For the complete documentation index, see llms.txt. This page is also available as Markdown.

πŸ“‚BaseWallet API

Public methods and properties of the BaseWallet abstract class

The BaseWallet class is an abstract class that defines the interface for wallet implementations. Wallet providers all extend this class and implement its required methods.

abstract class BaseWallet {
  constructor({
    id,
    metadata,
    store,
    subscribe,
    getAlgodClient
  }: WalletConstructor<WalletId>)
}

Public Methods

connect

connect(): Promise<WalletAccount[]>

Connects the wallet to the dApp.

disconnect

disconnect(): Promise<void>

Disconnects the wallet from the dApp.

resumeSession

Re-initializes the connected wallet from persisted storage when the application mounts.

setActive

Sets the wallet as the active wallet.

setActiveAccount

Sets the active account.

  • account: The account address to be set as active.

signTransactions

Signs transactions of an atomic transaction group with this wallet provider. Transactions can be signed by any connected account in the wallet.

  • txnGroup: An atomic transaction group of either algosdk.Transaction objects or their serialized bytes, or an array of atomic transaction groups.

  • indexesToSign: An optional array of indexes in the atomic transaction group that should be signed.

transactionSigner

A typed TransactionSigner function that signs transactions of an atomic transaction group with this wallet provider. It can be used with AtomicTransactionComposer - see https://developer.algorand.org/docs/get-details/atc/

  • txnGroup: An atomic transaction group of algosdk.Transaction objects.

  • indexesToSign: An array of indexes in the atomic transaction group that should be signed.

subscribe

Subscribes to state changes.

  • callback: The function to be executed when state changes.


Public Properties

id

The wallet's ID.

metadata

The wallet's metadata. An object containing the wallet's display name and icon expressed as a base64 data URI.

name

The wallet's name (in uppercase).

accounts

The wallet's connected accounts.

addresses

The wallet's connected account addresses.

activeAccount

The currently active account.

activeAddress

The currently active account's address.

activeNetwork

The currently active network.

isConnected

Whether the wallet provider is connected.

isActive

Whether the wallet provider is active.

Last updated