Embedded Wallets Interactions (EIP-5792)
AppKit integrates with 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
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.
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
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 thewallet_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 thereceipts
field.
Response Example
-
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