You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: appkit/features/smart-accounts-interaction.mdx
+18-11Lines changed: 18 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,29 @@
2
2
title: Embedded Wallets Interactions (EIP-5792)
3
3
---
4
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.
5
+
AppKit integrates with [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) to interact with embedded Wallets (smart accounts) through wallet capabilities.
6
+
EIP-5792 introduces a general mechanism for wallets to expose structured execution capabilities to dApps. AppKit currently focuses on key capabilities like atomic batch transactions, but the interface is extensible and can support future capabilities defined by the spec.
7
+
AppKit uses the following primary methods defined in EIP-5792:
6
8
7
-
## wallet_getCapabilities
9
+
- wallet_getCapabilities
10
+
11
+
- wallet_sendCalls
12
+
13
+
- wallet_getCallsStatus
8
14
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.
15
+
## wallet_getCapabilities
16
+
This method queries the wallet for its supported execution capabilities. AppKit inspects the response to determine what features are supported by the wallet, including (but not limited to) atomic batch execution.
10
17
Wallets should include the [EIP-5792 capabilities in CAIP-25](/walletkit/android/eip5792#wallet-response).
11
18
12
19
## wallet_sendCalls
13
20
14
-
Depending on the 3 different values from the `atomic` capability, AppKit will trigger the `wallet_sendCalls`:
21
+
Used to send one or more contract calls to the wallet for execution. The behavior depends on the specific capabilities returned by wallet_getCapabilities. For example:
22
+
23
+
-`atomic: "supported"` -> The wallet guarantees atomic and contiguous execution.
24
+
-`atomic: "ready"` -> The wallet may support atomic execution pending user action.
25
+
-`atomic: "unsupported"` -> The wallet does not guarantee atomic execution.
15
26
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`**
27
+
If a required capability is not supported, the dApp should fall back to legacy methods (e.g. eth_sendTransaction, eth_getTransactionReceipt).
19
28
20
29
Request Example
21
30
```json
@@ -38,13 +47,11 @@ Request Example
38
47
}
39
48
```
40
49
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`
50
+
-`atomicRequired` should be set to true only if the dApp requires atomic execution and the wallet has advertised support.
44
51
45
52
## wallet_getCallsStatus
46
53
47
-
Call this function to get the information about the batch execution.
54
+
This method returns the status and receipt(s) of a previously submitted batch.
48
55
49
56
- The `batchId` field, returned from the `wallet_sendCalls` will be used to identify the batch call.
0 commit comments