@fuel-ts/providers.CreateTransactionRequest
CreateTransactionRequest
provides functionalities for creating a transaction request that creates a contract.
↳ CreateTransactionRequest
• new CreateTransactionRequest(createTransactionRequestLike?
)
Creates an instance CreateTransactionRequest
.
Name | Type | Description |
---|---|---|
createTransactionRequestLike | CreateTransactionRequestLike | The initial values for the instance |
BaseTransactionRequest.constructor
packages/providers/src/transaction-request/create-transaction-request.ts:50
• bytecodeWitnessIndex: number
Witness index of contract bytecode to create
packages/providers/src/transaction-request/create-transaction-request.ts:39
• gasLimit: BN
Gas limit for transaction
BaseTransactionRequest.gasLimit
packages/providers/src/transaction-request/transaction-request.ts:67
• gasPrice: BN
Gas price for transaction
BaseTransactionRequest.gasPrice
packages/providers/src/transaction-request/transaction-request.ts:65
• inputs: TransactionRequestInput
[] = []
List of inputs
packages/providers/src/transaction-request/transaction-request.ts:71
• maturity: number
Block until which tx cannot be included
BaseTransactionRequest.maturity
packages/providers/src/transaction-request/transaction-request.ts:69
• outputs: TransactionRequestOutput
[] = []
List of outputs
BaseTransactionRequest.outputs
packages/providers/src/transaction-request/transaction-request.ts:73
• salt: string
Salt
packages/providers/src/transaction-request/create-transaction-request.ts:41
• storageSlots: TransactionRequestStorageSlot
[]
List of storage slots to initialize
packages/providers/src/transaction-request/create-transaction-request.ts:43
• type: Create
Type of the transaction
packages/providers/src/transaction-request/create-transaction-request.ts:37
• witnesses: BytesLike
[] = []
List of witnesses
BaseTransactionRequest.witnesses
packages/providers/src/transaction-request/transaction-request.ts:75
▸ addCoinOutput(to
, amount
, assetId?
): void
Adds a coin input to the transaction.
Name | Type | Default value | Description |
---|---|---|---|
to | AddressLike | undefined | Address of the owner. |
amount | BigNumberish | undefined | Amount of coin. |
assetId | BytesLike | BaseAssetId | Asset ID of coin. |
void
BaseTransactionRequest.addCoinOutput
packages/providers/src/transaction-request/transaction-request.ts:339
▸ addCoinOutputs(to
, quantities
): void
Adds multiple coin outputs to the transaction.
Name | Type | Description |
---|---|---|
to | AddressLike | Address of the destination. |
quantities | CoinQuantityLike [] | Quantities of coins. |
void
BaseTransactionRequest.addCoinOutputs
packages/providers/src/transaction-request/transaction-request.ts:361
▸ addContractCreatedOutput(contractId
, stateRoot
): void
Adds a contract created output to the transaction request.
Name | Type | Description |
---|---|---|
contractId | BytesLike | The contract ID. |
stateRoot | BytesLike | The state root. |
void
packages/providers/src/transaction-request/create-transaction-request.ts:100
▸ addResourceInputAndOutput(resource
): CreateTransactionRequest
Adds a single resource to the transaction by adding inputs and outputs.
Name | Type |
---|---|
resource | Resource |
This transaction.
BaseTransactionRequest.addResourceInputAndOutput
packages/providers/src/transaction-request/transaction-request.ts:267
▸ addResourceInputsAndOutputs(resources
): CreateTransactionRequest
Adds multiple resources to the transaction by adding inputs and outputs.
Name | Type | Description |
---|---|---|
resources | readonly Resource [] | The resources to add. |
This transaction.
BaseTransactionRequest.addResourceInputsAndOutputs
packages/providers/src/transaction-request/transaction-request.ts:326
▸ calculateFee(): CoinQuantity
Return the minimum amount in native coins required to create a transaction. This is required even if the gasPrice is 0.
The minimum amount in coins required to create a transaction.
BaseTransactionRequest.calculateFee
packages/providers/src/transaction-request/transaction-request.ts:398
▸ Protected
getBaseTransaction(): Pick
<TransactionScript
| TransactionCreate
, "inputsCount"
| "outputsCount"
| "witnessesCount"
| keyof BaseTransactionRequestLike
>
Method to obtain the base transaction details.
Pick
<TransactionScript
| TransactionCreate
, "inputsCount"
| "outputsCount"
| "witnessesCount"
| keyof BaseTransactionRequestLike
>
The base transaction details.
BaseTransactionRequest.getBaseTransaction
packages/providers/src/transaction-request/transaction-request.ts:103
▸ getChangeOutputs(): ChangeTransactionRequestOutput
[]
Gets the change outputs for a transaction.
ChangeTransactionRequestOutput
[]
The change outputs.
BaseTransactionRequest.getChangeOutputs
packages/providers/src/transaction-request/transaction-request.ts:218
▸ getCoinInputs(): CoinTransactionRequestInput
[]
Gets the coin inputs for a transaction.
The coin inputs.
BaseTransactionRequest.getCoinInputs
packages/providers/src/transaction-request/transaction-request.ts:196
▸ getCoinOutputs(): CoinTransactionRequestOutput
[]
Gets the coin outputs for a transaction.
CoinTransactionRequestOutput
[]
The coin outputs.
BaseTransactionRequest.getCoinOutputs
packages/providers/src/transaction-request/transaction-request.ts:207
▸ getContractCreatedOutputs(): ContractCreatedTransactionRequestOutput
[]
Get contract created outputs for the transaction.
ContractCreatedTransactionRequestOutput
[]
An array of contract created transaction request outputs.
packages/providers/src/transaction-request/create-transaction-request.ts:87
▸ toJSON(): any
Return the minimum amount in native coins required to create a transaction.
any
The transaction as a JSON object.
packages/providers/src/transaction-request/transaction-request.ts:413
▸ toTransaction(): TransactionCreate
Converts the transaction request to a TransactionCreate
.
TransactionCreate
The transaction create object.
BaseTransactionRequest.toTransaction
packages/providers/src/transaction-request/create-transaction-request.ts:67
▸ toTransactionBytes(): Uint8Array
Converts the transaction request to a byte array.
Uint8Array
The transaction bytes.
BaseTransactionRequest.toTransactionBytes
packages/providers/src/transaction-request/transaction-request.ts:130
▸ updateWitness(index
, witness
): void
Updates an existing witness without any side effects.
Throws
If the witness does not exist.
Name | Type | Description |
---|---|---|
index | number | The index of the witness to update. |
witness | BytesLike | The new witness. |
void
BaseTransactionRequest.updateWitness
packages/providers/src/transaction-request/transaction-request.ts:184
▸ updateWitnessByCoinInputOwner(owner
, witness
): void
Updates the witness for the given CoinInput owner.
Throws
If no witness exists for the given owner.
Name | Type | Description |
---|---|---|
owner | AddressLike | The owner of the CoinInput. |
witness | BytesLike | The witness to update. |
void
BaseTransactionRequest.updateWitnessByCoinInputOwner
packages/providers/src/transaction-request/transaction-request.ts:251
▸ updateWitnessByOwner(address
, signature
): void
Updates the witness for a given owner and signature.
Name | Type | Description |
---|---|---|
address | AbstractAddress | The address to get the coin input witness index for. |
signature | BytesLike | The signature to update the witness with. |
void
BaseTransactionRequest.updateWitnessByOwner
packages/providers/src/transaction-request/transaction-request.ts:170
▸ Static
from(obj
): CreateTransactionRequest
Name | Type |
---|---|
obj | CreateTransactionRequestLike |
packages/providers/src/transaction-request/create-transaction-request.ts:29
Was this page helpful?