Skip to content

Commit f9959d5

Browse files
committed
chore: move serialization to method spec
1 parent ed50c27 commit f9959d5

File tree

3 files changed

+51
-27
lines changed

3 files changed

+51
-27
lines changed

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

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

3535

36-
## Connection
37-
### Session Properties
38-
39-
In a connection request, all wallets **should** serialize the connected accounts 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 and paths from the wallet.
40-
41-
## RPC Methods
42-
4336
## sendTransfer
4437

4538
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.
@@ -119,6 +112,10 @@ We recognize that there are two broad classes of wallets in use today:
119112
- `path` : `String` - _(Optional)_ Derivation path of the address e.g. "m/84'/0'/0'/0/0".
120113
- `intention` : `String` - _(Optional)_ Intention of the address, e.g. "payment" or "ordinal".
121114

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+
122119
### Example: Dynamic Wallet
123120

124121
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: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ description: Stacks JSON-RPC Methods
44
---
55

66

7-
## Conection
8-
9-
### Session Properties
10-
11-
In a connection request, all wallets **should** serialize the connected accounts 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.
12-
13-
## RPC Methods
14-
157
These are the methods that wallets should implement to handle Stacks transfers and messages via WalletConnect.
168

179
## stx_transferStx
@@ -96,4 +88,43 @@ For signing a message with wallet users private key.
9688
}
9789
```
9890

99-
- `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: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,12 @@ title: "Sui"
33
description: Sui JSON-RPC Methods
44
---
55

6+
These are the methods that wallets should implement to handle Sui transactions and messages via WalletConnect.
67

78
<Note type="warning">
89
**Please note:** The SUI RPC standard is still under review and specifications may change. Implementation details and method signatures are subject to updates.
910
</Note>
1011

11-
## Conection
12-
13-
### Session Properties
14-
15-
In a connection request, all wallets **should** serialize the connected accounts 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.
16-
17-
## RPC Methods
18-
19-
These are the methods that wallets should implement to handle Sui transactions and messages via WalletConnect.
20-
2112
## sui_getAccounts
2213

2314
This method returns an Array of public keys and addresses available to sign from the wallet.
@@ -53,7 +44,12 @@ This method returns an Array of public keys and addresses available to sign from
5344
}
5445
```
5546

56-
### 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
5753

5854
Sign a Sui transaction without executing it.
5955

0 commit comments

Comments
 (0)