Starknet.js API - v5.14.1
Namespaces​
- types
- constants
- encode
- hash
- json
- num
- transaction
- stark
- merkle
- uint256
- shortString
- typedData
- ec
- starknetId
- provider
- selector
- cairo
Classes​
- Account
- AccountInterface
- Contract
- ContractInterface
- ContractFactory
- Provider
- CustomError
- LibraryError
- GatewayError
- HttpError
- SequencerProvider
- ProviderInterface
- RpcProvider
- SignerInterface
- Signer
- CallData
References​
EstimateFee​
Re-exports EstimateFee
EstimateFeeBulk​
Re-exports EstimateFeeBulk
AccountInvocationsFactoryDetails​
Re-exports AccountInvocationsFactoryDetails
EstimateFeeDetails​
Re-exports EstimateFeeDetails
DeployContractResponse​
Re-exports DeployContractResponse
MultiDeployContractResponse​
Re-exports MultiDeployContractResponse
DeployContractUDCResponse​
Re-exports DeployContractUDCResponse
DeclareDeployUDCResponse​
Re-exports DeclareDeployUDCResponse
SimulateTransactionDetails​
Re-exports SimulateTransactionDetails
SIMULATION_FLAG​
Re-exports SIMULATION_FLAG
AsyncContractFunction​
Re-exports AsyncContractFunction
ContractFunction​
Re-exports ContractFunction
Result​
Re-exports Result
Calldata​
Re-exports Calldata
ArgsOrCalldata​
Re-exports ArgsOrCalldata
ArgsOrCalldataWithOptions​
Re-exports ArgsOrCalldataWithOptions
ContractOptions​
Re-exports ContractOptions
CallOptions​
Re-exports CallOptions
InvokeOptions​
Re-exports InvokeOptions
WeierstrassSignatureType​
Re-exports WeierstrassSignatureType
ArraySignatureType​
Re-exports ArraySignatureType
Signature​
Re-exports Signature
BigNumberish​
Re-exports BigNumberish
Uint256​
Re-exports Uint256
RawCalldata​
Re-exports RawCalldata
HexCalldata​
Re-exports HexCalldata
AllowArray​
Re-exports AllowArray
OptionalPayload​
Re-exports OptionalPayload
RawArgs​
Re-exports RawArgs
RawArgsObject​
Re-exports RawArgsObject
RawArgsArray​
Re-exports RawArgsArray
MultiType​
Re-exports MultiType
UniversalDeployerContractPayload​
Re-exports UniversalDeployerContractPayload
DeployContractPayload​
Re-exports DeployContractPayload
DeployAccountContractPayload​
Re-exports DeployAccountContractPayload
DeployAccountContractTransaction​
Re-exports DeployAccountContractTransaction
DeclareContractPayload​
Re-exports DeclareContractPayload
CompleteDeclareContractPayload​
Re-exports CompleteDeclareContractPayload
DeclareAndDeployContractPayload​
Re-exports DeclareAndDeployContractPayload
DeclareContractTransaction​
Re-exports DeclareContractTransaction
CallDetails​
Re-exports CallDetails
Invocation​
Re-exports Invocation
Call​
Re-exports Call
CairoVersion​
Re-exports CairoVersion
InvocationsDetails​
Re-exports InvocationsDetails
Details​
Re-exports Details
InvocationsDetailsWithNonce​
Re-exports InvocationsDetailsWithNonce
TransactionStatus​
Re-exports TransactionStatus
AccountInvocationItem​
Re-exports AccountInvocationItem
AccountInvocations​
Re-exports AccountInvocations
Invocations​
Re-exports Invocations
Status​
Re-exports Status
TransactionType​
Re-exports TransactionType
Tupled​
Re-exports Tupled
BlockTag​
Re-exports BlockTag
BlockNumber​
Re-exports BlockNumber
BlockIdentifier​
Re-exports BlockIdentifier
Struct​
Re-exports Struct
Args​
Re-exports Args
ParsedStruct​
Re-exports ParsedStruct
waitForTransactionOptions​
Re-exports waitForTransactionOptions
getSimulateTransactionOptions​
Re-exports getSimulateTransactionOptions
getEstimateFeeBulkOptions​
Re-exports getEstimateFeeBulkOptions
CallStruct​
Re-exports CallStruct
ContractClass​
Re-exports ContractClass
CompiledContract​
Re-exports CompiledContract
CairoContract​
Re-exports CairoContract
EntryPointType​
Re-exports EntryPointType
Abi​
Re-exports Abi
AbiEntry​
Re-exports AbiEntry
FunctionAbi​
Re-exports FunctionAbi
AbiStructs​
Re-exports AbiStructs
StructAbi​
Re-exports StructAbi
LegacyContractClass​
Re-exports LegacyContractClass
LegacyCompiledContract​
Re-exports LegacyCompiledContract
Builtins​
Re-exports Builtins
CompressedProgram​
Re-exports CompressedProgram
EntryPointsByType​
Re-exports EntryPointsByType
ContractEntryPointFields​
Re-exports ContractEntryPointFields
Program​
Re-exports Program
CairoAssembly​
Re-exports CairoAssembly
CompiledSierra​
Re-exports CompiledSierra
SierraContractClass​
Re-exports SierraContractClass
CompiledSierraCasm​
Re-exports CompiledSierraCasm
ByteCode​
Re-exports ByteCode
PythonicHints​
Re-exports PythonicHints
SierraProgramDebugInfo​
Re-exports SierraProgramDebugInfo
SierraEntryPointsByType​
Re-exports SierraEntryPointsByType
SierraContractEntryPointFields​
Re-exports SierraContractEntryPointFields
ProviderOptions​
Re-exports ProviderOptions
RpcProviderOptions​
Re-exports RpcProviderOptions
SequencerHttpMethod​
Re-exports SequencerHttpMethod
SequencerProviderOptions​
Re-exports SequencerProviderOptions
GetBlockResponse​
Re-exports GetBlockResponse
GetCodeResponse​
Re-exports GetCodeResponse
GetTransactionResponse​
Re-exports GetTransactionResponse
CommonTransactionResponse​
Re-exports CommonTransactionResponse
InvokeTransactionResponse​
Re-exports InvokeTransactionResponse
ContractEntryPoint​
Re-exports ContractEntryPoint
DeclareTransactionResponse​
Re-exports DeclareTransactionResponse
GetTransactionReceiptResponse​
Re-exports GetTransactionReceiptResponse
CommonTransactionReceiptResponse​
Re-exports CommonTransactionReceiptResponse
MessageToL1​
Re-exports MessageToL1
Event​
Re-exports Event
MessageToL2​
Re-exports MessageToL2
InvokeTransactionReceiptResponse​
Re-exports InvokeTransactionReceiptResponse
DeclareTransactionReceiptResponse​
Re-exports DeclareTransactionReceiptResponse
EstimateFeeResponse​
Re-exports EstimateFeeResponse
InvokeFunctionResponse​
Re-exports InvokeFunctionResponse
DeclareContractResponse​
Re-exports DeclareContractResponse
CallContractResponse​
Re-exports CallContractResponse
EstimateFeeAction​
Re-exports EstimateFeeAction
EstimateFeeResponseBulk​
Re-exports EstimateFeeResponseBulk
Storage​
Re-exports Storage
Nonce​
Re-exports Nonce
SimulationFlags​
Re-exports SimulationFlags
SimulatedTransaction​
Re-exports SimulatedTransaction
SimulateTransactionResponse​
Re-exports SimulateTransactionResponse
StateUpdateResponse​
Re-exports StateUpdateResponse
ContractClassResponse​
Re-exports ContractClassResponse
InvocationsSignerDetails​
Re-exports InvocationsSignerDetails
DeclareSignerDetails​
Re-exports DeclareSignerDetails
DeployAccountSignerDetails​
Re-exports DeployAccountSignerDetails
StarkNetMerkleType​
Re-exports StarkNetMerkleType
StarkNetType​
Re-exports StarkNetType
StarkNetDomain​
Re-exports StarkNetDomain
TypedData​
Re-exports TypedData
GetTransactionStatusResponse​
Re-exports GetTransactionStatusResponse
GetContractAddressesResponse​
Re-exports GetContractAddressesResponse
FunctionInvocation​
Re-exports FunctionInvocation
ExecutionResources​
Re-exports ExecutionResources
CallL1Handler​
Re-exports CallL1Handler
DeployedContractItem​
Re-exports DeployedContractItem
SequencerIdentifier​
Re-exports SequencerIdentifier
Sequencer​
Re-exports Sequencer
RPC​
Re-exports RPC
Variables​
number​
• Const
number: num
= num
Deprecated
prefer the 'num' naming
Defined in​
defaultProvider​
• Const
defaultProvider: Provider
Defined in​
Functions​
getCalldata​
â–¸ getCalldata(args
, callback
): Calldata
Parameters​
Name | Type |
---|---|
args | RawArgs |
callback | Function |
Returns​
Defined in​
splitArgsAndOptions​
â–¸ splitArgsAndOptions(args
): { args
: ArgsOrCalldata
; options
: ContractOptions
} | { args
: ArgsOrCalldata
; options?
: undefined
}
Parameters​
Name | Type |
---|---|
args | ArgsOrCalldataWithOptions |
Returns​
{ args
: ArgsOrCalldata
; options
: ContractOptions
} | { args
: ArgsOrCalldata
; options?
: undefined
}
Defined in​
fixStack​
â–¸ fixStack(target
, fn?
): void
Parameters​
Name | Type | Default value |
---|---|---|
target | Error | undefined |
fn | Function | target.constructor |
Returns​
void
Defined in​
fixProto​
â–¸ fixProto(target
, prototype
): void
Parameters​
Name | Type |
---|---|
target | Error |
prototype | Object |
Returns​
void
Defined in​
addAddressPadding​
â–¸ addAddressPadding(address
): string
Parameters​
Name | Type |
---|---|
address | BigNumberish |
Returns​
string
Defined in​
validateAndParseAddress​
â–¸ validateAndParseAddress(address
): string
Parameters​
Name | Type |
---|---|
address | BigNumberish |
Returns​
string
Defined in​
getChecksumAddress​
â–¸ getChecksumAddress(address
): string
Parameters​
Name | Type |
---|---|
address | BigNumberish |
Returns​
string
Defined in​
validateChecksumAddress​
â–¸ validateChecksumAddress(address
): boolean
Parameters​
Name | Type |
---|---|
address | string |
Returns​
boolean
Defined in​
isUrl​
â–¸ isUrl(s?
): boolean
Loosely validate a URL string
.
Parameters​
Name | Type |
---|---|
s? | string |
Returns​
boolean
Defined in​
buildUrl​
â–¸ buildUrl(baseUrl
, defaultPath
, urlOrPath?
): string
Parameters​
Name | Type |
---|---|
baseUrl | string |
defaultPath | string |
urlOrPath? | string |
Returns​
string
Defined in​
isSierra​
â–¸ isSierra(contract
): contract is CompiledSierra | SierraContractClass
Parameters​
Name | Type |
---|---|
contract | string | CairoContract |
Returns​
contract is CompiledSierra | SierraContractClass
Defined in​
extractContractHashes​
â–¸ extractContractHashes(payload
): CompleteDeclareContractPayload
Parameters​
Name | Type |
---|---|
payload | DeclareContractPayload |
Returns​
CompleteDeclareContractPayload
Defined in​
contractClassResponseToLegacyCompiledContract​
â–¸ contractClassResponseToLegacyCompiledContract(ccr
): LegacyCompiledContract
Helper to redeclare response Cairo0 contract
Parameters​
Name | Type | Description |
---|---|---|
ccr | ContractClassResponse | ContractClassResponse |
Returns​
LegacyCompiledContract
Defined in​
parseUDCEvent​
â–¸ parseUDCEvent(txReceipt
): Object
Parse Transaction Receipt Event from UDC invoke transaction and create DeployContractResponse compatible response with addition of UDC Event data
Parameters​
Name | Type |
---|---|
txReceipt | InvokeTransactionReceiptResponse |
Returns​
Object
DeployContractResponse | UDC Event Response data
Name | Type |
---|---|
transaction_hash | string |
contract_address | string |
address | string |
deployer | string |
unique | string |
classHash | string |
calldata_len | string |
calldata | string [] |
salt | string |