Class: RpcChannel
RPC06.RpcChannel
Constructorsβ
constructorβ
β’ new RpcChannel(optionsOrProvider?
): RpcChannel
Parametersβ
Name | Type |
---|---|
optionsOrProvider? | RpcProviderOptions |
Returnsβ
Defined inβ
Propertiesβ
nodeUrlβ
β’ nodeUrl: string
Defined inβ
headersβ
β’ headers: object
Defined inβ
retriesβ
β’ Readonly
retries: number
Defined inβ
requestIdβ
β’ requestId: number
Defined inβ
blockIdentifierβ
β’ Readonly
blockIdentifier: BlockIdentifier
Defined inβ
chainIdβ
β’ Private
Optional
chainId: StarknetChainId
Defined inβ
specVersionβ
β’ Private
Optional
specVersion: string
Defined inβ
waitModeβ
β’ Readonly
waitMode: Boolean
Defined inβ
Methodsβ
setChainIdβ
βΈ setChainId(chainId
): void
Parametersβ
Name | Type |
---|---|
chainId | StarknetChainId |
Returnsβ
void
Defined inβ
fetchβ
βΈ fetch(method
, params?
, id?
): Promise
<Response
>
Parametersβ
Name | Type | Default value |
---|---|---|
method | string | undefined |
params? | object | undefined |
id | string | number | 0 |
Returnsβ
Promise
<Response
>
Defined inβ
errorHandlerβ
βΈ errorHandler(method
, params
, rpcError?
, otherError?
): void
Parametersβ
Name | Type |
---|---|
method | string |
params | any |
rpcError? | Error |
otherError? | any |
Returnsβ
void
Defined inβ
fetchEndpointβ
βΈ fetchEndpoint<T
>(method
, params?
): Promise
<Methods
[T
][``"result"``]>
Type parametersβ
Name | Type |
---|---|
T | extends keyof ReadMethods | keyof WriteMethods | keyof TraceMethods |
Parametersβ
Name | Type |
---|---|
method | T |
params? | Methods [T ][``"params"``] |
Returnsβ
Promise
<Methods
[T
][``"result"``]>
Defined inβ
getChainIdβ
βΈ getChainId(): Promise
<StarknetChainId
>
Returnsβ
Promise
<StarknetChainId
>
Defined inβ
getSpecVersionβ
βΈ getSpecVersion(): Promise
<string
>
Returnsβ
Promise
<string
>
Defined inβ
getNonceForAddressβ
βΈ getNonceForAddress(contractAddress
, blockIdentifier?
): Promise
<string
>
Parametersβ
Name | Type |
---|---|
contractAddress | BigNumberish |
blockIdentifier | BlockIdentifier |
Returnsβ
Promise
<string
>
Defined inβ
getBlockLatestAcceptedβ
βΈ getBlockLatestAccepted(): Promise
<BlockHashAndNumber
>
Get the most recent accepted block hash and number
Returnsβ
Promise
<BlockHashAndNumber
>
Defined inβ
getBlockNumberβ
βΈ getBlockNumber(): Promise
<number
>
Get the most recent accepted block number redundant use getBlockLatestAccepted();
Returnsβ
Promise
<number
>
Number of the latest block
Defined inβ
getBlockWithTxHashesβ
βΈ getBlockWithTxHashes(blockIdentifier?
): Promise
<BlockWithTxHashes
>
Parametersβ
Name | Type |
---|---|
blockIdentifier | BlockIdentifier |
Returnsβ
Promise
<BlockWithTxHashes
>
Defined inβ
getBlockWithTxsβ
βΈ getBlockWithTxs(blockIdentifier?
): Promise
<BlockWithTxs
>
Parametersβ
Name | Type |
---|---|
blockIdentifier | BlockIdentifier |
Returnsβ
Promise
<BlockWithTxs
>
Defined inβ
getBlockStateUpdateβ
βΈ getBlockStateUpdate(blockIdentifier?
): Promise
<StateUpdate
>
Parametersβ
Name | Type |
---|---|
blockIdentifier | BlockIdentifier |
Returnsβ
Promise
<StateUpdate
>
Defined inβ
getBlockTransactionsTracesβ
βΈ getBlockTransactionsTraces(blockIdentifier?
): Promise
<BlockTransactionsTraces
>
Parametersβ
Name | Type |
---|---|
blockIdentifier | BlockIdentifier |
Returnsβ
Promise
<BlockTransactionsTraces
>
Defined inβ
getBlockTransactionCountβ
βΈ getBlockTransactionCount(blockIdentifier?
): Promise
<number
>
Parametersβ
Name | Type |
---|---|
blockIdentifier | BlockIdentifier |
Returnsβ
Promise
<number
>
Defined inβ
getTransactionByHashβ
βΈ getTransactionByHash(txHash
): Promise
<TransactionWithHash
>
Parametersβ
Name | Type |
---|---|
txHash | BigNumberish |
Returnsβ
Promise
<TransactionWithHash
>
Defined inβ
getTransactionByBlockIdAndIndexβ
βΈ getTransactionByBlockIdAndIndex(blockIdentifier
, index
): Promise
<TransactionWithHash
>
Parametersβ
Name | Type |
---|---|
blockIdentifier | BlockIdentifier |
index | number |
Returnsβ
Promise
<TransactionWithHash
>
Defined inβ
getTransactionReceiptβ
βΈ getTransactionReceipt(txHash
): Promise
<TransactionReceipt
>
Parametersβ
Name | Type |
---|---|
txHash | BigNumberish |
Returnsβ
Promise
<TransactionReceipt
>
Defined inβ
getTransactionTraceβ
βΈ getTransactionTrace(txHash
): Promise
<TRANSACTION_TRACE
>
Parametersβ
Name | Type |
---|---|
txHash | BigNumberish |
Returnsβ
Promise
<TRANSACTION_TRACE
>
Defined inβ
getTransactionStatusβ
βΈ getTransactionStatus(transactionHash
): Promise
<TransactionStatus
>
Get the status of a transaction
Parametersβ
Name | Type |
---|---|
transactionHash | BigNumberish |
Returnsβ
Promise
<TransactionStatus
>
Defined inβ
simulateTransactionβ
βΈ simulateTransaction(invocations
, simulateTransactionOptions?
): Promise
<SimulateTransactionResponse
>
Parametersβ
Name | Type | Description |
---|---|---|
invocations | AccountInvocations | AccountInvocations |
simulateTransactionOptions | getSimulateTransactionOptions | blockIdentifier and flags to skip validation and fee charge - blockIdentifier - skipValidate (default false) - skipFeeCharge (default true) |
Returnsβ
Promise
<SimulateTransactionResponse
>
Defined inβ
waitForTransactionβ
βΈ waitForTransaction(txHash
, options?
): Promise
<TXN_RECEIPT
>
Parametersβ
Name | Type |
---|---|
txHash | BigNumberish |
options? | waitForTransactionOptions |
Returnsβ
Promise
<TXN_RECEIPT
>
Defined inβ
getStorageAtβ
βΈ getStorageAt(contractAddress
, key
, blockIdentifier?
): Promise
<string
>
Parametersβ
Name | Type |
---|---|
contractAddress | BigNumberish |
key | BigNumberish |
blockIdentifier | BlockIdentifier |
Returnsβ
Promise
<string
>
Defined inβ
getClassHashAtβ
βΈ getClassHashAt(contractAddress
, blockIdentifier?
): Promise
<string
>
Parametersβ
Name | Type |
---|---|
contractAddress | BigNumberish |
blockIdentifier | BlockIdentifier |
Returnsβ
Promise
<string
>
Defined inβ
getClassβ
βΈ getClass(classHash
, blockIdentifier?
): Promise
<ContractClass
>
Parametersβ
Name | Type |
---|---|
classHash | BigNumberish |
blockIdentifier | BlockIdentifier |
Returnsβ
Promise
<ContractClass
>
Defined inβ
getClassAtβ
βΈ getClassAt(contractAddress
, blockIdentifier?
): Promise
<ContractClass
>
Parametersβ
Name | Type |
---|---|
contractAddress | BigNumberish |
blockIdentifier | BlockIdentifier |
Returnsβ
Promise
<ContractClass
>
Defined inβ
getEstimateFeeβ
βΈ getEstimateFee(invocations
, Β«destructuredΒ»
): Promise
<FEE_ESTIMATE
[]>
Parametersβ
Name | Type |
---|---|
invocations | AccountInvocations |
Β«destructuredΒ» | getEstimateFeeBulkOptions |
Returnsβ
Promise
<FEE_ESTIMATE
[]>
Defined inβ
invokeβ
βΈ invoke(functionInvocation
, details
): Promise
<InvokedTransaction
>
Parametersβ
Name | Type |
---|---|
functionInvocation | Invocation |
details | InvocationsDetailsWithNonce |
Returnsβ
Promise
<InvokedTransaction
>
Defined inβ
declareβ
βΈ declare(Β«destructuredΒ»
, details
): Promise
<TXN_RECEIPT
| DeclaredTransaction
>
Parametersβ
Name | Type |
---|---|
Β«destructuredΒ» | DeclareContractTransaction |
details | InvocationsDetailsWithNonce |
Returnsβ
Promise
<TXN_RECEIPT
| DeclaredTransaction
>
Defined inβ
deployAccountβ
βΈ deployAccount(Β«destructuredΒ»
, details
): Promise
<TXN_RECEIPT
| DeployedAccountTransaction
>
Parametersβ
Name | Type |
---|---|
Β«destructuredΒ» | DeployAccountContractTransaction |
details | InvocationsDetailsWithNonce |
Returnsβ
Promise
<TXN_RECEIPT
| DeployedAccountTransaction
>
Defined inβ
callContractβ
βΈ callContract(call
, blockIdentifier?
): Promise
<string
[]>
Parametersβ
Name | Type |
---|---|
call | Call |
blockIdentifier | BlockIdentifier |
Returnsβ
Promise
<string
[]>
Defined inβ
estimateMessageFeeβ
βΈ estimateMessageFee(message
, blockIdentifier?
): Promise
<FEE_ESTIMATE
>
NEW: Estimate the fee for a message from L1
Parametersβ
Name | Type | Description |
---|---|---|
message | MSG_FROM_L1 | Message From L1 |
blockIdentifier | BlockIdentifier | - |
Returnsβ
Promise
<FEE_ESTIMATE
>
Defined inβ
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β
getEventsβ
βΈ getEvents(eventFilter
): Promise
<EVENTS_CHUNK
>
Returns all events matching the given filter
Parametersβ
Name | Type |
---|---|
eventFilter | EventFilter |
Returnsβ
Promise
<EVENTS_CHUNK
>
events and the pagination of the events
Defined inβ
buildTransactionβ
βΈ buildTransaction(invocation
, versionType?
): BROADCASTED_TXN
Parametersβ
Name | Type |
---|---|
invocation | AccountInvocationItem |
versionType? | "fee" | "transaction" |