Skip to content

Commit 005f7d5

Browse files
committed
improve appkit on being more open than atomic
1 parent 8569e57 commit 005f7d5

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

appkit/features/smart-accounts-interaction.mdx

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,29 @@
22
title: Embedded Wallets Interactions (EIP-5792)
33
---
44

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:
68

7-
## wallet_getCapabilities
9+
- wallet_getCapabilities
10+
11+
- wallet_sendCalls
12+
13+
- wallet_getCallsStatus
814

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.
1017
Wallets should include the [EIP-5792 capabilities in CAIP-25](/walletkit/android/eip5792#wallet-response).
1118

1219
## wallet_sendCalls
1320

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.
1526

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).
1928

2029
Request Example
2130
```json
@@ -38,13 +47,11 @@ Request Example
3847
}
3948
```
4049

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.
4451

4552
## wallet_getCallsStatus
4653

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.
4855

4956
- The `batchId` field, returned from the `wallet_sendCalls` will be used to identify the batch call.
5057

0 commit comments

Comments
 (0)