CreateTransactionRequest provides functionalities for creating a transaction request that creates a contract.

Hierarchy (view full)

Constructors

Properties

bytecodeWitnessIndex: number

Witness index of contract bytecode to create

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

salt: string

Salt

storageSlots: TransactionRequestStorageSlot[]

List of storage slots to initialize

tip?: BN

Gas price for transaction

type: Create = ...

Type of the transaction

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 contract created output to the transaction request.

    Parameters

    Returns void

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

    Parameters

    Returns void

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

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