Skip to main content
Version: 6.11.0

Class: RpcChannel

RPC07.RpcChannel

Constructors​

constructor​

β€’ new RpcChannel(optionsOrProvider?): RpcChannel

Parameters​

NameType
optionsOrProvider?RpcProviderOptions

Returns​

RpcChannel

Defined in​

src/channel/rpc_0_7.ts:57

Properties​

nodeUrl​

β€’ nodeUrl: string

Defined in​

src/channel/rpc_0_7.ts:39


headers​

β€’ headers: object

Defined in​

src/channel/rpc_0_7.ts:41


retries​

β€’ Readonly retries: number

Defined in​

src/channel/rpc_0_7.ts:43


requestId​

β€’ requestId: number

Defined in​

src/channel/rpc_0_7.ts:45


blockIdentifier​

β€’ Readonly blockIdentifier: BlockIdentifier

Defined in​

src/channel/rpc_0_7.ts:47


chainId​

β€’ Private Optional chainId: StarknetChainId

Defined in​

src/channel/rpc_0_7.ts:49


specVersion​

β€’ Private Optional specVersion: string

Defined in​

src/channel/rpc_0_7.ts:51


transactionRetryIntervalFallback​

β€’ Private Optional transactionRetryIntervalFallback: number

Defined in​

src/channel/rpc_0_7.ts:53


waitMode​

β€’ Readonly waitMode: Boolean

Defined in​

src/channel/rpc_0_7.ts:55

Accessors​

transactionRetryIntervalDefault​

β€’ get transactionRetryIntervalDefault(): number

Returns​

number

Defined in​

src/channel/rpc_0_7.ts:85

Methods​

setChainId​

β–Έ setChainId(chainId): void

Parameters​

NameType
chainIdStarknetChainId

Returns​

void

Defined in​

src/channel/rpc_0_7.ts:89


fetch​

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

Parameters​

NameTypeDefault value
methodstringundefined
params?objectundefined
idstring | number0

Returns​

Promise<Response>

Defined in​

src/channel/rpc_0_7.ts:93


errorHandler​

β–Έ errorHandler(method, params, rpcError?, otherError?): void

Parameters​

NameType
methodstring
paramsany
rpcError?Error
otherError?any

Returns​

void

Defined in​

src/channel/rpc_0_7.ts:107


fetchEndpoint​

β–Έ fetchEndpoint<T>(method, params?): Promise<Methods[T][``"result"``]>

Type parameters​

NameType
Textends keyof ReadMethods | keyof WriteMethods | keyof TraceMethods

Parameters​

NameType
methodT
params?Methods[T][``"params"``]

Returns​

Promise<Methods[T][``"result"``]>

Defined in​

src/channel/rpc_0_7.ts:123


getChainId​

β–Έ getChainId(): Promise<StarknetChainId>

Returns​

Promise<StarknetChainId>

Defined in​

src/channel/rpc_0_7.ts:138


getSpecVersion​

β–Έ getSpecVersion(): Promise<string>

Returns​

Promise<string>

Defined in​

src/channel/rpc_0_7.ts:143


getNonceForAddress​

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

Parameters​

NameType
contractAddressBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<string>

Defined in​

src/channel/rpc_0_7.ts:148


getBlockLatestAccepted​

β–Έ getBlockLatestAccepted(): Promise<BlockHashAndNumber>

Get the most recent accepted block hash and number

Returns​

Promise<BlockHashAndNumber>

Defined in​

src/channel/rpc_0_7.ts:163


getBlockNumber​

β–Έ getBlockNumber(): Promise<number>

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

Returns​

Promise<number>

Number of the latest block

Defined in​

src/channel/rpc_0_7.ts:172


getBlockWithTxHashes​

β–Έ getBlockWithTxHashes(blockIdentifier?): Promise<BlockWithTxHashes>

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<BlockWithTxHashes>

Defined in​

src/channel/rpc_0_7.ts:176


getBlockWithTxs​

β–Έ getBlockWithTxs(blockIdentifier?): Promise<BlockWithTxs>

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<BlockWithTxs>

Defined in​

src/channel/rpc_0_7.ts:181


getBlockWithReceipts​

β–Έ getBlockWithReceipts(blockIdentifier?): Promise<BlockWithTxReceipts>

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<BlockWithTxReceipts>

Defined in​

src/channel/rpc_0_7.ts:186


getBlockStateUpdate​

β–Έ getBlockStateUpdate(blockIdentifier?): Promise<StateUpdate>

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<StateUpdate>

Defined in​

src/channel/rpc_0_7.ts:191


getBlockTransactionsTraces​

β–Έ getBlockTransactionsTraces(blockIdentifier?): Promise<BlockTransactionsTraces>

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<BlockTransactionsTraces>

Defined in​

src/channel/rpc_0_7.ts:196


getBlockTransactionCount​

β–Έ getBlockTransactionCount(blockIdentifier?): Promise<number>

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<number>

Defined in​

src/channel/rpc_0_7.ts:201


getTransactionByHash​

β–Έ getTransactionByHash(txHash): Promise<TransactionWithHash>

Parameters​

NameType
txHashBigNumberish

Returns​

Promise<TransactionWithHash>

Defined in​

src/channel/rpc_0_7.ts:206


getTransactionByBlockIdAndIndex​

β–Έ getTransactionByBlockIdAndIndex(blockIdentifier, index): Promise<TransactionWithHash>

Parameters​

NameType
blockIdentifierBlockIdentifier
indexnumber

Returns​

Promise<TransactionWithHash>

Defined in​

src/channel/rpc_0_7.ts:213


getTransactionReceipt​

β–Έ getTransactionReceipt(txHash): Promise<TXN_RECEIPT_WITH_BLOCK_INFO>

Parameters​

NameType
txHashBigNumberish

Returns​

Promise<TXN_RECEIPT_WITH_BLOCK_INFO>

Defined in​

src/channel/rpc_0_7.ts:218


getTransactionTrace​

β–Έ getTransactionTrace(txHash): Promise<TRANSACTION_TRACE>

Parameters​

NameType
txHashBigNumberish

Returns​

Promise<TRANSACTION_TRACE>

Defined in​

src/channel/rpc_0_7.ts:223


getTransactionStatus​

β–Έ getTransactionStatus(transactionHash): Promise<TransactionStatus>

Get the status of a transaction

Parameters​

NameType
transactionHashBigNumberish

Returns​

Promise<TransactionStatus>

Defined in​

src/channel/rpc_0_7.ts:231


simulateTransaction​

β–Έ simulateTransaction(invocations, simulateTransactionOptions?): Promise<SimulateTransactionResponse>

Parameters​

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

Returns​

Promise<SimulateTransactionResponse>

Defined in​

src/channel/rpc_0_7.ts:243


waitForTransaction​

β–Έ waitForTransaction(txHash, options?): Promise<TXN_RECEIPT>

Parameters​

NameType
txHashBigNumberish
options?waitForTransactionOptions

Returns​

Promise<TXN_RECEIPT>

Defined in​

src/channel/rpc_0_7.ts:264


getStorageAt​

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

Parameters​

NameType
contractAddressBigNumberish
keyBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<string>

Defined in​

src/channel/rpc_0_7.ts:346


getClassHashAt​

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

Parameters​

NameType
contractAddressBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<string>

Defined in​

src/channel/rpc_0_7.ts:361


getClass​

β–Έ getClass(classHash, blockIdentifier?): Promise<ContractClass>

Parameters​

NameType
classHashBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<ContractClass>

Defined in​

src/channel/rpc_0_7.ts:373


getClassAt​

β–Έ getClassAt(contractAddress, blockIdentifier?): Promise<ContractClass>

Parameters​

NameType
contractAddressBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<ContractClass>

Defined in​

src/channel/rpc_0_7.ts:385


getEstimateFee​

β–Έ getEstimateFee(invocations, Β«destructuredΒ»): Promise<FEE_ESTIMATE[]>

Parameters​

NameType
invocationsAccountInvocations
Β«destructuredΒ»getEstimateFeeBulkOptions

Returns​

Promise<FEE_ESTIMATE[]>

Defined in​

src/channel/rpc_0_7.ts:397


invoke​

β–Έ invoke(functionInvocation, details): Promise<InvokedTransaction>

Parameters​

NameType
functionInvocationInvocation
detailsInvocationsDetailsWithNonce

Returns​

Promise<InvokedTransaction>

Defined in​

src/channel/rpc_0_7.ts:416


declare​

β–Έ declare(Β«destructuredΒ», details): Promise<TXN_RECEIPT | DeclaredTransaction>

Parameters​

NameType
Β«destructuredΒ»DeclareContractTransaction
detailsInvocationsDetailsWithNonce

Returns​

Promise<TXN_RECEIPT | DeclaredTransaction>

Defined in​

src/channel/rpc_0_7.ts:454


deployAccount​

β–Έ deployAccount(Β«destructuredΒ», details): Promise<TXN_RECEIPT | DeployedAccountTransaction>

Parameters​

NameType
Β«destructuredΒ»DeployAccountContractTransaction
detailsInvocationsDetailsWithNonce

Returns​

Promise<TXN_RECEIPT | DeployedAccountTransaction>

Defined in​

src/channel/rpc_0_7.ts:526


callContract​

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

Parameters​

NameType
callCall
blockIdentifierBlockIdentifier

Returns​

Promise<string[]>

Defined in​

src/channel/rpc_0_7.ts:568


estimateMessageFee​

β–Έ estimateMessageFee(message, blockIdentifier?): Promise<FEE_ESTIMATE>

NEW: Estimate the fee for a message from L1

Parameters​

NameTypeDescription
messageMSG_FROM_L1Message From L1
blockIdentifierBlockIdentifier-

Returns​

Promise<FEE_ESTIMATE>

Defined in​

src/channel/rpc_0_7.ts:584


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

Defined in​

src/channel/rpc_0_7.ts:607


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

Defined in​

src/channel/rpc_0_7.ts:615


buildTransaction​

β–Έ buildTransaction(invocation, versionType?): BROADCASTED_TXN

Parameters​

NameType
invocationAccountInvocationItem
versionType?"fee" | "transaction"

Returns​

BROADCASTED_TXN

Defined in​

src/channel/rpc_0_7.ts:619