@seams/wallet-server 0.8.0 → 0.9.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.
Files changed (369) hide show
  1. package/THIRD_PARTY_NOTICES.md +7 -1
  2. package/artifact-manifest.json +196 -41
  3. package/cloudflare-router-ab/build/deriver-a/build-stamp.json +1 -1
  4. package/cloudflare-router-ab/build/deriver-a/index.js +2 -2
  5. package/cloudflare-router-ab/build/deriver-a/index_bg.wasm +0 -0
  6. package/cloudflare-router-ab/build/deriver-b/build-stamp.json +1 -1
  7. package/cloudflare-router-ab/build/deriver-b/index.js +2 -2
  8. package/cloudflare-router-ab/build/deriver-b/index_bg.wasm +0 -0
  9. package/cloudflare-router-ab/build/local-tools/darwin-arm64/router_ab_local_init +0 -0
  10. package/cloudflare-router-ab/build/local-tools/darwin-x64/router_ab_local_init +0 -0
  11. package/cloudflare-router-ab/build/local-tools/linux-x64/router_ab_local_init +0 -0
  12. package/cloudflare-router-ab/build/router/build-stamp.json +1 -1
  13. package/cloudflare-router-ab/build/router/index.js +2 -2
  14. package/cloudflare-router-ab/build/router/index_bg.wasm +0 -0
  15. package/cloudflare-router-ab/build/signing-worker/build-stamp.json +1 -1
  16. package/cloudflare-router-ab/build/signing-worker/index.js +2 -2
  17. package/cloudflare-router-ab/build/signing-worker/index_bg.wasm +0 -0
  18. package/cloudflare-router-ab/build/tenant-root-control-plane/build-stamp.json +1 -1
  19. package/cloudflare-router-ab/build/tenant-root-control-plane/index.js +2 -2
  20. package/cloudflare-router-ab/build/tenant-root-control-plane/index_bg.wasm +0 -0
  21. package/cloudflare-router-ab/migrations/deriver-a/0019_wallet_object_addresses.sql +10 -0
  22. package/cloudflare-router-ab/migrations/deriver-b/0019_wallet_object_addresses.sql +10 -0
  23. package/cloudflare-router-ab/scripts/prepare-local-runtime-config.mjs +3 -117
  24. package/cloudflare-router-ab/wrangler.deriver-a.toml +0 -8
  25. package/cloudflare-router-ab/wrangler.deriver-b.toml +24 -8
  26. package/cloudflare-router-ab/wrangler.router.toml +0 -2
  27. package/cloudflare-router-ab/wrangler.signing-worker.toml +29 -0
  28. package/dist/esm/authorization/domain.js +3 -2
  29. package/dist/esm/authorization/ed25519WalletSessionAdmission.js +0 -0
  30. package/dist/esm/authorization/service.js +64 -36
  31. package/dist/esm/cloud-host.js +24 -19
  32. package/dist/esm/core/EmailOtpRecords.js +29 -6
  33. package/dist/esm/core/ThresholdService/routerAb/ecdsaDerivationPoolFillHandlers.js +2 -0
  34. package/dist/esm/core/ThresholdService/routerAb/ecdsaDerivationPresignBridge.js +10 -0
  35. package/dist/esm/core/ThresholdService/routerAb/internalServiceHttp.js +1 -0
  36. package/dist/esm/core/ThresholdService/validation.js +2 -2
  37. package/dist/esm/core/authService/nearPrivateKeySigning.js +1 -1
  38. package/dist/esm/core/authService/webauthn.js +1 -1
  39. package/dist/esm/core/d1Ed25519SignerRead.js +55 -0
  40. package/dist/esm/core/d1WalletStore.js +14 -11
  41. package/dist/esm/core/deviceLinking/linkedDeviceEmailOtpGrant.js +2 -2
  42. package/dist/esm/core/deviceLinking/linkedDeviceManagement.js +1 -1
  43. package/dist/esm/core/deviceLinking/linkedDeviceSessionRecord.js +2 -2
  44. package/dist/esm/core/emailOtpD1Statements.js +1 -0
  45. package/dist/esm/core/nearRelayerAccountProvisioning.js +1 -1
  46. package/dist/esm/core/routerAbSigning/RouterAbEcdsaPresignRuntime.js +4 -0
  47. package/dist/esm/core/signingLanes/WalletExecutionLaneProjection.js +1 -1
  48. package/dist/esm/core/signingMaterial/ordinaryInactiveSignerMaterialReservation.js +1 -0
  49. package/dist/esm/hosted-wallet-gateway.js +93 -10
  50. package/dist/esm/localHostedWalletGatewayHandler.js +12 -9
  51. package/dist/esm/localIntendedYaoSigningFault.js +2 -30
  52. package/dist/esm/localRegistrationSetupAuthority.js +8 -1
  53. package/dist/esm/router/auth/commonRouterUtils.js +17 -10
  54. package/dist/esm/router/auth/routerApiCredentialAuth.js +26 -7
  55. package/dist/esm/router/auth/walletRegistrationContext.js +49 -0
  56. package/dist/esm/router/auth/webAuthnCredentialCodecs.js +1 -1
  57. package/dist/esm/router/cloudflare/d1/auth/d1AuthorizationAssembly.js +4 -3
  58. package/dist/esm/router/cloudflare/d1/auth/d1AuthorizedOperationRouteService.js +2 -0
  59. package/dist/esm/router/cloudflare/d1/auth/d1EmailOtpRouteService.js +25 -0
  60. package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthConfig.js +14 -6
  61. package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthService.js +44 -40
  62. package/dist/esm/router/cloudflare/d1/auth/walletSessionCredentialReaders.js +17 -1
  63. package/dist/esm/router/cloudflare/d1/authorization/authorizedOperationStatements.js +35 -5
  64. package/dist/esm/router/cloudflare/d1/authorization/d1AuthorizationStore.js +258 -99
  65. package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.js +31 -4
  66. package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceOwnerAuthorizationProvider.js +1 -1
  67. package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceRequestProofNonceStore.js +1 -1
  68. package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceSessionRecords.js +1 -1
  69. package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetCredentialProvider.js +1 -1
  70. package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetPlanner.js +1 -1
  71. package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceVerifiedLinkBuilder.js +1 -1
  72. package/dist/esm/router/cloudflare/d1/ed25519Yao/d1Ed25519YaoLifecycleDecisionStore.js +11 -2
  73. package/dist/esm/router/cloudflare/d1/ed25519Yao/d1Ed25519YaoProductRegistrationPartitionedStateStore.js +100 -10
  74. package/dist/esm/router/cloudflare/d1/ed25519Yao/d1Ed25519YaoStateWriteFence.js +92 -0
  75. package/dist/esm/router/cloudflare/d1/ed25519Yao/d1WalletCeremonyActivity.js +77 -0
  76. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeIssuer.js +14 -8
  77. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeStore.js +14 -8
  78. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeVerifier.js +3 -1
  79. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRateLimitStore.js +58 -38
  80. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecords.js +27 -20
  81. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecoveryService.js +1 -0
  82. package/dist/esm/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpSessionResolver.js +1 -0
  83. package/dist/esm/router/cloudflare/d1/oidc/d1OidcBoundary.js +1 -1
  84. package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletCustodyCommitStore.js +18 -7
  85. package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore.js +75 -14
  86. package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyRecords.js +1 -1
  87. package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyStore.js +49 -29
  88. package/dist/esm/router/cloudflare/d1/registration/d1RegistrationSessionTransaction.js +28 -0
  89. package/dist/esm/router/cloudflare/d1/registration/d1RegistrationSetupSupport.js +11 -1
  90. package/dist/esm/router/cloudflare/d1/registration/d1WalletExecutionAuthority.js +168 -0
  91. package/dist/esm/router/cloudflare/d1/registration/d1WalletOperationStore.js +53 -0
  92. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationCommitStore.js +83 -42
  93. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationInitialSession.js +33 -0
  94. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationPreparation.js +16 -0
  95. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationRead.js +58 -0
  96. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationService.js +439 -500
  97. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationSetup.js +1 -1
  98. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationSetupExecution.js +104 -90
  99. package/dist/esm/router/cloudflare/d1/registration/walletRegistrationEstablishedSessionIssuer.js +78 -44
  100. package/dist/esm/router/cloudflare/d1/registration/walletRegistrationSessionCommitReceipt.js +11 -35
  101. package/dist/esm/router/cloudflare/d1/signingAdmission/d1RouterAbNormalSigningAdmissionStore.js +98 -39
  102. package/dist/esm/router/cloudflare/d1/versionedJson/d1VersionedJsonRecordStore.js +12 -9
  103. package/dist/esm/router/cloudflare/d1/wallet/authorizationSnapshotLayout.js +168 -0
  104. package/dist/esm/router/cloudflare/d1/wallet/d1WalletAddSignerFinalizeRecord.js +1 -1
  105. package/dist/esm/router/cloudflare/d1/wallet/d1WalletAddSignerService.js +15 -6
  106. package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthMethodService.js +3 -40
  107. package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthorityStore.js +54 -1
  108. package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthorizationCleanup.js +157 -0
  109. package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthorizationFreeze.js +56 -0
  110. package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthorizationHistory.js +238 -0
  111. package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthorizationIntake.js +287 -0
  112. package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthorizationSnapshot.js +295 -0
  113. package/dist/esm/router/cloudflare/d1/wallet/d1WalletRelocationApprovals.js +140 -0
  114. package/dist/esm/router/cloudflare/d1/wallet/d1WalletRelocationChallenges.js +170 -0
  115. package/dist/esm/router/cloudflare/d1/wallet/d1WalletRelocationEmailOtp.js +60 -0
  116. package/dist/esm/router/cloudflare/d1/wallet/d1WalletRelocationOwner.js +33 -0
  117. package/dist/esm/router/cloudflare/d1/wallet/d1WalletRelocationOwnerRequest.js +74 -0
  118. package/dist/esm/router/cloudflare/d1/wallet/d1WalletRelocationPasskey.js +77 -0
  119. package/dist/esm/router/cloudflare/d1/wallet/d1WalletRelocationReadAccess.js +37 -0
  120. package/dist/esm/router/cloudflare/d1/wallet/d1WalletRelocationSessions.js +97 -0
  121. package/dist/esm/router/cloudflare/d1/wallet/d1WalletRelocationWriteBlock.js +133 -0
  122. package/dist/esm/router/cloudflare/d1/walletObjectAddresses.js +47 -0
  123. package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnAuthService.js +1 -1
  124. package/dist/esm/router/cloudflare/runtime/routerAbServiceBindings.js +32 -1
  125. package/dist/esm/router/cloudflare/runtime/staticWalletConsoleBinding.js +20 -8
  126. package/dist/esm/router/cloudflare/runtime/walletAuthorizationRelocationRoutes.js +488 -0
  127. package/dist/esm/router/cloudflare/runtime/walletConsoleOps.js +1 -1
  128. package/dist/esm/router/cloudflare/runtime/walletConsoleOpsClient.js +26 -6
  129. package/dist/esm/router/cloudflare/runtime/walletControlOps.js +3 -0
  130. package/dist/esm/router/cloudflare/runtime/walletGateway.js +1 -1
  131. package/dist/esm/router/cloudflare/runtime/walletObjectAddresses.js +105 -0
  132. package/dist/esm/router/cloudflare/runtime/walletPlacementRoutes.js +339 -0
  133. package/dist/esm/router/cloudflare/runtime/walletRelocationDeriver.js +244 -0
  134. package/dist/esm/router/cloudflare/runtime/walletRelocationEcdsa.js +212 -0
  135. package/dist/esm/router/cloudflare/runtime/walletRelocationEd25519.js +172 -0
  136. package/dist/esm/router/cloudflare/runtime/walletRelocationOps.js +183 -0
  137. package/dist/esm/router/cloudflare/runtime/walletRelocationPresign.js +185 -0
  138. package/dist/esm/router/cloudflare/runtime/walletRelocationSource.js +221 -0
  139. package/dist/esm/router/cloudflare/signingLanes/cloudflareOrdinaryInactiveSignerMaterialReservation.js +30 -8
  140. package/dist/esm/router/cloudflare-adaptor.js +8 -8
  141. package/dist/esm/router/cloudflare.js +34115 -32240
  142. package/dist/esm/router/domains/ecdsa/routerAbEcdsaStrictRegistration.js +35 -9
  143. package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoCapabilityCommit.js +42 -0
  144. package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistration.js +32 -6
  145. package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistrationPartitionedStateStore.js +61 -1
  146. package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistrationPersistence.js +70 -3
  147. package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistrationRequestScopedRuntime.js +59 -87
  148. package/dist/esm/router/domains/ed25519Yao/export/routerAbEd25519YaoExport.js +52 -22
  149. package/dist/esm/router/domains/ed25519Yao/export/routerAbEd25519YaoExportRequestScopedCloudflare.js +10 -7
  150. package/dist/esm/router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecovery.js +108 -78
  151. package/dist/esm/router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecoveryRequestScopedCloudflare.js +19 -5
  152. package/dist/esm/router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecoveryWalletSessionAuthorization.js +71 -22
  153. package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoHttpRegistrationBackend.js +37 -25
  154. package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistration.js +3 -3
  155. package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationExecutionRecord.js +2 -1
  156. package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationIntentAuthorization.js +24 -3
  157. package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationRequestScopedCloudflare.js +4 -3
  158. package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationSideEffectBoundary.js +20 -7
  159. package/dist/esm/router/domains/ed25519Yao/routerAbEd25519YaoGatewayEnvelope.js +7 -1
  160. package/dist/esm/router/domains/emailOtp/emailOtpRouteHandlers.js +2 -2
  161. package/dist/esm/router/domains/passkeyCustody/passkeyCustodyEnvelopeRetrieval.js +1 -1
  162. package/dist/esm/router/domains/passkeyCustody/registrationCustodyOutcome.js +34 -18
  163. package/dist/esm/router/domains/passkeyCustody/walletCustodyRegistrationAdmission.js +2 -2
  164. package/dist/esm/router/domains/passkeyCustody/walletCustodyRegistrationCommit.js +16 -6
  165. package/dist/esm/router/domains/signingOperations/authorizedOperationWire.js +73 -0
  166. package/dist/esm/router/domains/signingOperations/ecdsaSigningResponse.js +31 -0
  167. package/dist/esm/router/domains/signingOperations/ed25519AuthorizedOperationReceipt.js +1 -1
  168. package/dist/esm/router/domains/signingOperations/routerAbEcdsaDerivationNormalSigningRoute.js +2 -1
  169. package/dist/esm/router/domains/signingOperations/routerAbEd25519NormalSigningRoute.js +31 -121
  170. package/dist/esm/router/domains/signingOperations/routerAbNormalSigningAdmission.js +2 -93
  171. package/dist/esm/router/domains/signingOperations/routerAbPrivateSigningWorker.js +1 -1
  172. package/dist/esm/router/domains/signingOperations/signingPrepareSession.js +33 -0
  173. package/dist/esm/router/domains/walletRegistration/registrationSessionSeal.js +121 -0
  174. package/dist/esm/router/domains/walletRegistration/walletRegistrationReservation.js +4 -4
  175. package/dist/esm/router/domains/walletRegistration/walletRegistrationRoutes.js +46 -157
  176. package/dist/esm/router/domains/walletRegistration/walletRegistrationSetupPayload.js +1 -1
  177. package/dist/esm/router/express.js +764 -894
  178. package/dist/esm/router/framework/http.js +2 -1
  179. package/dist/esm/router/transport/fetch/createFetchRouter.js +2 -2
  180. package/dist/esm/router/transport/fetch/routes/auth.js +1 -1
  181. package/dist/esm/router/transport/fetch/routes/deviceLinking.js +3 -3
  182. package/dist/esm/router/transport/fetch/routes/deviceLinkingOwnerAuthorization.js +2 -2
  183. package/dist/esm/router/transport/fetch/routes/ed25519AuthorizedOperationRevalidation.js +65 -0
  184. package/dist/esm/router/transport/fetch/routes/normalSigningRouterProxy.js +13 -3
  185. package/dist/esm/router/transport/fetch/routes/passkeyCustody.js +3 -3
  186. package/dist/esm/router/transport/fetch/routes/sessions.js +3 -2
  187. package/dist/esm/router/transport/fetch/routes/thresholdEcdsa.js +67 -130
  188. package/dist/esm/router/transport/fetch/routes/thresholdEd25519.js +76 -212
  189. package/dist/esm/router/transport/fetch/routes/walletExecutionLanePreflight.js +18 -41
  190. package/dist/esm/router/transport/fetch/routes/walletRegistration.js +6 -5
  191. package/dist/esm/router/transport/fetch/routes/webauthnAuthenticators.js +1 -1
  192. package/dist/esm/shared-ts/src/authorization/index.js +1 -1
  193. package/dist/esm/shared-ts/src/authorization/walletAuthority.js +2 -2
  194. package/dist/esm/shared-ts/src/device-linking/activeWalletSession.js +12 -2
  195. package/dist/esm/shared-ts/src/device-linking/digests.js +1 -1
  196. package/dist/esm/shared-ts/src/device-linking/ed25519ExportRoot.js +1 -1
  197. package/dist/esm/shared-ts/src/device-linking/index.js +1 -1
  198. package/dist/esm/shared-ts/src/device-linking/parsers.js +1 -1
  199. package/dist/esm/shared-ts/src/device-linking/sourceContribution.js +1 -1
  200. package/dist/esm/shared-ts/src/device-linking/wireFields.js +1 -1
  201. package/dist/esm/shared-ts/src/near/nearClient.js +1 -1
  202. package/dist/esm/shared-ts/src/signing-lanes/ownerContinuity.js +2 -2
  203. package/dist/esm/shared-ts/src/utils/ecdsaServerTiming.js +6 -1
  204. package/dist/esm/shared-ts/src/utils/emailOtpDomain.js +4 -2
  205. package/dist/esm/shared-ts/src/utils/routerAbEcdsaDerivation.js +1 -1
  206. package/dist/esm/shared-ts/src/utils/routerAbPublicKeyset.js +0 -27
  207. package/dist/esm/shared-ts/src/wallet-recovery/walletRecoveryEcdsaPossession.js +1 -1
  208. package/dist/esm/threshold/session/signingSessionSeal/options.js +1 -1
  209. package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
  210. package/dist/types/shared-ts/src/device-linking/activeWalletSession.d.ts +2 -1
  211. package/dist/types/shared-ts/src/device-linking/contracts.d.ts +10 -0
  212. package/dist/types/shared-ts/src/threshold/ed25519OperationFingerprint.d.ts +2 -1
  213. package/dist/types/shared-ts/src/utils/emailOtpDomain.d.ts +3 -1
  214. package/dist/types/shared-ts/src/utils/routerAbPublicKeyset.d.ts +0 -9
  215. package/dist/types/shared-ts/src/utils/walletManagementProtocol.d.ts +1 -1
  216. package/dist/types/wallet-server/src/authorization/domain.d.ts +17 -1
  217. package/dist/types/wallet-server/src/authorization/ecdsaWalletSessionAdmission.d.ts +1 -0
  218. package/dist/types/wallet-server/src/authorization/ed25519WalletSessionAdmission.d.ts +35 -0
  219. package/dist/types/wallet-server/src/authorization/ed25519WalletSessionAdmission.typecheck.d.ts +2 -0
  220. package/dist/types/wallet-server/src/authorization/service.d.ts +43 -5
  221. package/dist/types/wallet-server/src/authorization/sessionRouting.d.ts +2 -0
  222. package/dist/types/wallet-server/src/cloud-host.d.ts +7 -3
  223. package/dist/types/wallet-server/src/core/EmailOtpRecords.d.ts +2 -1
  224. package/dist/types/wallet-server/src/core/EmailOtpStores.d.ts +19 -5
  225. package/dist/types/wallet-server/src/core/ThresholdService/routerAb/ecdsaDerivationPoolFillHandlers.d.ts +1 -0
  226. package/dist/types/wallet-server/src/core/ThresholdService/routerAb/ecdsaDerivationPresignBridge.d.ts +6 -0
  227. package/dist/types/wallet-server/src/core/ThresholdService/routerAb/internalServiceHttp.d.ts +1 -0
  228. package/dist/types/wallet-server/src/core/d1Ed25519SignerRead.d.ts +17 -0
  229. package/dist/types/wallet-server/src/core/d1WalletStore.d.ts +6 -0
  230. package/dist/types/wallet-server/src/core/emailOtpD1Statements.d.ts +1 -0
  231. package/dist/types/wallet-server/src/core/routerAbSigning/RouterAbEcdsaPresignRuntime.d.ts +5 -1
  232. package/dist/types/wallet-server/src/core/signingMaterial/ordinaryInactiveSignerMaterialReservation.d.ts +1 -0
  233. package/dist/types/wallet-server/src/core/threeRouteRegistrationContracts.d.ts +14 -48
  234. package/dist/types/wallet-server/src/hosted-wallet-gateway.d.ts +4 -3
  235. package/dist/types/wallet-server/src/localIntendedYaoSigningFault.d.ts +1 -16
  236. package/dist/types/wallet-server/src/localRegistrationSetupAuthority.d.ts +1 -1
  237. package/dist/types/wallet-server/src/router/auth/commonRouterUtils.d.ts +7 -1
  238. package/dist/types/wallet-server/src/router/auth/routerApiCredentialAuth.d.ts +11 -3
  239. package/dist/types/wallet-server/src/router/auth/walletRegistrationContext.d.ts +8 -0
  240. package/dist/types/wallet-server/src/router/cloudflare/d1/auth/d1AuthorizationAssembly.d.ts +1 -1
  241. package/dist/types/wallet-server/src/router/cloudflare/d1/auth/d1EmailOtpRouteService.d.ts +16 -0
  242. package/dist/types/wallet-server/src/router/cloudflare/d1/auth/d1RouterApiAuthConfig.d.ts +7 -4
  243. package/dist/types/wallet-server/src/router/cloudflare/d1/auth/d1RouterApiAuthService.d.ts +4 -1
  244. package/dist/types/wallet-server/src/router/cloudflare/d1/auth/walletSessionCredentialReaders.d.ts +7 -1
  245. package/dist/types/wallet-server/src/router/cloudflare/d1/authorization/d1AuthorizationStore.d.ts +32 -1
  246. package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.d.ts +2 -0
  247. package/dist/types/wallet-server/src/router/cloudflare/d1/ed25519Yao/d1Ed25519YaoLifecycleDecisionStore.d.ts +3 -1
  248. package/dist/types/wallet-server/src/router/cloudflare/d1/ed25519Yao/d1Ed25519YaoProductRegistrationPartitionedStateStore.d.ts +1 -0
  249. package/dist/types/wallet-server/src/router/cloudflare/d1/ed25519Yao/d1Ed25519YaoStateWriteFence.d.ts +8 -0
  250. package/dist/types/wallet-server/src/router/cloudflare/d1/ed25519Yao/d1WalletCeremonyActivity.d.ts +15 -0
  251. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeIssuer.d.ts +6 -1
  252. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeStore.d.ts +1 -0
  253. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeVerifier.d.ts +4 -1
  254. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpCounters.typecheck.d.ts +2 -0
  255. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpRateLimitStore.d.ts +6 -29
  256. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpRecords.d.ts +21 -7
  257. package/dist/types/wallet-server/src/router/cloudflare/d1/passkeyCustody/d1WalletCustodyCommitStore.d.ts +17 -1
  258. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore.d.ts +32 -7
  259. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationCeremonyStore.d.ts +16 -7
  260. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationSessionTransaction.d.ts +13 -0
  261. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationSetupSupport.d.ts +7 -0
  262. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletExecutionAuthority.d.ts +41 -0
  263. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletOperationStore.d.ts +28 -0
  264. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationCommitStore.d.ts +6 -9
  265. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationInitialSession.d.ts +17 -0
  266. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationPreparation.d.ts +12 -0
  267. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationRead.d.ts +43 -0
  268. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationService.d.ts +24 -45
  269. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationSetupExecution.d.ts +9 -4
  270. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/walletRegistrationEstablishedSessionIssuer.d.ts +42 -14
  271. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/walletRegistrationSessionCommitReceipt.d.ts +5 -4
  272. package/dist/types/wallet-server/src/router/cloudflare/d1/signingAdmission/d1RouterAbNormalSigningAdmissionStore.d.ts +24 -1
  273. package/dist/types/wallet-server/src/router/cloudflare/d1/versionedJson/d1VersionedJsonRecordStore.d.ts +10 -4
  274. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/authorizationSnapshotLayout.d.ts +21 -0
  275. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletAddSignerService.d.ts +3 -0
  276. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletAuthMethodService.d.ts +3 -7
  277. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletAuthorityStore.d.ts +8 -0
  278. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletAuthorizationCleanup.d.ts +20 -0
  279. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletAuthorizationFreeze.d.ts +12 -0
  280. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletAuthorizationHistory.d.ts +20 -0
  281. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletAuthorizationIntake.d.ts +29 -0
  282. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletAuthorizationSnapshot.d.ts +31 -0
  283. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletRelocationApprovals.d.ts +49 -0
  284. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletRelocationChallenges.d.ts +47 -0
  285. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletRelocationEmailOtp.d.ts +25 -0
  286. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletRelocationOwner.d.ts +88 -0
  287. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletRelocationOwnerRequest.d.ts +37 -0
  288. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletRelocationPasskey.d.ts +12 -0
  289. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletRelocationReadAccess.d.ts +18 -0
  290. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletRelocationSessions.d.ts +23 -0
  291. package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletRelocationWriteBlock.d.ts +16 -0
  292. package/dist/types/wallet-server/src/router/cloudflare/d1/walletObjectAddresses.d.ts +14 -0
  293. package/dist/types/wallet-server/src/router/cloudflare/runtime/routerAbServiceBindings.d.ts +13 -0
  294. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletAuthorizationRelocationRoutes.d.ts +21 -0
  295. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletConsoleOps.d.ts +1 -1
  296. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletConsoleOpsClient.d.ts +3 -3
  297. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletControlOps.d.ts +2 -1
  298. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletGateway.d.ts +3 -1
  299. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletObjectAddresses.d.ts +45 -0
  300. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletPlacementRoutes.d.ts +30 -0
  301. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletRelocationDeriver.d.ts +11 -0
  302. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletRelocationEcdsa.d.ts +7 -0
  303. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletRelocationEd25519.d.ts +7 -0
  304. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletRelocationOps.d.ts +11 -0
  305. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletRelocationPresign.d.ts +7 -0
  306. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletRelocationSource.d.ts +26 -0
  307. package/dist/types/wallet-server/src/router/cloudflare/signingLanes/cloudflareOrdinaryInactiveSignerMaterialReservation.d.ts +5 -0
  308. package/dist/types/wallet-server/src/router/domains/ecdsa/routerAbEcdsaStrictRegistration.d.ts +3 -0
  309. package/dist/types/wallet-server/src/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoCapabilityCommit.d.ts +7 -0
  310. package/dist/types/wallet-server/src/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistration.d.ts +41 -7
  311. package/dist/types/wallet-server/src/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistrationPartitionedStateStore.d.ts +33 -2
  312. package/dist/types/wallet-server/src/router/domains/ed25519Yao/export/routerAbEd25519YaoExport.d.ts +12 -6
  313. package/dist/types/wallet-server/src/router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecovery.d.ts +17 -9
  314. package/dist/types/wallet-server/src/router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecoveryWalletSessionAuthorization.d.ts +2 -0
  315. package/dist/types/wallet-server/src/router/domains/ed25519Yao/registration/routerAbEd25519YaoHttpRegistrationBackend.d.ts +13 -14
  316. package/dist/types/wallet-server/src/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistration.d.ts +7 -3
  317. package/dist/types/wallet-server/src/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationExecutionRecord.d.ts +1 -0
  318. package/dist/types/wallet-server/src/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationIntentAuthorization.d.ts +6 -1
  319. package/dist/types/wallet-server/src/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationSideEffectBoundary.d.ts +11 -0
  320. package/dist/types/wallet-server/src/router/domains/ed25519Yao/routerAbEd25519YaoGatewayEnvelope.d.ts +12 -3
  321. package/dist/types/wallet-server/src/router/domains/passkeyCustody/registrationCustodyOutcome.d.ts +10 -6
  322. package/dist/types/wallet-server/src/router/domains/passkeyCustody/walletCustodyRegistrationAdmission.d.ts +10 -3
  323. package/dist/types/wallet-server/src/router/domains/passkeyCustody/walletCustodyRegistrationCommit.d.ts +12 -5
  324. package/dist/types/wallet-server/src/router/domains/signingOperations/authorizedOperationWire.d.ts +97 -0
  325. package/dist/types/wallet-server/src/router/domains/signingOperations/ecdsaSigningResponse.d.ts +13 -0
  326. package/dist/types/wallet-server/src/router/domains/signingOperations/routerAbNormalSigningAdmission.d.ts +9 -206
  327. package/dist/types/wallet-server/src/router/domains/signingOperations/signingPrepareSession.d.ts +23 -0
  328. package/dist/types/wallet-server/src/router/domains/walletRegistration/registrationSessionSeal.d.ts +36 -0
  329. package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationInputs.d.ts +7 -7
  330. package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationReservation.d.ts +80 -6
  331. package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationRoutes.d.ts +15 -5
  332. package/dist/types/wallet-server/src/router/framework/apiCredentialPorts.d.ts +24 -0
  333. package/dist/types/wallet-server/src/router/framework/authServicePort.d.ts +21 -7
  334. package/dist/types/wallet-server/src/router/framework/routerApi.d.ts +3 -12
  335. package/dist/types/wallet-server/src/router/transport/fetch/routes/ed25519AuthorizedOperationRevalidation.d.ts +37 -0
  336. package/dist/types/wallet-server/src/router/transport/fetch/routes/thresholdEcdsa.d.ts +1 -17
  337. package/dist/types/wallet-server/src/storage/tenantRoute.d.ts +1 -1
  338. package/migrations/d1-signer/0049_wallet_relocation_challenges.sql +16 -0
  339. package/migrations/d1-signer/0050_wallet_relocation_approvals.sql +14 -0
  340. package/migrations/d1-signer/0051_wallet_relocation_email_otp.sql +92 -0
  341. package/migrations/d1-signer/0052_wallet_relocation_session_fences.sql +91 -0
  342. package/migrations/d1-signer/0053_wallet_hosted_history_import.sql +164 -0
  343. package/migrations/d1-signer/0054_wallet_authorization_freeze.sql +318 -0
  344. package/migrations/d1-signer/0055_wallet_authorization_snapshot.sql +120 -0
  345. package/migrations/d1-signer/0056_wallet_authorization_history_import.sql +424 -0
  346. package/migrations/d1-signer/0057_wallet_authorization_intake.sql +44 -0
  347. package/migrations/d1-signer/0058_wallet_ceremony_activity.sql +59 -0
  348. package/migrations/d1-signer/0059_wallet_authorization_activation.sql +45 -0
  349. package/migrations/d1-signer/0060_wallet_authorization_cleanup.sql +153 -0
  350. package/migrations/d1-signer/0061_wallet_session_operation_settlement.sql +28 -0
  351. package/migrations/d1-signer/0062_wallet_step_up_operation_settlement.sql +204 -0
  352. package/migrations/d1-signer/0063_wallet_operation_history_transfer.sql +466 -0
  353. package/migrations/d1-signer/0064_wallet_execution_generations.sql +93 -0
  354. package/migrations/d1-signer/0065_wallet_operation_execution_generation.sql +37 -0
  355. package/migrations/d1-signer/0066_regional_deployment_admission.sql +59 -0
  356. package/migrations/d1-signer/0067_registration_completion_decision.sql +12 -0
  357. package/migrations/d1-signer/0068_registration_cancellation_write_fence.sql +24 -0
  358. package/migrations/d1-signer/0069_cancelled_registration_session_fence.sql +11 -0
  359. package/migrations/d1-signer/0070_wallet_passkey_relocation.sql +369 -0
  360. package/migrations/d1-signer/0071_regional_wallet_otp_counters.sql +98 -0
  361. package/migrations/d1-signer/0072_linked_device_relocation_history.sql +899 -0
  362. package/migrations/d1-signer/0073_wallet_recovery_relocation.sql +86 -0
  363. package/migrations/d1-signer/0074_email_otp_relocation.sql +158 -0
  364. package/migrations/d1-signer/0075_wallet_authorization_return.sql +107 -0
  365. package/migrations/d1-signer/0076_wallet_relocation_write_block.sql +406 -0
  366. package/migrations/d1-signer/0077_wallet_object_addresses.sql +24 -0
  367. package/package.json +1 -1
  368. package/src/README.md +23 -1
  369. package/cloudflare-router-ab/scripts/local-key-material.mjs +0 -29
@@ -1,9 +1,9 @@
1
1
  import { normalizeOptionalTrimmedString } from "../../../../shared-ts/src/utils/normalize.js";
2
2
  import { normalizeRegistrationAuthMethodInput } from "../../../../shared-ts/src/utils/registrationAuthMethodInput.js";
3
3
  import { thresholdEcdsaChainTargetFromValue } from "../../../../core/thresholdEcdsaChainTarget.js";
4
- import { computeWalletRegistrationSetupDigestB64u, mintSignedWalletRegistrationSetup } from "../../../domains/walletRegistration/walletRegistrationSetupPayload.js";
5
4
  import { normalizeRegistrationSignerPlan, registrationSignerSetSelectionFromPlan } from "../../../../shared-ts/src/utils/registrationSignerPlan.js";
6
5
  import { computeRegistrationIntentDigestB64u } from "../../../../shared-ts/src/utils/registrationIntent.js";
6
+ import { computeWalletRegistrationSetupDigestB64u, mintSignedWalletRegistrationSetup } from "../../../domains/walletRegistration/walletRegistrationSetupPayload.js";
7
7
  //#region src/router/cloudflare/d1/registration/d1WalletRegistrationSetup.ts
8
8
  /**
9
9
  * `/wallets/register/setup` — one request replacing the bootstrap grant, the
@@ -20,101 +20,114 @@ async function executeD1WalletRegistrationSetup(input, dependencies) {
20
20
  if (input.request.wallet?.kind === "provided" && input.request.wallet.walletId !== wallet.walletId) return walletRegistrationSetupError("reservation_conflict", "Registration reservation changed the requested wallet");
21
21
  const expiresAtMs = walletRegistrationSetupExpiresAtMs(reservation.reservedAtMs);
22
22
  if (Date.now() >= expiresAtMs) return walletRegistrationSetupError("registration_expired", "Registration setup has expired");
23
- const registrationCeremonyId = reservation.ceremonyId;
24
- const registrationPreparationId = reservation.preparationId;
25
- const runtimePolicyScope = input.runtimePolicyScope || inferRuntimePolicyScopeFromSigningRoot({
26
- orgId: input.orgId,
27
- signingRootId: input.signingRootId,
28
- signingRootVersion: input.signingRootVersion
29
- });
30
- const signingRootId = normalizeOptionalTrimmedString(input.signingRootId) || (runtimePolicyScope ? deriveSigningRootId(runtimePolicyScope) : "");
31
- const signingRootVersion = normalizeOptionalTrimmedString(input.signingRootVersion) || runtimePolicyScope?.signingRootVersion || "default";
32
- if (!signingRootId) return walletRegistrationSetupError("invalid_body", "registration requires a signing root");
33
- const registrationOperation = reservation;
34
- const intent = buildRegistrationIntent({
35
- nonceB64u: registrationCeremonyId.slice(4),
23
+ const [startup, setup] = await Promise.allSettled([dependencies.startRegistrationWallets?.({
36
24
  walletId: wallet.walletId,
37
- authMethod: normalized.authMethod,
38
- signerSelection: normalized.signerSelection,
39
- foundingWalletAuthMethodId: registrationOperation.walletAuthMethodId,
40
- ...runtimePolicyScope ? { runtimePolicyScope } : {}
41
- });
42
- const digestB64u = await walletRegistrationSetupIntentDigest(intent);
43
- const existing = await dependencies.store.getSetupCeremony(registrationCeremonyId);
44
- if (existing) {
45
- if (existing.digestB64u !== digestB64u || existing.expectedOrigin !== input.expectedOrigin || existing.foundingWalletAuthorityId !== reservation.walletAuthorityId || existing.foundingDeviceId !== reservation.deviceId || existing.foundingWalletAuthMethodId !== reservation.walletAuthMethodId || existing.expiresAtMs !== expiresAtMs) return walletRegistrationSetupError("reservation_conflict", "Registration setup conflicts with its reservation");
46
- if (admitted.lifecycle === "reserved") await dependencies.store.ensureSetupCeremony(existing);
47
- return await setupResponseFromCeremony(input, existing);
48
- }
49
- if (admitted.lifecycle === "established") return walletRegistrationSetupError("registration_closed", "Completed registration setup snapshot is unavailable");
50
- const branches = registrationIntentSignerBranches(intent);
51
- if (!branches.ok) return walletRegistrationSetupError(branches.code, branches.message);
52
- const ecdsaBranch = branches.value.evmFamilyEcdsa;
53
- const nearEd25519Branch = branches.value.nearEd25519;
54
- if (!ecdsaBranch && !nearEd25519Branch) return walletRegistrationSetupError("invalid_body", "registration signer branch is required");
55
- const preparedContext = resolveRegistrationPreparedContextFromPlan({
56
- signerPlan: branches.value.plan,
57
- runtimePolicyScope,
58
- signingRootId,
59
- signingRootVersion
60
- });
61
- if (!preparedContext.ok) return walletRegistrationSetupError(preparedContext.code, preparedContext.message);
62
- if (ecdsaBranch && !runtimePolicyScope) return walletRegistrationSetupError("invalid_body", "ECDSA registration requires an exact runtime policy scope");
63
- const chainTargets = ecdsaBranch ? registrationPreparedContextEcdsaChainTargets(preparedContext.preparedContext) : null;
64
- if (ecdsaBranch && !chainTargets) return walletRegistrationSetupError("invalid_body", "ECDSA chain targets are required");
65
- const ecdsaPrepared = ecdsaBranch && chainTargets && runtimePolicyScope ? await buildD1EvmFamilyEcdsaRegistrationPrepare({
66
- registrationPurpose: "wallet_registration",
67
- registrationCeremonyId,
68
- registrationPreparationId: registrationPreparationIdFromString(registrationPreparationId),
69
- walletId: wallet.walletId,
70
- signingRootId,
71
- signingRootVersion,
72
- chainTargets,
73
- participantIds: [...ecdsaBranch.participantIds],
74
- strictRegistration: dependencies.ecdsaStrictRegistration,
75
- runtimePolicyScope
76
- }) : null;
77
- if (ecdsaPrepared && !ecdsaPrepared.ok) return walletRegistrationSetupError(ecdsaPrepared.code, ecdsaPrepared.message);
78
- const storedBranches = [];
79
- if (ecdsaPrepared?.ok && ecdsaBranch) storedBranches.push(buildStoredWalletRegistrationEvmFamilyEcdsaPreparedBranch({
80
- branchKey: ecdsaBranch.branchKey,
81
- ecdsa: {
82
- kind: ecdsaPrepared.ecdsa.kind,
83
- chainTargets: ecdsaPrepared.ecdsa.chainTargets,
84
- prepare: ecdsaPrepared.ecdsa.prepare,
85
- strictRegistration: ecdsaPrepared.ecdsa.strictRegistration,
86
- strictRegistrationBindingJson: routerAbEcdsaStrictRegistrationFactsBindingJson(ecdsaPrepared.ecdsa.strictRegistration)
87
- }
88
- }));
89
- const ceremony = {
90
- registrationCeremonyId,
91
- foundingWalletAuthorityId: registrationOperation.walletAuthorityId,
92
- foundingDeviceId: registrationOperation.deviceId,
93
- foundingWalletAuthMethodId: registrationOperation.walletAuthMethodId,
94
- intent,
95
- digestB64u,
96
- signerPlan: branches.value.plan,
97
- preparedContext: preparedContext.preparedContext,
98
- orgId: normalizeOptionalTrimmedString(input.orgId) || "",
99
- signingRootId,
100
- signingRootVersion,
101
- ...input.expectedOrigin ? { expectedOrigin: input.expectedOrigin } : {},
102
- expiresAtMs,
103
- authorityState: {
104
- kind: "awaiting_proof",
105
- authMethod: normalized.authMethod
106
- },
107
- signerState: {
108
- kind: "signer_set_registration",
109
- branches: storedBranches
110
- }
111
- };
112
- return await setupResponseFromCeremony(input, await dependencies.store.reserveSetupCeremony(ceremony));
25
+ ownershipGeneration: admitted.ownershipGeneration
26
+ }), completeReservedRegistrationSetup(input, dependencies, admitted, normalized, expiresAtMs)]);
27
+ if (setup.status === "rejected") throw setup.reason;
28
+ if (!setup.value.ok) return setup.value;
29
+ if (startup.status === "rejected") throw startup.reason;
30
+ return setup.value;
113
31
  } catch (error) {
114
32
  return walletRegistrationSetupError("internal", errorMessage(error) || "Failed to set up wallet registration");
115
33
  }
116
34
  }
117
- async function setupResponseFromCeremony(input, ceremony) {
35
+ async function completeReservedRegistrationSetup(input, dependencies, admitted, normalized, expiresAtMs) {
36
+ const reservation = admitted.reservation;
37
+ const wallet = { walletId: reservation.walletId };
38
+ const registrationCeremonyId = reservation.ceremonyId;
39
+ const registrationPreparationId = reservation.preparationId;
40
+ const runtimePolicyScope = input.runtimePolicyScope || inferRuntimePolicyScopeFromSigningRoot({
41
+ orgId: input.orgId,
42
+ signingRootId: input.signingRootId,
43
+ signingRootVersion: input.signingRootVersion
44
+ });
45
+ const signingRootId = normalizeOptionalTrimmedString(input.signingRootId) || (runtimePolicyScope ? deriveSigningRootId(runtimePolicyScope) : "");
46
+ const signingRootVersion = normalizeOptionalTrimmedString(input.signingRootVersion) || runtimePolicyScope?.signingRootVersion || "default";
47
+ if (!signingRootId) return walletRegistrationSetupError("invalid_body", "registration requires a signing root");
48
+ const registrationOperation = reservation;
49
+ const intent = buildRegistrationIntent({
50
+ nonceB64u: registrationCeremonyId.slice(4),
51
+ walletId: wallet.walletId,
52
+ authMethod: normalized.authMethod,
53
+ signerSelection: normalized.signerSelection,
54
+ foundingWalletAuthMethodId: registrationOperation.walletAuthMethodId,
55
+ ...runtimePolicyScope ? { runtimePolicyScope } : {}
56
+ });
57
+ const digestB64u = await walletRegistrationSetupIntentDigest(intent);
58
+ const branches = registrationIntentSignerBranches(intent);
59
+ if (!branches.ok) return walletRegistrationSetupError(branches.code, branches.message);
60
+ const existing = admitted.lifecycle === "established" || branches.value.evmFamilyEcdsa ? await dependencies.store.getSetupCeremony(registrationCeremonyId) : null;
61
+ if (existing) {
62
+ if (existing.digestB64u !== digestB64u || existing.expectedOrigin !== input.expectedOrigin || existing.foundingWalletAuthorityId !== reservation.walletAuthorityId || existing.foundingDeviceId !== reservation.deviceId || existing.foundingWalletAuthMethodId !== reservation.walletAuthMethodId || existing.expiresAtMs !== expiresAtMs) return walletRegistrationSetupError("reservation_conflict", "Registration setup conflicts with its reservation");
63
+ if (admitted.lifecycle === "reserved") await dependencies.store.reserveSetupCeremony(existing, admitted.ownershipGeneration);
64
+ return await setupResponseFromCeremony(input, dependencies.home, existing);
65
+ }
66
+ if (admitted.lifecycle === "established") return walletRegistrationSetupError("registration_closed", "Completed registration setup snapshot is unavailable");
67
+ const ecdsaBranch = branches.value.evmFamilyEcdsa;
68
+ const nearEd25519Branch = branches.value.nearEd25519;
69
+ if (!ecdsaBranch && !nearEd25519Branch) return walletRegistrationSetupError("invalid_body", "registration signer branch is required");
70
+ const preparedContext = resolveRegistrationPreparedContextFromPlan({
71
+ signerPlan: branches.value.plan,
72
+ runtimePolicyScope,
73
+ signingRootId,
74
+ signingRootVersion
75
+ });
76
+ if (!preparedContext.ok) return walletRegistrationSetupError(preparedContext.code, preparedContext.message);
77
+ if (ecdsaBranch && !runtimePolicyScope) return walletRegistrationSetupError("invalid_body", "ECDSA registration requires an exact runtime policy scope");
78
+ const chainTargets = ecdsaBranch ? registrationPreparedContextEcdsaChainTargets(preparedContext.preparedContext) : null;
79
+ if (ecdsaBranch && !chainTargets) return walletRegistrationSetupError("invalid_body", "ECDSA chain targets are required");
80
+ const ecdsaPrepared = ecdsaBranch && chainTargets && runtimePolicyScope ? await buildD1EvmFamilyEcdsaRegistrationPrepare({
81
+ registrationPurpose: "wallet_registration",
82
+ registrationCeremonyId,
83
+ registrationPreparationId: registrationPreparationIdFromString(registrationPreparationId),
84
+ walletId: wallet.walletId,
85
+ signingRootId,
86
+ signingRootVersion,
87
+ chainTargets,
88
+ participantIds: [...ecdsaBranch.participantIds],
89
+ strictRegistration: dependencies.ecdsaStrictRegistration,
90
+ runtimePolicyScope
91
+ }) : null;
92
+ if (ecdsaPrepared && !ecdsaPrepared.ok) return walletRegistrationSetupError(ecdsaPrepared.code, ecdsaPrepared.message);
93
+ const storedBranches = [];
94
+ if (ecdsaPrepared?.ok && ecdsaBranch) storedBranches.push(buildStoredWalletRegistrationEvmFamilyEcdsaPreparedBranch({
95
+ branchKey: ecdsaBranch.branchKey,
96
+ ecdsa: {
97
+ kind: ecdsaPrepared.ecdsa.kind,
98
+ chainTargets: ecdsaPrepared.ecdsa.chainTargets,
99
+ prepare: ecdsaPrepared.ecdsa.prepare,
100
+ strictRegistration: ecdsaPrepared.ecdsa.strictRegistration,
101
+ strictRegistrationBindingJson: routerAbEcdsaStrictRegistrationFactsBindingJson(ecdsaPrepared.ecdsa.strictRegistration)
102
+ }
103
+ }));
104
+ const ceremony = {
105
+ registrationCeremonyId,
106
+ foundingWalletAuthorityId: registrationOperation.walletAuthorityId,
107
+ foundingDeviceId: registrationOperation.deviceId,
108
+ foundingWalletAuthMethodId: registrationOperation.walletAuthMethodId,
109
+ intent,
110
+ digestB64u,
111
+ signerPlan: branches.value.plan,
112
+ preparedContext: preparedContext.preparedContext,
113
+ orgId: normalizeOptionalTrimmedString(input.orgId) || "",
114
+ signingRootId,
115
+ signingRootVersion,
116
+ ...input.expectedOrigin ? { expectedOrigin: input.expectedOrigin } : {},
117
+ expiresAtMs,
118
+ authorityState: {
119
+ kind: "awaiting_proof",
120
+ authMethod: normalized.authMethod
121
+ },
122
+ signerState: {
123
+ kind: "signer_set_registration",
124
+ branches: storedBranches
125
+ }
126
+ };
127
+ const stored = await dependencies.store.reserveSetupCeremony(ceremony, admitted.ownershipGeneration);
128
+ return await setupResponseFromCeremony(input, dependencies.home, stored);
129
+ }
130
+ async function setupResponseFromCeremony(input, home, ceremony) {
118
131
  const { signedSetup } = await buildWalletRegistrationSetupSignature({
119
132
  signer: input.signer,
120
133
  ceremony,
@@ -123,6 +136,7 @@ async function setupResponseFromCeremony(input, ceremony) {
123
136
  const branches = registrationIntentSignerBranches(ceremony.intent);
124
137
  if (!branches.ok) return branches;
125
138
  const success = {
139
+ home,
126
140
  ok: true,
127
141
  registrationCeremonyId: ceremony.registrationCeremonyId,
128
142
  walletId: String(ceremony.intent.walletId),
@@ -14,11 +14,48 @@ import { DEFAULT_WALLET_SESSION_TTL_MS } from "../../../../shared-ts/src/thresho
14
14
  import { deriveThresholdEcdsaKeyHandle } from "../../../../shared-ts/src/utils/thresholdEcdsaKeyHandle.js";
15
15
  import { registrationEstablishedMintId } from "./walletRegistrationSessionCommitReceipt.js";
16
16
  //#region src/router/cloudflare/d1/registration/walletRegistrationEstablishedSessionIssuer.ts
17
+ async function commitInitialEd25519RegistrationSession(input, commitSession) {
18
+ const issuedAtMs = Date.now();
19
+ await assertDirectWalletSessionOwnerProof({
20
+ proof: input.proof,
21
+ tenantId: input.authorizationTenantId,
22
+ authority: input.authority,
23
+ activeAuthority: input.foundingAuthority,
24
+ walletAuthMethodId: input.walletAuthMethodId,
25
+ nowMs: issuedAtMs
26
+ });
27
+ const policy = registrationSessionPolicy({
28
+ issuedAtMs,
29
+ expiresAtMs: input.expiresAtMs,
30
+ remainingUses: input.remainingUses
31
+ });
32
+ return input.authorizationService.commitDirectWalletSessionAuthorizationV2({
33
+ tenantId: input.authorizationTenantId,
34
+ principalId: walletSessionPrincipalId(input.authority),
35
+ walletId: walletIdFromString(String(input.authority.walletId)),
36
+ authority: input.foundingAuthority,
37
+ walletAuthMethodId: input.walletAuthMethodId,
38
+ mintId: registrationEstablishedMintId(input.registrationCeremonyId),
39
+ remainingUses: policy.remainingUses,
40
+ issuedAtMs,
41
+ expiresAtMs: policy.expiresAtMs
42
+ }, { kind: "validated_registration_authority_projection" }, {
43
+ kind: "registration",
44
+ ceremonyId: input.registrationCeremonyId
45
+ }, commitSession);
46
+ }
17
47
  function requireWalletSessionPrincipalId(value) {
18
48
  const parsed = parsePrincipalId(value);
19
49
  if (!parsed.ok) throw new Error(`Wallet Session principal is invalid: ${parsed.error.message}`);
20
50
  return parsed.value;
21
51
  }
52
+ function publishCommittedRegistration(home, committed) {
53
+ if (!committed.registration) throw new Error("Registration publication requires a committed registration session");
54
+ return home.publishEstablished({
55
+ registration: committed.registration,
56
+ session: committed.publication
57
+ });
58
+ }
22
59
  function walletSessionPrincipalId(authority) {
23
60
  return requireWalletSessionPrincipalId(isEmailOtpWalletAuthAuthority(authority) ? String(authority.factor.providerUserId) : String(authority.walletId));
24
61
  }
@@ -229,13 +266,15 @@ function directRegistrationResultFromIssue(input) {
229
266
  case "issued": return {
230
267
  kind: "issued",
231
268
  session: directRegistrationSession(input.authorization, input.tokens, input.directIssue.operationCredential),
232
- issuedAtMs: input.authorization.session.createdAtMs
269
+ issuedAtMs: input.authorization.session.createdAtMs,
270
+ activation: input.activation
233
271
  };
234
272
  case "already_committed": return {
235
273
  kind: "already_committed",
236
274
  session: projectDirectRegistrationSession(input.authorization, input.tokens),
237
275
  next: input.directIssue.next,
238
- issuedAtMs: input.authorization.session.createdAtMs
276
+ issuedAtMs: input.authorization.session.createdAtMs,
277
+ activation: input.activation
239
278
  };
240
279
  default: return assertNeverDirectRegistrationIssue(input.directIssue);
241
280
  }
@@ -248,15 +287,13 @@ async function assertDirectWalletSessionOwnerProof(input) {
248
287
  if (input.proof.tenantId !== input.tenantId || input.proof.walletId !== input.authority.walletId || input.proof.principalId !== walletSessionPrincipalId(input.authority) || input.proof.authority.walletId !== authorityRef.walletId || input.proof.authority.authorityDigest !== authorityRef.authorityDigest || input.proof.authority.walletAuthMethodId !== authorityRef.walletAuthMethodId || input.activeAuthority.walletId !== input.authority.walletId || input.activeAuthority.state !== "active" || input.walletAuthMethodId !== authorityRef.walletAuthMethodId || input.proof.verifiedAtMs > input.nowMs || input.proof.expiresAtMs <= input.nowMs) throw new Error("Owner proof does not authorize direct Wallet Session issuance");
249
288
  }
250
289
  async function issueDirectRegistrationEstablishedEcdsaSession(input) {
251
- const activeRegistration = await input.walletAuthMethods.readActiveRegistrationAuthority(input.registrationAuthority);
252
- if (!activeRegistration || activeRegistration.authority.walletId !== input.authority.walletId || activeRegistration.walletAuthMethodId !== input.walletAuthMethodId) throw new Error("Registration founding authority is unavailable after commit");
253
290
  const issuedAtMs = Date.now();
254
291
  await assertDirectWalletSessionOwnerProof({
255
292
  proof: input.proof,
256
293
  tenantId: input.authorizationTenantId,
257
294
  authority: input.authority,
258
- activeAuthority: activeRegistration.authority,
259
- walletAuthMethodId: activeRegistration.walletAuthMethodId,
295
+ activeAuthority: input.foundingAuthority,
296
+ walletAuthMethodId: input.walletAuthMethodId,
260
297
  nowMs: issuedAtMs
261
298
  });
262
299
  const policy = registrationSessionPolicy({
@@ -264,17 +301,21 @@ async function issueDirectRegistrationEstablishedEcdsaSession(input) {
264
301
  expiresAtMs: input.expiresAtMs,
265
302
  remainingUses: input.remainingUses
266
303
  });
267
- const directIssue = await input.authorizationService.issueDirectWalletSessionAuthorizationV2({
304
+ const committed = await input.authorizationService.commitDirectWalletSessionAuthorizationV2({
268
305
  tenantId: input.authorizationTenantId,
269
306
  principalId: walletSessionPrincipalId(input.authority),
270
307
  walletId: walletIdFromString(String(input.authority.walletId)),
271
- authority: activeRegistration.authority,
272
- walletAuthMethodId: activeRegistration.walletAuthMethodId,
308
+ authority: input.foundingAuthority,
309
+ walletAuthMethodId: input.walletAuthMethodId,
273
310
  mintId: registrationEstablishedMintId(input.registrationCeremonyId),
274
311
  remainingUses: policy.remainingUses,
275
312
  issuedAtMs,
276
313
  expiresAtMs: policy.expiresAtMs
314
+ }, { kind: "strict" }, {
315
+ kind: "registration",
316
+ ceremonyId: input.registrationCeremonyId
277
317
  });
318
+ const directIssue = committed.result;
278
319
  let authorization;
279
320
  switch (directIssue.kind) {
280
321
  case "issued":
@@ -305,29 +346,29 @@ async function issueDirectRegistrationEstablishedEcdsaSession(input) {
305
346
  runtimePolicyScope: input.runtimePolicyScope,
306
347
  keyHandle
307
348
  });
349
+ const published = await publishCommittedRegistration(input.homeCompletion, committed);
350
+ if (!published.ok) throw new Error(published.message);
308
351
  return directRegistrationResultFromIssue({
309
352
  directIssue,
310
353
  authorization,
311
- tokens
354
+ tokens,
355
+ activation: published.activation
312
356
  });
313
357
  }
314
358
  async function issueDirectRegistrationEstablishedEd25519Session(input) {
315
- const activeRegistration = await input.walletAuthMethods.readActiveRegistrationAuthority(input.registrationAuthority);
316
- if (!activeRegistration || activeRegistration.authority.walletId !== input.authority.walletId || activeRegistration.walletAuthMethodId !== input.walletAuthMethodId) throw new Error("Registration founding authority is unavailable after commit");
317
- const issuedAtMs = Date.now();
318
- await assertDirectWalletSessionOwnerProof({
319
- proof: input.proof,
320
- tenantId: input.authorizationTenantId,
321
- authority: input.authority,
322
- activeAuthority: activeRegistration.authority,
323
- walletAuthMethodId: activeRegistration.walletAuthMethodId,
324
- nowMs: issuedAtMs
325
- });
326
359
  if (input.predecessor.kind === "resumed_mixed") {
360
+ await assertDirectWalletSessionOwnerProof({
361
+ proof: input.proof,
362
+ tenantId: input.authorizationTenantId,
363
+ authority: input.authority,
364
+ activeAuthority: input.foundingAuthority,
365
+ walletAuthMethodId: input.walletAuthMethodId,
366
+ nowMs: Date.now()
367
+ });
327
368
  const authorization = await input.authorizationService.refreshWalletSessionAuthorizationV2AuthorityProjection({
328
369
  existing: input.predecessor.authorization,
329
- authority: activeRegistration.authority,
330
- walletAuthMethodId: activeRegistration.walletAuthMethodId
370
+ authority: input.foundingAuthority,
371
+ walletAuthMethodId: input.walletAuthMethodId
331
372
  });
332
373
  return {
333
374
  kind: "already_committed",
@@ -339,25 +380,12 @@ async function issueDirectRegistrationEstablishedEd25519Session(input) {
339
380
  predecessor: input.predecessor
340
381
  })),
341
382
  next: "unlock_exact_method",
342
- issuedAtMs: authorization.session.createdAtMs
383
+ issuedAtMs: authorization.session.createdAtMs,
384
+ activation: null
343
385
  };
344
386
  }
345
- const policy = registrationSessionPolicy({
346
- issuedAtMs,
347
- expiresAtMs: input.expiresAtMs,
348
- remainingUses: input.remainingUses
349
- });
350
- const directIssue = await input.authorizationService.issueDirectRegistrationPromotedWalletSessionAuthorizationV2({
351
- tenantId: input.authorizationTenantId,
352
- principalId: walletSessionPrincipalId(input.authority),
353
- walletId: walletIdFromString(String(input.authority.walletId)),
354
- authority: activeRegistration.authority,
355
- walletAuthMethodId: activeRegistration.walletAuthMethodId,
356
- mintId: registrationEstablishedMintId(input.registrationCeremonyId),
357
- remainingUses: policy.remainingUses,
358
- issuedAtMs,
359
- expiresAtMs: policy.expiresAtMs
360
- });
387
+ const committed = input.initialSession.kind === "committed" ? input.initialSession.value : await commitInitialEd25519RegistrationSession(input);
388
+ const directIssue = committed.result;
361
389
  let authorization;
362
390
  switch (directIssue.kind) {
363
391
  case "issued":
@@ -375,8 +403,8 @@ async function issueDirectRegistrationEstablishedEd25519Session(input) {
375
403
  });
376
404
  authorization = await input.authorizationService.refreshWalletSessionAuthorizationV2AuthorityProjection({
377
405
  existing,
378
- authority: activeRegistration.authority,
379
- walletAuthMethodId: activeRegistration.walletAuthMethodId
406
+ authority: input.foundingAuthority,
407
+ walletAuthMethodId: input.walletAuthMethodId
380
408
  });
381
409
  break;
382
410
  }
@@ -389,10 +417,16 @@ async function issueDirectRegistrationEstablishedEd25519Session(input) {
389
417
  }).ed25519,
390
418
  predecessor: input.predecessor
391
419
  });
420
+ const [publication, preparation] = await Promise.allSettled([publishCommittedRegistration(input.homeCompletion, committed), input.onSessionCommitted?.(projectDirectRegistrationSession(authorization, tokens))]);
421
+ if (publication.status === "rejected") throw publication.reason;
422
+ if (preparation.status === "rejected") throw preparation.reason;
423
+ const published = publication.value;
424
+ if (!published.ok) throw new Error(published.message);
392
425
  return directRegistrationResultFromIssue({
393
426
  directIssue,
394
427
  authorization,
395
- tokens
428
+ tokens,
429
+ activation: published.activation
396
430
  });
397
431
  }
398
432
  function projectCurrentNearRegistrationSession(authorization, tokens) {
@@ -416,6 +450,6 @@ function replayDirectRegistrationEstablishedEd25519Session(receipt) {
416
450
  };
417
451
  }
418
452
  //#endregion
419
- export { assertDirectWalletSessionOwnerProof, buildRegistrationOwnerProof, issueDirectRegistrationEstablishedEcdsaSession, issueDirectRegistrationEstablishedEd25519Session, projectCurrentNearRegistrationSession, replayDirectRegistrationEstablishedEcdsaSession, replayDirectRegistrationEstablishedEd25519Session, walletSessionPrincipalId };
453
+ export { assertDirectWalletSessionOwnerProof, buildRegistrationOwnerProof, commitInitialEd25519RegistrationSession, issueDirectRegistrationEstablishedEcdsaSession, issueDirectRegistrationEstablishedEd25519Session, projectCurrentNearRegistrationSession, replayDirectRegistrationEstablishedEcdsaSession, replayDirectRegistrationEstablishedEd25519Session, walletSessionPrincipalId };
420
454
 
421
455
  //# sourceMappingURL=walletRegistrationEstablishedSessionIssuer.js.map
@@ -9,6 +9,15 @@ import { hasExactKeys } from "../../../../shared-ts/src/utils/exactKeys.js";
9
9
  import { parseWalletCustodyRegistrationOutcome } from "../../../../shared-ts/src/passkey-custody/ceremonyCommitPayload.js";
10
10
  import "../../../../shared-ts/src/passkey-custody/index.js";
11
11
  //#region src/router/cloudflare/d1/registration/walletRegistrationSessionCommitReceipt.ts
12
+ /** The home activation that a commit left for the record that completes its operation. */
13
+ function registrationCommitActivation(execution) {
14
+ switch (execution.kind) {
15
+ case "session_issued":
16
+ case "session_issued_with_installation_projection": return execution.activation;
17
+ case "unissued":
18
+ case "replayed": return null;
19
+ }
20
+ }
12
21
  function unissuedRegistrationCommit(response) {
13
22
  return {
14
23
  kind: "unissued",
@@ -59,7 +68,7 @@ function projectWalletRegistrationSessionCommitReceiptV2(input) {
59
68
  }
60
69
  };
61
70
  }
62
- if (input.execution.kind === "unissued" || input.execution.kind === "replayed") throw new Error("Registration commit receipt requires an issued or pending response");
71
+ if (input.execution.kind === "unissued" || input.execution.kind === "replayed") throw new Error("Registration commit receipt requires an issued response");
63
72
  const expectedOrigin = input.execution.expectedOrigin;
64
73
  const metadata = {
65
74
  kind: "wallet_registration_session_commit_receipt_v2",
@@ -72,17 +81,6 @@ function projectWalletRegistrationSessionCommitReceiptV2(input) {
72
81
  expectedOrigin,
73
82
  ..."registrationDiagnostics" in response && response.registrationDiagnostics ? { registrationDiagnostics: response.registrationDiagnostics } : {}
74
83
  };
75
- if (response.kind === "near_ed25519" && !("registrationEstablishedSession" in response)) {
76
- if (input.execution.kind !== "near_pending") throw new Error("Pending registration commit receipt has an issued-session marker");
77
- return {
78
- ...metadata,
79
- walletAuthMethodId: response.authority.bindingId,
80
- committed: {
81
- kind: "near_pending",
82
- nearProvisioning: { status: "near_pending" }
83
- }
84
- };
85
- }
86
84
  if (response.kind === "evm_family_ecdsa") {
87
85
  if (!("registrationEstablishedSession" in response)) throw new Error("ECDSA registration commit receipt is missing its session");
88
86
  if (input.execution.kind !== "session_issued" && input.execution.kind !== "session_issued_with_installation_projection") throw new Error("ECDSA registration commit receipt is missing its issue identity");
@@ -235,28 +233,6 @@ function parseWalletRegistrationSessionCommitReceiptV2(raw, parseCommitted) {
235
233
  expectedOrigin,
236
234
  ...registrationDiagnostics ? { registrationDiagnostics } : {}
237
235
  };
238
- if (committedRecord.kind === "near_pending") {
239
- if (operation !== "registration_activate" || !hasExactKeys(record, [
240
- "kind",
241
- "operation",
242
- "operationFingerprint",
243
- "registrationCeremonyId",
244
- "walletId",
245
- "walletAuthMethodId",
246
- "authority",
247
- "authMethod",
248
- "expectedOrigin",
249
- ...registrationDiagnostics ? ["registrationDiagnostics"] : [],
250
- "committed"
251
- ]) || !hasExactKeys(committedRecord, ["kind", "nearProvisioning"]) || committedRecord.nearProvisioning === null || typeof committedRecord.nearProvisioning !== "object" || Array.isArray(committedRecord.nearProvisioning) || !hasExactKeys(committedRecord.nearProvisioning, ["status"]) || committedRecord.nearProvisioning.status !== "near_pending") return null;
252
- return {
253
- ...common,
254
- committed: {
255
- kind: "near_pending",
256
- nearProvisioning: { status: "near_pending" }
257
- }
258
- };
259
- }
260
236
  if (committedRecord.kind !== "ecdsa_ready" && committedRecord.kind !== "near_ready") return null;
261
237
  if (committedRecord.kind === "ecdsa_ready" && operation !== "registration_activate" || committedRecord.kind === "near_ready" && operation !== "near_provisioning") return null;
262
238
  const foundingAuthority = parseWalletAuthorityV1(record.foundingAuthority);
@@ -478,6 +454,6 @@ function containsPersistedRegistrationCredential(value) {
478
454
  return false;
479
455
  }
480
456
  //#endregion
481
- export { parseWalletRegistrationSessionCommitReceiptV2, projectWalletRegistrationSessionCommitReceiptV2, registrationEstablishedMintId, registrationReplayAuthMethodFields, replayedRegistrationCommit, unissuedRegistrationCommit };
457
+ export { parseWalletRegistrationSessionCommitReceiptV2, projectWalletRegistrationSessionCommitReceiptV2, registrationCommitActivation, registrationEstablishedMintId, registrationReplayAuthMethodFields, replayedRegistrationCommit, unissuedRegistrationCommit };
482
458
 
483
459
  //# sourceMappingURL=walletRegistrationSessionCommitReceipt.js.map