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.
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.
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 thegetAddresses() 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(...)andportal.rawSign(...)called with one of these chain IDs throwPortalException.Blockchain.NoSupportedCurveForChainId, andportal.sendAsset(...)returns a failedResultwithPortalException.Transaction.SendAssetArgumentError. Raw sign selects the key by aneip155(SECP256K1) orsolana(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
getAddressreturnsnullfor it. - The wallet-status methods also accept these chain IDs and namespaces. See Manage wallet lifecycle states.