Skip to content

Commit d1312ad

Browse files
authored
Merge pull request #598 from reown-com/feat/sui-stacks-accounts-cache
feat: add btc, sui and stacks accounts caching to RPC specs
2 parents 598e635 + f9959d5 commit d1312ad

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

advanced/multichain/rpc-reference/bitcoin-rpc.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ If the wallet user changes to account 1 we get path `m/84'/0'/1'/0/0` with ident
3232
- `m/84'/0'/1'/change/address_index`
3333
- `m/86'/0'/1'/change/address_index`
3434

35+
3536
## sendTransfer
3637

3738
This method is used to sign and submit a transfer of any `amount` of Bitcoin to a single `recipientAddress`, optionally including a `changeAddress` for the change amount and `memo` set as an OP_RETURN output by supporting wallets. The transaction will be signed and broadcast upon user approval.
@@ -111,6 +112,10 @@ We recognize that there are two broad classes of wallets in use today:
111112
- `path` : `String` - _(Optional)_ Derivation path of the address e.g. "m/84'/0'/0'/0/0".
112113
- `intention` : `String` - _(Optional)_ Intention of the address, e.g. "payment" or "ordinal".
113114

115+
### Session Properties
116+
In a connection request, it is recommended to serialize the response to `getAccountAddresses` in `session.sessionProperties.bip122_getAccountAddresses`. This allows dapps to consume an active session without requiring a context switch to re-request all addresses and associated public keys from the wallet.
117+
118+
114119
### Example: Dynamic Wallet
115120

116121
The example below specifies a result from a dynamic wallet. For the sake of this example, receive and change addresses with index 3-4 are considered unused and addresses with paths `m/49'/0'/0'/0/7` and `m/84'/0'/0'/0/2` are considered to have UTXOs.

advanced/multichain/rpc-reference/stacks-rpc.mdx

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: "Stacks"
33
description: Stacks JSON-RPC Methods
44
---
55

6-
These are the methods that wallets should implement to handle Stacks transfers and messages via WalletConnect.
76

7+
These are the methods that wallets should implement to handle Stacks transfers and messages via WalletConnect.
88

99
## stx_transferStx
1010

@@ -88,4 +88,43 @@ For signing a message with wallet users private key.
8888
}
8989
```
9090

91-
- `signature` - The signature of the message
91+
- `signature` - The signature of the message
92+
93+
94+
95+
96+
## stx_getAddresses
97+
98+
For requesting the wallet addresses
99+
100+
### Request
101+
102+
```json
103+
{
104+
"id": 1,
105+
"jsonrpc": "2.0",
106+
"method": "stx_getAddresses",
107+
}
108+
```
109+
110+
### Response
111+
```json
112+
{
113+
"jsonrpc": "2.0",
114+
"id": 1,
115+
"result": {
116+
"accounts": [
117+
{
118+
"address": "SP23....",
119+
"publicKey": "ab12031..."
120+
}
121+
]
122+
}
123+
}
124+
```
125+
126+
- `accounts`: The connected accounts with their address and publicKey
127+
128+
129+
### Session Properties
130+
In a connection request, it is recommended to serialize the response to `getAddresses` in `session.sessionProperties.stacks_getAddresses`. This allows dapps to consume an active session without requiring a context switch to re-request all addresses and associated public keys from the wallet.

advanced/multichain/rpc-reference/sui-rpc.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ This method returns an Array of public keys and addresses available to sign from
4444
}
4545
```
4646

47-
### sui_signTransaction
47+
### Session Properties
48+
In a connection request, it is recommended to serialize the response to `getAccounts` in `session.sessionProperties.sui_getAccounts`. This allows dapps to consume an active session without requiring a context switch to re-request all addresses and associated public keys from the wallet.
49+
50+
51+
52+
## sui_signTransaction
4853

4954
Sign a Sui transaction without executing it.
5055

0 commit comments

Comments
 (0)