Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TxAPI

Hierarchy

  • BaseAPI
    • TxAPI

Index

Constructors

constructor

Properties

lcd

Methods

broadcast

broadcastAsync

  • broadcastAsync(tx: Tx): Promise<Async>
  • Broadcast the transaction using the "async" mode, returning after CheckTx() is performed.

    Parameters

    • tx: Tx

      transaction to broadcast

    Returns Promise<Async>

broadcastSync

  • NOTE: This is not a synchronous function and is unconventionally named. This function can be await as it returns a Promise.

    Broadcast the transaction using the "sync" mode, returning after DeliverTx() is performed.

    Parameters

    • tx: Tx

      transaction to broadcast

    Returns Promise<SyncTxBroadcastResult>

computeTax

create

  • Builds a [[StdSignMsg]] that is ready to be signed by a Key. The appropriate account number and sequence will be fetched live from the blockchain and added to the resultant [[StdSignMsg]]. If no fee is provided, fee will be automatically estimated using the parameters, simulated using a "dummy fee" with sourceAddress's nonzero denominations in its balance.

    Parameters

    Returns Promise<Tx>

encode

  • encode(tx: Tx): string

estimateFee

estimateGas

  • estimateGas(tx: Tx, options?: { gasAdjustment?: Value }): Promise<number>
  • Parameters

    • tx: Tx
    • Optional options: { gasAdjustment?: Value }
      • Optional gasAdjustment?: Value

    Returns Promise<number>

hash

  • hash(tx: Tx): Promise<string>

search

txInfo

  • txInfo(txHash: string, params?: APIParams): Promise<TxInfo>
  • Looks up a transaction on the blockchain, addressed by its hash

    Parameters

    • txHash: string

      transaction's hash

    • params: APIParams = {}

    Returns Promise<TxInfo>

txInfosByHeight

  • txInfosByHeight(height: undefined | number): Promise<TxInfo[]>
  • Looks up transactions on the blockchain for the block height. If height is undefined, gets the transactions for the latest block.

    Parameters

    • height: undefined | number

      block height

    Returns Promise<TxInfo[]>