Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
BaseTransactionRequest

Icon LinkClass: BaseTransactionRequest

@fuel-ts/account .BaseTransactionRequest

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

Icon LinkHierarchy

Icon LinkImplements

  • BaseTransactionRequestLike

Icon LinkConstructors

Icon Linkconstructor

new BaseTransactionRequest(baseTransactionRequest?): BaseTransactionRequest

Constructor for initializing a base transaction request.

Icon LinkParameters

NameTypeDescription
baseTransactionRequestBaseTransactionRequestLikeOptional object containing properties to initialize the transaction request.

Icon LinkReturns

BaseTransactionRequest

Icon LinkDefined in

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

Icon LinkProperties

Icon Linkinputs

inputs: TransactionRequestInput [] = []

List of inputs

Icon LinkImplementation of

BaseTransactionRequestLike.inputs

Icon LinkDefined in

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


Icon Linkmaturity

Optional maturity: number

Block until which tx cannot be included

Icon LinkImplementation of

BaseTransactionRequestLike.maturity

Icon LinkDefined in

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


Icon LinkmaxFee

maxFee: BN

The maximum fee payable by this transaction using BASE_ASSET.

Icon LinkImplementation of

BaseTransactionRequestLike.maxFee

Icon LinkDefined in

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


Icon Linkoutputs

outputs: TransactionRequestOutput [] = []

List of outputs

Icon LinkImplementation of

BaseTransactionRequestLike.outputs

Icon LinkDefined in

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


Icon Linktip

Optional tip: BN

Gas price for transaction

Icon LinkImplementation of

BaseTransactionRequestLike.tip

Icon LinkDefined in

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


Icon Linktype

Abstract type: TransactionType

Type of the transaction

Icon LinkDefined in

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


Icon LinkwitnessLimit

Optional witnessLimit: BN

The maximum amount of witness data allowed for the transaction

Icon LinkImplementation of

BaseTransactionRequestLike.witnessLimit

Icon LinkDefined in

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


Icon Linkwitnesses

witnesses: BytesLike [] = []

List of witnesses

Icon LinkImplementation of

BaseTransactionRequestLike.witnesses

Icon LinkDefined in

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

Icon LinkMethods

Icon LinkaddAccountWitnesses

addAccountWitnesses(account): Promise<BaseTransactionRequest >

Helper function to add an external signature to the transaction.

Icon LinkParameters

NameTypeDescription
accountAccount | Account []The account/s to sign to the transaction.

Icon LinkReturns

Promise<BaseTransactionRequest >

The transaction with the signature witness added.

Icon LinkDefined in

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


Icon LinkaddChangeOutput

addChangeOutput(to, assetId): void

Adds a change output to the transaction.

Icon LinkParameters

NameTypeDescription
toAddressLike Address of the owner.
assetIdBytesLike Asset ID of coin.

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkaddCoinInput

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

NameTypeDescription
coinCoin Coin resource.

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkaddCoinOutput

addCoinOutput(to, amount, assetId): BaseTransactionRequest

Adds a coin output to the transaction.

Icon LinkParameters

NameTypeDescription
toAddressLike Address of the owner.
amountBigNumberishAmount of coin.
assetIdBytesLike Asset ID of coin.

Icon LinkReturns

BaseTransactionRequest

Icon LinkDefined in

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


Icon LinkaddCoinOutputs

addCoinOutputs(to, quantities): BaseTransactionRequest

Adds multiple coin outputs to the transaction.

Icon LinkParameters

NameTypeDescription
toAddressLike Address of the destination.
quantitiesCoinQuantityLike []Quantities of coins.

Icon LinkReturns

BaseTransactionRequest

Icon LinkDefined in

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


Icon LinkaddMessageInput

addMessageInput(message): void

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

Icon LinkParameters

NameTypeDescription
messageMessageCoin Message resource.

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkaddResource

addResource(resource): BaseTransactionRequest

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

NameTypeDescription
resourceResource The resource to add.

Icon LinkReturns

BaseTransactionRequest

This transaction.

Icon LinkDefined in

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


Icon LinkaddResources

addResources(resources): BaseTransactionRequest

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

Icon LinkParameters

NameTypeDescription
resourcesreadonly Resource []The resources to add.

Icon LinkReturns

BaseTransactionRequest

This transaction.

Icon LinkDefined in

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


Icon LinkadjustWitnessIndexes

adjustWitnessIndexes(removedIndex): void

Icon LinkParameters

NameType
removedIndexnumber

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkcalculateMaxGas

calculateMaxGas(chainInfo, minGas): BN

Icon LinkParameters

NameType
chainInfoChainInfo
minGasBN

Icon LinkReturns

BN

Icon LinkDefined in

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


Icon LinkfundWithFakeUtxos

fundWithFakeUtxos(quantities, baseAssetId, resourcesOwner?): void

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

Icon LinkParameters

NameTypeDescription
quantitiesCoinQuantity []CoinQuantity Array.
baseAssetIdstringThe base asset to fund the transaction.
resourcesOwner?AbstractAddress -

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkgetBaseTransaction

getBaseTransaction(): ToBaseTransactionResponse

Method to obtain the base transaction details.

Icon LinkReturns

ToBaseTransactionResponse

The base transaction details.

Icon LinkDefined in

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


Icon LinkgetChangeOutputs

getChangeOutputs(): ChangeTransactionRequestOutput []

Gets the change outputs for a transaction.

Icon LinkReturns

ChangeTransactionRequestOutput []

The change outputs.

Icon LinkDefined in

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


Icon LinkgetCoinInputs

getCoinInputs(): CoinTransactionRequestInput []

Gets the coin inputs for a transaction.

Icon LinkReturns

CoinTransactionRequestInput []

The coin inputs.

Icon LinkDefined in

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


Icon LinkgetCoinOutputs

getCoinOutputs(): CoinTransactionRequestOutput []

Gets the coin outputs for a transaction.

Icon LinkReturns

CoinTransactionRequestOutput []

The coin outputs.

Icon LinkDefined in

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


Icon LinkgetCoinOutputsQuantities

getCoinOutputsQuantities(): CoinQuantity []

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

Icon LinkReturns

CoinQuantity []

CoinQuantity array.

Icon LinkDefined in

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


Icon LinkgetTransactionId

getTransactionId(chainId): string

Gets the Transaction Request by hashing the transaction.

Icon LinkParameters

NameTypeDescription
chainIdnumberThe chain ID.

Icon LinkReturns

string

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

Icon LinkDefined in

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


Icon LinkremoveWitness

removeWitness(index): void

Icon LinkParameters

NameType
indexnumber

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinktoJSON

toJSON(): any

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

Icon LinkReturns

any

The transaction as a JSON object.

Icon LinkDefined in

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


Icon LinktoTransaction

toTransaction(): TransactionScript | TransactionCreate

Icon LinkReturns

TransactionScript | TransactionCreate

Icon LinkDefined in

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


Icon LinktoTransactionBytes

toTransactionBytes(): Uint8Array

Converts the transaction request to a byte array.

Icon LinkReturns

Uint8Array

The transaction bytes.

Icon LinkDefined in

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


Icon LinkupdatePredicateGasUsed

updatePredicateGasUsed(inputs): void

Icon LinkParameters

NameType
inputsTransactionRequestInput []

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkupdateWitness

updateWitness(index, witness): void

Updates an existing witness without any side effects.

Throws

If the witness does not exist.

Icon LinkParameters

NameTypeDescription
indexnumberThe index of the witness to update.
witnessBytesLike The new witness.

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkupdateWitnessByOwner

updateWitnessByOwner(address, signature): void

Updates the witness for a given owner and signature.

Icon LinkParameters

NameTypeDescription
addressstring | AbstractAddress The address to get the coin input witness index for.
signatureBytesLike The signature to update the witness with.

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkgetPolicyMeta

getPolicyMeta(req): Object

Icon LinkParameters

Icon LinkReturns

Object

NameType
policiesPolicy[]
policyTypesnumber

Icon LinkDefined in

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