Skip to main content
Version: Next

Class: RpcChannel

RPC06.RpcChannel

Constructors​

constructor​

β€’ new RpcChannel(optionsOrProvider?): RpcChannel

Parameters​

NameType
optionsOrProvider?RpcProviderOptions

Returns​

RpcChannel

Defined in​

src/channel/rpc_0_6.ts:61

Properties​

nodeUrl​

β€’ nodeUrl: string

Defined in​

src/channel/rpc_0_6.ts:41


headers​

β€’ headers: object

Defined in​

src/channel/rpc_0_6.ts:43


retries​

β€’ Readonly retries: number

Defined in​

src/channel/rpc_0_6.ts:45


requestId​

β€’ requestId: number

Defined in​

src/channel/rpc_0_6.ts:47


blockIdentifier​

β€’ Readonly blockIdentifier: BlockIdentifier

Defined in​

src/channel/rpc_0_6.ts:49


chainId​

β€’ Private Optional chainId: StarknetChainId

Defined in​

src/channel/rpc_0_6.ts:51


specVersion​

β€’ Private Optional specVersion: string

Defined in​

src/channel/rpc_0_6.ts:53


transactionRetryIntervalFallback​

β€’ Private Optional transactionRetryIntervalFallback: number

Defined in​

src/channel/rpc_0_6.ts:55


waitMode​

β€’ Readonly waitMode: Boolean

Defined in​

src/channel/rpc_0_6.ts:57


batchClient​

β€’ Private Optional batchClient: BatchClient

Defined in​

src/channel/rpc_0_6.ts:59

Accessors​

transactionRetryIntervalDefault​

β€’ get transactionRetryIntervalDefault(): number

Returns​

number

Defined in​

src/channel/rpc_0_6.ts:98

Methods​

setChainId​

β–Έ setChainId(chainId): void

Parameters​

NameType
chainIdStarknetChainId

Returns​

void

Defined in​

src/channel/rpc_0_6.ts:102


fetch​

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

Parameters​

NameTypeDefault value
methodstringundefined
params?objectundefined
idstring | number0

Returns​

Promise<Response>

Defined in​

src/channel/rpc_0_6.ts:106


errorHandler​

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

Parameters​

NameType
methodstring
paramsany
rpcError?Error
otherError?any

Returns​

void

Defined in​

src/channel/rpc_0_6.ts:120


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_6.ts:132


getChainId​

β–Έ getChainId(): Promise<StarknetChainId>

Returns​

Promise<StarknetChainId>

Defined in​

src/channel/rpc_0_6.ts:157


getSpecVersion​

β–Έ getSpecVersion(): Promise<string>

Returns​

Promise<string>

Defined in​

src/channel/rpc_0_6.ts:162


getNonceForAddress​

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

Parameters​

NameType
contractAddressBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<string>

Defined in​

src/channel/rpc_0_6.ts:167


getBlockLatestAccepted​

β–Έ getBlockLatestAccepted(): Promise<BlockHashAndNumber>

Get the most recent accepted block hash and number

Returns​

Promise<BlockHashAndNumber>

Defined in​

src/channel/rpc_0_6.ts:182


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_6.ts:191


getBlockWithTxHashes​

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

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<BlockWithTxHashes>

Defined in​

src/channel/rpc_0_6.ts:195


getBlockWithTxs​

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

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<BlockWithTxs>

Defined in​

src/channel/rpc_0_6.ts:200


getBlockStateUpdate​

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

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<StateUpdate>

Defined in​

src/channel/rpc_0_6.ts:205


getBlockTransactionsTraces​

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

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<BlockTransactionsTraces>

Defined in​

src/channel/rpc_0_6.ts:210


getBlockTransactionCount​

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

Parameters​

NameType
blockIdentifierBlockIdentifier

Returns​

Promise<number>

Defined in​

src/channel/rpc_0_6.ts:215


getTransactionByHash​

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

Parameters​

NameType
txHashBigNumberish

Returns​

Promise<TransactionWithHash>

Defined in​

src/channel/rpc_0_6.ts:220


getTransactionByBlockIdAndIndex​

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

Parameters​

NameType
blockIdentifierBlockIdentifier
indexnumber

Returns​

Promise<TransactionWithHash>

Defined in​

src/channel/rpc_0_6.ts:227


getTransactionReceipt​

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

Parameters​

NameType
txHashBigNumberish

Returns​

Promise<TransactionReceipt>

Defined in​

src/channel/rpc_0_6.ts:232


getTransactionTrace​

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

Parameters​

NameType
txHashBigNumberish

Returns​

Promise<TRANSACTION_TRACE>

Defined in​

src/channel/rpc_0_6.ts:237


getTransactionStatus​

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

Get the status of a transaction

Parameters​

NameType
transactionHashBigNumberish

Returns​

Promise<TransactionStatus>

Defined in​

src/channel/rpc_0_6.ts:245


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_6.ts:257


waitForTransaction​

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

Parameters​

NameType
txHashBigNumberish
options?waitForTransactionOptions

Returns​

Promise<TXN_RECEIPT>

Defined in​

src/channel/rpc_0_6.ts:278


getStorageAt​

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

Parameters​

NameType
contractAddressBigNumberish
keyBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<string>

Defined in​

src/channel/rpc_0_6.ts:360


getClassHashAt​

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

Parameters​

NameType
contractAddressBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<string>

Defined in​

src/channel/rpc_0_6.ts:375


getClass​

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

Parameters​

NameType
classHashBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<ContractClass>

Defined in​

src/channel/rpc_0_6.ts:387


getClassAt​

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

Parameters​

NameType
contractAddressBigNumberish
blockIdentifierBlockIdentifier

Returns​

Promise<ContractClass>

Defined in​

src/channel/rpc_0_6.ts:399


getEstimateFee​

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

Parameters​

NameType
invocationsAccountInvocations
Β«destructuredΒ»getEstimateFeeBulkOptions

Returns​

Promise<FEE_ESTIMATE[]>

Defined in​

src/channel/rpc_0_6.ts:411


invoke​

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

Parameters​

NameType
functionInvocationInvocation
detailsInvocationsDetailsWithNonce

Returns​

Promise<InvokedTransaction>

Defined in​

src/channel/rpc_0_6.ts:430


declare​

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

Parameters​

NameType
Β«destructuredΒ»DeclareContractTransaction
detailsInvocationsDetailsWithNonce

Returns​

Promise<TXN_RECEIPT | DeclaredTransaction>

Defined in​

src/channel/rpc_0_6.ts:468


deployAccount​

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

Parameters​

NameType
Β«destructuredΒ»DeployAccountContractTransaction
detailsInvocationsDetailsWithNonce

Returns​

Promise<TXN_RECEIPT | DeployedAccountTransaction>

Defined in​

src/channel/rpc_0_6.ts:540


callContract​

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

Parameters​

NameType
callCall
blockIdentifierBlockIdentifier

Returns​

Promise<string[]>

Defined in​

src/channel/rpc_0_6.ts:582


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_6.ts:598


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_6.ts:621


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_6.ts:629


buildTransaction​

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

Parameters​

NameType
invocationAccountInvocationItem
versionType?"fee" | "transaction"

Returns​

BROADCASTED_TXN

Defined in​

src/channel/rpc_0_6.ts:633