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

Hierarchy (view full)

Constructors

  • Creates an instance UpgradeTransactionRequest.

    Parameters

    • upgradeTransactionRequestLike: UpgradeTransactionRequestLike = {}

      The initial values for the instance

    Returns UpgradeTransactionRequest

Properties

bytecodeWitnessIndex: number

Witness index of consensus

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

The type of transaction

upgradePurpose: UpgradePurposeRequest

The upgrade purpose

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 consensus parameters upgrade purpose.

    Parameters

    Returns UpgradeTransactionRequest

    • The current instance of UpgradeTransactionRequest.
  • Adds a single message input to the transaction and a change output for the asset against the message

    Parameters

    Returns void

  • Adds a state transition upgrade purpose.

    Parameters

    • bytecodeRoot: BytesLike

      The Merkle root of the state transition.

    Returns UpgradeTransactionRequest

    • The current instance of UpgradeTransactionRequest.
  • 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 UpgradeTransactionRequest

    • 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 ID 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 upgrade transaction.

    Parameters

    • gasCosts: GasCosts

      gas costs passed from the chain.

    Returns BN

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