Wander Docs
HomeGithub
  • ๐Ÿ‘‹Welcome to Wander
  • โ›๏ธDeveloper tooling
    • Wander Devtools
    • ArLocal Devtools
  • ๐Ÿ“šExternal libraries
    • Arweave Wallet Kit
    • arweave-js
  • ๐Ÿ”ญDemos
    • Applications
  • ๐ŸงชAPI
    • Intro
    • Events
    • Connect
    • Disconnect
    • Get active address
    • Get active public key
    • Get all addresses
    • Get wallet names
    • Sign Transaction
    • Dispatch Transaction
    • Sign DataItem
    • Batch Sign DataItem
    • Sign message
    • Verify message
    • Private hash
    • User Tokens
    • Token Balance
    • Encrypt
    • Decrypt
    • Crypto signature
    • Subscriptions
    • Retrive permissions
    • Retrive Gateway Config
  • ๐ŸŒWander.app
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. API

Get all addresses

Wander Injected API getAllAddresses() function

PreviousGet active public keyNextGet wallet names

Last updated 3 months ago

Was this helpful?

Wander provides enhanced key management for your Arweave wallets. Because of this, the extension might store more than one wallet and your application can take advantage of that. For example, this feature can make it easier for your app to transfer tokens between the user's addresses. The getAllAddresses() function returns an array of addresses added to Wander.

Note: This function requires the permission.

Example usage

// connect to the extension
await window.arweaveWallet.connect(["ACCESS_ADDRESS", "ACCESS_ALL_ADDRESSES"]);

// get all wallet addresses added to ArConnect
const addresses = await window.arweaveWallet.getAllAddresses();

// obtain the user's active wallet address
const activeAddress = await window.arweaveWallet.getActiveAddress();

console.log("Your wallet address is", activeAddress);
console.log("You can transfer your assets to your other addresses:\n", addresses.filter((addr) => addr !== activeAddress).join("\n"));
๐Ÿงช
ACCESS_ALL_ADDRESSES