Wander Docs
HomeGithub
  • ๐Ÿ‘‹Welcome to Wander
  • โšกWander Connect
    • Intro - Wander Connect
    • Options
    • Properties
    • Methods
    • Event Callbacks
    • Custom UI
    • Advanced Customization
  • ๐Ÿ”ญExamples
    • Playground
    • Applications
  • โ”How To
    • Subsidizing Payments
  • ๐ŸงชAPI
    • Intro - Wander Injected API
    • 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
  • โ›๏ธDeveloper tooling
    • Wander Devtools
    • ArLocal Devtools
  • ๐Ÿ“šExternal libraries
    • Arweave Wallet Kit
    • arweave-js
  • ๐ŸŒWander.app
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. API

Get wallet names

Wander Injected API getWalletNames() function

PreviousGet all addressesNextSign Transaction

Last updated 4 months ago

Was this helpful?

In Wander, each wallet has a nickname. This is either the user's name, or a user-given nickname. To provide better UX, you can retrive these names and display them for the user, so they can easily recognize which wallet they're using. The getWalletNames() function returns an object, where the object keys are the wallet addresses and the values are the nicknames.

Note: This function requires the permission.

Example usage

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

// get all wallet names from Wander
const walletNames = await window.arweaveWallet.getWalletNames();

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

console.log("Your active wallet's nickname is", walletNames[activeAddress]);
๐Ÿงช
ArNS
ACCESS_ALL_ADDRESSES