@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
@@ -2,6 +2,7 @@ import type { PasskeyEnvelopeId, WalletAuthMethodId, WalletId, WebAuthnCredentia
2
2
  import type { DigestB64u } from '../utils/canonicalPrimitives';
3
3
  import type { PasskeyCustodySecretBinding } from './custodySecretBinding';
4
4
  import type { EnvelopeCiphertextB64u, EnvelopeNonceB64u, EnvelopeRevision } from './primitives';
5
+ import type { ExclusiveUnion } from '../utils/variant';
5
6
  export declare const WALLET_CUSTODY_ENVELOPE_VERSION_V2: "wallet_custody_envelope_v2";
6
7
  declare const PASSKEY_PRF_KEK_VERSION_V1: "passkey_prf_kek_hkdf_sha256_v1";
7
8
  declare const EMAIL_OTP_FACTOR_KEK_VERSION_V1: "email_otp_factor_kek_hkdf_sha256_v1";
@@ -34,37 +35,29 @@ export type WalletCustodyEnvelopeOwnership = {
34
35
  readonly kind: 'method_bound';
35
36
  readonly walletAuthMethodId: WalletAuthMethodId;
36
37
  };
37
- export type WalletCustodyEnvelopeFactor = {
38
+ export type WalletCustodyEnvelopeFactor = ExclusiveUnion<{
38
39
  kind: 'passkey';
39
40
  rpId: WebAuthnRpId;
40
41
  credentialIdB64u: WebAuthnCredentialIdB64u;
41
42
  kekVersion: PasskeyPrfKekVersion;
42
- enrollmentId?: never;
43
- enrollmentSealKeyVersion?: never;
44
43
  } | {
45
44
  kind: 'email_otp';
46
45
  enrollmentId: string;
47
46
  enrollmentSealKeyVersion: string;
48
47
  kekVersion: EmailOtpFactorKekVersion;
49
- rpId?: never;
50
- credentialIdB64u?: never;
51
- };
52
- export type PasskeyCustodyEnvelopeLifecycle = {
48
+ }>;
49
+ export type PasskeyCustodyEnvelopeLifecycle = ExclusiveUnion<{
53
50
  state: 'active';
54
51
  activatedAtMs: number;
55
- retiredAtMs?: never;
56
- revokedAtMs?: never;
57
52
  } | {
58
53
  state: 'retired';
59
54
  activatedAtMs: number;
60
55
  retiredAtMs: number;
61
- revokedAtMs?: never;
62
56
  } | {
63
57
  state: 'revoked';
64
58
  activatedAtMs: number;
65
59
  revokedAtMs: number;
66
- retiredAtMs?: never;
67
- };
60
+ }>;
68
61
  /**
69
62
  * Ciphertext plus public binding data for one factor-sealed custody secret.
70
63
  *
@@ -8,6 +8,15 @@ export type Ed25519PublicKeyB64u = string & PasskeyCustodyBrand<'Ed25519PublicKe
8
8
  export type Secp256k1CompressedPublicKeyB64u = string & PasskeyCustodyBrand<'Secp256k1CompressedPublicKeyB64u'>;
9
9
  export type KeyCreationSignerSlot = number & PasskeyCustodyBrand<'KeyCreationSignerSlot'>;
10
10
  export type EnvelopeRevision = number & PasskeyCustodyBrand<'EnvelopeRevision'>;
11
+ export declare function requireParsed<T>(result: {
12
+ readonly ok: true;
13
+ readonly value: T;
14
+ } | {
15
+ readonly ok: false;
16
+ readonly error: {
17
+ readonly message: string;
18
+ };
19
+ }, label: string): T;
11
20
  export declare function parseDigestField(value: unknown, label: string): DigestB64u;
12
21
  export declare function parseEnvelopeNonceB64u(value: unknown, label?: string): EnvelopeNonceB64u;
13
22
  export declare function parseEnvelopeCiphertextB64u(value: unknown, label?: string): EnvelopeCiphertextB64u;
@@ -1,8 +1,18 @@
1
1
  import type { AuthorizedOperationId, CapabilityId } from '../authorization/capabilityKinds';
2
2
  import type { CapabilityOperationFingerprintDigest } from '../authorization/operationFingerprint';
3
+ import type { DigestB64u } from '../utils/canonicalPrimitives';
3
4
  import type { MpcMaterialActivationRef } from '../utils/domainIds';
4
5
  import type { LinkedDeviceEnrollmentId } from './ids';
5
- import type { ActiveSigningLaneReference } from './records';
6
+ import type { ActiveSigningLaneReference, SigningLaneRecord, WalletKeyRecord } from './records';
7
+ export type OwnerWalletExecutionLaneProjectionV1 = {
8
+ readonly kind: 'active_owner_wallet_execution_lane_projection_v1';
9
+ readonly walletKey: WalletKeyRecord;
10
+ readonly lane: Extract<SigningLaneRecord, {
11
+ readonly laneKind: 'owner_passkey' | 'owner_email_otp';
12
+ }>;
13
+ readonly materialActivation: MpcMaterialActivationRef;
14
+ readonly verifiedActivationReceiptDigestB64u: DigestB64u;
15
+ };
6
16
  export type ClaimedWalletExecutionAuthorization = {
7
17
  readonly kind: 'claimed_wallet_execution_authorization_v1';
8
18
  readonly authorizedOperationId: AuthorizedOperationId;
@@ -4,15 +4,6 @@ export type EcdsaManifestIdentity = {
4
4
  manifestId: EcdsaCapabilityManifestId;
5
5
  manifestRevision: EcdsaCapabilityManifestRevision;
6
6
  };
7
- export type ThresholdEcdsaChainTarget = {
8
- kind: 'evm';
9
- namespace: 'eip155';
10
- chainId: number;
11
- networkSlug: string;
12
- } | {
13
- kind: 'tempo';
14
- chainId: number;
15
- networkSlug: string;
16
- };
7
+ export type { ThresholdEcdsaChainTarget } from '../utils/thresholdEcdsaChainTarget';
17
8
  export { parseLaneShareEpoch, parseLaneEnrollmentId, parseLaneOperationId, parseLaneOperationIdempotencyKey, parseLinkedDeviceId, parseLinkedDeviceEnrollmentId, parseLinkDeviceSessionId, parseSigningLaneId, parseWalletKeyId, parseEd25519YaoSuiteId, parseEcdsaRelayerKeyId, } from '../utils/domainIds';
18
9
  //# sourceMappingURL=ids.d.ts.map
@@ -10,6 +10,7 @@ import type { LaneHolderParticipantId, HpkePublicKeyB64u, HpkePublicKeyDigestB64
10
10
  import type { EvmFamilySigningKeySlotId } from './evmFamilySigningKeySlotId';
11
11
  import type { SigningLaneKind } from './records';
12
12
  import type { OwnerLaneParticipantContinuityV1 } from './ownerContinuity';
13
+ import type { ExclusiveUnion } from '../utils/variant';
13
14
  export type LinkedDeviceLaneAuthorizationBindingV1 = {
14
15
  kind: 'linked_device_enrollment';
15
16
  authorizedOperationId: AuthorizedOperationId;
@@ -761,17 +762,14 @@ type LaneHolderRecipientDescriptorV1 = {
761
762
  hpkePublicKeyB64u: HpkePublicKeyB64u;
762
763
  hpkePublicKeyDigestB64u: HpkePublicKeyDigestB64u;
763
764
  };
764
- export type LaneHolderPackageWireV1 = {
765
+ export type LaneHolderPackageWireV1 = ExclusiveUnion<{
765
766
  kind: 'ed25519_yao_lane_holder_package_set_v1';
766
767
  deriverAEncryptedPackageJson: string;
767
768
  deriverBEncryptedPackageJson: string;
768
- ecdsaEncryptedMaterialEnvelopeJson?: never;
769
769
  } | {
770
770
  kind: 'ecdsa_additive_lane_holder_package_v1';
771
771
  ecdsaEncryptedMaterialEnvelopeJson: string;
772
- deriverAEncryptedPackageJson?: never;
773
- deriverBEncryptedPackageJson?: never;
774
- };
772
+ }>;
775
773
  export type EcdsaAdditiveLaneHolderPreparationV1 = {
776
774
  kind: 'ecdsa_additive_lane_holder_preparation_v1';
777
775
  holderRound: EcdsaAdditiveLaneHolderRoundV1;
@@ -0,0 +1,3 @@
1
+ export declare const TENANT_ROOT_IDENTITY_MAX_IDENTIFIER_BYTES_V1 = 256;
2
+ export declare function hasControlCharacters(value: string): boolean;
3
+ //# sourceMappingURL=tenantRootIdentifier.d.ts.map
@@ -5,7 +5,7 @@ export declare const TENANT_ROOT_OPERATION_MAX_LIFETIME_MS_V1 = 600000;
5
5
  /** Maximum authorization lifetime for a ciphertext download. */
6
6
  export declare const TENANT_ROOT_DOWNLOAD_MAX_LIFETIME_MS_V1 = 300000;
7
7
  /** One console operation on a tenant derivation root. */
8
- export type TenantRootOperationKindV1 = 'tenant_root_operational_share_rotation_v1' | 'tenant_root_recovery_governance_change_v1' | 'tenant_root_recovery_recipient_pair_enroll_v1' | 'tenant_root_recovery_recipient_pair_replace_v1' | 'tenant_root_recovery_backup_create_v1' | 'tenant_root_recovery_backup_replace_v1' | 'tenant_root_recovery_role_package_download_v1' | 'tenant_root_recovery_manifest_download_v1' | 'tenant_root_restore_session_start_v1' | 'tenant_root_restore_manifest_register_v1' | 'tenant_root_restore_role_import_key_issue_v1' | 'tenant_root_restore_role_import_v1' | 'tenant_root_restore_activate_v1' | 'tenant_root_source_lineage_retire_v1';
8
+ export type TenantRootOperationKindV1 = (typeof TENANT_ROOT_OPERATION_KINDS_V1)[number];
9
9
  /** What one operation acts on. */
10
10
  export type TenantRootOperationSubjectV1 = {
11
11
  readonly kind: 'tenant_root';
@@ -157,6 +157,7 @@ export type TenantRootRestoreRoleImportKeyIssueOperationInputV1 = {
157
157
  };
158
158
  /** Inputs the console resolves before building a record. */
159
159
  export type TenantRootOperationRecordInputV1 = TenantRootOperationRecordInputWithActiveRootV1 | TenantRootRestoreRoleImportKeyIssueOperationInputV1;
160
+ declare const TENANT_ROOT_OPERATION_KINDS_V1: readonly ["tenant_root_operational_share_rotation_v1", "tenant_root_recovery_governance_change_v1", "tenant_root_recovery_recipient_pair_enroll_v1", "tenant_root_recovery_recipient_pair_replace_v1", "tenant_root_recovery_backup_create_v1", "tenant_root_recovery_backup_replace_v1", "tenant_root_recovery_role_package_download_v1", "tenant_root_recovery_manifest_download_v1", "tenant_root_restore_session_start_v1", "tenant_root_restore_manifest_register_v1", "tenant_root_restore_role_import_key_issue_v1", "tenant_root_restore_role_import_v1", "tenant_root_restore_activate_v1", "tenant_root_source_lineage_retire_v1"];
160
161
  /** Returns the four operations that follow the tenant's recovery governance. */
161
162
  export declare function tenantRootOperationFollowsGovernanceV1(kind: TenantRootOperationKindV1): boolean;
162
163
  /** Returns the maximum authorization lifetime for one operation. */
@@ -10,6 +10,12 @@ export declare function derivationClientSharePublicKey33B64uFromString(value: st
10
10
  export type EcdsaDerivationRelayerPublicKey33B64u = string & {
11
11
  readonly __brand: 'EcdsaDerivationRelayerPublicKey33B64u';
12
12
  };
13
+ export type EcdsaDerivationRoleLocalPublicIdentity = {
14
+ derivationClientSharePublicKey33B64u: DerivationClientSharePublicKey33B64u;
15
+ relayerPublicKey33B64u: EcdsaDerivationRelayerPublicKey33B64u;
16
+ groupPublicKey33B64u: string;
17
+ ethereumAddress: string;
18
+ };
13
19
  export type EcdsaThresholdKeyId = string & {
14
20
  readonly __brand: 'EcdsaThresholdKeyId';
15
21
  };
@@ -16,6 +16,7 @@ export declare function normalizeRuntimePolicyScope(input: unknown): RuntimePoli
16
16
  export declare function normalizeRuntimePolicyScopeFields(input: unknown): Omit<RuntimePolicyScope, 'signingRootVersion'> & {
17
17
  readonly signingRootVersion?: string;
18
18
  };
19
+ export declare function sameRuntimePolicyScope(left: RuntimePolicyScope, right: RuntimePolicyScope): boolean;
19
20
  export declare function signingRootScopeFromRuntimePolicyScope(scope: RuntimePolicyScope): SigningRootScope;
20
21
  export {};
21
22
  //# sourceMappingURL=signingRootScope.d.ts.map
@@ -1,19 +1,10 @@
1
- type EcdsaInventoryChainTarget = {
2
- kind: 'evm';
3
- namespace: 'eip155';
4
- chainId: number;
5
- networkSlug?: string;
6
- } | {
7
- kind: 'tempo';
8
- chainId: number;
9
- networkSlug?: string;
10
- };
1
+ import { type ThresholdEcdsaChainTargetWire } from './thresholdEcdsaChainTarget';
11
2
  type WalletEcdsaKeyFactsInventoryChallengeInput = {
12
3
  walletId: string;
13
4
  rpId: string;
14
5
  keyTargets: readonly {
15
6
  keyHandle: string;
16
- chainTarget: EcdsaInventoryChainTarget;
7
+ chainTarget: ThresholdEcdsaChainTargetWire;
17
8
  }[];
18
9
  runtimePolicyScope?: unknown;
19
10
  serverNonceB64u: string;
@@ -0,0 +1,16 @@
1
+ /** The EIP-1559 transaction as the EVM crypto WASM reads it: amounts in decimal strings. */
2
+ export type Eip1559TxWasmJson = {
3
+ chainId: number;
4
+ nonce: string;
5
+ maxPriorityFeePerGas: string;
6
+ maxFeePerGas: string;
7
+ gasLimit: string;
8
+ to?: string | null;
9
+ value: string;
10
+ data?: string;
11
+ accessList?: {
12
+ address: string;
13
+ storageKeys: string[];
14
+ }[];
15
+ };
16
+ //# sourceMappingURL=eip1559TxWasmJson.d.ts.map
@@ -1,6 +1,8 @@
1
1
  export declare const EMAIL_OTP_CHANNEL: "email_otp";
2
2
  export declare const EMAIL_OTP_INITIAL_ENROLLMENT_VERSION: "1";
3
3
  export declare function emailOtpDeviceEnrollmentId(walletId: string, providerSubject: string): string;
4
+ /** Domain label that opens the AAD binding a released Email OTP factor to its challenge. */
5
+ export declare const EMAIL_OTP_FACTOR_RELEASE_AAD_DOMAIN_V1 = "seams/email-otp/factor-release/v1";
4
6
  declare const WALLET_UNLOCK_BACKENDS: readonly ["passkey", "email_otp"];
5
7
  export type WalletUnlockBackend = (typeof WALLET_UNLOCK_BACKENDS)[number];
6
8
  export type WalletEmailOtpChannel = typeof EMAIL_OTP_CHANNEL;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * True when `value` is a non-array object whose own enumerable string keys are exactly `keys`.
3
+ *
4
+ * A key whose value is `undefined` still counts as present. Symbol, non-enumerable and inherited
5
+ * keys are not counted, and the prototype is not checked. A list that repeats a key never matches.
6
+ * Kept apart from validation.ts, which the wallet iframe's boot path loads.
7
+ */
8
+ export declare function hasExactKeys<const K extends readonly string[]>(value: unknown, keys: K): value is {
9
+ readonly [P in K[number]]: unknown;
10
+ };
11
+ //# sourceMappingURL=exactKeys.d.ts.map
@@ -0,0 +1,12 @@
1
+ export declare function failure<const C extends string>(code: C, message: string): {
2
+ ok: false;
3
+ code: C;
4
+ message: string;
5
+ };
6
+ export declare function failedVerification<const C extends string>(code: C, message: string): {
7
+ ok: false;
8
+ verified: false;
9
+ code: C;
10
+ message: string;
11
+ };
12
+ //# sourceMappingURL=failure.d.ts.map
@@ -1,3 +1,4 @@
1
+ import type { ExclusiveUnion } from './variant';
1
2
  type JsonRpcId = string | number | null;
2
3
  export type JsonRpcErrorDetails = {
3
4
  code?: number | string;
@@ -6,17 +7,15 @@ export type JsonRpcErrorDetails = {
6
7
  data?: unknown;
7
8
  cause?: unknown;
8
9
  };
9
- export type JsonRpcEnvelope = {
10
+ export type JsonRpcEnvelope = ExclusiveUnion<{
10
11
  kind: 'success';
11
12
  id: JsonRpcId;
12
13
  result: unknown;
13
- error?: never;
14
14
  } | {
15
15
  kind: 'failure';
16
16
  id: JsonRpcId;
17
17
  error: JsonRpcErrorDetails;
18
- result?: never;
19
- };
18
+ }>;
20
19
  type JsonRpcEnvelopeDecodeResult = {
21
20
  ok: true;
22
21
  value: JsonRpcEnvelope;
@@ -1,5 +1,6 @@
1
1
  import { ExecutionStatusBasic, FinalExecutionStatusBasic, type ExecutionError, type TxExecutionStatus } from '@near-js/types';
2
2
  export type NearRpcResultDecoder<T> = (value: unknown) => T;
3
+ export type NearRpcErrorType = 'InvalidTxError' | 'ActionError' | 'TxExecutionError' | 'RpcError' | 'Failure' | 'Unknown';
3
4
  type DecodedNearFunctionCallPermission = {
4
5
  FunctionCall: {
5
6
  allowance: string;
@@ -1,5 +1,6 @@
1
1
  import { type ChallengeSubjectId, type EmailOtpChallengeId, type OrgId, type ProviderSubject, type WalletId, type WebAuthnRpId } from './domainIds';
2
2
  import type { WebAuthnAuthenticatorDeviceInfo } from './webauthnDeviceInfo';
3
+ import type { ExclusiveUnion } from './variant';
3
4
  export type RegisterWalletInput = {
4
5
  kind: 'server_allocated';
5
6
  walletId?: never;
@@ -135,7 +136,7 @@ export type RegistrationAuthority = {
135
136
  device?: never;
136
137
  rpId?: never;
137
138
  };
138
- export type EmailOtpRegistrationProof = {
139
+ export type EmailOtpRegistrationProof = ExclusiveUnion<{
139
140
  version: 'email_otp_registration_proof_v1';
140
141
  proofKind: 'otp_challenge';
141
142
  providerSubject: string;
@@ -146,9 +147,6 @@ export type EmailOtpRegistrationProof = {
146
147
  otpChannel: 'email_otp';
147
148
  /** Registration intent digest that binds the OTP proof to the wallet-registration request. */
148
149
  registrationIntentDigestB64u: string;
149
- googleEmailOtpRegistrationAttemptId?: never;
150
- googleEmailOtpRegistrationOfferId?: never;
151
- googleEmailOtpRegistrationCandidateId?: never;
152
150
  } | {
153
151
  version: 'email_otp_registration_proof_v1';
154
152
  proofKind: 'google_sso_registration';
@@ -158,10 +156,7 @@ export type EmailOtpRegistrationProof = {
158
156
  googleEmailOtpRegistrationOfferId: string;
159
157
  googleEmailOtpRegistrationCandidateId: string;
160
158
  registrationIntentDigestB64u: string;
161
- challengeId?: never;
162
- otpCode?: never;
163
- otpChannel?: never;
164
- };
159
+ }>;
165
160
  export declare function inspectRawObject(value: unknown): object | null;
166
161
  export declare function trimString(value: unknown): string;
167
162
  export declare function normalizeRegistrationAuthMethodInput(raw: unknown): RegistrationAuthMethodInput | null;
@@ -1,16 +1,15 @@
1
1
  import { type ImplicitNearAccountId, type NamedNearAccountId } from './near';
2
2
  import type { NearEd25519SigningKeyId } from './registrationIds';
3
- export type RegistrationNearAccountProvisioning = {
3
+ import type { ThresholdEcdsaChainTargetWire } from './thresholdEcdsaChainTarget';
4
+ import type { ExclusiveUnion } from './variant';
5
+ export type RegistrationNearAccountProvisioning = ExclusiveUnion<{
4
6
  kind: 'implicit_account';
5
7
  accountIdSource: 'ed25519_public_key';
6
- requestedAccountId?: never;
7
- sponsor?: never;
8
8
  } | {
9
9
  kind: 'sponsored_named_account';
10
10
  requestedAccountId: NamedNearAccountId;
11
11
  sponsor: 'relayer';
12
- accountIdSource?: never;
13
- };
12
+ }>;
14
13
  export type ResolvedRegistrationNearAccount = {
15
14
  kind: 'implicit_account';
16
15
  nearAccountId: ImplicitNearAccountId;
@@ -38,16 +37,7 @@ export type ThresholdEd25519AddSignerSpec = {
38
37
  keyVersion: string;
39
38
  derivationVersion: number;
40
39
  };
41
- export type ThresholdEcdsaAddSignerChainTarget = {
42
- readonly kind: 'evm';
43
- readonly namespace: 'eip155';
44
- readonly chainId: number;
45
- readonly networkSlug?: string;
46
- } | {
47
- readonly kind: 'tempo';
48
- readonly chainId: number;
49
- readonly networkSlug?: string;
50
- };
40
+ export type ThresholdEcdsaAddSignerChainTarget = Readonly<ThresholdEcdsaChainTargetWire>;
51
41
  export type ThresholdEcdsaAddSignerSpec = {
52
42
  chainTargets: readonly ThresholdEcdsaAddSignerChainTarget[];
53
43
  participantIds: number[];
@@ -102,15 +92,13 @@ export type RegistrationSignerPlan = {
102
92
  kind: 'signer_set';
103
93
  branches: readonly RegistrationSignerPlanBranch[];
104
94
  };
105
- export type AddSignerSelection = {
95
+ export type AddSignerSelection = ExclusiveUnion<{
106
96
  mode: 'ed25519';
107
97
  ed25519: ThresholdEd25519AddSignerSpec;
108
- ecdsa?: never;
109
98
  } | {
110
99
  mode: 'ecdsa';
111
100
  ecdsa: ThresholdEcdsaAddSignerSpec;
112
- ed25519?: never;
113
- };
101
+ }>;
114
102
  export declare function implicitNearAccountProvisioning(): RegistrationNearAccountProvisioning;
115
103
  export declare function sponsoredNamedNearAccountProvisioning(requestedAccountId: NamedNearAccountId): RegistrationNearAccountProvisioning;
116
104
  type NormalizeSignerSelectionResult<TSelection> = {
@@ -33,7 +33,7 @@ export type RouterAbEcdsaDerivationPublicIdentityV1 = {
33
33
  client_share_retry_counter: number;
34
34
  server_share_retry_counter: number;
35
35
  };
36
- export type RouterAbServerIdentityV1 = {
36
+ type RouterAbServerIdentityV1 = {
37
37
  server_id: string;
38
38
  key_epoch: string;
39
39
  recipient_encryption_key: string;
@@ -583,6 +583,7 @@ export declare function parseRouterAbEcdsaRegistrationActivationReceiptV1(value:
583
583
  export declare function parseRouterAbEcdsaRegistrationPublicActivationReceiptV1(value: unknown): RouterAbEcdsaRegistrationPublicActivationReceiptV1;
584
584
  export declare function sameRouterAbServerIdentityV1(left: RouterAbServerIdentityV1, right: RouterAbServerIdentityV1): boolean;
585
585
  export declare function sameRouterAbEcdsaVerifiedClientActivationFactsV1(left: RouterAbEcdsaVerifiedClientActivationFactsV1, right: RouterAbEcdsaVerifiedClientActivationFactsV1): boolean;
586
+ export declare function sameRegistrationSignerSet(left: RouterAbEcdsaDerivationSignerSetV1, right: RouterAbEcdsaDerivationSignerSetV1): boolean;
586
587
  export declare function sameRouterAbEcdsaRegistrationRequestFactsV1(left: RouterAbEcdsaRegistrationRequestFactsV1, right: RouterAbEcdsaRegistrationRequestFactsV1): boolean;
587
588
  export declare function assertRouterAbEcdsaRegistrationFactsMatchRequestV1(input: {
588
589
  facts: RouterAbEcdsaRegistrationRequestFactsV1;
@@ -605,6 +606,7 @@ export declare function parseRouterAbEcdsaDerivationExplicitExportProtocolReques
605
606
  export declare function parseRouterAbEcdsaDerivationActivationRefreshRequestV1(value: unknown): RouterAbEcdsaDerivationActivationRefreshRequestV1;
606
607
  export declare function parseRouterAbEcdsaDerivationActivationRefreshCommitRequestV1(value: unknown): RouterAbEcdsaDerivationActivationRefreshCommitRequestV1;
607
608
  export declare function sameRouterAbPublicDigest32V1Wire(left: RouterAbPublicDigest32V1Wire, right: RouterAbPublicDigest32V1Wire): boolean;
609
+ export declare function sameRegistrationRecipientKeys(left: RouterAbEcdsaRegistrationRecipientKeysV1, right: RouterAbEcdsaRegistrationRecipientKeysV1): boolean;
608
610
  export declare function sameRouterAbEcdsaRegistrationActivationReceiptV1(left: RouterAbEcdsaRegistrationActivationReceiptV1, right: RouterAbEcdsaRegistrationActivationReceiptV1): boolean;
609
611
  export declare function sameRouterAbEcdsaDerivationNormalSigningStateV1(left: RouterAbEcdsaDerivationNormalSigningStateV1, right: RouterAbEcdsaDerivationNormalSigningStateV1): boolean;
610
612
  export declare function sameRouterAbEcdsaDerivationPublicCapabilityV1(left: RouterAbEcdsaDerivationPublicCapabilityV1, right: RouterAbEcdsaDerivationPublicCapabilityV1): boolean;
@@ -104,6 +104,7 @@ export type RouterAbEd25519YaoActivationBindingV1<Operation extends RouterAbEd25
104
104
  operation: Operation;
105
105
  } : never;
106
106
  export declare function sameRouterAbEd25519YaoActivationBindingV1(left: RouterAbEd25519YaoActivationBindingV1, right: RouterAbEd25519YaoActivationBindingV1): boolean;
107
+ export declare function sameRouterAbEd25519YaoByteSequence(left: readonly number[], right: readonly number[]): boolean;
107
108
  export declare function sameRouterAbEd25519YaoRegistrationAdmissionRequestV1(left: RouterAbEd25519YaoRegistrationAdmissionRequestV1, right: RouterAbEd25519YaoRegistrationAdmissionRequestV1): boolean;
108
109
  export declare function sameRouterAbEd25519YaoRecoveryAdmissionRequestV1(left: RouterAbEd25519YaoRecoveryAdmissionRequestV1, right: RouterAbEd25519YaoRecoveryAdmissionRequestV1): boolean;
109
110
  export declare function sameRouterAbEd25519YaoActivationKeysetV1(left: RouterAbEd25519YaoActivationKeysetV1, right: RouterAbEd25519YaoActivationKeysetV1): boolean;
@@ -1,14 +1,13 @@
1
1
  import type { RouterAbEd25519YaoBytes32V1 } from './generated/routerAbEd25519YaoCore';
2
2
  import type { RouterAbEd25519YaoApplicationBindingFactsV1, RouterAbEd25519YaoExportAuthorizationIdentityV1 } from './routerAbEd25519Yao';
3
- type RouterAbEd25519YaoExportAuthorityBindingV1 = {
3
+ import type { ReadonlyExclusiveUnion } from './variant';
4
+ type RouterAbEd25519YaoExportAuthorityBindingV1 = ReadonlyExclusiveUnion<{
4
5
  readonly kind: 'passkey';
5
6
  readonly credentialIdB64u: string;
6
- readonly providerSubjectId?: never;
7
7
  } | {
8
8
  readonly kind: 'email_otp';
9
9
  readonly providerSubjectId: string;
10
- readonly credentialIdB64u?: never;
11
- };
10
+ }>;
12
11
  export declare function requireVisibleIdentifier(value: unknown, label: string): string;
13
12
  export declare function requireBytes(value: unknown, label: string, minimumLength: number, maximumLength: number): number[];
14
13
  export declare function requireBytes32(value: unknown, label: string, nonzero: boolean): number[];
@@ -1,4 +1,6 @@
1
1
  import { type MpcMaterialActivationRef } from './domainIds';
2
+ import type { RouterAbEcdsaOperationStepUpPreparationV1Wire } from './routerAbEcdsaDerivation';
3
+ import type { RouterAbMpcMaterialActivationRefV1 } from './generated/routerAbEd25519YaoCore';
2
4
  export type RouterAbNormalSigningAuthorizationWire = {
3
5
  readonly kind: 'reusable_wallet_session';
4
6
  readonly wallet_session_id: string;
@@ -7,15 +9,18 @@ export type RouterAbNormalSigningAuthorizationWire = {
7
9
  readonly evidence_set_digest?: never;
8
10
  readonly wallet_session_id?: never;
9
11
  };
10
- export type RouterAbMpcMaterialActivationRefWire = {
11
- readonly kind: 'mpc_material_activation_ref';
12
- readonly activation_id: string;
13
- readonly capability: string;
14
- readonly material_owner: string;
15
- readonly key_binding: string;
16
- readonly lifecycle_binding: string;
17
- readonly signing_worker: string;
12
+ export type RouterAbEcdsaDerivationPoolFillAuthorization = {
13
+ readonly authorization: Extract<RouterAbNormalSigningAuthorizationWire, {
14
+ readonly kind: 'reusable_wallet_session';
15
+ }>;
16
+ readonly operation?: never;
17
+ } | {
18
+ readonly authorization: Extract<RouterAbNormalSigningAuthorizationWire, {
19
+ readonly kind: 'operation_step_up';
20
+ }>;
21
+ readonly operation: RouterAbEcdsaOperationStepUpPreparationV1Wire;
18
22
  };
23
+ export type RouterAbMpcMaterialActivationRefWire = Readonly<RouterAbMpcMaterialActivationRefV1>;
19
24
  export type RouterAbEd25519OperationStepUpPreparationV1Wire = {
20
25
  readonly wallet_id: string;
21
26
  readonly operation_kind: 'near.sign_transaction' | 'near.sign_delegate_action' | 'near.sign_nep413_message';
@@ -29,6 +34,23 @@ export type RouterAbEd25519OperationStepUpPreparationV1Wire = {
29
34
  readonly participant_ids: readonly [number, number];
30
35
  readonly expires_at_ms: number;
31
36
  };
37
+ export type RouterAbEd25519OperationStepUpMaterialRecoveryRequest = {
38
+ kind: 'not_requested';
39
+ } | {
40
+ kind: 'email_otp_factor_release_v1';
41
+ workerEphemeralPublicKey65B64u: string;
42
+ };
43
+ export type RouterAbEd25519OperationStepUpMaterialRecoveryResponse = {
44
+ kind: 'not_requested';
45
+ } | {
46
+ kind: 'email_otp_factor_release_v1';
47
+ challengeId: string;
48
+ enrollmentId: string;
49
+ enrollmentSealKeyVersion: string;
50
+ serverEphemeralPublicKey65B64u: string;
51
+ nonce12B64u: string;
52
+ ciphertextB64u: string;
53
+ };
32
54
  export type RouterAbEd25519OwnerOperationAuthorizationDecisionV1Wire = {
33
55
  readonly kind: 'authorized';
34
56
  readonly operation: {
@@ -0,0 +1,2 @@
1
+ export type RouterApiKeyAuthFailureCode = 'secret_key_missing' | 'secret_key_invalid' | 'secret_key_revoked' | 'secret_key_forbidden_scope' | 'secret_key_ip_blocked' | 'secret_key_environment_mismatch';
2
+ //# sourceMappingURL=routerApiKeyAuth.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import type { RouterAbEcdsaDerivationNormalSigningStateV1, RouterAbEcdsaDerivationPublicCapabilityV1 } from './routerAbEcdsaDerivation';
2
2
  import type { EmailOtpProvider, EmailOtpWalletAuthAuthority, WalletAuthAuthorityRef } from './walletAuthAuthority';
3
3
  import type { MpcMaterialActivationRef } from './domainIds';
4
+ import type { ThresholdEcdsaChainTarget } from './thresholdEcdsaChainTarget';
4
5
  import { SIGNER_AUTH_METHODS, type SignerAuthMethod } from './signerDomain';
5
6
  export declare const SIGNING_SESSION_SEALED_RECORD_VERSION: 2;
6
7
  export declare const SIGNING_SESSION_SEAL_ALG: "shamir3pass-v2";
@@ -23,6 +24,14 @@ export type SigningSessionSealProtocol = {
23
24
  algorithm: typeof SIGNING_SESSION_SEAL_ALG;
24
25
  groupId: SigningSessionSealGroupId;
25
26
  };
27
+ /** The signing-session seal capabilities a relayer publishes in its well-known document. */
28
+ export type WellKnownSigningSessionSealCapabilities = {
29
+ mode: 'none';
30
+ } | {
31
+ mode: 'sealed_refresh_v1';
32
+ protocol: SigningSessionSealProtocol;
33
+ currentKeyVersion: string;
34
+ };
26
35
  export type SealedSigningSessionEcdsaRestoreSource = 'login' | 'registration' | 'manual-bootstrap' | 'email_otp';
27
36
  export type RouterAbEd25519NormalSigningState = {
28
37
  kind: typeof ROUTER_AB_ED25519_NORMAL_SIGNING_STATE_KIND;
@@ -30,18 +39,8 @@ export type RouterAbEd25519NormalSigningState = {
30
39
  };
31
40
  export declare function parseRouterAbEd25519NormalSigningState(value: unknown): RouterAbEd25519NormalSigningState | null;
32
41
  export declare function requireRouterAbEd25519NormalSigningState(value: unknown): RouterAbEd25519NormalSigningState;
33
- type SealedSigningSessionEcdsaChainTarget = {
34
- kind: 'tempo';
35
- chainId: number;
36
- networkSlug: string;
37
- } | {
38
- kind: 'evm';
39
- namespace: 'eip155';
40
- chainId: number;
41
- networkSlug: string;
42
- };
43
42
  type SealedSigningSessionEcdsaRestoreMetadataBase = {
44
- chainTarget: SealedSigningSessionEcdsaChainTarget;
43
+ chainTarget: ThresholdEcdsaChainTarget;
45
44
  signingRootId: string;
46
45
  signingRootVersion: string;
47
46
  keyHandle: string;
@@ -0,0 +1,25 @@
1
+ export type EvmEip155ChainTarget = {
2
+ kind: 'evm';
3
+ namespace: 'eip155';
4
+ chainId: number;
5
+ networkSlug: string;
6
+ };
7
+ export type TempoChainTarget = {
8
+ kind: 'tempo';
9
+ chainId: number;
10
+ networkSlug: string;
11
+ };
12
+ export type ThresholdEcdsaChainTarget = EvmEip155ChainTarget | TempoChainTarget;
13
+ /** A chain target as requests carry it: the network slug may still be unresolved. */
14
+ export type ThresholdEcdsaChainTargetWire = {
15
+ kind: 'evm';
16
+ namespace: 'eip155';
17
+ chainId: number;
18
+ networkSlug?: string;
19
+ } | {
20
+ kind: 'tempo';
21
+ chainId: number;
22
+ networkSlug?: string;
23
+ };
24
+ export declare function thresholdEcdsaChainTargetKey(target: ThresholdEcdsaChainTargetWire): string;
25
+ //# sourceMappingURL=thresholdEcdsaChainTarget.d.ts.map
@@ -8,4 +8,22 @@
8
8
  export type Variant<U, K extends keyof U, V extends U[K]> = Extract<U, {
9
9
  readonly [P in K]: V;
10
10
  }>;
11
+ type KeysOfUnion<U> = U extends unknown ? keyof U : never;
12
+ type Flatten<T> = {
13
+ [K in keyof T]: T[K];
14
+ };
15
+ /**
16
+ * Union `U` with each member's missing keys added as `?: never`, where the missing keys are
17
+ * those that other members declare. The members stay mutually exclusive, and code can read any
18
+ * member's key without narrowing first (it reads as `undefined` on the members that lack it).
19
+ * `K` holds every member's keys, taken before `U` distributes.
20
+ */
21
+ export type ExclusiveUnion<U, K extends PropertyKey = KeysOfUnion<U>> = U extends unknown ? Flatten<U & {
22
+ [P in Exclude<K, keyof U>]?: never;
23
+ }> : never;
24
+ /** `ExclusiveUnion` for readonly members: the added keys are `readonly` too. */
25
+ export type ReadonlyExclusiveUnion<U, K extends PropertyKey = KeysOfUnion<U>> = U extends unknown ? Flatten<U & {
26
+ readonly [P in Exclude<K, keyof U>]?: never;
27
+ }> : never;
28
+ export {};
11
29
  //# sourceMappingURL=variant.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { type DigestB64u } from './canonicalPrimitives';
2
2
  import { type WalletAuthMethodId, type WalletAuthorityId, type WalletId, type WebAuthnCredentialIdB64u, type WebAuthnRpId } from './domainIds';
3
- import type { Variant } from './variant';
3
+ import type { Variant, ReadonlyExclusiveUnion } from './variant';
4
4
  export type WalletAuthMethodRevocationProof = {
5
5
  readonly kind: 'webauthn_assertion';
6
6
  rpId: WebAuthnRpId;
@@ -44,19 +44,16 @@ export type WalletAuthMethodRecord = {
44
44
  credentialPublicKeyB64u?: never;
45
45
  counter?: never;
46
46
  };
47
- type WalletAuthMethodLifecycleV1 = {
47
+ type WalletAuthMethodLifecycleV1 = ReadonlyExclusiveUnion<{
48
48
  readonly status: 'pending_local_install';
49
- readonly activatedAtMs?: never;
50
- readonly revokedAtMs?: never;
51
49
  } | {
52
50
  readonly status: 'active';
53
51
  readonly activatedAtMs: number;
54
- readonly revokedAtMs?: never;
55
52
  } | {
56
53
  readonly status: 'revoked';
57
54
  readonly activatedAtMs: number;
58
55
  readonly revokedAtMs: number;
59
- };
56
+ }>;
60
57
  type WalletAuthMethodDraftCommonV1 = {
61
58
  readonly walletAuthMethodId: WalletAuthMethodId;
62
59
  readonly walletId: WalletId;