Skip to content

Commit 8ef54b8

Browse files
committed
AppKit EIP-5792 docs
1 parent 5a1a942 commit 8ef54b8

File tree

8 files changed

+202
-1
lines changed

8 files changed

+202
-1
lines changed

.cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"tictactoe", "dollar", "supabase", "Frontmatter", "LLMSTXT", "tokenpocket", "imtoken", "kraken", "ronin", "exodus", "argent", "zerion", "oneinch", "crypto-com", "imtoken", "kraken", "ronin", "robinhood", "exodus", "argent", "tokenpocket",
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",
41-
"tnum","minmax","toolkits", "autoplay", "Litoshi", "Litoshis", "encryptor's", "Everscale", "Bitcore", "satoshis", "Parachain", "Bitcore", "walletlist", "Userflow", "retryable", "USDS", "Arbitrum"
41+
"tnum","minmax","toolkits", "autoplay", "Litoshi", "Litoshis", "encryptor's", "Everscale", "Bitcore", "satoshis", "Parachain", "Bitcore", "walletlist", "Userflow", "retryable", "USDS", "Arbitrum", "Wolfswap"
4242
]
4343
}
4444

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: Embedded Wallets Interactions (EIP-5792)
3+
---
4+
5+
AppKit integrates with EIP-5792 to interact with embedded Wallets (smart accounts) through wallet capabilities. It focuses on three primary methods: `wallet_getCapabilities`, `wallet_sendCalls`, and `wallet_getCallsStatus`. It shows how to check if atomic batch transactions are supported and how to use them.
6+
7+
## wallet_getCapabilities
8+
9+
Appkit checks the `atomic` capability from `wallet_getCapabilities` of the wallet in order to know if a wallet required to handle the batch of calls atomically or not.
10+
Wallets should include the [EIP-5792 capabilities in CAIP-25](/walletkit/android/eip5792#wallet-response).
11+
12+
## wallet_sendCalls
13+
14+
Depending on the 3 different values from the `atomic` capability, AppKit will trigger the `wallet_sendCalls`:
15+
16+
- `supported` means that the wallet supports atomic batch transactions for the account and chain ID. The wallet executes calls atomically and contiguously
17+
- `ready` means that the wallet can upgrade to support atomic execution, pending user approval.
18+
- `unsupported` means that the wallet does not provide any atomicity or contiguity guarantees, and it will not suggest an upgrade to the user. The dApp should fallback to **`eth_sendTransaction`** instead of **`wallet_sendCalls`**, and **`eth_getTransactionReceipt`** instead of **`wallet_getCallsStatus`**
19+
20+
Request Example
21+
```json
22+
{
23+
"from": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
24+
"chainId": "0x01",
25+
"atomicRequired": true,
26+
"calls": [
27+
{
28+
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
29+
"value": "0x9184e72a",
30+
"data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
31+
},
32+
{
33+
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
34+
"value": "0x182183",
35+
"data": "0xfbadbaf01"
36+
}
37+
]
38+
}
39+
```
40+
41+
- `atomicRequired` -  can be set to either `true` or `false`.
42+
- If the `atomic` capability is not supported set to `false`
43+
- If the `atomic` capability is supported set to `true`
44+
45+
## wallet_getCallsStatus
46+
47+
Call this function to get the information about the batch execution.
48+
49+
- The `batchId` field, returned from the `wallet_sendCalls` will be used to identify the batch call.
50+
51+
- The `atomic` field specifies how the wallet handled the batch of calls, which affects the structure of the `receipts` field.
52+
53+
### Response Example
54+
55+
```json
56+
{
57+
"chainId": "0x01",
58+
"id": "0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
59+
"status": 200,
60+
"atomic": true,
61+
"receipts": [
62+
{
63+
"logs": [
64+
{
65+
"address": "0xa922b54716264130634d6ff183747a8ead91a40b",
66+
"topics": [
67+
"0x5a2a90727cc9d000dd060b1132a5c977c9702bb3a52afe360c9c22f0e9451a68"
68+
],
69+
"data": "0xabcd"
70+
}
71+
],
72+
"status": "0x1",
73+
"blockHash": "0xf19bbafd9fd0124ec110b848e8de4ab4f62bf60c189524e54213285e7f540d4a",
74+
"blockNumber": "0xabcd",
75+
"gasUsed": "0xdef",
76+
"transactionHash": "0x9b7bb827c2e5e3c1a0a44dc53e573aa0b3af3bd1f9f5ed03071b100bb039eaff"
77+
}
78+
]
79+
}
80+
```
81+
82+
- if `atomic` is true, the batch was executed atomically by a wallet
83+
84+
- if `atomic` is false, the batch was executed **non-atomically** by a wallet
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Embedded Wallets Interactions (EIP-5792)
3+
---
4+
5+
import SmartAccount from "/snippets/appkit/shared/smart-accounts-interaction.mdx";
6+
7+
<SmartAccount />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Embedded Wallets Interactions (EIP-5792)
3+
---
4+
5+
import SmartAccount from "/snippets/appkit/shared/smart-accounts-interaction.mdx";
6+
7+
<SmartAccount />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Embedded Wallets Interactions (EIP-5792)
3+
---
4+
5+
import SmartAccount from "/snippets/appkit/shared/smart-accounts-interaction.mdx";
6+
7+
<SmartAccount />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Embedded Wallets Interactions (EIP-5792)
3+
---
4+
5+
import SmartAccount from "/snippets/appkit/shared/smart-accounts-interaction.mdx";
6+
7+
<SmartAccount />

docs.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@
214214
"appkit/features/onramp",
215215
"appkit/features/multichain",
216216
"appkit/features/smart-accounts",
217+
"appkit/features/smart-accounts-interaction",
217218
"appkit/features/notifications",
218219
"appkit/features/telegram-mini-apps",
219220
"appkit/features/sponsored-transactions",
@@ -313,6 +314,7 @@
313314
"appkit/react/core/options",
314315
"appkit/react/core/components",
315316
"appkit/react/core/smart-accounts",
317+
"appkit/react/core/smart-accounts-interaction",
316318
"appkit/react/core/custom-connectors",
317319
"appkit/react/core/custom-networks",
318320
"appkit/react/core/multichain",
@@ -400,6 +402,7 @@
400402
"appkit/next/core/options",
401403
"appkit/next/core/components",
402404
"appkit/next/core/smart-accounts",
405+
"appkit/next/core/smart-accounts-interaction",
403406
"appkit/next/core/custom-connectors",
404407
"appkit/next/core/custom-networks",
405408
"appkit/next/core/multichain",
@@ -487,6 +490,7 @@
487490
"appkit/vue/core/options",
488491
"appkit/vue/core/components",
489492
"appkit/vue/core/smart-accounts",
493+
"appkit/vue/core/smart-accounts-interaction",
490494
"appkit/vue/core/custom-connectors",
491495
"appkit/vue/core/custom-networks",
492496
"appkit/vue/core/multichain",
@@ -573,6 +577,7 @@
573577
"appkit/javascript/core/options",
574578
"appkit/javascript/core/components",
575579
"appkit/javascript/core/smart-accounts",
580+
"appkit/javascript/core/smart-accounts-interaction",
576581
"appkit/javascript/core/custom-connectors",
577582
"appkit/javascript/core/custom-networks",
578583
"appkit/javascript/core/multichain",
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: Embedded Wallets Interactions (EIP-5792)
3+
---
4+
5+
AppKit integrates with EIP-5792 to interact with embedded Wallets (smart accounts) through wallet capabilities. It focuses on three primary methods: `wallet_getCapabilities`, `wallet_sendCalls`, and `wallet_getCallsStatus`. It shows how to check if atomic batch transactions are supported and how to use them.
6+
7+
## wallet_getCapabilities
8+
9+
Appkit checks the `atomic` capability from `wallet_getCapabilities` of the wallet in order to know if a wallet required to handle the batch of calls atomically or not.
10+
Wallets should include the [EIP-5792 capabilities in CAIP-25](/walletkit/android/eip5792#wallet-response).
11+
12+
## wallet_sendCalls
13+
14+
Depending on the 3 different values from the `atomic` capability, AppKit will trigger the `wallet_sendCalls`:
15+
16+
- `supported` means that the wallet supports atomic batch transactions for the account and chain ID. The wallet executes calls atomically and contiguously
17+
- `ready` means that the wallet can upgrade to support atomic execution, pending user approval.
18+
- `unsupported` means that the wallet does not provide any atomicity or contiguity guarantees, and it will not suggest an upgrade to the user. The dApp should fallback to **`eth_sendTransaction`** instead of **`wallet_sendCalls`**, and **`eth_getTransactionReceipt`** instead of **`wallet_getCallsStatus`**
19+
20+
Request Example
21+
```json
22+
{
23+
"from": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
24+
"chainId": "0x01",
25+
"atomicRequired": true,
26+
"calls": [
27+
{
28+
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
29+
"value": "0x9184e72a",
30+
"data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
31+
},
32+
{
33+
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
34+
"value": "0x182183",
35+
"data": "0xfbadbaf01"
36+
}
37+
]
38+
}
39+
```
40+
41+
- `atomicRequired` -  can be set to either `true` or `false`.
42+
- If the `atomic` capability is not supported set to `false`
43+
- If the `atomic` capability is supported set to `true`
44+
45+
## wallet_getCallsStatus
46+
47+
Call this function to get the information about the batch execution.
48+
49+
- The `batchId` field, returned from the `wallet_sendCalls` will be used to identify the batch call.
50+
51+
- The `atomic` field specifies how the wallet handled the batch of calls, which affects the structure of the `receipts` field.
52+
53+
### Response Example
54+
55+
```json
56+
{
57+
"chainId": "0x01",
58+
"id": "0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
59+
"status": 200,
60+
"atomic": true,
61+
"receipts": [
62+
{
63+
"logs": [
64+
{
65+
"address": "0xa922b54716264130634d6ff183747a8ead91a40b",
66+
"topics": [
67+
"0x5a2a90727cc9d000dd060b1132a5c977c9702bb3a52afe360c9c22f0e9451a68"
68+
],
69+
"data": "0xabcd"
70+
}
71+
],
72+
"status": "0x1",
73+
"blockHash": "0xf19bbafd9fd0124ec110b848e8de4ab4f62bf60c189524e54213285e7f540d4a",
74+
"blockNumber": "0xabcd",
75+
"gasUsed": "0xdef",
76+
"transactionHash": "0x9b7bb827c2e5e3c1a0a44dc53e573aa0b3af3bd1f9f5ed03071b100bb039eaff"
77+
}
78+
]
79+
}
80+
```
81+
82+
- if `atomic` is true, the batch was executed atomically by a wallet
83+
84+
- if `atomic` is false, the batch was executed **non-atomically** by a wallet

0 commit comments

Comments
 (0)