Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Nightly /
UploadTransactionRequest

@fuel-ts/account v0.96.1 • Docs


Icon LinkClass: UploadTransactionRequest

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

Icon LinkExtends

Icon LinkConstructors

Icon Linknew UploadTransactionRequest()

Icon InfoCircle

new UploadTransactionRequest(uploadTransactionRequestLike): UploadTransactionRequest

Creates an instance UploadTransactionRequest.

Icon LinkParameters

• uploadTransactionRequestLike: UploadTransactionRequestLike = {}

The initial values for the instance

Icon LinkReturns

UploadTransactionRequest

Icon LinkOverrides

BaseTransactionRequest .constructor

Icon LinkDefined in

packages/account/src/providers/transaction-request/upload-transaction-request.ts:65 Icon Link

Icon LinkProperties

Icon Linkinputs

Icon InfoCircle

inputs: TransactionRequestInput [] = []

List of inputs

Icon LinkInherited from

BaseTransactionRequest .inputs

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:116 Icon Link


Icon Linkmaturity?

Icon InfoCircle

optional maturity: number

Block until which tx cannot be included

Icon LinkInherited from

BaseTransactionRequest .maturity

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:110 Icon Link


Icon LinkmaxFee

Icon InfoCircle

maxFee: BN

The maximum fee payable by this transaction using BASE_ASSET.

Icon LinkInherited from

BaseTransactionRequest .maxFee

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:112 Icon Link


Icon Linkoutputs

Icon InfoCircle

outputs: TransactionRequestOutput [] = []

List of outputs

Icon LinkInherited from

BaseTransactionRequest .outputs

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:118 Icon Link


Icon Linksubsection

Icon InfoCircle

subsection: Omit<UploadSubsectionRequest, "subsection">

The subsection data.

Icon LinkDefined in

packages/account/src/providers/transaction-request/upload-transaction-request.ts:58 Icon Link


Icon Linktip?

Icon InfoCircle

optional tip: BN

Gas price for transaction

Icon LinkInherited from

BaseTransactionRequest .tip

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:108 Icon Link


Icon Linktype

Icon InfoCircle

type: Upload

Type of the transaction

Icon LinkOverrides

BaseTransactionRequest .type

Icon LinkDefined in

packages/account/src/providers/transaction-request/upload-transaction-request.ts:54 Icon Link


Icon LinkwitnessIndex

Icon InfoCircle

witnessIndex: number

The witness index of the subsection of the bytecode.

Icon LinkDefined in

packages/account/src/providers/transaction-request/upload-transaction-request.ts:56 Icon Link


Icon LinkwitnessLimit?

Icon InfoCircle

optional witnessLimit: BN

The maximum amount of witness data allowed for the transaction

Icon LinkInherited from

BaseTransactionRequest .witnessLimit

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:114 Icon Link


Icon Linkwitnesses

Icon InfoCircle

witnesses: BytesLike [] = []

List of witnesses

Icon LinkInherited from

BaseTransactionRequest .witnesses

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:120 Icon Link

Icon LinkMethods

Icon LinkaddAccountWitnesses()

Icon InfoCircle

addAccountWitnesses(account): Promise<UploadTransactionRequest >

Helper function to add an external signature to the transaction.

Icon LinkParameters

• account: Account | Account []

The account/s to sign to the transaction.

Icon LinkReturns

Promise<UploadTransactionRequest >

The transaction with the signature witness added.

Icon LinkInherited from

BaseTransactionRequest .addAccountWitnesses

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:294 Icon Link


Icon LinkaddChangeOutput()

Icon InfoCircle

addChangeOutput(to, assetId): void

Adds a change output to the transaction.

Icon LinkParameters

• to: AddressLike

Address of the owner.

• assetId: BytesLike

Asset ID of coin.

Icon LinkReturns

void

Icon LinkInherited from

BaseTransactionRequest .addChangeOutput

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:519 Icon Link


Icon LinkaddCoinInput()

Icon InfoCircle

addCoinInput(coin): void

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

Icon LinkParameters

• coin: Coin

Coin resource.

Icon LinkReturns

void

Icon LinkInherited from

BaseTransactionRequest .addCoinInput

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:368 Icon Link


Icon LinkaddCoinOutput()

Icon InfoCircle

addCoinOutput(to, amount, assetId): UploadTransactionRequest

Adds a coin output to the transaction.

Icon LinkParameters

• to: AddressLike

Address of the owner.

• amount: BigNumberish

Amount of coin.

• assetId: BytesLike

Asset ID of coin.

Icon LinkReturns

UploadTransactionRequest

Icon LinkInherited from

BaseTransactionRequest .addCoinOutput

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:483 Icon Link


Icon LinkaddCoinOutputs()

Icon InfoCircle

addCoinOutputs(to, quantities): UploadTransactionRequest

Adds multiple coin outputs to the transaction.

Icon LinkParameters

• to: AddressLike

Address of the destination.

• quantities: CoinQuantityLike []

Quantities of coins.

Icon LinkReturns

UploadTransactionRequest

Icon LinkInherited from

BaseTransactionRequest .addCoinOutputs

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:500 Icon Link


Icon LinkaddMessageInput()

Icon InfoCircle

addMessageInput(message): void

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

Icon LinkParameters

• message: Message | MessageCoin

Message resource.

Icon LinkReturns

void

Icon LinkInherited from

BaseTransactionRequest .addMessageInput

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:409 Icon Link


Icon LinkaddResource()

Icon InfoCircle

addResource(resource): UploadTransactionRequest

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.

Icon LinkParameters

• resource: Resource

The resource to add.

Icon LinkReturns

UploadTransactionRequest

This transaction.

Icon LinkInherited from

BaseTransactionRequest .addResource

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:453 Icon Link


Icon LinkaddResources()

Icon InfoCircle

addResources(resources): UploadTransactionRequest

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

Icon LinkParameters

• resources: readonly Resource []

The resources to add.

Icon LinkReturns

UploadTransactionRequest

This transaction.

Icon LinkInherited from

BaseTransactionRequest .addResources

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:470 Icon Link


Icon LinkaddSubsection()

Icon InfoCircle

addSubsection(subsection): void

Adds the subsection.

Icon LinkParameters

• subsection: UploadSubsectionRequest

The subsection data.

Icon LinkReturns

void

Icon LinkDefined in

packages/account/src/providers/transaction-request/upload-transaction-request.ts:81 Icon Link


Icon LinkbyteLength()

Icon InfoCircle

byteLength(): number

Icon LinkReturns

number

Icon LinkInherited from

BaseTransactionRequest .byteLength

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:709 Icon Link


Icon LinkcalculateMaxGas()

Icon InfoCircle

calculateMaxGas(chainInfo, minGas): BN

Icon LinkParameters

• chainInfo: ChainInfo

• minGas: BN

Icon LinkReturns

BN

Icon LinkInherited from

BaseTransactionRequest .calculateMaxGas

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:567 Icon Link


Icon LinkcalculateMinGas()

Icon InfoCircle

calculateMinGas(chainInfo): BN

Calculates the minimum gas for an upload transaction.

Icon LinkParameters

• chainInfo: ChainInfo

The chain information.

Icon LinkReturns

BN

the minimum gas for the upload transaction

Icon LinkOverrides

BaseTransactionRequest.calculateMinGas

Icon LinkDefined in

packages/account/src/providers/transaction-request/upload-transaction-request.ts:141 Icon Link


Icon LinkfundWithFakeUtxos()

Icon InfoCircle

fundWithFakeUtxos(quantities, baseAssetId, resourcesOwner?): UploadTransactionRequest

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

Icon LinkParameters

• quantities: CoinQuantity []

CoinQuantity Array.

• baseAssetId: string

The base asset to fund the transaction.

• resourcesOwner?: AbstractAddress

Icon LinkReturns

UploadTransactionRequest

Icon LinkDeprecated

  • This method is deprecated and will be removed in future versions. Please use Account.generateFakeResources along with this.addResources instead.

Icon LinkInherited from

BaseTransactionRequest .fundWithFakeUtxos

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:596 Icon Link


Icon LinkgetBaseTransaction()

Icon InfoCircle

protected getBaseTransaction(): ToBaseTransactionResponse

Method to obtain the base transaction details.

Icon LinkReturns

ToBaseTransactionResponse

The base transaction details.

Icon LinkInherited from

BaseTransactionRequest .getBaseTransaction

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:179 Icon Link


Icon LinkgetChangeOutputs()

Icon InfoCircle

getChangeOutputs(): ChangeTransactionRequestOutput []

Gets the change outputs for a transaction.

Icon LinkReturns

ChangeTransactionRequestOutput []

The change outputs.

Icon LinkInherited from

BaseTransactionRequest .getChangeOutputs

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:332 Icon Link


Icon LinkgetCoinInputs()

Icon InfoCircle

getCoinInputs(): CoinTransactionRequestInput []

Gets the coin inputs for a transaction.

Icon LinkReturns

CoinTransactionRequestInput []

The coin inputs.

Icon LinkInherited from

BaseTransactionRequest .getCoinInputs

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:310 Icon Link


Icon LinkgetCoinOutputs()

Icon InfoCircle

getCoinOutputs(): CoinTransactionRequestOutput []

Gets the coin outputs for a transaction.

Icon LinkReturns

CoinTransactionRequestOutput []

The coin outputs.

Icon LinkInherited from

BaseTransactionRequest .getCoinOutputs

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:321 Icon Link


Icon LinkgetCoinOutputsQuantities()

Icon InfoCircle

getCoinOutputsQuantities(): CoinQuantity []

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

Icon LinkReturns

CoinQuantity []

CoinQuantity array.

Icon LinkInherited from

BaseTransactionRequest .getCoinOutputsQuantities

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:647 Icon Link


Icon LinkgetTransactionId()

Icon InfoCircle

getTransactionId(chainId): string

Gets the Transaction Request by hashing the transaction.

Icon LinkParameters

• chainId: number

The chain ID.

Icon LinkReturns

string

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

Icon LinkOverrides

BaseTransactionRequest .getTransactionId

Icon LinkDefined in

packages/account/src/providers/transaction-request/upload-transaction-request.ts:94 Icon Link


Icon LinkmetadataGas()

Icon InfoCircle

metadataGas(gasCosts): BN

Calculates the metadata gas cost for an upload transaction.

Icon LinkParameters

• gasCosts: GasCosts

gas costs passed from the chain.

Icon LinkReturns

BN

metadata gas cost for the upload transaction.

Icon LinkOverrides

BaseTransactionRequest.metadataGas

Icon LinkDefined in

packages/account/src/providers/transaction-request/upload-transaction-request.ts:125 Icon Link


Icon LinkremoveWitness()

Icon InfoCircle

removeWitness(index): void

Icon LinkParameters

• index: number

Icon LinkReturns

void

Icon LinkInherited from

BaseTransactionRequest .removeWitness

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:675 Icon Link


Icon LinktoJSON()

Icon InfoCircle

toJSON(): any

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

Icon LinkReturns

any

The transaction as a JSON object.

Icon LinkInherited from

BaseTransactionRequest .toJSON

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:671 Icon Link


Icon LinktoTransaction()

Icon InfoCircle

toTransaction(): TransactionUpload

Converts the transaction request to a TransactionUpload.

Icon LinkReturns

TransactionUpload

The transaction create object.

Icon LinkOverrides

BaseTransactionRequest .toTransaction

Icon LinkDefined in

packages/account/src/providers/transaction-request/upload-transaction-request.ts:103 Icon Link


Icon LinktoTransactionBytes()

Icon InfoCircle

toTransactionBytes(): Uint8Array

Converts the transaction request to a byte array.

Icon LinkReturns

Uint8Array

The transaction bytes.

Icon LinkInherited from

BaseTransactionRequest .toTransactionBytes

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:210 Icon Link


Icon LinkupdatePredicateGasUsed()

Icon InfoCircle

updatePredicateGasUsed(inputs): void

Icon LinkParameters

• inputs: TransactionRequestInput []

Icon LinkReturns

void

Icon LinkInherited from

BaseTransactionRequest .updatePredicateGasUsed

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:689 Icon Link


Icon LinkupdateWitness()

Icon InfoCircle

updateWitness(index, witness): void

Updates an existing witness without any side effects.

Icon LinkParameters

• index: number

The index of the witness to update.

• witness: BytesLike

The new witness.

Icon LinkReturns

void

Icon LinkThrows

If the witness does not exist.

Icon LinkInherited from

BaseTransactionRequest .updateWitness

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:281 Icon Link


Icon LinkupdateWitnessByOwner()

Icon InfoCircle

updateWitnessByOwner(address, signature): void

Updates the witness for a given owner and signature.

Icon LinkParameters

• address: string | AbstractAddress

The address to get the coin input witness index for.

• signature: BytesLike

The signature to update the witness with.

Icon LinkReturns

void

Icon LinkInherited from

BaseTransactionRequest .updateWitnessByOwner

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:266 Icon Link


Icon Linkfrom()

Icon InfoCircle

static from(obj): UploadTransactionRequest

Icon LinkParameters

• obj: UploadTransactionRequestLike

Icon LinkReturns

UploadTransactionRequest

Icon LinkDefined in

packages/account/src/providers/transaction-request/upload-transaction-request.ts:46 Icon Link


Icon LinkgetPolicyMeta()

Icon InfoCircle

static getPolicyMeta(req): object

Icon LinkParameters

• req: BaseTransactionRequest

Icon LinkReturns

object

Icon Linkpolicies

Icon InfoCircle

policies: Policy[]

Icon LinkpolicyTypes

Icon InfoCircle

policyTypes: number

Icon LinkInherited from

BaseTransactionRequest .getPolicyMeta

Icon LinkDefined in

packages/account/src/providers/transaction-request/transaction-request.ts:145 Icon Link