Namespace: cairo
Functions​
isCairo1Abi​
â–¸ isCairo1Abi(abi
): boolean
Test if an ABI comes from a Cairo 1 contract
Example
const isCairo1: boolean = isCairo1Abi(myAbi: Abi);
Parameters​
Name | Type | Description |
---|---|---|
abi | Abi | representing the interface of a Cairo contract |
Returns​
boolean
TRUE if it is an ABI from a Cairo1 contract
Defined in​
src/utils/calldata/cairo.ts:53
getAbiContractVersion​
â–¸ getAbiContractVersion(abi
): ContractVersion
Return ContractVersion (Abi version) based on Abi or undefined for unknown version
Parameters​
Name | Type |
---|---|
abi | Abi |
Returns​
string
Defined in​
src/utils/calldata/cairo.ts:67
felt​
â–¸ felt(it
): string
Create felt Cairo type (cairo type helper)
Parameters​
Name | Type |
---|---|
it | BigNumberish |
Returns​
string
format: felt-string
Defined in​
src/utils/calldata/cairo.ts:127
isLen​
â–¸ isLen(name
): boolean
Parameters​
Name | Type |
---|---|
name | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:16
isTypeFelt​
â–¸ isTypeFelt(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:17
isTypeArray​
â–¸ isTypeArray(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:18
isTypeTuple​
â–¸ isTypeTuple(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:22
isTypeNamedTuple​
â–¸ isTypeNamedTuple(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:23
isTypeStruct​
â–¸ isTypeStruct(type
, structs
): boolean
Parameters​
Name | Type |
---|---|
type | string |
structs | AbiStructs |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:24
isTypeEnum​
â–¸ isTypeEnum(type
, enums
): boolean
Parameters​
Name | Type |
---|---|
type | string |
enums | AbiEnums |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:25
isTypeOption​
â–¸ isTypeOption(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:26
isTypeResult​
â–¸ isTypeResult(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:27
isTypeUint​
â–¸ isTypeUint(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:28
isTypeLitteral​
â–¸ isTypeLitteral(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:29
isTypeUint256​
â–¸ isTypeUint256(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:30
isTypeBool​
â–¸ isTypeBool(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:31
isTypeContractAddress​
â–¸ isTypeContractAddress(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:32
isTypeEthAddress​
â–¸ isTypeEthAddress(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:34
isCairo1Type​
â–¸ isCairo1Type(type
): boolean
Parameters​
Name | Type |
---|---|
type | string |
Returns​
boolean
Defined in​
src/utils/calldata/cairo.ts:36
getArrayType​
â–¸ getArrayType(type
): string
Parameters​
Name | Type |
---|---|
type | string |
Returns​
string
Defined in​
src/utils/calldata/cairo.ts:37
uint256​
â–¸ uint256(it
): Uint256
Create Uint256 Cairo type (helper for common struct type)
Example
uint256('892349863487563453485768723498');
Parameters​
Name | Type |
---|---|
it | BigNumberish |
Returns​
Defined in​
src/utils/calldata/cairo.ts:101
tuple​
â–¸ tuple(...args
): Record
<number
, boolean
| object
| BigNumberish
>
Create unnamed tuple Cairo type (helper same as common struct type)
Example
tuple(1, '0x101', 16);
Parameters​
Name | Type |
---|---|
...args | (boolean | object | BigNumberish )[] |
Returns​
Record
<number
, boolean
| object
| BigNumberish
>