wallet_getCapabilities, wallet_sendCalls, and wallet_getCallsStatus. It shows how to check if atomic batch transactions are supported and how to use them.
wallet_getCapabilities
Appkit checks theatomic capability from wallet_getCapabilities of the wallet in order to know if a wallet required to handle the batch of calls atomically or not.
Wallets should include the EIP-5792 capabilities in CAIP-25.
wallet_sendCalls
Depending on the 3 different values from theatomic capability, AppKit will trigger the wallet_sendCalls:
supportedmeans that the wallet supports atomic batch transactions for the account and chain ID. The wallet executes calls atomically and contiguouslyreadymeans that the wallet can upgrade to support atomic execution, pending user approval.unsupportedmeans 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 toeth_sendTransactioninstead ofwallet_sendCalls, andeth_getTransactionReceiptinstead ofwallet_getCallsStatus
atomicRequired- can be set to eithertrueorfalse.- If the
atomiccapability is not supported set tofalse - If the
atomiccapability is supported set totrue
- If the
wallet_getCallsStatus
Call this function to get the information about the batch execution.-
The
batchIdfield, returned from thewallet_sendCallswill be used to identify the batch call. -
The
atomicfield specifies how the wallet handled the batch of calls, which affects the structure of thereceiptsfield.
Response Example
-
if
atomicis true, the batch was executed atomically by a wallet -
if
atomicis false, the batch was executed non-atomically by a wallet