Skip to main content
Version: Next

Class: RpcChannel

RPC07.RpcChannel

Constructors​

constructor​

β€’ new RpcChannel(optionsOrProvider?): RpcChannel

Parameters​

NameType
optionsOrProvider?RpcProviderOptions

Returns​

RpcChannel

Defined in​

src/channel/rpc_0_7.ts:60

Properties​

nodeUrl​

β€’ nodeUrl: string

Defined in​

src/channel/rpc_0_7.ts:40


headers​

β€’ headers: object

Defined in​

src/channel/rpc_0_7.ts:42


retries​

β€’ Readonly retries: number

Defined in​

src/channel/rpc_0_7.ts:44


requestId​

β€’ requestId: number

Defined in​

src/channel/rpc_0_7.ts:46


blockIdentifier​

β€’ Readonly blockIdentifier: BlockIdentifier

Defined in​

src/channel/rpc_0_7.ts:48


chainId​

β€’ Private Optional chainId: StarknetChainId

Defined in​

src/channel/rpc_0_7.ts:50


specVersion​

β€’ Private Optional specVersion: string

Defined in​

src/channel/rpc_0_7.ts:52


transactionRetryIntervalFallback​

β€’ Private Optional transactionRetryIntervalFallback: number

Defined in​

src/channel/rpc_0_7.ts:54


waitMode​

β€’ Readonly waitMode: Boolean

Defined in​

src/channel/rpc_0_7.ts:56


batchClient​

β€’ Private Optional batchClient: BatchClient

Defined in​

src/channel/rpc_0_7.ts:58

Accessors​

transactionRetryIntervalDefault​

β€’ get transactionRetryIntervalDefault(): number

Returns​

number

Defined in​

src/channel/rpc_0_7.ts:97

Methods​

setChainId​

β–Έ setChainId(chainId): void

Parameters​

NameType
chainIdStarknetChainId

Returns​

void

Defined in​

src/channel/rpc_0_7.ts:101


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:105


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:119


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:135


getChainId​

β–Έ getChainId(): Promise<StarknetChainId>

Returns​

Promise<StarknetChainId>

Defined in​

src/channel/rpc_0_7.ts:160


getSpecVersion​

β–Έ getSpecVersion(): Promise<string>

Returns​

Promise<string>

Defined in​

src/channel/rpc_0_7.ts:165


getNonceForAddress​

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

Parameters​

NameType
contractAddressBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<string>

Defined in​

src/channel/rpc_0_7.ts:170


getBlockLatestAccepted​

β–Έ getBlockLatestAccepted(): Promise<BlockHashAndNumber>

Get the most recent accepted block hash and number

Returns​

Promise<BlockHashAndNumber>

Defined in​

src/channel/rpc_0_7.ts:185


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:194


getBlockWithTxHashes​

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

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<BlockWithTxHashes>

Defined in​

src/channel/rpc_0_7.ts:198


getBlockWithTxs​

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

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<BlockWithTxs>

Defined in​

src/channel/rpc_0_7.ts:203


getBlockWithReceipts​

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

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<BlockWithTxReceipts>

Defined in​

src/channel/rpc_0_7.ts:208


getBlockStateUpdate​

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

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<StateUpdate>

Defined in​

src/channel/rpc_0_7.ts:213


getBlockTransactionsTraces​

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

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<BlockTransactionsTraces>

Defined in​

src/channel/rpc_0_7.ts:218


getBlockTransactionCount​

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

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<number>

Defined in​

src/channel/rpc_0_7.ts:223


getTransactionByHash​

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

Parameters​

NameType
txHashBigNumberish

Returns​

Promise<TransactionWithHash>

Defined in​

src/channel/rpc_0_7.ts:228


getTransactionByBlockIdAndIndex​

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

Parameters​

NameType
blockIdentifierBlockIdentifier
indexnumber

Returns​

Promise<TransactionWithHash>

Defined in​

src/channel/rpc_0_7.ts:235


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:240


getTransactionTrace​

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

Parameters​

NameType
txHashBigNumberish

Returns​

Promise<TRANSACTION_TRACE>

Defined in​

src/channel/rpc_0_7.ts:245


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:253


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:265


waitForTransaction​

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

Parameters​

NameType
txHashBigNumberish
options?waitForTransactionOptions

Returns​

Promise<TXN_RECEIPT>

Defined in​

src/channel/rpc_0_7.ts:286


getStorageAt​

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

Parameters​

NameType
contractAddressBigNumberish
keyBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<string>

Defined in​

src/channel/rpc_0_7.ts:368


getClassHashAt​

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

Parameters​

NameType
contractAddressBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<string>

Defined in​

src/channel/rpc_0_7.ts:383


getClass​

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

Parameters​

NameType
classHashBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<ContractClass>

Defined in​

src/channel/rpc_0_7.ts:395


getClassAt​

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

Parameters​

NameType
contractAddressBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<ContractClass>

Defined in​

src/channel/rpc_0_7.ts:407


getEstimateFee​

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

Parameters​

NameType
invocationsAccountInvocations
Β«destructuredΒ»getEstimateFeeBulkOptions

Returns​

Promise<FEE_ESTIMATE[]>

Defined in​

src/channel/rpc_0_7.ts:419


invoke​

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

Parameters​

NameType
functionInvocationInvocation
detailsInvocationsDetailsWithNonce

Returns​

Promise<InvokedTransaction>

Defined in​

src/channel/rpc_0_7.ts:438


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:476


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:548


callContract​

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

Parameters​

NameType
callCall
blockIdentifierBlockIdentifier

Returns​

Promise<string[]>

Defined in​

src/channel/rpc_0_7.ts:590


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:606


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:629


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:637


buildTransaction​

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

Parameters​

NameType
invocationAccountInvocationItem
versionType?"fee" | "transaction"

Returns​

BROADCASTED_TXN

Defined in​

src/channel/rpc_0_7.ts:641