@seams/wallet 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/dist/.build-inputs.sha256 +1 -1
  2. package/dist/esm/SeamsWeb/walletIframe/client/router.js +38 -0
  3. package/dist/esm/SeamsWeb/walletIframe/client/sessionCommands.js +16 -0
  4. package/dist/esm/SeamsWeb/walletIframe/host/walletMutationGuard.js +1 -0
  5. package/dist/esm/SeamsWeb/walletIframe/shared/exactSessionState.js +27 -4
  6. package/dist/esm/SeamsWeb/walletIframe/shared/messages.js +1 -1
  7. package/dist/esm/core/authMethods/plugins.js +8 -2
  8. package/dist/esm/core/ui/messages.js +5 -0
  9. package/dist/esm/react/components/AccountMenuButton/AccountMenuButtonView.js +35 -22
  10. package/dist/esm/react/components/AccountMenuButton/AccountSettingsDialog.js +157 -0
  11. package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodsModal.js +13 -1
  12. package/dist/esm/react/components/AccountMenuButton/ExternalWalletSettings.js +46 -0
  13. package/dist/esm/react/components/AccountMenuButton/LinkedDevicesModal.js +14 -2
  14. package/dist/esm/react/components/AccountMenuButton/WalletSettingsLayout.js +1 -1
  15. package/dist/esm/react/components/AccountMenuButton/Web3AuthProfileButton.css +154 -5
  16. package/dist/esm/react/components/AccountMenuButton/index.js +7 -3
  17. package/dist/esm/react/context/reactLoginStateBuilders.js +20 -0
  18. package/dist/esm/react/styles/styles.css +154 -5
  19. package/dist/esm/sdk/{ConfirmationDrawer-AZruQmhP.js → ConfirmationDrawer-MJoE0AAo.js} +1 -1
  20. package/dist/{public/sdk/adapters-d9yh1bdC.js → esm/sdk/adapters-C-g_hkkZ.js} +1 -1
  21. package/dist/esm/sdk/appearance-token-vars-01eH9pgA.js +1 -0
  22. package/dist/esm/sdk/configBuilder-DpChXfDO.js +1 -0
  23. package/dist/esm/sdk/{configuration-DBEc3bsj.js → configuration-BAad7ngq.js} +1 -1
  24. package/dist/esm/sdk/{confirm-ui-nU6ymgiv.js → confirm-ui-em0vkd2m.js} +1 -1
  25. package/dist/esm/sdk/{deviceLinkApproval-CfEiotVt.js → deviceLinkApproval-x3WkiYrd.js} +1 -1
  26. package/dist/esm/sdk/{export-viewer-host-BtrKVXxu.js → export-viewer-host-BSTfHhau.js} +1 -1
  27. package/dist/{public/sdk/exportKeypairOperation-CGE9ZU1m.js → esm/sdk/exportKeypairOperation-CjST_NUK.js} +1 -1
  28. package/dist/esm/sdk/host-C51z-AxP.js +1 -0
  29. package/dist/esm/sdk/{localOnly-BATWJj78.js → localOnly-Xs89Xajm.js} +1 -1
  30. package/dist/esm/sdk/{mountExportPrivateKeySurface-CyHU8bVc.js → mountExportPrivateKeySurface-CsUEKeum.js} +1 -1
  31. package/dist/esm/sdk/{mountRecoveryCodeBackupSurface-C7aglQxf.js → mountRecoveryCodeBackupSurface-kFLo5zLk.js} +1 -1
  32. package/dist/{public/sdk/pendingWalletRecoveryCodeBackup-Cjx-X-pP.js → esm/sdk/pendingWalletRecoveryCodeBackup-B-R_U34I.js} +1 -1
  33. package/dist/esm/sdk/{registration-CNLUYN-p.js → registration-Byl4l4yZ.js} +1 -1
  34. package/dist/esm/sdk/{registration-HSwOHZOo.js → registration-C2fb9kRQ.js} +1 -1
  35. package/dist/esm/sdk/resealedEnvelopeResult-CLW00Vbw.js +1 -0
  36. package/dist/esm/sdk/runtime-auth-ufbVur2p.js +1 -0
  37. package/dist/esm/sdk/{runtime-device-link-DAsq5tGT.js → runtime-device-link-CagI2Q62.js} +1 -1
  38. package/dist/{public/sdk/runtime-ecdsa-tempo-CVh_Vwl6.js → esm/sdk/runtime-ecdsa-tempo-Rctxr0yM.js} +1 -1
  39. package/dist/{public/sdk/runtime-email-otp-BxSKK9AG.js → esm/sdk/runtime-email-otp-BQtcG-LF.js} +1 -1
  40. package/dist/esm/sdk/{runtime-export-BWnQXMzT.js → runtime-export-wTeEaqlk.js} +1 -1
  41. package/dist/esm/sdk/{runtime-near-CuzPZrDS.js → runtime-near-59yU_3ud.js} +1 -1
  42. package/dist/esm/sdk/{runtime-preferences-B-nDWlm3.js → runtime-preferences-B9qLHX8W.js} +1 -1
  43. package/dist/esm/sdk/{runtime-recovery-DpOdEJ8N.js → runtime-recovery-DNyzdMBj.js} +1 -1
  44. package/dist/esm/sdk/{runtime-recovery-codes-DeUjQsxZ.js → runtime-recovery-codes-si1fGktB.js} +1 -1
  45. package/dist/esm/sdk/runtimeContext-ByeM6Z4Z.js +6 -0
  46. package/dist/{public/sdk/sessionObservationRevision-JOvVF4Hf.js → esm/sdk/sessionObservationRevision-ihBwjS3y.js} +1 -1
  47. package/dist/esm/sdk/tx-confirm-ui.js +8 -0
  48. package/dist/esm/sdk/voiceid-host.js +1 -1
  49. package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
  50. package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
  51. package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
  52. package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
  53. package/dist/esm/sdk/{walletRecoveryAdminProof-CvSYbyg5.js → walletRecoveryAdminProof-B4Ic07jY.js} +1 -1
  54. package/dist/esm/shared-ts/src/auth/externalAuth.js +53 -0
  55. package/dist/esm/voiceid-host.js +1 -1
  56. package/dist/public/headers.manifest.json +1 -1
  57. package/dist/public/sdk/{ConfirmationDrawer-AZruQmhP.js → ConfirmationDrawer-MJoE0AAo.js} +1 -1
  58. package/dist/{esm/sdk/adapters-d9yh1bdC.js → public/sdk/adapters-C-g_hkkZ.js} +1 -1
  59. package/dist/public/sdk/appearance-token-vars-01eH9pgA.js +1 -0
  60. package/dist/public/sdk/configBuilder-DpChXfDO.js +1 -0
  61. package/dist/public/sdk/{configuration-DBEc3bsj.js → configuration-BAad7ngq.js} +1 -1
  62. package/dist/public/sdk/{confirm-ui-nU6ymgiv.js → confirm-ui-em0vkd2m.js} +1 -1
  63. package/dist/public/sdk/{deviceLinkApproval-CfEiotVt.js → deviceLinkApproval-x3WkiYrd.js} +1 -1
  64. package/dist/public/sdk/{export-viewer-host-BtrKVXxu.js → export-viewer-host-BSTfHhau.js} +1 -1
  65. package/dist/{esm/sdk/exportKeypairOperation-CGE9ZU1m.js → public/sdk/exportKeypairOperation-CjST_NUK.js} +1 -1
  66. package/dist/public/sdk/host-C51z-AxP.js +1 -0
  67. package/dist/public/sdk/{localOnly-BATWJj78.js → localOnly-Xs89Xajm.js} +1 -1
  68. package/dist/public/sdk/{mountExportPrivateKeySurface-CyHU8bVc.js → mountExportPrivateKeySurface-CsUEKeum.js} +1 -1
  69. package/dist/public/sdk/{mountRecoveryCodeBackupSurface-C7aglQxf.js → mountRecoveryCodeBackupSurface-kFLo5zLk.js} +1 -1
  70. package/dist/{esm/sdk/pendingWalletRecoveryCodeBackup-Cjx-X-pP.js → public/sdk/pendingWalletRecoveryCodeBackup-B-R_U34I.js} +1 -1
  71. package/dist/public/sdk/{registration-CNLUYN-p.js → registration-Byl4l4yZ.js} +1 -1
  72. package/dist/public/sdk/{registration-HSwOHZOo.js → registration-C2fb9kRQ.js} +1 -1
  73. package/dist/public/sdk/resealedEnvelopeResult-CLW00Vbw.js +1 -0
  74. package/dist/public/sdk/runtime-auth-ufbVur2p.js +1 -0
  75. package/dist/public/sdk/{runtime-device-link-DAsq5tGT.js → runtime-device-link-CagI2Q62.js} +1 -1
  76. package/dist/{esm/sdk/runtime-ecdsa-tempo-CVh_Vwl6.js → public/sdk/runtime-ecdsa-tempo-Rctxr0yM.js} +1 -1
  77. package/dist/{esm/sdk/runtime-email-otp-BxSKK9AG.js → public/sdk/runtime-email-otp-BQtcG-LF.js} +1 -1
  78. package/dist/public/sdk/{runtime-export-BWnQXMzT.js → runtime-export-wTeEaqlk.js} +1 -1
  79. package/dist/public/sdk/{runtime-near-CuzPZrDS.js → runtime-near-59yU_3ud.js} +1 -1
  80. package/dist/public/sdk/{runtime-preferences-B-nDWlm3.js → runtime-preferences-B9qLHX8W.js} +1 -1
  81. package/dist/public/sdk/{runtime-recovery-DpOdEJ8N.js → runtime-recovery-DNyzdMBj.js} +1 -1
  82. package/dist/public/sdk/{runtime-recovery-codes-DeUjQsxZ.js → runtime-recovery-codes-si1fGktB.js} +1 -1
  83. package/dist/public/sdk/runtimeContext-ByeM6Z4Z.js +6 -0
  84. package/dist/{esm/sdk/sessionObservationRevision-JOvVF4Hf.js → public/sdk/sessionObservationRevision-ihBwjS3y.js} +1 -1
  85. package/dist/public/sdk/tx-confirm-ui.js +8 -0
  86. package/dist/public/sdk/voiceid-host.js +1 -1
  87. package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
  88. package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
  89. package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
  90. package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
  91. package/dist/public/sdk/{walletRecoveryAdminProof-CvSYbyg5.js → walletRecoveryAdminProof-B4Ic07jY.js} +1 -1
  92. package/dist/public/wallet-assets.manifest.json +61 -61
  93. package/dist/public/wallet-service/index.html +4 -4
  94. package/dist/types/shared-ts/src/auth/externalAuth.d.ts +84 -0
  95. package/dist/types/wallet/src/SeamsWeb/operations/devices/walletHostOwnerAuthority.d.ts +2 -1
  96. package/dist/types/wallet/src/SeamsWeb/publicApi/auth.d.ts +1 -1
  97. package/dist/types/wallet/src/SeamsWeb/publicApi/types.d.ts +11 -0
  98. package/dist/types/wallet/src/SeamsWeb/walletIframe/client/router.d.ts +4 -0
  99. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/WalletHostRuntime.d.ts +4 -2
  100. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/createSessionCommands.d.ts +5 -2
  101. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/externalAuth.d.ts +29 -0
  102. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/requestRouter.d.ts +1 -1
  103. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/sessionObserver.d.ts +1 -0
  104. package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/messages.d.ts +3 -3
  105. package/dist/types/wallet/src/core/authMethods/plugins.d.ts +2 -0
  106. package/dist/types/wallet/src/core/types/seams.d.ts +14 -6
  107. package/dist/types/wallet/src/core/ui/messages.d.ts +1 -1
  108. package/dist/types/wallet/src/index.d.ts +1 -0
  109. package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuButtonView.d.ts +2 -1
  110. package/dist/types/wallet/src/react/components/AccountMenuButton/AccountSettingsDialog.d.ts +10 -0
  111. package/dist/types/wallet/src/react/components/AccountMenuButton/AuthenticationMethodsModal.d.ts +1 -2
  112. package/dist/types/wallet/src/react/components/AccountMenuButton/ExternalWalletSettings.d.ts +10 -0
  113. package/dist/types/wallet/src/react/components/AccountMenuButton/LinkedDevicesModal.d.ts +1 -2
  114. package/dist/types/wallet/src/react/components/AccountMenuButton/WalletSettingsLayout.d.ts +1 -0
  115. package/dist/types/wallet/src/react/components/AccountMenuButton/hooks/useProfileState.d.ts +2 -2
  116. package/dist/types/wallet/src/react/components/AccountMenuButton/types.d.ts +4 -3
  117. package/dist/types/wallet/src/react/context/reactLoginStateBuilders.d.ts +1 -1
  118. package/dist/types/wallet/src/react/types.d.ts +13 -3
  119. package/dist/types/wallet/src/voiceid-host.d.ts +2 -2
  120. package/package.json +1 -1
  121. package/dist/esm/react/components/AccountMenuButton/AccountMenuModal.js +0 -66
  122. package/dist/esm/sdk/appearance-token-vars-BJydfWT_.js +0 -1
  123. package/dist/esm/sdk/configBuilder-CSwJrmcR.js +0 -1
  124. package/dist/esm/sdk/host-DayrOrgm.js +0 -1
  125. package/dist/esm/sdk/resealedEnvelopeResult-B1p5UkYg.js +0 -1
  126. package/dist/esm/sdk/runtime-auth-BCoj7_-G.js +0 -1
  127. package/dist/esm/sdk/runtimeContext-5JcewRo3.js +0 -6
  128. package/dist/public/sdk/appearance-token-vars-BJydfWT_.js +0 -1
  129. package/dist/public/sdk/configBuilder-CSwJrmcR.js +0 -1
  130. package/dist/public/sdk/host-DayrOrgm.js +0 -1
  131. package/dist/public/sdk/resealedEnvelopeResult-B1p5UkYg.js +0 -1
  132. package/dist/public/sdk/runtime-auth-BCoj7_-G.js +0 -1
  133. package/dist/public/sdk/runtimeContext-5JcewRo3.js +0 -6
  134. package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuModal.d.ts +0 -9
@@ -1 +1 @@
1
- import{E as e,k as t}from"./domainIds-t1lp25yU.js";import{g as n}from"./digests-BIaE0DMd.js";import{r}from"./activeWalletSession-BJ4B-nJo.js";import{t as i}from"./walletIframeIdentity-CpgyEnKg.js";import{o as a}from"./errors-BJBDbwHk.js";const o=`__SEAMS_WALLET_SDK_BASE__`,s=`SEAMS_WALLET_SDK_BASE_CHANGED`,c=`__SEAMS_WALLET_ASSET_VERSION__`;function l(){if(typeof window>`u`)return;let e=window[o];return typeof e==`string`&&e.length>0?e:void 0}function u(e){if(typeof window>`u`)return;let t=window;t[o]=e,window.dispatchEvent(new CustomEvent(s,{detail:e}))}function d(){if(typeof window>`u`)return;let e=window[c];return typeof e==`string`&&e.length>0?e:void 0}function f(e){if(typeof window>`u`)return;let t=e.trim();t&&(window[c]=t)}function p(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;typeof n==`string`&&n.length>0&&e(n)};return window.addEventListener(s,t,{passive:!0}),()=>window.removeEventListener(s,t)}const m={login:{title:`Welcome back`,subtitle:``,passkeyCta:`Unlock with passkey`},register:{title:`Create a wallet`,subtitle:``,passkeyNameLabel:`Wallet name`,passkeyCta:`Create wallet with passkey`},common:{closeLabel:`Close`}};function h(e,t){return typeof e==`string`&&e.trim()||null}function g(e,t){let n=h(e,t);return n===null?null:n}function _(e){try{return i(e)}catch{return null}}function v(e,t){let n=new Set(t);return Object.keys(e).every(e=>n.has(e))}function y(e){return g(e,`authMenuSessionId`)}function b(e){return g(e,`externalAuthRequestId`)}function x(e){return n(e)?e:null}function S(e,t=new Set,n=!1){if(e===void 0)return n;if(e===null||typeof e==`string`||typeof e==`boolean`)return!0;if(typeof e==`number`)return Number.isFinite(e);if(typeof e!=`object`||t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>S(e,t,n));let r=x(e);return r!==null&&Object.values(r).every(e=>S(e,t,n))}function C(e,t){return h(e,`copy`)??t}function w(e,t){let n=x(e);return{title:C(n?.title,t.title),subtitle:C(n?.subtitle,t.subtitle),passkeyCta:C(n?.passkeyCta,t.passkeyCta)}}function T(e){let t=x(e),n=x(t?.register);return{login:w(t?.login,m.login),register:{...w(t?.register,m.register),passkeyNameLabel:C(n?.passkeyNameLabel,m.register.passkeyNameLabel)},common:{closeLabel:C(x(t?.common)?.closeLabel,m.common.closeLabel)}}}function E(e){return e===`google`?e:null}function D(e){return e===`login`||e===`register`?e:null}function O(e){return e===`implicit_wallet`||e===`sponsored_named_near_account`?e:null}function k(e){return e===`close_button`||e===`component_unmounted`||e===`connection_closed`?e:null}function A(e,t){if(e===void 0)return!0;let n=x(e);return n!==null&&v(n,t)}function j(e){let t=x(e);return!t||!v(t,[`login`,`register`,`common`])?!1:A(t.login,[`title`,`subtitle`,`passkeyCta`])&&A(t.register,[`title`,`subtitle`,`passkeyCta`,`passkeyNameLabel`])&&A(t.common,[`closeLabel`])}function M(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){let e=E(n);if(!e)return null;t.push(e)}return t}function N(e){let n=x(e);if(!n||!S(n,new Set,!0)||n.kind!==`hosted_auth_menu_open_v1`||!v(n,[`kind`,`authMenuSessionId`,`initialMode`,`initialHeightCssPx`,`loginTarget`,`registrationAccountInput`,`showRegistrationInput`,`showProgress`,`copy`,`enabledExternalProviders`])||!j(n.copy))return null;let r=y(n.authMenuSessionId),i=D(n.initialMode),a=n.initialHeightCssPx;if(a!==void 0&&(typeof a!=`number`||!Number.isFinite(a)||a<=0))return null;let o=x(n.loginTarget),s=o?.kind===`wallet`||o?.kind===`wallet_sync`?t(o.walletId):null,c=o?.kind===`discoverable`&&v(o,[`kind`])?{kind:`discoverable`}:o?.kind===`wallet`&&v(o,[`kind`,`walletId`])&&s?.ok?{kind:`wallet`,walletId:s.value}:o?.kind===`wallet_sync`&&v(o,[`kind`,`walletId`])&&s?.ok?{kind:`wallet_sync`,walletId:s.value}:null,l=O(n.registrationAccountInput),u=M(n.enabledExternalProviders);return!r||!i||!c||!l||typeof n.showRegistrationInput!=`boolean`||typeof n.showProgress!=`boolean`||!u||!S(n.copy,new Set,!0)?null:{kind:`hosted_auth_menu_open_v1`,authMenuSessionId:r,initialMode:i,initialHeightCssPx:a,loginTarget:c,registrationAccountInput:l,showRegistrationInput:n.showRegistrationInput,showProgress:n.showProgress,copy:T(n.copy),enabledExternalProviders:u}}function P(e){let t=x(e);if(!t||!S(t)||t.kind!==`hosted_auth_menu_error_v1`||!v(t,[`kind`,`authMenuSessionId`,`mode`,`message`]))return null;let n=y(t.authMenuSessionId),r=D(t.mode),i=h(t.message,`message`);return n&&r&&i?{kind:t.kind,authMenuSessionId:n,mode:r,message:i}:null}function F(e){let t=x(e);if(!t||!S(t))return null;switch(t.kind){case`google_id_token`:{if(!v(t,[`kind`,`idToken`]))return null;let e=h(t.idToken,`idToken`);return e?{kind:t.kind,idToken:e}:null}case`cancelled`:return v(t,[`kind`,`reason`])&&t.reason===`user_cancelled`?{kind:t.kind,reason:t.reason}:null;case`failed`:{if(!v(t,[`kind`,`code`,`message`]))return null;let e=t.code===`provider_unavailable`||t.code===`provider_error`||t.code===`invalid_evidence`?t.code:null,n=h(t.message,`message`);return e&&n?{kind:t.kind,code:e,message:n}:null}default:return null}}function I(e){let t=x(e);if(!t||!S(t)||t.kind!==`hosted_auth_menu_external_auth_resolution_v1`||!v(t,[`kind`,`authMenuSessionId`,`externalAuthRequestId`,`requestId`,`evidence`]))return null;let n=y(t.authMenuSessionId),r=b(t.externalAuthRequestId),i=_(t.requestId),a=F(t.evidence);return!n||!r||!i||!a?null:{kind:t.kind,authMenuSessionId:n,externalAuthRequestId:r,requestId:i,evidence:a}}function L(e){let t=x(e);if(!t||!S(t)||t.kind!==`hosted_auth_menu_cancel_v1`||!v(t,[`kind`,`authMenuSessionId`,`requestId`,`reason`]))return null;let n=y(t.authMenuSessionId),r=_(t.requestId),i=k(t.reason);return n&&r&&i?{kind:t.kind,authMenuSessionId:n,requestId:r,reason:i}:null}const R=`17.0.0`,z=`WALLET_IFRAME_PROTOCOL_VERSION_MISMATCH`,B=[`home`,`exchangeCode`,`nonce`,`appOrigin`,`walletOrigin`,`relayUrl`];function V(e,t){if(typeof e!=`string`||e.length===0||e.length>512||e.trim()!==e||/[\s\u0000-\u001f\u007f]/.test(e))throw Error(`${t} must be a compact opaque identifier`);return e}function H(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw Error(`${t} must be a canonical HTTP origin`);let n;try{n=new URL(e)}catch{throw Error(`${t} must be a canonical HTTP origin`)}if(n.protocol!==`https:`&&n.protocol!==`http:`||n.origin!==e||n.pathname!==`/`||n.search!==``||n.hash!==``)throw Error(`${t} must be a canonical HTTP origin`);return n.origin}function U(e){if(!n(e))throw Error(`hosted-wallet redemption payload must be an exact object`);if(Object.keys(e).length!==B.length)throw Error(`hosted-wallet redemption payload fields are invalid`);for(let t of B)if(!Object.hasOwn(e,t))throw Error(`hosted-wallet redemption payload fields are invalid`);return{home:r(e.home),exchangeCode:V(e.exchangeCode,`exchangeCode`),nonce:V(e.nonce,`nonce`),appOrigin:H(e.appOrigin,`appOrigin`),walletOrigin:H(e.walletOrigin,`walletOrigin`),relayUrl:V(e.relayUrl,`relayUrl`)}}function W(t){if(!n(t)||!v(t,[`scanRequestId`,`action`])||typeof t.scanRequestId!=`string`||t.scanRequestId.length===0||!n(t.action))return null;let r=t.action;if(r.kind===`cancel`)return v(r,[`kind`])?{scanRequestId:t.scanRequestId,action:{kind:r.kind}}:null;if(r.kind!==`select`||!v(r,[`kind`,`baseWalletAuthMethodId`]))return null;let i=e(r.baseWalletAuthMethodId);return i.ok?{scanRequestId:t.scanRequestId,action:{kind:r.kind,baseWalletAuthMethodId:i.value}}:null}function G(e){if(!n(e)||!v(e,[`activationId`,`action`])||typeof e.activationId!=`string`||e.activationId.length===0||!n(e.action))return null;let t=e.action;switch(t.kind){case`create_passkey`:case`send_email_otp`:case`resend_email_otp`:return v(t,[`kind`])?{activationId:e.activationId,action:{kind:t.kind}}:null;case`submit_email_otp`:return v(t,[`kind`,`otpCode`])&&typeof t.otpCode==`string`&&/^\d{6}$/.test(t.otpCode)?{activationId:e.activationId,action:{kind:t.kind,otpCode:t.otpCode}}:null;default:return null}}function K(e,t){return{success:!1,kind:t,error:a(e)||`NEAR transaction failed`}}function q(e,t){return{success:!1,kind:`unresolved`,transactionId:e,error:a(t)}}function J(){return{appIdentity:{kind:`anonymous`},authentication:{kind:`signed_out`},capabilityProjection:{kind:`not_requested`},nonceDiagnostics:null}}let Y=0;function X(){return Y+=1,Y}export{p as _,z as a,W as c,P as d,I as f,l as g,d as h,q as i,G as l,U as m,J as n,R as o,N as p,K as r,b as s,X as t,L as u,f as v,u as y};
1
+ import{E as e,k as t}from"./domainIds-t1lp25yU.js";import{g as n}from"./digests-BIaE0DMd.js";import{r}from"./activeWalletSession-BJ4B-nJo.js";import{t as i}from"./walletIframeIdentity-CpgyEnKg.js";import{o as a}from"./errors-BJBDbwHk.js";const o=`__SEAMS_WALLET_SDK_BASE__`,s=`SEAMS_WALLET_SDK_BASE_CHANGED`,c=`__SEAMS_WALLET_ASSET_VERSION__`;function l(){if(typeof window>`u`)return;let e=window[o];return typeof e==`string`&&e.length>0?e:void 0}function u(e){if(typeof window>`u`)return;let t=window;t[o]=e,window.dispatchEvent(new CustomEvent(s,{detail:e}))}function d(){if(typeof window>`u`)return;let e=window[c];return typeof e==`string`&&e.length>0?e:void 0}function f(e){if(typeof window>`u`)return;let t=e.trim();t&&(window[c]=t)}function p(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;typeof n==`string`&&n.length>0&&e(n)};return window.addEventListener(s,t,{passive:!0}),()=>window.removeEventListener(s,t)}const m={login:{title:`Welcome back`,subtitle:``,passkeyCta:`Unlock with passkey`},register:{title:`Create a wallet`,subtitle:``,passkeyNameLabel:`Wallet name`,passkeyCta:`Create wallet with passkey`},common:{closeLabel:`Close`}};function h(e,t){return typeof e==`string`&&e.trim()||null}function g(e,t){let n=h(e,t);return n===null?null:n}function _(e){try{return i(e)}catch{return null}}function v(e,t){let n=new Set(t);return Object.keys(e).every(e=>n.has(e))}function y(e){return g(e,`authMenuSessionId`)}function b(e){return g(e,`externalAuthRequestId`)}function x(e){return n(e)?e:null}function S(e,t=new Set,n=!1){if(e===void 0)return n;if(e===null||typeof e==`string`||typeof e==`boolean`)return!0;if(typeof e==`number`)return Number.isFinite(e);if(typeof e!=`object`||t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>S(e,t,n));let r=x(e);return r!==null&&Object.values(r).every(e=>S(e,t,n))}function C(e,t){return h(e,`copy`)??t}function w(e,t){let n=x(e);return{title:C(n?.title,t.title),subtitle:C(n?.subtitle,t.subtitle),passkeyCta:C(n?.passkeyCta,t.passkeyCta)}}function T(e){let t=x(e),n=x(t?.register);return{login:w(t?.login,m.login),register:{...w(t?.register,m.register),passkeyNameLabel:C(n?.passkeyNameLabel,m.register.passkeyNameLabel)},common:{closeLabel:C(x(t?.common)?.closeLabel,m.common.closeLabel)}}}function E(e){return e===`google`?e:null}function D(e){return e===`login`||e===`register`?e:null}function O(e){return e===`implicit_wallet`||e===`sponsored_named_near_account`?e:null}function k(e){return e===`close_button`||e===`component_unmounted`||e===`connection_closed`?e:null}function A(e,t){if(e===void 0)return!0;let n=x(e);return n!==null&&v(n,t)}function j(e){let t=x(e);return!t||!v(t,[`login`,`register`,`common`])?!1:A(t.login,[`title`,`subtitle`,`passkeyCta`])&&A(t.register,[`title`,`subtitle`,`passkeyCta`,`passkeyNameLabel`])&&A(t.common,[`closeLabel`])}function M(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){let e=E(n);if(!e)return null;t.push(e)}return t}function N(e){let n=x(e);if(!n||!S(n,new Set,!0)||n.kind!==`hosted_auth_menu_open_v1`||!v(n,[`kind`,`authMenuSessionId`,`initialMode`,`initialHeightCssPx`,`loginTarget`,`registrationAccountInput`,`showRegistrationInput`,`showProgress`,`copy`,`enabledExternalProviders`])||!j(n.copy))return null;let r=y(n.authMenuSessionId),i=D(n.initialMode),a=n.initialHeightCssPx;if(a!==void 0&&(typeof a!=`number`||!Number.isFinite(a)||a<=0))return null;let o=x(n.loginTarget),s=o?.kind===`wallet`||o?.kind===`wallet_sync`?t(o.walletId):null,c=o?.kind===`discoverable`&&v(o,[`kind`])?{kind:`discoverable`}:o?.kind===`wallet`&&v(o,[`kind`,`walletId`])&&s?.ok?{kind:`wallet`,walletId:s.value}:o?.kind===`wallet_sync`&&v(o,[`kind`,`walletId`])&&s?.ok?{kind:`wallet_sync`,walletId:s.value}:null,l=O(n.registrationAccountInput),u=M(n.enabledExternalProviders);return!r||!i||!c||!l||typeof n.showRegistrationInput!=`boolean`||typeof n.showProgress!=`boolean`||!u||!S(n.copy,new Set,!0)?null:{kind:`hosted_auth_menu_open_v1`,authMenuSessionId:r,initialMode:i,initialHeightCssPx:a,loginTarget:c,registrationAccountInput:l,showRegistrationInput:n.showRegistrationInput,showProgress:n.showProgress,copy:T(n.copy),enabledExternalProviders:u}}function P(e){let t=x(e);if(!t||!S(t)||t.kind!==`hosted_auth_menu_error_v1`||!v(t,[`kind`,`authMenuSessionId`,`mode`,`message`]))return null;let n=y(t.authMenuSessionId),r=D(t.mode),i=h(t.message,`message`);return n&&r&&i?{kind:t.kind,authMenuSessionId:n,mode:r,message:i}:null}function F(e){let t=x(e);if(!t||!S(t))return null;switch(t.kind){case`google_id_token`:{if(!v(t,[`kind`,`idToken`]))return null;let e=h(t.idToken,`idToken`);return e?{kind:t.kind,idToken:e}:null}case`cancelled`:return v(t,[`kind`,`reason`])&&t.reason===`user_cancelled`?{kind:t.kind,reason:t.reason}:null;case`failed`:{if(!v(t,[`kind`,`code`,`message`]))return null;let e=t.code===`provider_unavailable`||t.code===`provider_error`||t.code===`invalid_evidence`?t.code:null,n=h(t.message,`message`);return e&&n?{kind:t.kind,code:e,message:n}:null}default:return null}}function I(e){let t=x(e);if(!t||!S(t)||t.kind!==`hosted_auth_menu_external_auth_resolution_v1`||!v(t,[`kind`,`authMenuSessionId`,`externalAuthRequestId`,`requestId`,`evidence`]))return null;let n=y(t.authMenuSessionId),r=b(t.externalAuthRequestId),i=_(t.requestId),a=F(t.evidence);return!n||!r||!i||!a?null:{kind:t.kind,authMenuSessionId:n,externalAuthRequestId:r,requestId:i,evidence:a}}function L(e){let t=x(e);if(!t||!S(t)||t.kind!==`hosted_auth_menu_cancel_v1`||!v(t,[`kind`,`authMenuSessionId`,`requestId`,`reason`]))return null;let n=y(t.authMenuSessionId),r=_(t.requestId),i=k(t.reason);return n&&r&&i?{kind:t.kind,authMenuSessionId:n,requestId:r,reason:i}:null}const R=`18.0.0`,z=`WALLET_IFRAME_PROTOCOL_VERSION_MISMATCH`,B=[`home`,`exchangeCode`,`nonce`,`appOrigin`,`walletOrigin`,`relayUrl`];function V(e,t){if(typeof e!=`string`||e.length===0||e.length>512||e.trim()!==e||/[\s\u0000-\u001f\u007f]/.test(e))throw Error(`${t} must be a compact opaque identifier`);return e}function H(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw Error(`${t} must be a canonical HTTP origin`);let n;try{n=new URL(e)}catch{throw Error(`${t} must be a canonical HTTP origin`)}if(n.protocol!==`https:`&&n.protocol!==`http:`||n.origin!==e||n.pathname!==`/`||n.search!==``||n.hash!==``)throw Error(`${t} must be a canonical HTTP origin`);return n.origin}function U(e){if(!n(e))throw Error(`hosted-wallet redemption payload must be an exact object`);if(Object.keys(e).length!==B.length)throw Error(`hosted-wallet redemption payload fields are invalid`);for(let t of B)if(!Object.hasOwn(e,t))throw Error(`hosted-wallet redemption payload fields are invalid`);return{home:r(e.home),exchangeCode:V(e.exchangeCode,`exchangeCode`),nonce:V(e.nonce,`nonce`),appOrigin:H(e.appOrigin,`appOrigin`),walletOrigin:H(e.walletOrigin,`walletOrigin`),relayUrl:V(e.relayUrl,`relayUrl`)}}function W(t){if(!n(t)||!v(t,[`scanRequestId`,`action`])||typeof t.scanRequestId!=`string`||t.scanRequestId.length===0||!n(t.action))return null;let r=t.action;if(r.kind===`cancel`)return v(r,[`kind`])?{scanRequestId:t.scanRequestId,action:{kind:r.kind}}:null;if(r.kind!==`select`||!v(r,[`kind`,`baseWalletAuthMethodId`]))return null;let i=e(r.baseWalletAuthMethodId);return i.ok?{scanRequestId:t.scanRequestId,action:{kind:r.kind,baseWalletAuthMethodId:i.value}}:null}function G(e){if(!n(e)||!v(e,[`activationId`,`action`])||typeof e.activationId!=`string`||e.activationId.length===0||!n(e.action))return null;let t=e.action;switch(t.kind){case`create_passkey`:case`send_email_otp`:case`resend_email_otp`:return v(t,[`kind`])?{activationId:e.activationId,action:{kind:t.kind}}:null;case`submit_email_otp`:return v(t,[`kind`,`otpCode`])&&typeof t.otpCode==`string`&&/^\d{6}$/.test(t.otpCode)?{activationId:e.activationId,action:{kind:t.kind,otpCode:t.otpCode}}:null;default:return null}}function K(e,t){return{success:!1,kind:t,error:a(e)||`NEAR transaction failed`}}function q(e,t){return{success:!1,kind:`unresolved`,transactionId:e,error:a(t)}}function J(){return{appIdentity:{kind:`anonymous`},authentication:{kind:`signed_out`},capabilityProjection:{kind:`not_requested`},nonceDiagnostics:null}}let Y=0;function X(){return Y+=1,Y}export{p as _,z as a,W as c,P as d,I as f,l as g,d as h,q as i,G as l,U as m,J as n,R as o,N as p,K as r,b as s,X as t,L as u,f as v,u as y};
@@ -2661,6 +2661,14 @@ var walletMessages = [
2661
2661
  "ウォレットをロックできません。もう一度お試しください。"
2662
2662
  ],
2663
2663
  ["Unlocked on this device", "このデバイスでロック解除済み"],
2664
+ ["Connected with Google", "Google で接続中"],
2665
+ ["Wallet access", "ウォレットへのアクセス"],
2666
+ ["Connected to your wallet", "ウォレットに接続しています"],
2667
+ ["Method {value0}", "認証方法 {value0}"],
2668
+ [
2669
+ "Confirm with a wallet authentication method to make security changes.",
2670
+ "セキュリティ設定を変更するには、ウォレットの認証方法で本人確認してください。"
2671
+ ],
2664
2672
  ["All settings", "すべての設定"],
2665
2673
  ["Locking…", "ロック中…"],
2666
2674
  ["Lock wallet", "ウォレットをロック"],
@@ -1 +1 @@
1
- import{E as e,P as t,i as n,k as r,t as i,y as a}from"./domainIds-t1lp25yU.js";import{S as o,g as s,p as c,t as l}from"./digests-BIaE0DMd.js";import{c as u,l as d,o as f,u as p}from"./participants-BXdREC5k.js";import{i as m,r as h}from"./base64-BmKR3UqU.js";import{r as g}from"./secureRandomId-8LSc91aN.js";import"./walletDbName-Ca0rCq5r.js";import{A as _,F as v,J as y,L as b,V as x,i as S,n as C}from"./activeWalletSession-BJ4B-nJo.js";import{a as w}from"./chains-B72I4PDH.js";import"./signingSessionSeal-BFOBKj-J.js";import{r as T}from"./configuration-DBEc3bsj.js";import{i as E,t as D}from"./transactionReview-CGIlI835.js";import"./capabilityKinds-DVlGMspk.js";import{a as O,r as k}from"./canonicalPrimitives-Jd3i_Ngz.js";import{s as A}from"./errors-BJBDbwHk.js";import{r as j,v as M}from"./icons-BlMXolHv.js";import{t as N}from"./surface-measurement-reporter-DXsvq401.js";import{n as P,t as F}from"./csp-stylesheet-DUSqfXvZ.js";import"./signerDomain-BAsLT3XN.js";import{T as I,_ as L,b as R,h as z,m as B,v as V,x as H}from"./registrationIntent-Do1tD1V7.js";import{a as U}from"./presignatures-BCeq56DG.js";import"./accountIds-CW2BP-d9.js";import{h as W}from"./device-linking-DiCNt3iA.js";import"./walletAuthority-BTGAuOi8.js";import"./digestEncoding-CqNXPZY9.js";import{a as G,c as K,o as q,r as J,s as Y}from"./walletAuthMethodRecord-DLBB5fez.js";import"./signerSlot-D2RZnb27.js";import{a as X,o as Z,s as Q,t as $}from"./indexedDB-C4SDsyOG.js";import"./keccak-mS0Mejjx.js";import"./registrationSignerPlan-DK2b3N_p.js";import"./walletCapabilityBindings-D5YYB7nN.js";import"./emailOtpEcdsaDerivationIdentity-HFQXc1Yw.js";import{o as ee}from"./walletSessionAuthorizationStore-B9Vwkshr.js";import{a as te,i as ne,n as re,t as ie,u as ae}from"./resealedEnvelopeResult-B1p5UkYg.js";import{n as oe}from"./walletSessionAuthorizationStatus-DG7DPcgR.js";import{i as se,n as ce}from"./evmCryptoWasm-BUPb4hBH.js";import{a as le,s as ue,u as de}from"./unlockedEd25519ExportRootCapability-yzxQjIFd.js";import{t as fe}from"./SeamsWordmark-DwvPx2UA.js";import{t as pe}from"./actions-DrtSTGus.js";var me=class{promise;resolveValue=null;rejectValue=null;constructor(){this.promise=new Promise(this.capture)}resolve(e){if(!this.resolveValue)throw Error(`Worker deferred resolver is unavailable`);this.resolveValue(e)}reject(e){if(!this.rejectValue)throw Error(`Worker deferred rejecter is unavailable`);this.rejectValue(e)}capture=(e,t)=>{this.resolveValue=e,this.rejectValue=t}};const he=2;export{pe as ActionType,$ as IndexedDBManager,U as SEAMS_WALLET_STORES,fe as SeamsWordmark,D as TransactionReviewError,he as VOICE_ID_HOST_API_VERSION,me as WorkerDeferred,i as allocateWalletAuthMethodId,l as alphabetizeStringify,M as authMenuSuccessCopy,re as availabilityKey,j as backIcon,h as base64UrlDecode,m as base64UrlEncode,v as buildDelegatedWalletAuthorityV1,b as buildFullOwnerPermissionsV1,B as buildMethodBoundEnvelopeOwnership,z as buildPasskeyCustodyEnvelopeRecord,f as buildRelayerJsonPostRequestInit,L as buildVoiceIdEnvelopeFactor,I as buildWalletCustodySeedBinding,u as buildWalletSessionAuthorizationHeaders,ce as buildWebauthnP256SignatureWasm,F as createCspStylesheetManager,oe as createRelayerExactWalletSessionStatusPort,N as createWalletIframeSurfaceMeasurementReporter,V as custodyEnvelopeBindingJsonV1,se as decodeCoseP256PublicKeyWasm,d as fetchWithWalletHomeDiscovery,P as getDefaultCspNonce,c as isFiniteNumber,s as isPlainObject,R as isVoiceIdSeedEnvelope,t as joinNormalizedUrl,n as mpcMaterialActivationRefsEqual,p as normalizeRelayerBaseUrl,C as parseActiveWalletSessionV1,k as parseDigestB64u,de as parseEd25519YaoRecoveryCapabilityV1,_ as parseEnvelopeRevision,W as parseLinkedDeviceListResultV1,H as parsePasskeyCustodyEnvelopeRecord,a as parsePasskeyEnvelopeId,ie as parseResealedEnvelopeResult,ne as parseStoredAuthMethodAvailability,E as parseTransactionReviewWire,G as parseVoiceIdDeviceAssertion,q as parseVoiceIdDevicePublicKeyB64u,Y as parseVoiceIdWalletSessionChallenge,e as parseWalletAuthMethodId,J as parseWalletAuthMethodRecordV2,X as parseWalletAuthMethodV2StorageRow,Z as parseWalletAuthorityStorageRow,r as parseWalletId,Q as parseWalletSelectionStorageRow,S as parseWalletSessionOperationCredentialV1,te as readAuthMethodEnabled,le as readUnlockedWalletEd25519ExportRootCapabilityV1,y as rejectUnknownFields,o as requireRecord,w as resolveNearNetwork,x as sameDelegatedWalletAuthorityV1,g as secureRandomId,O as sha256DigestB64u,A as toError,K as voiceIdWalletSessionChallengeBytes,ue as walletCustodyCeremonyTransportFromWorkerContextV1,ae as walletForHostRequest,T as walletHostExecutionFingerprint,ee as walletSessionAuthorizations};
1
+ import{E as e,P as t,i as n,k as r,t as i,y as a}from"./domainIds-t1lp25yU.js";import{S as o,g as s,p as c,t as l}from"./digests-BIaE0DMd.js";import{c as u,l as d,o as f,u as p}from"./participants-BXdREC5k.js";import{i as m,r as h}from"./base64-BmKR3UqU.js";import{r as g}from"./secureRandomId-8LSc91aN.js";import"./walletDbName-Ca0rCq5r.js";import{A as _,F as v,J as y,L as b,V as x,i as S,n as C}from"./activeWalletSession-BJ4B-nJo.js";import{a as w}from"./chains-B72I4PDH.js";import"./signingSessionSeal-BFOBKj-J.js";import{r as T}from"./configuration-BAad7ngq.js";import{i as E,t as D}from"./transactionReview-CGIlI835.js";import"./capabilityKinds-DVlGMspk.js";import{a as O,r as k}from"./canonicalPrimitives-Jd3i_Ngz.js";import{s as A}from"./errors-BJBDbwHk.js";import{r as j,v as M}from"./icons-BlMXolHv.js";import{t as N}from"./surface-measurement-reporter-DXsvq401.js";import{n as P,t as F}from"./csp-stylesheet-DUSqfXvZ.js";import"./signerDomain-BAsLT3XN.js";import{T as I,_ as L,b as R,h as z,m as B,v as V,x as H}from"./registrationIntent-Do1tD1V7.js";import{a as U}from"./presignatures-BCeq56DG.js";import"./accountIds-CW2BP-d9.js";import{h as W}from"./device-linking-DiCNt3iA.js";import"./walletAuthority-BTGAuOi8.js";import"./digestEncoding-CqNXPZY9.js";import{a as G,c as K,o as q,r as J,s as Y}from"./walletAuthMethodRecord-DLBB5fez.js";import"./signerSlot-D2RZnb27.js";import{a as X,o as Z,s as Q,t as $}from"./indexedDB-C4SDsyOG.js";import"./keccak-mS0Mejjx.js";import"./registrationSignerPlan-DK2b3N_p.js";import"./walletCapabilityBindings-D5YYB7nN.js";import"./emailOtpEcdsaDerivationIdentity-HFQXc1Yw.js";import{o as ee}from"./walletSessionAuthorizationStore-B9Vwkshr.js";import{a as te,i as ne,n as re,t as ie,u as ae}from"./resealedEnvelopeResult-CLW00Vbw.js";import{n as oe}from"./walletSessionAuthorizationStatus-DG7DPcgR.js";import{i as se,n as ce}from"./evmCryptoWasm-BUPb4hBH.js";import{a as le,s as ue,u as de}from"./unlockedEd25519ExportRootCapability-yzxQjIFd.js";import{t as fe}from"./SeamsWordmark-DwvPx2UA.js";import{t as pe}from"./actions-DrtSTGus.js";var me=class{promise;resolveValue=null;rejectValue=null;constructor(){this.promise=new Promise(this.capture)}resolve(e){if(!this.resolveValue)throw Error(`Worker deferred resolver is unavailable`);this.resolveValue(e)}reject(e){if(!this.rejectValue)throw Error(`Worker deferred rejecter is unavailable`);this.rejectValue(e)}capture=(e,t)=>{this.resolveValue=e,this.rejectValue=t}};const he=3;export{pe as ActionType,$ as IndexedDBManager,U as SEAMS_WALLET_STORES,fe as SeamsWordmark,D as TransactionReviewError,he as VOICE_ID_HOST_API_VERSION,me as WorkerDeferred,i as allocateWalletAuthMethodId,l as alphabetizeStringify,M as authMenuSuccessCopy,re as availabilityKey,j as backIcon,h as base64UrlDecode,m as base64UrlEncode,v as buildDelegatedWalletAuthorityV1,b as buildFullOwnerPermissionsV1,B as buildMethodBoundEnvelopeOwnership,z as buildPasskeyCustodyEnvelopeRecord,f as buildRelayerJsonPostRequestInit,L as buildVoiceIdEnvelopeFactor,I as buildWalletCustodySeedBinding,u as buildWalletSessionAuthorizationHeaders,ce as buildWebauthnP256SignatureWasm,F as createCspStylesheetManager,oe as createRelayerExactWalletSessionStatusPort,N as createWalletIframeSurfaceMeasurementReporter,V as custodyEnvelopeBindingJsonV1,se as decodeCoseP256PublicKeyWasm,d as fetchWithWalletHomeDiscovery,P as getDefaultCspNonce,c as isFiniteNumber,s as isPlainObject,R as isVoiceIdSeedEnvelope,t as joinNormalizedUrl,n as mpcMaterialActivationRefsEqual,p as normalizeRelayerBaseUrl,C as parseActiveWalletSessionV1,k as parseDigestB64u,de as parseEd25519YaoRecoveryCapabilityV1,_ as parseEnvelopeRevision,W as parseLinkedDeviceListResultV1,H as parsePasskeyCustodyEnvelopeRecord,a as parsePasskeyEnvelopeId,ie as parseResealedEnvelopeResult,ne as parseStoredAuthMethodAvailability,E as parseTransactionReviewWire,G as parseVoiceIdDeviceAssertion,q as parseVoiceIdDevicePublicKeyB64u,Y as parseVoiceIdWalletSessionChallenge,e as parseWalletAuthMethodId,J as parseWalletAuthMethodRecordV2,X as parseWalletAuthMethodV2StorageRow,Z as parseWalletAuthorityStorageRow,r as parseWalletId,Q as parseWalletSelectionStorageRow,S as parseWalletSessionOperationCredentialV1,te as readAuthMethodEnabled,le as readUnlockedWalletEd25519ExportRootCapabilityV1,y as rejectUnknownFields,o as requireRecord,w as resolveNearNetwork,x as sameDelegatedWalletAuthorityV1,g as secureRandomId,O as sha256DigestB64u,A as toError,K as voiceIdWalletSessionChallengeBytes,ue as walletCustodyCeremonyTransportFromWorkerContextV1,ae as walletForHostRequest,T as walletHostExecutionFingerprint,ee as walletSessionAuthorizations};
@@ -1 +1 @@
1
- import"./walletDbName-Ca0rCq5r.js";import"./activeWalletSession-BJ4B-nJo.js";import"./signingSessionSeal-BFOBKj-J.js";import{t as e}from"./host-DayrOrgm.js";import"./capabilityKinds-DVlGMspk.js";import"./errors-BJBDbwHk.js";e({supportedRuntimeRouteKinds:new Set([`auth`,`ecdsa`,`email_otp`,`export`,`recovery`,`preferences`])});
1
+ import"./walletDbName-Ca0rCq5r.js";import"./activeWalletSession-BJ4B-nJo.js";import"./signingSessionSeal-BFOBKj-J.js";import{t as e}from"./host-C51z-AxP.js";import"./capabilityKinds-DVlGMspk.js";import"./errors-BJBDbwHk.js";e({supportedRuntimeRouteKinds:new Set([`auth`,`ecdsa`,`email_otp`,`export`,`recovery`,`preferences`])});
@@ -1 +1 @@
1
- import"./walletDbName-Ca0rCq5r.js";import"./activeWalletSession-BJ4B-nJo.js";import"./signingSessionSeal-BFOBKj-J.js";import{t as e}from"./host-DayrOrgm.js";import"./capabilityKinds-DVlGMspk.js";import"./errors-BJBDbwHk.js";e();
1
+ import"./walletDbName-Ca0rCq5r.js";import"./activeWalletSession-BJ4B-nJo.js";import"./signingSessionSeal-BFOBKj-J.js";import{t as e}from"./host-C51z-AxP.js";import"./capabilityKinds-DVlGMspk.js";import"./errors-BJBDbwHk.js";e();
@@ -1 +1 @@
1
- import"./walletDbName-Ca0rCq5r.js";import"./activeWalletSession-BJ4B-nJo.js";import"./signingSessionSeal-BFOBKj-J.js";import{t as e}from"./host-DayrOrgm.js";import"./capabilityKinds-DVlGMspk.js";import"./errors-BJBDbwHk.js";e({supportedRuntimeRouteKinds:new Set([`auth`,`near`,`export`,`device_link`,`recovery`,`preferences`])});
1
+ import"./walletDbName-Ca0rCq5r.js";import"./activeWalletSession-BJ4B-nJo.js";import"./signingSessionSeal-BFOBKj-J.js";import{t as e}from"./host-C51z-AxP.js";import"./capabilityKinds-DVlGMspk.js";import"./errors-BJBDbwHk.js";e({supportedRuntimeRouteKinds:new Set([`auth`,`near`,`export`,`device_link`,`recovery`,`preferences`])});
@@ -1 +1 @@
1
- import"./walletDbName-Ca0rCq5r.js";import"./activeWalletSession-BJ4B-nJo.js";import"./signingSessionSeal-BFOBKj-J.js";import{t as e}from"./host-DayrOrgm.js";import"./capabilityKinds-DVlGMspk.js";import"./errors-BJBDbwHk.js";export{e as initWalletIFrame};
1
+ import"./walletDbName-Ca0rCq5r.js";import"./activeWalletSession-BJ4B-nJo.js";import"./signingSessionSeal-BFOBKj-J.js";import{t as e}from"./host-C51z-AxP.js";import"./capabilityKinds-DVlGMspk.js";import"./errors-BJBDbwHk.js";export{e as initWalletIFrame};
@@ -1 +1 @@
1
- import{o as e,u as t}from"./participants-BXdREC5k.js";import{r as n}from"./base64-BmKR3UqU.js";import{r,t as i}from"./secureRandomId-8LSc91aN.js";import{o as a}from"./signerSlot-D2RZnb27.js";import{t as o}from"./indexedDB-C4SDsyOG.js";import{n as s,s as c,t as l,u}from"./helpers-Dubwo5uK.js";import{i as ee}from"./pendingWalletRecoveryCodeBackup-Cjx-X-pP.js";import{t as d}from"./walletCustodyOperation-DimzAbCB.js";import{t as f}from"./webauthnPromptCoordinator-npsSRD51.js";import{i as p}from"./collectAuthenticationCredentialForChallengeB64u-I4wq8OGq.js";function m(e){if(typeof e!=`object`||!e||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)return{kind:`invalid`};let t=new Map(Object.entries(e)),n=[...t.keys()];if(t.size===5&&n.every(e=>[`ok`,`challengeId`,`challenge_digest`,`expiresAtMs`,`otpChannel`].includes(e))&&t.get(`ok`)===!0)return{kind:`success`,challengeId:t.get(`challengeId`),challengeDigest:t.get(`challenge_digest`),expiresAtMs:t.get(`expiresAtMs`),otpChannel:t.get(`otpChannel`)};let r=[`ok`,`code`,`message`,`retryAfterMs`];if((t.size===3||t.size===4)&&n.every(e=>r.includes(e))&&t.get(`ok`)===!1&&typeof t.get(`code`)==`string`&&typeof t.get(`message`)==`string`&&(t.size===3||typeof t.get(`retryAfterMs`)==`number`)){let e=t.get(`message`);return{kind:`failure`,message:typeof e==`string`&&e.trim()?e.trim():null}}return{kind:`invalid`}}async function h(e){let t;try{t=await S({relayUrl:e.relayUrl,path:`/wallets/custody/email-otp/challenge`,body:{walletId:e.walletId,providerSubjectId:e.providerSubjectId,operation:e.operation,payload:e.payload,...e.requestOrigin?{requestOrigin:e.requestOrigin}:{}},fetchImpl:e.fetchImpl})}catch(e){return{kind:`transport_failed`,message:e instanceof Error?e.message:`Email OTP challenge request failed`}}let n=m(await t.json().catch(()=>null)),r=n.kind===`failure`&&n.message?n.message:``;if(t.status!==200||n.kind!==`success`)return{kind:t.status>=400&&t.status<500?`rejected`:`transport_failed`,message:r||`Email OTP challenge failed (HTTP ${t.status})`};let i=typeof n.challengeId==`string`?n.challengeId.trim():``,a=typeof n.challengeDigest==`string`?n.challengeDigest.trim():``,o=Number(n.expiresAtMs),s=typeof n.otpChannel==`string`?n.otpChannel.trim():``;return!i||!a||!Number.isSafeInteger(o)||o<=0||!s?{kind:`transport_failed`,message:`Email OTP challenge returned an unusable payload`}:{kind:`ready`,challengeId:i,challenge_digest:a,expiresAtMs:o,otpChannel:s}}function g(e){if(typeof e!=`object`||!e||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)return{kind:`invalid`};let t=new Map(Object.entries(e)),n=[`ok`,`activeCodeCount`,`totalCodeCount`,`issuedAtMs`,`storeVersion`,`backupOutstanding`],r=[...t.keys()];if(t.size===n.length&&r.every(e=>n.includes(e))&&t.get(`ok`)===!0)return{kind:`success`,activeCodeCount:t.get(`activeCodeCount`),totalCodeCount:t.get(`totalCodeCount`),issuedAtMs:t.get(`issuedAtMs`),storeVersion:t.get(`storeVersion`),backupOutstanding:t.get(`backupOutstanding`)};let i=[`ok`,`code`,`message`];if(t.size===i.length&&r.every(e=>i.includes(e))&&t.get(`ok`)===!1&&typeof t.get(`code`)==`string`){let e=t.get(`message`);return{kind:`failure`,message:typeof e==`string`&&e.trim()?e.trim():null}}return{kind:`invalid`}}async function _(e){let t;try{t=await S({relayUrl:e.relayUrl,path:`/wallets/${encodeURIComponent(e.walletId)}/recovery/status`,body:{requestId:e.requestId,factorProof:e.factorProof},fetchImpl:e.fetchImpl})}catch(e){return{kind:`transport_failed`,message:e instanceof Error?e.message:`recovery status request failed`}}let n=g(await t.json().catch(()=>null)),r=n.kind===`failure`&&n.message?n.message:``;if(t.status===401||t.status===403)return{kind:`unauthorized`,message:r||`recovery status is unauthorized`};if(t.status===404)return{kind:`no_recovery_set`,message:r||`this wallet has no recovery set`};if(t.status!==200)return{kind:`transport_failed`,message:r||`recovery status failed (HTTP ${t.status})`};if(n.kind!==`success`)return{kind:`transport_failed`,message:`recovery status returned an unusable payload`};let i=Number(n.activeCodeCount),a=Number(n.totalCodeCount),o=Number(n.issuedAtMs),s=typeof n.storeVersion==`string`?n.storeVersion.trim():``;return!Number.isSafeInteger(i)||i<0||!Number.isSafeInteger(a)||a<i||!Number.isSafeInteger(o)||o<=0||!s||typeof n.backupOutstanding!=`boolean`?{kind:`transport_failed`,message:`recovery status returned an unusable payload`}:{kind:`ready`,walletId:e.walletId,activeCodeCount:i,totalCodeCount:a,issuedAtMs:o,storeVersion:s,backupOutstanding:n.backupOutstanding,pendingLocalBackup:!1}}function v(e){if(typeof e!=`object`||!e||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)return{kind:`invalid`};let t=new Map(Object.entries(e)),n=[...t.keys()];if(t.size===2&&n.includes(`ok`)&&n.includes(`issuedAtMs`)&&t.get(`ok`)===!0)return{kind:`success`,issuedAtMs:t.get(`issuedAtMs`)};if(t.size===3&&n.includes(`ok`)&&n.includes(`code`)&&n.includes(`message`)&&t.get(`ok`)===!1&&typeof t.get(`code`)==`string`){let e=t.get(`message`);return{kind:`failure`,message:typeof e==`string`&&e.trim()?e.trim():null}}return{kind:`invalid`}}async function y(e){let t;try{t=await S({relayUrl:e.relayUrl,path:`/wallets/recovery/acknowledge-backup`,body:{walletId:e.walletId,requestId:e.requestId,expectedIssuedAtMs:e.expectedIssuedAtMs,factorProof:e.factorProof},fetchImpl:e.fetchImpl})}catch(e){return{kind:`transport_failed`,message:e instanceof Error?e.message:`recovery backup acknowledgement failed`}}let n=v(await t.json().catch(()=>null)),r=n.kind===`failure`&&n.message?n.message:``;if(t.status===401||t.status===403)return{kind:`unauthorized`,message:r||`recovery backup acknowledgement is unauthorized`};if(t.status===404)return{kind:`no_recovery_set`,message:r||`this wallet has no recovery set`};if(t.status===409)return{kind:`conflict`,message:r||`Recovery codes changed. Check status and review the current set.`};if(t.status!==200)return{kind:`transport_failed`,message:r||`recovery backup acknowledgement failed (HTTP ${t.status})`};if(n.kind!==`success`)return{kind:`transport_failed`,message:`recovery backup acknowledgement returned an unusable payload`};let i=Number(n.issuedAtMs);return!Number.isSafeInteger(i)||i<=0?{kind:`transport_failed`,message:`recovery backup acknowledgement returned an unusable payload`}:{kind:`acknowledged`,walletId:e.walletId,issuedAtMs:i}}function b(e){if(typeof e!=`object`||!e||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)return{kind:`invalid`};let t=new Map(Object.entries(e)),n=[...t.keys()];if(t.size===3&&n.every(e=>[`ok`,`issuedAtMs`,`storeVersion`].includes(e))&&t.get(`ok`)===!0)return{kind:`success`,issuedAtMs:t.get(`issuedAtMs`),storeVersion:t.get(`storeVersion`)};if(t.size===3&&n.every(e=>[`ok`,`code`,`message`].includes(e))&&t.get(`ok`)===!1&&typeof t.get(`code`)==`string`){let e=t.get(`message`);return{kind:`failure`,message:typeof e==`string`&&e.trim()?e.trim():null}}return{kind:`invalid`}}async function x(e){let t=await S({relayUrl:e.relayUrl,path:`/wallets/recovery/rotate`,body:{walletId:e.walletId,expectedStoreVersion:e.expectedStoreVersion,manifestKekWraps:e.replacement.manifestKekWraps,entries:[e.replacement.entry],recoveryCodeLocators:e.recoveryCodeLocators,factorProof:e.factorProof},fetchImpl:e.fetchImpl}),n=b(await t.json().catch(()=>null)),r=n.kind===`failure`&&n.message?n.message:``;if(t.status===200&&n.kind===`success`){let e=Number(n.issuedAtMs),t=typeof n.storeVersion==`string`?n.storeVersion.trim():``;return!Number.isSafeInteger(e)||e<=0||!t?{kind:`transport_failed`,message:`rotation returned an unusable response`}:{kind:`rotated`,issuedAtMs:e,storeVersion:t}}return t.status===404?{kind:`no_recovery_set`,message:r||`no recovery set`}:t.status===409?{kind:`conflict`,message:r||`recovery set changed`}:t.status===400?{kind:`rejected`,message:r||`rotation rejected`}:{kind:`transport_failed`,message:r||`rotation failed (HTTP ${t.status})`}}async function S(n){let r=`${t(n.relayUrl)}${n.path}`;return await(n.fetchImpl||fetch)(r,e({headers:{Accept:`application/json`},body:n.body}))}var C=class extends Error{code=`wallet_origin_webauthn_unavailable`;constructor(e){super(e),this.name=`WalletOriginWebAuthnUnavailableError`}};async function w(e,t,n){let r=T(e,t);try{return e===`create`?await navigator.credentials.create({publicKey:r,...n.abortSignal?{signal:n.abortSignal}:{}}):await navigator.credentials.get({publicKey:r,...n.abortSignal?{signal:n.abortSignal}:{}})}catch(t){throw e===`create`&&(N(t)||P(t))?new C(`Wallet-origin WebAuthn registration is unavailable: ${F(t)}`):t}}function T(e,t){return e===`create`?E(t):D(t)}function E(e){return{...e,challenge:M(e.challenge),user:{...e.user,id:M(e.user.id)},excludeCredentials:e.excludeCredentials?.map(O),extensions:k(e.extensions)}}function D(e){return{...e,challenge:M(e.challenge),allowCredentials:e.allowCredentials?.map(O),extensions:k(e.extensions)}}function O(e){return{...e,id:M(e.id)}}function k(e){if(!e)return e;let t={...e},n=t.prf;if(n&&typeof n==`object`){let e={...n};if(e.eval&&typeof e.eval==`object`&&(e.eval=A(e.eval)),e.evalByCredential&&typeof e.evalByCredential==`object`){let t={};for(let[n,r]of Object.entries(e.evalByCredential))t[n]=r&&typeof r==`object`?A(r):r;e.evalByCredential=t}t.prf=e}return t}function A(e){return{...e,...j(e.first)?{first:M(e.first)}:{},...j(e.second)?{second:M(e.second)}:{}}}function j(e){return e instanceof ArrayBuffer||ArrayBuffer.isView(e)}function M(e){if(e instanceof ArrayBuffer)return e.slice(0);let t=e,n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength).slice();if(e instanceof DataView)return new DataView(n.buffer);let r=Object.getPrototypeOf(e).constructor;return new r(n.buffer)}function N(e){let t=F(e);return/origin of the document is not the same as its ancestors/i.test(t)}function P(e){let t=I(e),n=F(e),r=t===`NotAllowedError`,i=/document is not focused|not focused|focus/i.test(n);return!!(r&&i)}function F(e){return String(e?.message||``)}function I(e){let t=e?.name;return typeof t==`string`?t:``}function L(e,t){return(e||t||``).toLowerCase()}function R(e){let t=n(String(e||``));if(t.length!==32)throw Error(`Invalid WebAuthn challenge: expected 32 bytes, got ${t.length}`);return t}function z(e){if(e.kind!==`wallet_registration`)throw Error(`Wallet registration challenge is unavailable`);return e.challengeB64u}function B(e){let t=a(String(e.walletId||``).trim());if(String(e.intendedUserName||``).trim()!==String(t))throw Error(`WebAuthn registration user.name must match walletId`);return{walletId:t}}var V=class{rpIdOverride;abortController;removePageAbortHandlers;removeExternalAbortListener;constructor(e){this.rpIdOverride=e}getRpId(){try{return L(this.rpIdOverride,window?.location?.hostname)}catch{return this.rpIdOverride||``}}getAuthenticationCredentialsSerializedForChallengeB64u(e){let t=`webauthn-get-${i(12,`WebAuthn get request IDs`)}`;return f.runImmediate({owner:{kind:`wallet_request`,requestId:t,operation:`authentication`},operation:this.executeAuthenticationCredential.bind(this,e)})}async executeAuthenticationCredential({subjectId:e,challengeB64u:t,allowCredentials:r=[],includeSecondPrfOutput:i=!1,cancellation:a={kind:`none`}}){this.abortController=new AbortController,this.removePageAbortHandlers=q(this.abortController),this.removeExternalAbortListener=H(this.abortController,a);let o=this.getRpId(),u={challenge:R(t),rpId:o,userVerification:`preferred`,timeout:6e4,extensions:{prf:{eval:{first:l(),second:s()}}}};r.length>0&&(u.allowCredentials=r.map(e=>({id:n(e.id),type:`public-key`,transports:e.transports})));try{let e=c({credential:await w(`get`,u,{abortSignal:this.abortController.signal}),firstPrfOutput:!0,secondPrfOutput:i});return G(e,t),e}finally{this.removePageAbortHandlers?.(),this.removePageAbortHandlers=void 0,this.removeExternalAbortListener?.(),this.removeExternalAbortListener=void 0,this.abortController=void 0}}generateRegistrationCredentialsInternal(e){switch(e.prompt.kind){case`reserved`:return f.runReserved({reservation:e.prompt.reservation,owner:e.prompt.owner,operation:this.executeRegistrationCredential.bind(this,e)});case`immediate`:return f.runImmediate({owner:{kind:`wallet_request`,requestId:e.prompt.requestId,operation:`registration`},operation:this.executeRegistrationCredential.bind(this,e)})}}async executeRegistrationCredential(e){this.abortController=new AbortController,this.removePageAbortHandlers=q(this.abortController),this.removeExternalAbortListener=H(this.abortController,e.prompt.cancellation);let t=this.getRpId(),r=B({walletId:e.walletId,intendedUserName:e.intendedUserName}),i=e.kind===`wallet_recovery`?e.recoveryRegistration:null,a=e.kind===`wallet_add_auth_method`?e.registration:null,o=i??a,c=o?.rpId??t;if(o&&c!==t)throw Error(`Wallet recovery RP ID does not match the wallet origin`);let u=o?{challenge:R(o.challengeB64u),rp:{name:`Seams Wallet`,id:c},user:{id:n(o.user.idB64u),name:o.user.name,displayName:o.user.displayName},pubKeyCredParams:o.pubKeyCredParams.map(e=>({...e})),authenticatorSelection:{...o.authenticatorSelection},timeout:o.timeoutMs,attestation:o.attestation,extensions:{prf:{eval:{first:n(o.extensions.prf.eval.firstB64u),second:n(o.extensions.prf.eval.secondB64u)}}},excludeCredentials:o.excludeCredentials.map(e=>({type:e.type,id:n(e.id)}))}:{challenge:R(z(e)),rp:{name:`WebAuthn Passkey`,id:c},user:{id:new TextEncoder().encode(K(e.walletId,e.signerSlot)),name:r.walletId,displayName:r.walletId},pubKeyCredParams:[{alg:-7,type:`public-key`},{alg:-257,type:`public-key`}],authenticatorSelection:{residentKey:`required`,userVerification:`preferred`},timeout:6e4,attestation:`none`,extensions:{prf:{eval:{first:l(),second:s()}}}};try{return await w(`create`,u,{abortSignal:this.abortController.signal})}finally{this.removePageAbortHandlers?.(),this.removePageAbortHandlers=void 0,this.removeExternalAbortListener?.(),this.removeExternalAbortListener=void 0,this.abortController=void 0}}};function H(e,t){if(t.kind===`none`)return;let n=t.signal,r=e.abort.bind(e);if(n.aborted){r();return}return n.addEventListener(`abort`,r,{once:!0}),n.removeEventListener.bind(n,`abort`,r)}function U(e){return String(e||``).trim().replace(/=+$/g,``)}function W(e){let t=String(e.response?.clientDataJSON||``).trim();if(!t)throw Error(`WebAuthn authentication response missing clientDataJSON`);let r=``;try{r=new TextDecoder().decode(n(t))}catch(e){throw Error(`WebAuthn authentication response has invalid clientDataJSON encoding: ${e instanceof Error?e.message:String(e)}`)}let i;try{i=JSON.parse(r)}catch(e){throw Error(`WebAuthn authentication response has invalid clientDataJSON JSON: ${e instanceof Error?e.message:String(e)}`)}let a=i&&typeof i==`object`?i.challenge:void 0;if(typeof a!=`string`||!a.trim())throw Error(`WebAuthn authentication response clientDataJSON missing challenge`);return a}function G(e,t){let n=U(W(e)),r=U(t);if(n!==r)throw Error(`Unexpected authentication response challenge "${n}", expected "${r}"`)}function K(e,t){return t===void 0||t===1?e:`${e} (${t})`}function q(e){let t=()=>{document.hidden&&e.abort()},n=()=>{e.abort()},r=()=>{e.abort()};return document.addEventListener(`visibilitychange`,t,{passive:!0}),window.addEventListener(`pagehide`,n,{passive:!0}),window.addEventListener(`beforeunload`,r,{passive:!0}),()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`pagehide`,n),window.removeEventListener(`beforeunload`,r)}}async function J(e){let t=e.request.payload.walletId,n=window.location.origin,r=await d({walletId:t,operation:e.request.operation,payload:e.request.payload,requestOrigin:n}),i=await p({credentialStore:o,touchIdPrompt:new V(e.rpId),walletId:t,challengeB64u:r,includeSecondPrfOutput:!1}),a=ee(i);if(!a)throw Error(`Wallet recovery proof did not receive a passkey credential`);return{kind:`passkey`,walletId:t,rpId:e.rpId,credentialIdB64u:a,challenge_digest:r,webauthn_authentication:u(i)}}function Y(){return r(`wallet-recovery-admin`,16,`wallet recovery administration request IDs`)}async function X(e){let t=Y(),n={walletId:e.walletId,requestId:t},r=await J({rpId:e.rpId,request:{operation:`recovery_status`,payload:n}});return await _({relayUrl:e.relayUrl,walletId:e.walletId,requestId:t,factorProof:r})}async function Z(e){let t=Y(),n={walletId:e.walletId,requestId:t,expectedIssuedAtMs:e.expectedIssuedAtMs},r=await J({rpId:e.rpId,request:{operation:`recovery_backup_acknowledge`,payload:n}});return await y({relayUrl:e.relayUrl,walletId:e.walletId,requestId:t,expectedIssuedAtMs:e.expectedIssuedAtMs,factorProof:r})}async function Q(e){let t=await o.resolveSelectedWalletAuthority(e);if(t.kind!==`resolved`||t.selection.lockState!==`unlocked`||String(t.selection.walletId)!==e||t.selection.walletAuthMethodId!==t.authMethod.walletAuthMethodId||t.authMethod.kind!==`email_otp`||t.authMethod.status!==`active`||t.authority.state!==`active`||String(t.authMethod.walletId)!==e||String(t.authority.walletId)!==e)throw Error(`Unlock this wallet with its active Email OTP method`);let n=await o.listWalletAuthMethodsForWallet(e),r=null;for(let e of n)if(!(e.kind!==`email_otp`||e.status!==`active`||e.localStatus!==`synced`||String(e.authority.bindingId)!==String(t.authMethod.walletAuthMethodId))){if(r!==null)throw Error(`The selected Email OTP owner method is duplicated`);r=String(e.authority.factor.providerUserId||``).trim()}if(!r)throw Error(`The selected Email OTP owner method is unavailable on this wallet`);return{walletAuthMethodId:String(t.authMethod.walletAuthMethodId),providerSubjectId:r}}async function $(e){let t=e.request.payload.walletId,{providerSubjectId:n}=await Q(t),r=window.location.origin,i=await d({walletId:t,operation:e.request.operation,payload:e.request.payload,requestOrigin:r}),a=await h({relayUrl:e.relayUrl,walletId:t,providerSubjectId:n,operation:e.request.operation,payload:e.request.payload,requestOrigin:r});if(a.kind!==`ready`)throw Error(a.message);if(a.challenge_digest!==i)throw Error(`Recovery Email OTP challenge does not match this operation`);let o=await e.context.signingEngine.requestEmailOtpOwnerConfirmation({purpose:e.request.operation,walletId:t,emailAddress:`your email`,challengeId:a.challengeId});if(o.challengeId!==a.challengeId)throw Error(`Recovery Email OTP confirmation changed its challenge`);return{kind:`email_otp`,provider_subject_id:n,challenge_id:o.challengeId,otp_code:o.otpCode,challenge_digest:i}}async function te(e){let t=Y(),n={walletId:e.walletId,requestId:t},r=await $({context:e.context,relayUrl:e.relayUrl,request:{operation:`recovery_status`,payload:n}});return await _({relayUrl:e.relayUrl,walletId:e.walletId,requestId:t,factorProof:r})}async function ne(e){let t=Y(),n={walletId:e.walletId,requestId:t,expectedIssuedAtMs:e.expectedIssuedAtMs},r=await $({context:e.context,relayUrl:e.relayUrl,request:{operation:`recovery_backup_acknowledge`,payload:n}});return await y({relayUrl:e.relayUrl,walletId:e.walletId,requestId:t,expectedIssuedAtMs:e.expectedIssuedAtMs,factorProof:r})}export{X as a,_ as c,te as i,h as l,Z as n,Q as o,$ as r,V as s,ne as t,x as u};
1
+ import{o as e,u as t}from"./participants-BXdREC5k.js";import{r as n}from"./base64-BmKR3UqU.js";import{r,t as i}from"./secureRandomId-8LSc91aN.js";import{o as a}from"./signerSlot-D2RZnb27.js";import{t as o}from"./indexedDB-C4SDsyOG.js";import{n as s,s as c,t as l,u}from"./helpers-Dubwo5uK.js";import{i as ee}from"./pendingWalletRecoveryCodeBackup-B-R_U34I.js";import{t as d}from"./walletCustodyOperation-DimzAbCB.js";import{t as f}from"./webauthnPromptCoordinator-npsSRD51.js";import{i as p}from"./collectAuthenticationCredentialForChallengeB64u-I4wq8OGq.js";function m(e){if(typeof e!=`object`||!e||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)return{kind:`invalid`};let t=new Map(Object.entries(e)),n=[...t.keys()];if(t.size===5&&n.every(e=>[`ok`,`challengeId`,`challenge_digest`,`expiresAtMs`,`otpChannel`].includes(e))&&t.get(`ok`)===!0)return{kind:`success`,challengeId:t.get(`challengeId`),challengeDigest:t.get(`challenge_digest`),expiresAtMs:t.get(`expiresAtMs`),otpChannel:t.get(`otpChannel`)};let r=[`ok`,`code`,`message`,`retryAfterMs`];if((t.size===3||t.size===4)&&n.every(e=>r.includes(e))&&t.get(`ok`)===!1&&typeof t.get(`code`)==`string`&&typeof t.get(`message`)==`string`&&(t.size===3||typeof t.get(`retryAfterMs`)==`number`)){let e=t.get(`message`);return{kind:`failure`,message:typeof e==`string`&&e.trim()?e.trim():null}}return{kind:`invalid`}}async function h(e){let t;try{t=await S({relayUrl:e.relayUrl,path:`/wallets/custody/email-otp/challenge`,body:{walletId:e.walletId,providerSubjectId:e.providerSubjectId,operation:e.operation,payload:e.payload,...e.requestOrigin?{requestOrigin:e.requestOrigin}:{}},fetchImpl:e.fetchImpl})}catch(e){return{kind:`transport_failed`,message:e instanceof Error?e.message:`Email OTP challenge request failed`}}let n=m(await t.json().catch(()=>null)),r=n.kind===`failure`&&n.message?n.message:``;if(t.status!==200||n.kind!==`success`)return{kind:t.status>=400&&t.status<500?`rejected`:`transport_failed`,message:r||`Email OTP challenge failed (HTTP ${t.status})`};let i=typeof n.challengeId==`string`?n.challengeId.trim():``,a=typeof n.challengeDigest==`string`?n.challengeDigest.trim():``,o=Number(n.expiresAtMs),s=typeof n.otpChannel==`string`?n.otpChannel.trim():``;return!i||!a||!Number.isSafeInteger(o)||o<=0||!s?{kind:`transport_failed`,message:`Email OTP challenge returned an unusable payload`}:{kind:`ready`,challengeId:i,challenge_digest:a,expiresAtMs:o,otpChannel:s}}function g(e){if(typeof e!=`object`||!e||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)return{kind:`invalid`};let t=new Map(Object.entries(e)),n=[`ok`,`activeCodeCount`,`totalCodeCount`,`issuedAtMs`,`storeVersion`,`backupOutstanding`],r=[...t.keys()];if(t.size===n.length&&r.every(e=>n.includes(e))&&t.get(`ok`)===!0)return{kind:`success`,activeCodeCount:t.get(`activeCodeCount`),totalCodeCount:t.get(`totalCodeCount`),issuedAtMs:t.get(`issuedAtMs`),storeVersion:t.get(`storeVersion`),backupOutstanding:t.get(`backupOutstanding`)};let i=[`ok`,`code`,`message`];if(t.size===i.length&&r.every(e=>i.includes(e))&&t.get(`ok`)===!1&&typeof t.get(`code`)==`string`){let e=t.get(`message`);return{kind:`failure`,message:typeof e==`string`&&e.trim()?e.trim():null}}return{kind:`invalid`}}async function _(e){let t;try{t=await S({relayUrl:e.relayUrl,path:`/wallets/${encodeURIComponent(e.walletId)}/recovery/status`,body:{requestId:e.requestId,factorProof:e.factorProof},fetchImpl:e.fetchImpl})}catch(e){return{kind:`transport_failed`,message:e instanceof Error?e.message:`recovery status request failed`}}let n=g(await t.json().catch(()=>null)),r=n.kind===`failure`&&n.message?n.message:``;if(t.status===401||t.status===403)return{kind:`unauthorized`,message:r||`recovery status is unauthorized`};if(t.status===404)return{kind:`no_recovery_set`,message:r||`this wallet has no recovery set`};if(t.status!==200)return{kind:`transport_failed`,message:r||`recovery status failed (HTTP ${t.status})`};if(n.kind!==`success`)return{kind:`transport_failed`,message:`recovery status returned an unusable payload`};let i=Number(n.activeCodeCount),a=Number(n.totalCodeCount),o=Number(n.issuedAtMs),s=typeof n.storeVersion==`string`?n.storeVersion.trim():``;return!Number.isSafeInteger(i)||i<0||!Number.isSafeInteger(a)||a<i||!Number.isSafeInteger(o)||o<=0||!s||typeof n.backupOutstanding!=`boolean`?{kind:`transport_failed`,message:`recovery status returned an unusable payload`}:{kind:`ready`,walletId:e.walletId,activeCodeCount:i,totalCodeCount:a,issuedAtMs:o,storeVersion:s,backupOutstanding:n.backupOutstanding,pendingLocalBackup:!1}}function v(e){if(typeof e!=`object`||!e||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)return{kind:`invalid`};let t=new Map(Object.entries(e)),n=[...t.keys()];if(t.size===2&&n.includes(`ok`)&&n.includes(`issuedAtMs`)&&t.get(`ok`)===!0)return{kind:`success`,issuedAtMs:t.get(`issuedAtMs`)};if(t.size===3&&n.includes(`ok`)&&n.includes(`code`)&&n.includes(`message`)&&t.get(`ok`)===!1&&typeof t.get(`code`)==`string`){let e=t.get(`message`);return{kind:`failure`,message:typeof e==`string`&&e.trim()?e.trim():null}}return{kind:`invalid`}}async function y(e){let t;try{t=await S({relayUrl:e.relayUrl,path:`/wallets/recovery/acknowledge-backup`,body:{walletId:e.walletId,requestId:e.requestId,expectedIssuedAtMs:e.expectedIssuedAtMs,factorProof:e.factorProof},fetchImpl:e.fetchImpl})}catch(e){return{kind:`transport_failed`,message:e instanceof Error?e.message:`recovery backup acknowledgement failed`}}let n=v(await t.json().catch(()=>null)),r=n.kind===`failure`&&n.message?n.message:``;if(t.status===401||t.status===403)return{kind:`unauthorized`,message:r||`recovery backup acknowledgement is unauthorized`};if(t.status===404)return{kind:`no_recovery_set`,message:r||`this wallet has no recovery set`};if(t.status===409)return{kind:`conflict`,message:r||`Recovery codes changed. Check status and review the current set.`};if(t.status!==200)return{kind:`transport_failed`,message:r||`recovery backup acknowledgement failed (HTTP ${t.status})`};if(n.kind!==`success`)return{kind:`transport_failed`,message:`recovery backup acknowledgement returned an unusable payload`};let i=Number(n.issuedAtMs);return!Number.isSafeInteger(i)||i<=0?{kind:`transport_failed`,message:`recovery backup acknowledgement returned an unusable payload`}:{kind:`acknowledged`,walletId:e.walletId,issuedAtMs:i}}function b(e){if(typeof e!=`object`||!e||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)return{kind:`invalid`};let t=new Map(Object.entries(e)),n=[...t.keys()];if(t.size===3&&n.every(e=>[`ok`,`issuedAtMs`,`storeVersion`].includes(e))&&t.get(`ok`)===!0)return{kind:`success`,issuedAtMs:t.get(`issuedAtMs`),storeVersion:t.get(`storeVersion`)};if(t.size===3&&n.every(e=>[`ok`,`code`,`message`].includes(e))&&t.get(`ok`)===!1&&typeof t.get(`code`)==`string`){let e=t.get(`message`);return{kind:`failure`,message:typeof e==`string`&&e.trim()?e.trim():null}}return{kind:`invalid`}}async function x(e){let t=await S({relayUrl:e.relayUrl,path:`/wallets/recovery/rotate`,body:{walletId:e.walletId,expectedStoreVersion:e.expectedStoreVersion,manifestKekWraps:e.replacement.manifestKekWraps,entries:[e.replacement.entry],recoveryCodeLocators:e.recoveryCodeLocators,factorProof:e.factorProof},fetchImpl:e.fetchImpl}),n=b(await t.json().catch(()=>null)),r=n.kind===`failure`&&n.message?n.message:``;if(t.status===200&&n.kind===`success`){let e=Number(n.issuedAtMs),t=typeof n.storeVersion==`string`?n.storeVersion.trim():``;return!Number.isSafeInteger(e)||e<=0||!t?{kind:`transport_failed`,message:`rotation returned an unusable response`}:{kind:`rotated`,issuedAtMs:e,storeVersion:t}}return t.status===404?{kind:`no_recovery_set`,message:r||`no recovery set`}:t.status===409?{kind:`conflict`,message:r||`recovery set changed`}:t.status===400?{kind:`rejected`,message:r||`rotation rejected`}:{kind:`transport_failed`,message:r||`rotation failed (HTTP ${t.status})`}}async function S(n){let r=`${t(n.relayUrl)}${n.path}`;return await(n.fetchImpl||fetch)(r,e({headers:{Accept:`application/json`},body:n.body}))}var C=class extends Error{code=`wallet_origin_webauthn_unavailable`;constructor(e){super(e),this.name=`WalletOriginWebAuthnUnavailableError`}};async function w(e,t,n){let r=T(e,t);try{return e===`create`?await navigator.credentials.create({publicKey:r,...n.abortSignal?{signal:n.abortSignal}:{}}):await navigator.credentials.get({publicKey:r,...n.abortSignal?{signal:n.abortSignal}:{}})}catch(t){throw e===`create`&&(N(t)||P(t))?new C(`Wallet-origin WebAuthn registration is unavailable: ${F(t)}`):t}}function T(e,t){return e===`create`?E(t):D(t)}function E(e){return{...e,challenge:M(e.challenge),user:{...e.user,id:M(e.user.id)},excludeCredentials:e.excludeCredentials?.map(O),extensions:k(e.extensions)}}function D(e){return{...e,challenge:M(e.challenge),allowCredentials:e.allowCredentials?.map(O),extensions:k(e.extensions)}}function O(e){return{...e,id:M(e.id)}}function k(e){if(!e)return e;let t={...e},n=t.prf;if(n&&typeof n==`object`){let e={...n};if(e.eval&&typeof e.eval==`object`&&(e.eval=A(e.eval)),e.evalByCredential&&typeof e.evalByCredential==`object`){let t={};for(let[n,r]of Object.entries(e.evalByCredential))t[n]=r&&typeof r==`object`?A(r):r;e.evalByCredential=t}t.prf=e}return t}function A(e){return{...e,...j(e.first)?{first:M(e.first)}:{},...j(e.second)?{second:M(e.second)}:{}}}function j(e){return e instanceof ArrayBuffer||ArrayBuffer.isView(e)}function M(e){if(e instanceof ArrayBuffer)return e.slice(0);let t=e,n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength).slice();if(e instanceof DataView)return new DataView(n.buffer);let r=Object.getPrototypeOf(e).constructor;return new r(n.buffer)}function N(e){let t=F(e);return/origin of the document is not the same as its ancestors/i.test(t)}function P(e){let t=I(e),n=F(e),r=t===`NotAllowedError`,i=/document is not focused|not focused|focus/i.test(n);return!!(r&&i)}function F(e){return String(e?.message||``)}function I(e){let t=e?.name;return typeof t==`string`?t:``}function L(e,t){return(e||t||``).toLowerCase()}function R(e){let t=n(String(e||``));if(t.length!==32)throw Error(`Invalid WebAuthn challenge: expected 32 bytes, got ${t.length}`);return t}function z(e){if(e.kind!==`wallet_registration`)throw Error(`Wallet registration challenge is unavailable`);return e.challengeB64u}function B(e){let t=a(String(e.walletId||``).trim());if(String(e.intendedUserName||``).trim()!==String(t))throw Error(`WebAuthn registration user.name must match walletId`);return{walletId:t}}var V=class{rpIdOverride;abortController;removePageAbortHandlers;removeExternalAbortListener;constructor(e){this.rpIdOverride=e}getRpId(){try{return L(this.rpIdOverride,window?.location?.hostname)}catch{return this.rpIdOverride||``}}getAuthenticationCredentialsSerializedForChallengeB64u(e){let t=`webauthn-get-${i(12,`WebAuthn get request IDs`)}`;return f.runImmediate({owner:{kind:`wallet_request`,requestId:t,operation:`authentication`},operation:this.executeAuthenticationCredential.bind(this,e)})}async executeAuthenticationCredential({subjectId:e,challengeB64u:t,allowCredentials:r=[],includeSecondPrfOutput:i=!1,cancellation:a={kind:`none`}}){this.abortController=new AbortController,this.removePageAbortHandlers=q(this.abortController),this.removeExternalAbortListener=H(this.abortController,a);let o=this.getRpId(),u={challenge:R(t),rpId:o,userVerification:`preferred`,timeout:6e4,extensions:{prf:{eval:{first:l(),second:s()}}}};r.length>0&&(u.allowCredentials=r.map(e=>({id:n(e.id),type:`public-key`,transports:e.transports})));try{let e=c({credential:await w(`get`,u,{abortSignal:this.abortController.signal}),firstPrfOutput:!0,secondPrfOutput:i});return G(e,t),e}finally{this.removePageAbortHandlers?.(),this.removePageAbortHandlers=void 0,this.removeExternalAbortListener?.(),this.removeExternalAbortListener=void 0,this.abortController=void 0}}generateRegistrationCredentialsInternal(e){switch(e.prompt.kind){case`reserved`:return f.runReserved({reservation:e.prompt.reservation,owner:e.prompt.owner,operation:this.executeRegistrationCredential.bind(this,e)});case`immediate`:return f.runImmediate({owner:{kind:`wallet_request`,requestId:e.prompt.requestId,operation:`registration`},operation:this.executeRegistrationCredential.bind(this,e)})}}async executeRegistrationCredential(e){this.abortController=new AbortController,this.removePageAbortHandlers=q(this.abortController),this.removeExternalAbortListener=H(this.abortController,e.prompt.cancellation);let t=this.getRpId(),r=B({walletId:e.walletId,intendedUserName:e.intendedUserName}),i=e.kind===`wallet_recovery`?e.recoveryRegistration:null,a=e.kind===`wallet_add_auth_method`?e.registration:null,o=i??a,c=o?.rpId??t;if(o&&c!==t)throw Error(`Wallet recovery RP ID does not match the wallet origin`);let u=o?{challenge:R(o.challengeB64u),rp:{name:`Seams Wallet`,id:c},user:{id:n(o.user.idB64u),name:o.user.name,displayName:o.user.displayName},pubKeyCredParams:o.pubKeyCredParams.map(e=>({...e})),authenticatorSelection:{...o.authenticatorSelection},timeout:o.timeoutMs,attestation:o.attestation,extensions:{prf:{eval:{first:n(o.extensions.prf.eval.firstB64u),second:n(o.extensions.prf.eval.secondB64u)}}},excludeCredentials:o.excludeCredentials.map(e=>({type:e.type,id:n(e.id)}))}:{challenge:R(z(e)),rp:{name:`WebAuthn Passkey`,id:c},user:{id:new TextEncoder().encode(K(e.walletId,e.signerSlot)),name:r.walletId,displayName:r.walletId},pubKeyCredParams:[{alg:-7,type:`public-key`},{alg:-257,type:`public-key`}],authenticatorSelection:{residentKey:`required`,userVerification:`preferred`},timeout:6e4,attestation:`none`,extensions:{prf:{eval:{first:l(),second:s()}}}};try{return await w(`create`,u,{abortSignal:this.abortController.signal})}finally{this.removePageAbortHandlers?.(),this.removePageAbortHandlers=void 0,this.removeExternalAbortListener?.(),this.removeExternalAbortListener=void 0,this.abortController=void 0}}};function H(e,t){if(t.kind===`none`)return;let n=t.signal,r=e.abort.bind(e);if(n.aborted){r();return}return n.addEventListener(`abort`,r,{once:!0}),n.removeEventListener.bind(n,`abort`,r)}function U(e){return String(e||``).trim().replace(/=+$/g,``)}function W(e){let t=String(e.response?.clientDataJSON||``).trim();if(!t)throw Error(`WebAuthn authentication response missing clientDataJSON`);let r=``;try{r=new TextDecoder().decode(n(t))}catch(e){throw Error(`WebAuthn authentication response has invalid clientDataJSON encoding: ${e instanceof Error?e.message:String(e)}`)}let i;try{i=JSON.parse(r)}catch(e){throw Error(`WebAuthn authentication response has invalid clientDataJSON JSON: ${e instanceof Error?e.message:String(e)}`)}let a=i&&typeof i==`object`?i.challenge:void 0;if(typeof a!=`string`||!a.trim())throw Error(`WebAuthn authentication response clientDataJSON missing challenge`);return a}function G(e,t){let n=U(W(e)),r=U(t);if(n!==r)throw Error(`Unexpected authentication response challenge "${n}", expected "${r}"`)}function K(e,t){return t===void 0||t===1?e:`${e} (${t})`}function q(e){let t=()=>{document.hidden&&e.abort()},n=()=>{e.abort()},r=()=>{e.abort()};return document.addEventListener(`visibilitychange`,t,{passive:!0}),window.addEventListener(`pagehide`,n,{passive:!0}),window.addEventListener(`beforeunload`,r,{passive:!0}),()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`pagehide`,n),window.removeEventListener(`beforeunload`,r)}}async function J(e){let t=e.request.payload.walletId,n=window.location.origin,r=await d({walletId:t,operation:e.request.operation,payload:e.request.payload,requestOrigin:n}),i=await p({credentialStore:o,touchIdPrompt:new V(e.rpId),walletId:t,challengeB64u:r,includeSecondPrfOutput:!1}),a=ee(i);if(!a)throw Error(`Wallet recovery proof did not receive a passkey credential`);return{kind:`passkey`,walletId:t,rpId:e.rpId,credentialIdB64u:a,challenge_digest:r,webauthn_authentication:u(i)}}function Y(){return r(`wallet-recovery-admin`,16,`wallet recovery administration request IDs`)}async function X(e){let t=Y(),n={walletId:e.walletId,requestId:t},r=await J({rpId:e.rpId,request:{operation:`recovery_status`,payload:n}});return await _({relayUrl:e.relayUrl,walletId:e.walletId,requestId:t,factorProof:r})}async function Z(e){let t=Y(),n={walletId:e.walletId,requestId:t,expectedIssuedAtMs:e.expectedIssuedAtMs},r=await J({rpId:e.rpId,request:{operation:`recovery_backup_acknowledge`,payload:n}});return await y({relayUrl:e.relayUrl,walletId:e.walletId,requestId:t,expectedIssuedAtMs:e.expectedIssuedAtMs,factorProof:r})}async function Q(e){let t=await o.resolveSelectedWalletAuthority(e);if(t.kind!==`resolved`||t.selection.lockState!==`unlocked`||String(t.selection.walletId)!==e||t.selection.walletAuthMethodId!==t.authMethod.walletAuthMethodId||t.authMethod.kind!==`email_otp`||t.authMethod.status!==`active`||t.authority.state!==`active`||String(t.authMethod.walletId)!==e||String(t.authority.walletId)!==e)throw Error(`Unlock this wallet with its active Email OTP method`);let n=await o.listWalletAuthMethodsForWallet(e),r=null;for(let e of n)if(!(e.kind!==`email_otp`||e.status!==`active`||e.localStatus!==`synced`||String(e.authority.bindingId)!==String(t.authMethod.walletAuthMethodId))){if(r!==null)throw Error(`The selected Email OTP owner method is duplicated`);r=String(e.authority.factor.providerUserId||``).trim()}if(!r)throw Error(`The selected Email OTP owner method is unavailable on this wallet`);return{walletAuthMethodId:String(t.authMethod.walletAuthMethodId),providerSubjectId:r}}async function $(e){let t=e.request.payload.walletId,{providerSubjectId:n}=await Q(t),r=window.location.origin,i=await d({walletId:t,operation:e.request.operation,payload:e.request.payload,requestOrigin:r}),a=await h({relayUrl:e.relayUrl,walletId:t,providerSubjectId:n,operation:e.request.operation,payload:e.request.payload,requestOrigin:r});if(a.kind!==`ready`)throw Error(a.message);if(a.challenge_digest!==i)throw Error(`Recovery Email OTP challenge does not match this operation`);let o=await e.context.signingEngine.requestEmailOtpOwnerConfirmation({purpose:e.request.operation,walletId:t,emailAddress:`your email`,challengeId:a.challengeId});if(o.challengeId!==a.challengeId)throw Error(`Recovery Email OTP confirmation changed its challenge`);return{kind:`email_otp`,provider_subject_id:n,challenge_id:o.challengeId,otp_code:o.otpCode,challenge_digest:i}}async function te(e){let t=Y(),n={walletId:e.walletId,requestId:t},r=await $({context:e.context,relayUrl:e.relayUrl,request:{operation:`recovery_status`,payload:n}});return await _({relayUrl:e.relayUrl,walletId:e.walletId,requestId:t,factorProof:r})}async function ne(e){let t=Y(),n={walletId:e.walletId,requestId:t,expectedIssuedAtMs:e.expectedIssuedAtMs},r=await $({context:e.context,relayUrl:e.relayUrl,request:{operation:`recovery_backup_acknowledge`,payload:n}});return await y({relayUrl:e.relayUrl,walletId:e.walletId,requestId:t,expectedIssuedAtMs:e.expectedIssuedAtMs,factorProof:r})}export{X as a,_ as c,te as i,h as l,Z as n,Q as o,$ as r,V as s,ne as t,x as u};
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "packageName": "@seams/wallet",
4
- "packageVersion": "0.27.0",
4
+ "packageVersion": "0.28.0",
5
5
  "assetRoot": "dist/public",
6
6
  "sdkBasePath": "/sdk",
7
7
  "walletServicePath": "/wallet-service",
8
8
  "headersManifest": "headers.manifest.json",
9
9
  "versionSkewContract": {
10
10
  "kind": "wallet_iframe_protocol_handshake",
11
- "packageVersion": "0.27.0",
12
- "protocolVersion": "17.0.0",
11
+ "packageVersion": "0.28.0",
12
+ "protocolVersion": "18.0.0",
13
13
  "readyPayloadField": "protocolVersion",
14
14
  "failureMode": "typed_error",
15
15
  "errorCode": "WALLET_IFRAME_PROTOCOL_VERSION_MISMATCH"
@@ -130,8 +130,8 @@
130
130
  ]
131
131
  },
132
132
  {
133
- "route": "/sdk/adapters-d9yh1bdC.js",
134
- "sourceFile": "sdk/adapters-d9yh1bdC.js",
133
+ "route": "/sdk/adapters-C-g_hkkZ.js",
134
+ "sourceFile": "sdk/adapters-C-g_hkkZ.js",
135
135
  "owner": "wallet_sdk_asset",
136
136
  "routeClass": "javascript",
137
137
  "contentType": "text/javascript; charset=utf-8",
@@ -178,8 +178,8 @@
178
178
  ]
179
179
  },
180
180
  {
181
- "route": "/sdk/appearance-token-vars-BJydfWT_.js",
182
- "sourceFile": "sdk/appearance-token-vars-BJydfWT_.js",
181
+ "route": "/sdk/appearance-token-vars-01eH9pgA.js",
182
+ "sourceFile": "sdk/appearance-token-vars-01eH9pgA.js",
183
183
  "owner": "wallet_sdk_asset",
184
184
  "routeClass": "javascript",
185
185
  "contentType": "text/javascript; charset=utf-8",
@@ -538,8 +538,8 @@
538
538
  ]
539
539
  },
540
540
  {
541
- "route": "/sdk/configBuilder-CSwJrmcR.js",
542
- "sourceFile": "sdk/configBuilder-CSwJrmcR.js",
541
+ "route": "/sdk/configBuilder-DpChXfDO.js",
542
+ "sourceFile": "sdk/configBuilder-DpChXfDO.js",
543
543
  "owner": "wallet_sdk_asset",
544
544
  "routeClass": "javascript",
545
545
  "contentType": "text/javascript; charset=utf-8",
@@ -586,8 +586,8 @@
586
586
  ]
587
587
  },
588
588
  {
589
- "route": "/sdk/configuration-DBEc3bsj.js",
590
- "sourceFile": "sdk/configuration-DBEc3bsj.js",
589
+ "route": "/sdk/configuration-BAad7ngq.js",
590
+ "sourceFile": "sdk/configuration-BAad7ngq.js",
591
591
  "owner": "wallet_sdk_asset",
592
592
  "routeClass": "javascript",
593
593
  "contentType": "text/javascript; charset=utf-8",
@@ -610,8 +610,8 @@
610
610
  ]
611
611
  },
612
612
  {
613
- "route": "/sdk/confirm-ui-nU6ymgiv.js",
614
- "sourceFile": "sdk/confirm-ui-nU6ymgiv.js",
613
+ "route": "/sdk/confirm-ui-em0vkd2m.js",
614
+ "sourceFile": "sdk/confirm-ui-em0vkd2m.js",
615
615
  "owner": "wallet_sdk_asset",
616
616
  "routeClass": "javascript",
617
617
  "contentType": "text/javascript; charset=utf-8",
@@ -634,8 +634,8 @@
634
634
  ]
635
635
  },
636
636
  {
637
- "route": "/sdk/ConfirmationDrawer-AZruQmhP.js",
638
- "sourceFile": "sdk/ConfirmationDrawer-AZruQmhP.js",
637
+ "route": "/sdk/ConfirmationDrawer-MJoE0AAo.js",
638
+ "sourceFile": "sdk/ConfirmationDrawer-MJoE0AAo.js",
639
639
  "owner": "wallet_sdk_asset",
640
640
  "routeClass": "javascript",
641
641
  "contentType": "text/javascript; charset=utf-8",
@@ -730,8 +730,8 @@
730
730
  ]
731
731
  },
732
732
  {
733
- "route": "/sdk/deviceLinkApproval-CfEiotVt.js",
734
- "sourceFile": "sdk/deviceLinkApproval-CfEiotVt.js",
733
+ "route": "/sdk/deviceLinkApproval-x3WkiYrd.js",
734
+ "sourceFile": "sdk/deviceLinkApproval-x3WkiYrd.js",
735
735
  "owner": "wallet_sdk_asset",
736
736
  "routeClass": "javascript",
737
737
  "contentType": "text/javascript; charset=utf-8",
@@ -1138,8 +1138,8 @@
1138
1138
  ]
1139
1139
  },
1140
1140
  {
1141
- "route": "/sdk/export-viewer-host-BtrKVXxu.js",
1142
- "sourceFile": "sdk/export-viewer-host-BtrKVXxu.js",
1141
+ "route": "/sdk/export-viewer-host-BSTfHhau.js",
1142
+ "sourceFile": "sdk/export-viewer-host-BSTfHhau.js",
1143
1143
  "owner": "wallet_sdk_asset",
1144
1144
  "routeClass": "javascript",
1145
1145
  "contentType": "text/javascript; charset=utf-8",
@@ -1162,8 +1162,8 @@
1162
1162
  ]
1163
1163
  },
1164
1164
  {
1165
- "route": "/sdk/exportKeypairOperation-CGE9ZU1m.js",
1166
- "sourceFile": "sdk/exportKeypairOperation-CGE9ZU1m.js",
1165
+ "route": "/sdk/exportKeypairOperation-CjST_NUK.js",
1166
+ "sourceFile": "sdk/exportKeypairOperation-CjST_NUK.js",
1167
1167
  "owner": "wallet_sdk_asset",
1168
1168
  "routeClass": "javascript",
1169
1169
  "contentType": "text/javascript; charset=utf-8",
@@ -1210,8 +1210,8 @@
1210
1210
  ]
1211
1211
  },
1212
1212
  {
1213
- "route": "/sdk/host-DayrOrgm.js",
1214
- "sourceFile": "sdk/host-DayrOrgm.js",
1213
+ "route": "/sdk/host-C51z-AxP.js",
1214
+ "sourceFile": "sdk/host-C51z-AxP.js",
1215
1215
  "owner": "wallet_sdk_asset",
1216
1216
  "routeClass": "javascript",
1217
1217
  "contentType": "text/javascript; charset=utf-8",
@@ -1402,8 +1402,8 @@
1402
1402
  ]
1403
1403
  },
1404
1404
  {
1405
- "route": "/sdk/localOnly-BATWJj78.js",
1406
- "sourceFile": "sdk/localOnly-BATWJj78.js",
1405
+ "route": "/sdk/localOnly-Xs89Xajm.js",
1406
+ "sourceFile": "sdk/localOnly-Xs89Xajm.js",
1407
1407
  "owner": "wallet_sdk_asset",
1408
1408
  "routeClass": "javascript",
1409
1409
  "contentType": "text/javascript; charset=utf-8",
@@ -1426,8 +1426,8 @@
1426
1426
  ]
1427
1427
  },
1428
1428
  {
1429
- "route": "/sdk/mountExportPrivateKeySurface-CyHU8bVc.js",
1430
- "sourceFile": "sdk/mountExportPrivateKeySurface-CyHU8bVc.js",
1429
+ "route": "/sdk/mountExportPrivateKeySurface-CsUEKeum.js",
1430
+ "sourceFile": "sdk/mountExportPrivateKeySurface-CsUEKeum.js",
1431
1431
  "owner": "wallet_sdk_asset",
1432
1432
  "routeClass": "javascript",
1433
1433
  "contentType": "text/javascript; charset=utf-8",
@@ -1450,8 +1450,8 @@
1450
1450
  ]
1451
1451
  },
1452
1452
  {
1453
- "route": "/sdk/mountRecoveryCodeBackupSurface-C7aglQxf.js",
1454
- "sourceFile": "sdk/mountRecoveryCodeBackupSurface-C7aglQxf.js",
1453
+ "route": "/sdk/mountRecoveryCodeBackupSurface-kFLo5zLk.js",
1454
+ "sourceFile": "sdk/mountRecoveryCodeBackupSurface-kFLo5zLk.js",
1455
1455
  "owner": "wallet_sdk_asset",
1456
1456
  "routeClass": "javascript",
1457
1457
  "contentType": "text/javascript; charset=utf-8",
@@ -1690,8 +1690,8 @@
1690
1690
  ]
1691
1691
  },
1692
1692
  {
1693
- "route": "/sdk/pendingWalletRecoveryCodeBackup-Cjx-X-pP.js",
1694
- "sourceFile": "sdk/pendingWalletRecoveryCodeBackup-Cjx-X-pP.js",
1693
+ "route": "/sdk/pendingWalletRecoveryCodeBackup-B-R_U34I.js",
1694
+ "sourceFile": "sdk/pendingWalletRecoveryCodeBackup-B-R_U34I.js",
1695
1695
  "owner": "wallet_sdk_asset",
1696
1696
  "routeClass": "javascript",
1697
1697
  "contentType": "text/javascript; charset=utf-8",
@@ -1882,8 +1882,8 @@
1882
1882
  ]
1883
1883
  },
1884
1884
  {
1885
- "route": "/sdk/registration-CNLUYN-p.js",
1886
- "sourceFile": "sdk/registration-CNLUYN-p.js",
1885
+ "route": "/sdk/registration-Byl4l4yZ.js",
1886
+ "sourceFile": "sdk/registration-Byl4l4yZ.js",
1887
1887
  "owner": "wallet_sdk_asset",
1888
1888
  "routeClass": "javascript",
1889
1889
  "contentType": "text/javascript; charset=utf-8",
@@ -1906,8 +1906,8 @@
1906
1906
  ]
1907
1907
  },
1908
1908
  {
1909
- "route": "/sdk/registration-HSwOHZOo.js",
1910
- "sourceFile": "sdk/registration-HSwOHZOo.js",
1909
+ "route": "/sdk/registration-C2fb9kRQ.js",
1910
+ "sourceFile": "sdk/registration-C2fb9kRQ.js",
1911
1911
  "owner": "wallet_sdk_asset",
1912
1912
  "routeClass": "javascript",
1913
1913
  "contentType": "text/javascript; charset=utf-8",
@@ -2050,8 +2050,8 @@
2050
2050
  ]
2051
2051
  },
2052
2052
  {
2053
- "route": "/sdk/resealedEnvelopeResult-B1p5UkYg.js",
2054
- "sourceFile": "sdk/resealedEnvelopeResult-B1p5UkYg.js",
2053
+ "route": "/sdk/resealedEnvelopeResult-CLW00Vbw.js",
2054
+ "sourceFile": "sdk/resealedEnvelopeResult-CLW00Vbw.js",
2055
2055
  "owner": "wallet_sdk_asset",
2056
2056
  "routeClass": "javascript",
2057
2057
  "contentType": "text/javascript; charset=utf-8",
@@ -2122,8 +2122,8 @@
2122
2122
  ]
2123
2123
  },
2124
2124
  {
2125
- "route": "/sdk/runtime-auth-BCoj7_-G.js",
2126
- "sourceFile": "sdk/runtime-auth-BCoj7_-G.js",
2125
+ "route": "/sdk/runtime-auth-ufbVur2p.js",
2126
+ "sourceFile": "sdk/runtime-auth-ufbVur2p.js",
2127
2127
  "owner": "wallet_sdk_asset",
2128
2128
  "routeClass": "javascript",
2129
2129
  "contentType": "text/javascript; charset=utf-8",
@@ -2146,8 +2146,8 @@
2146
2146
  ]
2147
2147
  },
2148
2148
  {
2149
- "route": "/sdk/runtime-device-link-DAsq5tGT.js",
2150
- "sourceFile": "sdk/runtime-device-link-DAsq5tGT.js",
2149
+ "route": "/sdk/runtime-device-link-CagI2Q62.js",
2150
+ "sourceFile": "sdk/runtime-device-link-CagI2Q62.js",
2151
2151
  "owner": "wallet_sdk_asset",
2152
2152
  "routeClass": "javascript",
2153
2153
  "contentType": "text/javascript; charset=utf-8",
@@ -2170,8 +2170,8 @@
2170
2170
  ]
2171
2171
  },
2172
2172
  {
2173
- "route": "/sdk/runtime-ecdsa-tempo-CVh_Vwl6.js",
2174
- "sourceFile": "sdk/runtime-ecdsa-tempo-CVh_Vwl6.js",
2173
+ "route": "/sdk/runtime-ecdsa-tempo-Rctxr0yM.js",
2174
+ "sourceFile": "sdk/runtime-ecdsa-tempo-Rctxr0yM.js",
2175
2175
  "owner": "wallet_sdk_asset",
2176
2176
  "routeClass": "javascript",
2177
2177
  "contentType": "text/javascript; charset=utf-8",
@@ -2194,8 +2194,8 @@
2194
2194
  ]
2195
2195
  },
2196
2196
  {
2197
- "route": "/sdk/runtime-email-otp-BxSKK9AG.js",
2198
- "sourceFile": "sdk/runtime-email-otp-BxSKK9AG.js",
2197
+ "route": "/sdk/runtime-email-otp-BQtcG-LF.js",
2198
+ "sourceFile": "sdk/runtime-email-otp-BQtcG-LF.js",
2199
2199
  "owner": "wallet_sdk_asset",
2200
2200
  "routeClass": "javascript",
2201
2201
  "contentType": "text/javascript; charset=utf-8",
@@ -2218,8 +2218,8 @@
2218
2218
  ]
2219
2219
  },
2220
2220
  {
2221
- "route": "/sdk/runtime-export-BWnQXMzT.js",
2222
- "sourceFile": "sdk/runtime-export-BWnQXMzT.js",
2221
+ "route": "/sdk/runtime-export-wTeEaqlk.js",
2222
+ "sourceFile": "sdk/runtime-export-wTeEaqlk.js",
2223
2223
  "owner": "wallet_sdk_asset",
2224
2224
  "routeClass": "javascript",
2225
2225
  "contentType": "text/javascript; charset=utf-8",
@@ -2242,8 +2242,8 @@
2242
2242
  ]
2243
2243
  },
2244
2244
  {
2245
- "route": "/sdk/runtime-near-CuzPZrDS.js",
2246
- "sourceFile": "sdk/runtime-near-CuzPZrDS.js",
2245
+ "route": "/sdk/runtime-near-59yU_3ud.js",
2246
+ "sourceFile": "sdk/runtime-near-59yU_3ud.js",
2247
2247
  "owner": "wallet_sdk_asset",
2248
2248
  "routeClass": "javascript",
2249
2249
  "contentType": "text/javascript; charset=utf-8",
@@ -2266,8 +2266,8 @@
2266
2266
  ]
2267
2267
  },
2268
2268
  {
2269
- "route": "/sdk/runtime-preferences-B-nDWlm3.js",
2270
- "sourceFile": "sdk/runtime-preferences-B-nDWlm3.js",
2269
+ "route": "/sdk/runtime-preferences-B9qLHX8W.js",
2270
+ "sourceFile": "sdk/runtime-preferences-B9qLHX8W.js",
2271
2271
  "owner": "wallet_sdk_asset",
2272
2272
  "routeClass": "javascript",
2273
2273
  "contentType": "text/javascript; charset=utf-8",
@@ -2290,8 +2290,8 @@
2290
2290
  ]
2291
2291
  },
2292
2292
  {
2293
- "route": "/sdk/runtime-recovery-codes-DeUjQsxZ.js",
2294
- "sourceFile": "sdk/runtime-recovery-codes-DeUjQsxZ.js",
2293
+ "route": "/sdk/runtime-recovery-codes-si1fGktB.js",
2294
+ "sourceFile": "sdk/runtime-recovery-codes-si1fGktB.js",
2295
2295
  "owner": "wallet_sdk_asset",
2296
2296
  "routeClass": "javascript",
2297
2297
  "contentType": "text/javascript; charset=utf-8",
@@ -2314,8 +2314,8 @@
2314
2314
  ]
2315
2315
  },
2316
2316
  {
2317
- "route": "/sdk/runtime-recovery-DpOdEJ8N.js",
2318
- "sourceFile": "sdk/runtime-recovery-DpOdEJ8N.js",
2317
+ "route": "/sdk/runtime-recovery-DNyzdMBj.js",
2318
+ "sourceFile": "sdk/runtime-recovery-DNyzdMBj.js",
2319
2319
  "owner": "wallet_sdk_asset",
2320
2320
  "routeClass": "javascript",
2321
2321
  "contentType": "text/javascript; charset=utf-8",
@@ -2338,8 +2338,8 @@
2338
2338
  ]
2339
2339
  },
2340
2340
  {
2341
- "route": "/sdk/runtimeContext-5JcewRo3.js",
2342
- "sourceFile": "sdk/runtimeContext-5JcewRo3.js",
2341
+ "route": "/sdk/runtimeContext-ByeM6Z4Z.js",
2342
+ "sourceFile": "sdk/runtimeContext-ByeM6Z4Z.js",
2343
2343
  "owner": "wallet_sdk_asset",
2344
2344
  "routeClass": "javascript",
2345
2345
  "contentType": "text/javascript; charset=utf-8",
@@ -2458,8 +2458,8 @@
2458
2458
  ]
2459
2459
  },
2460
2460
  {
2461
- "route": "/sdk/sessionObservationRevision-JOvVF4Hf.js",
2462
- "sourceFile": "sdk/sessionObservationRevision-JOvVF4Hf.js",
2461
+ "route": "/sdk/sessionObservationRevision-ihBwjS3y.js",
2462
+ "sourceFile": "sdk/sessionObservationRevision-ihBwjS3y.js",
2463
2463
  "owner": "wallet_sdk_asset",
2464
2464
  "routeClass": "javascript",
2465
2465
  "contentType": "text/javascript; charset=utf-8",
@@ -3466,8 +3466,8 @@
3466
3466
  ]
3467
3467
  },
3468
3468
  {
3469
- "route": "/sdk/walletRecoveryAdminProof-CvSYbyg5.js",
3470
- "sourceFile": "sdk/walletRecoveryAdminProof-CvSYbyg5.js",
3469
+ "route": "/sdk/walletRecoveryAdminProof-B4Ic07jY.js",
3470
+ "sourceFile": "sdk/walletRecoveryAdminProof-B4Ic07jY.js",
3471
3471
  "owner": "wallet_sdk_asset",
3472
3472
  "routeClass": "javascript",
3473
3473
  "contentType": "text/javascript; charset=utf-8",
@@ -5,14 +5,14 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>Web3Authn Wallet Service</title>
7
7
  <!-- Surface styles are external so strict CSP can keep style-src 'self' -->
8
- <link rel="stylesheet" href="/sdk/wallet-ui.css?v=0.27.0" />
8
+ <link rel="stylesheet" href="/sdk/wallet-ui.css?v=0.28.0" />
9
9
  <!-- Minimal shims some ESM bundles expect (externalized to enable strict CSP) -->
10
- <script src="/sdk/wallet-shims.js?v=0.27.0"></script>
10
+ <script src="/sdk/wallet-shims.js?v=0.28.0"></script>
11
11
  <!-- Hint the browser to fetch the host script earlier -->
12
- <link rel="modulepreload" href="/sdk/wallet-iframe-host-runtime.js?v=0.27.0" crossorigin>
12
+ <link rel="modulepreload" href="/sdk/wallet-iframe-host-runtime.js?v=0.28.0" crossorigin>
13
13
  </head>
14
14
  <body>
15
15
  <!-- sdkBasePath points to the SDK root (e.g. '/sdk'). Load the host directly. -->
16
- <script type="module" src="/sdk/wallet-iframe-host-runtime.js?v=0.27.0"></script>
16
+ <script type="module" src="/sdk/wallet-iframe-host-runtime.js?v=0.28.0"></script>
17
17
  </body>
18
18
  </html>
@@ -0,0 +1,84 @@
1
+ import { type WalletId } from '../utils/domainIds';
2
+ import type { ReadonlyExclusiveUnion } from '../utils/variant';
3
+ export declare const EXTERNAL_AUTH_PATH = "/wallet/external-auth";
4
+ export type ExternalAuthConfiguration = ReadonlyExclusiveUnion<{
5
+ kind: 'disabled';
6
+ revision: number;
7
+ } | {
8
+ kind: 'google';
9
+ revision: number;
10
+ clientId: string;
11
+ }>;
12
+ export declare function parseExternalAuthConfiguration(raw: unknown): ExternalAuthConfiguration;
13
+ type ExternalAuthFailureCode = 'invalid_request' | 'invalid_credential' | 'access_denied' | 'expired' | 'superseded' | 'unavailable' | 'rate_limited';
14
+ export type ExternalAuthResult<T> = ReadonlyExclusiveUnion<{
15
+ ok: true;
16
+ value: T;
17
+ } | {
18
+ ok: false;
19
+ code: ExternalAuthFailureCode;
20
+ message: string;
21
+ }>;
22
+ export type ExternalAuthenticateInput = ReadonlyExclusiveUnion<{
23
+ method: 'google';
24
+ walletId: string;
25
+ idToken: string;
26
+ } | {
27
+ method: 'handoff';
28
+ walletId: string;
29
+ attemptId: string;
30
+ code: string;
31
+ }>;
32
+ export type ExternalAuthAttempt = Readonly<{
33
+ attemptId: string;
34
+ walletId: WalletId;
35
+ expiresAtMs: number;
36
+ }>;
37
+ export type ExternalAuthCommand = ReadonlyExclusiveUnion<{
38
+ action: 'authenticate';
39
+ input: ExternalAuthenticateInput;
40
+ } | {
41
+ action: 'prepare';
42
+ walletId: string;
43
+ } | {
44
+ action: 'associate';
45
+ walletId: string;
46
+ idToken: string;
47
+ } | {
48
+ action: 'unlink';
49
+ walletId: string;
50
+ associationId: string;
51
+ }>;
52
+ export declare function parseExternalAuthCommand(raw: unknown): ExternalAuthCommand;
53
+ export type ExternalWalletAuthentication = Readonly<{
54
+ kind: 'external_authenticated';
55
+ walletId: WalletId;
56
+ sessionId: string;
57
+ associationId: string;
58
+ environmentId: string;
59
+ provider: 'google';
60
+ permission: 'wallet_settings_read';
61
+ expiresAtMs: number;
62
+ authMethod?: never;
63
+ }>;
64
+ export type ExternalWalletSettings = Readonly<{
65
+ authentication: ExternalWalletAuthentication;
66
+ accounts: readonly Readonly<{
67
+ family: 'ed25519' | 'ecdsa';
68
+ address: string;
69
+ publicKey: string;
70
+ }>[];
71
+ methods: readonly Readonly<{
72
+ id: string;
73
+ kind: 'passkey' | 'email_otp' | 'voiceid';
74
+ }>[];
75
+ devices: readonly Readonly<{
76
+ id: string;
77
+ }>[];
78
+ }>;
79
+ export declare function parseExternalWalletAuthentication(value: unknown): ExternalWalletAuthentication;
80
+ export declare function externalAuthFailure(code: ExternalAuthFailureCode): ExternalAuthResult<never>;
81
+ export declare function parseExternalAuthFailure(value: unknown): ExternalAuthResult<never>;
82
+ export declare function parseExternalWalletSettings(value: unknown): ExternalWalletSettings;
83
+ export {};
84
+ //# sourceMappingURL=externalAuth.d.ts.map