Understand ExecutionAccount boundaries, atomic return-to-pool, and lower-level execute helpers.
This page covers the edge cases around execute(): what the ExecutionAccount
can do, how assets are returned to the private pool atomically, and what the
advanced SDK exposes for custom orchestration and follow-up calls.
ExecutionAccount boundary
An execute() session is a single sponsored ERC-4337 UserOperation built around
the ExecutionAccount. Depending on the request it contains:
Optional private withdrawals from the user’s Unlink balance into the
ExecutionAccount (withdrawFromPool, one entry per token).
The user calls, run as the userCalls section of the plan.
An optional atomic returnToPool deposit that returns ERC-20 tokens from the
ExecutionAccount back into the user’s private Unlink balance.
The account runs all three as one typed plan
(executeUnlinkPlan(withdrawFromPool, userCalls, returnToPool)). The withdrawals,
the calls, and the deposit back into the pool either all succeed or all revert
together — there is no separate return transaction and no partial-settlement
state.The ExecutionAccount is a smart account, not an EOA. The owner key signs an
ExecutionIntent for ERC-4337 validation. It does not send normal EVM
transactions directly from the ExecutionAccount.
Session shape: funded vs unfunded
The number of signatures and round trips depends on whether the session
withdraws from the pool.
Funded session (withdrawFromPool present) — funding mode
private_withdrawal. Three steps: prepare → finalize → submit. Prepare
returns one withdrawal signing request per withdrawFromPool entry (one
private spend proof per token); the user signs each; finalize proves the
withdrawals, materializes the atomic withdrawToExecutionAccount funding
section, and returns the final ExecutionIntent; the user signs that intent and
submit broadcasts the UserOperation. The ExecutionIntent is null until
finalize because the plan (and its planHash) is not complete until the
funding section is materialized.
Unfunded session (withdrawFromPool omitted, including every
executeAccountCall) — funding mode existing_execution_account. Two steps:
prepare → submit. Prepare returns the ExecutionIntent directly because no
funding section has to be materialized.
The high-level client.execute() / client.executeAccountCall() helpers run
the whole sequence for you, including the withdrawal and intent signatures. The
advanced helpers below expose the individual steps.
Advanced SDK surface
The @unlink-xyz/sdk/advanced subpath exports lower-level helpers for custom
orchestration:
prepareExecute / finalizeExecute / submitExecute are the funded
private-withdrawal execute-session steps. Direct prepareExecute callers pass an
account candidate (accountPolicy plus executionAccount.slotIndex, address,
owner, and initCode); /execute/prepare is the atomic bind-or-conflict boundary.
execute() handles the normal discovery, local derivation, and retry loop for
you. prepareExecuteAccountCall / submitExecuteAccountCall prepare and
submit a sponsored UserOperation from an ExecutionAccount without preparing a
withdrawal. The prepare request may include factory initCode for the account’s
first bind/deploy; the durable account binding is completed on submit after the
backend verifies the owner’s ExecutionIntent signature. Direct low-level
callers that use first-bind evidence in prepare must send the same factory
initCode to submitExecuteAccountCall. executeAccountCall is the high-level
helper that performs the same account-call flow for you. finalizeExecute
applies only to funded sessions; unfunded sessions submit the intent returned by
prepare directly.reserveExecutionAccount is still exported for explicit discovery/reservation
tools and legacy custom flows. The high-level private-withdrawal execute()
path does not call it; it lists accounts for an environment, derives the
candidate account from the returned allocation hint, then prepares that
candidate.By default, execute() and executeAccountCall() resolve when the backend
reports execution.confirmation_status: "confirmed": the handleOps
receipt/effects required by the session have been observed and are visible to
API reads. Pass waitUntil: "processed" (or "finalized") if your integration
needs the durable terminal execution-session state before continuing.
The withdrawless account-call flow does not create a pool withdrawal, and it
is not a withdraw(0) workaround. Cold first use is supported only for the
verified ExecutionAccount factory initCode derived by the SDK.
Pass an evm provider when constructing the user client to enable the SDK’s
client-side deployed-code check for warm account calls. The backend always
performs the authoritative factory/initCode derivation checks before preparing a
withdrawless account-call session, and requires deployed code only when the
request is reusing an account without first-bind initCode evidence.
Return assets with returnToPool
Pass returnToPool in the same execute() call when the batch leaves ERC-20
tokens in the ExecutionAccount and those tokens should go back into the user’s
private balance.The return is atomic and typed. returnToPool is the plan’s returnToPool
section, grouped by token; the ExecutionAccount constructs each token group’s
approve → depositFromExecutionAccount → allowance-reset on-chain, inside the
same UserOperation as the funding withdrawals and your calls. The ExecutionAccount
is the depositor and the pool authorizes it directly, so there is no Permit2
signature, nonce, or deadline to manage — and no separate deposit transaction that
can fail on its own.
const amount = 1_000_000_000_000_000_000n;const result = await client.execute({ withdrawFromPool: [{ token, amount: amount.toString() }], calls: [ // protocol calls first, if any ], returnToPool: [{ token, amount: amount.toString() }],});
Your batch must leave at least the requested amount of each returnToPool token
in the ExecutionAccount when the batch reaches the deposit step. If the batch
swaps into a different ERC-20, set the returnToPooltoken to whatever token
remains in the account.Funding, calls, and return-to-pool are three independently-capped plan sections,
not one combined batch: at most 16 calls, at most 8 withdrawFromPool tokens,
and at most 8 returnToPool token groups with at most 4 output notes per token.
Return-to-pool groups do not consume the 16-call budget. The structural caps sit
alongside a per-network sponsored gas budget checked at prepare, so a plan
stacking several sections near their caps can receive a gas-budget rejection
even with every section within bounds. Each token group can mix
fixed amount outputs with one sweep output that re-shields the runtime
remainder (sweep: true + required max_total, optional min_total floor and
baseline). recipient is reserved for future use; v1 defaults every output to
the authenticated Unlink address and rejects a supplied recipient.
Follow-up calls without withdrawal
If a previous execute session completed without returnToPool, those assets can
remain in the ExecutionAccount. Use client.executeAccountCall to run another
call from the same account index without moving funds through the pool first.
The same recovery path applies when a known terminal failure such as
user_op_reverted leaves tokens in the ExecutionAccount.This still uses the ExecutionAccount owner signature and Unlink’s sponsored
ERC-4337 path. The session has funding mode existing_execution_account, and its
withdrawal fields are empty arrays: withdraw_from_pool: [] and
withdrawal_tx_ids: [].
You can also use it for a non-deposit follow-up call, as long as the target
calldata can execute from the ExecutionAccount and does not need a new private
withdrawal. When returnToPool is omitted, calls must be non-empty.
Public EOA deposit fallback
depositWithApproval() deposits from the connected EVM wallet, not from the
ExecutionAccount. If atomic returnToPool is not suitable for a flow, transfer
the tokens from the ExecutionAccount to the user’s EOA in a follow-up
executeAccountCall(), then call depositWithApproval() from that EOA.
This fallback is public. The ERC-20 transfer from the ExecutionAccount to the
EOA and the later deposit source wallet are visible on-chain.
The pool, circuits, and contracts still require positive note amounts for real
withdrawals and outputs. A zero-amount withdrawal is not the supported escape
hatch.
⌘I
{"docsConfig":{"theme":"linden","$schema":"https://mintlify.com/docs.json","name":"Unlink Docs","colors":{"primary":"#0a0a0a","light":"#0a0a0a","dark":"#0a0a0a"},"logo":{"light":"https://mintcdn.com/unlink/mifVsX-TcdZe15P5/brand/unlink-wordmark.svg?fit=max\u0026auto=format\u0026n=mifVsX-TcdZe15P5\u0026q=85\u0026s=5e30595a899bfdb69235652d61f469a4","dark":"https://mintcdn.com/unlink/mifVsX-TcdZe15P5/brand/unlink-wordmark.svg?fit=max\u0026auto=format\u0026n=mifVsX-TcdZe15P5\u0026q=85\u0026s=5e30595a899bfdb69235652d61f469a4"},"favicon":"https://mintcdn.com/unlink/XcTvjFq-XieS4sNd/favicon.svg?fit=max\u0026auto=format\u0026n=XcTvjFq-XieS4sNd\u0026q=85\u0026s=68cfa7bf7c2c82e7bd75bbcf4bfdee83","appearance":{"default":"light","strict":true},"background":{"color":{"light":"#fafaf7","dark":"#09090b"}},"navbar":{"links":[],"primary":{"type":"button","label":"Website","href":"https://unlink.xyz"}},"footer":{"socials":{"x":"https://x.com/unlink_xyz","linkedin":"https://www.linkedin.com/company/unlink-labs","website":"https://unlink.xyz"}},"fonts":{"heading":{"family":"Instrument Serif","weight":400},"body":{"family":"Inter","weight":400}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Security","icon":"shield","href":"https://unlink.xyz/security"},{"anchor":"Telegram","icon":"telegram","href":"https://t.me/+E9EXrwnsXuUyZGI8"},{"anchor":"NPM Packages","icon":"npm","href":"https://www.npmjs.com/org/unlink-xyz"},{"anchor":"Feedback","icon":"envelope","href":"mailto:hello@unlink.xyz"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"unlink","hasAudioNarration":false,"actualSubdomain":"unlink","customDomains":["docs.unlink.xyz"],"gitSource":{"type":"github","owner":"unlink-xyz","repo":"monorepo","deployBranch":"main","contentDirectory":"docs/public","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae92be4d6d43ca9cd217814:success","clientVersion":"0.0.4304","searchFilterCounts":[{"language":"default","tag":"Build","count":6},{"language":"default","tag":"Reference","count":3},{"language":"default","tag":"Concepts","count":3},{"language":"default","tag":"Get Started","count":3},{"language":"default","tag":"Tutorial","count":2}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx3cwhsk.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxTcwhsk.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxPcwhsk.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx_cwhsk.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx7cwhsk.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx3cwhsk.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxTcwhsk.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxPcwhsk.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx_cwhsk.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx7cwhsk.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n:root{--color-paper: #fafaf7;--color-paper-2: #fafaf7;--color-ink: #0a0a0a;--color-ink-2: #1f1f1f;--color-ink-3: #737373;--color-ink-4: #9a9a94;--color-line: #0a0a0a;--color-line-soft: #e5e5e0;--color-accent: #0a0a0a;--color-graphite: #1f1f1f;--color-smoke: #737373;--color-hairline: #e5e5e0;--color-mist: #f0f0eb;--color-settled: #1a6b3f;--color-pending: #8a6d1f;--color-alert: #8b1f1f;--font-sans: \"Inter\", ui-sans-serif, system-ui, sans-serif;--font-display: \"Instrument Serif\", Georgia, \"Times New Roman\", serif;--font-mono:\n \"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,\n monospace}#content-area,#content-container,#body-content,#mdx-content,main,article,[class*=\"content\"]{max-width:1400px!important;margin-left:auto!important;margin-right:auto!important}body{background:var(--color-paper);color:var(--color-ink);font-family:var(--font-sans)}#page-title{font-family:var(--font-display)!important;font-size:clamp(44px, 6vw, 64px)!important;font-weight:400!important;line-height:1.04!important;letter-spacing:-0.01em!important;color:var(--color-ink)!important;text-wrap:balance;word-break:normal!important;overflow-wrap:normal!important}#header .eyebrow{font-family:var(--font-mono)!important;font-size:13px!important;font-weight:500!important;letter-spacing:0.16em!important;text-transform:uppercase!important;color:var(--color-ink-3)!important;height:auto!important;margin-bottom:14px}.mdx-content h2,.mdx-content h3{font-family:var(--font-display)!important;color:var(--color-ink)!important;font-weight:400!important;letter-spacing:-0.01em;text-wrap:balance}.mdx-content h2{font-size:clamp(30px, 3.5vw, 42px)!important;line-height:1.08!important;margin-top:1.6em!important;margin-bottom:0.4em!important}.mdx-content h3{font-size:clamp(22px, 2.5vw, 28px)!important;line-height:1.12!important;margin-top:1.4em!important;margin-bottom:0.3em!important}#sidebar-title,#sidebar-content h5{font-family:var(--font-mono)!important;font-size:13px!important;font-weight:500!important;letter-spacing:0.16em!important;text-transform:uppercase!important;color:var(--color-ink-3)!important;text-decoration:underline!important;text-decoration-color:var(--color-line-soft)!important;text-underline-offset:4px!important}code,pre,kbd,samp{font-family:var(--font-mono)!important}.mdx-content :not(pre)>code{border:1px solid var(--color-line-soft);background:var(--color-paper-2);border-radius:3px;padding:1px 6px;font-size:0.86em}.mdx-content a{color:var(--color-ink);text-decoration:underline;text-decoration-color:var(--color-line-soft);text-underline-offset:3px}.mdx-content a:hover{text-decoration-color:var(--color-ink)}.mdx-content blockquote{border-left:1px solid var(--color-line-soft);padding:4px 0 4px 20px;margin:30px 0;font-family:var(--font-display);font-size:28px;line-height:1.2;color:var(--color-ink-2)}.unlink-flow{display:grid;grid-template-columns:minmax(0, 1fr) minmax(52px, 72px) minmax(160px, 1.45fr)\n minmax(52px, 72px) minmax(0, 1fr);gap:12px;align-items:center;box-sizing:border-box;width:100%;max-width:100%;margin:28px 0 34px;padding:18px;border:1px solid var(--color-line-soft);border-radius:4px;background:var(--color-paper-2)}.unlink-flow__lane,.unlink-flow__pool{min-width:0}.unlink-flow__label{margin-bottom:8px;font-family:var(--font-mono);font-size:10px;font-weight:500;letter-spacing:0.12em;text-transform:uppercase;color:var(--color-ink-3)}.unlink-flow__node{min-height:56px;min-width:0;display:flex;align-items:center;justify-content:center;padding:12px;border:1px solid var(--color-line-soft);border-radius:4px;background:#ffffff;color:var(--color-ink);font-family:var(--font-mono);font-size:13px;line-height:1.25;text-align:center;overflow-wrap:anywhere}.unlink-flow__node--strong{border-color:var(--color-line)}.unlink-flow__node--muted{color:var(--color-ink-2)}.unlink-flow__pool{padding:14px;border:1px solid var(--color-line);border-radius:4px;background:var(--color-mist)}.unlink-flow__rail{position:relative;display:flex;justify-content:center;margin:12px 0;font-family:var(--font-mono);font-size:10px;font-weight:500;letter-spacing:0.12em;text-transform:uppercase;color:var(--color-ink-3)}.unlink-flow__rail::before,.unlink-flow__rail::after{content:\"\";position:absolute;top:50%;width:24%;border-top:1px solid var(--color-line-soft)}.unlink-flow__rail::before{left:0}.unlink-flow__rail::after{right:0}.unlink-flow__step{position:relative;display:flex;justify-content:center;align-items:center;min-width:0;font-family:var(--font-mono);font-size:10px;font-weight:500;letter-spacing:0.12em;text-transform:uppercase;color:var(--color-ink-3)}.unlink-flow__step::before,.unlink-flow__step::after{content:\"\";flex:1;border-top:1px solid var(--color-line-soft)}.unlink-flow__step span{padding:0 8px;white-space:nowrap}@media (max-width: 760px){.unlink-flow{grid-template-columns:1fr;gap:12px;padding:14px}.unlink-flow__step{min-height:28px}.unlink-flow__step::before,.unlink-flow__step::after{max-width:64px}}.mdx-content table th{font-family:var(--font-sans);font-size:11px;letter-spacing:0.18em;text-transform:uppercase;border-bottom:1px solid var(--color-line-soft);text-align:left;padding:10px 12px}.mdx-content table td{border-bottom:1px solid var(--color-line-soft);padding:10px 12px}.card:not(.card-group){border:1px solid var(--color-line-soft)!important;border-radius:4px!important;background:var(--color-paper-2)!important;box-shadow:none!important;transition:background-color 150ms ease,\n border-color 150ms ease}.card:not(.card-group):hover{border-color:var(--color-line)!important;background:var(--color-mist)!important}.callout{border:1px solid var(--color-line-soft)!important;background:var(--color-paper-2)!important;border-left-width:3px!important;border-left-color:var(--color-ink)!important;border-radius:4px!important}span[data-shape=\"rounded\"]{font-family:var(--font-mono)!important;font-size:10px!important;letter-spacing:0.12em!important;text-transform:uppercase!important}.navbar a[class*=\"primary\"],button[class*=\"primary\"]{background:var(--color-ink)!important;color:var(--color-paper-2)!important;border:1px solid var(--color-ink)!important;border-radius:4px!important}[class*=\"sidebar\"] [aria-current=\"page\"],[class*=\"anchor\"][aria-current=\"page\"]{color:var(--color-ink)!important;font-weight:500}.privacy-public{color:var(--color-alert)!important;font-weight:500}.privacy-private{color:var(--color-settled)!important;font-weight:500}"}]}
{"page":{"pagePath":"execute-advanced","slug":"/execute-advanced","pageMetadata":{"title":"Advanced execute","description":"Understand ExecutionAccount boundaries, atomic return-to-pool, and lower-level execute helpers.","href":"/execute-advanced"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Understand ExecutionAccount boundaries, atomic return-to-pool, and lower-level execute helpers.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`This page covers the edge cases around `,_jsx(_components.code,{children:`execute()`}),`: what the ExecutionAccount\ncan do, how assets are returned to the private pool atomically, and what the\nadvanced SDK exposes for custom orchestration and follow-up calls.`]}),`\n`,_jsx(Heading,{level:`2`,id:`executionaccount-boundary`,children:`ExecutionAccount boundary`}),`\n`,_jsxs(_components.p,{children:[`An `,_jsx(_components.code,{children:`execute()`}),` session is a single sponsored ERC-4337 UserOperation built around\nthe ExecutionAccount. Depending on the request it contains:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Optional private withdrawals from the user’s Unlink balance into the\nExecutionAccount (`,_jsx(_components.code,{children:`withdrawFromPool`}),`, one entry per token).`]}),`\n`,_jsxs(_components.li,{children:[`The user `,_jsx(_components.code,{children:`calls`}),`, run as the `,_jsx(_components.code,{children:`userCalls`}),` section of the plan.`]}),`\n`,_jsxs(_components.li,{children:[`An optional atomic `,_jsx(_components.code,{children:`returnToPool`}),` deposit that returns ERC-20 tokens from the\nExecutionAccount back into the user’s private Unlink balance.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The account runs all three as one typed plan\n(`,_jsx(_components.code,{children:`executeUnlinkPlan(withdrawFromPool, userCalls, returnToPool)`}),`). The withdrawals,\nthe calls, and the deposit back into the pool either all succeed or all revert\ntogether — there is no separate return transaction and no partial-settlement\nstate.`]}),`\n`,_jsx(_components.p,{children:`The ExecutionAccount is a smart account, not an EOA. The owner key signs an\nExecutionIntent for ERC-4337 validation. It does not send normal EVM\ntransactions directly from the ExecutionAccount.`}),`\n`,_jsx(Heading,{level:`2`,id:`session-shape-funded-vs-unfunded`,children:`Session shape: funded vs unfunded`}),`\n`,_jsx(_components.p,{children:`The number of signatures and round trips depends on whether the session\nwithdraws from the pool.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Funded session`}),` (`,_jsx(_components.code,{children:`withdrawFromPool`}),` present) — funding mode\n`,_jsx(_components.code,{children:`private_withdrawal`}),`. Three steps: `,_jsx(_components.code,{children:`prepare`}),` → `,_jsx(_components.code,{children:`finalize`}),` → `,_jsx(_components.code,{children:`submit`}),`. Prepare\nreturns one withdrawal signing request `,_jsxs(_components.strong,{children:[`per `,_jsx(_components.code,{children:`withdrawFromPool`}),` entry`]}),` (one\nprivate spend proof per token); the user signs each; `,_jsx(_components.code,{children:`finalize`}),` proves the\nwithdrawals, materializes the atomic `,_jsx(_components.code,{children:`withdrawToExecutionAccount`}),` funding\nsection, and returns the final ExecutionIntent; the user signs that intent and\n`,_jsx(_components.code,{children:`submit`}),` broadcasts the UserOperation. The ExecutionIntent is null until\nfinalize because the plan (and its `,_jsx(_components.code,{children:`planHash`}),`) is not complete until the\nfunding section is materialized.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Unfunded session`}),` (`,_jsx(_components.code,{children:`withdrawFromPool`}),` omitted, including every\n`,_jsx(_components.code,{children:`executeAccountCall`}),`) — funding mode `,_jsx(_components.code,{children:`existing_execution_account`}),`. Two steps:\n`,_jsx(_components.code,{children:`prepare`}),` → `,_jsx(_components.code,{children:`submit`}),`. Prepare returns the ExecutionIntent directly because no\nfunding section has to be materialized.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The high-level `,_jsx(_components.code,{children:`client.execute()`}),` / `,_jsx(_components.code,{children:`client.executeAccountCall()`}),` helpers run\nthe whole sequence for you, including the withdrawal and intent signatures. The\nadvanced helpers below expose the individual steps.`]}),`\n`,_jsx(Heading,{level:`2`,id:`advanced-sdk-surface`,children:`Advanced SDK surface`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`@unlink-xyz/sdk/advanced`}),` subpath exports lower-level helpers for custom\norchestration:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` createExecutionAccountClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` executeAccountCall`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` finalizeExecute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` getExecuteSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` pollExecuteStatus`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` prepareExecute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` prepareExecuteAccountCall`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reserveExecutionAccount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` submitExecute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` submitExecuteAccountCall`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`} `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@unlink-xyz/sdk/advanced\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`prepareExecute`}),` / `,_jsx(_components.code,{children:`finalizeExecute`}),` / `,_jsx(_components.code,{children:`submitExecute`}),` are the funded\nprivate-withdrawal execute-session steps. Direct `,_jsx(_components.code,{children:`prepareExecute`}),` callers pass an\naccount candidate (`,_jsx(_components.code,{children:`accountPolicy`}),` plus `,_jsx(_components.code,{children:`executionAccount.slotIndex`}),`, address,\nowner, and initCode); `,_jsx(_components.code,{children:`/execute/prepare`}),` is the atomic bind-or-conflict boundary.\n`,_jsx(_components.code,{children:`execute()`}),` handles the normal discovery, local derivation, and retry loop for\nyou. `,_jsx(_components.code,{children:`prepareExecuteAccountCall`}),` / `,_jsx(_components.code,{children:`submitExecuteAccountCall`}),` prepare and\nsubmit a sponsored UserOperation from an ExecutionAccount without preparing a\nwithdrawal. The prepare request may include factory initCode for the account’s\nfirst bind/deploy; the durable account binding is completed on submit after the\nbackend verifies the owner’s `,_jsx(_components.code,{children:`ExecutionIntent`}),` signature. Direct low-level\ncallers that use first-bind evidence in prepare must send the same factory\ninitCode to `,_jsx(_components.code,{children:`submitExecuteAccountCall`}),`. `,_jsx(_components.code,{children:`executeAccountCall`}),` is the high-level\nhelper that performs the same account-call flow for you. `,_jsx(_components.code,{children:`finalizeExecute`}),`\napplies only to funded sessions; unfunded sessions submit the intent returned by\nprepare directly.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`reserveExecutionAccount`}),` is still exported for explicit discovery/reservation\ntools and legacy custom flows. The high-level private-withdrawal `,_jsx(_components.code,{children:`execute()`}),`\npath does not call it; it lists accounts for an environment, derives the\ncandidate account from the returned allocation hint, then prepares that\ncandidate.`]}),`\n`,_jsxs(_components.p,{children:[`By default, `,_jsx(_components.code,{children:`execute()`}),` and `,_jsx(_components.code,{children:`executeAccountCall()`}),` resolve when the backend\nreports `,_jsx(_components.code,{children:`execution.confirmation_status: \"confirmed\"`}),`: the handleOps\nreceipt/effects required by the session have been observed and are visible to\nAPI reads. Pass `,_jsx(_components.code,{children:`waitUntil: \"processed\"`}),` (or `,_jsx(_components.code,{children:`\"finalized\"`}),`) if your integration\nneeds the durable terminal execution-session state before continuing.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The withdrawless account-call flow does not create a pool withdrawal, and it\nis not a `,_jsx(_components.code,{children:`withdraw(0)`}),` workaround. Cold first use is supported only for the\nverified ExecutionAccount factory initCode derived by the SDK.`]})}),`\n`,_jsxs(_components.p,{children:[`Pass an `,_jsx(_components.code,{children:`evm`}),` provider when constructing the user client to enable the SDK’s\nclient-side deployed-code check for warm account calls. The backend always\nperforms the authoritative factory/initCode derivation checks before preparing a\nwithdrawless account-call session, and requires deployed code only when the\nrequest is reusing an account without first-bind initCode evidence.`]}),`\n`,_jsx(Heading,{level:`2`,id:`return-assets-with-returntopool`,children:`Return assets with returnToPool`}),`\n`,_jsxs(_components.p,{children:[`Pass `,_jsx(_components.code,{children:`returnToPool`}),` in the same `,_jsx(_components.code,{children:`execute()`}),` call when the batch leaves ERC-20\ntokens in the ExecutionAccount and those tokens should go back into the user’s\nprivate balance.`]}),`\n`,_jsxs(_components.p,{children:[`The return is atomic and typed. `,_jsx(_components.code,{children:`returnToPool`}),` is the plan’s `,_jsx(_components.code,{children:`returnToPool`}),`\nsection, grouped by token; the ExecutionAccount constructs each token group’s\n`,_jsx(_components.code,{children:`approve`}),` → `,_jsx(_components.code,{children:`depositFromExecutionAccount`}),` → allowance-reset on-chain, inside the\nsame UserOperation as the funding withdrawals and your calls. The ExecutionAccount\nis the depositor and the pool authorizes it directly, so there is no Permit2\nsignature, nonce, or deadline to manage — and no separate deposit transaction that\ncan fail on its own.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` amount`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1_000_000_000_000_000_000`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` result`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`execute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` withdrawFromPool:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amount:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() }],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` calls:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // protocol calls first, if any`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` returnToPool:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amount:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() }],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Your batch must leave at least the requested amount of each `,_jsx(_components.code,{children:`returnToPool`}),` token\nin the ExecutionAccount when the batch reaches the deposit step. If the batch\nswaps into a different ERC-20, set the `,_jsx(_components.code,{children:`returnToPool`}),` `,_jsx(_components.code,{children:`token`}),` to whatever token\nremains in the account.`]}),`\n`,_jsxs(_components.p,{children:[`Funding, calls, and return-to-pool are three independently-capped plan sections,\nnot one combined batch: at most 16 `,_jsx(_components.code,{children:`calls`}),`, at most 8 `,_jsx(_components.code,{children:`withdrawFromPool`}),` tokens,\nand at most 8 `,_jsx(_components.code,{children:`returnToPool`}),` token groups with at most 4 output notes per token.\nReturn-to-pool groups do not consume the 16-call budget. The structural caps sit\nalongside a per-network sponsored gas budget checked at prepare, so a plan\nstacking several sections near their caps can receive a gas-budget rejection\neven with every section within bounds. Each token group can mix\nfixed `,_jsx(_components.code,{children:`amount`}),` outputs with one `,_jsx(_components.code,{children:`sweep`}),` output that re-shields the runtime\nremainder (`,_jsx(_components.code,{children:`sweep: true`}),` + required `,_jsx(_components.code,{children:`max_total`}),`, optional `,_jsx(_components.code,{children:`min_total`}),` floor and\n`,_jsx(_components.code,{children:`baseline`}),`). `,_jsx(_components.code,{children:`recipient`}),` is reserved for future use; v1 defaults every output to\nthe authenticated Unlink address and rejects a supplied recipient.`]}),`\n`,_jsx(Heading,{level:`2`,id:`follow-up-calls-without-withdrawal`,children:`Follow-up calls without withdrawal`}),`\n`,_jsxs(_components.p,{children:[`If a previous execute session completed without `,_jsx(_components.code,{children:`returnToPool`}),`, those assets can\nremain in the ExecutionAccount. Use `,_jsx(_components.code,{children:`client.executeAccountCall`}),` to run another\ncall from the same account index without moving funds through the pool first.\nThe same recovery path applies when a known terminal failure such as\n`,_jsx(_components.code,{children:`user_op_reverted`}),` leaves tokens in the ExecutionAccount.`]}),`\n`,_jsxs(_components.p,{children:[`This still uses the ExecutionAccount owner signature and Unlink’s sponsored\nERC-4337 path. The session has funding mode `,_jsx(_components.code,{children:`existing_execution_account`}),`, and its\nwithdrawal fields are empty arrays: `,_jsx(_components.code,{children:`withdraw_from_pool: []`}),` and\n`,_jsx(_components.code,{children:`withdrawal_tx_ids: []`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` accountIndex`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` previousResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`execution`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`account_index`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` stuckAmount`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1_000_000_000_000_000_000`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`executeAccountCall`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` accountIndex`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` calls:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` target:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` stuckToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` value:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` data:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0x...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// optional follow-up calldata from the ExecutionAccount`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` returnToPool:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` stuckToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amount:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` stuckAmount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() }],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`You can also use it for a non-deposit follow-up call, as long as the target\ncalldata can execute from the ExecutionAccount and does not need a new private\nwithdrawal. When `,_jsx(_components.code,{children:`returnToPool`}),` is omitted, `,_jsx(_components.code,{children:`calls`}),` must be non-empty.`]}),`\n`,_jsx(Heading,{level:`2`,id:`public-eoa-deposit-fallback`,children:`Public EOA deposit fallback`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`depositWithApproval()`}),` deposits from the connected EVM wallet, not from the\nExecutionAccount. If atomic `,_jsx(_components.code,{children:`returnToPool`}),` is not suitable for a flow, transfer\nthe tokens from the ExecutionAccount to the user’s EOA in a follow-up\n`,_jsx(_components.code,{children:`executeAccountCall()`}),`, then call `,_jsx(_components.code,{children:`depositWithApproval()`}),` from that EOA.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`This fallback is public. The ERC-20 transfer from the ExecutionAccount to the\nEOA and the later deposit source wallet are visible on-chain.`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`78`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`78`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`account`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`createUnlinkClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`evm`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@unlink-xyz/sdk/browser\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`encodeFunctionData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`erc20Abi`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"viem\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` evmProvider`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` evm`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`fromEip1193`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`provider:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ethereum`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` createUnlinkClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` environment:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"base-sepolia\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` account:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` account`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`fromMnemonic`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`mnemonic`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` evm:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` evmProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`ensureRegistered`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` token`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0xTokenAddress\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` protocol`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0xProtocolAddress\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` firstAmount`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1_000_000_000_000_000_000`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` first`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`execute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` withdrawFromPool:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amount:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` firstAmount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() }],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` calls:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` target:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` value:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` data:`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` encodeFunctionData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` abi:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` erc20Abi`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` functionName:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"approve\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` args:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`protocol`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`firstAmount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` target:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` protocol`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` value:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` data:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0x...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// initial protocol calldata`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` waitUntil:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"processed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`first`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"completed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`execute ended with status \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`first`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` accountIndex`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` first`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`execution`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`account_index`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` recipientEoa`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` evmProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getAddress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` amountToDeposit`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 500_000_000_000_000_000`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` followUp`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`executeAccountCall`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` accountIndex`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` calls:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` target:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` protocol`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` value:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` data:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0x...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// optional follow-up calldata from the ExecutionAccount`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` target:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` value:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` data:`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` encodeFunctionData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` abi:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` erc20Abi`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` functionName:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"transfer\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` args:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`recipientEoa`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amountToDeposit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` waitUntil:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"processed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`followUp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"completed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`account call ended with status \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`followUp`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` deposit`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`depositWithApproval`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` amount:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` amountToDeposit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` confirmed`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` deposit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`wait`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`confirmed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`confirmationStatus`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The pool, circuits, and contracts still require positive note amounts for real\nwithdrawals and outputs. A zero-amount withdrawal is not the supported escape\nhatch.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Advanced execute","description":"Understand ExecutionAccount boundaries, atomic return-to-pool, and lower-level execute helpers.","href":"/execute-advanced"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"ExecutionAccount boundary","slug":"executionaccount-boundary","depth":2,"children":[]},{"title":"Session shape: funded vs unfunded","slug":"session-shape-funded-vs-unfunded","depth":2,"children":[]},{"title":"Advanced SDK surface","slug":"advanced-sdk-surface","depth":2,"children":[]},{"title":"Return assets with returnToPool","slug":"return-assets-with-returntopool","depth":2,"children":[]},{"title":"Follow-up calls without withdrawal","slug":"follow-up-calls-without-withdrawal","depth":2,"children":[]},{"title":"Public EOA deposit fallback","slug":"public-eoa-deposit-fallback","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"unlink","siteName":"Unlink Docs","title":"Advanced execute - Unlink Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-23T23:13:41.703Z","originalFileLocation":"execute-advanced.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Understand ExecutionAccount boundaries, atomic return-to-pool, and lower-level execute helpers.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Unlink Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/unlink/P16o6fBZsqGi5J9Q/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/unlink/P16o6fBZsqGi5J9Q/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/unlink/P16o6fBZsqGi5J9Q/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/unlink/P16o6fBZsqGi5J9Q/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/unlink/P16o6fBZsqGi5J9Q/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/unlink/P16o6fBZsqGi5J9Q/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/unlink/P16o6fBZsqGi5J9Q/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/unlink/P16o6fBZsqGi5J9Q/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/unlink/P16o6fBZsqGi5J9Q/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Advanced execute - Unlink Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Understand ExecutionAccount boundaries, atomic return-to-pool, and lower-level execute helpers.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Unlink Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.unlink.xyz/execute-advanced\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://unlink.mintlify.site/_mintlify/api/og/v2?division=Build\u0026amp;title=Advanced+execute\u0026amp;description=Understand+ExecutionAccount+boundaries%2C+atomic+return-to-pool%2C+and+lower-level+execute+helpers.\u0026amp;theme=9c68b84a32e90035921e3b68\u0026amp;signature=d485242c252cd9db89ba71d66bbf7340a827ec386b40b96d72ea29746350911a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Advanced execute - Unlink Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Understand ExecutionAccount boundaries, atomic return-to-pool, and lower-level execute helpers.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://unlink.mintlify.site/_mintlify/api/og/v2?division=Build\u0026amp;title=Advanced+execute\u0026amp;description=Understand+ExecutionAccount+boundaries%2C+atomic+return-to-pool%2C+and+lower-level+execute+helpers.\u0026amp;theme=9c68b84a32e90035921e3b68\u0026amp;signature=d485242c252cd9db89ba71d66bbf7340a827ec386b40b96d72ea29746350911a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/unlink/P16o6fBZsqGi5J9Q/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Unlink Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0a0a0a\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.unlink.xyz/execute-advanced\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/execute-advanced.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.unlink.xyz/#organization\",\"name\":\"Unlink Docs\",\"url\":\"https://docs.unlink.xyz\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/unlink/mifVsX-TcdZe15P5/brand/unlink-wordmark.svg?fit=max\u0026auto=format\u0026n=mifVsX-TcdZe15P5\u0026q=85\u0026s=5e30595a899bfdb69235652d61f469a4\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.unlink.xyz#website\",\"name\":\"Unlink Docs\",\"url\":\"https://docs.unlink.xyz\",\"publisher\":{\"@id\":\"https://docs.unlink.xyz/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.unlink.xyz/execute-advanced#webpage\",\"url\":\"https://docs.unlink.xyz/execute-advanced\",\"name\":\"Advanced execute\",\"description\":\"Understand ExecutionAccount boundaries, atomic return-to-pool, and lower-level execute helpers.\",\"dateModified\":\"2026-07-23T23:13:41.703Z\",\"isPartOf\":{\"@id\":\"https://docs.unlink.xyz#website\"},\"breadcrumb\":{\"@id\":\"https://docs.unlink.xyz/execute-advanced#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.unlink.xyz/execute-advanced#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Build\",\"item\":\"https://docs.unlink.xyz/faucet\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Advanced execute\",\"item\":\"https://docs.unlink.xyz/execute-advanced\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.unlink.xyz/execute-advanced#article\",\"headline\":\"Advanced execute\",\"name\":\"Advanced execute\",\"description\":\"Understand ExecutionAccount boundaries, atomic return-to-pool, and lower-level execute helpers.\",\"url\":\"https://docs.unlink.xyz/execute-advanced\",\"mainEntityOfPage\":{\"@id\":\"https://docs.unlink.xyz/execute-advanced#webpage\"},\"dateModified\":\"2026-07-23T23:13:41.703Z\",\"publisher\":{\"@id\":\"https://docs.unlink.xyz/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.unlink.xyz#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Unlink Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Unlink Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/execute-advanced.md","siteName":"Unlink Docs","nav":{"global":{"anchors":[{"anchor":"Security","icon":"shield","href":"https://unlink.xyz/security"},{"anchor":"Telegram","icon":"telegram","href":"https://t.me/+E9EXrwnsXuUyZGI8"},{"anchor":"NPM Packages","icon":"npm","href":"https://www.npmjs.com/org/unlink-xyz"},{"anchor":"Feedback","icon":"envelope","href":"mailto:hello@unlink.xyz"}]},"groups":[{"group":"Get Started","icon":"play","pages":[{"title":"Introduction","href":"/index"},{"title":"Quickstart","href":"/quickstart"},{"title":"Supported chains","href":"/supported-chains"}]},{"group":"Concepts","icon":"book-open","pages":[{"title":"How Unlink works","href":"/how-unlink-works"},{"title":"Trust model","href":"/trust-model"},{"title":"Custody models","href":"/custody-models"}]},{"group":"Build","icon":"hammer","pages":[{"title":"Faucet","href":"/faucet"},{"title":"Deposit","href":"/deposit"},{"title":"Transfer","href":"/transfer"},{"title":"Withdraw","href":"/withdraw"},{"title":"Execute","description":"Use private funds in an external EVM call.","href":"/execute"},{"title":"Advanced execute","href":"/execute-advanced"}]},{"group":"Reference","icon":"code","pages":[{"title":"Accounts and keys","description":"Register accounts, read addresses, choose a constructor, derive from a wallet signature, and store encrypted recovery data.","href":"/accounts-and-keys"},{"title":"Reading data and status","href":"/reading-data"},{"title":"Error handling","href":"/errors"}]},{"group":"Tutorial","icon":"graduation-cap","pages":[{"title":"Create Unlink accounts with Openfort","href":"/openfort-accounts"},{"title":"Build a private nanopayment app","href":"/partner-integrations"}]}]},"basePath":"","title":"Advanced execute - Unlink Docs","deploymentId":"dpl_57NA6NKtrcUBhuxv6Tm2hAi21TK4","buildId":"dpl_57NA6NKtrcUBhuxv6Tm2hAi21TK4","dynamics":[],"chunks":[]}