# Embedded Wallets Interactions (EIP-5792)

AppKit integrates with [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) to interact with embedded Wallets (smart accounts) through wallet capabilities. 
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.
AppKit uses the following primary methods defined in EIP-5792:

- wallet_getCapabilities

- wallet_sendCalls

- wallet_getCallsStatus

<Card title="Guide: Switching to Send Calls" icon="arrow-right-arrow-left" href="/appkit/recipes/switching-to-send-calls" horizontal>
  A step-by-step recipe for adopting `wallet_sendCalls` — checking wallet capabilities, batching transactions, and using paymasters (ERC-7677).
</Card>

## wallet_getCapabilities
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.
Wallets should include the [EIP-5792 capabilities in CAIP-25](https://docs.walletconnect.network/wallet-sdk/android/eip5792#wallet-response). 

## wallet_sendCalls

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:

- `atomic: "supported"` -> The wallet guarantees atomic and contiguous execution.
- `atomic: "ready"` -> The wallet may support atomic execution pending user action.
- `atomic: "unsupported"` -> The wallet does not guarantee atomic execution.

If a required capability is not supported, the dApp should fall back to legacy methods (e.g. eth_sendTransaction, eth_getTransactionReceipt).

Request Example
```json
{
    "from": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
    "chainId": "0x01",
    "atomicRequired": true,
    "calls": [
      {
        "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
        "value": "0x9184e72a",
        "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
      },
      {
        "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
        "value": "0x182183",
        "data": "0xfbadbaf01"
      }
    ]
  }
  ```

  - `atomicRequired` should be set to true only if the dApp requires atomic execution and the wallet has advertised support.

## wallet_getCallsStatus

This method returns the status and receipt(s) of a previously submitted batch. 

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

- The `atomic` field specifies how the wallet handled the batch of calls, which affects the structure of the `receipts` field.

### Response Example

```json
{
  "chainId": "0x01",
  "id": "0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
  "status": 200,
  "atomic": true,
  "receipts": [
    {
      "logs": [
        {
          "address": "0xa922b54716264130634d6ff183747a8ead91a40b",
          "topics": [
            "0x5a2a90727cc9d000dd060b1132a5c977c9702bb3a52afe360c9c22f0e9451a68"
          ],
          "data": "0xabcd"
        }
      ],
      "status": "0x1",
      "blockHash": "0xf19bbafd9fd0124ec110b848e8de4ab4f62bf60c189524e54213285e7f540d4a",
      "blockNumber": "0xabcd",
      "gasUsed": "0xdef",
      "transactionHash": "0x9b7bb827c2e5e3c1a0a44dc53e573aa0b3af3bd1f9f5ed03071b100bb039eaff"
    }
  ]
}
```

- if `atomic` is true, the batch was executed atomically by a wallet

- if `atomic` is false, the batch was executed **non-atomically** by a wallet
