Skip to main content
Version: Next

Starknet.js API - v5.11.0

Namespaces

Enumerations

Classes

Interfaces

Type Aliases

WeierstrassSignatureType

Ƭ WeierstrassSignatureType: SignatureType

Defined in

src/types/lib/index.ts:7


ArraySignatureType

Ƭ ArraySignatureType: string[]

Defined in

src/types/lib/index.ts:8


Signature

Ƭ Signature: ArraySignatureType | WeierstrassSignatureType

Defined in

src/types/lib/index.ts:9


RawCalldata

Ƭ RawCalldata: BigNumberish[]

BigNumberish array use CallData.compile() to convert to Calldata

Defined in

src/types/lib/index.ts:15


HexCalldata

Ƭ HexCalldata: string[]

Hexadecimal-string array

Defined in

src/types/lib/index.ts:20


AllowArray

Ƭ AllowArray<T>: T | T[]

Type parameters

Name
T

Defined in

src/types/lib/index.ts:22


RawArgs

Ƭ RawArgs: RawArgsObject | RawArgsArray

Defined in

src/types/lib/index.ts:24


RawArgsObject

Ƭ RawArgsObject: Object

Index signature

[inputName: string]: MultiType | MultiType[] | RawArgs

Defined in

src/types/lib/index.ts:26


RawArgsArray

Ƭ RawArgsArray: (MultiType | MultiType[] | RawArgs)[]

Defined in

src/types/lib/index.ts:30


MultiType

Ƭ MultiType: BigNumberish | Uint256 | object | boolean

Defined in

src/types/lib/index.ts:32


UniversalDeployerContractPayload

Ƭ UniversalDeployerContractPayload: Object

Type declaration

NameType
classHashBigNumberish
salt?string
unique?boolean
constructorCalldata?RawArgs

Defined in

src/types/lib/index.ts:34


DeployContractPayload

Ƭ DeployContractPayload: Object

Deprecated

deprecated due to no direct deploy, unused - can be removed

Type declaration

NameType
contractCompiledContract | string
constructorCalldata?RawCalldata
addressSalt?string

Defined in

src/types/lib/index.ts:44


DeployAccountContractPayload

Ƭ DeployAccountContractPayload: Object

Type declaration

NameType
classHashstring
constructorCalldata?RawArgs
addressSalt?BigNumberish
contractAddress?string

Defined in

src/types/lib/index.ts:50


DeployAccountContractTransaction

Ƭ DeployAccountContractTransaction: Omit<DeployAccountContractPayload, "contractAddress"> & { signature?: Signature }

Defined in

src/types/lib/index.ts:57


DeclareContractPayload

Ƭ DeclareContractPayload: Object

Type declaration

NameType
contractCompiledContract | string
classHash?string
casm?CompiledSierraCasm
compiledClassHash?string

Defined in

src/types/lib/index.ts:64


CompleteDeclareContractPayload

Ƭ CompleteDeclareContractPayload: Object

Type declaration

NameType
contractCompiledContract | string
classHashstring
casm?CompiledSierraCasm
compiledClassHash?string

Defined in

src/types/lib/index.ts:71


DeclareAndDeployContractPayload

Ƭ DeclareAndDeployContractPayload: Omit<UniversalDeployerContractPayload, "classHash"> & DeclareContractPayload

Defined in

src/types/lib/index.ts:78


DeclareContractTransaction

Ƭ DeclareContractTransaction: Object

Type declaration

NameType
contractDefinitionContractClass
senderAddressstring
signature?Signature
compiledClassHash?string

Defined in

src/types/lib/index.ts:81


CallDetails

Ƭ CallDetails: Object

Type declaration

NameType
contractAddressstring
calldata?RawArgs

Defined in

src/types/lib/index.ts:88


Invocation

Ƭ Invocation: CallDetails & { signature?: Signature }

Defined in

src/types/lib/index.ts:93


Call

Ƭ Call: CallDetails & { entrypoint: string }

Defined in

src/types/lib/index.ts:95


CairoVersion

Ƭ CairoVersion: "0" | "1"

Defined in

src/types/lib/index.ts:97


InvocationsDetails

Ƭ InvocationsDetails: Object

Type declaration

NameType
nonce?BigNumberish
maxFee?BigNumberish
version?BigNumberish

Defined in

src/types/lib/index.ts:99


Details

Ƭ Details: Object

Contain all additional details params

Type declaration

NameType
nonceBigNumberish
maxFeeBigNumberish
versionBigNumberish
chainIdStarknetChainId

Defined in

src/types/lib/index.ts:108


InvocationsDetailsWithNonce

Ƭ InvocationsDetailsWithNonce: InvocationsDetails & { nonce: BigNumberish }

Defined in

src/types/lib/index.ts:115


TransactionBulk

Ƭ TransactionBulk: ({ type: "DECLARE" } & { payload: DeclareContractPayload } | { type: "DEPLOY" } & { payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[] } | { type: "DEPLOY_ACCOUNT" } & { payload: DeployAccountContractPayload } | { type: "INVOKE_FUNCTION" } & { payload: AllowArray<Call> })[]

Defined in

src/types/lib/index.ts:127


InvocationBulk

Ƭ InvocationBulk: { type: "DECLARE" } & DeclareContractTransaction | { type: "DEPLOY_ACCOUNT" } & DeployAccountContractTransaction | { type: "INVOKE_FUNCTION" } & Invocation & InvocationsDetailsWithNonce & { blockIdentifier: BlockNumber | BigNumberish }[]

Defined in

src/types/lib/index.ts:136


Status

Ƭ Status: "NOT_RECEIVED" | "RECEIVED" | "PENDING" | "ACCEPTED_ON_L2" | "ACCEPTED_ON_L1" | "REJECTED"

Defined in

src/types/lib/index.ts:145


Tupled

Ƭ Tupled: Object

Type declaration

NameType
elementany
typestring

Defined in

src/types/lib/index.ts:160


BlockTag

Ƭ BlockTag: "pending" | "latest"

Defined in

src/types/lib/index.ts:161


BlockNumber

Ƭ BlockNumber: BlockTag | null | number

Defined in

src/types/lib/index.ts:162


Struct

Ƭ Struct: Object

Index signature

[k: string]: BigNumberish

Type declaration

NameType
type"struct"

Defined in

src/types/lib/index.ts:164


Args

Ƭ Args: Object

Index signature

[inputName: string]: BigNumberish | BigNumberish[] | ParsedStruct | ParsedStruct[]

Defined in

src/types/lib/index.ts:168


ParsedStruct

Ƭ ParsedStruct: Object

Index signature

[key: string]: BigNumberish | ParsedStruct

Defined in

src/types/lib/index.ts:171


waitForTransactionOptions

Ƭ waitForTransactionOptions: Object

Type declaration

NameType
retryInterval?number
successStates?TransactionStatus[]

Defined in

src/types/lib/index.ts:175


ContractClass

Ƭ ContractClass: LegacyContractClass | SierraContractClass

Defined in

src/types/lib/contract/index.ts:5


CompiledContract

Ƭ CompiledContract: LegacyCompiledContract | CompiledSierra

Defined in

src/types/lib/contract/index.ts:6


CairoContract

Ƭ CairoContract: ContractClass | CompiledContract

Defined in

src/types/lib/contract/index.ts:7


Abi

Ƭ Abi: (FunctionAbi | EventAbi | StructAbi)[]

ABI

Defined in

src/types/lib/contract/abi.ts:2


AbiEntry

Ƭ AbiEntry: Object

Type declaration

NameType
namestring
type"felt" | "felt*" | string

Defined in

src/types/lib/contract/abi.ts:5


FunctionAbi

Ƭ FunctionAbi: Object

Type declaration

NameType
inputsAbiEntry[]
namestring
outputsAbiEntry[]
stateMutability?"view"
state_mutability?string
typeFunctionAbiType

Defined in

src/types/lib/contract/abi.ts:14


AbiStructs

Ƭ AbiStructs: Object

Index signature

[name: string]: StructAbi

Defined in

src/types/lib/contract/abi.ts:23


StructAbi

Ƭ StructAbi: Object

Type declaration

NameType
membersAbiEntry & { offset: number }[]
namestring
sizenumber
type"struct"

Defined in

src/types/lib/contract/abi.ts:25


LegacyContractClass

Ƭ LegacyContractClass: Object

LEGACY CONTRACT

Type declaration

NameType
programCompressedProgram
entry_points_by_typeEntryPointsByType
abiAbi

Defined in

src/types/lib/contract/legacy.ts:4


LegacyCompiledContract

Ƭ LegacyCompiledContract: Omit<LegacyContractClass, "program"> & { program: Program }

Defined in

src/types/lib/contract/legacy.ts:10


Builtins

Ƭ Builtins: string[]

SUBTYPES

Defined in

src/types/lib/contract/legacy.ts:15


CompressedProgram

Ƭ CompressedProgram: string

Defined in

src/types/lib/contract/legacy.ts:16


EntryPointsByType

Ƭ EntryPointsByType: Object

Type declaration

NameType
CONSTRUCTORContractEntryPointFields[]
EXTERNALContractEntryPointFields[]
L1_HANDLERContractEntryPointFields[]

Defined in

src/types/lib/contract/legacy.ts:18


ContractEntryPointFields

Ƭ ContractEntryPointFields: Object

Type declaration

NameType
selectorstring
offsetstring
builtins?Builtins

Defined in

src/types/lib/contract/legacy.ts:24


CairoAssembly

Ƭ CairoAssembly: Object

SYSTEM TYPES

Type declaration

NameType
primestring
compiler_versionstring
bytecodeByteCode
hintsany[]
pythonic_hintsPythonicHints
entry_points_by_typeEntryPointsByType

Defined in

src/types/lib/contract/sierra.ts:5


SierraContractClass

Ƭ SierraContractClass: Object

Type declaration

NameType
sierra_programByteCode
sierra_program_debug_infoSierraProgramDebugInfo
contract_class_versionstring
entry_points_by_typeSierraEntryPointsByType
abiAbi

Defined in

src/types/lib/contract/sierra.ts:14


CompiledSierra

Ƭ CompiledSierra: SierraContractClass

COMPILED CONTRACT

Defined in

src/types/lib/contract/sierra.ts:23


CompiledSierraCasm

Ƭ CompiledSierraCasm: CairoAssembly

Defined in

src/types/lib/contract/sierra.ts:24


ByteCode

Ƭ ByteCode: string[]

SUBTYPES

Defined in

src/types/lib/contract/sierra.ts:27


PythonicHints

Ƭ PythonicHints: [number, string[]][]

Defined in

src/types/lib/contract/sierra.ts:28


SierraProgramDebugInfo

Ƭ SierraProgramDebugInfo: Object

Type declaration

NameType
type_names[number, string][]
libfunc_names[number, string][]
user_func_names[number, string][]

Defined in

src/types/lib/contract/sierra.ts:30


SierraEntryPointsByType

Ƭ SierraEntryPointsByType: Object

Type declaration

NameType
CONSTRUCTORSierraContractEntryPointFields[]
EXTERNALSierraContractEntryPointFields[]
L1_HANDLERSierraContractEntryPointFields[]

Defined in

src/types/lib/contract/sierra.ts:36


SierraContractEntryPointFields

Ƭ SierraContractEntryPointFields: Object

Type declaration

NameType
selectorstring
function_idxnumber

Defined in

src/types/lib/contract/sierra.ts:42


DeployAccountSignerDetails

Ƭ DeployAccountSignerDetails: Required<DeployAccountContractPayload> & Required<InvocationsDetails> & { contractAddress: BigNumberish ; chainId: StarknetChainId }

Defined in

src/types/signer.ts:21


AsyncContractFunction

Ƭ AsyncContractFunction<T>: (...args: ArgsOrCalldataWithOptions) => Promise<T>

Type parameters

NameType
Tany

Type declaration

▸ (...args): Promise<T>

Parameters
NameType
...argsArgsOrCalldataWithOptions
Returns

Promise<T>

Defined in

src/types/contract.ts:5


ContractFunction

Ƭ ContractFunction: (...args: ArgsOrCalldataWithOptions) => any

Type declaration

▸ (...args): any

Parameters
NameType
...argsArgsOrCalldataWithOptions
Returns

any

Defined in

src/types/contract.ts:6


Result

Ƭ Result: { [key: string]: any; } | Result[] | bigint | string | boolean

Defined in

src/types/contract.ts:7


Calldata

Ƭ Calldata: string[] & { __compiled__?: boolean }

Compiled calldata ready to be sent decimal-string array

Defined in

src/types/contract.ts:20


ArgsOrCalldata

Ƭ ArgsOrCalldata: RawArgsArray | [Calldata] | Calldata

Defined in

src/types/contract.ts:22


ArgsOrCalldataWithOptions

Ƭ ArgsOrCalldataWithOptions: ArgsOrCalldata & ContractOptions

Defined in

src/types/contract.ts:23


ContractOptions

Ƭ ContractOptions: Object

Type declaration

NameType
blockIdentifier?BlockIdentifier
parseRequest?boolean
parseResponse?boolean
formatResponse?{ [key: string]: any; }
maxFee?BigNumberish
nonce?BigNumberish
signature?Signature
addressSalt?string

Defined in

src/types/contract.ts:24


CallOptions

Ƭ CallOptions: Pick<ContractOptions, "blockIdentifier" | "parseRequest" | "parseResponse" | "formatResponse">

Defined in

src/types/contract.ts:35


InvokeOptions

Ƭ InvokeOptions: Pick<ContractOptions, "maxFee" | "nonce" | "signature" | "parseRequest">

Defined in

src/types/contract.ts:40


EstimateFeeBulk

Ƭ EstimateFeeBulk: EstimateFee[]

Defined in

src/types/account.ts:13


MultiDeployContractResponse

Ƭ MultiDeployContractResponse: Object

Type declaration

NameType
contract_addressstring[]
transaction_hashstring

Defined in

src/types/account.ts:26


DeployContractUDCResponse

Ƭ DeployContractUDCResponse: Object

Type declaration

NameType
contract_addressstring
transaction_hashstring
addressstring
deployerstring
uniquestring
classHashstring
calldata_lenstring
calldatastring[]
saltstring

Defined in

src/types/account.ts:31


DeclareDeployUDCResponse

Ƭ DeclareDeployUDCResponse: Object

Type declaration

NameType
declare{ class_hash: BigNumberish } & Partial<DeclareTransactionReceiptResponse>
deployDeployContractUDCResponse

Defined in

src/types/account.ts:43


GetTransactionResponse

Ƭ GetTransactionResponse: InvokeTransactionResponse & DeclareTransactionResponse

Defined in

src/types/provider.ts:40


GetTransactionReceiptResponse

Ƭ GetTransactionReceiptResponse: InvokeTransactionReceiptResponse | DeclareTransactionReceiptResponse

Defined in

src/types/provider.ts:67


DeclareTransactionReceiptResponse

Ƭ DeclareTransactionReceiptResponse: CommonTransactionReceiptResponse

Defined in

src/types/provider.ts:101


CallContractResponse

Ƭ CallContractResponse: Object

Type declaration

NameType
resultstring[]

Defined in

src/types/provider.ts:119


EstimateFeeAction

Ƭ EstimateFeeAction: { type: INVOKE ; payload: AllowArray<Call> } | { type: DECLARE ; payload: DeclareContractPayload } | { type: DEPLOY_ACCOUNT ; payload: DeployAccountContractPayload } | { type: DEPLOY ; payload: UniversalDeployerContractPayload }

Defined in

src/types/provider.ts:123


EstimateFeeResponseBulk

Ƭ EstimateFeeResponseBulk: EstimateFeeResponse[]

Defined in

src/types/provider.ts:141


Storage

Ƭ Storage: Storage

Defined in

src/types/provider.ts:143


Nonce

Ƭ Nonce: Nonce

Defined in

src/types/provider.ts:145


GetTransactionStatusResponse

Ƭ GetTransactionStatusResponse: Object

Type declaration

NameType
tx_statusTransactionStatus
block_hash?string
tx_failure_reason?{ code: string ; error_message: string }
tx_failure_reason.codestring
tx_failure_reason.error_messagestring

Defined in

src/types/api/sequencer.ts:17


GetContractAddressesResponse

Ƭ GetContractAddressesResponse: Object

Type declaration

NameType
Starknetstring
GpsStatementVerifierstring

Defined in

src/types/api/sequencer.ts:26


FunctionInvocation

Ƭ FunctionInvocation: Object

Type declaration

NameType
caller_addressstring
contract_addressstring
calldataRawCalldata
call_type?string
class_hash?string
selector?string
entry_point_type?EXTERNAL
resultany[]
execution_resourcesExecutionResources
internal_callsFunctionInvocation[]
eventsany[]
messagesany[]

Defined in

src/types/api/sequencer.ts:31


ExecutionResources

Ƭ ExecutionResources: Object

Type declaration

NameType
n_stepsnumber
builtin_instance_counter{ pedersen_builtin: number ; range_check_builtin: number ; bitwise_builtin: number ; output_builtin: number ; ecdsa_builtin: number ; ec_op_builtin?: number }
builtin_instance_counter.pedersen_builtinnumber
builtin_instance_counter.range_check_builtinnumber
builtin_instance_counter.bitwise_builtinnumber
builtin_instance_counter.output_builtinnumber
builtin_instance_counter.ecdsa_builtinnumber
builtin_instance_counter.ec_op_builtin?number
n_memory_holesnumber

Defined in

src/types/api/sequencer.ts:46


TransactionTraceResponse

Ƭ TransactionTraceResponse: Object

Type declaration

NameType
validate_invocation?FunctionInvocation
function_invocation?FunctionInvocation
fee_transfer_invocation?FunctionInvocation
signaturestring[]

Defined in

src/types/api/sequencer.ts:59


CallL1Handler

Ƭ CallL1Handler: Object

Type declaration

NameType
from_addressstring
to_addressstring
entry_point_selectorstring
payloadstring[]

Defined in

src/types/api/sequencer.ts:66


DeployedContractItem

Ƭ DeployedContractItem: Object

Type declaration

NameType
addressstring
class_hashstring

Defined in

src/types/api/sequencer.ts:73


SequencerIdentifier

Ƭ SequencerIdentifier: { blockHash: string } | { blockNumber: BlockNumber }

Defined in

src/types/api/sequencer.ts:78


SequencerHttpMethod

Ƭ SequencerHttpMethod: "POST" | "GET"

Defined in

src/provider/sequencer.ts:56


SequencerProviderOptions

Ƭ SequencerProviderOptions: { headers?: Record<string, string> ; blockIdentifier?: BlockIdentifier } & { network: NetworkName | StarknetChainId ; chainId?: StarknetChainId } | { baseUrl: string ; feederGatewayUrl?: string ; gatewayUrl?: string ; chainId?: StarknetChainId }

Defined in

src/provider/sequencer.ts:58


RpcProviderOptions

Ƭ RpcProviderOptions: Object

Type declaration

NameType
nodeUrlstring
retries?number
headers?object
blockIdentifier?BlockIdentifier

Defined in

src/provider/rpc.ts:36

Variables

number

Const number: num = num

Deprecated

prefer the 'num' naming

Defined in

src/index.ts:37


defaultProvider

Const defaultProvider: Provider

Defined in

src/provider/index.ts:9

Functions

getCalldata

getCalldata(args, callback): Calldata

Parameters

NameType
argsArgsOrCalldata
callbackFunction

Returns

Calldata

Defined in

src/contract/default.ts:97


splitArgsAndOptions

splitArgsAndOptions(args): { args: ArgsOrCalldata ; options: ContractOptions } | { args: ArgsOrCalldata ; options?: undefined }

Parameters

NameType
argsArgsOrCalldataWithOptions

Returns

{ args: ArgsOrCalldata ; options: ContractOptions } | { args: ArgsOrCalldata ; options?: undefined }

Defined in

src/contract/default.ts:24


fixStack

fixStack(target, fn?): void

Parameters

NameTypeDefault value
targetErrorundefined
fnFunctiontarget.constructor

Returns

void

Defined in

src/provider/errors.ts:2


fixProto

fixProto(target, prototype): void

Parameters

NameType
targetError
prototypeObject

Returns

void

Defined in

src/provider/errors.ts:8


addAddressPadding

addAddressPadding(address): string

Parameters

NameType
addressBigNumberish

Returns

string

Defined in

src/utils/address.ts:9


validateAndParseAddress

validateAndParseAddress(address): string

Parameters

NameType
addressBigNumberish

Returns

string

Defined in

src/utils/address.ts:13


getChecksumAddress

getChecksumAddress(address): string

Parameters

NameType
addressBigNumberish

Returns

string

Defined in

src/utils/address.ts:26


validateChecksumAddress

validateChecksumAddress(address): boolean

Parameters

NameType
addressstring

Returns

boolean

Defined in

src/utils/address.ts:43


isUrl

isUrl(s?): boolean

Loosely validate a URL string.

Parameters

NameType
s?string

Returns

boolean

Defined in

src/utils/url.ts:22


buildUrl

buildUrl(baseUrl, defaultPath, urlOrPath?): string

Parameters

NameType
baseUrlstring
defaultPathstring
urlOrPath?string

Returns

string

Defined in

src/utils/url.ts:51