import { AbstractAccount } from '@fuel-ts/interfaces'; import type { AbstractAddress } from '@fuel-ts/interfaces'; import type { BigNumberish, BN } from '@fuel-ts/math'; import type { TransactionRequestLike, CallResult, TransactionRequest, Coin, CoinQuantityLike, CoinQuantity, Message, Resource, ExcludeResourcesOption, TransactionResponse, Provider, ScriptTransactionRequestLike, ProviderSendTxParams } from '@fuel-ts/providers'; import type { BytesLike } from 'ethers'; export type TxParamsType = Pick; /** * `Account` provides an abstraction for interacting with accounts or wallets on the network. */ export declare class Account extends AbstractAccount { /** * The address associated with the account. */ readonly address: AbstractAddress; /** * The provider used to interact with the network. */ protected _provider?: Provider; /** * Creates a new Account instance. * * @param address - The address of the account. * @param provider - A Provider instance (optional). */ constructor(address: string | AbstractAddress, provider?: Provider); /** * The provider used to interact with the network. * * @returns A Provider instance. * * @throws `FuelError` if the provider is not set. */ get provider(): Provider; /** * Sets the provider for the account. * * @param provider - A Provider instance. */ set provider(provider: Provider); /** * Changes the provider connection for the account. * * @param provider - A Provider instance. * @returns The updated Provider instance. */ connect(provider: Provider): Provider; /** * Retrieves resources satisfying the spend query for the account. * * @param quantities - IDs of coins to exclude. * @param excludedIds - IDs of resources to be excluded from the query. * @returns A promise that resolves to an array of Resources. */ getResourcesToSpend(quantities: CoinQuantityLike[] /** IDs of coins to exclude */, excludedIds?: ExcludeResourcesOption): Promise; /** * Retrieves coins owned by the account. * * @param assetId - The asset ID of the coins to retrieve. * @returns A promise that resolves to an array of Coins. */ getCoins(assetId?: BytesLike): Promise; /** * Retrieves messages owned by the account. * * @returns A promise that resolves to an array of Messages. */ getMessages(): Promise; /** * Retrieves the balance of the account for the given asset. * * @param assetId - The asset ID to check the balance for. * @returns A promise that resolves to the balance amount. */ getBalance(assetId?: BytesLike): Promise; /** * Retrieves all the balances for the account. * * @returns A promise that resolves to an array of Coins and their quantities. */ getBalances(): Promise; /** * Adds resources to the transaction enough to fund it. * * @param request - The transaction request. * @param coinQuantities - The coin quantities required to execute the transaction. * @param fee - The estimated transaction fee. * @returns A promise that resolves when the resources are added to the transaction. */ fund(request: T, coinQuantities: CoinQuantity[], fee: BN): Promise; /** * A helper that creates a transfer transaction request and returns it. * * @param destination - The address of the destination. * @param amount - The amount of coins to transfer. * @param assetId - The asset ID of the coins to transfer. * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity). * @returns A promise that resolves to the prepared transaction request. */ createTransfer( /** Address of the destination */ destination: string | AbstractAddress, /** Amount of coins */ amount: BigNumberish, /** Asset ID of coins */ assetId?: BytesLike, /** Tx Params */ txParams?: TxParamsType): Promise; /** * Transfers coins to a destination address. * * @param destination - The address of the destination. * @param amount - The amount of coins to transfer. * @param assetId - The asset ID of the coins to transfer. * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity). * @returns A promise that resolves to the transaction response. */ transfer( /** Address of the destination */ destination: string | AbstractAddress, /** Amount of coins */ amount: BigNumberish, /** Asset ID of coins */ assetId?: BytesLike, /** Tx Params */ txParams?: TxParamsType): Promise; /** * Transfers coins to a contract address. * * @param contractId - The address of the contract. * @param amount - The amount of coins to transfer. * @param assetId - The asset ID of the coins to transfer. * @param txParams - The optional transaction parameters. * @returns A promise that resolves to the transaction response. */ transferToContract( /** Contract address */ contractId: string | AbstractAddress, /** Amount of coins */ amount: BigNumberish, /** Asset ID of coins */ assetId?: BytesLike, /** Tx Params */ txParams?: TxParamsType): Promise; /** * Withdraws an amount of the base asset to the base chain. * * @param recipient - Address of the recipient on the base chain. * @param amount - Amount of base asset. * @param txParams - The optional transaction parameters. * @returns A promise that resolves to the transaction response. */ withdrawToBaseLayer( /** Address of the recipient on the base chain */ recipient: string | AbstractAddress, /** Amount of base asset */ amount: BigNumberish, /** Tx Params */ txParams?: TxParamsType): Promise; /** * Sends a transaction to the network. * * @param transactionRequestLike - The transaction request to be sent. * @returns A promise that resolves to the transaction response. */ sendTransaction(transactionRequestLike: TransactionRequestLike, options?: Pick): Promise; /** * Simulates a transaction. * * @param transactionRequestLike - The transaction request to be simulated. * @returns A promise that resolves to the call result. */ simulateTransaction(transactionRequestLike: TransactionRequestLike): Promise; } //# sourceMappingURL=account.d.ts.map