Skip to main content
Version: 8.6.0

Class: Provider

Hierarchy

  • RpcProvider<this> & StarknetId<this> & BrotherId<this>

    Provider

    ↳↳ Account

Constructors

constructor

new Provider(optionsOrProvider?): Provider

Parameters

NameType
optionsOrProvider?RpcProviderOptions | ProviderInterface | RpcProvider

Returns

Provider

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).constructor

Defined in

src/provider/rpc.ts:66

new Provider(): Provider

Returns

Provider

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).constructor

Properties

responseParser

responseParser: RPCResponseParser

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).responseParser

Defined in

src/provider/rpc.ts:62


channel

channel: RpcChannel | RpcChannel

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).channel

Defined in

src/provider/rpc.ts:64


getStateUpdate

getStateUpdate: () => Promise<{ block_hash: string ; new_root: string ; 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: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] } }>(blockIdentifier: "pre_confirmed") => Promise<PRE_CONFIRMED_STATE_UPDATE>(blockIdentifier: "latest") => Promise<{ block_hash: string ; new_root: string ; 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: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] } }>(blockIdentifier?: BlockIdentifier) => Promise<StateUpdateResponse>

Type declaration

▸ (): Promise<{ block_hash: string ; new_root: string ; 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: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] } }>

Returns

Promise<{ block_hash: string ; new_root: string ; 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: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] } }>

▸ (blockIdentifier): Promise<PRE_CONFIRMED_STATE_UPDATE>

Parameters
NameType
blockIdentifier"pre_confirmed"
Returns

Promise<PRE_CONFIRMED_STATE_UPDATE>

▸ (blockIdentifier): Promise<{ block_hash: string ; new_root: string ; 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: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] } }>

Parameters
NameType
blockIdentifier"latest"
Returns

Promise<{ block_hash: string ; new_root: string ; 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: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] } }>

▸ (blockIdentifier?): Promise<StateUpdateResponse>

Parameters
NameType
blockIdentifier?BlockIdentifier
Returns

Promise<StateUpdateResponse>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getStateUpdate

Defined in

src/provider/rpc.ts:256

Methods

create

create<T>(this, optionsOrProvider?): Promise<T>

auto configure channel based on provided node leave space for other async before constructor

Type parameters

NameType
Textends RpcProvider

Parameters

NameType
this(...args: [optionsOrProvider?: RpcProviderOptions | ProviderInterface | RpcProvider]) => T
optionsOrProvider?RpcProviderOptions

Returns

Promise<T>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).create

Defined in

src/provider/rpc.ts:98


getStarkName

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

Parameters

NameType
providerProviderInterface
addressBigNumberish
StarknetIdContract?string

Returns

Promise<string>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getStarkName

Defined in

src/provider/extensions/starknetId.ts:62


getAddressFromStarkName

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

Parameters

NameType
providerProviderInterface
namestring
StarknetIdContract?string

Returns

Promise<string>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getAddressFromStarkName

Defined in

src/provider/extensions/starknetId.ts:96


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, BrotherId).getStarkProfile

Defined in

src/provider/extensions/starknetId.ts:128


getBrotherName

getBrotherName(provider, address, BrotherIdContract?): Promise<string>

Static implementation of getBrotherName

Parameters

NameTypeDescription
providerProviderInterfaceThe provider interface
addressBigNumberishThe address to get the domain for
BrotherIdContract?stringOptional contract address

Returns

Promise<string>

The domain name with .brother suffix

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBrotherName

Defined in

src/provider/extensions/brotherId.ts:148


getAddressFromBrotherName

getAddressFromBrotherName(provider, name, BrotherIdContract?): Promise<string>

Static implementation of getAddressFromBrotherName

Parameters

NameTypeDescription
providerProviderInterfaceThe provider interface
namestringThe domain name
BrotherIdContract?stringOptional contract address

Returns

Promise<string>

The resolver address

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getAddressFromBrotherName

Defined in

src/provider/extensions/brotherId.ts:186


getBrotherProfile

getBrotherProfile(provider, address, BrotherIdContract?): Promise<BrotherProfile>

Static implementation of getBrotherProfile

Parameters

NameTypeDescription
providerProviderInterfaceThe provider interface
addressBigNumberishThe address to get the profile for
BrotherIdContract?stringOptional contract address

Returns

Promise<BrotherProfile>

The complete Brother profile

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBrotherProfile

Defined in

src/provider/extensions/brotherId.ts:226


fetch

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

Parameters

NameTypeDefault value
methodstringundefined
params?objectundefined
idstring | number0

Returns

Promise<Response>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).fetch

Defined in

src/provider/rpc.ts:128


getChainId

getChainId(): Promise<"0x534e5f4d41494e" | "0x534e5f5345504f4c4941">

Returns

Promise<"0x534e5f4d41494e" | "0x534e5f5345504f4c4941">

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getChainId

Defined in

src/provider/rpc.ts:132


readSpecVersion

readSpecVersion(): undefined | "0.8.1" | "0.9.0"

Returns

undefined | "0.8.1" | "0.9.0"

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).readSpecVersion

Defined in

src/provider/rpc.ts:136


getSpecVersion

getSpecVersion(): Promise<string>

Returns

Promise<string>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getSpecVersion

Defined in

src/provider/rpc.ts:140


setUpSpecVersion

setUpSpecVersion(): Promise<"0.8.1" | "0.9.0">

Returns

Promise<"0.8.1" | "0.9.0">

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).setUpSpecVersion

Defined in

src/provider/rpc.ts:144


getNonceForAddress

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

Parameters

NameType
contractAddressBigNumberish
blockIdentifier?BlockIdentifier

Returns

Promise<string>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getNonceForAddress

Defined in

src/provider/rpc.ts:148


getBlock

getBlock(): Promise<{ transactions: string[] ; parent_hash: string ; timestamp: number ; sequencer_address: string ; l1_gas_price: RESOURCE_PRICE ; l2_gas_price: RESOURCE_PRICE ; l1_data_gas_price: RESOURCE_PRICE ; l1_da_mode: L1_DA_MODE ; starknet_version: string }>

Returns

Promise<{ transactions: string[] ; parent_hash: string ; timestamp: number ; sequencer_address: string ; l1_gas_price: RESOURCE_PRICE ; l2_gas_price: RESOURCE_PRICE ; l1_data_gas_price: RESOURCE_PRICE ; l1_da_mode: L1_DA_MODE ; starknet_version: string }>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlock

Defined in

src/provider/rpc.ts:155

getBlock(blockIdentifier): Promise<{ transactions: string[] ; parent_hash: string ; timestamp: number ; sequencer_address: string ; l1_gas_price: RESOURCE_PRICE ; l2_gas_price: RESOURCE_PRICE ; l1_data_gas_price: RESOURCE_PRICE ; l1_da_mode: L1_DA_MODE ; starknet_version: string }>

Parameters

NameType
blockIdentifier"pre_confirmed"

Returns

Promise<{ transactions: string[] ; parent_hash: string ; timestamp: number ; sequencer_address: string ; l1_gas_price: RESOURCE_PRICE ; l2_gas_price: RESOURCE_PRICE ; l1_data_gas_price: RESOURCE_PRICE ; l1_da_mode: L1_DA_MODE ; starknet_version: string }>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlock

Defined in

src/provider/rpc.ts:156

getBlock(blockIdentifier): Promise<{ status: EBlockStatus ; block_hash: string ; parent_hash: string ; block_number: number ; new_root: string ; timestamp: number ; sequencer_address: string ; l1_gas_price: RESOURCE_PRICE ; l2_gas_price: RESOURCE_PRICE ; l1_data_gas_price: RESOURCE_PRICE ; l1_da_mode: L1_DA_MODE ; starknet_version: string ; transactions: string[] }>

Parameters

NameType
blockIdentifier"latest"

Returns

Promise<{ status: EBlockStatus ; block_hash: string ; parent_hash: string ; block_number: number ; new_root: string ; timestamp: number ; sequencer_address: string ; l1_gas_price: RESOURCE_PRICE ; l2_gas_price: RESOURCE_PRICE ; l1_data_gas_price: RESOURCE_PRICE ; l1_da_mode: L1_DA_MODE ; starknet_version: string ; transactions: string[] }>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlock

Defined in

src/provider/rpc.ts:157

getBlock(blockIdentifier): Promise<GetBlockResponse>

Parameters

NameType
blockIdentifierBlockIdentifier

Returns

Promise<GetBlockResponse>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlock

Defined in

src/provider/rpc.ts:158


getBlockLatestAccepted

getBlockLatestAccepted(): Promise<BlockHashAndNumber>

Returns

Promise<BlockHashAndNumber>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlockLatestAccepted

Defined in

src/provider/rpc.ts:165


getBlockNumber

getBlockNumber(): Promise<number>

Returns

Promise<number>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlockNumber

Defined in

src/provider/rpc.ts:169


getBlockWithTxHashes

getBlockWithTxHashes(blockIdentifier?): Promise<OnlyFirst<BLOCK_WITH_TX_HASHES, { status: BLOCK_STATUS } & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES & PENDING_BLOCK_HEADER> | OnlyFirst<PENDING_BLOCK_WITH_TX_HASHES, { status: BLOCK_STATUS } & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES & PENDING_BLOCK_HEADER> | OnlyFirst<BLOCK_WITH_TX_HASHES, { status: EBlockStatus } & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES & PRE_CONFIRMED_BLOCK_HEADER> | OnlyFirst<PRE_CONFIRMED_BLOCK_WITH_TX_HASHES, { status: EBlockStatus } & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES & PRE_CONFIRMED_BLOCK_HEADER>>

Parameters

NameType
blockIdentifier?BlockIdentifier

Returns

Promise<OnlyFirst<BLOCK_WITH_TX_HASHES, { status: BLOCK_STATUS } & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES & PENDING_BLOCK_HEADER> | OnlyFirst<PENDING_BLOCK_WITH_TX_HASHES, { status: BLOCK_STATUS } & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES & PENDING_BLOCK_HEADER> | OnlyFirst<BLOCK_WITH_TX_HASHES, { status: EBlockStatus } & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES & PRE_CONFIRMED_BLOCK_HEADER> | OnlyFirst<PRE_CONFIRMED_BLOCK_WITH_TX_HASHES, { status: EBlockStatus } & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES & PRE_CONFIRMED_BLOCK_HEADER>>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlockWithTxHashes

Defined in

src/provider/rpc.ts:173


getBlockWithTxs

getBlockWithTxs(blockIdentifier?): Promise<OnlyFirst<BLOCK_WITH_TXS, { status: BLOCK_STATUS } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS & PENDING_BLOCK_HEADER> | OnlyFirst<PENDING_BLOCK_WITH_TXS, { status: BLOCK_STATUS } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS & PENDING_BLOCK_HEADER> | OnlyFirst<BLOCK_WITH_TXS, { status: EBlockStatus } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS & PRE_CONFIRMED_BLOCK_HEADER> | OnlyFirst<PRE_CONFIRMED_BLOCK_WITH_TXS, { status: EBlockStatus } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS & PRE_CONFIRMED_BLOCK_HEADER>>

Parameters

NameType
blockIdentifier?BlockIdentifier

Returns

Promise<OnlyFirst<BLOCK_WITH_TXS, { status: BLOCK_STATUS } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS & PENDING_BLOCK_HEADER> | OnlyFirst<PENDING_BLOCK_WITH_TXS, { status: BLOCK_STATUS } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS & PENDING_BLOCK_HEADER> | OnlyFirst<BLOCK_WITH_TXS, { status: EBlockStatus } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS & PRE_CONFIRMED_BLOCK_HEADER> | OnlyFirst<PRE_CONFIRMED_BLOCK_WITH_TXS, { status: EBlockStatus } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS & PRE_CONFIRMED_BLOCK_HEADER>>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlockWithTxs

Defined in

src/provider/rpc.ts:177


waitForBlock

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

Parameters

NameTypeDefault value
blockIdentifierBlockIdentifierBlockTag.LATEST
retryIntervalnumber5000

Returns

Promise<void>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).waitForBlock

Defined in

src/provider/rpc.ts:181


getL1GasPrice

getL1GasPrice(blockIdentifier?): Promise<string>

Parameters

NameType
blockIdentifier?BlockIdentifier

Returns

Promise<string>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getL1GasPrice

Defined in

src/provider/rpc.ts:212


getGasPrices

getGasPrices(blockIdentifier?): Promise<GasPrices>

Get the gas prices related to a block.

Parameters

NameTypeDescription
blockIdentifier?BlockIdentifierOptional. Can be 'pending', 'latest' or a block number (an integer type).

Returns

Promise<GasPrices>

an object with l1DataGasPrice, l1GasPrice, l2GasPrice properties (all bigint type).

Example

const result = await myProvider.getGasPrices();
// result = { l1DataGasPrice: 3039n, l1GasPrice: 55590341542890n, l2GasPrice: 8441845008n }

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getGasPrices

Defined in

src/provider/rpc.ts:228


getL1MessageHash

getL1MessageHash(l2TxHash): Promise<string>

Parameters

NameType
l2TxHashBigNumberish

Returns

Promise<string>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getL1MessageHash

Defined in

src/provider/rpc.ts:236


getBlockWithReceipts

getBlockWithReceipts(blockIdentifier?): Promise<OnlyFirst<BLOCK_WITH_RECEIPTS, { status: BLOCK_STATUS } & BLOCK_HEADER & BLOCK_BODY_WITH_RECEIPTS & PENDING_BLOCK_HEADER> | OnlyFirst<PENDING_BLOCK_WITH_RECEIPTS, { status: BLOCK_STATUS } & BLOCK_HEADER & BLOCK_BODY_WITH_RECEIPTS & PENDING_BLOCK_HEADER> | OnlyFirst<BLOCK_WITH_RECEIPTS, { status: EBlockStatus } & BLOCK_HEADER & BLOCK_BODY_WITH_RECEIPTS & PRE_CONFIRMED_BLOCK_HEADER> | OnlyFirst<PRE_CONFIRMED_BLOCK_WITH_RECEIPTS, { status: EBlockStatus } & BLOCK_HEADER & BLOCK_BODY_WITH_RECEIPTS & PRE_CONFIRMED_BLOCK_HEADER>>

Parameters

NameType
blockIdentifier?BlockIdentifier

Returns

Promise<OnlyFirst<BLOCK_WITH_RECEIPTS, { status: BLOCK_STATUS } & BLOCK_HEADER & BLOCK_BODY_WITH_RECEIPTS & PENDING_BLOCK_HEADER> | OnlyFirst<PENDING_BLOCK_WITH_RECEIPTS, { status: BLOCK_STATUS } & BLOCK_HEADER & BLOCK_BODY_WITH_RECEIPTS & PENDING_BLOCK_HEADER> | OnlyFirst<BLOCK_WITH_RECEIPTS, { status: EBlockStatus } & BLOCK_HEADER & BLOCK_BODY_WITH_RECEIPTS & PRE_CONFIRMED_BLOCK_HEADER> | OnlyFirst<PRE_CONFIRMED_BLOCK_WITH_RECEIPTS, { status: EBlockStatus } & BLOCK_HEADER & BLOCK_BODY_WITH_RECEIPTS & PRE_CONFIRMED_BLOCK_HEADER>>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlockWithReceipts

Defined in

src/provider/rpc.ts:252


getBlockStateUpdate

getBlockStateUpdate(): Promise<{ block_hash: string ; new_root: string ; 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: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] } }>

Returns

Promise<{ block_hash: string ; new_root: string ; 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: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] } }>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlockStateUpdate

Defined in

src/provider/rpc.ts:258

getBlockStateUpdate(blockIdentifier): Promise<PRE_CONFIRMED_STATE_UPDATE>

Parameters

NameType
blockIdentifier"pre_confirmed"

Returns

Promise<PRE_CONFIRMED_STATE_UPDATE>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlockStateUpdate

Defined in

src/provider/rpc.ts:259

getBlockStateUpdate(blockIdentifier): Promise<{ block_hash: string ; new_root: string ; 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: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] } }>

Parameters

NameType
blockIdentifier"latest"

Returns

Promise<{ block_hash: string ; new_root: string ; 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: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] } }>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlockStateUpdate

Defined in

src/provider/rpc.ts:262

getBlockStateUpdate(blockIdentifier?): Promise<StateUpdateResponse>

Parameters

NameType
blockIdentifier?BlockIdentifier

Returns

Promise<StateUpdateResponse>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlockStateUpdate

Defined in

src/provider/rpc.ts:263


getBlockTransactionsTraces

getBlockTransactionsTraces(blockIdentifier?): Promise<BlockTransactionsTraces | BlockTransactionsTraces>

Parameters

NameType
blockIdentifier?BlockIdentifier

Returns

Promise<BlockTransactionsTraces | BlockTransactionsTraces>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlockTransactionsTraces

Defined in

src/provider/rpc.ts:268


getBlockTransactionCount

getBlockTransactionCount(blockIdentifier?): Promise<number>

Parameters

NameType
blockIdentifier?BlockIdentifier

Returns

Promise<number>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBlockTransactionCount

Defined in

src/provider/rpc.ts:272


getTransaction

getTransaction(txHash): Promise<TXN_WITH_HASH>

Parameters

NameType
txHashBigNumberish

Returns

Promise<TXN_WITH_HASH>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getTransaction

Defined in

src/provider/rpc.ts:276


getTransactionByHash

getTransactionByHash(txHash): Promise<TXN_WITH_HASH>

Parameters

NameType
txHashBigNumberish

Returns

Promise<TXN_WITH_HASH>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getTransactionByHash

Defined in

src/provider/rpc.ts:280


getTransactionByBlockIdAndIndex

getTransactionByBlockIdAndIndex(blockIdentifier, index): Promise<TXN_WITH_HASH>

Parameters

NameType
blockIdentifierBlockIdentifier
indexnumber

Returns

Promise<TXN_WITH_HASH>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getTransactionByBlockIdAndIndex

Defined in

src/provider/rpc.ts:284


getTransactionReceipt

getTransactionReceipt(txHash): Promise<GetTransactionReceiptResponse>

Parameters

NameType
txHashBigNumberish

Returns

Promise<GetTransactionReceiptResponse>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getTransactionReceipt

Defined in

src/provider/rpc.ts:288


getTransactionTrace

getTransactionTrace(txHash): Promise<TRANSACTION_TRACE | TRANSACTION_TRACE>

Parameters

NameType
txHashBigNumberish

Returns

Promise<TRANSACTION_TRACE | TRANSACTION_TRACE>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getTransactionTrace

Defined in

src/provider/rpc.ts:295


getTransactionStatus

getTransactionStatus(transactionHash): Promise<TXN_STATUS_RESULT | TXN_STATUS_RESULT>

Parameters

NameType
transactionHashBigNumberish

Returns

Promise<TXN_STATUS_RESULT | TXN_STATUS_RESULT>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getTransactionStatus

Defined in

src/provider/rpc.ts:301


getSimulateTransaction

getSimulateTransaction(invocations, options?): Promise<SimulateTransactionOverheadResponse>

Parameters

NameType
invocationsAccountInvocations
options?getSimulateTransactionOptions

Returns

Promise<SimulateTransactionOverheadResponse>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getSimulateTransaction

Defined in

src/provider/rpc.ts:305


waitForTransaction

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

Parameters

NameType
txHashBigNumberish
options?waitForTransactionOptions

Returns

Promise<GetTransactionReceiptResponse>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).waitForTransaction

Defined in

src/provider/rpc.ts:315


fastWaitForTransaction

fastWaitForTransaction(txHash, address, initNonce, options?): Promise<boolean>

Wait up until a new transaction is possible with same the account. This method is fast, but Events and transaction report are not yet available. Useful for gaming activity.

  • only rpc 0.9 and onwards.

Parameters

NameTypeDescription
txHashBigNumberishtransaction hash
addressstringaddress of the account
initNonceBigNumberishinitial nonce of the account (before the transaction).
options?fastWaitForTransactionOptionsoptions to scan the network for the next possible transaction. retries is the number of times to retry.

Returns

Promise<boolean>

Returns true if the next transaction is possible, false if the timeout has been reached, throw an error in case of provider communication.

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).fastWaitForTransaction

Defined in

src/provider/rpc.ts:340


getStorageAt

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

Parameters

NameType
contractAddressBigNumberish
keyBigNumberish
blockIdentifier?BlockIdentifier

Returns

Promise<string>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getStorageAt

Defined in

src/provider/rpc.ts:358


getClassHashAt

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

Parameters

NameType
contractAddressBigNumberish
blockIdentifier?BlockIdentifier

Returns

Promise<string>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getClassHashAt

Defined in

src/provider/rpc.ts:366


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, BrotherId).getClassByHash

Defined in

src/provider/rpc.ts:370


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, BrotherId).getClass

Defined in

src/provider/rpc.ts:374


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, BrotherId).getClassAt

Defined in

src/provider/rpc.ts:380


getContractVersion

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

Parameters

NameType
contractAddressBigNumberish
classHash?undefined
options?getContractVersionOptions

Returns

Promise<ContractVersion>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getContractVersion

Defined in

src/provider/rpc.ts:386

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

Parameters

NameType
contractAddressundefined
classHashBigNumberish
options?getContractVersionOptions

Returns

Promise<ContractVersion>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getContractVersion

Defined in

src/provider/rpc.ts:391


getInvokeEstimateFee

getInvokeEstimateFee(invocation, details, blockIdentifier?, skipValidate?): Promise<EstimateFeeResponseOverhead>

Parameters

NameType
invocationInvocation
detailsInvocationsDetailsWithNonce
blockIdentifier?BlockIdentifier
skipValidate?boolean

Returns

Promise<EstimateFeeResponseOverhead>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getInvokeEstimateFee

Defined in

src/provider/rpc.ts:424


getDeclareEstimateFee

getDeclareEstimateFee(invocation, details, blockIdentifier?, skipValidate?): Promise<EstimateFeeResponseOverhead>

Parameters

NameType
invocationDeclareContractTransaction
detailsInvocationsDetailsWithNonce
blockIdentifier?BlockIdentifier
skipValidate?boolean

Returns

Promise<EstimateFeeResponseOverhead>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getDeclareEstimateFee

Defined in

src/provider/rpc.ts:438


getDeployAccountEstimateFee

getDeployAccountEstimateFee(invocation, details, blockIdentifier?, skipValidate?): Promise<EstimateFeeResponseOverhead>

Parameters

NameType
invocationDeployAccountContractTransaction
detailsInvocationsDetailsWithNonce
blockIdentifier?BlockIdentifier
skipValidate?boolean

Returns

Promise<EstimateFeeResponseOverhead>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getDeployAccountEstimateFee

Defined in

src/provider/rpc.ts:452


getEstimateFeeBulk

getEstimateFeeBulk(invocations, options?): Promise<EstimateFeeResponseBulkOverhead>

Parameters

NameType
invocationsAccountInvocations
options?getEstimateFeeBulkOptions

Returns

Promise<EstimateFeeResponseBulkOverhead>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getEstimateFeeBulk

Defined in

src/provider/rpc.ts:466


invokeFunction

invokeFunction(functionInvocation, details): Promise<{ transaction_hash: string }>

Parameters

NameType
functionInvocationInvocation
detailsInvocationsDetailsWithNonce

Returns

Promise<{ transaction_hash: string }>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).invokeFunction

Defined in

src/provider/rpc.ts:475


declareContract

declareContract(transaction, details): Promise<{ class_hash: string ; transaction_hash: string }>

Parameters

NameType
transactionDeclareContractTransaction
detailsInvocationsDetailsWithNonce

Returns

Promise<{ class_hash: string ; transaction_hash: string }>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).declareContract

Defined in

src/provider/rpc.ts:482


deployAccountContract

deployAccountContract(transaction, details): Promise<{ contract_address: string ; transaction_hash: string }>

Parameters

NameType
transactionDeployAccountContractTransaction
detailsInvocationsDetailsWithNonce

Returns

Promise<{ contract_address: string ; transaction_hash: string }>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).deployAccountContract

Defined in

src/provider/rpc.ts:489


callContract

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

Parameters

NameType
callCall
blockIdentifier?BlockIdentifier

Returns

Promise<string[]>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).callContract

Defined in

src/provider/rpc.ts:496


estimateMessageFee

estimateMessageFee(message, blockIdentifier?): Promise<FEE_ESTIMATE | MESSAGE_FEE_ESTIMATE>

Parameters

NameType
messageMSG_FROM_L1
blockIdentifier?BlockIdentifier

Returns

Promise<FEE_ESTIMATE | MESSAGE_FEE_ESTIMATE>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).estimateMessageFee

Defined in

src/provider/rpc.ts:500


getSyncingStats

getSyncingStats(): Promise<Syncing>

Returns

Promise<Syncing>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getSyncingStats

Defined in

src/provider/rpc.ts:507


getEvents

getEvents(eventFilter): Promise<EVENTS_CHUNK | EVENTS_CHUNK>

Parameters

NameType
eventFilterEventFilter | EventFilter

Returns

Promise<EVENTS_CHUNK | EVENTS_CHUNK>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getEvents

Defined in

src/provider/rpc.ts:511


verifyMessageInStarknet

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

Parameters

NameType
messageTypedData | BigNumberish
signatureSignature
accountAddressBigNumberish
signatureVerificationFunctionName?string
signatureVerificationResponse?Object
signatureVerificationResponse.okResponsestring[]
signatureVerificationResponse.nokResponsestring[]
signatureVerificationResponse.errorstring[]

Returns

Promise<boolean>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).verifyMessageInStarknet

Defined in

src/provider/rpc.ts:523


isClassDeclared

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

Parameters

NameType
contractClassIdentifierContractClassIdentifier
blockIdentifier?BlockIdentifier

Returns

Promise<boolean>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).isClassDeclared

Defined in

src/provider/rpc.ts:540


prepareInvocations

prepareInvocations(invocations): Promise<Invocations>

Parameters

NameType
invocationsInvocations

Returns

Promise<Invocations>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).prepareInvocations

Defined in

src/provider/rpc.ts:568


getL1MessagesStatus

getL1MessagesStatus(transactionHash): Promise<L1L2MessagesStatus | L1L2MessagesStatus>

Parameters

NameType
transactionHashBigNumberish

Returns

Promise<L1L2MessagesStatus | L1L2MessagesStatus>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getL1MessagesStatus

Defined in

src/provider/rpc.ts:589


getStorageProof

getStorageProof(classHashes, contractAddresses, contractsStorageKeys, blockIdentifier?): Promise<StorageProof>

Parameters

NameType
classHashesBigNumberish[]
contractAddressesBigNumberish[]
contractsStorageKeysCONTRACT_STORAGE_KEYS[]
blockIdentifier?BlockIdentifier

Returns

Promise<StorageProof>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getStorageProof

Defined in

src/provider/rpc.ts:595


getCompiledCasm

getCompiledCasm(classHash): Promise<CASM_COMPILED_CONTRACT_CLASS>

Parameters

NameType
classHashBigNumberish

Returns

Promise<CASM_COMPILED_CONTRACT_CLASS>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getCompiledCasm

Defined in

src/provider/rpc.ts:609


getEstimateTip

getEstimateTip(blockIdentifier?, options?): Promise<TipEstimate>

Parameters

NameType
blockIdentifier?BlockIdentifier
optionsTipAnalysisOptions

Returns

Promise<TipEstimate>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getEstimateTip

Defined in

src/provider/rpc.ts:613


getStarkName

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

Parameters

NameType
addressBigNumberish
StarknetIdContract?string

Returns

Promise<string>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getStarkName

Defined in

src/provider/extensions/starknetId.ts:22


getAddressFromStarkName

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

Parameters

NameType
namestring
StarknetIdContract?string

Returns

Promise<string>

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getAddressFromStarkName

Defined in

src/provider/extensions/starknetId.ts:31


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, BrotherId).getStarkProfile

Defined in

src/provider/extensions/starknetId.ts:40


getBrotherName

getBrotherName(address, BrotherIdContract?): Promise<string>

Gets the primary Brother domain name for an address

Parameters

NameTypeDescription
addressBigNumberishThe address to get the domain for
BrotherIdContract?stringOptional contract address

Returns

Promise<string>

The domain name with .brother suffix

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBrotherName

Defined in

src/provider/extensions/brotherId.ts:99


getAddressFromBrotherName

getAddressFromBrotherName(name, BrotherIdContract?): Promise<string>

Gets the address associated with a Brother domain name

Parameters

NameTypeDescription
namestringThe domain name (with or without .brother suffix)
BrotherIdContract?stringOptional contract address

Returns

Promise<string>

The resolver address for the domain

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getAddressFromBrotherName

Defined in

src/provider/extensions/brotherId.ts:114


getBrotherProfile

getBrotherProfile(address, BrotherIdContract?): Promise<BrotherProfile>

Gets the complete profile information for a Brother domain

Parameters

NameTypeDescription
addressBigNumberishThe address to get the profile for
BrotherIdContract?stringOptional contract address

Returns

Promise<BrotherProfile>

The complete Brother profile information

Inherited from

Mixin(BaseRpcProvider, StarknetId, BrotherId).getBrotherProfile

Defined in

src/provider/extensions/brotherId.ts:132