This class provides common account related RPC calls including signing transactions with a KeyPair.

Hierarchy

Constructors

Properties

accountId: string
connection: Connection
getCode: getCodeFunction
helperUrl: string = 'https://helper.testnet.near.org'
onAddRequestResult: ((any) => any)

Type declaration

    • (any): any
    • Parameters

      • any: any

      Returns any

onConfirmResult: ((any) => any)

Type declaration

    • (any): any
    • Parameters

      • any: any

      Returns any

sendCode: sendCodeFunction

Account2FA has options object where you can provide callbacks for:

  • sendCode: how to send the 2FA code in case you don't use NEAR Contract Helper
  • getCode: how to get code from user (use this to provide custom UI/UX for prompt of 2FA code)
  • onResult: the tx result after it's been confirmed by NEAR Contract Helper

storage: any
verifyCode: verifyCodeFunction

Methods

  • Returns the NEAR tokens balance and validators of a given account that is delegated to the staking pools that are part of the validators set in the current epoch.

    NOTE: If the tokens are delegated to a staking pool that is currently on pause or does not have enough tokens to participate in validation, they won't be accounted for.

    Returns Promise<ActiveDelegatedStakeBalance>

  • Returns Promise<{
        blockNumber: string;
        blockNumberSignature: string;
    }>

  • Returns the state (key value pairs) of this account's contract based on the key prefix. Pass an empty string for prefix if you would like to return the entire state.

    Parameters

    • prefix: string | Uint8Array

      allows to filter which keys should be returned. Empty prefix means all keys. String prefix is utf-8 encoded.

    • blockQuery: BlockReference = ...

      specifies which block to query state at. By default returns last "optimistic" block (i.e. not necessarily finalized).

    Returns Promise<{
        key: Buffer;
        value: Buffer;
    }[]>

Generated using TypeDoc