@fuel-ts/account v0.96.1 • Docs
Abstract class to define the functionalities of a transaction request transaction request.
new UpgradeTransactionRequest(
upgradeTransactionRequestLike
):UpgradeTransactionRequest
Creates an instance UpgradeTransactionRequest
.
• upgradeTransactionRequestLike: UpgradeTransactionRequestLike
= {}
The initial values for the instance
BaseTransactionRequest
.constructor
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:64
bytecodeWitnessIndex:
number
Witness index of consensus
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:57
inputs:
TransactionRequestInput
[] =[]
List of inputs
BaseTransactionRequest
.inputs
packages/account/src/providers/transaction-request/transaction-request.ts:116
optional
maturity:number
Block until which tx cannot be included
BaseTransactionRequest
.maturity
packages/account/src/providers/transaction-request/transaction-request.ts:110
maxFee:
BN
The maximum fee payable by this transaction using BASE_ASSET.
BaseTransactionRequest
.maxFee
packages/account/src/providers/transaction-request/transaction-request.ts:112
outputs:
TransactionRequestOutput
[] =[]
List of outputs
BaseTransactionRequest
.outputs
packages/account/src/providers/transaction-request/transaction-request.ts:118
optional
tip:BN
Gas price for transaction
packages/account/src/providers/transaction-request/transaction-request.ts:108
type:
Upgrade
The type of transaction
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:53
upgradePurpose:
UpgradePurposeRequest
The upgrade purpose
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:55
optional
witnessLimit:BN
The maximum amount of witness data allowed for the transaction
BaseTransactionRequest
.witnessLimit
packages/account/src/providers/transaction-request/transaction-request.ts:114
witnesses:
BytesLike
[] =[]
List of witnesses
BaseTransactionRequest
.witnesses
packages/account/src/providers/transaction-request/transaction-request.ts:120
addAccountWitnesses(
account
):Promise
<UpgradeTransactionRequest
>
Helper function to add an external signature to the transaction.
• account: Account
| Account
[]
The account/s to sign to the transaction.
Promise
<UpgradeTransactionRequest
>
The transaction with the signature witness added.
BaseTransactionRequest
.addAccountWitnesses
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
BaseTransactionRequest
.addChangeOutput
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
BaseTransactionRequest
.addCoinInput
packages/account/src/providers/transaction-request/transaction-request.ts:368
addCoinOutput(
to
,amount
,assetId
):UpgradeTransactionRequest
Adds a coin output to the transaction.
• to: AddressLike
Address of the owner.
• amount: BigNumberish
Amount of coin.
• assetId: BytesLike
Asset ID of coin.
BaseTransactionRequest
.addCoinOutput
packages/account/src/providers/transaction-request/transaction-request.ts:483
addCoinOutputs(
to
,quantities
):UpgradeTransactionRequest
Adds multiple coin outputs to the transaction.
• to: AddressLike
Address of the destination.
• quantities: CoinQuantityLike
[]
Quantities of coins.
BaseTransactionRequest
.addCoinOutputs
packages/account/src/providers/transaction-request/transaction-request.ts:500
addConsensusParametersUpgradePurpose(
consensus
):UpgradeTransactionRequest
Adds a consensus parameters upgrade purpose.
• consensus: BytesLike
The consensus bytecode.
UpgradeTransactionRequest
. packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:84
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
BaseTransactionRequest
.addMessageInput
packages/account/src/providers/transaction-request/transaction-request.ts:409
addResource(
resource
):UpgradeTransactionRequest
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.
BaseTransactionRequest
.addResource
packages/account/src/providers/transaction-request/transaction-request.ts:453
addResources(
resources
):UpgradeTransactionRequest
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.
BaseTransactionRequest
.addResources
packages/account/src/providers/transaction-request/transaction-request.ts:470
addStateTransitionUpgradePurpose(
bytecodeRoot
):UpgradeTransactionRequest
Adds a state transition upgrade purpose.
• bytecodeRoot: BytesLike
The Merkle root of the state transition.
UpgradeTransactionRequest
. packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:100
addUpgradePurpose(
type
,data
):UpgradeTransactionRequest
Adds an upgrade purpose.
• type: UpgradePurposeTypeEnum
The upgrade purpose type.
• data: BytesLike
The bytecode or merkle root of upgrade purpose
UpgradeTransactionRequest
. packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:116
byteLength():
number
number
BaseTransactionRequest
.byteLength
packages/account/src/providers/transaction-request/transaction-request.ts:709
calculateMaxGas(
chainInfo
,minGas
):BN
• chainInfo: ChainInfo
• minGas: BN
BN
BaseTransactionRequest
.calculateMaxGas
packages/account/src/providers/transaction-request/transaction-request.ts:567
fundWithFakeUtxos(
quantities
,baseAssetId
,resourcesOwner
?):UpgradeTransactionRequest
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. BaseTransactionRequest
.fundWithFakeUtxos
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.
BaseTransactionRequest
.getBaseTransaction
packages/account/src/providers/transaction-request/transaction-request.ts:179
getChangeOutputs():
ChangeTransactionRequestOutput
[]
Gets the change outputs for a transaction.
ChangeTransactionRequestOutput
[]
The change outputs.
BaseTransactionRequest
.getChangeOutputs
packages/account/src/providers/transaction-request/transaction-request.ts:332
getCoinInputs():
CoinTransactionRequestInput
[]
Gets the coin inputs for a transaction.
CoinTransactionRequestInput
[]
The coin inputs.
BaseTransactionRequest
.getCoinInputs
packages/account/src/providers/transaction-request/transaction-request.ts:310
getCoinOutputs():
CoinTransactionRequestOutput
[]
Gets the coin outputs for a transaction.
CoinTransactionRequestOutput
[]
The coin outputs.
BaseTransactionRequest
.getCoinOutputs
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.
BaseTransactionRequest
.getCoinOutputsQuantities
packages/account/src/providers/transaction-request/transaction-request.ts:647
getTransactionId(
chainId
):string
Gets the Transaction ID by hashing the transaction
• chainId: number
The chain ID.
string
BaseTransactionRequest
.getTransactionId
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:169
metadataGas(
gasCosts
):BN
Calculates the metadata gas cost for an upgrade transaction.
• gasCosts: GasCosts
gas costs passed from the chain.
BN
metadata gas cost for the upgrade transaction.
BaseTransactionRequest.metadataGas
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:180
removeWitness(
index
):void
• index: number
void
BaseTransactionRequest
.removeWitness
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.
BaseTransactionRequest
.toJSON
packages/account/src/providers/transaction-request/transaction-request.ts:671
toTransaction():
TransactionUpgrade
Converts the transaction request to a TransactionUpgrade
.
TransactionUpgrade
The transaction create object.
BaseTransactionRequest
.toTransaction
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:133
toTransactionBytes():
Uint8Array
Converts the transaction request to a byte array.
Uint8Array
The transaction bytes.
BaseTransactionRequest
.toTransactionBytes
packages/account/src/providers/transaction-request/transaction-request.ts:210
updatePredicateGasUsed(
inputs
):void
• inputs: TransactionRequestInput
[]
void
BaseTransactionRequest
.updatePredicateGasUsed
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.
BaseTransactionRequest
.updateWitness
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
BaseTransactionRequest
.updateWitnessByOwner
packages/account/src/providers/transaction-request/transaction-request.ts:266
static
from(obj
):UpgradeTransactionRequest
• obj: UpgradeTransactionRequestLike
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:45
static
getPolicyMeta(req
):object
• req: BaseTransactionRequest
object
policies:
Policy
[]
policyTypes:
number
BaseTransactionRequest
.getPolicyMeta
packages/account/src/providers/transaction-request/transaction-request.ts:145