Starknet.js API - v5.19.5
Namespaces​
- types
- constants
- encode
- hash
- json
- num
- transaction
- stark
- merkle
- uint256
- shortString
- typedData
- ec
- starknetId
- provider
- selector
- events
- cairo
Enumerations​
Classes​
- Account
- AccountInterface
- Contract
- ContractInterface
- ContractFactory
- Provider
- CustomError
- LibraryError
- GatewayError
- HttpError
- SequencerProvider
- ProviderInterface
- RpcProvider
- SignerInterface
- Signer
- CallData
- CairoCustomEnum
- CairoOption
- CairoResult
References​
RPC​
Re-exports RPC
CallL1Handler​
Re-exports CallL1Handler
DeployedContractItem​
Re-exports DeployedContractItem
ExecutionResources​
Re-exports ExecutionResources
FunctionInvocation​
Re-exports FunctionInvocation
GetContractAddressesResponse​
Re-exports GetContractAddressesResponse
GetTransactionStatusResponse​
Re-exports GetTransactionStatusResponse
SequencerIdentifier​
Re-exports SequencerIdentifier
Sequencer​
Re-exports Sequencer
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
ValidateType​
Re-exports ValidateType
Uint​
Re-exports Uint
Litteral​
Re-exports Litteral
AsyncContractFunction​
Re-exports AsyncContractFunction
ContractFunction​
Re-exports ContractFunction
Result​
Re-exports Result
ArgsOrCalldata​
Re-exports ArgsOrCalldata
ArgsOrCalldataWithOptions​
Re-exports ArgsOrCalldataWithOptions
ContractOptions​
Re-exports ContractOptions
CallOptions​
Re-exports CallOptions
InvokeOptions​
Re-exports InvokeOptions
ParsedEvent​
Re-exports ParsedEvent
ParsedEvents​
Re-exports ParsedEvents
WeierstrassSignatureType​
Re-exports WeierstrassSignatureType
ArraySignatureType​
Re-exports ArraySignatureType
Signature​
Re-exports Signature
BigNumberish​
Re-exports BigNumberish
Calldata​
Re-exports Calldata
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
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
TransactionType​
Re-exports TransactionType
TransactionStatus​
Re-exports TransactionStatus
TransactionFinalityStatus​
Re-exports TransactionFinalityStatus
TransactionExecutionStatus​
Re-exports TransactionExecutionStatus
BlockStatus​
Re-exports BlockStatus
BlockTag​
Re-exports BlockTag
BlockNumber​
Re-exports BlockNumber
BlockIdentifier​
Re-exports BlockIdentifier
AccountInvocationItem​
Re-exports AccountInvocationItem
AccountInvocations​
Re-exports AccountInvocations
Invocations​
Re-exports Invocations
Tupled​
Re-exports Tupled
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
EventEntry​
Re-exports EventEntry
FunctionAbi​
Re-exports FunctionAbi
AbiStructs​
Re-exports AbiStructs
StructAbi​
Re-exports StructAbi
AbiEnums​
Re-exports AbiEnums
EnumAbi​
Re-exports EnumAbi
AbiEvents​
Re-exports AbiEvents
EventAbi​
Re-exports EventAbi
Cairo1Event​
Re-exports Cairo1Event
LegacyEvent​
Re-exports LegacyEvent
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
ContractEntryPoint​
Re-exports ContractEntryPoint
GetTransactionResponse​
Re-exports GetTransactionResponse
CommonTransactionResponse​
Re-exports CommonTransactionResponse
InvokeTransactionResponse​
Re-exports InvokeTransactionResponse
DeclareTransactionResponse​
Re-exports DeclareTransactionResponse
MessageToL1​
Re-exports MessageToL1
Event​
Re-exports Event
MessageToL2​
Re-exports MessageToL2
RejectedTransactionResponse​
Re-exports RejectedTransactionResponse
GetTransactionReceiptResponse​
Re-exports GetTransactionReceiptResponse
SuccessfulTransactionReceiptResponse​
Re-exports SuccessfulTransactionReceiptResponse
InvokeTransactionReceiptResponse​
Re-exports InvokeTransactionReceiptResponse
DeclareTransactionReceiptResponse​
Re-exports DeclareTransactionReceiptResponse
DeployTransactionReceiptResponse​
Re-exports DeployTransactionReceiptResponse
RejectedTransactionReceiptResponse​
Re-exports RejectedTransactionReceiptResponse
RevertedTransactionReceiptResponse​
Re-exports RevertedTransactionReceiptResponse
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
CairoEnum​
Re-exports CairoEnum
Type Aliases​
TypedContract​
Ƭ TypedContract<TAbi
>: AbiWanTypedContract
<TAbi
> & ContractInterface
Type parameters​
Name | Type |
---|---|
TAbi | extends AbiKanabi |
Defined in​
ContractFactoryParams​
Ƭ ContractFactoryParams: Object
Type declaration​
Name | Type |
---|---|
compiledContract | CompiledContract |
account | any |
casm? | CairoAssembly |
classHash? | string |
compiledClassHash? | string |
abi? | Abi |
Defined in​
src/contract/contractFactory.ts:13
CairoEnumRaw​
Ƭ CairoEnumRaw: Object
Index signature​
â–ª [key: string
]: any
Defined in​
src/utils/calldata/enum/CairoCustomEnum.ts:1
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 adsition of UDC Event data
Parameters​
Name | Type |
---|---|
txReceipt | InvokeTransactionReceiptResponse |
Returns​
Object
DeployContractResponse | UDC Event Response data
Name | Type |
---|---|
transaction_hash | string |
contract_address | any |
address | any |
deployer | any |
unique | any |
classHash | any |
calldata_len | any |
calldata | any |
salt | any |