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

Hierarchy (view full)

Constructors

  • Creates an instance UploadTransactionRequest.

    Parameters

    • uploadTransactionRequestLike: UploadTransactionRequestLike = {}

      The initial values for the instance

    Returns UploadTransactionRequest

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

subsection: Omit<UploadSubsectionRequest, "subsection">

The subsection data.

tip?: BN

Gas price for transaction

type: Upload = ...

Type of the transaction

witnessIndex: number

The witness index of the subsection of the bytecode.

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 the subsection.

    Parameters

    • subsection: UploadSubsectionRequest

      The subsection data.

    Returns void

  • Returns number

  • Calculates the minimum gas for an upload transaction.

    Parameters

    Returns BN

    the minimum gas for the upload transaction

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

    • 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 an upload transaction.

    Parameters

    • gasCosts: GasCosts

      gas costs passed from the chain.

    Returns BN

    metadata gas cost for the upload 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