Execution sessions move ERC-20 tokens from private pool notes into an ERC-4337 ExecutionAccount, run an ordered batch of one or more sponsored account calls atomically via Solady’sDocumentation Index
Fetch the complete documentation index at: https://docs.unlink.xyz/llms.txt
Use this file to discover all available pages before exploring further.
executeBatch, and optionally deposit resulting tokens back into the private pool. A “single call” is just a length-1 array.
The SDK exposes session.execute(...) as the high-level path. It reserves an ExecutionAccount, prepares an ExecutionIntent, collects the required signatures, submits once, and returns once the session reaches a terminal status.
Provide an EVM provider with eth_getCode support. The SDK accepts an empty prepared initCodeHash only when eth_getCode confirms bytecode at the resolved ExecutionAccount address; an active backend account alone does not prove deployment.
Flow
- Reserve or reuse an ExecutionAccount.
- Prepare a private withdrawal and backend-built
ExecutionIntent. - Sign the private withdrawal request.
- Verify and sign the prepared
ExecutionIntent. - Submit the withdrawal signature, ExecutionIntent signature, and optional deposit-back payload in one request.
- Backend recovery waits for the withdrawal, sponsors and relays the UserOperation, and submits deposit-back when requested.
Recovery
session.execute(...) throws ExecuteRecoveryError when prepare, signing, submit, poll, or deposit-back pre-signing fails after the session exists. The error includes the execution id, withdrawal transaction id, optional deposit-back transaction id, failed stage, last known execution session when available, prepared ExecutionIntent, collected ExecutionIntent signature when available, and deposit-back payload when available.
Use the low-level helpers for custom orchestration:
execution_submit_accepted is true, no signer-side action remains, even if the session status is still prepared.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Yes | ERC-20 token withdrawn privately |
amount | string | Yes | Amount in token base units |
calls | ExecuteCall[] | Yes | Ordered batch of 1..16 calls run atomically. Each call: { target, value, data, label? }. A “single call” is a length-1 array. |
signSigningRequest | SignSigningRequestFn | No | Override the withdrawal EdDSA signer. Auto-derived from a seed account. |
signingHooks | ExecutionSigningHooks | No | Override the ExecutionIntent signer. Auto-derived from a seed account. |
depositBack | DepositBackParams | No | Private re-deposit for leftover/output ERC-20s |
value must be "0" until native ETH execution funding is supported (use WETH for flows that need ETH). For compound DeFi actions, list each step in calls (approve + supply, repay + withdraw, swap + deposit) — the wrapper runs them atomically as one sponsored UserOp via Solady’s executeBatch, and any inner revert reverts the whole batch.
The optional label on each call is client-side only — the SDK strips it before sending over the wire. Use it to tag calls in your own logging or devtools. Per-call error surfacing (which call in the batch failed) is tracked separately as ENG-566 and is not implemented yet.