Icon LinkClass: BaseTransactionRequest

@fuel-ts/providers.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?)

Constructor for initializing a base transaction request.

Icon LinkParameters

NameTypeDescription
baseTransactionRequestBaseTransactionRequestLikeOptional object containing properties to initialize the transaction request.

Icon LinkDefined in

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

Icon LinkProperties

Icon LinkgasLimit

gasLimit: BN

Gas limit for transaction

Icon LinkImplementation of

BaseTransactionRequestLike.gasLimit

Icon LinkDefined in

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


Icon LinkgasPrice

gasPrice: BN

Gas price for transaction

Icon LinkImplementation of

BaseTransactionRequestLike.gasPrice

Icon LinkDefined in

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


Icon Linkinputs

inputs: TransactionRequestInput[] = []

List of inputs

Icon LinkImplementation of

BaseTransactionRequestLike.inputs

Icon LinkDefined in

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


Icon Linkmaturity

maturity: number

Block until which tx cannot be included

Icon LinkImplementation of

BaseTransactionRequestLike.maturity

Icon LinkDefined in

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


Icon Linkoutputs

outputs: TransactionRequestOutput[] = []

List of outputs

Icon LinkImplementation of

BaseTransactionRequestLike.outputs

Icon LinkDefined in

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


Icon Linktype

Abstract type: TransactionType

Type of the transaction

Icon LinkDefined in

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


Icon Linkwitnesses

witnesses: BytesLike[] = []

List of witnesses

Icon LinkImplementation of

BaseTransactionRequestLike.witnesses

Icon LinkDefined in

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

Icon LinkMethods

Icon LinkaddCoinOutput

addCoinOutput(to, amount, assetId?): void

Adds a coin input to the transaction.

Icon LinkParameters

NameTypeDefault valueDescription
toAddressLikeundefinedAddress of the owner.
amountBigNumberishundefinedAmount of coin.
assetIdBytesLikeBaseAssetIdAsset ID of coin.

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkaddCoinOutputs

addCoinOutputs(to, quantities): void

Adds multiple coin outputs to the transaction.

Icon LinkParameters

NameTypeDescription
toAddressLikeAddress of the destination.
quantitiesCoinQuantityLike[]Quantities of coins.

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkaddResourceInputAndOutput

addResourceInputAndOutput(resource): BaseTransactionRequest

Adds a single resource to the transaction by adding inputs and outputs.

Icon LinkParameters

NameType
resourceResource

Icon LinkReturns

BaseTransactionRequest

This transaction.

Icon LinkDefined in

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


Icon LinkaddResourceInputsAndOutputs

addResourceInputsAndOutputs(resources): BaseTransactionRequest

Adds multiple resources to the transaction by adding inputs and outputs.

Icon LinkParameters

NameTypeDescription
resourcesreadonly Resource[]The resources to add.

Icon LinkReturns

BaseTransactionRequest

This transaction.

Icon LinkDefined in

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


Icon LinkcalculateFee

calculateFee(): CoinQuantity

Return the minimum amount in native coins required to create a transaction. This is required even if the gasPrice is 0.

Icon LinkReturns

CoinQuantity

The minimum amount in coins required to create a transaction.

Icon LinkDefined in

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


Icon LinkgetBaseTransaction

Protected getBaseTransaction(): Pick<TransactionScript | TransactionCreate, "inputsCount" | "outputsCount" | "witnessesCount" | keyof BaseTransactionRequestLike>

Method to obtain the base transaction details.

Icon LinkReturns

Pick<TransactionScript | TransactionCreate, "inputsCount" | "outputsCount" | "witnessesCount" | keyof BaseTransactionRequestLike>

The base transaction details.

Icon LinkDefined in

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


Icon LinkgetChangeOutputs

getChangeOutputs(): ChangeTransactionRequestOutput[]

Gets the change outputs for a transaction.

Icon LinkReturns

ChangeTransactionRequestOutput[]

The change outputs.

Icon LinkDefined in

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


Icon LinkgetCoinInputs

getCoinInputs(): CoinTransactionRequestInput[]

Gets the coin inputs for a transaction.

Icon LinkReturns

CoinTransactionRequestInput[]

The coin inputs.

Icon LinkDefined in

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


Icon LinkgetCoinOutputs

getCoinOutputs(): CoinTransactionRequestOutput[]

Gets the coin outputs for a transaction.

Icon LinkReturns

CoinTransactionRequestOutput[]

The coin outputs.

Icon LinkDefined in

packages/providers/src/transaction-request/transaction-request.ts:207 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/providers/src/transaction-request/transaction-request.ts:413 Icon Link


Icon LinktoTransaction

Abstract toTransaction(): TransactionScript | TransactionCreate

Icon LinkReturns

TransactionScript | TransactionCreate

Icon LinkDefined in

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


Icon LinktoTransactionBytes

toTransactionBytes(): Uint8Array

Converts the transaction request to a byte array.

Icon LinkReturns

Uint8Array

The transaction bytes.

Icon LinkDefined in

packages/providers/src/transaction-request/transaction-request.ts:130 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.
witnessBytesLikeThe new witness.

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkupdateWitnessByCoinInputOwner

updateWitnessByCoinInputOwner(owner, witness): void

Updates the witness for the given CoinInput owner.

Throws

If no witness exists for the given owner.

Icon LinkParameters

NameTypeDescription
ownerAddressLikeThe owner of the CoinInput.
witnessBytesLikeThe witness to update.

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkupdateWitnessByOwner

updateWitnessByOwner(address, signature): void

Updates the witness for a given owner and signature.

Icon LinkParameters

NameTypeDescription
addressAbstractAddressThe address to get the coin input witness index for.
signatureBytesLikeThe signature to update the witness with.

Icon LinkReturns

void

Icon LinkDefined in

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

Was this page helpful?