Class RpcClient

Hierarchy

  • RpcClient

Implements

Constructors

Properties

Methods

getAccountInfo getAccountInfoByBlockHash getAccountInfoByBlockHeight getAuctionInfoByHash getAuctionInfoByHeight getAuctionInfoV1ByHash getAuctionInfoV1ByHeight getAuctionInfoV2ByHash getAuctionInfoV2ByHeight getBalanceByStateRootHash getBlockByHash getBlockByHeight getBlockTransfersByHash getBlockTransfersByHeight getChainspec getDelegatorRewardByBlockHash getDelegatorRewardByBlockHeight getDelegatorRewardByEraID getDeploy getDeployFinalizedApproval getDictionaryItem getDictionaryItemByIdentifier getEntityByBlockHash getEntityByBlockHeight getEraInfoByBlockHash getEraInfoByBlockHeight getEraInfoLatest getEraSummaryByHash getEraSummaryByHeight getEraSummaryLatest getLatestAuctionInfo getLatestAuctionInfoV1 getLatestAuctionInfoV2 getLatestBalance getLatestBlock getLatestBlockTransfers getLatestDelegatorReward getLatestEntity getLatestValidatorReward getPeers getStateItem getStateRootHashByHash getStateRootHashByHeight getStateRootHashLatest getStatus getTransactionByDeployHash getTransactionByTransactionHash getTransactionFinalizedApprovalByDeployHash getTransactionFinalizedApprovalByTransactionHash getValidatorChangesInfo getValidatorRewardByBlockHash getValidatorRewardByBlockHeight getValidatorRewardByEraID parseResponse processRequest putDeploy putTransaction queryBalanceByBlockHash queryBalanceByBlockHeight queryBalanceByStateRootHash queryBalanceDetailsByBlockHash queryBalanceDetailsByBlockHeight queryBalanceDetailsByStateRootHash queryGlobalStateByBlockHash queryGlobalStateByBlockHeight queryGlobalStateByStateHash queryLatestBalance queryLatestBalanceDetails queryLatestGlobalState waitForConfirmation waitForDeploy waitForTransaction

Constructors

Properties

handler: IHandler

Methods

  • Type Parameters

    • T

    Parameters

    • type: (new (params: any) => T)
        • new (params: any): T
        • Parameters

          • params: any

          Returns T

    • response: any

    Returns T

  • Waits for a transaction to be confirmed within a given timeout period. Implements a retry mechanism to handle transient errors from the getInfo function.

    Returns

    A promise that resolves with the transaction info if confirmed, otherwise rejects on timeout or persistent errors.

    Throws

    If the timeout is reached before confirmation or if getInfo fails consistently beyond the allowed retries.

    Type Parameters

    • T

      The expected return type of the transaction info.

    Parameters

    • getInfo: ((hash: string) => Promise<T>)

      A function that fetches transaction info based on its hash.

        • (hash: string): Promise<T>
        • Parameters

          • hash: string

          Returns Promise<T>

    • hash: string

      The transaction hash to monitor.

    • timeout: number

      The maximum time (in milliseconds) to wait for confirmation.

    • maxRetries: number = 3

      The maximum number of retries for transient errors.

    • retryDelay: number = 500

      The delay (in milliseconds) between retry attempts.

    Returns Promise<T>

  • Waits for a deploy to be confirmed on-chain.

    Returns

    A promise that resolves to InfoGetDeployResult if successful.

    Throws

    An error if the deploy times out.

    Parameters

    • deploy: Deploy

      The deploy instance.

    • timeout: number = 60000

      Optional timeout in milliseconds (default: 60000ms).

    Returns Promise<InfoGetDeployResult>

  • Waits for a transaction to be confirmed on-chain.

    Returns

    A promise that resolves to InfoGetTransactionResult if successful.

    Throws

    An error if the transaction times out.

    Parameters

    • transaction: Transaction

      The transaction instance.

    • timeout: number = 6000

      Optional timeout in milliseconds (default: 6000ms).

    Returns Promise<InfoGetTransactionResult>

Generated using TypeDoc