Abstract class to define the functionalities of a transaction request transaction request.

Hierarchy (view full)

Implements

  • BaseTransactionRequestLike

Constructors

  • Constructor for initializing a base transaction request.

    Parameters

    • baseTransactionRequest: BaseTransactionRequestLike = {}

      Optional object containing properties to initialize the transaction request.

    Returns BaseTransactionRequest

Properties

List of inputs

maturity?: number

Block until which tx cannot be included

maxFee: BN

The maximum fee payable by this transaction using BASE_ASSET.

outputs: TransactionRequestOutput[] = []

List of outputs

tip?: BN

Gas price for transaction

Type of the transaction

witnessLimit?: BN

The maximum amount of witness data allowed for the transaction

witnesses: BytesLike[] = []

List of witnesses

Methods

  • Helper function to add an external signature to the transaction.

    Parameters

    • account: Account | Account[]

      The account/s to sign to the transaction.

    Returns Promise<BaseTransactionRequest>

    The transaction with the signature witness added.

  • Adds a change output to the transaction.

    Parameters

    Returns void

  • Adds a single coin input to the transaction and a change output for the related assetId, if one it was not added yet.

    Parameters

    • coin: Coin

      Coin resource.

    Returns void

  • Adds a single message input to the transaction and a change output for the asset against the message

    Parameters

    Returns void

  • Adds a single resource to the transaction by adding a coin/message input and a change output for the related assetId, if one it was not added yet.

    Parameters

    Returns BaseTransactionRequest

    This transaction.

  • Adds multiple resources to the transaction by adding coin/message inputs and change outputs from the related assetIds.

    Parameters

    • resources: readonly Resource[]

      The resources to add.

    Returns BaseTransactionRequest

    This transaction.

  • Returns number

  • Parameters

    Returns BN

  • Funds the transaction with fake UTXOs for each assetId and amount in the quantities array.

    Parameters

    • quantities: CoinQuantity[]

      CoinQuantity Array.

    • baseAssetId: string

      The base asset to fund the transaction.

    • OptionalresourcesOwner: AbstractAddress

    Returns BaseTransactionRequest

    • This method is deprecated and will be removed in future versions. Please use Account.generateFakeResources along with this.addResources instead.
  • Method to obtain the base transaction details.

    Returns ToBaseTransactionResponse

    The base transaction details.

  • Retrieves an array of CoinQuantity for each coin output present in the transaction. a transaction.

    Returns CoinQuantity[]

    CoinQuantity array.

  • Gets the Transaction Request by hashing the transaction.

    Parameters

    • chainId: number

      The chain ID.

    Returns string

    • A hash of the transaction, which is the transaction ID.
  • Parameters

    • index: number

    Returns void

  • Return the minimum amount in native coins required to create a transaction.

    Returns any

    The transaction as a JSON object.

  • Converts the transaction request to a byte array.

    Returns Uint8Array

    The transaction bytes.

  • Parameters

    Returns void

  • Updates an existing witness without any side effects.

    Parameters

    • index: number

      The index of the witness to update.

    • witness: BytesLike

      The new witness.

    Returns void

    If the witness does not exist.

  • Updates the witness for a given owner and signature.

    Parameters

    • address: string | AbstractAddress

      The address to get the coin input witness index for.

    • signature: BytesLike

      The signature to update the witness with.

    Returns void

  • Parameters

    Returns {
        policies: Policy[];
        policyTypes: number;
    }

    • policies: Policy[]
    • policyTypes: number