Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link

@fuel-ts/account v0.97.0 Docs


Icon LinkClass: Predicate<TData, TConfigurables>

Predicate provides methods to populate transaction data with predicate information and sending transactions with them.

Icon LinkExtends

Icon LinkType Parameters

TData extends InputValue[] = InputValue[]

TConfigurables extends object | undefined = object

Icon LinkConstructors

Icon Linknew Predicate()

Icon InfoCircle

new Predicate<TData, TConfigurables>(__namedParameters): Predicate <TData, TConfigurables>

Creates an instance of the Predicate class.

Icon LinkParameters

__namedParameters: PredicateParams <TData, TConfigurables>

Icon LinkReturns

Predicate <TData, TConfigurables>

Icon LinkOverrides

Account .constructor

Icon LinkDefined in

packages/account/src/predicate/predicate.ts:61 Icon Link

Icon LinkProperties

Icon Link_connector?

Icon InfoCircle

protected optional _connector: FuelConnector

The connector for use with external wallets

Icon LinkInherited from

Account ._connector

Icon LinkDefined in

packages/account/src/account.ts:93 Icon Link


Icon Link_provider?

Icon InfoCircle

protected optional _provider: Provider

The provider used to interact with the network.

Icon LinkInherited from

Account ._provider

Icon LinkDefined in

packages/account/src/account.ts:88 Icon Link


Icon Linkaddress

Icon InfoCircle

readonly address: AbstractAddress

The address associated with the account.

Icon LinkInherited from

Account .address

Icon LinkDefined in

packages/account/src/account.ts:83 Icon Link


Icon Linkbytes

Icon InfoCircle

bytes: Uint8Array

Icon LinkDefined in

packages/account/src/predicate/predicate.ts:48 Icon Link


Icon Linkinterface

Icon InfoCircle

interface: Interface

Icon LinkDefined in

packages/account/src/predicate/predicate.ts:50 Icon Link


Icon LinkpredicateData

Icon InfoCircle

predicateData: TData

Icon LinkDefined in

packages/account/src/predicate/predicate.ts:49 Icon Link

Icon LinkAccessors

Icon Linkprovider

Icon InfoCircle

get provider(): Provider

The provider used to interact with the network.

Icon LinkThrows

FuelError if the provider is not set.

Icon InfoCircle

set provider(provider): void

Sets the provider for the account.

Icon LinkParameters

provider: Provider

A Provider instance.

Icon LinkReturns

Provider

A Provider instance.

Icon LinkInherited from

Account .provider

Icon LinkDefined in

packages/account/src/account.ts:116 Icon Link

Icon LinkMethods

Icon LinkaddBatchTransfer()

Icon InfoCircle

addBatchTransfer(request, transferParams): ScriptTransactionRequest

Adds multiple transfers to a script transaction request.

Icon LinkParameters

request: ScriptTransactionRequest

The script transaction request to add transfers to.

transferParams: TransferParams []

An array of TransferParams objects representing the transfers to be made.

Icon LinkReturns

ScriptTransactionRequest

The updated script transaction request.

Icon LinkInherited from

Account .addBatchTransfer

Icon LinkDefined in

packages/account/src/account.ts:415 Icon Link


Icon LinkaddTransfer()

Icon InfoCircle

addTransfer(request, transferParams): ScriptTransactionRequest

Adds a transfer to the given transaction request.

Icon LinkParameters

request: ScriptTransactionRequest

The script transaction request to add transfers to.

transferParams: TransferParams

The object representing the transfer to be made.

Icon LinkReturns

ScriptTransactionRequest

The updated transaction request with the added transfer.

Icon LinkInherited from

Account .addTransfer

Icon LinkDefined in

packages/account/src/account.ts:397 Icon Link


Icon LinkbatchTransfer()

Icon InfoCircle

batchTransfer(transferParams, txParams): Promise<TransactionResponse >

Transfers multiple amounts of a token to multiple recipients.

Icon LinkParameters

transferParams: TransferParams []

An array of TransferParams objects representing the transfers to be made.

txParams: TxParamsType = {}

Optional transaction parameters.

Icon LinkReturns

Promise<TransactionResponse >

A promise that resolves to a TransactionResponse object representing the transaction result.

Icon LinkInherited from

Account .batchTransfer

Icon LinkDefined in

packages/account/src/account.ts:380 Icon Link


Icon LinkbatchTransferToContracts()

Icon InfoCircle

batchTransferToContracts(contractTransferParams, txParams): Promise<TransactionResponse >

Icon LinkParameters

contractTransferParams: ContractTransferParams []

txParams: TxParamsType = {}

Icon LinkReturns

Promise<TransactionResponse >

Icon LinkInherited from

Account .batchTransferToContracts

Icon LinkDefined in

packages/account/src/account.ts:445 Icon Link


Icon Linkconnect()

Icon InfoCircle

connect(provider): Provider

Changes the provider connection for the account.

Icon LinkParameters

provider: Provider

A Provider instance.

Icon LinkReturns

Provider

The updated Provider instance.

Icon LinkInherited from

Account .connect

Icon LinkDefined in

packages/account/src/account.ts:139 Icon Link


Icon LinkcreateTransfer()

Icon InfoCircle

createTransfer(destination, amount, assetId?, txParams?): Promise<ScriptTransactionRequest >

A helper that creates a transfer transaction request and returns it.

Icon LinkParameters

destination: string | AbstractAddress

The address of the destination.

amount: BigNumberish

The amount of coins to transfer.

assetId?: BytesLike

The asset ID of the coins to transfer (optional).

txParams?: TxParamsType = {}

The transaction parameters (optional).

Icon LinkReturns

Promise<ScriptTransactionRequest >

A promise that resolves to the prepared transaction request.

Icon LinkInherited from

Account .createTransfer

Icon LinkDefined in

packages/account/src/account.ts:342 Icon Link


Icon Linkdeploy()

Icon InfoCircle

deploy<T>(account): Promise<object>

Icon LinkType Parameters

T = Predicate <TData, TConfigurables>

Icon LinkParameters

account: Account

The account used to pay the deployment costs.

Icon LinkReturns

Promise<object>

The blobId and a waitForResult callback that returns the deployed predicate once the blob deployment transaction finishes.

The returned loader predicate will have the same configurable constants as the original predicate which was used to generate the loader predicate.

Icon LinkblobId

Icon InfoCircle

blobId: string

Icon LinkwaitForResult()

Icon InfoCircle

waitForResult: () => Promise<T>

Icon LinkReturns

Promise<T>

Icon LinkDefined in

packages/account/src/predicate/predicate.ts:315 Icon Link


Icon Linkfund()

Icon InfoCircle

fund<T>(request, params): Promise<T>

Funds a transaction request by adding the necessary resources.

Icon LinkType Parameters

T extends TransactionRequest

The type of the TransactionRequest.

Icon LinkParameters

request: T

The transaction request to fund.

params: EstimatedTxParams

The estimated transaction parameters.

Icon LinkReturns

Promise<T>

A promise that resolves to the funded transaction request.

Icon LinkInherited from

Account .fund

Icon LinkDefined in

packages/account/src/account.ts:209 Icon Link


Icon LinkgenerateFakeResources()

Icon InfoCircle

generateFakeResources(coins): Resource []

Generates an array of fake resources based on the provided coins.

Icon LinkParameters

coins: FakeResources []

An array of FakeResources objects representing the coins.

Icon LinkReturns

Resource []

An array of Resource objects with generated properties.

Icon LinkOverrides

Account .generateFakeResources

Icon LinkDefined in

packages/account/src/predicate/predicate.ts:212 Icon Link


Icon LinkgetBalance()

Icon InfoCircle

getBalance(assetId?): Promise<BN>

Retrieves the balance of the account for the given asset.

Icon LinkParameters

assetId?: BytesLike

The asset ID to check the balance for (optional).

Icon LinkReturns

Promise<BN>

A promise that resolves to the balance amount.

Icon LinkInherited from

Account .getBalance

Icon LinkDefined in

packages/account/src/account.ts:186 Icon Link


Icon LinkgetBalances()

Icon InfoCircle

getBalances(): Promise<GetBalancesResponse >

Retrieves all the balances for the account.

Icon LinkReturns

Promise<GetBalancesResponse >

A promise that resolves to an array of Coins and their quantities.

Icon LinkInherited from

Account .getBalances

Icon LinkDefined in

packages/account/src/account.ts:197 Icon Link


Icon LinkgetCoins()

Icon InfoCircle

getCoins(assetId?, paginationArgs?): Promise<GetCoinsResponse >

Retrieves coins owned by the account.

Icon LinkParameters

assetId?: BytesLike

The asset ID of the coins to retrieve (optional).

paginationArgs?: CursorPaginationArgs

Icon LinkReturns

Promise<GetCoinsResponse >

A promise that resolves to an array of Coins.

Icon LinkInherited from

Account .getCoins

Icon LinkDefined in

packages/account/src/account.ts:164 Icon Link


Icon LinkgetMessages()

Icon InfoCircle

getMessages(paginationArgs?): Promise<GetMessagesResponse >

Retrieves messages owned by the account.

Icon LinkParameters

paginationArgs?: CursorPaginationArgs

Icon LinkReturns

Promise<GetMessagesResponse >

A promise that resolves to an array of Messages.

Icon LinkInherited from

Account .getMessages

Icon LinkDefined in

packages/account/src/account.ts:176 Icon Link


Icon LinkgetResourcesToSpend()

Icon InfoCircle

getResourcesToSpend(quantities, excludedIds?): Promise<Resource []>

Retrieves resources satisfying the spend query for the account.

Icon LinkParameters

quantities: CoinQuantityLike []

IDs of coins to exclude.

excludedIds?: ExcludeResourcesOption

IDs of resources to be excluded from the query.

Icon LinkReturns

Promise<Resource []>

A promise that resolves to an array of Resources.

Icon LinkOverrides

Account .getResourcesToSpend

Icon LinkDefined in

packages/account/src/predicate/predicate.ts:190 Icon Link


Icon LinkgetTransactionCost()

Icon InfoCircle

getTransactionCost(transactionRequestLike, transactionCostParams): Promise<TransactionCost >

Returns a transaction cost to enable user to set gasLimit and also reserve balance amounts on the transaction.

Icon LinkParameters

transactionRequestLike: TransactionRequestLike

The transaction request object.

transactionCostParams: TransactionCostParams = {}

The transaction cost parameters (optional).

Icon LinkReturns

Promise<TransactionCost >

A promise that resolves to the transaction cost object.

Icon LinkInherited from

Account .getTransactionCost

Icon LinkDefined in

packages/account/src/account.ts:547 Icon Link


Icon LinkpopulateTransactionPredicateData()

Icon InfoCircle

populateTransactionPredicateData<T>(transactionRequestLike): T

Populates the transaction data with predicate data.

Icon LinkType Parameters

T extends TransactionRequest

Icon LinkParameters

transactionRequestLike: TransactionRequestLike

The transaction request-like object.

Icon LinkReturns

T

The transaction request with predicate data.

Icon LinkDefined in

packages/account/src/predicate/predicate.ts:89 Icon Link


Icon LinksendTransaction()

Icon InfoCircle

sendTransaction(transactionRequestLike): Promise<TransactionResponse >

Sends a transaction with the populated predicate data.

Icon LinkParameters

transactionRequestLike: TransactionRequestLike

The transaction request-like object.

Icon LinkReturns

Promise<TransactionResponse >

A promise that resolves to the transaction response.

Icon LinkOverrides

Account .sendTransaction

Icon LinkDefined in

packages/account/src/predicate/predicate.ts:120 Icon Link


Icon LinksignTransaction()

Icon InfoCircle

signTransaction(transactionRequestLike): Promise<string>

Signs a transaction from the account via the connector..

Icon LinkParameters

transactionRequestLike: TransactionRequestLike

The transaction request to sign.

Icon LinkReturns

Promise<string>

A promise that resolves to the signature of the transaction.

Icon LinkInherited from

Account .signTransaction

Icon LinkDefined in

packages/account/src/account.ts:629 Icon Link


Icon LinksimulateTransaction()

Icon InfoCircle

simulateTransaction(transactionRequestLike): Promise<CallResult >

Simulates a transaction with the populated predicate data.

Icon LinkParameters

transactionRequestLike: TransactionRequestLike

The transaction request-like object.

Icon LinkReturns

Promise<CallResult >

A promise that resolves to the call result.

Icon LinkOverrides

Account .simulateTransaction

Icon LinkDefined in

packages/account/src/predicate/predicate.ts:132 Icon Link


Icon Linktransfer()

Icon InfoCircle

transfer(destination, amount, assetId?, txParams?): Promise<TransactionResponse >

Transfers coins to a destination address.

Icon LinkParameters

destination: string | AbstractAddress

The address of the destination.

amount: BigNumberish

The amount of coins to transfer.

assetId?: BytesLike

The asset ID of the coins to transfer (optional).

txParams?: TxParamsType = {}

The transaction parameters (optional).

Icon LinkReturns

Promise<TransactionResponse >

A promise that resolves to the transaction response.

Icon LinkInherited from

Account .transfer

Icon LinkDefined in

packages/account/src/account.ts:363 Icon Link


Icon LinktransferToContract()

Icon InfoCircle

transferToContract(contractId, amount, assetId?, txParams?): Promise<TransactionResponse >

Transfers coins to a contract address.

Icon LinkParameters

contractId: string | AbstractAddress

The address of the contract.

amount: BigNumberish

The amount of coins to transfer.

assetId?: BytesLike

The asset ID of the coins to transfer (optional).

txParams?: TxParamsType = {}

The transaction parameters (optional).

Icon LinkReturns

Promise<TransactionResponse >

A promise that resolves to the transaction response.

Icon LinkInherited from

Account .transferToContract

Icon LinkDefined in

packages/account/src/account.ts:436 Icon Link


Icon LinkwithdrawToBaseLayer()

Icon InfoCircle

withdrawToBaseLayer(recipient, amount, txParams): Promise<TransactionResponse >

Withdraws an amount of the base asset to the base chain.

Icon LinkParameters

recipient: string | AbstractAddress

Address of the recipient on the base chain.

amount: BigNumberish

Amount of base asset.

txParams: TxParamsType = {}

The transaction parameters (optional).

Icon LinkReturns

Promise<TransactionResponse >

A promise that resolves to the transaction response.

Icon LinkInherited from

Account .withdrawToBaseLayer

Icon LinkDefined in

packages/account/src/account.ts:498 Icon Link