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

Hierarchy (view full)

Constructors

Properties

blobId: string

Blob ID

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: Blob = ...

Type of the transaction

witnessIndex: number

Witness index of the bytecode to create

witnessLimit?: BN

The maximum amount of witness data allowed for the transaction

witnesses: BytesLike[] = []

List of witnesses

Methods

  • 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 BlobTransactionRequest

    This transaction.

  • Returns number

  • 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 BlobTransactionRequest

    • 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.

  • 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.
  • Calculates the metadata gas cost for a blob transaction.

    Parameters

    • gasCosts: GasCosts

      gas costs passed from the chain.

    Returns BN

    metadata gas cost for the blob transaction.

  • 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.

  • 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