Skip to content

Commit 264a28e

Browse files
werner-stacksgitbook-bot
authored andcommitted
GITBOOK-57: getAddresses: Bitcoin Staking note and pinned reference link
1 parent 5908f12 commit 264a28e

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

‎docs/reference/stacks.js/stacks-connect/methods/getAddresses.md‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ for (const entry of result.addresses) {
2222

2323
#### Notes
2424

25-
- This method returns addresses for **all supported chains** (BTC and STX). For Stacks-only addresses, use [`stx_getAddresses`](stx_getAddresses.md).
26-
- Results are automatically cached in local storage when `enableLocalStorage` is `true` (the default).
27-
- For Xverse-like wallets, this method is automatically overridden to use `wallet_connect` when provider overrides are enabled.
28-
- The [`connect`](../connection/connect.md) function is a convenience wrapper that calls this method with `forceWalletSelect: true`.
25+
* This method returns addresses for **all supported chains** (BTC and STX). For Stacks-only addresses, use [`stx_getAddresses`](stx_getAddresses.md).
26+
* Results are automatically cached in local storage when `enableLocalStorage` is `true` (the default).
27+
* For Xverse-like wallets, this method is automatically overridden to use `wallet_connect` when provider overrides are enabled.
28+
* The [`connect`](../connection/connect.md) function is a convenience wrapper that calls this method with `forceWalletSelect: true`.
29+
* To derive a Bitcoin Staking lock address from an entry, pass its `publicKey` to [`buildLockAddress`](../../stacks-bitcoin-staking/script/buildlockaddress.md) in `@stacks/bitcoin-staking`, with `stxAddress`, `unlockHeight`, `earlyUnlockBytes` and `network`. The key must be a 33-byte compressed key starting with `02` or `03`. [`buildUnlockScript`](../../stacks-bitcoin-staking/script/buildunlockscript.md) throws on any other key, so check the entry's key length first.
2930

30-
**[Reference Link](https://github.com/stx-labs/connect/blob/main/packages/connect/src/methods.ts#L228)**
31+
[**Reference Link**](https://github.com/stx-labs/connect/blob/v8.2.7/packages/connect/src/methods.ts#L236-L239)
3132

3233
***
3334

@@ -58,17 +59,17 @@ interface AddressEntry {
5859
}
5960
```
6061

61-
| Property | Type | Description |
62-
| --- | --- | --- |
62+
| Property | Type | Description |
63+
| ----------- | ---------------- | -------------------------------------------- |
6364
| `addresses` | `AddressEntry[]` | An array of address entries from the wallet. |
6465

6566
Each `AddressEntry` contains:
6667

67-
| Property | Type | Description |
68-
| --- | --- | --- |
69-
| `symbol` | `string` (optional) | The symbol for the address (e.g. `'STX'`, `'BTC'`). |
70-
| `address` | `string` | The address string. |
71-
| `publicKey` | `string` | The hex-encoded public key for this address. |
68+
| Property | Type | Description |
69+
| ----------- | ------------------- | --------------------------------------------------- |
70+
| `symbol` | `string` (optional) | The symbol for the address (e.g. `'STX'`, `'BTC'`). |
71+
| `address` | `string` | The address string. |
72+
| `publicKey` | `string` | The hex-encoded public key for this address. |
7273

7374
***
7475

0 commit comments

Comments
 (0)