getAddresses
Function Signatureaddresses property:
[PortalNamespace: String?]: The client’s addresses, keyed by namespace:.eip155: The EVM address.solana: The Solana address.stellar: The Stellar address.tron: The Tron address.xrpl: The XRP Ledger classic address
.eip155,.tron, and.xrplare present when the client has a SECP256K1 wallet..solanaand.stellarare present when the client has an ED25519 wallet.- A namespace the client has no address for is left out of the dictionary, so it is not in
keysand reads asnilby subscript. .bip122is never present. Read Bitcoin addresses withgetAddressand a P2WPKH chain ID.
- An error if the addresses can’t be read from the device’s keychain.
getAddress
Function SignatureforChainId: A Portal chain ID, in CAIP-2 format except for the Bitcoin P2WPKH IDs, which add a-p2wpkhsuffix. The namespace part selects the address:
Returns
String?: The address for that chain, ornilwhen:- the client has no address for that namespace,
- the chain ID is a
bip122:ID other than the two P2WPKH IDs above, or - the chain ID is malformed or its namespace isn’t supported.
nil instead, including when the stored addresses can’t be read. Use getAddresses when you need to see errors from reading the stored addresses, such as keychain failures. A malformed or unsupported chain ID only ever produces nil.
Example Usage
PortalNamespace
switch exhaustively over PortalNamespace, add a case for .xrpl.
Notes
- 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
isWalletOnDeviceto check that. - 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 throw an unsupported request method error. Raw sign selects the key by aneip155(SECP256K1) orsolana(ED25519) chain ID. - The deprecated
portal.addressproperty returnsnilwhen the client has no EVM address. .xrpl,xrpl:chain IDs, the Bitcoin P2WPKH chain IDs ingetAddress, and the omission of namespaces without an address are available starting from SDK version 8.1.0.