Skip to main content
After a client has a wallet, you can read its address for each supported chain. Addresses come from the client’s wallet metadata in the Portal API, not from the signing shares on the device. An address tells you the client has a wallet, not that it can sign on this device. Use isWalletOnDeviceOrThrow to check that.
getAddresses() and the XRP Ledger, Stellar, and Tron addresses are available starting from SDK version 10.1.0.

Get every address

getAddresses() returns the client’s addresses keyed by PortalNamespace.
Which entries are present depends on the client’s wallets: A namespace the client has no address for is left out of the map, so don’t assume any entry is present, including EIP155. PortalNamespace.BIP122 is never present; see Get the Bitcoin address. getAddresses() throws an IllegalStateException if the client isn’t set.

Get one address

getAddress returns the address for a single chain ID or PortalNamespace, or null when the client has no address for that namespace.
The namespace part of a CAIP-2 chain ID selects the address: getAddress returns null for a bip122: chain ID. It throws an IllegalArgumentException for a malformed chain ID or an unsupported namespace, and an IllegalStateException if the client isn’t set.

Get the Bitcoin address

Bitcoin has a separate address per network, so it isn’t in the getAddresses() map. Read the P2WPKH addresses from the client details:

PortalNamespace

STELLAR, TRON, and XRPL are new in 10.1.0. If you use an exhaustive when over PortalNamespace, add branches for them.

Notes

  • The XRP Ledger, Stellar, and Tron addresses are derived from the client’s existing wallets. No new wallet is created.
  • Signing with an XRP Ledger, Stellar, or Tron chain ID isn’t supported yet. portal.request(...) and portal.rawSign(...) called with one of these chain IDs throw PortalException.Blockchain.NoSupportedCurveForChainId, and portal.sendAsset(...) returns a failed Result with PortalException.Transaction.SendAssetArgumentError. Raw sign selects the key by an eip155 (SECP256K1) or solana (ED25519) chain ID.
  • Starting from SDK version 10.1.0, a namespace without an address is left out of the address map instead of being mapped to an empty string, so getAddress returns null for it.
  • The wallet-status methods also accept these chain IDs and namespaces. See Manage wallet lifecycle states.