An abstraction for creating and signing transactions.

Constructors

Properties

chainID: string

The chain ID of the Network (e.g. "1" for Mainnet).

data: Uint8Array

The payload of the transaction.

gasLimit: bigint

The maximum amount of gas to be consumed when processing the transaction.

gasPrice: bigint

The gas price to be used.

guardian: string

The address of the guardian, in bech32 format.

guardianSignature: Uint8Array

The signature of the guardian.

nonce: bigint

The nonce of the transaction (the account sequence number of the sender).

options: number

The options field, useful for describing different settings available for transactions.

receiver: string

The address of the receiver, in bech32 format.

receiverUsername: string

The username of the receiver.

sender: string

The address of the sender, in bech32 format.

senderUsername: string

The username of the sender.

signature: Uint8Array

The signature.

value: bigint

The value to transfer.

version: number

The version, required by the Network in order to correctly interpret the contents of the transaction.

Methods

  • Legacy method, use the "guardianSignature" property instead. Applies the guardian signature on the transaction.

    Parameters

    • guardianSignature: Uint8Array | ISignature

      The signature, as computed by a signer.

    Returns void

  • Legacy method, use the "signature" property instead. Applies the signature on the transaction.

    Parameters

    • signature: Uint8Array | ISignature

      The signature, as computed by a signer.

    Returns void

  • Legacy method, use "TransactionComputer.computeTransactionFee()" instead.

    Computes the current transaction fee based on the NetworkConfig and transaction properties

    Parameters

    Returns BigNumber

  • Legacy method, use the "guardianSignature" property instead.

    Returns Buffer

  • Legacy method, use the "receiverUsername" property instead.

    Returns string

  • Legacy method, use the "senderUsername" property instead.

    Returns string

  • Legacy method, use the "signature" property instead.

    Returns Buffer

  • Checks the integrity of the guarded transaction

    Returns boolean

  • Legacy method, use "TransactionComputer.computeBytesForSigning()" instead. Serializes a transaction to a sequence of bytes, ready to be signed. This function is called internally by signers.

    Returns Buffer

  • Legacy method, use the "chainID" property instead.

    Parameters

    Returns void

  • Legacy method, use the "gasLimit" property instead.

    Parameters

    Returns void

  • Legacy method, use the "gasPrice" property instead.

    Parameters

    Returns void

  • Legacy method, use the "guardian" property instead.

    Parameters

    Returns void

  • Legacy method, use the "nonce" property instead. Sets the account sequence number of the sender. Must be done prior signing.

    Parameters

    Returns void

  • Legacy method, use the "options" property instead.

    Question for review: check how the options are set by sdk-dapp, wallet, ledger, extension.

    Parameters

    Returns void

  • Legacy method, use the "receiverUsername" property instead.

    Parameters

    • receiverUsername: string

    Returns void

  • Legacy method, use the "sender" property instead.

    Parameters

    Returns void

  • Legacy method, use the "senderUsername" property instead.

    Parameters

    • senderUsername: string

    Returns void

  • Converts a transaction to a ready-to-broadcast object. Called internally by the network provider.

    Returns any

  • Legacy method, use "TransactionsConverter.plainObjectToTransaction()" instead. Converts a plain object transaction into a Transaction Object.

    Parameters

    • plainObjectTransaction: IPlainTransactionObject

      Raw data of a transaction, usually obtained by calling toPlainObject()

    Returns Transaction