Skip to content

Commit 1476af7

Browse files
authored
Merge branch 'main' into devin/1760607358-add-ton-rpc-docs
2 parents ccc55c8 + 8c2ff8e commit 1476af7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1808
-517
lines changed

.cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"nosocial", "bitget", "leather", "binance", "uniswap", "safepal", "bybit", "phantom", "ledger", "timeless-x", "safe", "zerion", "oneinch", "crypto-com", "imtoken", "kraken", "ronin", "robinhood", "exodus", "argent", "tokenpocket", "Contractaddress",
4040
"executionreverted", "FATF", "VASP", "LLMSTXT", "Frontmatter", "CASP", "DKMS", "hydradx", "phala", "astar", "mangata", "polkadotjs", "Dogecoin", "Blockbook", "vuejs", "xsmall", "rgba", "mintlify", "filteredwallets",
4141
"tnum","minmax","toolkits", "autoplay", "Litoshi", "Litoshis", "encryptor's", "Everscale", "Bitcore", "satoshis", "Parachain", "Bitcore", "walletlist", "Userflow", "retryable", "USDS", "Arbitrum", "Wolfswap", "Halborn", "Pentest", "Spearbit", "valtio",
42-
"reshare", "microstacks", "Prebuild", "APKT", "offchain", "Bitgpt", "Restaking", "Synthetix", "lamports", "mmkv", "Windscribe", "nanotons", "nanoton"
42+
"reshare", "microstacks", "Prebuild", "APKT", "offchain", "tabnabbing", "Bitgpt", "Restaking", "Synthetix", "lamports", "mmkv", "Windscribe", "Dappkit", "nanotons", "nanoton"
4343
]
4444
}
4545

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ Assuming the dapp monitors all returned addresses for balance changes, a new req
181181

182182
The example below specifies a response from a static wallet. The returned address is used for both change and payments. It's the only address with UTXOs.
183183

184+
<Note>
185+
Hardware wallets utilizing `bip32` are also supported.
186+
</Note>
187+
184188
```javascript
185189
// Request
186190
{

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ description: Sui JSON-RPC Methods
55

66
These are the methods that wallets should implement to handle Sui transactions and messages via WalletConnect.
77

8-
<Note type="warning">
9-
**Please note:** The SUI RPC standard is still under review and specifications may change. Implementation details and method signatures are subject to updates.
10-
</Note>
11-
128
## sui_getAccounts
139

1410
This method returns an Array of public keys and addresses available to sign from the wallet.
@@ -47,7 +43,9 @@ This method returns an Array of public keys and addresses available to sign from
4743
### Session Properties
4844
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.
4945

50-
46+
:::warning
47+
This method is **required** for all wallets to implement in order to connect to applications using Sui Dappkit. Wallets that do not implement `sui_getAccounts` will not be able to establish connections with dapps using the Sui Dappkit SDK.
48+
:::
5149

5250
## sui_signTransaction
5351

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

Lines changed: 155 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,81 @@ description: Tron JSON-RPC Methods
55

66
These are the methods that wallets should implement to handle Tron transactions and messages via WalletConnect.
77

8-
<Note type="warning">
9-
**Please note:** The TRON RPC standard is still under review and specifications may change. Implementation details and method signatures are subject to updates.
10-
</Note>
8+
## Session Properties
9+
10+
To enable the new simplified transaction structure, wallets should include `tron_method_version: "v1"` in their `sessionProperties` during the connection handshake:
11+
12+
```json
13+
{
14+
"sessionProperties": {
15+
"tron_method_version": "v1"
16+
}
17+
}
18+
```
19+
20+
When `tron_method_version` is set to `"v1"`, the transaction structure is simplified to remove the nested `transaction.transaction` format. If not set, the legacy nested format is used for backward compatibility.
1121

1222
### tron_signTransaction
1323

1424
Sign a Tron transaction without executing it.
1525

1626
#### Parameters
1727

18-
1. `transaction` (object) - The transaction to sign:
28+
- The transaction to sign:
1929
- `address` (string) - The sender's Tron address
2030
- `transaction` (object) - The transaction object to sign
2131

2232
#### Returns
2333

24-
`object` - The signed transaction:
25-
- `txID` (string) - The transaction ID (deterministically derived from raw transaction)
26-
- `signature` (array) - Array of signature strings
27-
- `raw_data` (object) - The raw transaction data
28-
- `raw_data_hex` (string) - The hex-encoded raw transaction data
29-
- `visible` (boolean) - Whether addresses are in visible format
34+
- The signed transaction:
35+
- `txID` (string) - The transaction ID (deterministically derived from raw transaction)
36+
- `signature` (array) - Array of signature strings
37+
- `raw_data` (object) - The raw transaction data
38+
- `raw_data_hex` (string) - The hex-encoded raw transaction data
39+
- `visible` (boolean) - Whether addresses are in visible format
3040

31-
#### Example
41+
<AccordionGroup>
42+
<Accordion title="Legacy Format">
43+
#### Example (Legacy Format)
3244

45+
- Request with the nested `transaction.transaction` format
3346
```javascript
34-
// Request
3547
{
3648
"jsonrpc": "2.0",
3749
"id": 1,
3850
"method": "tron_signTransaction",
3951
"params": {
4052
"address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
4153
"transaction": {
42-
"raw_data": {
43-
"contract": [
44-
{
45-
"parameter": {
46-
"value": {
47-
"data": "095ea7b30000000000000000000000001cb0b7348eded93b8d0816bbeb819fc1d7a51f310000000000000000000000000000000000000000000000000000000000000000",
48-
"owner_address": "411cb0b7348eded93b8d0816bbeb819fc1d7a51f31",
49-
"contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c"
54+
"transaction": {
55+
"raw_data": {
56+
"contract": [
57+
{
58+
"parameter": {
59+
"value": {
60+
"data": "095ea7b30000000000000000000000001cb0b7348eded93b8d0816bbeb819fc1d7a51f310000000000000000000000000000000000000000000000000000000000000000",
61+
"owner_address": "411cb0b7348eded93b8d0816bbeb819fc1d7a51f31",
62+
"contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c"
63+
},
64+
"type_url": "type.googleapis.com/protocol.TriggerSmartContract"
5065
},
51-
"type_url": "type.googleapis.com/protocol.TriggerSmartContract"
52-
},
53-
"type": "TriggerSmartContract"
54-
}
55-
],
56-
"ref_block_bytes": "885b",
57-
"ref_block_hash": "baa1c278fd0a309f",
58-
"expiration": 1745849082000,
59-
"fee_limit": 200000000,
60-
"timestamp": 1745849022978
66+
"type": "TriggerSmartContract"
67+
}
68+
],
69+
"ref_block_bytes": "885b",
70+
"ref_block_hash": "baa1c278fd0a309f",
71+
"expiration": 1745849082000,
72+
"fee_limit": 200000000,
73+
"timestamp": 1745849022978
74+
}
6175
}
6276
}
6377
}
6478
}
79+
```
6580

66-
// Response
81+
- Response:
82+
```javascript
6783
{
6884
"jsonrpc": "2.0",
6985
"result": {
@@ -97,68 +113,146 @@ Sign a Tron transaction without executing it.
97113
"id": 1
98114
}
99115
```
116+
</Accordion>
117+
</AccordionGroup>
118+
119+
#### Example (New Format with tron_method_version: "v1")
120+
121+
Request with the simplified format:
122+
```javascript
123+
{
124+
"request": {
125+
"method": "tron_signTransaction",
126+
"params": {
127+
"address": "TKZRPqoV7WLFvjhT4cEyBLv27Rvv1RNWGj",
128+
"transaction": {
129+
"visible": false,
130+
"txID": "539f218871fdd87e94eb03a0dd617107ba722005f37a5ddb82cb65aa4f3b73b0",
131+
"raw_data": {
132+
"contract": [
133+
{
134+
"parameter": {
135+
"value": {
136+
"data": "095ea7b300000000000000000000000069319ea845b1c35a1f7b0e1429f4f303e8f791330000000000000000000000000000000000000000000000000000000000000000",
137+
"owner_address": "4169319ea845b1c35a1f7b0e1429f4f303e8f79133",
138+
"contract_address": "41eca9bc828a3005b9a3b909f2cc5c2a54794de05f"
139+
},
140+
"type_url": "type.googleapis.com/protocol.TriggerSmartContract"
141+
},
142+
"type": "TriggerSmartContract"
143+
}
144+
],
145+
"ref_block_bytes": "7803",
146+
"ref_block_hash": "16138f9255a1db91",
147+
"expiration": 1756201572000,
148+
"fee_limit": 200000000,
149+
"timestamp": 1756201512720
150+
},
151+
"raw_data_hex": "0a027803220816138f9255a1db9140a0ad95ae8e335aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a154169319ea845b1c35a1f7b0e1429f4f303e8f79133121541eca9bc828a3005b9a3b909f2cc5c2a54794de05f2244095ea7b300000000000000000000000069319ea845b1c35a1f7b0e1429f4f303e8f79133000000000000000000000000000000000000000000000000000000000000000007090de91ae8e3390018084af5f"
152+
}
153+
},
154+
"expiryTimestamp": 1756201811
155+
},
156+
"chainId": "tron:0xcd8690dc"
157+
}
158+
```
159+
160+
- Response:
161+
```javascript
162+
{
163+
"visible": false,
164+
"txID": "539f218871fdd87e94eb03a0dd617107ba722005f37a5ddb82cb65aa4f3b73b0",
165+
"raw_data": {
166+
"contract": [
167+
{
168+
"parameter": {
169+
"value": {
170+
"data": "095ea7b300000000000000000000000069319ea845b1c35a1f7b0e1429f4f303e8f791330000000000000000000000000000000000000000000000000000000000000000",
171+
"owner_address": "4169319ea845b1c35a1f7b0e1429f4f303e8f79133",
172+
"contract_address": "41eca9bc828a3005b9a3b909f2cc5c2a54794de05f"
173+
},
174+
"type_url": "type.googleapis.com/protocol.TriggerSmartContract"
175+
},
176+
"type": "TriggerSmartContract"
177+
}
178+
],
179+
"ref_block_bytes": "7803",
180+
"ref_block_hash": "16138f9255a1db91",
181+
"expiration": 1756201572000,
182+
"fee_limit": 200000000,
183+
"timestamp": 1756201512720
184+
},
185+
"raw_data_hex": "0a027803220816138f9255a1db9140a0ad95ae8e335aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a154169319ea845b1c35a1f7b0e1429f4f303e8f79133121541eca9bc828a3005b9a3b909f2cc5c2a54794de05f2244095ea7b300000000000000000000000069319ea845b1c35a1f7b0e1429f4f303e8f79133000000000000000000000000000000000000000000000000000000000000000007090de91ae8e3390018084af5f",
186+
"signature": [
187+
"1c2dd921c15fd83ca1dec4fd999b801f08c8bb073702f4bfafa4132a6e129421ed6267ec81c7dd2e4ef04ce077b101186ec2cda86d69f9f44255c216398cc9c601"
188+
]
189+
}
190+
```
100191

101192
### tron_signMessage
102193

103194
Sign a personal message.
104195

105196
#### Parameters
106197

107-
1. `message` (object) - The message to sign:
198+
The message to sign:
108199
- `message` (string) - The message to sign (plain text)
109200
- `address` (string) - The account address to sign with
110201

111202
#### Returns
112203

113-
`object` - The signed message:
204+
The signed message:
114205
- `signature` (string) - The signature string
115206

116207
#### Example
117208

209+
- Request:
118210
```javascript
119-
// Request
120-
{
121-
"jsonrpc": "2.0",
122-
"id": 1,
123-
"method": "tron_signMessage",
124-
"params": {
125-
"message": "This is a message to be signed for TRON",
126-
"address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH"
127-
}
128-
}
129-
130-
// Response
131211
{
132-
"jsonrpc": "2.0",
133-
"result": {
134-
"signature": "7e760cef94bc82a7533bc1e8d4ab88508c6e13224cd50cc8da62d3f4d4e19b99514f..."
212+
"request": {
213+
"method": "tron_signMessage",
214+
"params": {
215+
"address": "TXUEmLr...",
216+
"message": "This is a message to be signed for Tron"
217+
},
218+
"expiryTimestamp": 1758269816
135219
},
136-
"id": 1
220+
"chainId": "tron:0xcd8690dc"
137221
}
138222
```
139223

140-
### tron_sendTransaction
224+
- dApp result (what client.request(...) resolves to):
225+
```javascript
226+
{ "signature": "0x1ec623ee6e4716f5a116d0a2755b158ac05dfbc3e9118cca..." }
227+
```
228+
<Note>
229+
The methods below are not part of the required wallet surface in the Reown official Tron Wallet example.
230+
dApps may perform these directly against a Tron node or gateway. Wallets may implement them for convenience, but they’re not required.
231+
</Note>
232+
233+
### tron_sendTransaction (optional)
141234

142235
Broadcast a signed transaction to the Tron network.
143236

144237
#### Parameters
145238

146-
1. `signedTransaction` (object) - The signed transaction object:
239+
The signed transaction object:
147240
- `txID` (string) - The transaction ID
148241
- `signature` (array) - Array of signature strings
149242
- `raw_data` (object) - The raw transaction data
150243
- `raw_data_hex` (string) - The hex-encoded raw transaction data
151244

152245
#### Returns
153246

154-
`object` - The transaction result:
247+
The transaction result:
155248
- `result` (boolean) - Whether the transaction was successfully broadcast
156249
- `txid` (string) - The transaction ID that can be used to look up the transaction
157250

158251
#### Example
159252

253+
- Request:
160254
```javascript
161-
// Request
255+
162256
{
163257
"jsonrpc": "2.0",
164258
"id": 1,
@@ -173,8 +267,10 @@ Broadcast a signed transaction to the Tron network.
173267
}
174268
}
175269
}
270+
```
176271

177-
// Response
272+
- Response:
273+
```javascript
178274
{
179275
"jsonrpc": "2.0",
180276
"result": {
@@ -185,7 +281,7 @@ Broadcast a signed transaction to the Tron network.
185281
}
186282
```
187283

188-
### tron_getBalance
284+
### tron_getBalance (optional)
189285

190286
Get the TRX balance of a Tron address.
191287

@@ -200,7 +296,7 @@ Get the TRX balance of a Tron address.
200296
#### Example
201297

202298
```javascript
203-
// Request
299+
- Request:
204300
{
205301
"jsonrpc": "2.0",
206302
"id": 1,
@@ -209,8 +305,10 @@ Get the TRX balance of a Tron address.
209305
"address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH"
210306
}
211307
}
308+
```
212309

213-
// Response
310+
- Response:
311+
```javascript
214312
{
215313
"jsonrpc": "2.0",
216314
"result": 1000000000,

advanced/security/content-security-policy.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ default-src 'self';
1717
script-src 'self';
1818
style-src https://fonts.googleapis.com;
1919
img-src * 'self' data: blob: https://walletconnect.org https://walletconnect.com https://secure.walletconnect.com https://secure.walletconnect.org https://tokens-data.1inch.io https://tokens.1inch.io https://ipfs.io https://cdn.zerion.io;
20-
font-src 'self' https://fonts.gstatic.com;
20+
font-src 'self' https://fonts.gstatic.com https://fonts.reown.com;
2121
connect-src 'self' https://rpc.walletconnect.com https://rpc.walletconnect.org https://relay.walletconnect.com https://relay.walletconnect.org wss://relay.walletconnect.com wss://relay.walletconnect.org https://pulse.walletconnect.com https://pulse.walletconnect.org https://api.web3modal.com https://api.web3modal.org https://keys.walletconnect.com https://keys.walletconnect.org https://notify.walletconnect.com https://notify.walletconnect.org https://echo.walletconnect.com https://echo.walletconnect.org https://push.walletconnect.com https://push.walletconnect.org wss://www.walletlink.org https://cca-lite.coinbase.com;
2222
frame-src 'self' https://verify.walletconnect.com https://verify.walletconnect.org https://secure.walletconnect.com https://secure.walletconnect.org;
23+
Cross-Origin-Opener-Policy: same-origin-allow-popups;
2324
```
2425

2526
<Note>
@@ -30,6 +31,12 @@ For a full of list of RPC sources used by `wagmi/viem`, please refer to [Viem's
3031

3132
</Note>
3233

34+
<Note>
35+
36+
**Cross-Origin-Opener-Policy for Social Login Security**: The `Cross-Origin-Opener-Policy: same-origin-allow-popups` header is essential when using AppKit's social login features (Google, X, GitHub, Discord, Apple, Facebook, Farcaster). This header helps prevent tabnabbing attacks during OAuth flows by controlling how popup windows can interact with your application. Without this header, malicious sites could potentially hijack the authentication flow and redirect users to phishing pages.
37+
38+
</Note>
39+
3340
## Testing and Deploying Your CSP
3441

3542
### Test Your CSP in a Staging Environment

0 commit comments

Comments
 (0)