WalletLocked provides the functionalities for a locked wallet.

Hierarchy (view full)

Constructors

  • Creates a new Account instance.

    Parameters

    • address: string | Address

      The address of the account.

    • Optionalprovider: Provider

      A Provider instance (optional).

    • Optionalconnector: FuelConnector

      A FuelConnector instance (optional).

    Returns WalletLocked

Properties

_connector?: FuelConnector

The connector for use with external wallets

_provider?: Provider

The provider used to interact with the network.

address: Address

The address associated with the account.

Accessors

  • get provider(): Provider
  • The provider used to interact with the network.

    Returns Provider

    A Provider instance.

    FuelError if the provider is not set.

  • set provider(provider): void
  • Sets the provider for the account.

    Parameters

    Returns void

Methods

  • Transfers multiple amounts of a token to multiple recipients.

    Parameters

    • transferParams: TransferParams[]

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

    • txParams: TxParamsType = {}

      Optional transaction parameters.

    Returns Promise<TransactionResponse>

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

  • Changes the provider connection for the account.

    Parameters

    Returns Provider

    The updated Provider instance.

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

    Parameters

    • destination: string | Address

      The address of the destination.

    • amount: BigNumberish

      The amount of coins to transfer.

    • OptionalassetId: BytesLike

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

    • txParams: TxParamsType = {}

      The transaction parameters (optional).

    Returns Promise<ScriptTransactionRequest>

    A promise that resolves to the prepared transaction request.

  • Funds a transaction request by adding the necessary resources.

    Type Parameters

    Parameters

    • request: T

      The transaction request to fund.

    • params: EstimatedTxParams

      The estimated transaction parameters.

    Returns Promise<T>

    A promise that resolves to the funded transaction request.

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

    Parameters

    • coins: FakeResources[]

      An array of FakeResources objects representing the coins.

    Returns Resource[]

    An array of Resource objects with generated properties.

  • Retrieves the balance of the account for the given asset.

    Parameters

    • OptionalassetId: BytesLike

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

    Returns Promise<BN>

    A promise that resolves to the balance amount.

  • Retrieves coins owned by the account.

    Parameters

    • OptionalassetId: BytesLike

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

    • OptionalpaginationArgs: CursorPaginationArgs

    Returns Promise<GetCoinsResponse>

    A promise that resolves to an array of Coins.

  • Retrieves messages owned by the account.

    Parameters

    • OptionalpaginationArgs: CursorPaginationArgs

    Returns Promise<GetMessagesResponse>

    A promise that resolves to an array of Messages.

  • Retrieves resources satisfying the spend query for the account.

    Parameters

    • quantities: CoinQuantityLike[]

      Quantities of resources to be obtained.

    • OptionalexcludedIds: ExcludeResourcesOption

      IDs of resources to be excluded from the query (optional).

    Returns Promise<Resource[]>

    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.

    Parameters

    Returns Promise<TransactionCost>

    A promise that resolves to the transaction cost object.

  • Signs a transaction from the account via the connector..

    Parameters

    Returns Promise<string>

    A promise that resolves to the signature of the transaction.

  • Transfers coins to a destination address.

    Parameters

    • destination: string | Address

      The address of the destination.

    • amount: BigNumberish

      The amount of coins to transfer.

    • OptionalassetId: BytesLike

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

    • txParams: TxParamsType = {}

      The transaction parameters (optional).

    Returns Promise<TransactionResponse>

    A promise that resolves to the transaction response.

  • Transfers coins to a contract address.

    Parameters

    • contractId: string | Address

      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).

    Returns Promise<TransactionResponse>

    A promise that resolves to the transaction response.

  • Unlocks the wallet using the provided private key and returns an instance of WalletUnlocked.

    Parameters

    • privateKey: BytesLike

      The private key used to unlock the wallet.

    Returns WalletUnlocked

    An instance of WalletUnlocked.

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

    Parameters

    • recipient: string | Address

      Address of the recipient on the base chain.

    • amount: BigNumberish

      Amount of base asset.

    • txParams: TxParamsType = {}

      The transaction parameters (optional).

    Returns Promise<TransactionResponse>

    A promise that resolves to the transaction response.