@seams/wallet-server 0.7.1 → 0.7.3

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 (259) hide show
  1. package/THIRD_PARTY_NOTICES.md +1 -105
  2. package/artifact-manifest.json +21 -21
  3. package/cloudflare-router-ab/build/deriver-a/build-stamp.json +1 -1
  4. package/cloudflare-router-ab/build/deriver-a/index_bg.wasm +0 -0
  5. package/cloudflare-router-ab/build/deriver-b/build-stamp.json +1 -1
  6. package/cloudflare-router-ab/build/deriver-b/index_bg.wasm +0 -0
  7. package/cloudflare-router-ab/build/local-tools/darwin-arm64/router_ab_local_init +0 -0
  8. package/cloudflare-router-ab/build/local-tools/darwin-x64/router_ab_local_init +0 -0
  9. package/cloudflare-router-ab/build/local-tools/linux-x64/router_ab_local_init +0 -0
  10. package/cloudflare-router-ab/build/router/build-stamp.json +1 -1
  11. package/cloudflare-router-ab/build/router/index_bg.wasm +0 -0
  12. package/cloudflare-router-ab/build/signing-worker/build-stamp.json +1 -1
  13. package/cloudflare-router-ab/build/signing-worker/index_bg.wasm +0 -0
  14. package/cloudflare-router-ab/build/tenant-root-control-plane/build-stamp.json +1 -1
  15. package/cloudflare-router-ab/build/tenant-root-control-plane/index_bg.wasm +0 -0
  16. package/dist/esm/authorization/service.js +8 -0
  17. package/dist/esm/authorization/vaultProxyUse.js +2 -6
  18. package/dist/esm/cloud-host.js +4 -4
  19. package/dist/esm/core/IdentityStore.js +23 -110
  20. package/dist/esm/core/SessionService.js +7 -30
  21. package/dist/esm/core/ThresholdService/routerAbNormalSigningPolicy.js +3 -10
  22. package/dist/esm/core/ThresholdService/stores/WalletSessionStore.js +21 -97
  23. package/dist/esm/core/ThresholdService/stores/exportReplayGuard.js +7 -0
  24. package/dist/esm/core/WalletStore.js +4 -6
  25. package/dist/esm/core/authService/bytes.js +1 -4
  26. package/dist/esm/core/authService/emailOtpChallengeOperations.js +2 -5
  27. package/dist/esm/core/authService/emailOtpChallengeProof.js +9 -40
  28. package/dist/esm/core/authService/emailOtpChallengeVerification.js +19 -90
  29. package/dist/esm/core/authService/emailOtpChallenges.js +10 -45
  30. package/dist/esm/core/authService/emailOtpDelivery.js +10 -45
  31. package/dist/esm/core/authService/emailOtpEnrollment.js +9 -40
  32. package/dist/esm/core/authService/emailOtpGrant.js +9 -40
  33. package/dist/esm/core/authService/emailOtpRegistrationEnrollment.js +9 -40
  34. package/dist/esm/core/authService/emailOtpSeal.js +5 -20
  35. package/dist/esm/core/authService/emailOtpUnlock.js +20 -110
  36. package/dist/esm/core/authService/googleEmailOtpRegistration.js +28 -115
  37. package/dist/esm/core/authService/identity.js +5 -20
  38. package/dist/esm/core/authService/nearPublicKeyMetadata.js +6 -25
  39. package/dist/esm/core/authService/oidcVerification.js +22 -34
  40. package/dist/esm/core/authService/rateLimits.js +2 -5
  41. package/dist/esm/core/authService/thresholdEcdsaKeyInventory.js +2 -1
  42. package/dist/esm/core/authService/webauthn.js +37 -191
  43. package/dist/esm/core/authService/webauthnVerificationOutcomes.js +5 -24
  44. package/dist/esm/core/d1EcdsaSignerRead.js +76 -0
  45. package/dist/esm/core/d1IdentityStore.js +16 -75
  46. package/dist/esm/core/d1TenantStore.js +1 -1
  47. package/dist/esm/core/d1WalletStore.js +15 -25
  48. package/dist/esm/core/deviceLinking/linkedDeviceEmailOtpGrant.js +1 -5
  49. package/dist/esm/core/deviceLinking/linkedDeviceSessionApproval.js +1 -3
  50. package/dist/esm/core/deviceLinking/linkedDeviceSessionRecord.js +2 -8
  51. package/dist/esm/core/deviceLinking/requestProof.js +13 -4
  52. package/dist/esm/core/ecdsaMaterialReadSnapshot.js +85 -0
  53. package/dist/esm/core/nearRelayerAccountProvisioning.js +2 -5
  54. package/dist/esm/core/signingLanes/WalletExecutionLaneProjection.js +3 -6
  55. package/dist/esm/core/signingMaterial/ordinaryInactiveSignerMaterialReservation.js +2 -5
  56. package/dist/esm/core/storeBackends.js +1 -1
  57. package/dist/esm/core/thresholdEcdsaChainTarget.js +1 -3
  58. package/dist/esm/hosted-wallet-gateway.js +2 -2
  59. package/dist/esm/localHostedWalletGatewayHandler.js +13 -0
  60. package/dist/esm/localIntendedMaterialAdmissionFault.js +176 -0
  61. package/dist/esm/localIntendedPresignCancellation.js +44 -0
  62. package/dist/esm/router/auth/commonRouterUtils.js +24 -10
  63. package/dist/esm/router/auth/walletSessionFailure.js +2 -5
  64. package/dist/esm/router/auth/webAuthnCredentialCodecs.js +4 -15
  65. package/dist/esm/router/cloudflare/d1/auth/d1AuthorizedOperationRouteService.js +1 -0
  66. package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthBoundary.js +2 -6
  67. package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthService.js +5 -27
  68. package/dist/esm/router/cloudflare/d1/auth/walletSessionCredentialReaders.js +76 -0
  69. package/dist/esm/router/cloudflare/d1/authorization/authorizedOperationStatements.js +28 -21
  70. package/dist/esm/router/cloudflare/d1/authorization/d1AuthorizationStore.js +209 -44
  71. package/dist/esm/router/cloudflare/d1/authorization/d1VaultProxyStore.js +8 -12
  72. package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.js +50 -8
  73. package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetCredentialProvider.js +1 -1
  74. package/dist/esm/router/cloudflare/d1/deviceLinking/index.js +3 -3
  75. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeIssuer.js +12 -55
  76. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeService.js +17 -80
  77. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpDeliveryRuntime.js +6 -25
  78. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecords.js +12 -47
  79. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecoveryService.js +24 -85
  80. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRegistrationEnrollmentFinalizer.js +7 -30
  81. package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpServerSealRuntime.js +5 -20
  82. package/dist/esm/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpSessionResolver.js +23 -110
  83. package/dist/esm/router/cloudflare/d1/identity/d1IdentityService.js +9 -40
  84. package/dist/esm/router/cloudflare/d1/near/d1NearPublicKeyStore.js +3 -10
  85. package/dist/esm/router/cloudflare/d1/oidc/d1OidcBoundary.js +18 -91
  86. package/dist/esm/router/cloudflare/d1/oidc/d1OidcVerificationService.js +6 -30
  87. package/dist/esm/router/cloudflare/d1/passkeyCustody/d1PasskeyCustodyRouteService.js +4 -15
  88. package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletCustodyCommitStore.js +2 -7
  89. package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletRecoveryGoogleEmailOtpRecords.js +9 -13
  90. package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletRecoveryGoogleEmailOtpService.js +11 -50
  91. package/dist/esm/router/cloudflare/d1/registration/d1EvmFamilyEcdsaRegistrationBranch.js +5 -20
  92. package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore.js +4 -7
  93. package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyRecords.js +2 -1
  94. package/dist/esm/router/cloudflare/d1/registration/d1RegistrationIntentService.js +7 -30
  95. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationService.js +32 -22
  96. package/dist/esm/router/cloudflare/d1/registration/walletRegistrationSessionCommitReceipt.js +1 -4
  97. package/dist/esm/router/cloudflare/d1/signingAdmission/d1RouterAbNormalSigningAdmissionStore.js +119 -25
  98. package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnAuthService.js +31 -168
  99. package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnRecords.js +6 -9
  100. package/dist/esm/router/cloudflare/durableObjects/thresholdStore.js +59 -66
  101. package/dist/esm/router/cloudflare/runtime/routerAbPrewarm.js +2 -2
  102. package/dist/esm/router/cloudflare/runtime/staticWalletConsoleBinding.js +5 -20
  103. package/dist/esm/router/cloudflare/runtime/tenantRootCreationGrant.js +2 -9
  104. package/dist/esm/router/cloudflare/runtime/walletControlOps.js +2 -1
  105. package/dist/esm/router/cloudflare/signingLanes/cloudflareLaneCurveExecution.js +2 -1
  106. package/dist/esm/router/cloudflare/signingLanes/cloudflareLaneProtocolCommitter.js +2 -2
  107. package/dist/esm/router/cloudflare.js +2146 -1802
  108. package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistrationPersistence.js +5 -8
  109. package/dist/esm/router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecoveryWalletSessionAuthorization.js +3 -6
  110. package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationIntentAuthorization.js +6 -25
  111. package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationSideEffectBoundary.js +39 -55
  112. package/dist/esm/router/domains/emailOtp/emailOtpRouteHandlers.js +15 -62
  113. package/dist/esm/router/domains/signingOperations/routerAbEcdsaDerivationNormalSigningRoute.js +83 -74
  114. package/dist/esm/router/domains/signingOperations/routerAbNormalSigningAdmission.js +1 -0
  115. package/dist/esm/router/domains/signingOperations/routerAbOperationStepUp.js +1 -0
  116. package/dist/esm/router/domains/signingOperations/walletExecutionAdmission.js +1 -4
  117. package/dist/esm/router/domains/tenantRoot/tenantRootIdentityResolution.js +7 -13
  118. package/dist/esm/router/domains/walletUnlock/walletUnlockRouteHandlers.js +41 -200
  119. package/dist/esm/router/express.js +317 -699
  120. package/dist/esm/router/framework/http.js +5 -1
  121. package/dist/esm/router/framework/runtimeSnapshotConsumer.js +8 -35
  122. package/dist/esm/router/transport/fetch/createFetchRouter.js +3 -6
  123. package/dist/esm/router/transport/fetch/routes/auth.js +9 -41
  124. package/dist/esm/router/transport/fetch/routes/deviceLinkingOwnerAuthorization.js +5 -22
  125. package/dist/esm/router/transport/fetch/routes/nearPublicKeys.js +4 -16
  126. package/dist/esm/router/transport/fetch/routes/sessions.js +1 -0
  127. package/dist/esm/router/transport/fetch/routes/syncAccount.js +8 -36
  128. package/dist/esm/router/transport/fetch/routes/thresholdEcdsa.js +27 -79
  129. package/dist/esm/router/transport/fetch/routes/walletExecutionLanePreflight.js +4 -1
  130. package/dist/esm/router/transport/fetch/routes/webauthnAuthenticators.js +4 -16
  131. package/dist/esm/shared-ts/src/authorization/walletSignerActivationEquality.js +12 -0
  132. package/dist/esm/shared-ts/src/device-linking/committedSignerPackages.js +2 -5
  133. package/dist/esm/shared-ts/src/device-linking/delegatedActivationPlan.js +1 -5
  134. package/dist/esm/shared-ts/src/device-linking/ed25519ExportRoot.js +12 -16
  135. package/dist/esm/shared-ts/src/device-linking/sourceContribution.js +5 -8
  136. package/dist/esm/shared-ts/src/passkey-custody/primitives.js +5 -1
  137. package/dist/esm/shared-ts/src/signing-lanes/ownerContinuity.js +4 -8
  138. package/dist/esm/shared-ts/src/tenant-root/tenantRootIdentifier.js +12 -0
  139. package/dist/esm/shared-ts/src/tenant-root/tenantRootIdentity.js +2 -9
  140. package/dist/esm/shared-ts/src/tenant-root/tenantRootOperationRecord.js +1 -4
  141. package/dist/esm/shared-ts/src/utils/ecdsaKeyFactsInventory.js +2 -4
  142. package/dist/esm/shared-ts/src/utils/ecdsaServerTiming.js +0 -1
  143. package/dist/esm/shared-ts/src/utils/emailOtpDomain.js +3 -1
  144. package/dist/esm/shared-ts/src/utils/exactKeys.js +17 -0
  145. package/dist/esm/shared-ts/src/utils/failure.js +20 -0
  146. package/dist/esm/shared-ts/src/utils/registrationIntent.js +3 -12
  147. package/dist/esm/shared-ts/src/utils/registrationSignerPlan.js +2 -5
  148. package/dist/esm/shared-ts/src/utils/routerAbEcdsaDerivation.js +1 -1
  149. package/dist/esm/shared-ts/src/utils/routerAbEd25519Yao.js +1 -1
  150. package/dist/esm/shared-ts/src/utils/thresholdEcdsaChainTarget.js +9 -0
  151. package/dist/esm/shared-ts/src/wallet-recovery/walletRecoveryCommittedProjection.js +1 -4
  152. package/dist/esm/threshold/session/signingSessionSeal/crypto/cipher.js +10 -32
  153. package/dist/esm/threshold/session/signingSessionSeal/idempotencyBackends.js +3 -3
  154. package/dist/esm/threshold/session/signingSessionSeal/idempotencyRecords.js +3 -9
  155. package/dist/esm/threshold/session/signingSessionSeal/service.js +8 -35
  156. package/dist/esm/threshold/session/signingSessionSeal/transport/express.js +18 -94
  157. package/dist/esm/threshold/session/signingSessionSeal/transport/fetch.js +6 -30
  158. package/dist/esm/threshold/session/signingSessionSeal/transport/shared.js +5 -20
  159. package/dist/esm/wasm/evm_crypto/pkg/evm_crypto_bg.wasm +0 -0
  160. package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
  161. package/dist/types/shared-ts/src/authorization/delegatedAuthority.d.ts +2 -1
  162. package/dist/types/shared-ts/src/authorization/walletSessionIssuance.d.ts +9 -2
  163. package/dist/types/shared-ts/src/authorization/walletSignerActivationEquality.d.ts +4 -0
  164. package/dist/types/shared-ts/src/device-linking/committedSignerPackages.d.ts +3 -4
  165. package/dist/types/shared-ts/src/device-linking/contracts.d.ts +5 -63
  166. package/dist/types/shared-ts/src/device-linking/sourceContribution.d.ts +2 -0
  167. package/dist/types/shared-ts/src/passkey-custody/custodyEnvelope.d.ts +5 -12
  168. package/dist/types/shared-ts/src/passkey-custody/primitives.d.ts +9 -0
  169. package/dist/types/shared-ts/src/signing-lanes/execution.d.ts +11 -1
  170. package/dist/types/shared-ts/src/signing-lanes/ids.d.ts +1 -10
  171. package/dist/types/shared-ts/src/signing-lanes/rotation.d.ts +3 -5
  172. package/dist/types/shared-ts/src/tenant-root/tenantRootIdentifier.d.ts +3 -0
  173. package/dist/types/shared-ts/src/tenant-root/tenantRootOperationRecord.d.ts +2 -1
  174. package/dist/types/shared-ts/src/threshold/ecdsaDerivationRoleLocalBootstrap.d.ts +6 -0
  175. package/dist/types/shared-ts/src/threshold/signingRootScope.d.ts +1 -0
  176. package/dist/types/shared-ts/src/utils/ecdsaKeyFactsInventory.d.ts +2 -11
  177. package/dist/types/shared-ts/src/utils/eip1559TxWasmJson.d.ts +16 -0
  178. package/dist/types/shared-ts/src/utils/emailOtpDomain.d.ts +2 -0
  179. package/dist/types/shared-ts/src/utils/exactKeys.d.ts +11 -0
  180. package/dist/types/shared-ts/src/utils/failure.d.ts +12 -0
  181. package/dist/types/shared-ts/src/utils/jsonRpc.d.ts +3 -4
  182. package/dist/types/shared-ts/src/utils/nearRpcResults.d.ts +1 -0
  183. package/dist/types/shared-ts/src/utils/registrationAuthMethodInput.d.ts +3 -8
  184. package/dist/types/shared-ts/src/utils/registrationSignerPlan.d.ts +7 -19
  185. package/dist/types/shared-ts/src/utils/routerAbEcdsaDerivation.d.ts +3 -1
  186. package/dist/types/shared-ts/src/utils/routerAbEd25519Yao.d.ts +1 -0
  187. package/dist/types/shared-ts/src/utils/routerAbEd25519YaoDigests.d.ts +3 -4
  188. package/dist/types/shared-ts/src/utils/routerAbNormalSigningIdentity.d.ts +30 -8
  189. package/dist/types/shared-ts/src/utils/routerApiKeyAuth.d.ts +2 -0
  190. package/dist/types/shared-ts/src/utils/signingSessionSeal.d.ts +10 -11
  191. package/dist/types/shared-ts/src/utils/thresholdEcdsaChainTarget.d.ts +25 -0
  192. package/dist/types/shared-ts/src/utils/variant.d.ts +18 -0
  193. package/dist/types/shared-ts/src/utils/walletAuthMethodRecord.d.ts +3 -6
  194. package/dist/types/shared-ts/src/utils/webauthnDeviceInfo.d.ts +4 -2
  195. package/dist/types/shared-ts/src/wallet-recovery/recoveryEnvelopes.d.ts +3 -16
  196. package/dist/types/shared-ts/src/wallet-recovery/walletRecoveryPreparation.d.ts +15 -0
  197. package/dist/types/shared-ts/src/wallet-recovery/walletRecoveryTarget.d.ts +3 -4
  198. package/dist/types/wallet-server/src/authorization/domain.d.ts +13 -2
  199. package/dist/types/wallet-server/src/authorization/ecdsaWalletSessionAdmission.d.ts +27 -3
  200. package/dist/types/wallet-server/src/authorization/service.d.ts +19 -0
  201. package/dist/types/wallet-server/src/core/ThresholdService/stores/SessionStore.d.ts +2 -2
  202. package/dist/types/wallet-server/src/core/ThresholdService/stores/WalletSessionStore.d.ts +1 -1
  203. package/dist/types/wallet-server/src/core/ThresholdService/stores/exportReplayGuard.d.ts +3 -0
  204. package/dist/types/wallet-server/src/core/ThresholdService/validation.d.ts +8 -101
  205. package/dist/types/wallet-server/src/core/WebAuthnAuthenticatorStore.d.ts +8 -0
  206. package/dist/types/wallet-server/src/core/authService/bytes.d.ts +0 -1
  207. package/dist/types/wallet-server/src/core/authService/emailOtpChallenges.d.ts +2 -10
  208. package/dist/types/wallet-server/src/core/authService/emailOtpSeal.d.ts +1 -1
  209. package/dist/types/wallet-server/src/core/authService/emailOtpUnlock.d.ts +3 -10
  210. package/dist/types/wallet-server/src/core/d1EcdsaSignerRead.d.ts +39 -0
  211. package/dist/types/wallet-server/src/core/d1WalletStore.d.ts +10 -0
  212. package/dist/types/wallet-server/src/core/deviceLinking/linkedDeviceSessionRecord.d.ts +3 -4
  213. package/dist/types/wallet-server/src/core/ecdsaMaterialReadSnapshot.d.ts +19 -0
  214. package/dist/types/wallet-server/src/core/routerAbSigning/RouterAbNormalSigningRuntime.d.ts +3 -5
  215. package/dist/types/wallet-server/src/core/rpcClients/near/NearClient.d.ts +1 -2
  216. package/dist/types/wallet-server/src/core/signingLanes/WalletExecutionLaneProjection.d.ts +2 -11
  217. package/dist/types/wallet-server/src/core/signingLanes/signingWorkerLaneMaterialIdentity.d.ts +2 -19
  218. package/dist/types/wallet-server/src/core/thresholdEcdsaChainTarget.d.ts +3 -11
  219. package/dist/types/wallet-server/src/core/types.d.ts +2 -6
  220. package/dist/types/wallet-server/src/localIntendedMaterialAdmissionFault.d.ts +38 -0
  221. package/dist/types/wallet-server/src/localIntendedPresignCancellation.d.ts +4 -0
  222. package/dist/types/wallet-server/src/router/auth/authRequestValidation.d.ts +4 -9
  223. package/dist/types/wallet-server/src/router/auth/commonRouterUtils.d.ts +15 -1
  224. package/dist/types/wallet-server/src/router/cloudflare/d1/auth/d1RouterApiAuthBoundary.d.ts +0 -1
  225. package/dist/types/wallet-server/src/router/cloudflare/d1/auth/d1RouterApiAuthService.d.ts +1 -1
  226. package/dist/types/wallet-server/src/router/cloudflare/d1/auth/walletSessionCredentialReaders.d.ts +9 -0
  227. package/dist/types/wallet-server/src/router/cloudflare/d1/authorization/authorizedOperationStatements.d.ts +4 -0
  228. package/dist/types/wallet-server/src/router/cloudflare/d1/authorization/d1AuthorizationStore.d.ts +10 -1
  229. package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.d.ts +19 -2
  230. package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceSessionStore.d.ts +2 -6
  231. package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetCredentialProvider.d.ts +5 -8
  232. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpEnrollmentStore.d.ts +2 -8
  233. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpRateLimitStore.d.ts +2 -9
  234. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpRecords.d.ts +5 -5
  235. package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpServerSealRuntime.d.ts +4 -14
  236. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore.d.ts +2 -6
  237. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationService.d.ts +8 -6
  238. package/dist/types/wallet-server/src/router/cloudflare/d1/signingAdmission/d1RouterAbNormalSigningAdmissionStore.d.ts +14 -1
  239. package/dist/types/wallet-server/src/router/cloudflare/d1/webauthn/d1WebAuthnRecords.d.ts +10 -39
  240. package/dist/types/wallet-server/src/router/cloudflare/runtime/walletConsoleOps.d.ts +8 -34
  241. package/dist/types/wallet-server/src/router/domains/ecdsa/thresholdEcdsaRequestValidation.d.ts +3 -15
  242. package/dist/types/wallet-server/src/router/domains/ed25519Yao/session/routerAbEd25519YaoWalletSession.d.ts +9 -50
  243. package/dist/types/wallet-server/src/router/domains/passkeyCustody/walletRecoveryKeyManifest.d.ts +1 -13
  244. package/dist/types/wallet-server/src/router/domains/signingOperations/routerAbEcdsaDerivationNormalSigningRoute.d.ts +8 -9
  245. package/dist/types/wallet-server/src/router/domains/signingOperations/routerAbNormalSigningAdmission.d.ts +13 -0
  246. package/dist/types/wallet-server/src/router/domains/signingOperations/routerAbOperationStepUp.d.ts +3 -4
  247. package/dist/types/wallet-server/src/router/domains/signingOperations/routerAbPrivateSigningWorker.d.ts +7 -16
  248. package/dist/types/wallet-server/src/router/domains/syncAccount/syncAccountRequestValidation.d.ts +2 -7
  249. package/dist/types/wallet-server/src/router/framework/apiCredentialPorts.d.ts +3 -1
  250. package/dist/types/wallet-server/src/router/framework/authServicePort.d.ts +25 -4
  251. package/dist/types/wallet-server/src/router/framework/http.d.ts +1 -0
  252. package/dist/types/wallet-server/src/router/framework/ror/normalize.d.ts +1 -9
  253. package/dist/types/wallet-server/src/router/transport/fetch/routes/deviceLinkingOwnerAuthorization.d.ts +3 -6
  254. package/dist/types/wallet-server/src/router/transport/fetch/routes/syncAccountBootstrap.d.ts +3 -5
  255. package/dist/types/wallet-server/src/router/transport/fetch/routes/thresholdEcdsa.d.ts +0 -1
  256. package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/idempotencyRecords.d.ts +1 -2
  257. package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/signingSessionSeal.types.d.ts +6 -8
  258. package/package.json +1 -1
  259. package/dist/esm/wasm/router_ab_ecdsa_signing_worker/pkg/router_ab_ecdsa_signing_worker_bg.wasm +0 -0
@@ -0,0 +1,12 @@
1
+ import { mpcMaterialActivationRefsEqual } from "../utils/domainIds.js";
2
+ //#region ../shared-ts/src/authorization/walletSignerActivationEquality.ts
3
+ function sameWalletEd25519SignerActivationV1(left, right) {
4
+ return left.kind === right.kind && left.signer.kind === right.signer.kind && left.signer.keyFamily === right.signer.keyFamily && left.signer.walletId === right.signer.walletId && left.signer.walletKeyId === right.signer.walletKeyId && left.signer.registeredPublicKeyB64u === right.signer.registeredPublicKeyB64u && mpcMaterialActivationRefsEqual(left.materialActivation, right.materialActivation);
5
+ }
6
+ function sameWalletEcdsaSignerActivationV1(left, right) {
7
+ return left.kind === right.kind && left.signer.kind === right.signer.kind && left.signer.keyFamily === right.signer.keyFamily && left.signer.walletId === right.signer.walletId && left.signer.walletKeyId === right.signer.walletKeyId && left.signer.thresholdPublicKey33B64u === right.signer.thresholdPublicKey33B64u && left.signer.evmAddress === right.signer.evmAddress && mpcMaterialActivationRefsEqual(left.materialActivation, right.materialActivation);
8
+ }
9
+ //#endregion
10
+ export { sameWalletEcdsaSignerActivationV1, sameWalletEd25519SignerActivationV1 };
11
+
12
+ //# sourceMappingURL=walletSignerActivationEquality.js.map
@@ -3,7 +3,7 @@ import { alphabetizeStringify } from "../utils/digests.js";
3
3
  import { parseDigestB64u, sha256Utf8DigestB64u } from "../utils/canonicalPrimitives.js";
4
4
  import { parseLinkedDeviceEd25519ExportRootPackageV1 } from "./ed25519ExportRoot.js";
5
5
  import { routerAbMpcMaterialActivationRefFromWire } from "../utils/routerAbNormalSigningIdentity.js";
6
- import { parseRouterAbEd25519YaoActivationPublicReceiptV1, parseRouterAbEd25519YaoApplicationBindingFactsV1, parseRouterAbEd25519YaoCeremonyBindingV1, parseRouterAbEd25519YaoEncryptedPackageV1, parseRouterAbEd25519YaoParticipantIdsV1 } from "../utils/routerAbEd25519Yao.js";
6
+ import { parseRouterAbEd25519YaoActivationPublicReceiptV1, parseRouterAbEd25519YaoApplicationBindingFactsV1, parseRouterAbEd25519YaoCeremonyBindingV1, parseRouterAbEd25519YaoEncryptedPackageV1, parseRouterAbEd25519YaoParticipantIdsV1, sameRouterAbEd25519YaoByteSequence } from "../utils/routerAbEd25519Yao.js";
7
7
  import { parseLinkedDeviceEcdsaEncryptedSourceContributionV1, parseLinkedDeviceEcdsaSourcePreservingActivationReceiptV1 } from "./sourceContribution.js";
8
8
  import { parseWalletAuthMethodRecordV2 } from "../utils/walletAuthMethodRecord.js";
9
9
  import { parseWalletAuthorityV1 } from "../authorization/walletAuthority.js";
@@ -117,7 +117,7 @@ function parseEd25519Package(raw) {
117
117
  if (!mpcMaterialActivationRefsEqual(materialActivation, routerAbMpcMaterialActivationRefFromWire(targetBinding.material_activation))) throw new Error("CommittedEd25519SignerPackageV1 target binding does not match material");
118
118
  const deriverA = parseEd25519ClientPackage(record.deriver_a_client_package, "deriver_a_client_package", "deriver_a");
119
119
  const deriverB = parseEd25519ClientPackage(record.deriver_b_client_package, "deriver_b_client_package", "deriver_b");
120
- if (!sameBytes(activationReceipt.transcript, deriverA.transcript) || !sameBytes(activationReceipt.transcript, deriverB.transcript)) throw new Error("CommittedEd25519SignerPackageV1 receipt transcript does not match packages");
120
+ if (!sameRouterAbEd25519YaoByteSequence(activationReceipt.transcript, deriverA.transcript) || !sameRouterAbEd25519YaoByteSequence(activationReceipt.transcript, deriverB.transcript)) throw new Error("CommittedEd25519SignerPackageV1 receipt transcript does not match packages");
121
121
  return {
122
122
  kind: "committed_ed25519_signer_package_v1",
123
123
  materialActivation,
@@ -283,9 +283,6 @@ function parseCommittedEcdsaSignerPackageWireV1(raw) {
283
283
  function inspectRawObject(raw) {
284
284
  return raw !== null && typeof raw === "object" && !Array.isArray(raw) ? raw : null;
285
285
  }
286
- function sameBytes(left, right) {
287
- return left.length === right.length && left.every((value, index) => value === right[index]);
288
- }
289
286
  function requireExactWireFields(record, keys, label) {
290
287
  const expected = new Set(keys);
291
288
  const actual = Object.keys(record);
@@ -1,7 +1,7 @@
1
1
  import { parseWalletId, parseWalletKeyId } from "../utils/domainIds.js";
2
2
  import { requireRecord } from "../utils/validation.js";
3
3
  import { rejectUnknownFields } from "../utils/exactRecord.js";
4
- import { parseEd25519PublicKeyB64u, parseSecp256k1CompressedPublicKeyB64u } from "../passkey-custody/primitives.js";
4
+ import { parseEd25519PublicKeyB64u, parseSecp256k1CompressedPublicKeyB64u, requireParsed } from "../passkey-custody/primitives.js";
5
5
  //#region ../shared-ts/src/device-linking/delegatedActivationPlan.ts
6
6
  const MANIFEST_FIELDS = [
7
7
  "kind",
@@ -124,10 +124,6 @@ function exactRecord(raw, fields, label) {
124
124
  for (const field of fields) if (!(field in record)) throw new Error(`${label}.${field} is required`);
125
125
  return record;
126
126
  }
127
- function requireParsed(parsed, label) {
128
- if (!parsed.ok) throw new Error(`${label} ${parsed.error.message}`);
129
- return parsed.value;
130
- }
131
127
  //#endregion
132
128
  export { buildExactAdministeredSignerManifestV1, parseExactAdministeredSignerManifestV1 };
133
129
 
@@ -2,7 +2,7 @@ import { parseLinkDeviceSessionId, parseLinkedDeviceEnrollmentId, parseLinkedDev
2
2
  import { base64UrlDecode, base64UrlEncode } from "../utils/base64.js";
3
3
  import { requireRecord } from "../utils/validation.js";
4
4
  import { rejectUnknownFields } from "../utils/exactRecord.js";
5
- import { parseDigestField, parseEd25519PublicKeyB64u, parseEnvelopeCiphertextB64u, parseEnvelopeNonceB64u } from "../passkey-custody/primitives.js";
5
+ import { parseDigestField, parseEd25519PublicKeyB64u, parseEnvelopeCiphertextB64u, parseEnvelopeNonceB64u, requireParsed } from "../passkey-custody/primitives.js";
6
6
  //#region ../shared-ts/src/device-linking/ed25519ExportRoot.ts
7
7
  /**
8
8
  * Authenticated relay records for the cross-device Ed25519 Yao Client export
@@ -71,11 +71,11 @@ function parseLinkedDeviceEd25519ExportRootRecipientV1(raw) {
71
71
  requireTransferAlg(record.transferAlg, "LinkedDeviceEd25519ExportRootRecipientV1.transferAlg");
72
72
  return {
73
73
  kind: "linked_device_ed25519_export_root_recipient_v1",
74
- linkSessionId: parseRequired(parseLinkDeviceSessionId(record.linkSessionId), "LinkedDeviceEd25519ExportRootRecipientV1.linkSessionId"),
75
- walletId: parseRequired(parseWalletId(record.walletId), "walletId"),
76
- walletKeyId: parseRequired(parseWalletKeyId(record.walletKeyId), "walletKeyId"),
77
- enrollmentId: parseRequired(parseLinkedDeviceEnrollmentId(record.enrollmentId), "enrollmentId"),
78
- deviceId: parseRequired(parseLinkedDeviceId(record.deviceId), "deviceId"),
74
+ linkSessionId: requireParsed(parseLinkDeviceSessionId(record.linkSessionId), "LinkedDeviceEd25519ExportRootRecipientV1.linkSessionId"),
75
+ walletId: requireParsed(parseWalletId(record.walletId), "walletId"),
76
+ walletKeyId: requireParsed(parseWalletKeyId(record.walletKeyId), "walletKeyId"),
77
+ enrollmentId: requireParsed(parseLinkedDeviceEnrollmentId(record.enrollmentId), "enrollmentId"),
78
+ deviceId: requireParsed(parseLinkedDeviceId(record.deviceId), "deviceId"),
79
79
  transferAlg: LINKED_DEVICE_ED25519_EXPORT_ROOT_TRANSFER_ALG_V1,
80
80
  applicationBindingDigestB64u: parseDigestField(record.applicationBindingDigestB64u, "applicationBindingDigestB64u"),
81
81
  registeredPublicKeyB64u: parseEd25519PublicKeyB64u(record.registeredPublicKeyB64u, "registeredPublicKeyB64u"),
@@ -94,11 +94,11 @@ function parseLinkedDeviceEd25519ExportRootPackageV1(raw) {
94
94
  if (recipientPublicKeyB64u === ephemeralPublicKeyB64u) throw new Error("ephemeralPublicKeyB64u repeats the recipient key");
95
95
  return {
96
96
  kind: "linked_device_ed25519_export_root_package_v1",
97
- linkSessionId: parseRequired(parseLinkDeviceSessionId(record.linkSessionId), "linkSessionId"),
98
- walletId: parseRequired(parseWalletId(record.walletId), "walletId"),
99
- walletKeyId: parseRequired(parseWalletKeyId(record.walletKeyId), "walletKeyId"),
100
- enrollmentId: parseRequired(parseLinkedDeviceEnrollmentId(record.enrollmentId), "enrollmentId"),
101
- deviceId: parseRequired(parseLinkedDeviceId(record.deviceId), "deviceId"),
97
+ linkSessionId: requireParsed(parseLinkDeviceSessionId(record.linkSessionId), "linkSessionId"),
98
+ walletId: requireParsed(parseWalletId(record.walletId), "walletId"),
99
+ walletKeyId: requireParsed(parseWalletKeyId(record.walletKeyId), "walletKeyId"),
100
+ enrollmentId: requireParsed(parseLinkedDeviceEnrollmentId(record.enrollmentId), "enrollmentId"),
101
+ deviceId: requireParsed(parseLinkedDeviceId(record.deviceId), "deviceId"),
102
102
  transferAlg: LINKED_DEVICE_ED25519_EXPORT_ROOT_TRANSFER_ALG_V1,
103
103
  applicationBindingDigestB64u: parseDigestField(record.applicationBindingDigestB64u, "applicationBindingDigestB64u"),
104
104
  registeredPublicKeyB64u: parseEd25519PublicKeyB64u(record.registeredPublicKeyB64u, "registeredPublicKeyB64u"),
@@ -118,7 +118,7 @@ function parseLinkedDeviceEd25519ExportRootSubmissionV1(raw) {
118
118
  if (record.kind !== "linked_device_ed25519_export_root_submission_v1") throw new Error("LinkedDeviceEd25519ExportRootSubmissionV1.kind is invalid");
119
119
  return {
120
120
  kind: "linked_device_ed25519_export_root_submission_v1",
121
- linkSessionId: parseRequired(parseLinkDeviceSessionId(record.linkSessionId), "linkSessionId"),
121
+ linkSessionId: requireParsed(parseLinkDeviceSessionId(record.linkSessionId), "linkSessionId"),
122
122
  package: parseLinkedDeviceEd25519ExportRootPackageV1(record.package)
123
123
  };
124
124
  }
@@ -150,10 +150,6 @@ function parseUnixMs(value, label) {
150
150
  if (typeof value !== "number" || !Number.isSafeInteger(value) || value <= 0) throw new Error(`${label} must be a positive unix-millisecond timestamp`);
151
151
  return value;
152
152
  }
153
- function parseRequired(parsed, label) {
154
- if (!parsed.ok) throw new Error(`${label} ${parsed.error.message}`);
155
- return parsed.value;
156
- }
157
153
  //#endregion
158
154
  export { LINKED_DEVICE_ED25519_EXPORT_ROOT_TRANSFER_ALG_V1, linkedDeviceEd25519ExportRootMatchesRecipientV1, parseLinkedDeviceEd25519ExportRootPackageV1, parseLinkedDeviceEd25519ExportRootRecipientPublicKeyB64u, parseLinkedDeviceEd25519ExportRootRecipientV1, parseLinkedDeviceEd25519ExportRootSubmissionV1 };
159
155
 
@@ -5,7 +5,7 @@ import { parseDigestB64u } from "../utils/canonicalPrimitives.js";
5
5
  import { requireRecordCopy } from "../utils/validation.js";
6
6
  import { parseEd25519PublicKeyB64u, parseEnvelopeCiphertextB64u, parseSecp256k1CompressedPublicKeyB64u } from "../passkey-custody/primitives.js";
7
7
  import { routerAbMpcMaterialActivationRefFromWire } from "../utils/routerAbNormalSigningIdentity.js";
8
- import { parseRouterAbEd25519YaoActivationPublicReceiptV1, parseRouterAbEd25519YaoApplicationBindingFactsV1, parseRouterAbEd25519YaoCeremonyBindingV1, parseRouterAbEd25519YaoEncryptedPackageV1, parseRouterAbEd25519YaoParticipantIdsV1, parseRouterAbEd25519YaoRegistrationActivationAdmissionReceiptV1 } from "../utils/routerAbEd25519Yao.js";
8
+ import { parseRouterAbEd25519YaoActivationPublicReceiptV1, parseRouterAbEd25519YaoApplicationBindingFactsV1, parseRouterAbEd25519YaoCeremonyBindingV1, parseRouterAbEd25519YaoEncryptedPackageV1, parseRouterAbEd25519YaoParticipantIdsV1, parseRouterAbEd25519YaoRegistrationActivationAdmissionReceiptV1, sameRouterAbEd25519YaoByteSequence } from "../utils/routerAbEd25519Yao.js";
9
9
  import { parseSdkEcdsaDerivationThresholdKeyId } from "../threshold/ecdsaDerivationRoleLocalBootstrap.js";
10
10
  import { requireRouterAbEcdsaDerivationNormalSigningStateV1 } from "../utils/routerAbEcdsaDerivation.js";
11
11
  //#region ../shared-ts/src/device-linking/sourceContribution.ts
@@ -33,7 +33,7 @@ function parseLinkedDeviceEd25519SourcePreservingReservationV1(raw) {
33
33
  const participantIds = parseRouterAbEd25519YaoParticipantIdsV1(record.participant_ids);
34
34
  const deriverA = parseEd25519ClientPackage(record.deriver_a_client_package, "deriver_a");
35
35
  const deriverB = parseEd25519ClientPackage(record.deriver_b_client_package, "deriver_b");
36
- if (!sameBytes(activationReceipt.transcript, deriverA.transcript) || !sameBytes(activationReceipt.transcript, deriverB.transcript)) throw new Error("linked-device Ed25519 reservation packages have mismatched transcripts");
36
+ if (!sameRouterAbEd25519YaoByteSequence(activationReceipt.transcript, deriverA.transcript) || !sameRouterAbEd25519YaoByteSequence(activationReceipt.transcript, deriverB.transcript)) throw new Error("linked-device Ed25519 reservation packages have mismatched transcripts");
37
37
  return {
38
38
  state: "inactive",
39
39
  reservationId: requireText(record.reservation_id, "reservation_id"),
@@ -207,10 +207,10 @@ function parseEd25519Contribution(record) {
207
207
  if (!sameEdStableIdentity(sourceBinding, targetBinding)) throw new Error("linked-device Ed25519 source contribution stable identity differs");
208
208
  if (!mpcMaterialActivationRefsEqual(routerAbMpcMaterialActivationRefFromWire(activationReceipt.material_activation), targetMaterialActivation)) throw new Error("linked-device Ed25519 source contribution receipt activation differs");
209
209
  const sourceRegisteredPublicKeyB64u = parseEd25519PublicKeyB64u(record.sourceRegisteredPublicKeyB64u, "sourceRegisteredPublicKeyB64u");
210
- if (!sameBytes(activationReceipt.registered_public_key, Array.from(base64UrlDecode(sourceRegisteredPublicKeyB64u)))) throw new Error("linked-device Ed25519 source contribution receipt public key differs");
210
+ if (!sameRouterAbEd25519YaoByteSequence(activationReceipt.registered_public_key, Array.from(base64UrlDecode(sourceRegisteredPublicKeyB64u)))) throw new Error("linked-device Ed25519 source contribution receipt public key differs");
211
211
  const deriverA = parseEd25519ClientPackage(record.deriver_a_client_package, "deriver_a");
212
212
  const deriverB = parseEd25519ClientPackage(record.deriver_b_client_package, "deriver_b");
213
- if (!sameBytes(activationReceipt.transcript, deriverA.transcript) || !sameBytes(activationReceipt.transcript, deriverB.transcript)) throw new Error("linked-device Ed25519 source contribution package transcript differs");
213
+ if (!sameRouterAbEd25519YaoByteSequence(activationReceipt.transcript, deriverA.transcript) || !sameRouterAbEd25519YaoByteSequence(activationReceipt.transcript, deriverB.transcript)) throw new Error("linked-device Ed25519 source contribution package transcript differs");
214
214
  if (sourceBinding.material_activation.activation_id === targetMaterialActivation.activationId) throw new Error("linked-device Ed25519 source contribution reuses the source activation");
215
215
  return {
216
216
  kind: "linked_device_ed25519_source_contribution_v1",
@@ -537,9 +537,6 @@ function parseFixedBase64(raw, byteLength, label) {
537
537
  if (decoded.length !== byteLength || base64UrlEncode(decoded) !== raw) throw new Error(`${label} must decode to ${byteLength} bytes`);
538
538
  return raw;
539
539
  }
540
- function sameBytes(left, right) {
541
- return left.length === right.length && left.every((value, index) => value === right[index]);
542
- }
543
540
  function requireText(raw, label) {
544
541
  if (typeof raw !== "string" || raw.length === 0 || raw.trim() !== raw || [...raw].some((character) => {
545
542
  const code = character.charCodeAt(0);
@@ -555,6 +552,6 @@ function exactRecord(raw, keys, label) {
555
552
  return record;
556
553
  }
557
554
  //#endregion
558
- export { assertLinkedDeviceOrdinaryMaterialSourceContributionMatchesContextV1, parseLinkedDeviceEcdsaEncryptedSourceContributionV1, parseLinkedDeviceEcdsaSourceContributionBindingV1, parseLinkedDeviceEcdsaSourceContributionPackageV1, parseLinkedDeviceEcdsaSourceContributionPreparationV1, parseLinkedDeviceEcdsaSourceDerivationV1, parseLinkedDeviceEcdsaSourcePreservingActivationReceiptV1, parseLinkedDeviceEd25519SourcePreservingReservationV1, parseLinkedDeviceOrdinaryMaterialSourceContributionPreparationTupleV1, parseLinkedDeviceOrdinaryMaterialSourceContributionPreparationV1, parseLinkedDeviceOrdinaryMaterialSourceContributionTupleV1, parseLinkedDeviceOrdinaryMaterialSourceContributionV1 };
555
+ export { assertLinkedDeviceOrdinaryMaterialSourceContributionMatchesContextV1, parseLinkedDeviceEcdsaEncryptedSourceContributionV1, parseLinkedDeviceEcdsaSourceContributionBindingV1, parseLinkedDeviceEcdsaSourceContributionPackageV1, parseLinkedDeviceEcdsaSourceContributionPreparationV1, parseLinkedDeviceEcdsaSourceDerivationV1, parseLinkedDeviceEcdsaSourcePreservingActivationReceiptV1, parseLinkedDeviceEd25519SourcePreservingReservationV1, parseLinkedDeviceOrdinaryMaterialSourceContributionPreparationTupleV1, parseLinkedDeviceOrdinaryMaterialSourceContributionPreparationV1, parseLinkedDeviceOrdinaryMaterialSourceContributionTupleV1, parseLinkedDeviceOrdinaryMaterialSourceContributionV1, sameEcdsaSourceSigner, sameEcdsaTarget };
559
556
 
560
557
  //# sourceMappingURL=sourceContribution.js.map
@@ -13,6 +13,10 @@ function requireCanonicalBase64Url(value, label) {
13
13
  if (base64UrlEncode(decoded) !== value) throw new Error(`${label} must be canonical base64url`);
14
14
  return decoded;
15
15
  }
16
+ function requireParsed(result, label) {
17
+ if (result.ok) return result.value;
18
+ throw new Error(`${label} ${result.error.message}`);
19
+ }
16
20
  function parseDigestField(value, label) {
17
21
  try {
18
22
  return parseDigestB64u(value);
@@ -53,6 +57,6 @@ function parseUnixMs(value, label) {
53
57
  return value;
54
58
  }
55
59
  //#endregion
56
- export { parseDigestField, parseEd25519PublicKeyB64u, parseEnvelopeCiphertextB64u, parseEnvelopeNonceB64u, parseEnvelopeRevision, parseKeyCreationSignerSlot, parseSecp256k1CompressedPublicKeyB64u, parseUnixMs };
60
+ export { parseDigestField, parseEd25519PublicKeyB64u, parseEnvelopeCiphertextB64u, parseEnvelopeNonceB64u, parseEnvelopeRevision, parseKeyCreationSignerSlot, parseSecp256k1CompressedPublicKeyB64u, parseUnixMs, requireParsed };
57
61
 
58
62
  //# sourceMappingURL=primitives.js.map
@@ -3,7 +3,7 @@ import { base64UrlEncode } from "../utils/base64.js";
3
3
  import { sha256Bytes } from "../utils/digests.js";
4
4
  import { requireRecord } from "../utils/validation.js";
5
5
  import { rejectUnknownFields } from "../utils/exactRecord.js";
6
- import { parseDigestField } from "../passkey-custody/primitives.js";
6
+ import { parseDigestField, requireParsed } from "../passkey-custody/primitives.js";
7
7
  import { concat } from "../utils/digestEncoding.js";
8
8
  import { parseLaneParticipantBindingDigestB64u } from "./participants.js";
9
9
  import { encodeLaneCanonicalDigestV1, encodeLaneCanonicalTextV1, encodeLaneCanonicalU64V1 } from "./participantDigest.js";
@@ -17,10 +17,6 @@ const OWNER_LANE_PARTICIPANT_CONTINUITY_FIELDS = [
17
17
  "custodyKeyManifestDigestB64u",
18
18
  "sourceIdentityDigestB64u"
19
19
  ];
20
- function requireResult(result, label) {
21
- if (result.ok) return result.value;
22
- throw new Error(`${label} ${result.error.message}`);
23
- }
24
20
  /** Parse the owner signer identity without widening it into a generic string. */
25
21
  function parseWalletSignerId(raw, label = "walletSignerId") {
26
22
  if (typeof raw !== "string") throw new Error(`${label} must be a string`);
@@ -46,7 +42,7 @@ function buildOwnerLaneParticipantContinuityV1(args) {
46
42
  kind: "owner_lane_participant_continuity_v1",
47
43
  signerId: parseWalletSignerId(args.signerId),
48
44
  participantIds,
49
- signingWorkerId: requireResult(parseMpcSigningWorkerRef(args.signingWorkerId), "signingWorkerId"),
45
+ signingWorkerId: requireParsed(parseMpcSigningWorkerRef(args.signingWorkerId), "signingWorkerId"),
50
46
  custodyKeyManifestDigestB64u: parseDigestField(args.custodyKeyManifestDigestB64u, "custodyKeyManifestDigestB64u"),
51
47
  sourceIdentityDigestB64u: parseDigestField(args.sourceIdentityDigestB64u, "sourceIdentityDigestB64u")
52
48
  };
@@ -58,7 +54,7 @@ function parseOwnerLaneParticipantContinuityV1(raw, label = "ownerParticipantCon
58
54
  return buildOwnerLaneParticipantContinuityV1({
59
55
  signerId: parseWalletSignerId(record.signerId, `${label}.signerId`),
60
56
  participantIds: parseParticipantIds(record.participantIds, `${label}.participantIds`),
61
- signingWorkerId: requireResult(parseMpcSigningWorkerRef(record.signingWorkerId), `${label}.signingWorkerId`),
57
+ signingWorkerId: requireParsed(parseMpcSigningWorkerRef(record.signingWorkerId), `${label}.signingWorkerId`),
62
58
  custodyKeyManifestDigestB64u: parseDigestField(record.custodyKeyManifestDigestB64u, `${label}.custodyKeyManifestDigestB64u`),
63
59
  sourceIdentityDigestB64u: parseDigestField(record.sourceIdentityDigestB64u, `${label}.sourceIdentityDigestB64u`)
64
60
  });
@@ -76,7 +72,7 @@ function ownerLaneParticipantContinuityCanonicalBytesV1(input) {
76
72
  ]);
77
73
  }
78
74
  async function computeOwnerLaneParticipantBindingDigestV1(input) {
79
- return requireResult(parseLaneParticipantBindingDigestB64u(base64UrlEncode(await sha256Bytes(ownerLaneParticipantContinuityCanonicalBytesV1(input)))), "owner participant digest");
75
+ return requireParsed(parseLaneParticipantBindingDigestB64u(base64UrlEncode(await sha256Bytes(ownerLaneParticipantContinuityCanonicalBytesV1(input)))), "owner participant digest");
80
76
  }
81
77
  //#endregion
82
78
  export { buildOwnerLaneParticipantContinuityV1, computeOwnerLaneParticipantBindingDigestV1, ownerLaneParticipantContinuityCanonicalBytesV1, parseOwnerLaneParticipantContinuityV1, parseWalletSignerId };
@@ -0,0 +1,12 @@
1
+ //#region ../shared-ts/src/tenant-root/tenantRootIdentifier.ts
2
+ function hasControlCharacters(value) {
3
+ for (const character of value) {
4
+ const codePoint = character.codePointAt(0) ?? 0;
5
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) return true;
6
+ }
7
+ return false;
8
+ }
9
+ //#endregion
10
+ export { hasControlCharacters };
11
+
12
+ //# sourceMappingURL=tenantRootIdentifier.js.map
@@ -1,6 +1,6 @@
1
+ import { hasControlCharacters } from "./tenantRootIdentifier.js";
1
2
  //#region ../shared-ts/src/tenant-root/tenantRootIdentity.ts
2
3
  const TENANT_ROOT_IDENTITY_DOMAIN_V1 = new TextEncoder().encode("seams/tenant-root-identity/v1");
3
- const TENANT_ROOT_IDENTITY_MAX_IDENTIFIER_BYTES_V1 = 256;
4
4
  /**
5
5
  * The identity proof is only emitted by the authenticated builder or exact
6
6
  * wire decoder. Its private method makes raw object literals structurally
@@ -49,13 +49,6 @@ function hasLeadingOrTrailingRustWhitespace(value) {
49
49
  const codePoints = Array.from(value, (character) => character.codePointAt(0) ?? 0);
50
50
  return codePoints.length > 0 && (isRustWhitespace(codePoints[0]) || isRustWhitespace(codePoints[codePoints.length - 1]));
51
51
  }
52
- function hasControlCharacters(value) {
53
- for (const character of value) {
54
- const codePoint = character.codePointAt(0) ?? 0;
55
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) return true;
56
- }
57
- return false;
58
- }
59
52
  function hasUnpairedSurrogate(value) {
60
53
  for (let index = 0; index < value.length; index += 1) {
61
54
  const codeUnit = value.charCodeAt(index);
@@ -73,7 +66,7 @@ function isCanonicalTenantRootIdentityField(value) {
73
66
  if (typeof value !== "string" || value.length === 0) return false;
74
67
  if (hasLeadingOrTrailingRustWhitespace(value) || hasControlCharacters(value)) return false;
75
68
  if (hasUnpairedSurrogate(value)) return false;
76
- return new TextEncoder().encode(value).length <= TENANT_ROOT_IDENTITY_MAX_IDENTIFIER_BYTES_V1;
69
+ return new TextEncoder().encode(value).length <= 256;
77
70
  }
78
71
  /** Checks one already-resolved field without normalizing it. */
79
72
  function isTenantRootIdentityFieldCanonicalV1(field, value) {
@@ -1,5 +1,6 @@
1
1
  import { base64UrlDecode, base64UrlEncode } from "../utils/base64.js";
2
2
  import { alphabetizeStringify, sha256Bytes } from "../utils/digests.js";
3
+ import { hasExactKeys } from "../utils/exactKeys.js";
3
4
  import { isTenantRootIdentityFieldCanonicalV1 } from "./tenantRootIdentity.js";
4
5
  //#region ../shared-ts/src/tenant-root/tenantRootOperationRecord.ts
5
6
  /**
@@ -126,10 +127,6 @@ const RESTORE_ROLE_IMPORT_KEY_RECORD_KEYS_V1 = [
126
127
  "subject",
127
128
  "tenantRootIdentityDigest"
128
129
  ];
129
- function hasExactKeys(record, keys) {
130
- const actual = Object.keys(record);
131
- return actual.length === keys.length && keys.every((key) => actual.includes(key));
132
- }
133
130
  function parseRestoreRoleImportKeyIssueRecord(raw) {
134
131
  if (!hasExactKeys(raw, RESTORE_ROLE_IMPORT_KEY_RECORD_KEYS_V1)) return null;
135
132
  if (raw.formatVersion !== TENANT_ROOT_OPERATION_RECORD_FORMAT_V1) return null;
@@ -1,10 +1,8 @@
1
1
  import { base64UrlEncode } from "./base64.js";
2
2
  import { alphabetizeStringify, sha256BytesUtf8 } from "./digests.js";
3
3
  import "./encoders.js";
4
+ import { thresholdEcdsaChainTargetKey } from "./thresholdEcdsaChainTarget.js";
4
5
  //#region ../shared-ts/src/utils/ecdsaKeyFactsInventory.ts
5
- function chainTargetKey(target) {
6
- return target.kind === "evm" ? `evm:eip155:${target.chainId}` : `tempo:${target.chainId}`;
7
- }
8
6
  function normalizeChainTarget(target) {
9
7
  if (target.kind === "evm") return {
10
8
  kind: "evm",
@@ -22,7 +20,7 @@ function canonicalizeWalletEcdsaKeyFactsInventoryChallenge(input) {
22
20
  const keyTargets = input.keyTargets.map((target) => ({
23
21
  keyHandle: target.keyHandle,
24
22
  chainTarget: normalizeChainTarget(target.chainTarget),
25
- targetKey: chainTargetKey(target.chainTarget)
23
+ targetKey: thresholdEcdsaChainTargetKey(target.chainTarget)
26
24
  })).sort((left, right) => {
27
25
  const leftKey = `${left.keyHandle}:${left.targetKey}`;
28
26
  const rightKey = `${right.keyHandle}:${right.targetKey}`;
@@ -5,7 +5,6 @@ const ECDSA_TIMING_METRICS = new Set([
5
5
  "ecdsa_sign_proxy",
6
6
  "ecdsa_sign_complete",
7
7
  "ecdsa_sign_total",
8
- "ecdsa_presign_queue",
9
8
  "ecdsa_presign_authenticate",
10
9
  "ecdsa_presign_material",
11
10
  "ecdsa_presign_admit",
@@ -6,6 +6,8 @@ function emailOtpDeviceEnrollmentId(walletId, providerSubject) {
6
6
  if (!normalizedWalletId || !normalizedProviderSubject) throw new Error("Email OTP enrollment identity requires wallet and provider subject");
7
7
  return `email-otp-device-enrollment-v1:${normalizedWalletId}:${normalizedProviderSubject}`;
8
8
  }
9
+ /** Domain label that opens the AAD binding a released Email OTP factor to its challenge. */
10
+ const EMAIL_OTP_FACTOR_RELEASE_AAD_DOMAIN_V1 = "seams/email-otp/factor-release/v1";
9
11
  const WALLET_UNLOCK_BACKENDS = ["passkey", EMAIL_OTP_CHANNEL];
10
12
  const WALLET_EMAIL_OTP_LOGIN_OPERATIONS = [
11
13
  "wallet_unlock",
@@ -33,6 +35,6 @@ function isWalletEmailOtpLoginOperation(value) {
33
35
  return WALLET_EMAIL_OTP_LOGIN_OPERATIONS.includes(value);
34
36
  }
35
37
  //#endregion
36
- export { EMAIL_OTP_CHANNEL, WALLET_EMAIL_OTP_ACTIONS, WALLET_EMAIL_OTP_DEVICE_LINK_OPERATION, WALLET_EMAIL_OTP_EXPORT_OPERATION, WALLET_EMAIL_OTP_REGISTRATION_OPERATION, WALLET_EMAIL_OTP_TRANSACTION_SIGN_OPERATION, WALLET_EMAIL_OTP_UNLOCK_OPERATION, emailOtpDeviceEnrollmentId, isWalletEmailOtpLoginOperation, isWalletUnlockBackend };
38
+ export { EMAIL_OTP_CHANNEL, EMAIL_OTP_FACTOR_RELEASE_AAD_DOMAIN_V1, WALLET_EMAIL_OTP_ACTIONS, WALLET_EMAIL_OTP_DEVICE_LINK_OPERATION, WALLET_EMAIL_OTP_EXPORT_OPERATION, WALLET_EMAIL_OTP_REGISTRATION_OPERATION, WALLET_EMAIL_OTP_TRANSACTION_SIGN_OPERATION, WALLET_EMAIL_OTP_UNLOCK_OPERATION, emailOtpDeviceEnrollmentId, isWalletEmailOtpLoginOperation, isWalletUnlockBackend };
37
39
 
38
40
  //# sourceMappingURL=emailOtpDomain.js.map
@@ -0,0 +1,17 @@
1
+ //#region ../shared-ts/src/utils/exactKeys.ts
2
+ /**
3
+ * True when `value` is a non-array object whose own enumerable string keys are exactly `keys`.
4
+ *
5
+ * A key whose value is `undefined` still counts as present. Symbol, non-enumerable and inherited
6
+ * keys are not counted, and the prototype is not checked. A list that repeats a key never matches.
7
+ * Kept apart from validation.ts, which the wallet iframe's boot path loads.
8
+ */
9
+ function hasExactKeys(value, keys) {
10
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
11
+ const actual = Object.keys(value);
12
+ return actual.length === keys.length && actual.every((key) => keys.includes(key));
13
+ }
14
+ //#endregion
15
+ export { hasExactKeys };
16
+
17
+ //# sourceMappingURL=exactKeys.js.map
@@ -0,0 +1,20 @@
1
+ //#region ../shared-ts/src/utils/failure.ts
2
+ function failure(code, message) {
3
+ return {
4
+ ok: false,
5
+ code,
6
+ message
7
+ };
8
+ }
9
+ function failedVerification(code, message) {
10
+ return {
11
+ ok: false,
12
+ verified: false,
13
+ code,
14
+ message
15
+ };
16
+ }
17
+ //#endregion
18
+ export { failedVerification, failure };
19
+
20
+ //# sourceMappingURL=failure.js.map
@@ -14,23 +14,14 @@ function addAuthMethodIntentGrantFromString(value) {
14
14
  function addSignerIntentGrantFromString(value) {
15
15
  return String(value || "").trim();
16
16
  }
17
- function serializeRegistrationIntentV1(intent) {
18
- return alphabetizeStringify(intent);
19
- }
20
- function serializeAddSignerIntentV1(intent) {
21
- return alphabetizeStringify(intent);
22
- }
23
- function serializeAddAuthMethodIntentV1(intent) {
24
- return alphabetizeStringify(intent);
25
- }
26
17
  async function computeRegistrationIntentDigestB64u(intent) {
27
- return base64UrlEncode(await sha256BytesUtf8(serializeRegistrationIntentV1(intent)));
18
+ return base64UrlEncode(await sha256BytesUtf8(alphabetizeStringify(intent)));
28
19
  }
29
20
  async function computeAddSignerIntentDigestB64u(intent) {
30
- return base64UrlEncode(await sha256BytesUtf8(serializeAddSignerIntentV1(intent)));
21
+ return base64UrlEncode(await sha256BytesUtf8(alphabetizeStringify(intent)));
31
22
  }
32
23
  async function computeAddAuthMethodIntentDigestB64u(intent) {
33
- return base64UrlEncode(await sha256BytesUtf8(serializeAddAuthMethodIntentV1(intent)));
24
+ return base64UrlEncode(await sha256BytesUtf8(alphabetizeStringify(intent)));
34
25
  }
35
26
  function normalizeAddAuthMethodIntentCaller(raw) {
36
27
  const record = inspectRawObject(raw);
@@ -62,11 +62,8 @@ function registrationSignerBranchKeyFromString(value) {
62
62
  function registrationNearEd25519BranchKey(signerSlot) {
63
63
  return registrationSignerBranchKeyFromString(`near_ed25519:slot:${signerSlot}`);
64
64
  }
65
- function registrationEvmFamilyEcdsaTargetKey(target) {
66
- return alphabetizeStringify(target);
67
- }
68
65
  function registrationEvmFamilyEcdsaBranchKey(chainTargets) {
69
- return registrationSignerBranchKeyFromString(`evm_family_ecdsa:${chainTargets.map(registrationEvmFamilyEcdsaTargetKey).join("|")}`);
66
+ return registrationSignerBranchKeyFromString(`evm_family_ecdsa:${chainTargets.map(alphabetizeStringify).join("|")}`);
70
67
  }
71
68
  function registrationSignerPlanFromRequests(signers) {
72
69
  return registrationSignerPlanFromBranches(signers.map(registrationSignerPlanBranchFromRequest));
@@ -150,7 +147,7 @@ function findDuplicateRegistrationSignerBranch(branch, branchKeys) {
150
147
  }
151
148
  function findDuplicateRegistrationEcdsaTarget(branch, ecdsaTargetKeys) {
152
149
  for (const target of branch.chainTargets) {
153
- const targetKey = registrationEvmFamilyEcdsaTargetKey(target);
150
+ const targetKey = alphabetizeStringify(target);
154
151
  if (ecdsaTargetKeys.has(targetKey)) return {
155
152
  ok: false,
156
153
  code: "invalid_body",
@@ -1560,6 +1560,6 @@ function parseRouterAbEcdsaDerivationEvmDigestSigningFinalizeRequestV1(value) {
1560
1560
  return parseRouterAbEcdsaDerivationEvmDigestSigningFinalizeCoreRequestFields(record);
1561
1561
  }
1562
1562
  //#endregion
1563
- export { ROUTER_AB_ECDSA_DERIVATION_EXPORT_PATH, ROUTER_AB_ECDSA_DERIVATION_HEALTH_PATH, ROUTER_AB_ECDSA_DERIVATION_NORMAL_SIGNING_PATH, ROUTER_AB_ECDSA_DERIVATION_NORMAL_SIGNING_PREPARE_PATH, ROUTER_AB_ECDSA_DERIVATION_NORMAL_SIGNING_STATE_KIND_V1, ROUTER_AB_ECDSA_DERIVATION_OPERATION_STEP_UP_PATH, ROUTER_AB_ECDSA_DERIVATION_PRESIGNATURE_POOL_FILL_INIT_PATH, ROUTER_AB_ECDSA_DERIVATION_PRESIGNATURE_POOL_FILL_STEP_PATH, ROUTER_AB_ECDSA_DERIVATION_REFRESH_PATH, ROUTER_AB_ECDSA_DERIVATION_SESSION_ACTIVATION_PATH, ROUTER_AB_ECDSA_PRESIGN_CEREMONY_MAX_LIFETIME_MS, buildRouterAbEcdsaDerivationActiveStateIdV1, buildRouterAbEcdsaDerivationPublicCapabilityV1, computeRouterAbEcdsaOperationStepUpChallengeB64u, parseRouterAbEcdsaCredentialFreeSessionActivationResponseV1, parseRouterAbEcdsaDerivationActivationRefreshCommitRequestV1, parseRouterAbEcdsaDerivationActivationRefreshRequestV1, parseRouterAbEcdsaDerivationActivationRefreshResponseV1, parseRouterAbEcdsaDerivationEvmDigestSigningFinalizeRequestV1, parseRouterAbEcdsaDerivationEvmDigestSigningRequestV1, parseRouterAbEcdsaDerivationExplicitExportRequestV1, parseRouterAbEcdsaDerivationNormalSigningScopeV1, parseRouterAbEcdsaDerivationNormalSigningStateV1, parseRouterAbEcdsaDerivationPublicCapabilityV1, parseRouterAbEcdsaExplicitExportProtocolForwardedResponseV1, parseRouterAbEcdsaOperationStepUpAuthorizationRequestV1, parseRouterAbEcdsaOperationStepUpPreparationV1, parseRouterAbEcdsaPostRegistrationSessionActivationPolicyV1, parseRouterAbEcdsaPostRegistrationSessionActivationRequestV1, parseRouterAbEcdsaPostRegistrationSessionActivationResponseV1, parseRouterAbEcdsaPrepareSourceV1, parseRouterAbEcdsaRegistrationActivationReceiptV1, parseRouterAbEcdsaRegistrationActivationRequestV1, parseRouterAbEcdsaRegistrationRequestFactsV1, parseRouterAbEcdsaRegistrationRequestV1, parseRouterAbEcdsaSigningWorkerProtocolExportShareEnvelopeV1, parseRouterAbEcdsaStrictForwardedRegistrationResponseV1, parseRouterAbEcdsaVerifiedClientActivationFactsV1, projectRouterAbEcdsaDerivationExplicitExportRequestToProtocolV1, requireRouterAbEcdsaDerivationNormalSigningStateV1, routerAbEcdsaDerivationActiveStateId, routerAbEcdsaDerivationEvmDigestSigningFinalizeCoreRequestDigestV1, routerAbEcdsaDerivationEvmDigestSigningRequestDigestV1, sameRouterAbEcdsaDerivationNormalSigningScopeV1, sameRouterAbEcdsaDerivationNormalSigningStateV1, sameRouterAbEcdsaDerivationPublicCapabilityV1, sameRouterAbEcdsaDerivationPublicIdentityV1, sameRouterAbEcdsaRegistrationActivationReceiptV1, sameRouterAbEcdsaRegistrationRequestFactsV1, sameRouterAbEcdsaVerifiedClientActivationFactsV1, sameRouterAbPublicDigest32V1Wire, sameRouterAbServerIdentityV1 };
1563
+ export { ROUTER_AB_ECDSA_DERIVATION_EXPORT_PATH, ROUTER_AB_ECDSA_DERIVATION_HEALTH_PATH, ROUTER_AB_ECDSA_DERIVATION_NORMAL_SIGNING_PATH, ROUTER_AB_ECDSA_DERIVATION_NORMAL_SIGNING_PREPARE_PATH, ROUTER_AB_ECDSA_DERIVATION_NORMAL_SIGNING_STATE_KIND_V1, ROUTER_AB_ECDSA_DERIVATION_OPERATION_STEP_UP_PATH, ROUTER_AB_ECDSA_DERIVATION_PRESIGNATURE_POOL_FILL_INIT_PATH, ROUTER_AB_ECDSA_DERIVATION_PRESIGNATURE_POOL_FILL_STEP_PATH, ROUTER_AB_ECDSA_DERIVATION_REFRESH_PATH, ROUTER_AB_ECDSA_DERIVATION_SESSION_ACTIVATION_PATH, ROUTER_AB_ECDSA_PRESIGN_CEREMONY_MAX_LIFETIME_MS, buildRouterAbEcdsaDerivationActiveStateIdV1, buildRouterAbEcdsaDerivationPublicCapabilityV1, computeRouterAbEcdsaOperationStepUpChallengeB64u, parseRouterAbEcdsaCredentialFreeSessionActivationResponseV1, parseRouterAbEcdsaDerivationActivationRefreshCommitRequestV1, parseRouterAbEcdsaDerivationActivationRefreshRequestV1, parseRouterAbEcdsaDerivationActivationRefreshResponseV1, parseRouterAbEcdsaDerivationEvmDigestSigningFinalizeRequestV1, parseRouterAbEcdsaDerivationEvmDigestSigningRequestV1, parseRouterAbEcdsaDerivationExplicitExportRequestV1, parseRouterAbEcdsaDerivationNormalSigningScopeV1, parseRouterAbEcdsaDerivationNormalSigningStateV1, parseRouterAbEcdsaDerivationPublicCapabilityV1, parseRouterAbEcdsaExplicitExportProtocolForwardedResponseV1, parseRouterAbEcdsaOperationStepUpAuthorizationRequestV1, parseRouterAbEcdsaOperationStepUpPreparationV1, parseRouterAbEcdsaPostRegistrationSessionActivationPolicyV1, parseRouterAbEcdsaPostRegistrationSessionActivationRequestV1, parseRouterAbEcdsaPostRegistrationSessionActivationResponseV1, parseRouterAbEcdsaPrepareSourceV1, parseRouterAbEcdsaRegistrationActivationReceiptV1, parseRouterAbEcdsaRegistrationActivationRequestV1, parseRouterAbEcdsaRegistrationRequestFactsV1, parseRouterAbEcdsaRegistrationRequestV1, parseRouterAbEcdsaSigningWorkerProtocolExportShareEnvelopeV1, parseRouterAbEcdsaStrictForwardedRegistrationResponseV1, parseRouterAbEcdsaVerifiedClientActivationFactsV1, projectRouterAbEcdsaDerivationExplicitExportRequestToProtocolV1, requireRouterAbEcdsaDerivationNormalSigningStateV1, routerAbEcdsaDerivationActiveStateId, routerAbEcdsaDerivationEvmDigestSigningFinalizeCoreRequestDigestV1, routerAbEcdsaDerivationEvmDigestSigningRequestDigestV1, sameRegistrationSignerSet, sameRouterAbEcdsaDerivationNormalSigningScopeV1, sameRouterAbEcdsaDerivationNormalSigningStateV1, sameRouterAbEcdsaDerivationPublicCapabilityV1, sameRouterAbEcdsaDerivationPublicIdentityV1, sameRouterAbEcdsaRegistrationActivationReceiptV1, sameRouterAbEcdsaRegistrationRequestFactsV1, sameRouterAbEcdsaVerifiedClientActivationFactsV1, sameRouterAbPublicDigest32V1Wire, sameRouterAbServerIdentityV1 };
1564
1564
 
1565
1565
  //# sourceMappingURL=routerAbEcdsaDerivation.js.map
@@ -819,6 +819,6 @@ function parseEncryptedPackageValue(value) {
819
819
  return parseEncryptedPackage(value, "encrypted_package");
820
820
  }
821
821
  //#endregion
822
- export { ROUTER_AB_ED25519_YAO_EMAIL_OTP_RECOVERY_BOOTSTRAP_KIND_V1, ROUTER_AB_ED25519_YAO_EXPORT_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_EXPORT_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_ACTIVATE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_CHALLENGE_ID_HEADER_V1, ROUTER_AB_ED25519_YAO_RECOVERY_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_STATUS_PATH_V1, ROUTER_AB_ED25519_YAO_REGISTRATION_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_REGISTRATION_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_WARM_RECOVERY_BOOTSTRAP_PATH_V1, parseRouterAbEd25519YaoActivationKeysetV1, parseRouterAbEd25519YaoActivationPublicReceiptV1, parseRouterAbEd25519YaoActivationResultV1, parseRouterAbEd25519YaoApplicationBindingFactsV1, parseRouterAbEd25519YaoCeremonyBindingV1, parseRouterAbEd25519YaoEncryptedPackageV1, parseRouterAbEd25519YaoExportAdmissionReceiptV1, parseRouterAbEd25519YaoExportAdmissionRequestV1, parseRouterAbEd25519YaoExportExecuteRequestV1, parseRouterAbEd25519YaoExportResultV1, parseRouterAbEd25519YaoParticipantIdsV1, parseRouterAbEd25519YaoRecoveryActivationAdmissionReceiptV1, parseRouterAbEd25519YaoRecoveryActivationExecuteRequestV1, parseRouterAbEd25519YaoRecoveryActivationReceiptV1, parseRouterAbEd25519YaoRecoveryActivationRequestV1, parseRouterAbEd25519YaoRecoveryActivationResultV1, parseRouterAbEd25519YaoRecoveryAdmissionRequestV1, parseRouterAbEd25519YaoRecoveryStatusRequestV1, parseRouterAbEd25519YaoRegistrationActivationAdmissionReceiptV1, parseRouterAbEd25519YaoRegistrationActivationExecuteRequestV1, parseRouterAbEd25519YaoRegistrationActivationResultV1, parseRouterAbEd25519YaoRegistrationAdmissionRequestV1, parseRouterAbEd25519YaoWarmRecoveryBootstrapRequestV1, sameRouterAbEd25519YaoActivationBindingV1, sameRouterAbEd25519YaoActivationPublicReceiptV1, sameRouterAbEd25519YaoRecoveryAdmissionRequestV1, sameRouterAbEd25519YaoRegistrationAdmissionRequestV1 };
822
+ export { ROUTER_AB_ED25519_YAO_EMAIL_OTP_RECOVERY_BOOTSTRAP_KIND_V1, ROUTER_AB_ED25519_YAO_EXPORT_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_EXPORT_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_ACTIVATE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_CHALLENGE_ID_HEADER_V1, ROUTER_AB_ED25519_YAO_RECOVERY_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_STATUS_PATH_V1, ROUTER_AB_ED25519_YAO_REGISTRATION_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_REGISTRATION_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_WARM_RECOVERY_BOOTSTRAP_PATH_V1, parseRouterAbEd25519YaoActivationKeysetV1, parseRouterAbEd25519YaoActivationPublicReceiptV1, parseRouterAbEd25519YaoActivationResultV1, parseRouterAbEd25519YaoApplicationBindingFactsV1, parseRouterAbEd25519YaoCeremonyBindingV1, parseRouterAbEd25519YaoEncryptedPackageV1, parseRouterAbEd25519YaoExportAdmissionReceiptV1, parseRouterAbEd25519YaoExportAdmissionRequestV1, parseRouterAbEd25519YaoExportExecuteRequestV1, parseRouterAbEd25519YaoExportResultV1, parseRouterAbEd25519YaoParticipantIdsV1, parseRouterAbEd25519YaoRecoveryActivationAdmissionReceiptV1, parseRouterAbEd25519YaoRecoveryActivationExecuteRequestV1, parseRouterAbEd25519YaoRecoveryActivationReceiptV1, parseRouterAbEd25519YaoRecoveryActivationRequestV1, parseRouterAbEd25519YaoRecoveryActivationResultV1, parseRouterAbEd25519YaoRecoveryAdmissionRequestV1, parseRouterAbEd25519YaoRecoveryStatusRequestV1, parseRouterAbEd25519YaoRegistrationActivationAdmissionReceiptV1, parseRouterAbEd25519YaoRegistrationActivationExecuteRequestV1, parseRouterAbEd25519YaoRegistrationActivationResultV1, parseRouterAbEd25519YaoRegistrationAdmissionRequestV1, parseRouterAbEd25519YaoWarmRecoveryBootstrapRequestV1, sameRouterAbEd25519YaoActivationBindingV1, sameRouterAbEd25519YaoActivationPublicReceiptV1, sameRouterAbEd25519YaoByteSequence, sameRouterAbEd25519YaoRecoveryAdmissionRequestV1, sameRouterAbEd25519YaoRegistrationAdmissionRequestV1 };
823
823
 
824
824
  //# sourceMappingURL=routerAbEd25519Yao.js.map
@@ -0,0 +1,9 @@
1
+ //#region ../shared-ts/src/utils/thresholdEcdsaChainTarget.ts
2
+ function thresholdEcdsaChainTargetKey(target) {
3
+ if (target.kind === "evm") return `evm:eip155:${target.chainId}`;
4
+ return `tempo:${target.chainId}`;
5
+ }
6
+ //#endregion
7
+ export { thresholdEcdsaChainTargetKey };
8
+
9
+ //# sourceMappingURL=thresholdEcdsaChainTarget.js.map
@@ -45,7 +45,7 @@ function buildGoogleEmailOtpProjection(input) {
45
45
  providerSubject: input.providerSubject,
46
46
  emailHashHex: requireEmailHash(input.emailHashHex),
47
47
  registrationAuthorityId: requireTrimmedString(input.registrationAuthorityId, "registrationAuthorityId", "is invalid"),
48
- enrollment: buildEnrollmentReference(input.enrollment)
48
+ enrollment: parseEnrollmentReference(input.enrollment)
49
49
  }
50
50
  };
51
51
  assertProjectionShape(projection);
@@ -60,9 +60,6 @@ function parseEnrollmentReference(raw) {
60
60
  enrollmentSealKeyVersion: requireTrimmedString(record.enrollmentSealKeyVersion, "enrollment.enrollmentSealKeyVersion", "is invalid")
61
61
  };
62
62
  }
63
- function buildEnrollmentReference(value) {
64
- return parseEnrollmentReference(value);
65
- }
66
63
  function assertProjectionShape(projection) {
67
64
  if (projection.authority.walletId !== projection.walletId || projection.authority.authorityId !== projection.targetAuthorityId || projection.authority.principal.deviceId !== projection.targetDeviceId || projection.authority.provenance.kind !== "wallet_recovery" || projection.authority.provenance.recoveryOperationId !== projection.recoveryOperationId || projection.authority.provenance.continuityAuthorityId === projection.targetAuthorityId || projection.authMethod.walletId !== projection.walletId || projection.authMethod.walletAuthorityId !== projection.targetAuthorityId || projection.authMethod.walletAuthMethodId !== projection.targetWalletAuthMethodId || projection.authMethod.status !== "active") throw new Error("wallet recovery committed projection relations are invalid");
68
65
  if (projection.kind === "passkey") {
@@ -1,33 +1,18 @@
1
1
  import { normalizeOptionalTrimmedString } from "../../../../shared-ts/src/utils/normalize.js";
2
2
  import "../../../../shared-ts/src/utils/validation.js";
3
3
  import { SIGNING_SESSION_SEAL_ALG, SIGNING_SESSION_SEAL_GROUP_ID, encodeSigningSessionHkdfTuple } from "../../../../shared-ts/src/utils/signingSessionSeal.js";
4
+ import { failure } from "../../../../shared-ts/src/utils/failure.js";
4
5
  import { parseSigningSessionSealKeyVersion } from "../../../../shared-ts/src/threshold/keyMaterialBrands.js";
5
6
  import { addSigningSessionSealLock, deriveSigningSessionSealLockKeyHandle, destroySigningSessionSealLockKeyHandle, removeSigningSessionSealLock } from "./shamir3PassWasm.js";
6
7
  //#region src/threshold/session/signingSessionSeal/crypto/cipher.ts
7
8
  function toErrorResult(error) {
8
- if (error && typeof error === "object" && !Array.isArray(error) && error.code) return {
9
- ok: false,
10
- code: String(error.code || "").trim() || "internal",
11
- message: String(error.message || "").trim() || "Signing-session seal cipher failed"
12
- };
13
- return {
14
- ok: false,
15
- code: "internal",
16
- message: error instanceof Error ? error.message : String(error || "Signing-session seal cipher failed")
17
- };
9
+ if (error && typeof error === "object" && !Array.isArray(error) && error.code) return failure(String(error.code || "").trim() || "internal", String(error.message || "").trim() || "Signing-session seal cipher failed");
10
+ return failure("internal", error instanceof Error ? error.message : String(error || "Signing-session seal cipher failed"));
18
11
  }
19
12
  function normalizeResult(result) {
20
- if (!result.ok) return {
21
- ok: false,
22
- code: String(result.code || "internal").trim() || "internal",
23
- message: String(result.message || "Signing-session seal cipher failed").trim() || "Signing-session seal cipher failed"
24
- };
13
+ if (!result.ok) return failure(String(result.code || "internal").trim() || "internal", String(result.message || "Signing-session seal cipher failed").trim() || "Signing-session seal cipher failed");
25
14
  const ciphertext = normalizeOptionalTrimmedString(result.ciphertext);
26
- if (!ciphertext) return {
27
- ok: false,
28
- code: "invalid_ciphertext",
29
- message: "Signing-session seal cipher returned empty ciphertext"
30
- };
15
+ if (!ciphertext) return failure("invalid_ciphertext", "Signing-session seal cipher returned empty ciphertext");
31
16
  return {
32
17
  ok: true,
33
18
  ciphertext,
@@ -141,19 +126,12 @@ var SigningSessionSealKeyHandles = class {
141
126
  return this.initialization;
142
127
  }
143
128
  };
144
- function cipherFailure(code, message) {
145
- return {
146
- ok: false,
147
- code,
148
- message
149
- };
150
- }
151
129
  function mapCipherError(error, defaultMessage) {
152
130
  const message = normalizeOptionalTrimmedString(error instanceof Error ? error.message : error) || defaultMessage;
153
131
  const lowered = message.toLowerCase();
154
- if (lowered.includes("keyversion")) return cipherFailure("invalid_key_version", message);
155
- if (lowered.includes("ciphertext") || lowered.includes("base64url") || lowered.includes("group")) return cipherFailure("invalid_ciphertext", message);
156
- return cipherFailure("internal", message);
132
+ if (lowered.includes("keyversion")) return failure("invalid_key_version", message);
133
+ if (lowered.includes("ciphertext") || lowered.includes("base64url") || lowered.includes("group")) return failure("invalid_ciphertext", message);
134
+ return failure("internal", message);
157
135
  }
158
136
  function createSigningSessionSealShamir3PassCipherAdapter(options) {
159
137
  const config = normalizeConfig(options.config);
@@ -163,7 +141,7 @@ function createSigningSessionSealShamir3PassCipherAdapter(options) {
163
141
  return createSigningSessionSealCipherAdapter({
164
142
  applyServerSeal: async (input) => {
165
143
  const requestedKeyVersion = normalizeOptionalTrimmedString(input.keyVersion);
166
- if (requestedKeyVersion && requestedKeyVersion !== config.currentKeyVersion) return cipherFailure("invalid_key_version", `Requested keyVersion "${requestedKeyVersion}" does not match active keyVersion "${config.currentKeyVersion}"`);
144
+ if (requestedKeyVersion && requestedKeyVersion !== config.currentKeyVersion) return failure("invalid_key_version", `Requested keyVersion "${requestedKeyVersion}" does not match active keyVersion "${config.currentKeyVersion}"`);
167
145
  try {
168
146
  const handle = (await handles.get()).get(config.currentKeyVersion);
169
147
  if (handle === void 0) throw new Error("currentKeyVersion handle is unavailable");
@@ -183,7 +161,7 @@ function createSigningSessionSealShamir3PassCipherAdapter(options) {
183
161
  const keyVersion = normalizeKeyVersion(input.keyVersion, "keyVersion");
184
162
  try {
185
163
  const handle = (await handles.get()).get(keyVersion);
186
- if (handle === void 0) return cipherFailure("invalid_key_version", `Unknown keyVersion "${keyVersion}"`);
164
+ if (handle === void 0) return failure("invalid_key_version", `Unknown keyVersion "${keyVersion}"`);
187
165
  return {
188
166
  ok: true,
189
167
  ciphertext: await runtime.removeLock({