Client class to interact with the NEAR RPC API.

Implements

  • Provider

Constructors

  • Parameters

    • providers: Provider[]

      list of providers

    Returns FailoverRpcProvider

Methods

  • Gets access key changes for a given array of accountIds See docs for more info

    Parameters

    Returns Promise<ChangeResult>

  • Gets account changes for a given array of accountIds pass block_id OR finality as blockQuery, not both See docs for more info

    Parameters

    Returns Promise<ChangeResult>

  • Parameters

    • accountId: string
    • method: string
    • args: Record<string, unknown>
    • OptionalblockQuery: BlockReference

    Returns Promise<string | number | boolean | object>

  • Parameters

    • accountId: string
    • method: string
    • args: Record<string, unknown>
    • OptionalblockQuery: BlockReference

    Returns Promise<CallContractViewFunctionResultRaw>

  • Queries for details about a specific chunk appending details of receipts and transactions to the same chunk data provided by a block

    Parameters

    • chunkId: ChunkId

      Hash of a chunk ID or shard ID

    Returns Promise<ChunkResult>

  • Gets contract code changes for a given array of accountIds pass block_id OR finality as blockQuery, not both Note: Change is returned in a base64 encoded WASM file See docs for more info

    Parameters

    Returns Promise<ChangeResult>

  • Gets contract state changes for a given array of accountIds pass block_id OR finality as blockQuery, not both Note: If you pass a keyPrefix it must be base64 encoded See docs for more info

    Parameters

    • accountIdArray: string[]
    • blockQuery: BlockReference
    • OptionalkeyPrefix: string

    Returns Promise<ChangeResult>

  • Gets the protocol config at a block from RPC

    Parameters

    • blockReference: BlockReference | { sync_checkpoint: "genesis" }

      specifies the block to get the protocol config for

    Returns Promise<NearProtocolConfig>

  • Returns gas price for a specific block_height or block_hash.

    Parameters

    • blockId: BlockId

      Block hash or height, or null for latest.

    Returns Promise<GasPrice>

  • Returns Promise<bigint>

  • Returns Promise<string>

  • Returns Promise<bigint>

  • Sends a signed transaction to the RPC and immediately returns transaction hash See docs for more info

    Parameters

    Returns Promise<FinalExecutionOutcome>

  • Parameters

    Returns Promise<FinalExecutionOutcome>

  • Gets a transaction's status from the RPC

    Parameters

    • txHash: string | Uint8Array

      A transaction hash as either a Uint8Array or a base58 encoded string

    • accountId: string

      The NEAR account that signed the transaction

    • waitUntil: TxExecutionStatus

    Returns Promise<FinalExecutionOutcome>

  • Gets a transaction's status from the RPC with receipts See docs for more info

    Parameters

    • txHash: string | Uint8Array

      The hash of the transaction

    • accountId: string

      The NEAR account that signed the transaction

    • waitUntil: TxExecutionStatus

    Returns Promise<FinalExecutionOutcome>

  • Parameters

    • accountId: string
    • publicKey: PublicKey
    • OptionalfinalityQuery: FinalityReference

    Returns Promise<AccessKeyView>

  • Parameters

    • accountId: string
    • OptionalfinalityQuery: FinalityReference

    Returns Promise<AccessKeyList>

  • Parameters

    Returns Promise<AccountView>

  • Parameters

    Returns Promise<ChunkResult>

  • Parameters

    Returns Promise<ContractCodeView>

  • Parameters

    • accountId: string
    • Optionalprefix: string
    • OptionalblockQuery: BlockReference

    Returns Promise<ContractStateView>

  • Parameters

    Returns Promise<GasPrice>

  • Returns Promise<NodeStatusResult>

  • Parameters

    • receiptId: string

    Returns Promise<ExecutionOutcomeReceiptDetail>

  • Parameters

    • txHash: string | Uint8Array
    • accountId: string
    • waitUntil: TxExecutionStatus

    Returns Promise<FinalExecutionOutcome>

  • Parameters

    • txHash: string | Uint8Array
    • accountId: string
    • waitUntil: TxExecutionStatus

    Returns Promise<
        FinalExecutionOutcome & Required<
            Pick<FinalExecutionOutcome, "receipts">,
        >,
    >