methods: {
    _getPollInterval: ((type: "key-block" | "micro-block", options: {
        _expectedMineRate?: number;
        _microBlockCycle?: number;
        onNode: Node;
    }) => Promise<number>);
    awaitHeight: ((height: number, options: {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _microBlockCycle?: number;
        onNode: Node;
    }) => Promise<number>);
    buildAuthTxHash: ((transaction: `tx_${string}`, options: {
        fee?: Int;
        gasPrice?: Int;
        onNode: Node;
    }) => Promise<Buffer>);
    buildAuthTxHashByGaMetaTx: ((transaction: `tx_${string}`, options: {
        onNode: Node;
    }) => Promise<Buffer>);
    createGeneralizedAccount: ((authFnName: string, args: any[], options: CreateGeneralizedAccountOptions) => Promise<Readonly<{
        gaContractId: ContractAddress;
        owner: AccountAddress;
        rawTx: Encoded.Transaction;
        transaction: TxHash;
    }>>);
    getAccount: ((address: `ct_${string}` | `ak_${string}`, options: {
        hash?: `kh_${string}` | `mh_${string}`;
        height?: number;
        onNode: Node;
    }) => ReturnType<Node["getAccountByPubkey"]>);
    getBalance: ((address: `ct_${string}` | `ok_${string}` | `ak_${string}`, options: {
        format?: AE_AMOUNT_FORMATS;
    } & {
        hash?: `kh_${string}` | `mh_${string}`;
        height?: number;
        onNode: Node;
    }) => Promise<string>);
    getContract: ((contractId: `ct_${string}`, options: {
        onNode: Node;
    }) => ReturnType<Node["getContract"]>);
    getContractByteCode: ((contractId: `ct_${string}`, options: {
        onNode: Node;
    }) => ReturnType<Node["getContractCode"]>);
    getCurrentGeneration: ((options: {
        onNode: Node;
    }) => ReturnType<Node["getCurrentGeneration"]>);
    getGeneration: ((hashOrHeight: number | `kh_${string}`, options: {
        onNode: Node;
    }) => ReturnType<Node["getGenerationByHash"]>);
    getHeight: ((options: {
        cached?: boolean;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _microBlockCycle?: number;
        onNode: Node;
    }) => Promise<number>);
    getKeyBlock: ((hashOrHeight: number | `kh_${string}`, options: {
        onNode: Node;
    }) => ReturnType<Node["getKeyBlockByHash"]>);
    getMicroBlockHeader: ((hash: `mh_${string}`, options: {
        onNode: Node;
    }) => ReturnType<Node["getMicroBlockHeaderByHash"]>);
    getMicroBlockTransactions: ((hash: `mh_${string}`, options: {
        onNode: Node;
    }) => Promise<SignedTx[]>);
    getName: ((name: `${string}.chain`, options: {
        onNode: Node;
    }) => ReturnType<Node["getNameEntryByName"]>);
    payForTransaction: ((transaction: `tx_${string}`, options: PayForTransactionOptions) => ReturnType<typeof sendTransaction>);
    poll: ((th: `th_${string}`, options: {
        blocks?: number;
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _microBlockCycle?: number;
        onNode: Node;
    }) => ReturnType<Node["getTransactionByHash"]>);
    resolveName: (<Type>(nameOrId: `${string}.chain` | `${Type}_${string}`, key: string, options: {
        onNode: Node;
        resolveByNode?: boolean;
        verify?: boolean;
    }) => Promise<Generic<Type | Name>>);
    sendTransaction: ((txUnsigned: `tx_${string}`, options: SendTransactionOptions) => Promise<SendTransactionReturnType>);
    spend: ((amount: string | number, recipientIdOrName: `${string}.chain` | `ct_${string}` | `ak_${string}`, options: SpendOptions) => ReturnType<typeof sendTransaction>);
    transferFunds: ((fraction: string | number, recipientIdOrName: `${string}.chain` | `ct_${string}` | `ak_${string}`, options: TransferFundsOptions) => ReturnType<typeof sendTransaction>);
    txDryRun: ((tx: `tx_${string}`, accountAddress: `ak_${string}`, options: {
        combine?: boolean;
        onNode: Node;
        top?: number | `kh_${string}` | `mh_${string}`;
        txEvents?: boolean;
    }) => Promise<{
        txEvents?: DryRunResults["txEvents"];
    } & DryRunResult>);
    waitForTxConfirm: ((txHash: `th_${string}`, options: {
        confirm?: number;
        onNode: Node;
    } & {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _microBlockCycle?: number;
        onNode: Node;
    }) => Promise<number>);
} = ...

Type declaration

  • _getPollInterval: ((type: "key-block" | "micro-block", options: {
        _expectedMineRate?: number;
        _microBlockCycle?: number;
        onNode: Node;
    }) => Promise<number>)
      • (type, options): Promise<number>
      • Parameters

        • type: "key-block" | "micro-block"

          Type

        • options: {
              _expectedMineRate?: number;
              _microBlockCycle?: number;
              onNode: Node;
          }

          Options

          • Optional_expectedMineRate?: number
          • Optional_microBlockCycle?: number
          • onNode: Node

        Returns Promise<number>

  • awaitHeight: ((height: number, options: {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _microBlockCycle?: number;
        onNode: Node;
    }) => Promise<number>)
      • (height, options): Promise<number>
      • Wait for the chain to reach a specific height

        Parameters

        • height: number

          Height to wait for

        • options: {
              interval?: number;
              onNode: Node;
          } & {
              _expectedMineRate?: number;
              _microBlockCycle?: number;
              onNode: Node;
          }

          Options

        Returns Promise<number>

        Current chain height

  • buildAuthTxHash: ((transaction: `tx_${string}`, options: {
        fee?: Int;
        gasPrice?: Int;
        onNode: Node;
    }) => Promise<Buffer>)
      • (transaction, options): Promise<Buffer>
      • Build a transaction hash the same as Auth.tx_hash by GaMetaTx payload

        Parameters

        • transaction: `tx_${string}`

          tx-encoded transaction

        • options: {
              fee?: Int;
              gasPrice?: Int;
              onNode: Node;
          }

          Options

          • Optionalfee?: Int

            GaMetaTx fee, required in Ceres

          • OptionalgasPrice?: Int

            GaMetaTx gasPrice, required in Ceres

          • onNode: Node

            Node to use

        Returns Promise<Buffer>

        Transaction hash

  • buildAuthTxHashByGaMetaTx: ((transaction: `tx_${string}`, options: {
        onNode: Node;
    }) => Promise<Buffer>)
      • (transaction, options): Promise<Buffer>
      • Build a transaction hash the same as Auth.tx_hash by GaMetaTx

        Parameters

        • transaction: `tx_${string}`

          tx-encoded signed GaMeta transaction

        • options: {
              onNode: Node;
          }

          Options

          • onNode: Node

            Node to use

        Returns Promise<Buffer>

        Transaction hash

  • createGeneralizedAccount: ((authFnName: string, args: any[], options: CreateGeneralizedAccountOptions) => Promise<Readonly<{
        gaContractId: ContractAddress;
        owner: AccountAddress;
        rawTx: Encoded.Transaction;
        transaction: TxHash;
    }>>)
  • getAccount: ((address: `ct_${string}` | `ak_${string}`, options: {
        hash?: `kh_${string}` | `mh_${string}`;
        height?: number;
        onNode: Node;
    }) => ReturnType<Node["getAccountByPubkey"]>)
      • (address, options): ReturnType<Node["getAccountByPubkey"]>
      • Get account by account public key

        Parameters

        • address: `ct_${string}` | `ak_${string}`

          Account address (public key)

        • options: {
              hash?: `kh_${string}` | `mh_${string}`;
              height?: number;
              onNode: Node;
          }

          Options

          • Optionalhash?: `kh_${string}` | `mh_${string}`

            Get account on specific block by micro block hash or key block hash

          • Optionalheight?: number

            Get account on specific block by block height

          • onNode: Node

            Node to use

        Returns ReturnType<Node["getAccountByPubkey"]>

  • getBalance: ((address: `ct_${string}` | `ok_${string}` | `ak_${string}`, options: {
        format?: AE_AMOUNT_FORMATS;
    } & {
        hash?: `kh_${string}` | `mh_${string}`;
        height?: number;
        onNode: Node;
    }) => Promise<string>)
      • (address, options): Promise<string>
      • Request the balance of specified account

        Parameters

        • address: `ct_${string}` | `ok_${string}` | `ak_${string}`

          The public account address to obtain the balance for

        • options: {
              format?: AE_AMOUNT_FORMATS;
          } & {
              hash?: `kh_${string}` | `mh_${string}`;
              height?: number;
              onNode: Node;
          }

          Options

        Returns Promise<string>

  • getContract: ((contractId: `ct_${string}`, options: {
        onNode: Node;
    }) => ReturnType<Node["getContract"]>)
      • (contractId, options): ReturnType<Node["getContract"]>
      • Get contract entry

        Parameters

        • contractId: `ct_${string}`

          Contract address

        • options: {
              onNode: Node;
          }

          Options

          • onNode: Node

            Node to use

        Returns ReturnType<Node["getContract"]>

  • getContractByteCode: ((contractId: `ct_${string}`, options: {
        onNode: Node;
    }) => ReturnType<Node["getContractCode"]>)
  • getCurrentGeneration: ((options: {
        onNode: Node;
    }) => ReturnType<Node["getCurrentGeneration"]>)
  • getGeneration: ((hashOrHeight: number | `kh_${string}`, options: {
        onNode: Node;
    }) => ReturnType<Node["getGenerationByHash"]>)
      • (hashOrHeight, options): ReturnType<Node["getGenerationByHash"]>
      • Get generation by hash or height

        Parameters

        • hashOrHeight: number | `kh_${string}`

          Generation hash or height

        • options: {
              onNode: Node;
          }

          Options

          • onNode: Node

            Node to use

        Returns ReturnType<Node["getGenerationByHash"]>

        Generation

  • getHeight: ((options: {
        cached?: boolean;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _microBlockCycle?: number;
        onNode: Node;
    }) => Promise<number>)
      • (options): Promise<number>
      • Obtain current height of the chain

        Parameters

        • options: {
              cached?: boolean;
              onNode: Node;
          } & {
              _expectedMineRate?: number;
              _microBlockCycle?: number;
              onNode: Node;
          }

          Options

        Returns Promise<number>

        Current chain height

  • getKeyBlock: ((hashOrHeight: number | `kh_${string}`, options: {
        onNode: Node;
    }) => ReturnType<Node["getKeyBlockByHash"]>)
  • getMicroBlockHeader: ((hash: `mh_${string}`, options: {
        onNode: Node;
    }) => ReturnType<Node["getMicroBlockHeaderByHash"]>)
  • getMicroBlockTransactions: ((hash: `mh_${string}`, options: {
        onNode: Node;
    }) => Promise<SignedTx[]>)
      • (hash, options): Promise<SignedTx[]>
      • Get micro block transactions

        Parameters

        • hash: `mh_${string}`

          Micro block hash

        • options: {
              onNode: Node;
          }

          Options

          • onNode: Node

            Node to use

        Returns Promise<SignedTx[]>

        Transactions

  • getName: ((name: `${string}.chain`, options: {
        onNode: Node;
    }) => ReturnType<Node["getNameEntryByName"]>)
  • payForTransaction: ((transaction: `tx_${string}`, options: PayForTransactionOptions) => ReturnType<typeof sendTransaction>)
      • (transaction, options): ReturnType<typeof sendTransaction>
      • Submit transaction of another account paying for it (fee and gas)

        Parameters

        Returns ReturnType<typeof sendTransaction>

        Object Transaction

  • poll: ((th: `th_${string}`, options: {
        blocks?: number;
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _microBlockCycle?: number;
        onNode: Node;
    }) => ReturnType<Node["getTransactionByHash"]>)
      • (th, options): ReturnType<Node["getTransactionByHash"]>
      • Return transaction details if it is mined, fail otherwise. If the transaction has ttl specified then would wait till it leaves the mempool. Otherwise would fail if a specified amount of blocks were mined.

        Parameters

        • th: `th_${string}`

          The hash of transaction to poll

        • options: {
              blocks?: number;
              interval?: number;
              onNode: Node;
          } & {
              _expectedMineRate?: number;
              _microBlockCycle?: number;
              onNode: Node;
          }

          Options

        Returns ReturnType<Node["getTransactionByHash"]>

        The transaction as it was mined

  • resolveName: (<Type>(nameOrId: `${string}.chain` | `${Type}_${string}`, key: string, options: {
        onNode: Node;
        resolveByNode?: boolean;
        verify?: boolean;
    }) => Promise<Generic<Type | Name>>)
      • <Type>(nameOrId, key, options): Promise<Generic<Type | Name>>
      • Resolve AENS name and return name hash

        Type Parameters

        Parameters

        • nameOrId: `${string}.chain` | `${Type}_${string}`

          AENS name or address

        • key: string

          in AENS pointers record

        • options: {
              onNode: Node;
              resolveByNode?: boolean;
              verify?: boolean;
          }

          Options

          • onNode: Node

            Node to use

          • OptionalresolveByNode?: boolean

            Enables pointer resolving using node

          • Optionalverify?: boolean

            To ensure that name exist and have a corresponding pointer // TODO: avoid that to don't trust to current api gateway

        Returns Promise<Generic<Type | Name>>

        Address or AENS name hash

  • sendTransaction: ((txUnsigned: `tx_${string}`, options: SendTransactionOptions) => Promise<SendTransactionReturnType>)
  • spend: ((amount: string | number, recipientIdOrName: `${string}.chain` | `ct_${string}` | `ak_${string}`, options: SpendOptions) => ReturnType<typeof sendTransaction>)
      • (amount, recipientIdOrName, options): ReturnType<typeof sendTransaction>
      • Send coins to another account

        Parameters

        • amount: string | number

          Amount to spend

        • recipientIdOrName: `${string}.chain` | `ct_${string}` | `ak_${string}`

          Address or name of recipient account

        • options: SpendOptions

          Options

        Returns ReturnType<typeof sendTransaction>

        Transaction

  • transferFunds: ((fraction: string | number, recipientIdOrName: `${string}.chain` | `ct_${string}` | `ak_${string}`, options: TransferFundsOptions) => ReturnType<typeof sendTransaction>)
      • (fraction, recipientIdOrName, options): ReturnType<typeof sendTransaction>
      • Spend a fraction of coin balance to another account. Useful if needed to drain account balance completely, sending funds to another account (with fraction set to 1).

        Parameters

        • fraction: string | number

          Fraction of balance to spend (between 0 and 1)

        • recipientIdOrName: `${string}.chain` | `ct_${string}` | `ak_${string}`

          Address or name of recipient account

        • options: TransferFundsOptions

          Options

        Returns ReturnType<typeof sendTransaction>

        // `fraction` * 100 = % of AE to be transferred (e.g. `0.42` for 42% or `1` for 100%)
        const { blockHeight } = await aeSdk.transferFunds(
        0.42,
        'ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E',
        );
        console.log('Transaction mined at', blockHeight);
  • txDryRun: ((tx: `tx_${string}`, accountAddress: `ak_${string}`, options: {
        combine?: boolean;
        onNode: Node;
        top?: number | `kh_${string}` | `mh_${string}`;
        txEvents?: boolean;
    }) => Promise<{
        txEvents?: DryRunResults["txEvents"];
    } & DryRunResult>)
      • (tx, accountAddress, options): Promise<{
            txEvents?: DryRunResults["txEvents"];
        } & DryRunResult>
      • Transaction dry-run

        Parameters

        • tx: `tx_${string}`

          transaction to execute

        • accountAddress: `ak_${string}`

          address that will be used to execute transaction

        • options: {
              combine?: boolean;
              onNode: Node;
              top?: number | `kh_${string}` | `mh_${string}`;
              txEvents?: boolean;
          }

          Options

          • Optionalcombine?: boolean

            Enables combining of similar requests to a single dry-run call

          • onNode: Node

            Node to use

          • Optionaltop?: number | `kh_${string}` | `mh_${string}`

            hash of block on which to make dry-run

          • OptionaltxEvents?: boolean

            collect and return on-chain tx events that would result from the call

        Returns Promise<{
            txEvents?: DryRunResults["txEvents"];
        } & DryRunResult>

  • waitForTxConfirm: ((txHash: `th_${string}`, options: {
        confirm?: number;
        onNode: Node;
    } & {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _microBlockCycle?: number;
        onNode: Node;
    }) => Promise<number>)
      • (txHash, options): Promise<number>
      • Wait for transaction confirmation

        Parameters

        • txHash: `th_${string}`

          Transaction hash

        • options: {
              confirm?: number;
              onNode: Node;
          } & {
              interval?: number;
              onNode: Node;
          } & {
              _expectedMineRate?: number;
              _microBlockCycle?: number;
              onNode: Node;
          }

          Options

        Returns Promise<number>

        Current Height