πŸ—ƒοΈWalletManager API

Public methods and properties of the WalletManager class

circle-info

The framework adapters abstract the WalletManager class and expose a similar API via the useWallet function/hook.

The following API is exposed via the WalletManager class instance:

class WalletManager {
  constructor({
    wallets: Array<T | WalletIdConfig<T>>,
    network?: NetworkId,
    algod?: NetworkConfig
  }: WalletManagerConstructor)
}

Public Methods

subscribe

subscribe(callback: (state: State) => void): (() => void)

Subscribes to state changes.

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

setActiveNetwork

setActiveNetwork(network: NetworkId): void

Sets the active network (BetaNet, TestNet, MainNet, or LocalNet).

  • network: The network to be set as active.

getWallet

Returns a wallet provider client by its WalletId.

  • walletId: The ID of the wallet to be retrieved.

resumeSessions

Re-initializes the connected wallet(s) from persisted storage when the app mounts. Framework adapters handle this automatically.


Public Properties

wallets

An array of all initialized wallet provider clients.

activeNetwork

The currently active network.

algodClient

The Algodv2 client for the active network.

activeWallet

The currently active wallet provider client instance.

activeWalletAccounts

An array of connected accounts for the currently active wallet provider.

activeWalletAddresses

An array of addresses of the currently active wallet provider's accounts.

activeAccount

The currently active account, the default sender used to sign transactions

activeAddress

The address of the currently active account.

signTransactions

A getter that returns the signTransactions method of the currently active wallet provider. It is a function that signs transactions of an atomic transaction group.

Learn more...

transactionSigner

A getter that returns the transactionSigner method of the currently active wallet provider. It is a typed TransactionSigner function that signs transactions of an atomic transaction group.

Learn more...

Last updated