Client class to interact with the NEAR RPC API.

Hierarchy

  • Provider
    • JsonRpcProvider

Constructors

Methods

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

    Parameters

    • accountIdArray: string[]
    • blockQuery: BlockReference

    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

    • accountIdArray: string[]
    • blockQuery: BlockReference

    Returns Promise<ChangeResult>

  • 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

    • accountIdArray: string[]
    • blockQuery: BlockReference

    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
    • keyPrefix: 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>

  • Directly call the RPC specifying the method and params

    Type Parameters

    • T

    Parameters

    • method: string

      RPC method

    • params: object

      Parameters to the method

    Returns Promise<T>

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

    Parameters

    • signedTransaction: SignedTransaction

      The signed transaction being sent

    Returns Promise<FinalExecutionOutcome>

  • Sends a signed transaction to the RPC

    Parameters

    • signedTransaction: SignedTransaction

      The signed transaction being sent

    • waitUntil: TxExecutionStatus

    Returns Promise<FinalExecutionOutcome>

  • Gets single access key changes for a given array of access keys pass block_id OR finality as blockQuery, not both See docs for more info

    Parameters

    • accessKeyArray: AccessKeyWithPublicKey[]
    • blockQuery: BlockReference

    Returns Promise<ChangeResult>

  • 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 = 'EXECUTED_OPTIMISTIC'

    Returns Promise<FinalExecutionOutcome>

  • Parameters

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

    Returns Promise<FinalExecutionOutcome>