@seams/wallet 0.6.0 → 0.6.2

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 (150) hide show
  1. package/dist/.build-inputs.sha256 +1 -1
  2. package/dist/esm/SeamsWeb/SeamsWeb.js +1 -0
  3. package/dist/esm/SeamsWeb/operations/registration/registration.js +162 -33
  4. package/dist/esm/SeamsWeb/operations/registration/registrationTiming.js +33 -2
  5. package/dist/esm/SeamsWeb/signingSurface/BrowserSigningSurface.js +3 -0
  6. package/dist/esm/SeamsWeb/walletIframe/client/overlay/overlay-controller.js +63 -10
  7. package/dist/esm/core/rpcClients/relayer/walletRegistration.js +45 -3
  8. package/dist/esm/core/signingEngine/flows/signNear/shared/ed25519YaoNormalSigning.js +19 -0
  9. package/dist/esm/core/signingEngine/flows/signNear/signTransactions.js +25 -6
  10. package/dist/esm/core/signingEngine/nonce/nearNonceLane.js +0 -29
  11. package/dist/esm/core/signingEngine/session/operationState/trace.js +10 -1
  12. package/dist/esm/core/signingEngine/session/passkey/prfCache.js +24 -4
  13. package/dist/esm/core/signingEngine/uiConfirm/PasskeyMpcSessionDurableState.js +5 -3
  14. package/dist/esm/core/signingEngine/uiConfirm/PasskeyMpcSessionManager.js +40 -3
  15. package/dist/esm/core/signingEngine/uiConfirm/ui/preact/TransactionReceipt.js +31 -35
  16. package/dist/esm/core/signingEngine/uiConfirm/ui/preact/mountConfirmationSurface.js +64 -10
  17. package/dist/esm/core/signingEngine/walletCustody/ceremonyDriver.js +1 -1
  18. package/dist/esm/react/SeamsWeb/SeamsWeb.js +1 -0
  19. package/dist/esm/react/SeamsWeb/operations/registration/registration.js +162 -33
  20. package/dist/esm/react/SeamsWeb/operations/registration/registrationTiming.js +33 -2
  21. package/dist/esm/react/SeamsWeb/signingSurface/BrowserSigningSurface.js +3 -0
  22. package/dist/esm/react/SeamsWeb/walletIframe/client/overlay/overlay-controller.js +63 -10
  23. package/dist/esm/react/core/rpcClients/relayer/walletRegistration.js +45 -3
  24. package/dist/esm/react/core/signingEngine/flows/signNear/shared/ed25519YaoNormalSigning.js +19 -0
  25. package/dist/esm/react/core/signingEngine/flows/signNear/signTransactions.js +25 -6
  26. package/dist/esm/react/core/signingEngine/nonce/nearNonceLane.js +0 -29
  27. package/dist/esm/react/core/signingEngine/session/operationState/trace.js +10 -1
  28. package/dist/esm/react/core/signingEngine/session/passkey/prfCache.js +24 -4
  29. package/dist/esm/react/core/signingEngine/uiConfirm/PasskeyMpcSessionDurableState.js +5 -3
  30. package/dist/esm/react/core/signingEngine/uiConfirm/PasskeyMpcSessionManager.js +40 -3
  31. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/TransactionReceipt.js +31 -35
  32. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/mountConfirmationSurface.js +64 -10
  33. package/dist/esm/react/core/signingEngine/walletCustody/ceremonyDriver.js +1 -1
  34. package/dist/esm/react/shared-ts/src/utils/routerAbEd25519Yao.js +13 -1
  35. package/dist/esm/sdk/{NonceCoordinator-C7QltTDC.js → NonceCoordinator-C7mqpJiU.js} +0 -29
  36. package/dist/esm/sdk/{adapters-Dgy69gf0.js → adapters-m94YFj70.js} +96 -46
  37. package/dist/{public/sdk/defaultConfigs-DJCLCrg9.js → esm/sdk/defaultConfigs-CyNOW4Sy.js} +1 -1
  38. package/dist/{public/sdk/display-Cw90-qmF.js → esm/sdk/display-DHdC2yXU.js} +1 -1
  39. package/dist/{public/sdk/ecdsaCapabilityManifest-DA_fklIs.js → esm/sdk/ecdsaCapabilityManifest-C8itxV9S.js} +1 -1
  40. package/dist/esm/sdk/{ecdsaPresignLifecycle-D_KCktCj.js → ecdsaPresignLifecycle-CnSnzoRJ.js} +13 -1
  41. package/dist/{public/sdk/ed25519SeedMaterial-0VmS6K9P.js → esm/sdk/ed25519SeedMaterial-Cghz8-XB.js} +2 -2
  42. package/dist/esm/sdk/{exactSessionState-C2aAv_ED.js → exactSessionState-Bt0HforB.js} +64 -11
  43. package/dist/esm/sdk/{export-viewer-host-NhjFdpm-.js → export-viewer-host-CbqG8ZQV.js} +1 -1
  44. package/dist/esm/sdk/{host-DACTruOj.js → host-BPC1zSVg.js} +2 -2
  45. package/dist/esm/sdk/{localOnly-DTNq69fJ.js → localOnly-CbLYTVbo.js} +2 -2
  46. package/dist/{public/sdk/nearEd25519YaoMaterialActivation-4AuGG2DG.js → esm/sdk/nearEd25519YaoMaterialActivation-Cz5UJQ_7.js} +46 -4
  47. package/dist/esm/sdk/{nearEd25519YaoSigningPreparation-jiGcQylO.js → nearEd25519YaoSigningPreparation-DX6xG-IW.js} +1 -1
  48. package/dist/esm/sdk/{prfCache-Dwwauj4v.js → prfCache-CgAr-VEU.js} +24 -4
  49. package/dist/{public/sdk/recovery-entrypoint-CFTX6PFZ.js → esm/sdk/recovery-entrypoint-D39R1avB.js} +3 -3
  50. package/dist/{public/sdk/registration-CuP1WmQu.js → esm/sdk/registration-DtDICj-o.js} +1 -1
  51. package/dist/esm/sdk/{registration-D8nYJKec.js → registration-PIBMSsQR.js} +247 -40
  52. package/dist/esm/sdk/{registrationPreparationPreload-DDe0sbZi.js → registrationPreparationPreload-BZfAC_ba.js} +2 -2
  53. package/dist/{public/sdk/router-DeX_cJ2f.js → esm/sdk/router-CeFS9SgT.js} +3 -3
  54. package/dist/{public/sdk/routerAbNormalSigning-BGpRKRAj.js → esm/sdk/routerAbNormalSigning-DktZKnf1.js} +1 -1
  55. package/dist/{public/sdk/runtime-auth-Ch00YcH5.js → esm/sdk/runtime-auth-D_lUQQlc.js} +8 -8
  56. package/dist/esm/sdk/{runtime-device-link-CEhVZYAw.js → runtime-device-link-CEph1iM0.js} +4 -4
  57. package/dist/{public/sdk/runtime-ecdsa-tempo-B-qMRrmx.js → esm/sdk/runtime-ecdsa-tempo-tUWnafRo.js} +5 -5
  58. package/dist/esm/sdk/{runtime-email-otp-giyMPib8.js → runtime-email-otp-1wIPTDim.js} +4 -4
  59. package/dist/esm/sdk/{runtime-export-CV-6G1Oy.js → runtime-export-Du2d4_Vu.js} +4 -4
  60. package/dist/{public/sdk/runtime-near-DoDcS88O.js → esm/sdk/runtime-near-CGoWxu7u.js} +4 -4
  61. package/dist/{public/sdk/runtime-preferences-Canyenle.js → esm/sdk/runtime-preferences-JwJK_xP3.js} +4 -4
  62. package/dist/esm/sdk/{runtime-recovery-lWyILD1g.js → runtime-recovery-BEqBdpyo.js} +4 -4
  63. package/dist/esm/sdk/{runtimeContext-BdTaYxJD.js → runtimeContext-CTt9ON27.js} +83 -40
  64. package/dist/{public/sdk/runtimeLoader-Dxn8UA8B.js → esm/sdk/runtimeLoader-ZXsvx9zX.js} +9 -9
  65. package/dist/{public/sdk/secp256k1-CQFsI3qQ.js → esm/sdk/secp256k1-CWDid9WH.js} +4 -4
  66. package/dist/{public/sdk/signEvmFamily-CZLET02E.js → esm/sdk/signEvmFamily-pbMepepQ.js} +10 -10
  67. package/dist/esm/sdk/{signEvmFamilyWithUiConfirmForTempo-DHTBHHgE.js → signEvmFamilyWithUiConfirmForTempo-CxvfCI_o.js} +2 -2
  68. package/dist/{public/sdk/signEvmWithUiConfirm-CSxTBQUW.js → esm/sdk/signEvmWithUiConfirm-nk-r3Rff.js} +1 -1
  69. package/dist/esm/sdk/{signNear-BeUWiWm_.js → signNear-DVD9-IO5.js} +50 -13
  70. package/dist/{public/sdk/signatureUses-C1o1pDql.js → esm/sdk/signatureUses-BY1IY7uz.js} +1 -1
  71. package/dist/{public/sdk/signerLoader-C_w8vuhm.js → esm/sdk/signerLoader-D_w-SfR9.js} +3 -3
  72. package/dist/{public/sdk/trace-DWnDLSuV.js → esm/sdk/trace-08ayoiNp.js} +10 -1
  73. package/dist/{public/sdk/transactionState-Dd13hMoY.js → esm/sdk/transactionState-Bpm4GamO.js} +2 -2
  74. package/dist/esm/sdk/tx-confirm-ui.js +134 -93
  75. package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
  76. package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
  77. package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
  78. package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
  79. package/dist/esm/sdk/wallet-ui.css +92 -32
  80. package/dist/esm/sdk/{walletRecoveryCommit-DNvzgeIX.js → walletRecoveryCommit-G6w6N5RV.js} +3 -3
  81. package/dist/esm/sdk/{warmSessionHydration-CCKeEIIy.js → warmSessionHydration-DDNYdTCz.js} +1 -1
  82. package/dist/esm/shared-ts/src/utils/routerAbEd25519Yao.js +13 -1
  83. package/dist/public/headers.manifest.json +1 -1
  84. package/dist/public/sdk/{NonceCoordinator-C7QltTDC.js → NonceCoordinator-C7mqpJiU.js} +0 -29
  85. package/dist/public/sdk/{adapters-Dgy69gf0.js → adapters-m94YFj70.js} +96 -46
  86. package/dist/{esm/sdk/defaultConfigs-DJCLCrg9.js → public/sdk/defaultConfigs-CyNOW4Sy.js} +1 -1
  87. package/dist/{esm/sdk/display-Cw90-qmF.js → public/sdk/display-DHdC2yXU.js} +1 -1
  88. package/dist/{esm/sdk/ecdsaCapabilityManifest-DA_fklIs.js → public/sdk/ecdsaCapabilityManifest-C8itxV9S.js} +1 -1
  89. package/dist/public/sdk/{ecdsaPresignLifecycle-D_KCktCj.js → ecdsaPresignLifecycle-CnSnzoRJ.js} +13 -1
  90. package/dist/{esm/sdk/ed25519SeedMaterial-0VmS6K9P.js → public/sdk/ed25519SeedMaterial-Cghz8-XB.js} +2 -2
  91. package/dist/public/sdk/{exactSessionState-C2aAv_ED.js → exactSessionState-Bt0HforB.js} +64 -11
  92. package/dist/public/sdk/{export-viewer-host-NhjFdpm-.js → export-viewer-host-CbqG8ZQV.js} +1 -1
  93. package/dist/public/sdk/{host-DACTruOj.js → host-BPC1zSVg.js} +2 -2
  94. package/dist/public/sdk/{localOnly-DTNq69fJ.js → localOnly-CbLYTVbo.js} +2 -2
  95. package/dist/{esm/sdk/nearEd25519YaoMaterialActivation-4AuGG2DG.js → public/sdk/nearEd25519YaoMaterialActivation-Cz5UJQ_7.js} +46 -4
  96. package/dist/public/sdk/{nearEd25519YaoSigningPreparation-jiGcQylO.js → nearEd25519YaoSigningPreparation-DX6xG-IW.js} +1 -1
  97. package/dist/public/sdk/{prfCache-Dwwauj4v.js → prfCache-CgAr-VEU.js} +24 -4
  98. package/dist/{esm/sdk/recovery-entrypoint-CFTX6PFZ.js → public/sdk/recovery-entrypoint-D39R1avB.js} +3 -3
  99. package/dist/{esm/sdk/registration-CuP1WmQu.js → public/sdk/registration-DtDICj-o.js} +1 -1
  100. package/dist/public/sdk/{registration-D8nYJKec.js → registration-PIBMSsQR.js} +247 -40
  101. package/dist/public/sdk/{registrationPreparationPreload-DDe0sbZi.js → registrationPreparationPreload-BZfAC_ba.js} +2 -2
  102. package/dist/{esm/sdk/router-DeX_cJ2f.js → public/sdk/router-CeFS9SgT.js} +3 -3
  103. package/dist/{esm/sdk/routerAbNormalSigning-BGpRKRAj.js → public/sdk/routerAbNormalSigning-DktZKnf1.js} +1 -1
  104. package/dist/{esm/sdk/runtime-auth-Ch00YcH5.js → public/sdk/runtime-auth-D_lUQQlc.js} +8 -8
  105. package/dist/public/sdk/{runtime-device-link-CEhVZYAw.js → runtime-device-link-CEph1iM0.js} +4 -4
  106. package/dist/{esm/sdk/runtime-ecdsa-tempo-B-qMRrmx.js → public/sdk/runtime-ecdsa-tempo-tUWnafRo.js} +5 -5
  107. package/dist/public/sdk/{runtime-email-otp-giyMPib8.js → runtime-email-otp-1wIPTDim.js} +4 -4
  108. package/dist/public/sdk/{runtime-export-CV-6G1Oy.js → runtime-export-Du2d4_Vu.js} +4 -4
  109. package/dist/{esm/sdk/runtime-near-DoDcS88O.js → public/sdk/runtime-near-CGoWxu7u.js} +4 -4
  110. package/dist/{esm/sdk/runtime-preferences-Canyenle.js → public/sdk/runtime-preferences-JwJK_xP3.js} +4 -4
  111. package/dist/public/sdk/{runtime-recovery-lWyILD1g.js → runtime-recovery-BEqBdpyo.js} +4 -4
  112. package/dist/public/sdk/{runtimeContext-BdTaYxJD.js → runtimeContext-CTt9ON27.js} +83 -40
  113. package/dist/{esm/sdk/runtimeLoader-Dxn8UA8B.js → public/sdk/runtimeLoader-ZXsvx9zX.js} +9 -9
  114. package/dist/{esm/sdk/secp256k1-CQFsI3qQ.js → public/sdk/secp256k1-CWDid9WH.js} +4 -4
  115. package/dist/{esm/sdk/signEvmFamily-CZLET02E.js → public/sdk/signEvmFamily-pbMepepQ.js} +10 -10
  116. package/dist/public/sdk/{signEvmFamilyWithUiConfirmForTempo-DHTBHHgE.js → signEvmFamilyWithUiConfirmForTempo-CxvfCI_o.js} +2 -2
  117. package/dist/{esm/sdk/signEvmWithUiConfirm-CSxTBQUW.js → public/sdk/signEvmWithUiConfirm-nk-r3Rff.js} +1 -1
  118. package/dist/public/sdk/{signNear-BeUWiWm_.js → signNear-DVD9-IO5.js} +50 -13
  119. package/dist/{esm/sdk/signatureUses-C1o1pDql.js → public/sdk/signatureUses-BY1IY7uz.js} +1 -1
  120. package/dist/{esm/sdk/signerLoader-C_w8vuhm.js → public/sdk/signerLoader-D_w-SfR9.js} +3 -3
  121. package/dist/{esm/sdk/trace-DWnDLSuV.js → public/sdk/trace-08ayoiNp.js} +10 -1
  122. package/dist/{esm/sdk/transactionState-Dd13hMoY.js → public/sdk/transactionState-Bpm4GamO.js} +2 -2
  123. package/dist/public/sdk/tx-confirm-ui.js +134 -93
  124. package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
  125. package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
  126. package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
  127. package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
  128. package/dist/public/sdk/wallet-ui.css +92 -32
  129. package/dist/public/sdk/{walletRecoveryCommit-DNvzgeIX.js → walletRecoveryCommit-G6w6N5RV.js} +3 -3
  130. package/dist/public/sdk/{warmSessionHydration-CCKeEIIy.js → warmSessionHydration-DDNYdTCz.js} +1 -1
  131. package/dist/public/sdk/workers/passkey-mpc-session.worker.js +92 -8
  132. package/dist/public/wallet-assets.manifest.json +86 -86
  133. package/dist/public/wallet-service/index.html +4 -4
  134. package/dist/types/wallet/src/SeamsWeb/operations/registration/registration.d.ts +15 -1
  135. package/dist/types/wallet/src/SeamsWeb/operations/registration/registrationTiming.d.ts +11 -1
  136. package/dist/types/wallet/src/SeamsWeb/signingSurface/BrowserSigningSurface.d.ts +6 -0
  137. package/dist/types/wallet/src/SeamsWeb/signingSurface/ports.d.ts +8 -2
  138. package/dist/types/wallet/src/core/rpcClients/relayer/walletRegistration.d.ts +49 -10
  139. package/dist/types/wallet/src/core/signingEngine/nonce/nearNonceLane.d.ts +2 -1
  140. package/dist/types/wallet/src/core/signingEngine/session/operationState/trace.d.ts +2 -0
  141. package/dist/types/wallet/src/core/signingEngine/session/passkey/prfCache.d.ts +7 -9
  142. package/dist/types/wallet/src/core/signingEngine/session/passkey/warmSessionHydration.d.ts +7 -8
  143. package/dist/types/wallet/src/core/signingEngine/session/passkey/warmSessionMaterialWriter.d.ts +9 -9
  144. package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/public.d.ts +7 -8
  145. package/dist/types/wallet/src/core/signingEngine/uiConfirm/PasskeyMpcSessionDurableState.d.ts +3 -0
  146. package/dist/types/wallet/src/core/signingEngine/uiConfirm/uiConfirm.types.d.ts +6 -0
  147. package/dist/types/wallet/src/core/signingEngine/workerManager/workers/shamir3pass/clientSealPreparation.d.ts +2 -0
  148. package/dist/types/wallet/src/core/types/secure-confirm-worker.d.ts +15 -1
  149. package/dist/workers/passkey-mpc-session.worker.js +92 -8
  150. package/package.json +1 -1
@@ -661,6 +661,11 @@ export type WalletRegistrationRespondResponseV2 = {
661
661
  ecdsa?: never;
662
662
  ed25519: WalletRegistrationRespondEd25519DeferredWork;
663
663
  };
664
+ export type WalletRegistrationNearAdmissionResponseV2 = {
665
+ ok: true;
666
+ registrationCeremonyId: string;
667
+ ed25519: WalletRegistrationRespondEd25519DeferredWork;
668
+ };
664
669
  type WalletRegistrationSignerPlanKind = WalletRegistrationRespondResponseV2['kind'];
665
670
  type RespondWalletRegistrationArgsBase = {
666
671
  relayerUrl: string;
@@ -683,6 +688,7 @@ type RespondWalletRegistrationArgs = (RespondWalletRegistrationArgsBase & {
683
688
  ecdsa: WalletRegistrationRespondEcdsaRequest;
684
689
  });
685
690
  export declare function respondWalletRegistration(args: RespondWalletRegistrationArgs): Promise<WalletRegistrationRespondResponseV2>;
691
+ export declare function authorizeWalletRegistrationNearAdmission(args: RespondWalletRegistrationArgsBase): Promise<WalletRegistrationNearAdmissionResponseV2>;
686
692
  /**
687
693
  * Refactor 94C route 3. Activate absorbs finalize: one call carries the
688
694
  * browser-verified activation facts and the Email OTP enrollment material that
@@ -783,14 +789,28 @@ export declare function activateWalletRegistration(args: ActivateWalletRegistrat
783
789
  * repeatable, so the caller reports provisioning state rather than unwinding
784
790
  * a wallet that already exists.
785
791
  */
786
- export type WalletRegistrationNearProvisioningResponseV2 = (Extract<WalletRegistrationFinalizeResponse, {
792
+ type WalletRegistrationNearProvisioningFinalizeSuccessV2 = Extract<WalletRegistrationFinalizeResponse, {
787
793
  ok: true;
788
794
  kind: 'near_ed25519';
789
- }> & {
795
+ }>;
796
+ type WalletRegistrationNearProvisioningSuccessBaseV2 = {
790
797
  registrationEstablishedSession: RegistrationEstablishedSessionResultV2;
791
798
  nearProvisioning: {
792
799
  status: 'near_ready';
793
800
  };
801
+ };
802
+ export type WalletRegistrationNearProvisioningResponseV2 = (Extract<WalletRegistrationNearProvisioningFinalizeSuccessV2, {
803
+ authMethod: {
804
+ kind: 'passkey';
805
+ };
806
+ }> & WalletRegistrationNearProvisioningSuccessBaseV2 & {
807
+ sessionSeal?: WalletRegistrationSessionSealResponse;
808
+ }) | (Extract<WalletRegistrationNearProvisioningFinalizeSuccessV2, {
809
+ authMethod: {
810
+ kind: 'email_otp';
811
+ };
812
+ }> & WalletRegistrationNearProvisioningSuccessBaseV2 & {
813
+ sessionSeal?: never;
794
814
  }) | {
795
815
  ok: false;
796
816
  code: string;
@@ -799,7 +819,13 @@ export type WalletRegistrationNearProvisioningResponseV2 = (Extract<WalletRegist
799
819
  status: 'near_failed_retryable';
800
820
  };
801
821
  };
802
- export declare function completeWalletRegistrationNearProvisioning(args: {
822
+ export type WalletRegistrationSessionSealResponse = {
823
+ readonly ciphertext: string;
824
+ readonly keyVersion: string;
825
+ readonly expiresAtMs: number;
826
+ readonly remainingUses: number;
827
+ };
828
+ type CompleteWalletRegistrationNearProvisioningBaseArgs = {
803
829
  relayerUrl: string;
804
830
  headers?: Record<string, string>;
805
831
  registrationCeremonyId: string;
@@ -809,19 +835,32 @@ export declare function completeWalletRegistrationNearProvisioning(args: {
809
835
  ed25519: {
810
836
  activationReference: WalletRegistrationEd25519YaoActivationReference;
811
837
  };
812
- auth: {
813
- kind: 'passkey';
814
- } | {
815
- kind: 'email_otp';
816
- enrollment: WalletRegistrationEmailOtpEnrollmentMaterial;
817
- };
818
838
  /**
819
839
  * The custody ceremony's sealed output. For an Ed25519-only wallet this is
820
840
  * the call that establishes custody: activate had no key set to seal against.
821
841
  */
822
842
  walletCustodyCommit?: WalletCustodyCeremonyCommitPayload;
823
843
  onServerTiming?: (header: string | null) => void;
824
- }): Promise<WalletRegistrationNearProvisioningResponseV2>;
844
+ };
845
+ type CompleteWalletRegistrationNearProvisioningArgs = CompleteWalletRegistrationNearProvisioningBaseArgs & ({
846
+ auth: {
847
+ kind: 'passkey';
848
+ } | {
849
+ kind: 'email_otp';
850
+ enrollment: WalletRegistrationEmailOtpEnrollmentMaterial;
851
+ };
852
+ sessionSeal?: never;
853
+ } | {
854
+ auth: {
855
+ kind: 'passkey';
856
+ };
857
+ sessionSeal: {
858
+ readonly thresholdSessionId: string;
859
+ readonly ciphertext: string;
860
+ readonly keyVersion?: string;
861
+ };
862
+ });
863
+ export declare function completeWalletRegistrationNearProvisioning(args: CompleteWalletRegistrationNearProvisioningArgs): Promise<WalletRegistrationNearProvisioningResponseV2>;
825
864
  type FinalizeWalletRegistrationBaseArgs = {
826
865
  relayerUrl: string;
827
866
  headers?: Record<string, string>;
@@ -3,6 +3,7 @@ import type { NonceLaneStatus } from '../../rpcClients/evm/nonceBackend';
3
3
  import type { TransactionContext } from '../../types/rpc';
4
4
  import type { AccessKeyView, BlockResult } from '@near-js/types';
5
5
  import { NonceDurableLeaseState, type NearNonceLane, type NearNonceLease, type NonceDurableLeaseLifecycle } from './nonceTypes';
6
+ type NearFreshDataClient = Pick<NearClient, 'viewAccessKey' | 'viewBlock'>;
6
7
  export type NearAccessKeySubject = {
7
8
  walletId: string;
8
9
  nearAccountId: string;
@@ -184,7 +185,7 @@ export declare class NearAccountLookupFailedError extends Error {
184
185
  }
185
186
  export declare function fetchNearFreshDataForState(input: {
186
187
  state: NearNonceLaneState;
187
- nearClient: NearClient;
188
+ nearClient: NearFreshDataClient;
188
189
  force?: boolean;
189
190
  now: () => number;
190
191
  nonceFreshnessThresholdMs: number;
@@ -5,6 +5,8 @@ export declare function emitEcdsaServerTiming(operationId: string, phase: 'prepa
5
5
  export declare function emitEcdsaPresignServerTiming(presignSessionId: string, phase: 'init' | 'step', header: string | null): void;
6
6
  export type EcdsaSigningTimingStage = 'material_queue' | 'material_authorization' | 'material_load' | 'public_key_validation' | 'pool_lookup' | 'pool_restore' | 'refill_wait' | 'foreground_refill' | 'presignature_reserve' | 'prepare' | 'presignature_commit' | 'client_share' | 'finalize' | 'signature_verify' | 'sign_total' | 'transaction_assembly' | 'commit_total';
7
7
  export declare function emitEcdsaSigningTiming(operationId: string, stage: EcdsaSigningTimingStage, startedAt: number, outcome?: 'succeeded' | 'failed'): void;
8
+ export type Ed25519SigningTimingStage = 'confirmed_to_signed' | 'prepare' | 'client_share' | 'finalize' | 'signature_total';
9
+ export declare function emitEd25519SigningTiming(operationId: string, stage: Ed25519SigningTimingStage, startedAt: number, outcome?: 'succeeded' | 'failed'): void;
8
10
  export type SigningLaneResolutionTraceEvent = {
9
11
  event: 'signing_lane_resolved';
10
12
  lane: SigningLaneSummary;
@@ -1,14 +1,12 @@
1
1
  import type { WarmSessionMaterialWriter, WarmSessionMaterialWriteDiagnostics } from './warmSessionMaterialWriter';
2
- type SigningSessionCacheTransport = Parameters<WarmSessionMaterialWriter['putWarmSessionMaterial']>[0]['transport'];
2
+ import type { WarmSessionSealTransportState } from '../../../types/secure-confirm-worker';
3
3
  export type SigningSessionCacheEntry = {
4
- thresholdSessionId: string;
5
- prfFirstB64u: string;
6
- expiresAtMs: number;
7
- remainingUses: number;
8
- transport?: SigningSessionCacheTransport;
9
- diagnostics?: WarmSessionMaterialWriteDiagnostics;
10
- };
4
+ readonly thresholdSessionId: string;
5
+ readonly prfFirstB64u: string;
6
+ readonly expiresAtMs: number;
7
+ readonly remainingUses: number;
8
+ readonly diagnostics?: WarmSessionMaterialWriteDiagnostics;
9
+ } & WarmSessionSealTransportState;
11
10
  export declare function generateSessionId(prefix: string): string;
12
11
  export declare function cacheCredentialBoundarySetupExportPrfFirst(writer: WarmSessionMaterialWriter, args: SigningSessionCacheEntry): Promise<void>;
13
- export {};
14
12
  //# sourceMappingURL=prfCache.d.ts.map
@@ -1,13 +1,12 @@
1
- import type { WarmSessionSealTransportInput } from '../../../types/secure-confirm-worker';
1
+ import type { WarmSessionSealTransportState } from '../../../types/secure-confirm-worker';
2
2
  import type { WarmSessionMaterialWriter, WarmSessionMaterialWriteDiagnostics } from './warmSessionMaterialWriter';
3
3
  export type HydrateWarmSigningSessionInput = {
4
- thresholdSessionId: string;
5
- prfFirstB64u: string;
6
- expiresAtMs: number;
7
- remainingUses: number;
8
- transport?: WarmSessionSealTransportInput;
9
- diagnostics?: WarmSessionMaterialWriteDiagnostics;
10
- };
4
+ readonly thresholdSessionId: string;
5
+ readonly prfFirstB64u: string;
6
+ readonly expiresAtMs: number;
7
+ readonly remainingUses: number;
8
+ readonly diagnostics?: WarmSessionMaterialWriteDiagnostics;
9
+ } & WarmSessionSealTransportState;
11
10
  export type WarmSessionHydrationService = {
12
11
  hydrateSigningSession(input: HydrateWarmSigningSessionInput): Promise<void>;
13
12
  };
@@ -1,14 +1,14 @@
1
- import type { WarmSessionSealTransportInput } from '../../../types/secure-confirm-worker';
1
+ import type { WarmSessionSealTransportState } from '../../../types/secure-confirm-worker';
2
2
  import type { WarmSessionMaterialWriteDiagnostics } from '../warmCapabilities/types';
3
3
  export type { WarmSessionMaterialWriteDiagnosticBucket, WarmSessionMaterialWriteDiagnostics, } from '../warmCapabilities/types';
4
+ export type WarmSessionMaterialWriteInput = {
5
+ readonly thresholdSessionId: string;
6
+ readonly prfFirstB64u: string;
7
+ readonly expiresAtMs: number;
8
+ readonly remainingUses: number;
9
+ readonly diagnostics?: WarmSessionMaterialWriteDiagnostics;
10
+ } & WarmSessionSealTransportState;
4
11
  export interface WarmSessionMaterialWriter {
5
- putWarmSessionMaterial(args: {
6
- thresholdSessionId: string;
7
- prfFirstB64u: string;
8
- expiresAtMs: number;
9
- remainingUses: number;
10
- transport?: WarmSessionSealTransportInput;
11
- diagnostics?: WarmSessionMaterialWriteDiagnostics;
12
- }): Promise<void>;
12
+ putWarmSessionMaterial(args: WarmSessionMaterialWriteInput): Promise<void>;
13
13
  }
14
14
  //# sourceMappingURL=warmSessionMaterialWriter.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import type { SigningSessionStatus } from '../../../types/seams';
2
- import type { WarmSessionSealTransportInput } from '../../../types/secure-confirm-worker';
2
+ import type { WarmSessionSealTransportState } from '../../../types/secure-confirm-worker';
3
3
  import type { WarmSessionMaterialWriteDiagnostics } from './types';
4
4
  import type { ThresholdEcdsaChainTarget, WalletId } from '../../interfaces/ecdsaChainTarget';
5
5
  import { type WalletSigningSessionStatusDeps } from '../lifecycle/walletSessionStatus';
@@ -16,13 +16,12 @@ export type PersistThresholdEcdsaBootstrapForWalletTargetInput = {
16
16
  signerAuth: ThresholdEcdsaBootstrapSignerAuth;
17
17
  };
18
18
  export type HydrateSigningSessionInput = {
19
- thresholdSessionId: string;
20
- prfFirstB64u: string;
21
- expiresAtMs: number;
22
- remainingUses: number;
23
- transport?: WarmSessionSealTransportInput;
24
- diagnostics?: WarmSessionMaterialWriteDiagnostics;
25
- };
19
+ readonly thresholdSessionId: string;
20
+ readonly prfFirstB64u: string;
21
+ readonly expiresAtMs: number;
22
+ readonly remainingUses: number;
23
+ readonly diagnostics?: WarmSessionMaterialWriteDiagnostics;
24
+ } & WarmSessionSealTransportState;
26
25
  export type WarmCapabilitiesPublicDeps = {
27
26
  statusReader: Pick<ThresholdWarmSessionStatusReader, 'getEd25519SigningSessionStatus'>;
28
27
  persistThresholdEcdsaBootstrapForWalletTarget: (args: PersistThresholdEcdsaBootstrapForWalletTargetInput) => Promise<void>;
@@ -19,6 +19,9 @@ export declare class PasskeyMpcSessionDurableState {
19
19
  thresholdSessionId: string;
20
20
  transport: PasskeyWarmSessionSealTransportInput;
21
21
  diagnostics?: WarmSessionMaterialWriteDiagnostics;
22
+ completedSeal?: Extract<WarmSessionSealAndPersistResult, {
23
+ readonly ok: true;
24
+ }>;
22
25
  }): Promise<WarmSessionSealAndPersistResult>;
23
26
  recordPolicyResult(purpose: WarmSessionLanePurpose, thresholdSessionId: string, result: WarmSessionStatusResult | WarmSessionClaimResult): Promise<void>;
24
27
  updatePersistedPolicy(args: {
@@ -210,6 +210,12 @@ export interface PasskeyMpcSessionWorkerLifecyclePort {
210
210
  thresholdSessionId: string;
211
211
  prfFirstB64u: string;
212
212
  }): Promise<void>;
213
+ readPreparedSigningSessionHydration(input: {
214
+ preparationId: string;
215
+ thresholdSessionId: string;
216
+ }): Promise<{
217
+ readonly ciphertext: string;
218
+ }>;
213
219
  discardSigningSessionHydration(input: {
214
220
  preparationId: string;
215
221
  thresholdSessionId: string;
@@ -15,6 +15,8 @@ export declare class ClientSealPreparations {
15
15
  constructor(getRuntime: () => Promise<Shamir3PassRuntime>);
16
16
  prepare(sessionId: string, preparationId: string, secret: string): Promise<void>;
17
17
  take(sessionId: string, secret: string): Promise<PreparedClientSeal>;
18
+ readCiphertext(sessionId: string, preparationId: string): Promise<string>;
19
+ takeExact(sessionId: string, preparationId: string, secret: string): Promise<PreparedClientSeal>;
18
20
  discard(sessionId: string, preparationId: string): Promise<void>;
19
21
  clearSession(sessionId: string): void;
20
22
  clear(): void;
@@ -41,7 +41,7 @@ export interface UiConfirmManagerConfig {
41
41
  signingSessionSealGroupId?: string;
42
42
  }
43
43
  export type UserConfirmWorkerMessageType = UserConfirmWorkerMessage['type'];
44
- export type PasskeyMpcSessionWorkerMessageType = 'PING' | 'PREWARM_SHAMIR3PASS' | 'PREPARE_SESSION_CLIENT_SEAL' | 'DISCARD_SESSION_CLIENT_SEAL' | 'WARM_SESSION_MATERIAL_PUT' | 'WARM_SESSION_STATUS_READ' | 'WARM_SESSION_STATUS_BATCH_READ' | 'WARM_SESSION_MATERIAL_CLAIM' | 'WARM_SESSION_MATERIAL_CONSUME' | 'WARM_SESSION_VOLATILE_MATERIAL_CLEAR' | 'WARM_SESSION_VOLATILE_MATERIAL_CLEAR_ALL' | 'WARM_SESSION_SEAL_AND_PERSIST' | 'WARM_SESSION_REHYDRATE';
44
+ export type PasskeyMpcSessionWorkerMessageType = 'PING' | 'PREWARM_SHAMIR3PASS' | 'PREPARE_SESSION_CLIENT_SEAL' | 'READ_SESSION_CLIENT_SEAL' | 'COMPLETE_SESSION_CLIENT_SEAL' | 'DISCARD_SESSION_CLIENT_SEAL' | 'WARM_SESSION_MATERIAL_PUT' | 'WARM_SESSION_STATUS_READ' | 'WARM_SESSION_STATUS_BATCH_READ' | 'WARM_SESSION_MATERIAL_CLAIM' | 'WARM_SESSION_MATERIAL_CONSUME' | 'WARM_SESSION_VOLATILE_MATERIAL_CLEAR' | 'WARM_SESSION_VOLATILE_MATERIAL_CLEAR_ALL' | 'WARM_SESSION_SEAL_AND_PERSIST' | 'WARM_SESSION_REHYDRATE';
45
45
  export type WarmSessionSealTransportInput = (EmailOtpWarmSessionSealTransportCommon & {
46
46
  curve: 'ed25519';
47
47
  authMethod: 'email_otp';
@@ -102,6 +102,20 @@ export interface WarmSessionSealAndPersistPayload {
102
102
  thresholdSessionId: string;
103
103
  transport: WarmSessionSealTransportInput;
104
104
  }
105
+ export type PreparedWarmSessionServerSeal = {
106
+ readonly preparationId: string;
107
+ readonly ciphertext: string;
108
+ readonly keyVersion: string;
109
+ readonly expiresAtMs: number;
110
+ readonly remainingUses: number;
111
+ };
112
+ export type WarmSessionSealTransportState = {
113
+ readonly transport?: WarmSessionSealTransportInput;
114
+ readonly preparedServerSeal?: never;
115
+ } | {
116
+ readonly transport: WarmSessionSealTransportInput;
117
+ readonly preparedServerSeal: PreparedWarmSessionServerSeal;
118
+ };
105
119
  export interface WarmSessionRehydratePayload {
106
120
  thresholdSessionId: string;
107
121
  sealedSecretB64u: string;
@@ -767,6 +767,26 @@ class ClientSealPreparations {
767
767
  throw result.error;
768
768
  return result.seal;
769
769
  }
770
+ async readCiphertext(sessionId, preparationId) {
771
+ const entry = this.entries.get(sessionId);
772
+ if (!entry || entry.id !== preparationId) {
773
+ throw new Error("Client seal preparation is unavailable");
774
+ }
775
+ const result = await entry.result;
776
+ if (this.entries.get(sessionId) !== entry) {
777
+ throw new Error("Client seal preparation was discarded");
778
+ }
779
+ if (result.kind === "failed")
780
+ throw result.error;
781
+ return result.seal.ciphertext;
782
+ }
783
+ async takeExact(sessionId, preparationId, secret) {
784
+ const entry = this.entries.get(sessionId);
785
+ if (!entry || entry.id !== preparationId) {
786
+ throw new Error("Client seal preparation is unavailable");
787
+ }
788
+ return await this.take(sessionId, secret);
789
+ }
770
790
  async discard(sessionId, preparationId) {
771
791
  const entry = this.entries.get(sessionId);
772
792
  if (!entry || entry.id !== preparationId)
@@ -849,6 +869,21 @@ function parseClientSealDiscard(value) {
849
869
  const thresholdSessionId = parseSessionString(Reflect.get(value, "thresholdSessionId"));
850
870
  return preparationId && thresholdSessionId ? { preparationId, thresholdSessionId } : null;
851
871
  }
872
+ function parseClientSealCompletion(value) {
873
+ if (!value || typeof value !== "object" || Array.isArray(value))
874
+ return null;
875
+ const fields = Object.keys(value);
876
+ if (fields.length !== 4 || !fields.includes("preparationId") || !fields.includes("thresholdSessionId") || !fields.includes("transport") || !fields.includes("serverSeal")) {
877
+ return null;
878
+ }
879
+ const preparationId = parseSessionString(Reflect.get(value, "preparationId"));
880
+ const thresholdSessionId = parseSessionString(Reflect.get(value, "thresholdSessionId"));
881
+ const transport = parseSigningSessionSealTransport(Reflect.get(value, "transport"));
882
+ const serverSeal = parseSigningSessionSealRouteResult(Reflect.get(value, "serverSeal"));
883
+ if (!preparationId || !thresholdSessionId || !transport || !serverSeal.ok)
884
+ return null;
885
+ return { preparationId, thresholdSessionId, transport, serverSeal };
886
+ }
852
887
  function parseWarmSessionMaterialPutPayload(value) {
853
888
  if (value === null || typeof value !== "object" || Array.isArray(value))
854
889
  return null;
@@ -1013,6 +1048,10 @@ function parsePasskeyMpcSessionWorkerMessage(value) {
1013
1048
  return { kind: "prewarm", ...id ? { id } : {} };
1014
1049
  case "PREPARE_SESSION_CLIENT_SEAL":
1015
1050
  return { kind: "prepare_client_seal", id, payload: parseClientSealPreparation(payload) };
1051
+ case "READ_SESSION_CLIENT_SEAL":
1052
+ return { kind: "read_client_seal", id, payload: parseClientSealDiscard(payload) };
1053
+ case "COMPLETE_SESSION_CLIENT_SEAL":
1054
+ return { kind: "complete_client_seal", id, payload: parseClientSealCompletion(payload) };
1016
1055
  case "DISCARD_SESSION_CLIENT_SEAL":
1017
1056
  return { kind: "discard_client_seal", id, payload: parseClientSealDiscard(payload) };
1018
1057
  case "WARM_SESSION_MATERIAL_PUT":
@@ -1523,24 +1562,26 @@ async function runSigningSessionSealAndPersist(args) {
1523
1562
  const task = (async () => {
1524
1563
  const diagnostics = createWarmSessionSealAndPersistDiagnostics();
1525
1564
  try {
1526
- const prepared = await clientSealPreparations.take(thresholdSessionId, activeEntry.secret.prfFirstB64u);
1565
+ const prepared = args.kind === "prepared_response" ? await clientSealPreparations.takeExact(thresholdSessionId, args.preparationId, activeEntry.secret.prfFirstB64u) : await clientSealPreparations.take(thresholdSessionId, activeEntry.secret.prfFirstB64u);
1527
1566
  const { runtime, keyHandle, ciphertext: clientEncryptedCiphertext } = prepared;
1528
1567
  diagnostics.runtimeSetupMs = prepared.runtimeSetupMs;
1529
1568
  diagnostics.clientSealMs = prepared.clientSealMs;
1530
1569
  try {
1531
1570
  const serverSealRouteStartedAt = performance.now();
1532
- const applied = await callSigningSessionSealRoute({
1571
+ const applied = args.kind === "prepared_response" ? args.serverSeal : await callSigningSessionSealRoute({
1533
1572
  operation: "apply-server-seal",
1534
1573
  transport: args.transport,
1535
1574
  thresholdSessionId,
1536
1575
  ciphertext: clientEncryptedCiphertext,
1537
1576
  keyVersion: args.transport.keyVersion
1538
1577
  });
1539
- recordWarmSessionSealAndPersistDiagnosticDuration({
1540
- diagnostics,
1541
- bucket: "serverSealRouteMs",
1542
- startedAt: serverSealRouteStartedAt
1543
- });
1578
+ if (args.kind === "server_route") {
1579
+ recordWarmSessionSealAndPersistDiagnosticDuration({
1580
+ diagnostics,
1581
+ bucket: "serverSealRouteMs",
1582
+ startedAt: serverSealRouteStartedAt
1583
+ });
1584
+ }
1544
1585
  if (!applied.ok)
1545
1586
  return applied;
1546
1587
  const policyUpdateStartedAt = performance.now();
@@ -1740,6 +1781,40 @@ async function handleClientSealPreparation(incoming) {
1740
1781
  });
1741
1782
  }
1742
1783
  }
1784
+ async function handleClientSealRead(incoming) {
1785
+ try {
1786
+ if (!incoming.payload)
1787
+ throw new Error("Invalid client seal read request");
1788
+ const ciphertext = await clientSealPreparations.readCiphertext(incoming.payload.thresholdSessionId, incoming.payload.preparationId);
1789
+ postPasskeyMpcSessionWorkerResponse(incoming.id, {
1790
+ success: true,
1791
+ data: { ok: true, ciphertext }
1792
+ });
1793
+ } catch (error) {
1794
+ postPasskeyMpcSessionWorkerResponse(incoming.id, {
1795
+ success: false,
1796
+ error: error instanceof Error ? error.message : "Client seal read failed"
1797
+ });
1798
+ }
1799
+ }
1800
+ async function handleClientSealCompletion(incoming) {
1801
+ const payload = incoming.payload;
1802
+ if (!payload) {
1803
+ postPasskeyMpcSessionWorkerResponse(incoming.id, {
1804
+ success: false,
1805
+ error: "Invalid client seal completion request"
1806
+ });
1807
+ return;
1808
+ }
1809
+ const result = await runSigningSessionSealAndPersist({
1810
+ kind: "prepared_response",
1811
+ thresholdSessionId: payload.thresholdSessionId,
1812
+ preparationId: payload.preparationId,
1813
+ transport: payload.transport,
1814
+ serverSeal: payload.serverSeal
1815
+ });
1816
+ postPasskeyMpcSessionWorkerResponse(incoming.id, { success: true, data: result });
1817
+ }
1743
1818
  self.onmessage = (event) => {
1744
1819
  const incoming = parsePasskeyMpcSessionWorkerMessage(event.data);
1745
1820
  switch (incoming.kind) {
@@ -1747,6 +1822,12 @@ self.onmessage = (event) => {
1747
1822
  case "discard_client_seal":
1748
1823
  handleClientSealPreparation(incoming);
1749
1824
  return;
1825
+ case "read_client_seal":
1826
+ handleClientSealRead(incoming);
1827
+ return;
1828
+ case "complete_client_seal":
1829
+ handleClientSealCompletion(incoming);
1830
+ return;
1750
1831
  case "ping":
1751
1832
  postPasskeyMpcSessionWorkerResponse(incoming.id, { success: true, data: { ok: true } });
1752
1833
  return;
@@ -1877,7 +1958,10 @@ self.onmessage = (event) => {
1877
1958
  });
1878
1959
  return;
1879
1960
  }
1880
- const result = await runSigningSessionSealAndPersist(payload);
1961
+ const result = await runSigningSessionSealAndPersist({
1962
+ kind: "server_route",
1963
+ ...payload
1964
+ });
1881
1965
  postPasskeyMpcSessionWorkerResponse(incoming.id, { success: true, data: result });
1882
1966
  })();
1883
1967
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seams/wallet",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "type": "module",
5
5
  "description": "Seams web and runtime TypeScript SDK for NEAR and EVM-family wallets",
6
6
  "main": "./dist/esm/index.js",