@fuel-ts/account v0.97.0 • Docs
abstract
BaseTransactionRequest Abstract class to define the functionalities of a transaction request transaction request.
BlobTransactionRequest
CreateTransactionRequest
ScriptTransactionRequest
UpgradeTransactionRequest
UploadTransactionRequest
BaseTransactionRequestLike
new BaseTransactionRequest(
baseTransactionRequest
):BaseTransactionRequest
Constructor for initializing a base transaction request.
• baseTransactionRequest: BaseTransactionRequestLike
= {}
Optional object containing properties to initialize the transaction request.
packages/account/src/providers/transaction-request/transaction-request.ts:127
inputs:
TransactionRequestInput
[] =[]
List of inputs
BaseTransactionRequestLike.inputs
packages/account/src/providers/transaction-request/transaction-request.ts:116
optional
maturity:number
Block until which tx cannot be included
BaseTransactionRequestLike.maturity
packages/account/src/providers/transaction-request/transaction-request.ts:110
maxFee:
BN
The maximum fee payable by this transaction using BASE_ASSET.
BaseTransactionRequestLike.maxFee
packages/account/src/providers/transaction-request/transaction-request.ts:112
outputs:
TransactionRequestOutput
[] =[]
List of outputs
BaseTransactionRequestLike.outputs
packages/account/src/providers/transaction-request/transaction-request.ts:118
optional
tip:BN
Gas price for transaction
BaseTransactionRequestLike.tip
packages/account/src/providers/transaction-request/transaction-request.ts:108
abstract
type:TransactionType
Type of the transaction
packages/account/src/providers/transaction-request/transaction-request.ts:106
optional
witnessLimit:BN
The maximum amount of witness data allowed for the transaction
BaseTransactionRequestLike.witnessLimit
packages/account/src/providers/transaction-request/transaction-request.ts:114
witnesses:
BytesLike
[] =[]
List of witnesses
BaseTransactionRequestLike.witnesses
packages/account/src/providers/transaction-request/transaction-request.ts:120
addAccountWitnesses(
account
):Promise
<BaseTransactionRequest
>
Helper function to add an external signature to the transaction.
• account: Account
| Account
[]
The account/s to sign to the transaction.
Promise
<BaseTransactionRequest
>
The transaction with the signature witness added.
packages/account/src/providers/transaction-request/transaction-request.ts:294
addChangeOutput(
to
,assetId
):void
Adds a change output to the transaction.
• to: AddressLike
Address of the owner.
• assetId: BytesLike
Asset ID of coin.
void
packages/account/src/providers/transaction-request/transaction-request.ts:519
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.
• coin: Coin
Coin resource.
void
packages/account/src/providers/transaction-request/transaction-request.ts:368
addCoinOutput(
to
,amount
,assetId
):BaseTransactionRequest
Adds a coin output to the transaction.
• to: AddressLike
Address of the owner.
• amount: BigNumberish
Amount of coin.
• assetId: BytesLike
Asset ID of coin.
packages/account/src/providers/transaction-request/transaction-request.ts:483
addCoinOutputs(
to
,quantities
):BaseTransactionRequest
Adds multiple coin outputs to the transaction.
• to: AddressLike
Address of the destination.
• quantities: CoinQuantityLike
[]
Quantities of coins.
packages/account/src/providers/transaction-request/transaction-request.ts:500
addMessageInput(
message
):void
Adds a single message input to the transaction and a change output for the asset against the message
• message: Message
| MessageCoin
Message resource.
void
packages/account/src/providers/transaction-request/transaction-request.ts:409
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.
• resource: Resource
The resource to add.
This transaction.
packages/account/src/providers/transaction-request/transaction-request.ts:453
addResources(
resources
):BaseTransactionRequest
Adds multiple resources to the transaction by adding coin/message inputs and change outputs from the related assetIds.
• resources: readonly Resource
[]
The resources to add.
This transaction.
packages/account/src/providers/transaction-request/transaction-request.ts:470
byteLength():
number
number
packages/account/src/providers/transaction-request/transaction-request.ts:709
calculateMaxGas(
chainInfo
,minGas
):BN
• chainInfo: ChainInfo
• minGas: BN
BN
packages/account/src/providers/transaction-request/transaction-request.ts:567
fundWithFakeUtxos(
quantities
,baseAssetId
,resourcesOwner
?):BaseTransactionRequest
Funds the transaction with fake UTXOs for each assetId and amount in the quantities array.
• quantities: CoinQuantity
[]
CoinQuantity Array.
• baseAssetId: string
The base asset to fund the transaction.
• resourcesOwner?: AbstractAddress
Account.generateFakeResources
along with this.addResources
instead. packages/account/src/providers/transaction-request/transaction-request.ts:596
protected
getBaseTransaction():ToBaseTransactionResponse
Method to obtain the base transaction details.
ToBaseTransactionResponse
The base transaction details.
packages/account/src/providers/transaction-request/transaction-request.ts:179
getChangeOutputs():
ChangeTransactionRequestOutput
[]
Gets the change outputs for a transaction.
ChangeTransactionRequestOutput
[]
The change outputs.
packages/account/src/providers/transaction-request/transaction-request.ts:332
getCoinInputs():
CoinTransactionRequestInput
[]
Gets the coin inputs for a transaction.
CoinTransactionRequestInput
[]
The coin inputs.
packages/account/src/providers/transaction-request/transaction-request.ts:310
getCoinOutputs():
CoinTransactionRequestOutput
[]
Gets the coin outputs for a transaction.
CoinTransactionRequestOutput
[]
The coin outputs.
packages/account/src/providers/transaction-request/transaction-request.ts:321
getCoinOutputsQuantities():
CoinQuantity
[]
Retrieves an array of CoinQuantity for each coin output present in the transaction. a transaction.
CoinQuantity
[]
CoinQuantity array.
packages/account/src/providers/transaction-request/transaction-request.ts:647
abstract
getTransactionId(chainId
):string
Gets the Transaction Request by hashing the transaction.
• chainId: number
The chain ID.
string
packages/account/src/providers/transaction-request/transaction-request.ts:663
removeWitness(
index
):void
• index: number
void
packages/account/src/providers/transaction-request/transaction-request.ts:675
toJSON():
any
Return the minimum amount in native coins required to create a transaction.
any
The transaction as a JSON object.
packages/account/src/providers/transaction-request/transaction-request.ts:671
abstract
toTransaction():TransactionScript
|TransactionCreate
|TransactionUpgrade
|TransactionUpload
|TransactionBlob
TransactionScript
| TransactionCreate
| TransactionUpgrade
| TransactionUpload
| TransactionBlob
packages/account/src/providers/transaction-request/transaction-request.ts:198
toTransactionBytes():
Uint8Array
Converts the transaction request to a byte array.
Uint8Array
The transaction bytes.
packages/account/src/providers/transaction-request/transaction-request.ts:210
updatePredicateGasUsed(
inputs
):void
• inputs: TransactionRequestInput
[]
void
packages/account/src/providers/transaction-request/transaction-request.ts:689
updateWitness(
index
,witness
):void
Updates an existing witness without any side effects.
• index: number
The index of the witness to update.
• witness: BytesLike
The new witness.
void
If the witness does not exist.
packages/account/src/providers/transaction-request/transaction-request.ts:281
updateWitnessByOwner(
address
,signature
):void
Updates the witness for a given owner and signature.
• address: string
| AbstractAddress
The address to get the coin input witness index for.
• signature: BytesLike
The signature to update the witness with.
void
packages/account/src/providers/transaction-request/transaction-request.ts:266
static
getPolicyMeta(req
):object
• req: BaseTransactionRequest
object
policies:
Policy
[]
policyTypes:
number
packages/account/src/providers/transaction-request/transaction-request.ts:145