Skip to main content
Version: Next

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

NameTypeDescription
abiAbirepresenting 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:44


felt

felt(it): string

Create felt Cairo type (cairo type helper)

Parameters

NameType
itBigNumberish

Returns

string

format: felt-string

Defined in

src/utils/calldata/cairo.ts:101


isLen

isLen(name): boolean

Parameters

NameType
namestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:7


isTypeFelt

isTypeFelt(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:8


isTypeArray

isTypeArray(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:9


isTypeTuple

isTypeTuple(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:13


isTypeNamedTuple

isTypeNamedTuple(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:14


isTypeStruct

isTypeStruct(type, structs): boolean

Parameters

NameType
typestring
structsAbiStructs

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:15


isTypeEnum

isTypeEnum(type, enums): boolean

Parameters

NameType
typestring
enumsAbiEnums

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:16


isTypeOption

isTypeOption(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:17


isTypeResult

isTypeResult(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:18


isTypeUint

isTypeUint(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:19


isTypeLitteral

isTypeLitteral(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:20


isTypeUint256

isTypeUint256(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:21


isTypeBool

isTypeBool(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:22


isTypeContractAddress

isTypeContractAddress(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:23


isTypeEthAddress

isTypeEthAddress(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:25


isCairo1Type

isCairo1Type(type): boolean

Parameters

NameType
typestring

Returns

boolean

Defined in

src/utils/calldata/cairo.ts:27


getArrayType

getArrayType(type): string

Parameters

NameType
typestring

Returns

string

Defined in

src/utils/calldata/cairo.ts:28


uint256

uint256(it): Uint256

Create Uint256 Cairo type (helper for common struct type)

Example

uint256('892349863487563453485768723498');

Parameters

NameType
itBigNumberish

Returns

Uint256

Defined in

src/utils/calldata/cairo.ts:75


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

NameType
...args(boolean | object | BigNumberish)[]

Returns

Record<number, boolean | object | BigNumberish>

Defined in

src/utils/calldata/cairo.ts:93