Help Center
getAddresses API method
May 14, 2025
Leather does not store or validate how these addresses are used externally. Developers must handle user data securely and with privacy considerations.
Request the Bitcoin addresses (Native SegWit and Taproot) and Stacks addresses for the active account of the user's wallet.
Method name
getAddresses
Parameters
None
Accounts
The number of the account connected by the user can be inferred using the derivationPath returned in the response. Note:
- Derivation paths are zero-indexed internally.
- For example, a derivation path of
m/84'/0'/1'/0/0corresponds to Account 2 in the UI. Thisaccountvalue can be used in subsequent method calls (e.g.sendTransfer,signMessage, etc.). If not specified, the currently active account is used by default.
Examples
Example request
[Unsupported block type: code]
Example response
[Unsupported block type: code]
⚠️ **Do not read addresses by index: **Developers must not rely on elements being at a fixed index. Ledger users may not have all keys, and more may be added in future. Accessing by index is not safe (e.g.
result.addresses[2]). Create a helper function usingArray.findinstead.
Use case
You can use the returned address to query third-party APIs like mempool.space:
[Unsupported block type: code]
Sandbox
Try the getAddresses method live in this CodeSandbox testing environment: 👉 Open Sandbox