Skip to main content
Version: Next

Class: Provider

Hierarchy​

  • RpcProvider<this> & StarknetId<this>

    ↳ Provider

    ↳↳ Account

Constructors​

constructor​

• new Provider(optionsOrProvider?): Provider

Parameters​

NameType
optionsOrProvider?RpcProviderOptions | ProviderInterface | RpcProvider

Returns​

Provider

Inherited from​

Mixin(BaseRpcProvider, StarknetId).constructor

Defined in​

src/provider/rpc.ts:55

• new Provider(): Provider

Returns​

Provider

Inherited from​

Mixin(BaseRpcProvider, StarknetId).constructor

Properties​

responseParser​

• responseParser: RPCResponseParser

Inherited from​

Mixin(BaseRpcProvider, StarknetId).responseParser

Defined in​

src/provider/rpc.ts:51


channel​

• channel: RpcChannel | RpcChannel

Inherited from​

Mixin(BaseRpcProvider, StarknetId).channel

Defined in​

src/provider/rpc.ts:53


getStateUpdate​

• getStateUpdate: () => Promise<{ block_hash: never ; old_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>(blockIdentifier: "pending") => Promise<{ block_hash: never ; old_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>(blockIdentifier: "latest") => Promise<{ block_hash: string ; old_root: string ; new_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>(blockIdentifier?: BlockIdentifier) => Promise<StateUpdateResponse>

Type declaration​

â–¸ (): Promise<{ block_hash: never ; old_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>

Returns​

Promise<{ block_hash: never ; old_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>

â–¸ (blockIdentifier): Promise<{ block_hash: never ; old_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>

Parameters​
NameType
blockIdentifier"pending"
Returns​

Promise<{ block_hash: never ; old_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>

â–¸ (blockIdentifier): Promise<{ block_hash: string ; old_root: string ; new_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>

Parameters​
NameType
blockIdentifier"latest"
Returns​

Promise<{ block_hash: string ; old_root: string ; new_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>

â–¸ (blockIdentifier?): Promise<StateUpdateResponse>

Parameters​
NameType
blockIdentifier?BlockIdentifier
Returns​

Promise<StateUpdateResponse>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getStateUpdate

Defined in​

src/provider/rpc.ts:191

Methods​

getStarkName​

â–¸ getStarkName(provider, address, StarknetIdContract?): Promise<string>

Parameters​

NameType
providerProviderInterface
addressBigNumberish
StarknetIdContract?string

Returns​

Promise<string>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getStarkName

Defined in​

src/provider/extensions/starknetId.ts:61


getAddressFromStarkName​

â–¸ getAddressFromStarkName(provider, name, StarknetIdContract?): Promise<string>

Parameters​

NameType
providerProviderInterface
namestring
StarknetIdContract?string

Returns​

Promise<string>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getAddressFromStarkName

Defined in​

src/provider/extensions/starknetId.ts:95


getStarkProfile​

â–¸ getStarkProfile(provider, address, StarknetIdContract?, StarknetIdIdentityContract?, StarknetIdVerifierContract?, StarknetIdPfpContract?, StarknetIdPopContract?, StarknetIdMulticallContract?): Promise<StarkProfile>

Parameters​

NameType
providerProviderInterface
addressBigNumberish
StarknetIdContract?string
StarknetIdIdentityContract?string
StarknetIdVerifierContract?string
StarknetIdPfpContract?string
StarknetIdPopContract?string
StarknetIdMulticallContract?string

Returns​

Promise<StarkProfile>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getStarkProfile

Defined in​

src/provider/extensions/starknetId.ts:121


fetch​

â–¸ fetch(method, params?, id?): Promise<Response>

Parameters​

NameTypeDefault value
methodstringundefined
params?objectundefined
idstring | number0

Returns​

Promise<Response>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).fetch

Defined in​

src/provider/rpc.ts:68


getChainId​

â–¸ getChainId(): Promise<StarknetChainId>

Returns​

Promise<StarknetChainId>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getChainId

Defined in​

src/provider/rpc.ts:72


getSpecVersion​

â–¸ getSpecVersion(): Promise<string>

Returns​

Promise<string>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getSpecVersion

Defined in​

src/provider/rpc.ts:76


getNonceForAddress​

â–¸ getNonceForAddress(contractAddress, blockIdentifier?): Promise<string>

Parameters​

NameType
contractAddressBigNumberish
blockIdentifier?BlockIdentifier

Returns​

Promise<string>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getNonceForAddress

Defined in​

src/provider/rpc.ts:80


getBlock​

â–¸ getBlock(): Promise<PendingBlock>

Returns​

Promise<PendingBlock>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlock

Defined in​

src/provider/rpc.ts:87

â–¸ getBlock(blockIdentifier): Promise<PendingBlock>

Parameters​

NameType
blockIdentifier"pending"

Returns​

Promise<PendingBlock>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlock

Defined in​

src/provider/rpc.ts:88

â–¸ getBlock(blockIdentifier): Promise<Block>

Parameters​

NameType
blockIdentifier"latest"

Returns​

Promise<Block>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlock

Defined in​

src/provider/rpc.ts:89

â–¸ getBlock(blockIdentifier?): Promise<GetBlockResponse>

Parameters​

NameType
blockIdentifier?BlockIdentifier

Returns​

Promise<GetBlockResponse>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlock

Defined in​

src/provider/rpc.ts:90


getBlockLatestAccepted​

â–¸ getBlockLatestAccepted(): Promise<BlockHashAndNumber>

Get the most recent accepted block hash and number

Returns​

Promise<BlockHashAndNumber>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlockLatestAccepted

Defined in​

src/provider/rpc.ts:100


getBlockNumber​

â–¸ getBlockNumber(): Promise<number>

Get the most recent accepted block number redundant use getBlockLatestAccepted();

Returns​

Promise<number>

Number of the latest block

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlockNumber

Defined in​

src/provider/rpc.ts:109


getBlockWithTxHashes​

â–¸ getBlockWithTxHashes(blockIdentifier?): Promise<BlockWithTxHashes>

Parameters​

NameType
blockIdentifier?BlockIdentifier

Returns​

Promise<BlockWithTxHashes>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlockWithTxHashes

Defined in​

src/provider/rpc.ts:113


getBlockWithTxs​

â–¸ getBlockWithTxs(blockIdentifier?): Promise<BlockWithTxs>

Parameters​

NameType
blockIdentifier?BlockIdentifier

Returns​

Promise<BlockWithTxs>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlockWithTxs

Defined in​

src/provider/rpc.ts:117


waitForBlock​

â–¸ waitForBlock(blockIdentifier?, retryInterval?): Promise<void>

Pause the execution of the script until a specified block is created.

Parameters​

NameTypeDefault valueDescription
blockIdentifierBlockIdentifier'pending'bloc number (BigNumberish) or 'pending' or 'latest'. Use of 'latest" or of a block already created will generate no pause.
retryInterval?number5000number of milliseconds between 2 requests to the node

Returns​

Promise<void>

Example

await myProvider.waitForBlock();
// wait the creation of the pending block

Inherited from​

Mixin(BaseRpcProvider, StarknetId).waitForBlock

Defined in​

src/provider/rpc.ts:132


getL1GasPrice​

â–¸ getL1GasPrice(blockIdentifier?): Promise<string>

Parameters​

NameType
blockIdentifier?BlockIdentifier

Returns​

Promise<string>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getL1GasPrice

Defined in​

src/provider/rpc.ts:162


getL1MessageHash​

â–¸ getL1MessageHash(l2TxHash): Promise<string>

Parameters​

NameType
l2TxHashBigNumberish

Returns​

Promise<string>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getL1MessageHash

Defined in​

src/provider/rpc.ts:168


getBlockWithReceipts​

â–¸ getBlockWithReceipts(blockIdentifier?): Promise<BlockWithTxReceipts>

Parameters​

NameType
blockIdentifier?BlockIdentifier

Returns​

Promise<BlockWithTxReceipts>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlockWithReceipts

Defined in​

src/provider/rpc.ts:184


getBlockStateUpdate​

â–¸ getBlockStateUpdate(): Promise<{ block_hash: never ; old_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>

Returns​

Promise<{ block_hash: never ; old_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlockStateUpdate

Defined in​

src/provider/rpc.ts:193

â–¸ getBlockStateUpdate(blockIdentifier): Promise<{ block_hash: never ; old_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>

Parameters​

NameType
blockIdentifier"pending"

Returns​

Promise<{ block_hash: never ; old_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlockStateUpdate

Defined in​

src/provider/rpc.ts:194

â–¸ getBlockStateUpdate(blockIdentifier): Promise<{ block_hash: string ; old_root: string ; new_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>

Parameters​

NameType
blockIdentifier"latest"

Returns​

Promise<{ block_hash: string ; old_root: string ; new_root: string ; state_diff: { storage_diffs: { address: string; storage_entries: { key: string; value: string; }[]; }[]; deprecated_declared_classes: string[]; declared_classes: { class_hash: string; compiled_class_hash: string; }[]; deployed_contracts: { ...; }[]; replaced_classes: { ...; }[]; nonces: { ...; }[]; } }>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlockStateUpdate

Defined in​

src/provider/rpc.ts:195

â–¸ getBlockStateUpdate(blockIdentifier?): Promise<StateUpdateResponse>

Parameters​

NameType
blockIdentifier?BlockIdentifier

Returns​

Promise<StateUpdateResponse>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlockStateUpdate

Defined in​

src/provider/rpc.ts:196


getBlockTransactionsTraces​

â–¸ getBlockTransactionsTraces(blockIdentifier?): Promise<BlockTransactionsTraces>

Parameters​

NameType
blockIdentifier?BlockIdentifier

Returns​

Promise<BlockTransactionsTraces>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlockTransactionsTraces

Defined in​

src/provider/rpc.ts:201


getBlockTransactionCount​

â–¸ getBlockTransactionCount(blockIdentifier?): Promise<number>

Parameters​

NameType
blockIdentifier?BlockIdentifier

Returns​

Promise<number>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getBlockTransactionCount

Defined in​

src/provider/rpc.ts:205


getPendingTransactions​

â–¸ getPendingTransactions(): Promise<TransactionWithHash[]>

Return transactions from pending block

Returns​

Promise<TransactionWithHash[]>

Deprecated

Instead use getBlock(BlockTag.PENDING); (will be removed in next minor version) Utility method, same result can be achieved using getBlockWithTxHashes(BlockTag.pending);

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getPendingTransactions

Defined in​

src/provider/rpc.ts:214


getTransaction​

â–¸ getTransaction(txHash): Promise<TransactionWithHash>

Parameters​

NameType
txHashBigNumberish

Returns​

Promise<TransactionWithHash>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getTransaction

Defined in​

src/provider/rpc.ts:221


getTransactionByHash​

â–¸ getTransactionByHash(txHash): Promise<TransactionWithHash>

Parameters​

NameType
txHashBigNumberish

Returns​

Promise<TransactionWithHash>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getTransactionByHash

Defined in​

src/provider/rpc.ts:225


getTransactionByBlockIdAndIndex​

â–¸ getTransactionByBlockIdAndIndex(blockIdentifier, index): Promise<TransactionWithHash>

Parameters​

NameType
blockIdentifierBlockIdentifier
indexnumber

Returns​

Promise<TransactionWithHash>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getTransactionByBlockIdAndIndex

Defined in​

src/provider/rpc.ts:229


getTransactionReceipt​

â–¸ getTransactionReceipt(txHash): Promise<GetTransactionReceiptResponse>

Parameters​

NameType
txHashBigNumberish

Returns​

Promise<GetTransactionReceiptResponse>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getTransactionReceipt

Defined in​

src/provider/rpc.ts:233


getTransactionTrace​

â–¸ getTransactionTrace(txHash): Promise<TRANSACTION_TRACE>

Parameters​

NameType
txHashBigNumberish

Returns​

Promise<TRANSACTION_TRACE>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getTransactionTrace

Defined in​

src/provider/rpc.ts:240


getTransactionStatus​

â–¸ getTransactionStatus(transactionHash): Promise<TransactionStatus>

Get the status of a transaction

Parameters​

NameType
transactionHashBigNumberish

Returns​

Promise<TransactionStatus>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getTransactionStatus

Defined in​

src/provider/rpc.ts:247


getSimulateTransaction​

â–¸ getSimulateTransaction(invocations, options?): Promise<SimulateTransactionResponse>

Parameters​

NameTypeDescription
invocationsAccountInvocationsAccountInvocations
options?getSimulateTransactionOptionsblockIdentifier and flags to skip validation and fee charge
- blockIdentifier
- skipValidate (default false)
- skipFeeCharge (default true)

Returns​

Promise<SimulateTransactionResponse>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getSimulateTransaction

Defined in​

src/provider/rpc.ts:258


waitForTransaction​

â–¸ waitForTransaction(txHash, options?): Promise<GetTransactionReceiptResponse>

Parameters​

NameType
txHashBigNumberish
options?waitForTransactionOptions

Returns​

Promise<GetTransactionReceiptResponse>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).waitForTransaction

Defined in​

src/provider/rpc.ts:268


getStorageAt​

â–¸ getStorageAt(contractAddress, key, blockIdentifier?): Promise<string>

Parameters​

NameType
contractAddressBigNumberish
keyBigNumberish
blockIdentifier?BlockIdentifier

Returns​

Promise<string>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getStorageAt

Defined in​

src/provider/rpc.ts:280


getClassHashAt​

â–¸ getClassHashAt(contractAddress, blockIdentifier?): Promise<string>

Parameters​

NameType
contractAddressBigNumberish
blockIdentifier?BlockIdentifier

Returns​

Promise<string>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getClassHashAt

Defined in​

src/provider/rpc.ts:288


getClassByHash​

â–¸ getClassByHash(classHash): Promise<LegacyContractClass | Omit<CompiledSierra, "sierra_program_debug_info">>

Parameters​

NameType
classHashBigNumberish

Returns​

Promise<LegacyContractClass | Omit<CompiledSierra, "sierra_program_debug_info">>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getClassByHash

Defined in​

src/provider/rpc.ts:292


getClass​

â–¸ getClass(classHash, blockIdentifier?): Promise<LegacyContractClass | Omit<CompiledSierra, "sierra_program_debug_info">>

Parameters​

NameType
classHashBigNumberish
blockIdentifier?BlockIdentifier

Returns​

Promise<LegacyContractClass | Omit<CompiledSierra, "sierra_program_debug_info">>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getClass

Defined in​

src/provider/rpc.ts:296


getClassAt​

â–¸ getClassAt(contractAddress, blockIdentifier?): Promise<LegacyContractClass | Omit<CompiledSierra, "sierra_program_debug_info">>

Parameters​

NameType
contractAddressBigNumberish
blockIdentifier?BlockIdentifier

Returns​

Promise<LegacyContractClass | Omit<CompiledSierra, "sierra_program_debug_info">>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getClassAt

Defined in​

src/provider/rpc.ts:302


getContractVersion​

â–¸ getContractVersion(contractAddress, classHash?, options?): Promise<ContractVersion>

Parameters​

NameType
contractAddressBigNumberish
classHash?undefined
options?getContractVersionOptions

Returns​

Promise<ContractVersion>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getContractVersion

Defined in​

src/provider/rpc.ts:308

â–¸ getContractVersion(contractAddress, classHash, options?): Promise<ContractVersion>

Parameters​

NameType
contractAddressundefined
classHashBigNumberish
options?getContractVersionOptions

Returns​

Promise<ContractVersion>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getContractVersion

Defined in​

src/provider/rpc.ts:313


getEstimateFee​

â–¸ getEstimateFee(invocation, invocationDetails, blockIdentifier?, skipValidate?): Promise<EstimateFeeResponse>

Parameters​

NameType
invocationInvocation
invocationDetailsInvocationsDetailsWithNonce
blockIdentifier?BlockIdentifier
skipValidate?boolean

Returns​

Promise<EstimateFeeResponse>

Deprecated

use gettypeEstimateFee (will be refactored based on type after sequencer deprecation)

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getEstimateFee

Defined in​

src/provider/rpc.ts:349


getInvokeEstimateFee​

â–¸ getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier?, skipValidate?): Promise<EstimateFeeResponse>

Parameters​

NameType
invocationInvocation
invocationDetailsInvocationsDetailsWithNonce
blockIdentifier?BlockIdentifier
skipValidate?boolean

Returns​

Promise<EstimateFeeResponse>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getInvokeEstimateFee

Defined in​

src/provider/rpc.ts:358


getDeclareEstimateFee​

â–¸ getDeclareEstimateFee(invocation, details, blockIdentifier?, skipValidate?): Promise<EstimateFeeResponse>

Parameters​

NameType
invocationDeclareContractTransaction
detailsInvocationsDetailsWithNonce
blockIdentifier?BlockIdentifier
skipValidate?boolean

Returns​

Promise<EstimateFeeResponse>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getDeclareEstimateFee

Defined in​

src/provider/rpc.ts:378


getDeployAccountEstimateFee​

â–¸ getDeployAccountEstimateFee(invocation, details, blockIdentifier?, skipValidate?): Promise<EstimateFeeResponse>

Parameters​

NameType
invocationDeployAccountContractTransaction
detailsInvocationsDetailsWithNonce
blockIdentifier?BlockIdentifier
skipValidate?boolean

Returns​

Promise<EstimateFeeResponse>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getDeployAccountEstimateFee

Defined in​

src/provider/rpc.ts:398


getEstimateFeeBulk​

â–¸ getEstimateFeeBulk(invocations, options): Promise<EstimateFeeResponseBulk>

Parameters​

NameType
invocationsAccountInvocations
optionsgetEstimateFeeBulkOptions

Returns​

Promise<EstimateFeeResponseBulk>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getEstimateFeeBulk

Defined in​

src/provider/rpc.ts:418


invokeFunction​

â–¸ invokeFunction(functionInvocation, details): Promise<InvokedTransaction>

Parameters​

NameType
functionInvocationInvocation
detailsInvocationsDetailsWithNonce

Returns​

Promise<InvokedTransaction>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).invokeFunction

Defined in​

src/provider/rpc.ts:427


declareContract​

â–¸ declareContract(transaction, details): Promise<DeclaredTransaction>

Parameters​

NameType
transactionDeclareContractTransaction
detailsInvocationsDetailsWithNonce

Returns​

Promise<DeclaredTransaction>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).declareContract

Defined in​

src/provider/rpc.ts:434


deployAccountContract​

â–¸ deployAccountContract(transaction, details): Promise<DeployedAccountTransaction>

Parameters​

NameType
transactionDeployAccountContractTransaction
detailsInvocationsDetailsWithNonce

Returns​

Promise<DeployedAccountTransaction>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).deployAccountContract

Defined in​

src/provider/rpc.ts:441


callContract​

â–¸ callContract(call, blockIdentifier?): Promise<string[]>

Parameters​

NameType
callCall
blockIdentifier?BlockIdentifier

Returns​

Promise<string[]>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).callContract

Defined in​

src/provider/rpc.ts:451


estimateMessageFee​

â–¸ estimateMessageFee(message, blockIdentifier?): Promise<FEE_ESTIMATE>

NEW: Estimate the fee for a message from L1

Parameters​

NameTypeDescription
messageMSG_FROM_L1Message From L1
blockIdentifier?BlockIdentifier-

Returns​

Promise<FEE_ESTIMATE>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).estimateMessageFee

Defined in​

src/provider/rpc.ts:459


getSyncingStats​

â–¸ getSyncingStats(): Promise<Syncing>

Returns an object about the sync status, or false if the node is not synching

Returns​

Promise<Syncing>

Object with the stats data

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getSyncingStats

Defined in​

src/provider/rpc.ts:467


getEvents​

â–¸ getEvents(eventFilter): Promise<EVENTS_CHUNK>

Returns all events matching the given filter

Parameters​

NameType
eventFilterEventFilter

Returns​

Promise<EVENTS_CHUNK>

events and the pagination of the events

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getEvents

Defined in​

src/provider/rpc.ts:475


verifyMessageInStarknet​

â–¸ verifyMessageInStarknet(message, signature, accountAddress, signatureVerificationFunctionName?, signatureVerificationResponse?): Promise<boolean>

Verify in Starknet a signature of a TypedData object or of a given hash.

Parameters​

NameTypeDescription
messageTypedData | BigNumberishTypedData object to be verified, or message hash to be verified.
signatureSignaturesignature of the message.
accountAddressBigNumberishaddress of the account that has signed the message.
signatureVerificationFunctionName?stringif account contract with non standard account verification function name.
signatureVerificationResponse?Objectif account contract with non standard response of verification function.
signatureVerificationResponse.okResponsestring[]-
signatureVerificationResponse.nokResponsestring[]-
signatureVerificationResponse.errorstring[]-

Returns​

Promise<boolean>

const myTypedMessage: TypedMessage = .... ;
const messageHash = typedData.getMessageHash(myTypedMessage,accountAddress);
const sign: WeierstrassSignatureType = ec.starkCurve.sign(messageHash, privateKey);
const accountAddress = "0x43b7240d227aa2fb8434350b3321c40ac1b88c7067982549e7609870621b535";
const result1 = myRpcProvider.verifyMessageInStarknet(myTypedMessage, sign, accountAddress);
const result2 = myRpcProvider.verifyMessageInStarknet(messageHash, sign, accountAddress);
// result1 = result2 = true

Inherited from​

Mixin(BaseRpcProvider, StarknetId).verifyMessageInStarknet

Defined in​

src/provider/rpc.ts:497


isClassDeclared​

â–¸ isClassDeclared(contractClassIdentifier, blockIdentifier?): Promise<boolean>

Test if class is already declared from ContractClassIdentifier Helper method using getClass

Parameters​

NameType
contractClassIdentifierContractClassIdentifier
blockIdentifier?BlockIdentifier

Returns​

Promise<boolean>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).isClassDeclared

Defined in​

src/provider/rpc.ts:583


prepareInvocations​

â–¸ prepareInvocations(invocations): Promise<Invocations>

Build bulk invocations with auto-detect declared class

  1. Test if class is declared if not declare it preventing already declared class error and not declared class errors
  2. Order declarations first

Parameters​

NameType
invocationsInvocations

Returns​

Promise<Invocations>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).prepareInvocations

Defined in​

src/provider/rpc.ts:614


getStarkName​

â–¸ getStarkName(address, StarknetIdContract?): Promise<string>

Parameters​

NameType
addressBigNumberish
StarknetIdContract?string

Returns​

Promise<string>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getStarkName

Defined in​

src/provider/extensions/starknetId.ts:21


getAddressFromStarkName​

â–¸ getAddressFromStarkName(name, StarknetIdContract?): Promise<string>

Parameters​

NameType
namestring
StarknetIdContract?string

Returns​

Promise<string>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getAddressFromStarkName

Defined in​

src/provider/extensions/starknetId.ts:30


getStarkProfile​

â–¸ getStarkProfile(address, StarknetIdContract?, StarknetIdIdentityContract?, StarknetIdVerifierContract?, StarknetIdPfpContract?, StarknetIdPopContract?, StarknetIdMulticallContract?): Promise<StarkProfile>

Parameters​

NameType
addressBigNumberish
StarknetIdContract?string
StarknetIdIdentityContract?string
StarknetIdVerifierContract?string
StarknetIdPfpContract?string
StarknetIdPopContract?string
StarknetIdMulticallContract?string

Returns​

Promise<StarkProfile>

Inherited from​

Mixin(BaseRpcProvider, StarknetId).getStarkProfile

Defined in​

src/provider/extensions/starknetId.ts:39