Set up the Shield Swap Typescript SDK for chain reads, API access, swaps, and liquidity.
@provablehq/shield-swap-sdk adds typed Shield Swap actions to a Typescript client. Use the extended wallet client for Shield Swap reads, writes, and records; publicClient for general ledger queries such as transaction acceptance; and client.api for indexed REST methods.The SDK handles record selection, program imports, swap planning, confidential addresses, and position math for applications that sign Shield transactions.Use the latest SDK release with this guide. For a complete testnet trade, start with the Developer Quickstart.
This example uses mainnet. Change loadNetwork("mainnet") to loadNetwork("testnet") for testnet. shieldSwapActions({ api: {} }) selects the Shield API host for the client’s network; you do not need to supply its URL.
import { loadNetwork } from "@provablehq/veil-aleo-sdk"import { shieldSwapActions } from "@provablehq/shield-swap-sdk"import { swapFileStore } from "@provablehq/shield-swap-sdk/node"const aleo = await loadNetwork("mainnet")const privateKey = process.env.SHIELD_SWAP_PRIVATE_KEYif (!privateKey) throw new Error("Set SHIELD_SWAP_PRIVATE_KEY before continuing")const { walletClient, publicClient, account } = aleo.createAleoClient({ privateKey })const client = walletClient.extend( shieldSwapActions({ api: {}, blindedIdentities: swapFileStore( `.shield-swap/mainnet/${account.address}/swaps.json`, ), }),)
createAleoClient configures the hosted gateway, record scanner, delegated proving, and FeeMaster payment by default. The default gateway needs no Provable API credentials. Pass useFeeMaster: false when the account should pay its own transaction fees.The default confidential-address store protects concurrent swaps through one client, but it lives in memory and is lost when the process exits. For bots and services, use swapFileStore, an alias of fileBlindedIdentityStore, to retain pending claims across restarts.Use a separate store for each network and account. Change the path when switching this example to testnet, and keep .shield-swap/ out of source control.
Keep private keys, Provable credentials, API tokens, and confidential-address files out of source control.
Pool and token discovery and public market data do not require credentials. Routes, positions, and unclaimed outputs require authentication and acceptance of the current Terms of Use. getBalances reads records and chain state without a DEX API credential.
await client.authenticateShieldSwap()
authenticateShieldSwap() signs a challenge and stores the session on the API client. Long-running services can create an API token once and pass it as shieldSwapActions({ api: { apiToken } }) on later runs. See Authentication.
Token amounts use raw base units and bigint. Apply token decimals only when parsing user input or formatting output. Pool price and fee-growth values use Q128.128 fixed-point representation.For transaction acceptance, call await publicClient.getConfirmedTransaction({ id: transactionId }) and inspect status. This method is not on the extended wallet client by default. See Verify swap settlement to check the swap, claim, and returned records together.
{"docsConfig":{"theme":"palm","$schema":"https://mintlify.com/docs.json","name":"Shield Swap","description":"Build, integrate, and operate Shield Swap.","colors":{"primary":"#35757F","light":"#4EA5B2","dark":"#35757F"},"logo":{"light":"https://mintcdn.com/shield-swap-documentation/yuhbTn5w9Y5dvhe1/images/shield-swap-logo-light.svg?fit=max\u0026auto=format\u0026n=yuhbTn5w9Y5dvhe1\u0026q=85\u0026s=5c8a660da99181df64043783ee6be6e3","dark":"https://mintcdn.com/shield-swap-documentation/yuhbTn5w9Y5dvhe1/images/shield-swap-logo-dark.svg?fit=max\u0026auto=format\u0026n=yuhbTn5w9Y5dvhe1\u0026q=85\u0026s=78a1f6fd40be2837ccb7eb802278a711","href":"/"},"favicon":"https://mintcdn.com/shield-swap-documentation/yuhbTn5w9Y5dvhe1/images/shield-swap-mark.svg?fit=max\u0026auto=format\u0026n=yuhbTn5w9Y5dvhe1\u0026q=85\u0026s=53947f3243d042cc8ec777a786f637a6","appearance":{"default":"dark","strict":false},"background":{"color":{"light":"#F9F9F9","dark":"#050609"}},"navbar":{"primary":{"type":"button","label":"Launch app","href":"https://swap.shield.fi"}},"seo":{"metatags":{"canonical":"https://shield.fi/docs"}},"fonts":{"family":"Geist"},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","codeblocks":{"languages":{"custom":["/languages/leo.tmLanguage.json"]}},"latex":false},"contextual":{"options":["copy","view","claude","chatgpt","download-spec"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"shield-swap-documentation","hasAudioNarration":false,"actualSubdomain":"shield-swap-documentation","customDomains":["shield.fi"],"gitSource":{"type":"github","owner":"provablehq","repo":"shield-swap-documentation","deployBranch":"master","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aede996958fda678bd60f56","clientVersion":"0.0.4124","searchFilterCounts":[{"language":"default","tag":"API Reference","count":52},{"language":"default","tag":"Protocol","count":49},{"language":"default","tag":"Guides","count":20},{"language":"default","tag":"Authentication and API tokens","count":13},{"language":"default","tag":"Pools","count":10},{"language":"default","tag":"Trading reference","count":10},{"language":"default","tag":"Provide liquidity","count":9},{"language":"default","tag":"Referrals","count":8},{"language":"default","tag":"Concepts","count":8},{"language":"default","tag":"Math and accounting","count":8}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"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":"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":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":":root{--shield-black: #000000;--shield-night: #050609;--shield-ink: #e8ebef;--shield-ink-strong: #ffffff;--shield-ink-soft: #c7cdd4;--shield-muted: #858e98;--shield-paper: #f9f9f9;--shield-paper-deep: #f2f2f2;--shield-teal: #4ea5b2;--shield-teal-ink: #35757f;--shield-mint: #c1ffd9;--shield-cyan: #c4ffff;--shield-ground: var(--shield-night);--shield-surface: #07090c;--shield-surface-raised: #0b0e13;--shield-foreground: var(--shield-ink);--shield-accent: var(--shield-teal);--shield-accent-strong: var(--shield-cyan);--shield-accent-ink: var(--shield-black);--shield-line: rgb(232 235 239 / 8%);--shield-line-strong: rgb(232 235 239 / 16%);--shield-display: \"Newsreader\", Georgia, serif;--shield-body: \"Geist\", Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;--shield-mono: \"Geist Mono\", \"SFMono-Regular\", Consolas, monospace;--shield-ease: cubic-bezier(0.16, 1, 0.3, 1);--shield-radius-control: 10px;--shield-radius-menu: 12px;--shield-radius-option: 8px}html:not(.dark){--shield-ground: var(--shield-paper);--shield-surface: #ffffff;--shield-surface-raised: var(--shield-paper-deep);--shield-foreground: var(--shield-black);--shield-muted: #6f6f6f;--shield-accent: var(--shield-teal-ink);--shield-accent-strong: #245b63;--shield-accent-ink: #ffffff;--shield-line: rgb(0 0 0 / 9%);--shield-line-strong: rgb(0 0 0 / 17%)}body,#background-color{background:var(--shield-ground)!important;color:var(--shield-foreground);font-family:var(--shield-body)}::selection{background:var(--shield-cyan);color:var(--shield-black)}a:focus-visible,button:focus-visible,[tabindex]:focus-visible{border-radius:var(--shield-radius-control);outline:2px solid var(--shield-accent-strong)!important;outline-offset:3px}#navbar{border-bottom:1px solid var(--shield-line);background:rgb(5 6 9 / 96%)!important;backdrop-filter:blur(12px)}html:not(.dark) #navbar{background:rgb(249 249 249 / 96%)!important}#navbar a,#navbar button,#sidebar,#table-of-contents,#search-bar-entry,#assistant-entry,#pagination{font-family:var(--shield-body);letter-spacing:-0.005em}#search-bar-entry,#assistant-entry{border-radius:var(--shield-radius-control)!important}body>div[role=\"status\"][aria-live=\"polite\"].fixed.z-999{display:none!important}#footer{display:none!important}.shield-network-control{position:relative;display:flex;align-items:center;z-index:30}.shield-network-trigger{display:inline-flex;min-width:108px;min-height:36px;align-items:center;justify-content:space-between;gap:9px;border:1px solid var(--shield-line-strong);border-radius:var(--shield-radius-control);padding:0 10px;background-color:var(--shield-surface);color:var(--shield-foreground);font-family:var(--shield-mono);font-size:11px;font-weight:500;letter-spacing:0.04em;text-transform:uppercase;cursor:pointer;transition:border-color 140ms ease-out,\n background-color 140ms ease-out,\n color 140ms ease-out}.shield-network-trigger:hover,.shield-network-control.is-open .shield-network-trigger{border-color:var(--shield-accent);background:var(--shield-surface-raised)}.shield-network-status,.shield-network-option-status{width:6px;height:6px;flex:0 0 auto;border-radius:50%;background:var(--shield-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--shield-accent) 12%, transparent)}.shield-network-control[data-network=\"testnet\"] .shield-network-status,.shield-network-option[data-network=\"testnet\"] .shield-network-option-status{background:#e6b35a;box-shadow:0 0 0 3px rgb(230 179 90 / 12%)}.shield-network-current{flex:1;text-align:left}.shield-network-chevron{width:12px;height:12px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.35;opacity:0.62;transition:transform 220ms var(--shield-ease), opacity 140ms ease-out}.shield-network-control.is-open .shield-network-chevron{transform:rotate(180deg);opacity:1}.shield-network-menu{position:absolute;top:calc(100% + 8px);right:0;width:200px;overflow:hidden;border:1px solid var(--shield-line-strong);border-radius:var(--shield-radius-menu);padding:4px;background:var(--shield-surface-raised);box-shadow:0 8px 8px rgb(0 0 0 / 24%);opacity:0;visibility:hidden;transform:translateY(-5px) scale(0.985);transform-origin:top right;pointer-events:none;transition:opacity 150ms ease-out,\n transform 150ms ease-out,\n visibility 0s linear 150ms}.shield-network-control.is-open .shield-network-menu{opacity:1;visibility:visible;transform:translateY(0) scale(1);pointer-events:auto;transition:opacity 220ms var(--shield-ease),\n transform 220ms var(--shield-ease),\n visibility 0s}.shield-network-option{display:flex;width:100%;min-height:48px;align-items:center;gap:10px;border:0;border-radius:var(--shield-radius-option);padding:7px 8px;background:transparent;color:var(--shield-foreground);text-align:left;cursor:pointer;transition:background-color 120ms ease-out}.shield-network-option:hover,.shield-network-option:focus-visible{background:color-mix(in srgb, var(--shield-foreground) 6%, transparent)}.shield-network-option-copy{display:flex;min-width:0;flex:1;flex-direction:column;gap:2px}.shield-network-option-label{font-family:var(--shield-body);font-size:12px;font-weight:600;letter-spacing:-0.01em}.shield-network-option-detail{color:var(--shield-muted);font-family:var(--shield-mono);font-size:9px;letter-spacing:0.04em;text-transform:uppercase}.shield-network-check{width:13px;height:13px;fill:none;stroke:var(--shield-accent-strong);stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5;opacity:0;transform:scale(0.7);transition:opacity 120ms ease-out, transform 180ms var(--shield-ease)}.shield-network-option[aria-selected=\"true\"] .shield-network-check{opacity:1;transform:scale(1)}.shield-network-control-mobile{display:none}@media (max-width: 1023px){.shield-network-control-mobile{display:flex}.shield-network-control-mobile .shield-network-trigger{min-height:32px;min-width:104px;padding-inline:8px;font-size:10px}.shield-network-control-mobile .shield-network-menu{right:auto;left:0;transform-origin:top left}}@media (prefers-reduced-motion: reduce){.shield-network-trigger,.shield-network-chevron,.shield-network-menu,.shield-network-option,.shield-network-check{transition-duration:0.01ms!important}}#sidebar{border-right-color:var(--shield-line)!important}@media (min-width: 1024px){#search-bar-entry{width:min(20vw, 280px)!important;max-width:280px!important}}#topbar-cta-button{align-items:center;min-height:40px;overflow:hidden;border:0!important;border-radius:var(--shield-radius-control)!important;background:var(--shield-ink-strong)!important;box-shadow:none!important;color:var(--shield-black)!important;transition:opacity 180ms ease-out}html:not(.dark) #topbar-cta-button{background:var(--shield-black)!important;color:#ffffff!important}#topbar-cta-button>a{display:flex;align-items:center;min-height:40px;padding:0 16px!important;color:inherit!important;font-family:var(--shield-mono)!important;font-size:11px!important;font-weight:500;line-height:1;letter-spacing:0.04em!important;text-decoration:none!important;text-transform:uppercase}#topbar-cta-button>a>div{margin-right:0!important;color:inherit!important}#topbar-cta-button svg{display:none}@media (hover: hover){#topbar-cta-button:hover{opacity:0.8}}#page-title,#content h1,#content h2{font-family:var(--shield-display);font-weight:400;letter-spacing:-0.035em;text-wrap:balance}#page-title,#content h1{line-height:1}#content h2{margin-top:2.25em;line-height:1.04}#content h3,#content h4{font-family:var(--shield-body);font-weight:600;letter-spacing:-0.02em;text-wrap:balance}#content p,#content li{line-height:1.68;text-wrap:pretty}#content :not(pre)>code{border:1px solid var(--shield-line-strong);border-radius:4px;background:var(--shield-surface-raised);color:var(--shield-accent-strong)}#content table{font-size:0.925rem}#content thead{font-family:var(--shield-mono);font-size:0.75rem;font-weight:500;letter-spacing:0.04em;text-transform:uppercase}.shield-lp-lifecycle{display:block;width:100%;height:auto;color-scheme:light}.dark .shield-lp-lifecycle{color-scheme:dark}.shield-home{width:100vw;min-height:calc(100svh - 113px);margin-inline:calc(50% - 50vw);background:var(--shield-paper);color:var(--shield-black)}.shield-home,.shield-home *,.shield-home *::before,.shield-home *::after{box-sizing:border-box}.shield-home a{color:inherit;text-decoration:none}.shield-home-hero{position:relative;display:flex;align-items:flex-end;min-height:calc(100svh - 113px);padding:clamp(140px, 21vh, 220px) 20px 32px;overflow:hidden;background:radial-gradient(circle at 76% 24%, rgb(193 255 217 / 20%), transparent 27%),\n radial-gradient(circle at 25% 8%, rgb(196 255 255 / 13%), transparent 24%),\n var(--shield-black);color:#ffffff}.shield-home-pattern{position:absolute;inset:-8%;opacity:0.88;background-image:radial-gradient(circle, var(--shield-cyan) 0 1.2px, transparent 1.4px),\n radial-gradient(circle, var(--shield-mint) 0 1px, transparent 1.2px);background-position:0 0, 6px 6px;background-size:12px 12px;mask-image:radial-gradient(ellipse at 74% 32%, black 0 16%, transparent 58%),\n linear-gradient(to bottom, black, transparent 84%);animation:shield-pattern-drift 18s ease-in-out infinite alternate;transform:rotate(-5deg) scale(1.08)}.shield-home-pattern::after{position:absolute;inset:0;background:linear-gradient(115deg, var(--shield-black) 12%, transparent 45%, var(--shield-black) 86%);content:\"\"}.shield-hero-panel{position:relative;width:min(1560px, 100%);margin-inline:auto;padding:clamp(72px, 8vw, 112px) clamp(32px, 7.5vw, 112px) clamp(40px, 4vw, 56px);border-radius:4px;background:var(--shield-black);animation:shield-panel-reveal 720ms var(--shield-ease) both}.shield-hero-rule{position:absolute;top:clamp(36px, 4vw, 56px);right:clamp(32px, 7.5vw, 112px);left:clamp(32px, 7.5vw, 112px);height:1px;background:rgb(255 255 255 / 72%);transform-origin:left;animation:shield-rule-reveal 900ms 100ms var(--shield-ease) both}.shield-home-kicker{font-family:var(--shield-mono);font-size:11px;font-weight:500;line-height:1.3;letter-spacing:0.06em;text-transform:uppercase;display:block;margin:0 0 24px;color:var(--shield-cyan)}.shield-hero-grid{display:grid;grid-template-columns:minmax(0, 1.25fr) minmax(330px, 0.75fr);gap:clamp(56px, 7vw, 112px);align-items:center}#content .shield-home-copy h1{max-width:940px;margin:0;color:#ffffff;font-family:var(--shield-display);font-size:clamp(64px, 8.8vw, 136px);font-weight:400;line-height:0.86;letter-spacing:-0.055em;text-wrap:balance}.shield-home-title-line{display:block;white-space:nowrap}.shield-home-intro{display:block;width:min(100%, 29ch);max-width:none;margin:0;color:#d1d1d1;font-family:var(--shield-display);font-size:clamp(19px, 1.55vw, 24px);font-weight:400;line-height:1.25;letter-spacing:-0.025em}.shield-home-jobs{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));margin-top:clamp(48px, 6vw, 76px);border-top:1px solid rgb(255 255 255 / 20%);border-bottom:1px solid rgb(255 255 255 / 20%)}.shield-job-card{display:flex;flex-direction:column;min-width:0;padding:28px 24px}.shield-job-card+.shield-job-card{border-left:1px solid rgb(255 255 255 / 20%)}#content .shield-job-card h2{margin:0 0 12px;color:#ffffff;font-size:clamp(26px, 2.5vw, 34px);line-height:1.15}#content .shield-job-card p{margin:0 0 20px;color:#d1d1d1;font-size:16px;line-height:1.5}.shield-job-actions{display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px;margin-top:12px}.shield-home-primary{display:inline-flex;align-items:center;justify-content:center;max-width:100%;min-height:64px;padding:16px 20px;border-radius:12px;font-family:var(--shield-mono);font-size:clamp(14px, 1.1vw, 18px);font-weight:700;letter-spacing:0.02em;text-transform:uppercase;line-height:1.4;text-align:center;transition:background-color 180ms ease-out, color 180ms ease-out, transform 180ms var(--shield-ease)}.shield-home-primary{background:#ffffff;color:var(--shield-black)!important}.shield-home a:focus-visible{outline:2px solid var(--shield-cyan);outline-offset:5px}@media (hover: hover){.shield-home-primary:hover{background:var(--shield-cyan);transform:translateY(-2px)}}body:has(.shield-home) .nav-tabs-item[data-active=\"true\"]{color:#a0a2a2!important;text-shadow:none!important}body:has(.shield-home) .nav-tabs-item[data-active=\"true\"]>div{display:none!important}@media (max-width: 980px){.shield-hero-grid{grid-template-columns:1fr;gap:24px}.shield-home-intro{width:min(100%, 48ch)}.shield-home-jobs{grid-template-columns:1fr}.shield-job-card+.shield-job-card{border-left:0;border-top:1px solid rgb(255 255 255 / 20%)}}@media (max-width: 1023px){.shield-home,.shield-home-hero{min-height:calc(100svh - 64px)}}@media (min-width: 981px) and (max-width: 1180px){#content .shield-home-copy h1{font-size:clamp(76px, 8vw, 92px)}}@media (max-width: 720px){.shield-home-hero{padding:112px 10px 16px}.shield-home-pattern{background-position:0 0, 5px 5px;background-size:10px 10px;mask-image:radial-gradient(ellipse at 72% 24%, black 0 12%, transparent 65%)}.shield-hero-panel{padding:68px 22px 28px}.shield-hero-rule{top:34px;right:22px;left:22px}#content .shield-home-copy h1{font-size:clamp(50px, 15.5vw, 76px);line-height:0.9}.shield-home-title-line{white-space:normal}.shield-home-jobs{margin-top:44px}.shield-job-card{padding:24px 0}.shield-home-primary{width:100%}body:has(.shield-home) #assistant-entry{display:none!important}}@keyframes shield-pattern-drift{from{transform:rotate(-5deg) scale(1.08) translate3d(-1%, -1%, 0)}to{transform:rotate(-3deg) scale(1.12) translate3d(1.5%, 1%, 0)}}@keyframes shield-panel-reveal{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:none}}@keyframes shield-rule-reveal{from{transform:scaleX(0)}to{transform:scaleX(1)}}@media (prefers-reduced-motion: reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:0.01ms!important;animation-duration:0.01ms!important;animation-iteration-count:1!important}}@media print{.shield-home{background:#ffffff;color:#000000}.shield-home-pattern{display:none}}.shield-trade-switch{display:inline-flex;gap:0.25rem;max-width:100%;margin-bottom:1.25rem;padding:0.25rem;border:1px solid var(--shield-line);border-radius:var(--shield-radius-control);background:var(--shield-surface)}.shield-trade-switch button{padding:0.5rem 1rem;border-radius:calc(var(--shield-radius-control) - 3px);color:var(--shield-foreground);font:inherit;font-size:0.875rem;font-weight:500;cursor:pointer}.shield-trade-switch button:hover{background:var(--shield-surface-raised)}.shield-trade-switch button[aria-pressed=\"true\"]{background:var(--shield-accent);color:var(--shield-accent-ink)}[data-trade-view] span[data-as=\"p\"]{display:block;margin-block:1.25em}[data-trade-view][hidden],.toc-item[hidden]{display:none!important}.shield-diagram{display:block;width:100%;max-width:560px;height:auto;margin-inline:auto;color-scheme:light}.dark .shield-diagram{color-scheme:dark}"}],"page":{"pagePath":"sdk/typescript-client","slug":"/sdk/typescript-client","pageMetadata":{"title":"Set up the Typescript SDK","description":"Set up the Shield Swap Typescript SDK for chain reads, API access, swaps, and liquidity.","href":"/sdk/typescript-client"},"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: \"Set up the Shield Swap Typescript SDK for chain reads, API access, swaps, and liquidity.\"\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={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._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:[_jsx(_components.code,{children:`@provablehq/shield-swap-sdk`}),` adds typed Shield Swap actions to a Typescript client. Use the extended wallet `,_jsx(_components.code,{children:`client`}),` for Shield Swap reads, writes, and records; `,_jsx(_components.code,{children:`publicClient`}),` for general ledger queries such as transaction acceptance; and `,_jsx(_components.code,{children:`client.api`}),` for indexed REST methods.`]}),`\n`,_jsx(_components.p,{children:`The SDK handles record selection, program imports, swap planning, confidential addresses, and position math for applications that sign Shield transactions.`}),`\n`,_jsxs(_components.p,{children:[`Use the latest SDK release with this guide. For a complete testnet trade, start with the `,_jsx(_components.a,{href:`/trading/quickstart`,children:`Developer Quickstart`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`install`,children:`Install`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pnpm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @provablehq/shield-swap-sdk@latest`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @provablehq/veil-core@latest`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Local-key clients also need the network package, which installs the underlying Provable SDK.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pnpm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @provablehq/veil-aleo-sdk@latest`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`create-a-local-client`,children:`Create a local client`}),`\n`,_jsxs(_components.p,{children:[`This example uses mainnet. Change `,_jsx(_components.code,{children:`loadNetwork(\"mainnet\")`}),` to `,_jsx(_components.code,{children:`loadNetwork(\"testnet\")`}),` for testnet. `,_jsx(_components.code,{children:`shieldSwapActions({ api: {} })`}),` selects the Shield API host for the client’s network; you do not need to supply its URL.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`18`,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:`18`,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:`loadNetwork`}),_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:` \"@provablehq/veil-aleo-sdk\"`})]}),`\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:`shieldSwapActions`}),_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:` \"@provablehq/shield-swap-sdk\"`})]}),`\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:`swapFileStore`}),_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:` \"@provablehq/shield-swap-sdk/node\"`})]}),`\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:` aleo`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` loadNetwork`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"mainnet\"`}),_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:` privateKey`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`SHIELD_SWAP_PRIVATE_KEY`})]}),`\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:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`privateKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`\"Set SHIELD_SWAP_PRIVATE_KEY before continuing\"`}),_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:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`walletClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`publicClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`account`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` aleo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createAleoClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`privateKey`}),_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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` walletClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`extend`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` shieldSwapActions`}),_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:` api:`}),_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:` blindedIdentities:`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` swapFileStore`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `.shield-swap/mainnet/\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`account`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`address`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/swaps.json`\"}),_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`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`createAleoClient`}),` configures the hosted gateway, record scanner, delegated proving, and FeeMaster payment by default. The default gateway needs no Provable API credentials. Pass `,_jsx(_components.code,{children:`useFeeMaster: false`}),` when the account should pay its own transaction fees.`]}),`\n`,_jsxs(_components.p,{children:[`The default confidential-address store protects concurrent swaps through one client, but it lives in memory and is lost when the process exits. For bots and services, use `,_jsx(_components.code,{children:`swapFileStore`}),`, an alias of `,_jsx(_components.code,{children:`fileBlindedIdentityStore`}),`, to retain pending claims across restarts.`]}),`\n`,_jsxs(_components.p,{children:[`Use a separate store for each network and account. Change the path when switching this example to testnet, and keep `,_jsx(_components.code,{children:`.shield-swap/`}),` out of source control.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Keep private keys, Provable credentials, API tokens, and confidential-address files out of source control.`})}),`\n`,_jsx(Heading,{level:`2`,id:`connect-a-wallet`,children:`Connect a wallet`}),`\n`,_jsx(_components.p,{children:`The wallet holds keys and records and proves transactions. Pass Shield Swap’s algorithm grants when connecting, then extend the wallet client.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,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:`15`,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:`createWalletClient`}),_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:` \"@provablehq/veil-core\"`})]}),`\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:`fromWalletAdapter`}),_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:` \"@provablehq/veil-aleo-wallet-adapter\"`})]}),`\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:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` SHIELD_SWAP_ALGORITHM_GRANTS`}),_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:` shieldSwapActions`}),_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:` \"@provablehq/shield-swap-sdk\"`})]}),`\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:` adapter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`connect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`network`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`decryptPermission`}),_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:` algorithmsAllowed:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` SHIELD_SWAP_ALGORITHM_GRANTS`}),_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:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`account`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`transport`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fromWalletAdapter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`adapter`}),_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:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` createWalletClient`}),_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:`transport`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`extend`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` shieldSwapActions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`api:`}),_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`,_jsx(_components.p,{children:`A connected wallet supplies record requests to transaction actions. The local-key client can find its own records through the configured scanner.`}),`\n`,_jsx(Heading,{level:`2`,id:`authenticate-the-api`,children:`Authenticate the API`}),`\n`,_jsxs(_components.p,{children:[`Pool and token discovery and public market data do not require credentials. Routes, positions, and unclaimed outputs require authentication and acceptance of the current Terms of Use. `,_jsx(_components.code,{children:`getBalances`}),` reads records and chain state without a DEX API credential.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_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:`authenticateShieldSwap`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`authenticateShieldSwap()`}),` signs a challenge and stores the session on the API client. Long-running services can create an API token once and pass it as `,_jsx(_components.code,{children:`shieldSwapActions({ api: { apiToken } })`}),` on later runs. See `,_jsx(_components.a,{href:`/rest/authentication`,children:`Authentication`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`read-state`,children:`Read state`}),`\n`,_jsx(_components.p,{children:`Use the API to discover markets and metadata. Before signing, read the pool state needed for execution from chain.`}),`\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:` pools`}),_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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`api`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getPools`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`limit:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 50`}),_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:` balances`}),_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:`getBalances`}),_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:` market`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` pools`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_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:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`market`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`\"no pools are available\"`}),_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:` poolKey`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` market`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`key`})]}),`\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:` pool`}),_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:`getPool`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`poolKey`}),_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:` slot`}),_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:`getSlot`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`poolKey`}),_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:` controls`}),_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:`getTradeControls`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`poolKey`}),_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:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pool`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`slot`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`controls`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`tradeable`}),_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:`\"pool is unavailable\"`}),_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:[`Token amounts use raw base units and `,_jsx(_components.code,{children:`bigint`}),`. Apply token decimals only when parsing user input or formatting output. Pool price and fee-growth values use Q128.128 fixed-point representation.`]}),`\n`,_jsxs(_components.p,{children:[`For transaction acceptance, call `,_jsx(_components.code,{children:`await publicClient.getConfirmedTransaction({ id: transactionId })`}),` and inspect `,_jsx(_components.code,{children:`status`}),`. This method is not on the extended wallet `,_jsx(_components.code,{children:`client`}),` by default. See `,_jsx(_components.a,{href:`/trading/verify-settlement`,children:`Verify swap settlement`}),` to check the swap, claim, and returned records together.`]}),`\n`,_jsx(Heading,{level:`2`,id:`resolve-program-imports`,children:`Resolve program imports`}),`\n`,_jsx(_components.p,{children:`Shield Swap calls token programs dynamically. Write actions need the source for each token program plus the AMM’s declared imports.`}),`\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:` token0`}),_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:`tokenData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pool`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token0`}),_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:` token1`}),_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:`tokenData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pool`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token1`}),_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:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ammTokenProgram`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ammTokenProgram`}),_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:`\"pool token program is missing\"`}),_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:` imports`}),_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:`resolveDexImports`}),_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:` tokenPrograms:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ammTokenProgram`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ammTokenProgram`}),_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:[`Resolve imports once for a route or pool and reuse the map. Continue with `,_jsx(_components.a,{href:`/sdk/swaps`,children:`SDK swaps`}),` or `,_jsx(_components.a,{href:`/liquidity/minting-a-position`,children:`Minting a position`}),`. The `,_jsx(_components.a,{href:`https://github.com/ProvableHQ/veil/tree/main/packages/shield-swap`,children:`package source and examples`}),` document the full SDK.`]})]})}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":{"codeStyling":{"languages":{"custom":["/languages/leo.tmLanguage.json"]}},"config":{},"pageMetadata":{"title":"Set up the Typescript SDK","description":"Set up the Shield Swap Typescript SDK for chain reads, API access, swaps, and liquidity.","href":"/sdk/typescript-client"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Install","slug":"install","depth":2,"children":[]},{"title":"Create a local client","slug":"create-a-local-client","depth":2,"children":[]},{"title":"Connect a wallet","slug":"connect-a-wallet","depth":2,"children":[]},{"title":"Authenticate the API","slug":"authenticate-the-api","depth":2,"children":[]},{"title":"Read state","slug":"read-state","depth":2,"children":[]},{"title":"Resolve program imports","slug":"resolve-program-imports","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/shield-swap-documentation/2f224b6c4f232e34/vercel-analytics.js","/docs/_mintlify/custom/shield-swap-documentation/66280dd8b1311154/shield-branding.js","/docs/_mintlify/custom/shield-swap-documentation/7495fa2e3a6ae8d6/shield-network.js","/docs/_mintlify/custom/shield-swap-documentation/e16b653cc5308ba0/shield-routing.js","/docs/_mintlify/custom/shield-swap-documentation/c59efd306b93e276/shield-trade-views.js"],"subdomain":"shield-swap-documentation","siteName":"Shield Swap","title":"Set up the Typescript SDK - Shield Swap","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-06T06:41:38.211Z","originalFileLocation":"sdk/typescript-client.md"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;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=\"dark\"}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=\"Set up the Shield Swap Typescript SDK for chain reads, API access, swaps, and liquidity.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Shield Swap\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/shield-swap-documentation/q1nRzjc_sWJWHkq4/_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=\"/docs/mintlify-assets/_mintlify/favicons/shield-swap-documentation/q1nRzjc_sWJWHkq4/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/shield-swap-documentation/q1nRzjc_sWJWHkq4/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/shield-swap-documentation/q1nRzjc_sWJWHkq4/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/shield-swap-documentation/q1nRzjc_sWJWHkq4/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/shield-swap-documentation/q1nRzjc_sWJWHkq4/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/shield-swap-documentation/q1nRzjc_sWJWHkq4/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/shield-swap-documentation/q1nRzjc_sWJWHkq4/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/shield-swap-documentation/q1nRzjc_sWJWHkq4/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Set up the Typescript SDK - Shield Swap\">\u003cmeta data-mint-head property=\"og:description\" content=\"Set up the Shield Swap Typescript SDK for chain reads, API access, swaps, and liquidity.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Shield Swap\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://shield.fi/docs/sdk/typescript-client\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://shield-swap-documentation.mintlify.site/docs/_mintlify/api/og/v2?division=Trading+reference\u0026amp;title=Set+up+the+Typescript+SDK\u0026amp;description=Set+up+the+Shield+Swap+Typescript+SDK+for+chain+reads%2C+API+access%2C+swaps%2C+and+liquidity.\u0026amp;theme=fac3b326f1419252128e7e6d\u0026amp;signature=393096a4ad6c59ff06f346bdbed80c4eca87ca831bbbec9953c35be28506d760\">\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=\"Set up the Typescript SDK - Shield Swap\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Set up the Shield Swap Typescript SDK for chain reads, API access, swaps, and liquidity.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://shield-swap-documentation.mintlify.site/docs/_mintlify/api/og/v2?division=Trading+reference\u0026amp;title=Set+up+the+Typescript+SDK\u0026amp;description=Set+up+the+Shield+Swap+Typescript+SDK+for+chain+reads%2C+API+access%2C+swaps%2C+and+liquidity.\u0026amp;theme=fac3b326f1419252128e7e6d\u0026amp;signature=393096a4ad6c59ff06f346bdbed80c4eca87ca831bbbec9953c35be28506d760\">\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=\"/docs/mintlify-assets/_mintlify/favicons/shield-swap-documentation/q1nRzjc_sWJWHkq4/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Shield Swap\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#35757F\">\u003clink data-mint-head rel=\"canonical\" href=\"https://shield.fi/docs/sdk/typescript-client\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/sdk/typescript-client.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://shield.fi/#organization\",\"name\":\"Shield Swap\",\"url\":\"https://shield.fi\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/shield-swap-documentation/yuhbTn5w9Y5dvhe1/images/shield-swap-logo-light.svg?fit=max\u0026auto=format\u0026n=yuhbTn5w9Y5dvhe1\u0026q=85\u0026s=5c8a660da99181df64043783ee6be6e3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://shield.fi/docs#website\",\"name\":\"Shield Swap\",\"url\":\"https://shield.fi/docs\",\"publisher\":{\"@id\":\"https://shield.fi/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://shield.fi/docs/sdk/typescript-client#webpage\",\"url\":\"https://shield.fi/docs/sdk/typescript-client\",\"name\":\"Set up the Typescript SDK\",\"description\":\"Set up the Shield Swap Typescript SDK for chain reads, API access, swaps, and liquidity.\",\"dateModified\":\"2026-11-06T06:41:38.211Z\",\"isPartOf\":{\"@id\":\"https://shield.fi/docs#website\"},\"breadcrumb\":{\"@id\":\"https://shield.fi/docs/sdk/typescript-client#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://shield.fi/docs/sdk/typescript-client#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Trading reference\",\"item\":\"https://shield.fi/docs/trading/verify-settlement\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Set up the Typescript SDK\",\"item\":\"https://shield.fi/docs/sdk/typescript-client\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://shield.fi/docs/sdk/typescript-client#article\",\"headline\":\"Set up the Typescript SDK\",\"name\":\"Set up the Typescript SDK\",\"description\":\"Set up the Shield Swap Typescript SDK for chain reads, API access, swaps, and liquidity.\",\"url\":\"https://shield.fi/docs/sdk/typescript-client\",\"mainEntityOfPage\":{\"@id\":\"https://shield.fi/docs/sdk/typescript-client#webpage\"},\"dateModified\":\"2026-11-06T06:41:38.211Z\",\"publisher\":{\"@id\":\"https://shield.fi/#organization\"},\"isPartOf\":{\"@id\":\"https://shield.fi/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Shield Swap\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Shield Swap\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/sdk/typescript-client.md","siteName":"Shield Swap","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/start/getting-started"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/rest/overview"}]},{"tab":"Protocol","groups":[{"group":"Understand Shield Swap","pages":[{"title":"Protocol overview","href":"/start/overview"},{"title":"Reading paths","href":"/start/audiences"},{"title":"Protocol boundaries","href":"/start/protocol-boundaries"},{"title":"Architecture","href":"/developers/architecture"}]},{"group":"Trading reference","pages":[{"title":"Verify swap settlement","description":"Check transaction acceptance, pending output, and the exact token record returned by a swap claim.","href":"/trading/verify-settlement"},{"title":"Set up the Typescript SDK","href":"/sdk/typescript-client"},{"title":"Swap with the Typescript SDK","description":"Plan, submit, claim, and recover private swaps with the Typescript SDK.","href":"/sdk/swaps"},{"title":"Failures and recovery","href":"/trading/failures-and-recovery"},{"title":"Trader workflow","href":"/trading/trader-workflow"},{"title":"Preparing token records","href":"/trading/preparing-token-records"},{"title":"Single-hop swaps","href":"/trading/single-hop-swaps"},{"title":"Price limits, slippage, and deadlines","href":"/trading/price-limits-slippage-deadlines"},{"title":"Output claims and refunds","href":"/trading/output-claims-and-refunds"},{"title":"Multi-hop swaps","href":"/trading/multi-hop-swaps"}]},{"group":"Concepts","pages":[{"title":"Concentrated liquidity","href":"/concepts/concentrated-liquidity"},{"title":"Pools and identifiers","href":"/concepts/pools-and-keys"},{"title":"Price, ticks, and square-root price","href":"/concepts/price-ticks-and-sqrt-price"},{"title":"Initialized-tick index","href":"/concepts/initialized-tick-index"},{"title":"Positions and ownership records","href":"/concepts/positions-and-nfts"},{"title":"Native token amounts","href":"/concepts/token-amount-normalization"},{"title":"Swap and claim lifecycle","href":"/concepts/swap-and-claim-lifecycle"},{"title":"Trading fees and protocol share","href":"/concepts/fees-and-protocol-share"}]},{"group":"Data and confidentiality","pages":[{"title":"Confidentiality model","href":"/confidentiality/model"},{"title":"Public data","href":"/confidentiality/public-data"},{"title":"Confidential data","href":"/confidentiality/confidential-data"},{"title":"Confidential addresses","href":"/confidentiality/confidential-addresses"},{"title":"Caller and signer","href":"/confidentiality/caller-and-signer"},{"title":"Compliance records","href":"/confidentiality/compliance-records"},{"title":"Compliance controls","href":"/confidentiality/regulator-and-compliance-review"}]},{"group":"Security and controls","pages":[{"title":"Security model","href":"/security/security-model"},{"title":"Trust and key boundaries","href":"/security/trust-and-key-boundaries"},{"title":"Confidential data limitations","href":"/security/confidential-data-limitations"},{"title":"Administrative control risks","href":"/security/admin-control-risks"}]},{"group":"Math and accounting","pages":[{"title":"Fixed-point conventions","href":"/math/fixed-point-conventions"},{"title":"Tick and price conversion","href":"/math/tick-price-conversion"},{"title":"Liquidity formulas","href":"/math/liquidity-formulas"},{"title":"Swap step","href":"/math/swap-step"},{"title":"Exact-limit tick crossing","href":"/math/exact-limit-tick-crossing"},{"title":"Zero-effective-input guard","href":"/math/zero-input-guard"},{"title":"Q128.128 fee growth","href":"/math/q128-fee-growth"},{"title":"Rounding, overflow, and invariants","href":"/math/rounding-overflow-and-invariants"}]},{"group":"Program reference","pages":[{"title":"Record reference","href":"/reference/records"},{"title":"Struct reference","href":"/reference/structs"},{"title":"Mapping reference","href":"/reference/mappings"},{"title":"Entry-point signatures","href":"/reference/entrypoint-signatures"},{"title":"Constants and limits","href":"/reference/constants-and-limits"},{"title":"Error and rejection catalog","href":"/reference/error-and-rejection-catalog"},{"title":"Glossary","href":"/reference/glossary"},{"title":"External references","href":"/reference/external-references"}]}]}]},"basePath":"","title":"Set up the Typescript SDK - Shield Swap","buildId":"dpl_FGqRJUoJWfds4SqdfFGJ2v1vVNSs","deploymentId":"dpl_FGqRJUoJWfds4SqdfFGJ2v1vVNSs","dynamics":[],"chunks":[]}