@seams/wallet 0.12.0 → 0.13.1
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.
- package/README.md +3 -3
- package/dist/.build-inputs.sha256 +1 -1
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.js +160 -140
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/linkDeviceBadge.js +90 -0
- package/dist/esm/core/config/defaultConfigs.js +1 -1
- package/dist/esm/sdk/{host-CHQwi-Nm.js → host-BAeJh9rB.js} +1 -1
- package/dist/{public/sdk/presignaturePool-CLHu7HaU.js → esm/sdk/presignaturePool-Bkk6bLFB.js} +1 -1
- package/dist/esm/sdk/routerAbNormalSigning-B35zb-P-.js +1 -0
- package/dist/esm/sdk/runtime-auth-D7VqiZeg.js +1 -0
- package/dist/esm/sdk/{runtime-device-link-DXjabXJb.js → runtime-device-link-BKc_MD5V.js} +1 -1
- package/dist/esm/sdk/{runtime-ecdsa-tempo-DlKMIbyP.js → runtime-ecdsa-tempo-DC51NDrh.js} +1 -1
- package/dist/esm/sdk/{runtime-email-otp-BBPghU2G.js → runtime-email-otp-C-wopKFf.js} +1 -1
- package/dist/esm/sdk/{runtime-export-pw-xJL8o.js → runtime-export-BtGy8BKi.js} +1 -1
- package/dist/esm/sdk/{runtime-near-B-vYxGjl.js → runtime-near-nq8pgRAl.js} +1 -1
- package/dist/esm/sdk/{runtime-preferences-D-hY0RfC.js → runtime-preferences-778ZfMmT.js} +1 -1
- package/dist/esm/sdk/{runtime-recovery-Vg1ND2nl.js → runtime-recovery-B-JsRiN0.js} +1 -1
- package/dist/esm/sdk/{secp256k1-C-AETUpI.js → secp256k1-CYQS0rj-.js} +1 -1
- package/dist/esm/sdk/{shared-6bpRPbcM.js → shared-B6BCLs8L.js} +1 -1
- package/dist/esm/sdk/{signEvmFamily-M0trbeZe.js → signEvmFamily-ttVfV0qm.js} +1 -1
- package/dist/{public/sdk/signNear-DGUQZ44s.js → esm/sdk/signNear-bcWIHxEY.js} +1 -1
- package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/esm/sdk/wallet-ui.css +1 -1
- package/dist/public/headers.manifest.json +1 -1
- package/dist/public/sdk/{host-CHQwi-Nm.js → host-BAeJh9rB.js} +1 -1
- package/dist/{esm/sdk/presignaturePool-CLHu7HaU.js → public/sdk/presignaturePool-Bkk6bLFB.js} +1 -1
- package/dist/public/sdk/routerAbNormalSigning-B35zb-P-.js +1 -0
- package/dist/public/sdk/runtime-auth-D7VqiZeg.js +1 -0
- package/dist/public/sdk/{runtime-device-link-DXjabXJb.js → runtime-device-link-BKc_MD5V.js} +1 -1
- package/dist/public/sdk/{runtime-ecdsa-tempo-DlKMIbyP.js → runtime-ecdsa-tempo-DC51NDrh.js} +1 -1
- package/dist/public/sdk/{runtime-email-otp-BBPghU2G.js → runtime-email-otp-C-wopKFf.js} +1 -1
- package/dist/public/sdk/{runtime-export-pw-xJL8o.js → runtime-export-BtGy8BKi.js} +1 -1
- package/dist/public/sdk/{runtime-near-B-vYxGjl.js → runtime-near-nq8pgRAl.js} +1 -1
- package/dist/public/sdk/{runtime-preferences-D-hY0RfC.js → runtime-preferences-778ZfMmT.js} +1 -1
- package/dist/public/sdk/{runtime-recovery-Vg1ND2nl.js → runtime-recovery-B-JsRiN0.js} +1 -1
- package/dist/public/sdk/{secp256k1-C-AETUpI.js → secp256k1-CYQS0rj-.js} +1 -1
- package/dist/public/sdk/{shared-6bpRPbcM.js → shared-B6BCLs8L.js} +1 -1
- package/dist/public/sdk/{signEvmFamily-M0trbeZe.js → signEvmFamily-ttVfV0qm.js} +1 -1
- package/dist/{esm/sdk/signNear-DGUQZ44s.js → public/sdk/signNear-bcWIHxEY.js} +1 -1
- package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/public/sdk/wallet-ui.css +1 -1
- package/dist/public/wallet-assets.manifest.json +34 -34
- package/dist/public/wallet-service/index.html +4 -4
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.d.ts +21 -3
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/linkDeviceBadge.d.ts +18 -0
- package/package.json +1 -1
- package/dist/esm/sdk/routerAbNormalSigning-DVKFBYgV.js +0 -1
- package/dist/esm/sdk/runtime-auth-DtpRz88X.js +0 -1
- package/dist/public/sdk/routerAbNormalSigning-DVKFBYgV.js +0 -1
- package/dist/public/sdk/runtime-auth-DtpRz88X.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./primitives-CqrjmIAH.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import{a as e,n as t,o as n,t as r}from"./shared-
|
|
1
|
+
import"./primitives-CqrjmIAH.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import{a as e,n as t,o as n,t as r}from"./shared-B6BCLs8L.js";import"./activeWalletSession-WdZkhtBB.js";import"./capabilityKinds-N8xo_IEh.js";import"./errors-DIWY1KR9.js";import"./accountIds-BzZs7YoX.js";import"./registrationSignerPlan-dY9Rp0m_.js";import"./signerDomain-DqLCvI-D.js";import"./registrationIntent-BHU5k2Q-.js";import"./singletons-8UH3gOnZ.js";import"./walletAuthority-BWvfaKIX.js";import"./emailOtpEcdsaDerivationIdentity-p0C1CQva.js";import"./challengeDelivery-5lIu9spR.js";import"./digestEncoding-CkUc5vtR.js";import"./registrationIds-ByuReLUc.js";import"./passkey-custody-Cd_yyoRa.js";import"./walletCustodyEcdsaContinuity-D-gYxv6e.js";import"./keccak-BArcwgbj.js";import"./wallet-recovery-LMtGiEL3.js";import"./nearEd25519YaoMaterialActivation-DMGPKrn8.js";import"./signNear-bcWIHxEY.js";import"./jsxRuntime.module-C8JOKu_4.js";function i(e){return{PM_SIGN_TEMPO:async r=>{let i=e.getWalletRuntime(),{walletSession:a,request:o,chainTarget:s,options:c}=r.payload;if(e.respondIfCancelled(r.requestId))return;let l={confirmationConfig:c?.confirmationConfig,shouldAbort:()=>e.isCancelled(r.requestId),onEvent:t=>{e.postProgress(r.requestId,t)}},u;switch(r.payload.operationKind){case`tempo_transaction`:if(o.chain!==`tempo`)throw Error(`[wallet-iframe] Tempo operation requires a Tempo request`);if(s.kind!==`tempo`)throw Error(`[wallet-iframe] Tempo request requires a Tempo target`);u=await i.tempo.signTransaction({walletSession:a,request:o,chainTarget:s,options:l});break;case`evm_transaction`:if(o.chain!==`evm`)throw Error(`[wallet-iframe] EVM operation requires an EVM request`);if(s.kind!==`evm`)throw Error(`[wallet-iframe] EVM request requires an EVM target`);u=await i.evm.signTransaction({walletSession:a,request:o,chainTarget:s,options:l});break;case`tempo_fee_token_preference`:{if(o.chain!==`evm`||s.kind!==`tempo`)throw Error(`[wallet-iframe] Tempo fee-token operation requires an EVM request and Tempo target`);let e=n({request:o,chainTarget:s});u=await i.signTempoFeeTokenPreferenceInternal({walletSession:a,request:e,chainTarget:s,confirmationConfigOverride:l.confirmationConfig,shouldAbort:l.shouldAbort,onEvent:l.onEvent});break}default:throw Error(`[wallet-iframe] unsupported EVM-family signing operation`)}e.respondIfCancelled(r.requestId)||t(e,r.requestId,u)},PM_REPORT_TEMPO_BROADCAST_ACCEPTED:async t=>{let n=e.getWalletRuntime(),{walletSession:i,signedResult:a,txHash:o}=t.payload;e.respondIfCancelled(t.requestId)||(await n.tempo.advanced.reportBroadcastAccepted({walletSession:i,signedResult:a,txHash:o,options:{onEvent:n=>e.postProgress(t.requestId,n)}}),!e.respondIfCancelled(t.requestId)&&r(e,t.requestId))},PM_REPORT_TEMPO_BROADCAST_REJECTED:async t=>{let n=e.getWalletRuntime(),{walletSession:i,signedResult:a,error:o}=t.payload;e.respondIfCancelled(t.requestId)||(await n.tempo.advanced.reportBroadcastRejected({walletSession:i,signedResult:a,...o?{error:o}:{},options:{onEvent:n=>e.postProgress(t.requestId,n)}}),!e.respondIfCancelled(t.requestId)&&r(e,t.requestId))},PM_REPORT_TEMPO_FINALIZED:async t=>{let n=e.getWalletRuntime(),{walletSession:i,signedResult:a,txHash:o,receiptStatus:s}=t.payload;e.respondIfCancelled(t.requestId)||(await n.tempo.advanced.reportFinalized({walletSession:i,signedResult:a,...o?{txHash:o}:{},...s?{receiptStatus:s}:{},options:{onEvent:n=>e.postProgress(t.requestId,n)}}),!e.respondIfCancelled(t.requestId)&&r(e,t.requestId))},PM_REPORT_TEMPO_DROPPED_OR_REPLACED:async t=>{let n=e.getWalletRuntime(),{walletSession:i,signedResult:a,reason:o,txHash:s}=t.payload;e.respondIfCancelled(t.requestId)||(await n.tempo.advanced.reportDroppedOrReplaced({walletSession:i,signedResult:a,reason:o,...s?{txHash:s}:{},options:{onEvent:n=>e.postProgress(t.requestId,n)}}),!e.respondIfCancelled(t.requestId)&&r(e,t.requestId))},PM_RECONCILE_TEMPO_NONCE_LANE:async n=>{let r=e.getWalletRuntime(),{walletSession:i,signedResult:a}=n.payload;if(e.respondIfCancelled(n.requestId))return;let o=await r.tempo.advanced.reconcileNonceLane({walletSession:i,signedResult:a,options:{onEvent:t=>e.postProgress(n.requestId,t)}});e.respondIfCancelled(n.requestId)||t(e,n.requestId,o)}}}async function a(t){await e(t,i)}export{a as handleWalletHostRuntimeRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./primitives-CqrjmIAH.js";import{r as e}from"./secureRandomId-LwBFx84B.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import{a as t,n,p as r,r as i}from"./shared-
|
|
1
|
+
import"./primitives-CqrjmIAH.js";import{r as e}from"./secureRandomId-LwBFx84B.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import{a as t,n,p as r,r as i}from"./shared-B6BCLs8L.js";import"./activeWalletSession-WdZkhtBB.js";import"./capabilityKinds-N8xo_IEh.js";import"./errors-DIWY1KR9.js";import"./accountIds-BzZs7YoX.js";import"./registrationSignerPlan-dY9Rp0m_.js";import"./signerDomain-DqLCvI-D.js";import"./registrationIntent-BHU5k2Q-.js";import"./singletons-8UH3gOnZ.js";import"./walletAuthority-BWvfaKIX.js";import"./emailOtpEcdsaDerivationIdentity-p0C1CQva.js";import"./challengeDelivery-5lIu9spR.js";import"./digestEncoding-CkUc5vtR.js";import"./registrationIds-ByuReLUc.js";import"./passkey-custody-Cd_yyoRa.js";import"./walletCustodyEcdsaContinuity-D-gYxv6e.js";import"./keccak-BArcwgbj.js";import"./wallet-recovery-LMtGiEL3.js";import"./nearEd25519YaoMaterialActivation-DMGPKrn8.js";import"./signNear-bcWIHxEY.js";import"./jsxRuntime.module-C8JOKu_4.js";function a(e){let t=o(e);if(t.method===`email`)return{method:`email`,walletId:s(t,`walletId`),email:s(t,`email`)};if(t.method!==`google`)throw Error(`Email code method is invalid`);let n=o(t.target);if(n.kind!==`wallet`&&n.kind!==`discoverable`)throw Error(`Email code wallet target is invalid`);return{method:`google`,idToken:s(t,`idToken`),target:n.kind===`wallet`?{kind:`wallet`,walletId:s(n,`walletId`)}:{kind:`discoverable`}}}function o(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function s(e,t){let n=typeof e[t]==`string`?e[t].trim():``;if(!n)throw Error(`Missing ${t}`);return n}function c(e,t){return(typeof e[t]==`string`?e[t].trim():``)||void 0}function l(e){let t=o(e);if(Object.prototype.hasOwnProperty.call(t,`walletSessionToken`))throw Error(`wallet iframe requests must not carry walletSessionToken`)}function u(e){let t=o(e),n=[`challengeId`,`challenge_id`,`otpCode`,`otp_code`,`otpDelivery`,`otp_delivery`,`delivery`,`resend`].find(e=>Object.prototype.hasOwnProperty.call(t,e));if(n)throw Error(`Google Email OTP registration message must not include ${n}`)}const d=new Map;function f(){return e(`google-email-otp`,16,`Google Email OTP wallet auth flow handles`)}function p(e){let t=f();return d.set(t,{flow:e,expiresAtMs:e.expiresAtMs}),e.mode===`register`?{kind:e.kind,state:`registration_ready`,flowHandleId:t,flowId:e.flowId,requestedMode:e.requestedMode,mode:`register`,walletId:e.walletId,emailHint:e.emailHint,prompt:e.prompt,expiresAtMs:e.expiresAtMs}:{kind:e.kind,state:`challenge_sent`,flowHandleId:t,flowId:e.flowId,requestedMode:e.requestedMode,mode:`login`,walletId:e.walletId,emailHint:e.emailHint,prompt:e.prompt,delivery:e.delivery,expiresAtMs:e.expiresAtMs}}function m(e){return e.ok?{ok:!0,value:p(e.value)}:e}function h(e){return e.ok?{ok:!0,value:p(e.value)}:e}function g(e){return e.ok?{ok:!0,value:{walletId:e.value.walletId,mode:`register`,session:e.value.session,registration:e.value.registration}}:e}function _(e){return s(o(e),`flowHandleId`)}function v(e,t){let n=s(t,`flowId`),r=s(t,`walletId`),i=s(t,`mode`);if(e.flowId!==n)throw Error(`Google Email OTP wallet auth flow handle does not match flow id`);if(String(e.walletId)!==r)throw Error(`Google Email OTP wallet auth flow handle does not match wallet`);if(e.mode!==i)throw Error(`Google Email OTP wallet auth flow handle does not match mode`)}function y(e){let t=o(e),n=_(t),r=d.get(n);if(!r)throw Error(`Google Email OTP wallet auth flow handle is not active`);if(Date.now()>r.expiresAtMs)throw d.delete(n),r.flow.cancel().catch(()=>void 0),Error(`Google Email OTP wallet auth flow handle expired`);return v(r.flow,t),r.flow}function b(e){let t=_(o(e)),n=y(e);return d.delete(t),n}function x(e){return{walletId:s(o(e),`walletId`)}}function S(e){let t=o(e),n=s(t,`operation`);if(n!==`credentials_list`&&n!==`credential_label`&&n!==`recovery_rotate`&&n!==`recovery_read`)throw Error(`Wallet custody Email OTP challenge operation is invalid`);let r=o(t.payload);if(Object.keys(r).length===0&&t.payload===void 0)throw Error(`Wallet custody Email OTP challenge payload is required`);return{walletId:s(t,`walletId`),providerSubjectId:s(t,`providerSubjectId`),operation:n,payload:r,...c(t,`requestOrigin`)?{requestOrigin:c(t,`requestOrigin`)}:{}}}function C(e){let t=o(e),n=o(t.authorization);if(n.kind===`existing_passkey`)return{walletId:s(t,`walletId`),authorization:{kind:`existing_passkey`}};if(n.kind===`email_otp`)return{walletId:s(t,`walletId`),authorization:{kind:`email_otp`,providerSubjectId:s(n,`providerSubjectId`),challengeId:s(n,`challengeId`),challenge_digest:s(n,`challenge_digest`),otpCode:s(n,`otpCode`)}};throw Error(`Wallet recovery rotation authorization is invalid`)}function w(e){let t=o(e.diagnostics);Reflect.set(globalThis,`__SEAMS_EMAIL_OTP_UNLOCK_DIAGNOSTICS`,t.emailOtpUnlockTimings===!0),Reflect.set(globalThis,`__SEAMS_REGISTRATION_BENCHMARK_DIAGNOSTICS`,t.registrationBenchmarkTimings===!0),delete e.diagnostics}function T(e){return{PM_REDEEM_HOSTED_WALLET_SEAMS_SESSION:async t=>{let i=await r(t.payload,t.payload.relayUrl);n(e,t.requestId,{kind:`redeemed_hosted_wallet_seams_session`,expiresAtMs:i.expiresAtMs})},PM_REQUEST_EMAIL_OTP_CHALLENGE:async t=>{let r=e.getWalletRuntime();l(t.payload);let o=a(t.payload),s=await r.auth.requestEmailCode(i(e,t.requestId,o));n(e,t.requestId,m(s))},PM_BEGIN_GOOGLE_EMAIL_OTP_WALLET_AUTH:async t=>{let r=e.getWalletRuntime(),a=o(t.payload);w(a),a.mode===`register`&&u(a);let s=i(e,t.requestId,a),c=await r.auth.startGoogleSignIn(s);n(e,t.requestId,m(c))},PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_RESEND:async t=>{let r=y(t.payload);if(r.mode!==`login`)throw Error(`Google Email OTP wallet auth resend requires a login flow`);let i=await r.resend();i.ok&&b(t.payload),n(e,t.requestId,m(i))},PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_REROLL_WALLET_ID:async t=>{let r=y(t.payload);if(r.mode!==`register`)throw Error(`Google Email OTP wallet auth reroll requires a registration flow`);u(t.payload);let i=await r.rerollWalletId();i.ok&&b(t.payload),n(e,t.requestId,h(i))},PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_SUBMIT:async t=>{let r=y(t.payload);if(r.mode!==`login`)throw Error(`Google Email OTP wallet auth submit requires a login flow`);let i=o(t.payload),a=await r.submit({otpCode:s(i,`otpCode`)});a.ok&&b(t.payload),n(e,t.requestId,a)},PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_COMPLETE_REGISTRATION:async t=>{let r=y(t.payload);if(r.mode!==`register`)throw Error(`Google Email OTP wallet auth completion requires a registration flow`);u(t.payload);let i=await r.completeRegistration();i.ok&&b(t.payload),n(e,t.requestId,g(i))},PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_CANCEL:async t=>{await y(t.payload).cancel(),b(t.payload),n(e,t.requestId,void 0)},PM_GET_WALLET_RECOVERY_CODE_STATUS:async t=>{l(t.payload);let r=await e.getWalletRuntime().recovery.getCodeStatus(x(t.payload));n(e,t.requestId,r)},PM_REQUEST_WALLET_CUSTODY_EMAIL_OTP_CHALLENGE:async t=>{l(t.payload);let r=await e.getWalletRuntime().recovery.requestWalletCustodyEmailOtpChallenge(S(t.payload));n(e,t.requestId,r)},PM_ACKNOWLEDGE_WALLET_RECOVERY_CODE_BACKUP:async t=>{l(t.payload);let r=await e.getWalletRuntime().recovery.confirmBackup(x(t.payload));n(e,t.requestId,r)},PM_ROTATE_WALLET_RECOVERY_CODES:async t=>{l(t.payload);let r=await e.getWalletRuntime().recovery.rotateCodes(C(t.payload));n(e,t.requestId,r)}}}async function E(e){await t(e,T)}export{E as handleWalletHostRuntimeRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./domainIds-BzkGsRqO.js";import"./primitives-CqrjmIAH.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import{a as t,n,t as r}from"./shared-
|
|
1
|
+
import{h as e}from"./domainIds-BzkGsRqO.js";import"./primitives-CqrjmIAH.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import{a as t,n,t as r}from"./shared-B6BCLs8L.js";import"./activeWalletSession-WdZkhtBB.js";import"./capabilityKinds-N8xo_IEh.js";import{r as i}from"./errors-DIWY1KR9.js";import"./accountIds-BzZs7YoX.js";import"./registrationSignerPlan-dY9Rp0m_.js";import{s as a}from"./ecdsaChainTarget-DJBXHzbH.js";import"./signerDomain-DqLCvI-D.js";import"./registrationIntent-BHU5k2Q-.js";import"./singletons-8UH3gOnZ.js";import"./walletAuthority-BWvfaKIX.js";import"./emailOtpEcdsaDerivationIdentity-p0C1CQva.js";import"./challengeDelivery-5lIu9spR.js";import"./digestEncoding-CkUc5vtR.js";import"./registrationIds-ByuReLUc.js";import"./passkey-custody-Cd_yyoRa.js";import"./walletCustodyEcdsaContinuity-D-gYxv6e.js";import"./keccak-BArcwgbj.js";import"./wallet-recovery-LMtGiEL3.js";import"./nearEd25519YaoMaterialActivation-DMGPKrn8.js";import{N as o,P as s}from"./nearEd25519YaoSigningPreparation-Eiq_ikXk.js";import"./signNear-bcWIHxEY.js";import"./jsxRuntime.module-C8JOKu_4.js";function c(t){switch(t.kind){case`ecdsa`:{let e=o(t.laneIdentity);if(String(e.signer.walletId)!==String(t.walletSession.walletId))throw Error(`[WalletIframe] key export lane wallet does not match wallet session`);if(!a(e.signer.chainTarget,t.chainTarget))throw Error(`[WalletIframe] key export lane chain target does not match request target`);return{kind:`ecdsa`,chainTarget:t.chainTarget,walletSession:t.walletSession,laneIdentity:e,options:t.options}}case`ed25519`:{let n=s(t.laneIdentity),r=e(t.materialActivation);if(!r.ok)throw Error(r.error.message);let i=n.signer;if(String(i.account.wallet.walletId)!==String(t.walletSession.walletId))throw Error(`[WalletIframe] Ed25519 export lane wallet does not match wallet session`);if(String(i.account.nearAccountId)!==String(t.nearAccount.accountId))throw Error(`[WalletIframe] Ed25519 export lane does not match the NEAR account`);return{kind:`ed25519`,nearAccount:t.nearAccount,walletSession:t.walletSession,laneIdentity:n,materialActivation:r.value,options:t.options}}}}function l(e){return{PM_RESOLVE_EXACT_KEY_EXPORT_LANE:async t=>{let r=await e.getWalletRuntime().keys.resolveExactKeyExportLane(t.payload);n(e,t.requestId,r)},PM_EXPORT_KEYPAIR_UI:async t=>{let n=e.getWalletRuntime(),a=t.payload;if(!e.respondIfCancelled(t.requestId)){try{let r=c(a);await n.keys.exportKeypairWithUI(r.kind===`ecdsa`?{kind:`ecdsa`,chainTarget:r.chainTarget,walletSession:r.walletSession,laneIdentity:r.laneIdentity,options:{...r.options,onEvent:n=>e.postProgress(t.requestId,n)}}:{kind:`ed25519`,nearAccount:r.nearAccount,walletSession:r.walletSession,laneIdentity:r.laneIdentity,materialActivation:r.materialActivation,options:{...r.options,onEvent:n=>e.postProgress(t.requestId,n)}})}catch(n){if(i(n)){if(e.respondIfCancelled(t.requestId))return;r(e,t.requestId);return}throw n}e.respondIfCancelled(t.requestId)||r(e,t.requestId)}}}}async function u(e){await t(e,l)}export{u as handleWalletHostRuntimeRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,w as t}from"./chains-C_X_fNuS.js";import"./primitives-CqrjmIAH.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import{a as n,i as r,n as i,r as a}from"./shared-
|
|
1
|
+
import{_ as e,w as t}from"./chains-C_X_fNuS.js";import"./primitives-CqrjmIAH.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import{a as n,i as r,n as i,r as a}from"./shared-B6BCLs8L.js";import"./activeWalletSession-WdZkhtBB.js";import"./capabilityKinds-N8xo_IEh.js";import"./errors-DIWY1KR9.js";import"./accountIds-BzZs7YoX.js";import"./registrationSignerPlan-dY9Rp0m_.js";import{c as o,n as s}from"./ecdsaChainTarget-DJBXHzbH.js";import"./signerDomain-DqLCvI-D.js";import"./registrationIntent-BHU5k2Q-.js";import"./singletons-8UH3gOnZ.js";import"./walletAuthority-BWvfaKIX.js";import"./emailOtpEcdsaDerivationIdentity-p0C1CQva.js";import"./challengeDelivery-5lIu9spR.js";import"./digestEncoding-CkUc5vtR.js";import"./registrationIds-ByuReLUc.js";import"./passkey-custody-Cd_yyoRa.js";import"./walletCustodyEcdsaContinuity-D-gYxv6e.js";import"./keccak-BArcwgbj.js";import"./wallet-recovery-LMtGiEL3.js";import"./nearEd25519YaoMaterialActivation-DMGPKrn8.js";import{l as c}from"./signNear-bcWIHxEY.js";import"./jsxRuntime.module-C8JOKu_4.js";function l(e){let t=o(e);return{walletId:t,walletSessionUserId:String(t)}}function u(n){if(n&&t(n))try{let t=e(n),r=n.nonceLease,i=n.serverDispatch;return c.fromPlain({transaction:n.transaction,signature:n.signature,borsh_bytes:t,...r?{nonceLease:r}:{},...i?{serverDispatch:i}:{}})}catch{return n}return n}function d(e){throw Error(`Unsupported registration auth method: ${String(e)}`)}function f(e){switch(e.kind){case`passkey`:return{kind:`passkey`,rpId:e.rpId,...e.authenticatorOptions===void 0?{}:{authenticatorOptions:e.authenticatorOptions}};case`email_otp`:switch(e.proofKind){case`otp_challenge`:return{kind:`email_otp`,proofKind:`otp_challenge`,email:e.email,providerSubject:e.providerSubject,otpCode:e.otpCode,...e.challengeId===void 0?{}:{challengeId:e.challengeId}};case`google_sso_registration`:return{kind:`email_otp`,proofKind:`google_sso_registration`,email:e.email,providerSubject:e.providerSubject,googleEmailOtpRegistrationAttemptId:e.googleEmailOtpRegistrationAttemptId,googleEmailOtpRegistrationOfferId:e.googleEmailOtpRegistrationOfferId,googleEmailOtpRegistrationCandidateId:e.googleEmailOtpRegistrationCandidateId};default:return d(e)}default:return d(e)}}function p(e){return{PM_REGISTER_WALLET:async t=>{let n=e.getWalletRuntime(),a=t.payload;if(e.respondIfCancelled(t.requestId))return;let o=r(e,t.requestId,a.options||{}),s=await n.registration.registerWallet({authMethod:f(a.authMethod),wallet:a.wallet,signerSelection:a.signerSelection,options:{...o,...a.confirmationConfig?{confirmationConfig:a.confirmationConfig}:{}}});e.respondIfCancelled(t.requestId)||(s.success&&await e.publishCurrentSession(),!e.respondIfCancelled(t.requestId)&&i(e,t.requestId,s))},PM_ADD_WALLET_SIGNER:async t=>{let n=e.getWalletRuntime(),r=t.payload;if(e.respondIfCancelled(t.requestId))return;let o=a(e,t.requestId,r.options||{}),s=await n.registration.addSigner({walletId:r.walletId,rpId:r.rpId,signerSelection:r.signerSelection,options:{...o,...r.confirmationConfig?{confirmationConfig:r.confirmationConfig}:{}}});e.respondIfCancelled(t.requestId)||i(e,t.requestId,s)},PM_ADD_PASSKEY:async t=>{let n=e.getWalletRuntime(),r=t.payload;if(e.respondIfCancelled(t.requestId))return;let o=a(e,t.requestId,r.options||{}),s=await n.registration.addPasskey({walletId:r.walletId,rpId:r.rpId,options:{...o,...r.confirmationConfig?{confirmationConfig:r.confirmationConfig}:{}}});e.respondIfCancelled(t.requestId)||i(e,t.requestId,s)},PM_ADD_EMAIL_OTP:async t=>{let n=e.getWalletRuntime(),r=t.payload;if(e.respondIfCancelled(t.requestId))return;let o=a(e,t.requestId,r.options||{}),s=await n.registration.addEmail({walletId:r.walletId,emailAddress:r.emailAddress,options:o});e.respondIfCancelled(t.requestId)||i(e,t.requestId,s)},PM_REVOKE_AUTH_METHOD:async t=>{let n=e.getWalletRuntime(),r=t.payload;if(e.respondIfCancelled(t.requestId))return;let a=await n.registration.removeAuthMethod({walletId:r.walletId,walletAuthMethodId:r.walletAuthMethodId});e.respondIfCancelled(t.requestId)||i(e,t.requestId,a)},PM_GET_NEAR_PROVISIONING_STATE:async t=>{let n=e.getWalletRuntime(),r=o(t.payload?.walletId),a=await n.registration.getNearAccountState({walletId:r});i(e,t.requestId,a)},PM_SIGN_TX_WITH_ACTIONS:async t=>{let n=e.getWalletRuntime(),{walletId:r,nearAccountId:o,transaction:c,options:u}=t.payload,d=await n.near.signTransaction({walletSession:l(r),nearAccount:s(o),transaction:c,options:{...a(e,t.requestId,u||{})}});e.respondIfCancelled(t.requestId)||i(e,t.requestId,d)},PM_SIGN_AND_SEND_TX:async t=>{let n=e.getWalletRuntime(),{walletId:r,nearAccountId:o,transaction:c,options:u}=t.payload,d=await n.near.signAndSendTransaction({walletSession:l(r),nearAccount:s(o),receiverId:c.receiverId,actions:c.actions,options:{...a(e,t.requestId,u||{})}});e.respondIfCancelled(t.requestId)||i(e,t.requestId,d)},PM_SEND_TRANSACTION:async t=>{let n=e.getWalletRuntime(),{walletId:r,nearAccountId:o,signedTransaction:c,options:d}=t.payload||{},f=await n.near.sendTransaction({walletSession:l(r),nearAccount:s(o),signedTransaction:u(c),options:{...a(e,t.requestId,d||{})}});e.respondIfCancelled(t.requestId)||i(e,t.requestId,f)},PM_SIGN_DELEGATE_ACTION:async t=>{let n=e.getWalletRuntime(),{walletId:r,nearAccountId:o,delegate:c,options:u}=t.payload,d=await n.near.signDelegateAction({walletSession:l(r),nearAccount:s(o),delegate:c,options:{...a(e,t.requestId,u||{})}});e.respondIfCancelled(t.requestId)||i(e,t.requestId,d)},PM_SIGN_NEP413:async t=>{let n=e.getWalletRuntime(),{walletId:r,nearAccountId:o,params:c,options:u}=t.payload,d=await n.near.signMessage({walletSession:l(r),nearAccount:s(o),params:c,options:{...a(e,t.requestId,u||{})}});e.respondIfCancelled(t.requestId)||i(e,t.requestId,d)}}}async function m(e){await n(e,p)}export{m as handleWalletHostRuntimeRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./primitives-CqrjmIAH.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import{a as e,n as t}from"./shared-
|
|
1
|
+
import"./primitives-CqrjmIAH.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import{a as e,n as t}from"./shared-B6BCLs8L.js";import"./activeWalletSession-WdZkhtBB.js";import"./capabilityKinds-N8xo_IEh.js";import"./errors-DIWY1KR9.js";import"./accountIds-BzZs7YoX.js";import"./registrationSignerPlan-dY9Rp0m_.js";import{c as n}from"./ecdsaChainTarget-DJBXHzbH.js";import"./signerDomain-DqLCvI-D.js";import"./registrationIntent-BHU5k2Q-.js";import"./singletons-8UH3gOnZ.js";import"./walletAuthority-BWvfaKIX.js";import"./emailOtpEcdsaDerivationIdentity-p0C1CQva.js";import"./challengeDelivery-5lIu9spR.js";import"./digestEncoding-CkUc5vtR.js";import"./registrationIds-ByuReLUc.js";import"./passkey-custody-Cd_yyoRa.js";import"./walletCustodyEcdsaContinuity-D-gYxv6e.js";import"./keccak-BArcwgbj.js";import"./wallet-recovery-LMtGiEL3.js";import"./nearEd25519YaoMaterialActivation-DMGPKrn8.js";import"./signNear-bcWIHxEY.js";import"./jsxRuntime.module-C8JOKu_4.js";function r(e){return{PM_SET_CONFIRM_BEHAVIOR:async r=>{let i=e.getWalletRuntime(),{behavior:a,walletId:o}=r.payload;o&&i.preferences.setCurrentWallet(n(o)),await i.preferences.setConfirmationBehavior(a),t(e,r.requestId,e.readPreferences())},PM_SET_CONFIRMATION_CONFIG:async r=>{let i=e.getWalletRuntime(),{walletId:a}=r.payload||{};a&&i.preferences.setCurrentWallet(n(a)),await i.preferences.setConfirmationConfig(r.payload?.config||{}),t(e,r.requestId,e.readPreferences())},PM_GET_CONFIRMATION_CONFIG:async n=>{let r=e.readPreferences();t(e,n.requestId,r)}}}async function i(t){await e(t,r)}export{i as handleWalletHostRuntimeRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./primitives-CqrjmIAH.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import{a as e,n as t,r as n}from"./shared-
|
|
1
|
+
import"./primitives-CqrjmIAH.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import{a as e,n as t,r as n}from"./shared-B6BCLs8L.js";import"./activeWalletSession-WdZkhtBB.js";import"./capabilityKinds-N8xo_IEh.js";import"./errors-DIWY1KR9.js";import"./accountIds-BzZs7YoX.js";import"./registrationSignerPlan-dY9Rp0m_.js";import"./signerDomain-DqLCvI-D.js";import"./registrationIntent-BHU5k2Q-.js";import"./singletons-8UH3gOnZ.js";import"./walletAuthority-BWvfaKIX.js";import"./emailOtpEcdsaDerivationIdentity-p0C1CQva.js";import"./challengeDelivery-5lIu9spR.js";import"./digestEncoding-CkUc5vtR.js";import"./registrationIds-ByuReLUc.js";import"./passkey-custody-Cd_yyoRa.js";import"./walletCustodyEcdsaContinuity-D-gYxv6e.js";import"./keccak-BArcwgbj.js";import"./wallet-recovery-LMtGiEL3.js";import"./nearEd25519YaoMaterialActivation-DMGPKrn8.js";import"./signNear-bcWIHxEY.js";import"./jsxRuntime.module-C8JOKu_4.js";function r(e){return{PM_SYNC_ACCOUNT_FLOW:async r=>{let i=e.getWalletRuntime(),{walletId:a}=r.payload||{};if(e.respondIfCancelled(r.requestId))return;let o=await i.recovery.syncAccount({...a?{walletId:a}:{},options:{...n(e,r.requestId,{})}});e.respondIfCancelled(r.requestId)||t(e,r.requestId,o)}}}async function i(t){await e(t,r)}export{i as handleWalletHostRuntimeRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./primitives-CqrjmIAH.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import"./activeWalletSession-WdZkhtBB.js";import"./capabilityKinds-N8xo_IEh.js";import"./signerDomain-DqLCvI-D.js";import"./singletons-8UH3gOnZ.js";import{tn as e}from"./emailOtpEcdsaDerivationIdentity-p0C1CQva.js";import"./digestEncoding-CkUc5vtR.js";import{z as t}from"./ecdsaCapabilityManifest-ChszYCC0.js";import{t as n}from"./presignatures-DZm0d6Wy.js";import{i as r,u as i}from"./trace-QLsbYdld.js";import{c as a,i as o,r as s}from"./presignaturePool-
|
|
1
|
+
import"./primitives-CqrjmIAH.js";import"./sessionPolicy-CBTZQe1n.js";import"./signingSessionSeal-DX41aXUL.js";import"./activeWalletSession-WdZkhtBB.js";import"./capabilityKinds-N8xo_IEh.js";import"./signerDomain-DqLCvI-D.js";import"./singletons-8UH3gOnZ.js";import{tn as e}from"./emailOtpEcdsaDerivationIdentity-p0C1CQva.js";import"./digestEncoding-CkUc5vtR.js";import{z as t}from"./ecdsaCapabilityManifest-ChszYCC0.js";import{t as n}from"./presignatures-DZm0d6Wy.js";import{i as r,u as i}from"./trace-QLsbYdld.js";import{c as a,i as o,r as s}from"./presignaturePool-Bkk6bLFB.js";function c(e){return e.kind===`digest`&&e.algorithm===`secp256k1`}function l(e){let t=String(e.intent.operationId||``).trim();if(!t)throw Error(`[multichain] exact EVM signing operation id is required`);return t}function u(e){switch(e.kind){case`reusable_wallet_session`:return{kind:`wallet_session_opaque`,walletSessionToken:e.walletSessionToken,home:e.home,ownershipGeneration:e.ownershipGeneration};case`operation_step_up`:return{kind:`wallet_session_opaque`,walletSessionToken:e.walletSessionToken,home:e.home,ownershipGeneration:e.ownershipGeneration}}throw Error(`[multichain] unsupported ECDSA signing credential`)}function d(r){let a=r.loadedMaterial.signerSession,o=a.publicFacts,c=a.transport.signingMaterial,l=s({relayerUrl:a.transport.relayerUrl,keyHandle:t(o.keyHandle),ecdsaThresholdKeyId:c.ecdsaThresholdKeyId,clientVerifyingShareB64u:c.clientVerifier33B64u,clientSigningMaterial:r.loadedMaterial.clientSigningMaterial,thresholdEcdsaPublicKeyB64u:o.publicKeyB64u,relayerVerifyingShareB64u:a.transport.relayerVerifyingShareB64u,credential:r.credential,materialActivation:e(a.materialActivation),routerAbEcdsaDerivationPoolFill:{kind:`router_ab_ecdsa_derivation_signing_worker_pool`,scope:a.routerAbEcdsaDerivationNormalSigning.state.scope,ceremonyExpiresAtMs:r.expiresAtMs,materialExpiresAtMs:Date.now()+n},workerCtx:r.workerCtx,authorization:r.authorization});i(`evm-family`,{event:`ecdsa_signing_refill`,operationId:r.operationId,scheduled:l.scheduled,reason:l.reason,depth:l.depth,targetDepth:l.targetDepth})}var f=class{constructor(e){this.algorithm=`secp256k1`,this.beforeSigning=e.beforeSigning,this.shouldAbort=e.shouldAbort,this.workerCtx=e.workerCtx,this.reconcileSession=e.reconcileSession}async signReadySecp256k1Digest(n,s,c,f){let p=l(c),m=performance.now(),h=await a({signerSession:s.signerSession,workerCtx:this.workerCtx});r(p,`material_load`,m);let g=h.signerSession,_=g.publicFacts,v=g.transport,y=u(s.credential),b=!1;try{let r={relayerUrl:v.relayerUrl,scope:g.routerAbEcdsaDerivationNormalSigning.state.scope,operationId:p,operationDigests:{lane_digest_b64u:f.laneDigest,intent_digest_b64u:f.intentDigest,display_digest_b64u:f.displayDigest},materialActivation:e(g.materialActivation),credential:y,keyHandle:t(_.keyHandle),signingDigest32:n.digest32,clientSigningMaterial:h.clientSigningMaterial,expiresAtMs:s.expiresAtMs,workerCtx:this.workerCtx};this.beforeSigning?.(),s.authorization.kind===`reusable_wallet_session`?d({operationId:p,loadedMaterial:h,workerCtx:this.workerCtx,credential:y,expiresAtMs:s.expiresAtMs,authorization:s.authorization}):i(`evm-family`,{event:`ecdsa_signing_refill`,operationId:p,scheduled:!1,reason:`operation_step_up`});let a;if(s.authorization.kind===`reusable_wallet_session`)a=await o({...r,authorization:s.authorization,reconcileSession:this.reconcileSession});else{let e=s.operationStepUpPreparation;if(!e)throw Error(`[multichain] operation step-up preparation is required for signing`);a=await o({...r,authorization:s.authorization,operation:e})}if(!a.ok)throw Error(a.message||a.code||`[multichain] Router A/B ECDSA derivation signing failed`);return b=!0,a.signature65}finally{await h.cleanupAfterSign({singleUseEmailOtpSession:s.singleUseEmailOtpSession}),r(p,`sign_total`,m,b?`succeeded`:`failed`)}}async signReady(e,t,n,r){if(!c(e))throw Error(`[Secp256k1Engine] unsupported sign request`);if(e.digest32.length!==32)throw Error(`[Secp256k1Engine] digest32 must be 32 bytes`);if(this.shouldAbort?.()){let e=Error(`Request cancelled`);throw e.code=`cancelled`,e}return await this.signReadySecp256k1Digest(e,t,n,r)}};export{f as Secp256k1Engine};
|