Reveal encrypted values locally for UI display using ACPs
Use decryptForView to reveal a confidential (encrypted) value locally in your app so you can display it in the UI.Unlike decryptForTx, this flow does not return an onchain-verifiable signature, and it is not meant to be published onchain.
Read the encrypted handle (ctHash) from your contract.
Ensure you have an ACP that authorizes decryption of that value.
Call decryptForView(ctHash, utype).execute() to get the plaintext.
decryptForView always decrypts using an ACP (there is no .withoutACP() mode). If your protocol intends for the plaintext to become publicly visible onchain, use decryptForTx instead.
Know the encrypted handle (ctHash) and the encrypted type (utype).
Have a ACP available for the connected chainId + account.
Getting ctHash: In most apps, ctHash comes from reading a stored encrypted value, an event arg, or a return value from a view call.
Providing utype: utype must match the ciphertext’s underlying FHE type. The SDK uses it to convert the decrypted bigint into a convenient JS type.Supported utypes:
FheTypes.Bool to returns a boolean
FheTypes.Uint160 (address) to returns a checksummed 0x... string
FheTypes.Uint8 | Uint16 | Uint32 | Uint64 | Uint128 to returns a bigint
If you don’t have an ACP yet, create one once after connecting:
await client.connect(publicClient, walletClient);// Creates an ACP if needed, stores it, and selects it as the active ACP.await client.acp.getOrCreateSelfACP();
Register a callback that fires once per poll attempt while decryptForView waits for Teecryptor to return the sealed plaintext. Useful for surfacing decrypt progress in a UI.
Configures how long decryptForView keeps retrying when Teecryptor’s submit endpoint responds with 404 Not Found before a requestId is available. This typically happens on slower backends where the ciphertext isn’t visible yet at submit time. Defaults to 10_000 ms.
const plaintext = await client .decryptForView(ctHash, FheTypes.Uint32) .set404RetryTimeout(20_000) // give a slower backend more time .execute();
Pass 0 to disable submit-time retries (404 becomes a hard failure). Submit retries share the same overall timeout budget as status polling.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Fhenix Documentation","description":"Documentation for Fhenix products: CoFHE and the Wallet Module.","colors":{"primary":"#0AD9DC","light":"#5FE8EA","dark":"#089EA1"},"logo":{"light":"https://mintcdn.com/fhenix/QsDx0SV0x2gd-xtZ/logo/light.svg?fit=max\u0026auto=format\u0026n=QsDx0SV0x2gd-xtZ\u0026q=85\u0026s=305de5e4f0ced7831f511f54c3836db2","dark":"https://mintcdn.com/fhenix/QsDx0SV0x2gd-xtZ/logo/dark.svg?fit=max\u0026auto=format\u0026n=QsDx0SV0x2gd-xtZ\u0026q=85\u0026s=85c3ae8ba2fc56ae4f71b99ff75cfefe"},"favicon":"https://mintcdn.com/fhenix/QsDx0SV0x2gd-xtZ/favicon.svg?fit=max\u0026auto=format\u0026n=QsDx0SV0x2gd-xtZ\u0026q=85\u0026s=1d44b00f5eeec228c407208538172b90","navbar":{"links":[{"icon":"github","href":"https://github.com/fhenixprotocol/","label":"Github"}],"primary":{"type":"button","label":"support","href":"https://t.me/+OEO4CItQYh8xYzNh"}},"footer":{"socials":{"x":"https://x.com/fhenix","github":"https://github.com/fhenixprotocol","discord":"https://discord.com/invite/FuVgxrvJMY"}},"seo":{"metatags":{"og:site_name":"Fhenix Documentation","og:type":"website","twitter:card":"summary","twitter:site":"@fhenix"}},"integrations":{"ga4":{"measurementId":"G-NKHXME4286"}},"contextual":{"options":["copy","chatgpt","claude","cursor"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"fhenix","hasAudioNarration":false,"actualSubdomain":"fhenix","customDomains":["cofhe-docs.fhenix.zone","docs.fhenix.io"],"gitSource":{"type":"github","owner":"fhenixprotocol","repo":"fhenix-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae36a4f878abd4f8baebabe","collectionId":"6fea768d-61a0-4383-aa70-4b1aea5b7f81","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae36a4f878abd4f8baebabe"},"feedback":{"thumbs":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae36a4f878abd4f8baebabe","clientVersion":"0.0.4054","searchFilterCounts":[{"language":"default","tag":"CoFHE","count":106},{"language":"default","tag":"FHE library","count":43},{"language":"default","tag":"Client SDK","count":36},{"language":"default","tag":"Wallet Module","count":18},{"language":"default","tag":"Reference","count":15},{"language":"default","tag":"Deep Dive","count":15},{"language":"default","tag":"Confidential Contracts","count":15},{"language":"default","tag":"Introduction","count":13},{"language":"default","tag":"Core Concepts","count":12},{"language":"default","tag":"Use the wallet","count":12}]},"assistantConfig":{"enableAskAiButton":true,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","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":"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":"llms-txt-v2","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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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":"sso-setup-deadline-banner","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}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"cofhe/client-sdk/guides/decrypt-to-view","slug":"/cofhe/client-sdk/guides/decrypt-to-view","pageMetadata":{"title":"Decrypt to View","description":"Reveal encrypted values locally for UI display using ACPs","href":"/cofhe/client-sdk/guides/decrypt-to-view"},"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: \"Reveal encrypted values locally for UI display using ACPs\"\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`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Note,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`decryptForView`}),` to reveal a confidential (encrypted) value locally in your app so you can display it in the UI.`]}),`\n`,_jsxs(_components.p,{children:[`Unlike `,_jsx(_components.a,{href:`/cofhe/client-sdk/guides/decrypt-to-tx`,children:_jsx(_components.code,{children:`decryptForTx`})}),`, this flow does `,_jsx(_components.strong,{children:`not`}),` return an onchain-verifiable signature, and it is `,_jsx(_components.strong,{children:`not`}),` meant to be published onchain.`]}),`\n`,_jsx(Heading,{level:`2`,id:`flow`,children:`Flow`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Read the encrypted handle (`,_jsx(_components.code,{children:`ctHash`}),`) from your contract.`]}),`\n`,_jsx(_components.li,{children:`Ensure you have an ACP that authorizes decryption of that value.`}),`\n`,_jsxs(_components.li,{children:[`Call `,_jsx(_components.code,{children:`decryptForView(ctHash, utype).execute()`}),` to get the plaintext.`]}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`decryptForView`}),` always decrypts using an ACP (there is no `,_jsx(_components.code,{children:`.withoutACP()`}),` mode). If your protocol intends for the plaintext to become publicly visible onchain, use `,_jsx(_components.a,{href:`/cofhe/client-sdk/guides/decrypt-to-tx`,children:_jsx(_components.code,{children:`decryptForTx`})}),` instead.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/cofhe/client-sdk/guides/client-setup`,children:`Create and connect a client`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Know the encrypted handle (`,_jsx(_components.code,{children:`ctHash`}),`) and the encrypted type (`,_jsx(_components.code,{children:`utype`}),`).`]}),`\n`,_jsxs(_components.li,{children:[`Have a `,_jsx(_components.a,{href:`/cofhe/client-sdk/guides/acps`,children:`ACP`}),` available for the connected `,_jsx(_components.code,{children:`chainId + account`}),`.`]}),`\n`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[`Getting `,_jsx(_components.code,{children:`ctHash`})]}),`: In most apps, `,_jsx(_components.code,{children:`ctHash`}),` comes from reading a stored encrypted value, an event arg, or a return value from a `,_jsx(_components.code,{children:`view`}),` call.`]})}),`\n`,_jsxs(Tip,{children:[_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[`Providing `,_jsx(_components.code,{children:`utype`})]}),`: `,_jsx(_components.code,{children:`utype`}),` must match the ciphertext’s underlying FHE type. The SDK uses it to convert the decrypted `,_jsx(_components.code,{children:`bigint`}),` into a convenient JS type.`]}),_jsxs(_components.p,{children:[`Supported `,_jsx(_components.code,{children:`utype`}),`s:`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`FheTypes.Bool`}),` to returns a `,_jsx(_components.code,{children:`boolean`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`FheTypes.Uint160`}),` (address) to returns a checksummed `,_jsx(_components.code,{children:`0x...`}),` string`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`FheTypes.Uint8 | Uint16 | Uint32 | Uint64 | Uint128`}),` to returns a `,_jsx(_components.code,{children:`bigint`})]}),`\n`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`acp-setup`,children:`ACP setup`}),`\n`,_jsx(_components.p,{children:`If you don’t have an ACP yet, create one once after connecting:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,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:`4`,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:`connect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`publicClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--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:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Creates an ACP if needed, stores it, and selects it as the active ACP.`})}),`\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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`acp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getOrCreateSelfACP`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`decrypt-for-ui`,children:`Decrypt for UI`}),`\n`,_jsx(_components.p,{children:`Choose the pattern that matches how your app manages ACPs:`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Active ACP`,numberOfLines:`6`,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:`6`,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:`connect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`publicClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--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:`);`})]}),`\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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`acp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getOrCreateSelfACP`}),_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:` plaintext`}),_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`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`decryptForView`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctHash`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`FheTypes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Uint32`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`execute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`ACP object`,numberOfLines:`6`,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:`6`,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:` acp`}),_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:`acp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getOrCreateSelfACP`}),_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:` plaintext`}),_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`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`decryptForView`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctHash`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`FheTypes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Uint64`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`withACP`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`acp`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`execute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`ACP hash`,numberOfLines:`4`,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:`4`,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:` plaintext`}),_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`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`decryptForView`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctHash`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`FheTypes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Uint8`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`withACP`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`acpHash`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`execute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})})]}),`\n`,_jsxs(Heading,{level:`2`,id:`what-decryptforview-returns`,children:[`What `,_jsx(_components.code,{children:`decryptForView`}),` returns`]}),`\n`,_jsxs(_components.p,{children:[`Running `,_jsx(_components.code,{children:`.execute()`}),` resolves to a scalar JS value:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Integer utypes (`,_jsx(_components.code,{children:`Uint8`}),`, `,_jsx(_components.code,{children:`Uint16`}),`, `,_jsx(_components.code,{children:`Uint32`}),`, `,_jsx(_components.code,{children:`Uint64`}),`, `,_jsx(_components.code,{children:`Uint128`}),`): a `,_jsx(_components.code,{children:`bigint`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`FheTypes.Bool`}),`: a `,_jsx(_components.code,{children:`boolean`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`FheTypes.Uint160`}),` (address): a checksummed `,_jsx(_components.code,{children:`0x...`}),` address string`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`builder-api`,children:`Builder API`}),`\n`,_jsxs(Heading,{level:`3`,id:`execute-required-call-last`,children:[_jsx(_components.code,{children:`.execute()`}),` (required, call last)`]}),`\n`,_jsx(_components.p,{children:`Runs the decryption and returns a UI-friendly scalar value.`}),`\n`,_jsxs(Heading,{level:`3`,id:`withacp-optional`,children:[_jsx(_components.code,{children:`.withACP(...)`}),` (optional)`]}),`\n`,_jsx(_components.p,{children:`Select which ACP to use:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`.withACP()`}),`: uses the active ACP`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`.withACP(acpHash)`}),`: fetches a stored ACP by hash`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`.withACP(acp)`}),`: uses the provided ACP object`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`If you don’t call `,_jsx(_components.code,{children:`.withACP(...)`}),`, the active ACP is used by default.`]}),`\n`,_jsxs(Heading,{level:`3`,id:`setaccount-address-optional`,children:[_jsx(_components.code,{children:`.setAccount(address)`}),` (optional)`]}),`\n`,_jsx(_components.p,{children:`Overrides the account used to resolve the active/stored ACP.`}),`\n`,_jsxs(Heading,{level:`3`,id:`setchainid-chainid-optional`,children:[_jsx(_components.code,{children:`.setChainId(chainId)`}),` (optional)`]}),`\n`,_jsxs(_components.p,{children:[`Overrides the chain used to resolve the `,_jsx(_components.a,{href:`/cofhe/deep-dive/cofhe-components/teecryptor`,children:`Teecryptor`}),` URL and ACPs.`]}),`\n`,_jsxs(Heading,{level:`3`,id:`onpoll-callback-optional`,children:[_jsx(_components.code,{children:`.onPoll(callback)`}),` (optional)`]}),`\n`,_jsxs(_components.p,{children:[`Register a callback that fires once per poll attempt while `,_jsx(_components.code,{children:`decryptForView`}),` waits for Teecryptor to return the sealed plaintext. Useful for surfacing decrypt progress in a UI.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,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:`6`,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:` plaintext`}),_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`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`decryptForView`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctHash`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`FheTypes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Uint64`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`onPoll`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(({ `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`operation`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`requestId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`attemptIndex`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`elapsedMs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`intervalMs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`timeoutMs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},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:` 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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`[\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`operation`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`] attempt `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`attemptIndex`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` after `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`elapsedMs`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ms (next in `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`intervalMs`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ms, budget `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`timeoutMs`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"ms)`\"}),_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\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`execute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The callback receives:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`operation`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`'decrypt' | 'sealoutput'`})}),_jsxs(_components.td,{children:[`Which decryption flow is polling. For `,_jsx(_components.code,{children:`decryptForView`}),` this is `,_jsx(_components.code,{children:`'sealoutput'`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`requestId`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsxs(_components.td,{children:[`The Teecryptor request id. `,_jsx(_components.strong,{children:`May be the empty string`}),` during submit-time retries, see `,_jsx(_components.code,{children:`.set404RetryTimeout(...)`}),` below.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`attemptIndex`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`number`})}),_jsx(_components.td,{children:`Zero-based poll attempt counter.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`elapsedMs`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`number`})}),_jsx(_components.td,{children:`Time since the first submit attempt.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`intervalMs`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`number`})}),_jsx(_components.td,{children:`Delay until the next poll.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`timeoutMs`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`number`})}),_jsx(_components.td,{children:`Overall budget shared by submit-retries and status-polling.`})]})]})]}),`\n`,_jsxs(Heading,{level:`3`,id:`set404retrytimeout-timeoutms-optional`,children:[_jsx(_components.code,{children:`.set404RetryTimeout(timeoutMs)`}),` (optional)`]}),`\n`,_jsxs(_components.p,{children:[`Configures how long `,_jsx(_components.code,{children:`decryptForView`}),` keeps retrying when Teecryptor’s submit endpoint responds with `,_jsx(_components.code,{children:`404 Not Found`}),` before a `,_jsx(_components.code,{children:`requestId`}),` is available. This typically happens on slower backends where the ciphertext isn’t visible yet at submit time. Defaults to `,_jsx(_components.code,{children:`10_000`}),` ms.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,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:`4`,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:` plaintext`}),_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`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`decryptForView`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctHash`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`FheTypes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Uint32`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`set404RetryTimeout`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`20_000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// give a slower backend more time`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_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`]})})}),`\n`,_jsxs(_components.p,{children:[`Pass `,_jsx(_components.code,{children:`0`}),` to disable submit-time retries (`,_jsx(_components.code,{children:`404`}),` becomes a hard failure). Submit retries share the same overall timeout budget as status polling.`]}),`\n`,_jsx(Heading,{level:`2`,id:`common-ui-patterns`,children:`Common UI patterns`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Format bigint for display`,numberOfLines:`4`,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:`4`,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:`formatUnits`}),_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:` decimals`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 6`}),_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:` display`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` formatUnits`}),_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\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`decimals`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Bigint → number (range-check)`,numberOfLines:`2`,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:`2`,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:` MAX_SAFE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` BigInt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Number`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.MAX_SAFE_INTEGER);`})]}),`\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:` asNumber`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` amount`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` MAX_SAFE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ?`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Number`}),_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\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` undefined`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Booleans \u0026 addresses`,numberOfLines:`2`,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:`2`,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:` statusLabel`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` decryptedIsAllowed`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ?`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Allowed'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Not allowed'`}),_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:` shortOwner`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`decryptedOwner`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`slice`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`6`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_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:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`decryptedOwner`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`slice`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_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`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`common-pitfalls`,children:`Common pitfalls`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Missing ACP`}),`: `,_jsx(_components.code,{children:`decryptForView`}),` will fail if there is no active ACP for the current `,_jsx(_components.code,{children:`chainId + account`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Wrong `,_jsx(_components.code,{children:`utype`})]}),`: you must pass the correct FHE type for the ciphertext.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Wrong chain/account`}),`: ACPs are scoped to `,_jsx(_components.code,{children:`chainId + account`}),`. If the user switches wallets or networks, create/select the correct ACP.`]}),`\n`]})]})}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":"Decrypt to View","description":"Reveal encrypted values locally for UI display using ACPs","href":"/cofhe/client-sdk/guides/decrypt-to-view"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Flow","slug":"flow","depth":2,"children":[]},{"title":"Prerequisites","slug":"prerequisites","depth":2,"children":[]},{"title":"ACP setup","slug":"acp-setup","depth":2,"children":[]},{"title":"Decrypt for UI","slug":"decrypt-for-ui","depth":2,"children":[]},{"title":"What decryptForView returns","slug":"what-decryptforview-returns","depth":2,"children":[]},{"title":"Builder API","slug":"builder-api","depth":2,"children":[{"title":".execute() (required, call last)","slug":"execute-required-call-last","depth":3,"children":[]},{"title":".withACP(...) (optional)","slug":"withacp-optional","depth":3,"children":[]},{"title":".setAccount(address) (optional)","slug":"setaccount-address-optional","depth":3,"children":[]},{"title":".setChainId(chainId) (optional)","slug":"setchainid-chainid-optional","depth":3,"children":[]},{"title":".onPoll(callback) (optional)","slug":"onpoll-callback-optional","depth":3,"children":[]},{"title":".set404RetryTimeout(timeoutMs) (optional)","slug":"set404retrytimeout-timeoutms-optional","depth":3,"children":[]}]},{"title":"Common UI patterns","slug":"common-ui-patterns","depth":2,"children":[]},{"title":"Common pitfalls","slug":"common-pitfalls","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"fhenix","siteName":"Fhenix Documentation","title":"Decrypt to View - Fhenix Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-14T10:26:46.331Z","originalFileLocation":"cofhe/client-sdk/guides/decrypt-to-view.mdx"},"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=\"system\"}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=\"Reveal encrypted values locally for UI display using ACPs\">\u003cmeta data-mint-head name=\"application-name\" content=\"Fhenix Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_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/fhenix/6My8uy_iS97zuzuy/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Decrypt to View - Fhenix Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Reveal encrypted values locally for UI display using ACPs\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Fhenix Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://cofhe-docs.fhenix.zone/cofhe/client-sdk/guides/decrypt-to-view\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://fhenix.mintlify.app/_mintlify/api/og/v2?division=Guides\u0026amp;title=Decrypt+to+View\u0026amp;description=Reveal+encrypted+values+locally+for+UI+display+using+ACPs\u0026amp;theme=b7e140db94e370d559b9133f\u0026amp;signature=37f06cdda639187b8994ff85f207f5928c6d9e201dd1f289140bf978cb39060a\">\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=\"Decrypt to View - Fhenix Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Reveal encrypted values locally for UI display using ACPs\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://fhenix.mintlify.app/_mintlify/api/og/v2?division=Guides\u0026amp;title=Decrypt+to+View\u0026amp;description=Reveal+encrypted+values+locally+for+UI+display+using+ACPs\u0026amp;theme=b7e140db94e370d559b9133f\u0026amp;signature=37f06cdda639187b8994ff85f207f5928c6d9e201dd1f289140bf978cb39060a\">\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/fhenix/6My8uy_iS97zuzuy/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Fhenix Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0AD9DC\">\u003clink data-mint-head rel=\"canonical\" href=\"https://cofhe-docs.fhenix.zone/cofhe/client-sdk/guides/decrypt-to-view\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cofhe/client-sdk/guides/decrypt-to-view.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://cofhe-docs.fhenix.zone/#organization\",\"name\":\"Fhenix Documentation\",\"url\":\"https://cofhe-docs.fhenix.zone\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/fhenix/QsDx0SV0x2gd-xtZ/logo/light.svg?fit=max\u0026auto=format\u0026n=QsDx0SV0x2gd-xtZ\u0026q=85\u0026s=305de5e4f0ced7831f511f54c3836db2\"}},{\"@type\":\"WebSite\",\"@id\":\"https://cofhe-docs.fhenix.zone#website\",\"name\":\"Fhenix Documentation\",\"url\":\"https://cofhe-docs.fhenix.zone\",\"publisher\":{\"@id\":\"https://cofhe-docs.fhenix.zone/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://cofhe-docs.fhenix.zone/cofhe/client-sdk/guides/decrypt-to-view#webpage\",\"url\":\"https://cofhe-docs.fhenix.zone/cofhe/client-sdk/guides/decrypt-to-view\",\"name\":\"Decrypt to View\",\"description\":\"Reveal encrypted values locally for UI display using ACPs\",\"dateModified\":\"2026-10-14T10:26:46.331Z\",\"isPartOf\":{\"@id\":\"https://cofhe-docs.fhenix.zone#website\"},\"breadcrumb\":{\"@id\":\"https://cofhe-docs.fhenix.zone/cofhe/client-sdk/guides/decrypt-to-view#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://cofhe-docs.fhenix.zone/cofhe/client-sdk/guides/decrypt-to-view#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://cofhe-docs.fhenix.zone/cofhe/client-sdk/guides/client-setup\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Decrypt to View\",\"item\":\"https://cofhe-docs.fhenix.zone/cofhe/client-sdk/guides/decrypt-to-view\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://cofhe-docs.fhenix.zone/cofhe/client-sdk/guides/decrypt-to-view#article\",\"headline\":\"Decrypt to View\",\"name\":\"Decrypt to View\",\"description\":\"Reveal encrypted values locally for UI display using ACPs\",\"url\":\"https://cofhe-docs.fhenix.zone/cofhe/client-sdk/guides/decrypt-to-view\",\"mainEntityOfPage\":{\"@id\":\"https://cofhe-docs.fhenix.zone/cofhe/client-sdk/guides/decrypt-to-view#webpage\"},\"dateModified\":\"2026-10-14T10:26:46.331Z\",\"publisher\":{\"@id\":\"https://cofhe-docs.fhenix.zone/#organization\"},\"isPartOf\":{\"@id\":\"https://cofhe-docs.fhenix.zone#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Fhenix Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Fhenix Documentation","nav":{"global":null,"products":[{"product":"All products","icon":"grid-2","pages":[{"title":"All products","href":""}]},{"product":"CoFHE","icon":"lock","tabs":[{"tab":"Get Started","pages":[{"title":"Get Started","href":"/cofhe"}]},{"tab":"Client SDK","groups":[{"group":"Introduction","pages":[{"title":"Overview","href":"/cofhe/client-sdk/introduction/overview"},{"title":"Mental Model","href":"/cofhe/client-sdk/introduction/mental-model"},{"title":"Installation","href":"/cofhe/client-sdk/introduction/installation"},{"title":"Migrating to 0.7","href":"/cofhe/client-sdk/introduction/migrating-to-0-7"},{"title":"Migrating from cofhejs","href":"/cofhe/client-sdk/introduction/migrating-from-cofhejs"}]},{"group":"Quick Start","pages":[{"title":"Quick Start: JavaScript","href":"/cofhe/client-sdk/quick-start/javascript"},{"title":"Quick Start: Hardhat","href":"/cofhe/client-sdk/quick-start/hardhat"},{"title":"Quick Start: Foundry","href":"/cofhe/client-sdk/quick-start/foundry"},{"title":"Quick Start: React","href":"/cofhe/client-sdk/quick-start/react"}]},{"group":"Guides","pages":[{"title":"Client Setup","href":"/cofhe/client-sdk/guides/client-setup"},{"title":"Encrypting Inputs","href":"/cofhe/client-sdk/guides/encrypting-inputs"},{"title":"Writing Encrypted Data to Contract","href":"/cofhe/client-sdk/guides/writing-encrypted-data"},{"title":"Access Control Permissions (ACP)","description":"Create and manage the EIP-712 signatures that authorize decryption","href":"/cofhe/client-sdk/guides/acps"},{"title":"Decrypt to View","href":"/cofhe/client-sdk/guides/decrypt-to-view"},{"title":"Decrypt to Transact","description":"Decrypt with a verifiable Teecryptor signature for onchain use","href":"/cofhe/client-sdk/guides/decrypt-to-tx"},{"title":"Writing Decrypt Result to Contract","href":"/cofhe/client-sdk/guides/writing-decrypt-result"},{"title":"Error Handling","href":"/cofhe/client-sdk/guides/error-handling"}]},{"group":"Hardhat Plugin","pages":[{"title":"Getting Started","href":"/cofhe/client-sdk/hardhat-plugin/getting-started"},{"title":"Client","href":"/cofhe/client-sdk/hardhat-plugin/client"},{"title":"Mock Contracts","href":"/cofhe/client-sdk/hardhat-plugin/mock-contracts"},{"title":"Logging","href":"/cofhe/client-sdk/hardhat-plugin/logging"},{"title":"Testing","href":"/cofhe/client-sdk/hardhat-plugin/testing"}]},{"group":"Hardhat 3 Plugin","pages":[{"title":"Getting Started","href":"/cofhe/client-sdk/hardhat-3-plugin/getting-started"},{"title":"Client","href":"/cofhe/client-sdk/hardhat-3-plugin/client"},{"title":"Mock Contracts","href":"/cofhe/client-sdk/hardhat-3-plugin/mock-contracts"},{"title":"Logging","href":"/cofhe/client-sdk/hardhat-3-plugin/logging"},{"title":"Testing","href":"/cofhe/client-sdk/hardhat-3-plugin/testing"}]},{"group":"Foundry Plugin","pages":[{"title":"Getting Started","href":"/cofhe/client-sdk/foundry-plugin/getting-started"},{"title":"CofheTest","href":"/cofhe/client-sdk/foundry-plugin/cofhe-test"},{"title":"CofheClient","href":"/cofhe/client-sdk/foundry-plugin/cofhe-client"},{"title":"Testing","href":"/cofhe/client-sdk/foundry-plugin/testing"}]},{"group":"Examples","pages":[{"title":"End-to-End Example","href":"/cofhe/client-sdk/examples/end-to-end"},{"title":"Templates \u0026 Starters","href":"/cofhe/client-sdk/examples/templates"}]},{"group":"Reference","pages":[{"title":"SDK Reference","href":"/cofhe/client-sdk/reference/sdk-reference"},{"title":"Hardhat Plugin Reference","href":"/cofhe/client-sdk/reference/hardhat-reference"},{"title":"Foundry Plugin Reference","href":"/cofhe/client-sdk/reference/foundry-reference"}]}],"global":{"anchors":[{"anchor":"Github","icon":"github","href":"https://github.com/FhenixProtocol/cofhesdk"}]}},{"tab":"FHE library","pages":[{"title":"FHE library","href":"/cofhe/fhe-library/introduction/overview"}]},{"tab":"Tutorials","pages":[{"title":"Tutorials","href":"/cofhe/tutorials/overview"}]},{"tab":"Deep Dive","pages":[{"title":"Deep Dive","href":"/cofhe/deep-dive/cofhe-components/overview"}]}]},{"product":"Wallet Module","icon":"wallet","pages":[{"title":"Wallet Module","href":"/wallet"}]},{"product":"Trading","icon":"chart-line","pages":[{"title":"Trading","href":"/trading"}]}]},"basePath":"","title":"Decrypt to View - Fhenix Documentation","buildId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","deploymentId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","dynamics":[],"chunks":[]}