Icon SunFilledIcon MoonStars

Icon LinkClass: CreateTransactionRequest

@fuel-ts/providers .CreateTransactionRequest

CreateTransactionRequest provides functionalities for creating a transaction request that creates a contract.

Icon LinkHierarchy

Icon LinkConstructors

Icon Linkconstructor

new CreateTransactionRequest(createTransactionRequestLike?)

Creates an instance CreateTransactionRequest.

Icon LinkParameters

NameTypeDescription
createTransactionRequestLikeCreateTransactionRequestLikeThe initial values for the instance

Icon LinkOverrides

BaseTransactionRequest .constructor

Icon LinkDefined in

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

Icon LinkProperties

Icon LinkbytecodeWitnessIndex

bytecodeWitnessIndex: number

Witness index of contract bytecode to create

Icon LinkDefined in

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


Icon LinkgasLimit

gasLimit: BN

Gas limit for transaction

Icon LinkInherited from

BaseTransactionRequest .gasLimit

Icon LinkDefined in

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


Icon LinkgasPrice

gasPrice: BN

Gas price for transaction

Icon LinkInherited from

BaseTransactionRequest .gasPrice

Icon LinkDefined in

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


Icon Linkinputs

inputs: TransactionRequestInput [] = []

List of inputs

Icon LinkInherited from

BaseTransactionRequest .inputs

Icon LinkDefined in

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


Icon Linkmaturity

maturity: number

Block until which tx cannot be included

Icon LinkInherited from

BaseTransactionRequest .maturity

Icon LinkDefined in

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


Icon Linkoutputs

outputs: TransactionRequestOutput [] = []

List of outputs

Icon LinkInherited from

BaseTransactionRequest .outputs

Icon LinkDefined in

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


Icon Linksalt

salt: string

Salt

Icon LinkDefined in

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


Icon LinkstorageSlots

storageSlots: TransactionRequestStorageSlot[]

List of storage slots to initialize

Icon LinkDefined in

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


Icon Linktype

type: Create

Type of the transaction

Icon LinkOverrides

BaseTransactionRequest .type

Icon LinkDefined in

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


Icon Linkwitnesses

witnesses: BytesLike[] = []

List of witnesses

Icon LinkInherited from

BaseTransactionRequest .witnesses

Icon LinkDefined in

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

Icon LinkMethods

Icon LinkaddChangeOutput

addChangeOutput(to, assetId?): void

Adds a change output to the transaction.

Icon LinkParameters

NameTypeDefault valueDescription
toAddressLike undefinedAddress of the owner.
assetIdBytesLikeBaseAssetIdAsset ID of coin.

Icon LinkReturns

void

Icon LinkInherited from

BaseTransactionRequest .addChangeOutput

Icon LinkDefined in

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


Icon LinkaddCoinInput

addCoinInput(coin, predicate?): void

Adds a single coin input to the transaction and a change output for the related assetId, if one it was not added yet.

Icon LinkParameters

NameTypeDescription
coinCoin Coin resource.
predicate?AbstractPredicatePredicate bytes.

Icon LinkReturns

void

Icon LinkInherited from

BaseTransactionRequest .addCoinInput

Icon LinkDefined in

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


Icon LinkaddCoinOutput

addCoinOutput(to, amount, assetId?): CreateTransactionRequest

Adds a coin output to the transaction.

Icon LinkParameters

NameTypeDefault valueDescription
toAddressLike undefinedAddress of the owner.
amountBigNumberishundefinedAmount of coin.
assetIdBytesLikeBaseAssetIdAsset ID of coin.

Icon LinkReturns

CreateTransactionRequest

Icon LinkInherited from

BaseTransactionRequest .addCoinOutput

Icon LinkDefined in

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


Icon LinkaddCoinOutputs

addCoinOutputs(to, quantities): CreateTransactionRequest

Adds multiple coin outputs to the transaction.

Icon LinkParameters

NameTypeDescription
toAddressLike Address of the destination.
quantitiesCoinQuantityLike []Quantities of coins.

Icon LinkReturns

CreateTransactionRequest

Icon LinkInherited from

BaseTransactionRequest .addCoinOutputs

Icon LinkDefined in

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


Icon LinkaddContractCreatedOutput

addContractCreatedOutput(contractId, stateRoot): void

Adds a contract created output to the transaction request.

Icon LinkParameters

NameTypeDescription
contractIdBytesLikeThe contract ID.
stateRootBytesLikeThe state root.

Icon LinkReturns

void

Icon LinkDefined in

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


Icon LinkaddMessageInput

addMessageInput(message, predicate?): void

Adds a single message input to the transaction and a change output for the baseAssetId, if one it was not added yet.

Icon LinkParameters

NameTypeDescription
messageMessageCoin Message resource.
predicate?AbstractPredicatePredicate bytes.

Icon LinkReturns

void

Icon LinkInherited from

BaseTransactionRequest .addMessageInput

Icon LinkDefined in

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


Icon LinkaddPredicateResource

addPredicateResource(resource, predicate): CreateTransactionRequest

Adds multiple resources to the transaction by adding coin/message inputs and change outputs from the related assetIds.

Icon LinkParameters

NameType
resourceResource
predicateAbstractPredicate

Icon LinkReturns

CreateTransactionRequest

This transaction.

Icon LinkInherited from

BaseTransactionRequest .addPredicateResource

Icon LinkDefined in

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


Icon LinkaddPredicateResources

addPredicateResources(resources, predicate): CreateTransactionRequest

Adds multiple predicate coin/message inputs to the transaction and change outputs from the related assetIds.

Icon LinkParameters

NameTypeDescription
resourcesResource []The resources to add.
predicateAbstractPredicate-

Icon LinkReturns

CreateTransactionRequest

This transaction.

Icon LinkInherited from

BaseTransactionRequest .addPredicateResources

Icon LinkDefined in

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


Icon LinkaddResource

addResource(resource): CreateTransactionRequest

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.

Icon LinkParameters

NameTypeDescription
resourceResource The resource to add.

Icon LinkReturns

CreateTransactionRequest

This transaction.

Icon LinkInherited from

BaseTransactionRequest .addResource

Icon LinkDefined in

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


Icon LinkaddResources

addResources(resources): CreateTransactionRequest

Adds multiple resources to the transaction by adding coin/message inputs and change outputs from the related assetIds.

Icon LinkParameters

NameTypeDescription
resourcesreadonly Resource []The resources to add.

Icon LinkReturns

CreateTransactionRequest

This transaction.

Icon LinkInherited from

BaseTransactionRequest .addResources

Icon LinkDefined in

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


Icon LinkcalculateFee

calculateFee(gasPriceFactor): CoinQuantity

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

Icon LinkParameters

NameType
gasPriceFactorBN

Icon LinkReturns

CoinQuantity

The minimum amount in coins required to create a transaction.

Icon LinkInherited from

BaseTransactionRequest .calculateFee

Icon LinkDefined in

packages/providers/src/transaction-request/transaction-request.ts:473 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 LinkInherited from

BaseTransactionRequest .getBaseTransaction

Icon LinkDefined in

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


Icon LinkgetChangeOutputs

getChangeOutputs(): ChangeTransactionRequestOutput []

Gets the change outputs for a transaction.

Icon LinkReturns

ChangeTransactionRequestOutput []

The change outputs.

Icon LinkInherited from

BaseTransactionRequest .getChangeOutputs

Icon LinkDefined in

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


Icon LinkgetCoinInputs

getCoinInputs(): CoinTransactionRequestInput []

Gets the coin inputs for a transaction.

Icon LinkReturns

CoinTransactionRequestInput []

The coin inputs.

Icon LinkInherited from

BaseTransactionRequest .getCoinInputs

Icon LinkDefined in

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


Icon LinkgetCoinOutputs

getCoinOutputs(): CoinTransactionRequestOutput []

Gets the coin outputs for a transaction.

Icon LinkReturns

CoinTransactionRequestOutput []

The coin outputs.

Icon LinkInherited from

BaseTransactionRequest .getCoinOutputs

Icon LinkDefined in

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


Icon LinkgetContractCreatedOutputs

getContractCreatedOutputs(): ContractCreatedTransactionRequestOutput []

Get contract created outputs for the transaction.

Icon LinkReturns

ContractCreatedTransactionRequestOutput []

An array of contract created transaction request outputs.

Icon LinkDefined in

packages/providers/src/transaction-request/create-transaction-request.ts:87 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 LinkInherited from

BaseTransactionRequest .toJSON

Icon LinkDefined in

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


Icon LinktoTransaction

toTransaction(): TransactionCreate

Converts the transaction request to a TransactionCreate.

Icon LinkReturns

TransactionCreate

The transaction create object.

Icon LinkOverrides

BaseTransactionRequest .toTransaction

Icon LinkDefined in

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


Icon LinktoTransactionBytes

toTransactionBytes(): Uint8Array

Converts the transaction request to a byte array.

Icon LinkReturns

Uint8Array

The transaction bytes.

Icon LinkInherited from

BaseTransactionRequest .toTransactionBytes

Icon LinkDefined in

packages/providers/src/transaction-request/transaction-request.ts:131 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 LinkInherited from

BaseTransactionRequest .updateWitness

Icon LinkDefined in

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


Icon LinkupdateWitnessByOwner

updateWitnessByOwner(address, signature): void

Updates the witness for a given owner and signature.

Icon LinkParameters

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

Icon LinkReturns

void

Icon LinkInherited from

BaseTransactionRequest .updateWitnessByOwner

Icon LinkDefined in

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


Icon Linkfrom

Static from(obj): CreateTransactionRequest

Icon LinkParameters

NameType
objCreateTransactionRequestLike

Icon LinkReturns

CreateTransactionRequest

Icon LinkDefined in

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