Creates an instance of the Predicate class.
Protected
Optional
_connectorThe connector for use with external wallets
Protected
Optional
_providerThe provider used to interact with the network.
Readonly
addressThe address associated with the account.
Adds multiple transfers to a script transaction request.
The script transaction request to add transfers to.
An array of TransferParams
objects representing the transfers to be made.
The updated script transaction request.
Adds a transfer to the given transaction request.
The script transaction request to add transfers to.
The object representing the transfer to be made.
The updated transaction request with the added transfer.
Assembles transactions for consolidating base asset coins into fewer UTXOs.
This method splits the provided coins into batches and creates transaction requests to consolidate them. It calculates the necessary fee and sets up the transactions to be submitted either in parallel (default) or sequentially.
The parameters for assembling base asset consolidation transactions.
An object containing the assembled transactions, the total fee cost, and a callback to submit all transactions.
Transfers multiple amounts of a token to multiple recipients.
An array of TransferParams
objects representing the transfers to be made.
Optional transaction parameters.
A promise that resolves to a TransactionResponse
object representing the transaction result.
Consolidates base asset UTXOs into fewer, larger ones.
Retrieves a limited number of base asset coins (as defined by Provider.RESOURCES_PAGE_SIZE_LIMIT
),
assembles consolidation transactions, and submits them to the network.
Note: This method currently supports only the base asset.
The parameters for coin consolidation, including the asset ID, mode, and output number.
A promise that resolves to the response of the submitted transactions.
A helper that creates a transfer transaction request and returns it.
The address of the destination.
The amount of coins to transfer.
Optional
assetId: BytesLikeThe asset ID of the coins to transfer (optional).
The transaction parameters (optional).
A promise that resolves to the prepared transaction request.
The account used to pay the deployment costs.
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.
Funds a transaction request by adding the necessary resources.
The type of the TransactionRequest.
The transaction request to fund.
The estimated transaction parameters.
A promise that resolves to the funded transaction request.
Use provider.assembleTx instead Check the migration guide https://docs.fuel.network/docs/fuels-ts/transactions/assemble-tx-migration-guide/ for more information.
Generates an array of fake resources based on the provided coins.
An array of FakeResources
objects representing the coins.
An array of Resource
objects with generated properties.
Retrieves all the balances for the account.
A promise that resolves to an array of Coins and their quantities.
Retrieves coins owned by the account.
Optional
assetId: BytesLikeThe asset ID of the coins to retrieve (optional).
Optional
paginationArgs: CursorPaginationArgsA promise that resolves to an array of Coins.
Retrieves messages owned by the account.
Optional
paginationArgs: CursorPaginationArgsA promise that resolves to an array of Messages.
Retrieves resources satisfying the spend query for the account.
IDs of coins to exclude.
Optional
resourcesIdsToIgnore: ResourcesIdsToIgnoreIDs of resources to be excluded from the query.
A promise that resolves to an array of Resources.
Returns a transaction cost to enable user to set gasLimit and also reserve balance amounts on the transaction.
The transaction request object.
The transaction cost parameters (optional).
A promise that resolves to the transaction cost object.
Use provider.assembleTx instead Check the migration guide https://docs.fuel.network/docs/fuels-ts/transactions/assemble-tx-migration-guide/ for more information.
Populates the transaction data with predicate data.
The transaction request-like object.
The transaction request with predicate data.
Prepares a function to submit all transactions either sequentially or in parallel.
The parameters for preparing the submitAll callback.
A callback that, when called, submits all transactions and returns their results and any errors encountered.
Sends a transaction with the populated predicate data.
The transaction request-like object.
A promise that resolves to the transaction response.
Sets the predicate data.
The data to be set for the predicate.
Signs a transaction from the account via the connector..
The transaction request to sign.
A promise that resolves to the signature of the transaction.
Simulates a transaction with the populated predicate data.
The transaction request-like object.
A promise that resolves to the call result.
Creates a new Predicate instance from an existing Predicate instance.
The data and configurable constants to override.
A new Predicate instance with the same bytecode, ABI and provider but with the ability to set the data and configurable constants.
Transfers coins to a destination address.
The address of the destination.
The amount of coins to transfer.
Optional
assetId: BytesLikeThe asset ID of the coins to transfer (optional).
The transaction parameters (optional).
A promise that resolves to the transaction response.
Transfers coins to a contract address.
The address of the contract.
The amount of coins to transfer.
The asset ID of the coins to transfer (optional).
The transaction parameters (optional).
A promise that resolves to the transaction response.
Withdraws an amount of the base asset to the base chain.
Address of the recipient on the base chain.
Amount of base asset.
The transaction parameters (optional).
A promise that resolves to the transaction response.
Predicate
provides methods to populate transaction data with predicate information and sending transactions with them.