@fuel-ts/account v0.94.5 • Docs
Class: UpgradeTransactionRequest
Abstract class to define the functionalities of a transaction request transaction request.
Extends
Constructors
new UpgradeTransactionRequest()
new UpgradeTransactionRequest(
upgradeTransactionRequestLike
):UpgradeTransactionRequest
Creates an instance UpgradeTransactionRequest
.
Parameters
• upgradeTransactionRequestLike: UpgradeTransactionRequestLike
= {}
The initial values for the instance
Returns
Overrides
BaseTransactionRequest
.constructor
Defined in
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:64
Properties
bytecodeWitnessIndex
bytecodeWitnessIndex:
number
Witness index of consensus
Defined in
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:57
inputs
inputs:
TransactionRequestInput
[] =[]
List of inputs
Inherited from
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:116
maturity?
optional
maturity:number
Block until which tx cannot be included
Inherited from
BaseTransactionRequest
.maturity
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:110
maxFee
maxFee:
BN
The maximum fee payable by this transaction using BASE_ASSET.
Inherited from
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:112
outputs
outputs:
TransactionRequestOutput
[] =[]
List of outputs
Inherited from
BaseTransactionRequest
.outputs
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:118
tip?
optional
tip:BN
Gas price for transaction
Inherited from
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:108
type
type:
Upgrade
The type of transaction
Overrides
Defined in
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:53
upgradePurpose
upgradePurpose:
UpgradePurposeRequest
The upgrade purpose
Defined in
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:55
witnessLimit?
optional
witnessLimit:BN
The maximum amount of witness data allowed for the transaction
Inherited from
BaseTransactionRequest
.witnessLimit
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:114
witnesses
witnesses:
BytesLike
[] =[]
List of witnesses
Inherited from
BaseTransactionRequest
.witnesses
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:120
Methods
addAccountWitnesses()
addAccountWitnesses(
account
):Promise
<UpgradeTransactionRequest
>
Helper function to add an external signature to the transaction.
Parameters
• account: Account
| Account
[]
The account/s to sign to the transaction.
Returns
Promise
<UpgradeTransactionRequest
>
The transaction with the signature witness added.
Inherited from
BaseTransactionRequest
.addAccountWitnesses
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:294
addChangeOutput()
addChangeOutput(
to
,assetId
):void
Adds a change output to the transaction.
Parameters
• to: AddressLike
Address of the owner.
• assetId: BytesLike
Asset ID of coin.
Returns
void
Inherited from
BaseTransactionRequest
.addChangeOutput
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:519
addCoinInput()
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.
Parameters
• coin: Coin
Coin resource.
Returns
void
Inherited from
BaseTransactionRequest
.addCoinInput
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:368
addCoinOutput()
addCoinOutput(
to
,amount
,assetId
):UpgradeTransactionRequest
Adds a coin output to the transaction.
Parameters
• to: AddressLike
Address of the owner.
• amount: BigNumberish
Amount of coin.
• assetId: BytesLike
Asset ID of coin.
Returns
Inherited from
BaseTransactionRequest
.addCoinOutput
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:483
addCoinOutputs()
addCoinOutputs(
to
,quantities
):UpgradeTransactionRequest
Adds multiple coin outputs to the transaction.
Parameters
• to: AddressLike
Address of the destination.
• quantities: CoinQuantityLike
[]
Quantities of coins.
Returns
Inherited from
BaseTransactionRequest
.addCoinOutputs
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:500
addConsensusParametersUpgradePurpose()
addConsensusParametersUpgradePurpose(
consensus
):UpgradeTransactionRequest
Adds a consensus parameters upgrade purpose.
Parameters
• consensus: BytesLike
The consensus bytecode.
Returns
- The current instance of
UpgradeTransactionRequest
.
Defined in
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:84
addMessageInput()
addMessageInput(
message
):void
Adds a single message input to the transaction and a change output for the asset against the message
Parameters
• message: Message
| MessageCoin
Message resource.
Returns
void
Inherited from
BaseTransactionRequest
.addMessageInput
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:409
addResource()
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.
Parameters
• resource: Resource
The resource to add.
Returns
This transaction.
Inherited from
BaseTransactionRequest
.addResource
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:453
addResources()
addResources(
resources
):UpgradeTransactionRequest
Adds multiple resources to the transaction by adding coin/message inputs and change outputs from the related assetIds.
Parameters
• resources: readonly Resource
[]
The resources to add.
Returns
This transaction.
Inherited from
BaseTransactionRequest
.addResources
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:470
addStateTransitionUpgradePurpose()
addStateTransitionUpgradePurpose(
bytecodeRoot
):UpgradeTransactionRequest
Adds a state transition upgrade purpose.
Parameters
• bytecodeRoot: BytesLike
The Merkle root of the state transition.
Returns
- The current instance of
UpgradeTransactionRequest
.
Defined in
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:100
addUpgradePurpose()
addUpgradePurpose(
type
,data
):UpgradeTransactionRequest
Adds an upgrade purpose.
Parameters
• type: UpgradePurposeTypeEnum
The upgrade purpose type.
• data: BytesLike
The bytecode or merkle root of upgrade purpose
Returns
- The current instance of
UpgradeTransactionRequest
.
Defined in
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:116
byteLength()
byteLength():
number
Returns
number
Inherited from
BaseTransactionRequest
.byteLength
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:709
calculateMaxGas()
calculateMaxGas(
chainInfo
,minGas
):BN
Parameters
• chainInfo: ChainInfo
• minGas: BN
Returns
BN
Inherited from
BaseTransactionRequest
.calculateMaxGas
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:567
fundWithFakeUtxos()
fundWithFakeUtxos(
quantities
,baseAssetId
,resourcesOwner
?):UpgradeTransactionRequest
Funds the transaction with fake UTXOs for each assetId and amount in the quantities array.
Parameters
• quantities: CoinQuantity
[]
CoinQuantity Array.
• baseAssetId: string
The base asset to fund the transaction.
• resourcesOwner?: AbstractAddress
Returns
Deprecated
- This method is deprecated and will be removed in future versions. Please use
Account.generateFakeResources
along withthis.addResources
instead.
Inherited from
BaseTransactionRequest
.fundWithFakeUtxos
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:596
getBaseTransaction()
protected
getBaseTransaction():ToBaseTransactionResponse
Method to obtain the base transaction details.
Returns
ToBaseTransactionResponse
The base transaction details.
Inherited from
BaseTransactionRequest
.getBaseTransaction
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:179
getChangeOutputs()
getChangeOutputs():
ChangeTransactionRequestOutput
[]
Gets the change outputs for a transaction.
Returns
ChangeTransactionRequestOutput
[]
The change outputs.
Inherited from
BaseTransactionRequest
.getChangeOutputs
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:332
getCoinInputs()
getCoinInputs():
CoinTransactionRequestInput
[]
Gets the coin inputs for a transaction.
Returns
The coin inputs.
Inherited from
BaseTransactionRequest
.getCoinInputs
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:310
getCoinOutputs()
getCoinOutputs():
CoinTransactionRequestOutput
[]
Gets the coin outputs for a transaction.
Returns
CoinTransactionRequestOutput
[]
The coin outputs.
Inherited from
BaseTransactionRequest
.getCoinOutputs
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:321
getCoinOutputsQuantities()
getCoinOutputsQuantities():
CoinQuantity
[]
Retrieves an array of CoinQuantity for each coin output present in the transaction. a transaction.
Returns
CoinQuantity array.
Inherited from
BaseTransactionRequest
.getCoinOutputsQuantities
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:647
getTransactionId()
getTransactionId(
chainId
):string
Gets the Transaction ID by hashing the transaction
Parameters
• chainId: number
The chain ID.
Returns
string
- A hash of the transaction, which is the transaction ID.
Overrides
BaseTransactionRequest
.getTransactionId
Defined in
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:169
metadataGas()
metadataGas(
gasCosts
):BN
Calculates the metadata gas cost for an upgrade transaction.
Parameters
• gasCosts: GasCosts
gas costs passed from the chain.
Returns
BN
metadata gas cost for the upgrade transaction.
Overrides
BaseTransactionRequest.metadataGas
Defined in
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:180
removeWitness()
removeWitness(
index
):void
Parameters
• index: number
Returns
void
Inherited from
BaseTransactionRequest
.removeWitness
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:675
toJSON()
toJSON():
any
Return the minimum amount in native coins required to create a transaction.
Returns
any
The transaction as a JSON object.
Inherited from
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:671
toTransaction()
toTransaction():
TransactionUpgrade
Converts the transaction request to a TransactionUpgrade
.
Returns
TransactionUpgrade
The transaction create object.
Overrides
BaseTransactionRequest
.toTransaction
Defined in
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:133
toTransactionBytes()
toTransactionBytes():
Uint8Array
Converts the transaction request to a byte array.
Returns
Uint8Array
The transaction bytes.
Inherited from
BaseTransactionRequest
.toTransactionBytes
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:210
updatePredicateGasUsed()
updatePredicateGasUsed(
inputs
):void
Parameters
• inputs: TransactionRequestInput
[]
Returns
void
Inherited from
BaseTransactionRequest
.updatePredicateGasUsed
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:689
updateWitness()
updateWitness(
index
,witness
):void
Updates an existing witness without any side effects.
Parameters
• index: number
The index of the witness to update.
• witness: BytesLike
The new witness.
Returns
void
Throws
If the witness does not exist.
Inherited from
BaseTransactionRequest
.updateWitness
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:281
updateWitnessByOwner()
updateWitnessByOwner(
address
,signature
):void
Updates the witness for a given owner and signature.
Parameters
• address: string
| AbstractAddress
The address to get the coin input witness index for.
• signature: BytesLike
The signature to update the witness with.
Returns
void
Inherited from
BaseTransactionRequest
.updateWitnessByOwner
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:266
from()
static
from(obj
):UpgradeTransactionRequest
Parameters
• obj: UpgradeTransactionRequestLike
Returns
Defined in
packages/account/src/providers/transaction-request/upgrade-transaction-request.ts:45
getPolicyMeta()
static
getPolicyMeta(req
):object
Parameters
• req: BaseTransactionRequest
Returns
object
policies
policies:
Policy
[]
policyTypes
policyTypes:
number
Inherited from
BaseTransactionRequest
.getPolicyMeta
Defined in
packages/account/src/providers/transaction-request/transaction-request.ts:145