@seams/wallet-server 0.7.3 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +1 -9
- package/artifact-manifest.json +78 -33
- package/cloudflare-router-ab/build/deriver-a/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/deriver-a/index.js +2 -2
- package/cloudflare-router-ab/build/deriver-a/index_bg.wasm +0 -0
- package/cloudflare-router-ab/build/deriver-b/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/deriver-b/index.js +2 -2
- package/cloudflare-router-ab/build/deriver-b/index_bg.wasm +0 -0
- package/cloudflare-router-ab/build/local-tools/darwin-arm64/router_ab_local_init +0 -0
- package/cloudflare-router-ab/build/local-tools/darwin-x64/router_ab_local_init +0 -0
- package/cloudflare-router-ab/build/local-tools/linux-x64/router_ab_local_init +0 -0
- package/cloudflare-router-ab/build/router/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/router/index.js +2 -2
- package/cloudflare-router-ab/build/router/index_bg.wasm +0 -0
- package/cloudflare-router-ab/build/signing-worker/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/signing-worker/index.js +2 -2
- package/cloudflare-router-ab/build/signing-worker/index_bg.wasm +0 -0
- package/cloudflare-router-ab/build/tenant-root-control-plane/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/tenant-root-control-plane/index.js +2 -2
- package/cloudflare-router-ab/build/tenant-root-control-plane/index_bg.wasm +0 -0
- package/cloudflare-router-ab/scripts/prepare-local-runtime-config.mjs +0 -2
- package/cloudflare-router-ab/scripts/start-local-role-workers.mjs +77 -20
- package/dist/esm/authorization/lifecycleRouting.js +62 -0
- package/dist/esm/authorization/service.js +35 -12
- package/dist/esm/cloud-host.js +20 -22
- package/dist/esm/core/EmailOtpRecords.js +1 -217
- package/dist/esm/core/EmailOtpStores.js +0 -859
- package/dist/esm/core/IdentityStore.js +2 -339
- package/dist/esm/core/ThresholdService/config.js +1 -9
- package/dist/esm/core/ThresholdService/index.js +0 -4
- package/dist/esm/core/ThresholdService/kv.js +1 -66
- package/dist/esm/core/ThresholdService/routerAb/ecdsaDerivationPoolFillHandlers.js +1 -13
- package/dist/esm/core/ThresholdService/routerAbNormalSigningPolicy.js +1 -11
- package/dist/esm/core/ThresholdService/stores/WalletSessionStore.js +0 -541
- package/dist/esm/core/ThresholdService/validation.js +2 -346
- package/dist/esm/core/WalletAuthMethodStore.js +2 -123
- package/dist/esm/core/WalletStore.js +3 -209
- package/dist/esm/core/WebAuthnAuthenticatorStore.js +0 -202
- package/dist/esm/core/WebAuthnCredentialBindingStore.js +2 -182
- package/dist/esm/core/WebAuthnLoginChallengeStore.js +0 -52
- package/dist/esm/core/WebAuthnSyncChallengeStore.js +0 -54
- package/dist/esm/core/authService/emailOtpConfig.js +1 -195
- package/dist/esm/core/authService/emailOtpEnrollment.js +0 -110
- package/dist/esm/core/authService/emailOtpSeal.js +0 -63
- package/dist/esm/core/authService/nearTransactions.js +3 -98
- package/dist/esm/core/authService/rateLimits.js +0 -84
- package/dist/esm/core/authService/webauthn.js +2 -298
- package/dist/esm/core/authService/webauthnOidcHelpers.js +1 -24
- package/dist/esm/core/authService/webauthnWalletBinding.js +0 -37
- package/dist/esm/core/config.js +1 -95
- package/dist/esm/core/d1EcdsaSignerRead.js +1 -1
- package/dist/esm/core/d1IdentityStore.js +1 -2
- package/dist/esm/core/d1TenantStore.js +1 -24
- package/dist/esm/core/d1WalletAuthMethodStore.js +2 -5
- package/dist/esm/core/d1WalletStore.js +2 -2
- package/dist/esm/core/deviceLinking/linkedDeviceBootstrap.js +13 -0
- package/dist/esm/core/deviceLinking/linkedDeviceSession.js +20 -14
- package/dist/esm/core/deviceLinking/requestProof.js +9 -6
- package/dist/esm/core/emailOtpD1Statements.js +107 -94
- package/dist/esm/core/keyMaterialBrands.js +2 -12
- package/dist/esm/core/nearKeys.js +0 -1
- package/dist/esm/core/nearRelayerAccountProvisioning.js +6 -9
- package/dist/esm/core/passkeyCredentialClaims.js +8 -0
- package/dist/esm/core/routerAbSigning/RouterAbEcdsaPresignRuntime.js +2 -6
- package/dist/esm/core/routerAbSigning/RouterAbNormalSigningRuntime.js +2 -30
- package/dist/esm/core/thresholdEcdsaChainTarget.js +1 -4
- package/dist/esm/hosted-wallet-gateway.js +66 -43
- package/dist/esm/index.js +6 -19
- package/dist/esm/localHostedWalletGatewayHandler.js +12 -0
- package/dist/esm/localRegistrationSetupAuthority.js +89 -0
- package/dist/esm/router/auth/authRequestValidation.js +8 -16
- package/dist/esm/router/auth/webAuthnCredentialCodecs.js +0 -1
- package/dist/esm/router/cloudflare/d1/auth/d1AuthorizationAssembly.js +87 -0
- package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthConfig.js +12 -2
- package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthService.js +32 -281
- package/dist/esm/router/cloudflare/d1/authorization/authorizedOperationStatements.js +24 -22
- package/dist/esm/router/cloudflare/d1/authorization/d1AuthorizationStore.js +8 -6
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.js +12 -13
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceEd25519ExportRootStore.js +6 -1
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceEmailOtpGrantStore.js +12 -2
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceEmailOtpTargetFactor.js +4 -4
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceOwnerAuthorizationProvider.js +1 -1
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceRequestProofNonceStore.js +3 -9
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceRouteService.js +2 -1
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceSessionStore.js +89 -7
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetCredentialProvider.js +23 -14
- package/dist/esm/router/cloudflare/d1/ed25519Yao/d1Ed25519YaoCapabilityPersistence.js +9 -6
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeIssuer.js +0 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeService.js +0 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeStore.js +1 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeVerifier.js +0 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpEnrollmentStore.js +1 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpGrantStore.js +1 -7
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRateLimitStore.js +19 -13
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecords.js +0 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecoveryService.js +0 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRegistrationEnrollmentFinalizer.js +2 -2
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpServerSealRuntime.js +0 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpRegistrationAttemptStore.js +44 -12
- package/dist/esm/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpRegistrationRecords.js +1 -49
- package/dist/esm/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpSessionResolver.js +19 -31
- package/dist/esm/router/cloudflare/d1/emailOtp/d1GoogleRegistrationCompletion.js +85 -0
- package/dist/esm/router/cloudflare/d1/identity/d1IdentityRecords.js +0 -1
- package/dist/esm/router/cloudflare/d1/identity/d1IdentityService.js +0 -48
- package/dist/esm/router/cloudflare/d1/near/d1SponsoredNearAccount.js +242 -0
- package/dist/esm/router/cloudflare/d1/oidc/d1OidcBoundary.js +0 -1
- package/dist/esm/router/cloudflare/d1/oidc/d1OidcVerificationService.js +2 -29
- package/dist/esm/router/cloudflare/d1/oidc/googleOidcToken.js +41 -0
- package/dist/esm/router/cloudflare/d1/passkeyCustody/d1PasskeyCustodyRouteService.js +5 -0
- package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletCustodyCommitStore.js +34 -0
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore.js +9 -3
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyRecords.js +7 -13
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyStore.js +25 -13
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationIntentService.js +0 -1
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationSetupSupport.js +74 -0
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationCommitStore.js +7 -1
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationService.js +69 -238
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationSetup.js +12 -56
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationSetupExecution.js +155 -0
- package/dist/esm/router/cloudflare/d1/registration/walletRegistrationEstablishedSessionIssuer.js +1 -3
- package/dist/esm/router/cloudflare/d1/signingAdmission/d1RouterAbNormalSigningAdmissionStore.js +12 -6
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAddSignerFinalizeRecord.js +68 -0
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAddSignerService.js +7 -54
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthMethodService.js +9 -8
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthorityStore.js +2 -142
- package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnAuthService.js +25 -4
- package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnRecords.js +4 -70
- package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnStore.js +23 -7
- package/dist/esm/router/cloudflare/runtime/staticWalletConsoleBinding.js +1 -0
- package/dist/esm/router/cloudflare/runtime/walletConsoleOps.js +1 -0
- package/dist/esm/router/cloudflare/runtime/walletConsoleOpsClient.js +5 -0
- package/dist/esm/router/cloudflare/runtime/walletGateway.js +1 -1
- package/dist/esm/router/cloudflare/runtime/walletRuntimeOps.js +16 -4
- package/dist/esm/router/cloudflare-adaptor.js +1 -2
- package/dist/esm/router/cloudflare.js +1342 -1733
- package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistration.js +11 -8
- package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistrationPartitionedStateStore.js +3 -2
- package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistrationPartitioning.js +6 -6
- package/dist/esm/router/domains/ed25519Yao/export/routerAbEd25519YaoExport.js +6 -6
- package/dist/esm/router/domains/ed25519Yao/export/routerAbEd25519YaoExportRequestScopedCloudflare.js +3 -0
- package/dist/esm/router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecoveryRequestScopedCloudflare.js +8 -0
- package/dist/esm/router/domains/emailOtp/emailOtpRequestValidation.js +0 -1
- package/dist/esm/router/domains/passkeyCustody/passkeyCustodyEnvelopeRetrieval.js +2 -8
- package/dist/esm/router/domains/passkeyCustody/walletCustodyRegistrationCommit.js +2 -8
- package/dist/esm/router/domains/signingOperations/routerAbPrivateSigningWorker.js +5 -19
- package/dist/esm/router/domains/signingOperations/walletExecutionAdmission.js +2 -3
- package/dist/esm/router/domains/walletRegistration/walletRegistrationReservation.js +70 -0
- package/dist/esm/router/domains/walletRegistration/walletRegistrationRoutes.js +10 -11
- package/dist/esm/router/domains/walletRegistration/walletRegistrationSetupPayload.js +2 -3
- package/dist/esm/router/domains/walletUnlock/walletUnlockRouteHandlers.js +14 -0
- package/dist/esm/router/express.js +574 -479
- package/dist/esm/router/framework/http.js +2 -0
- package/dist/esm/router/framework/registrationSetupDispatch.js +14 -0
- package/dist/esm/router/framework/ror/normalize.js +0 -1
- package/dist/esm/router/framework/ror/options.js +0 -1
- package/dist/esm/router/framework/ror/provider.js +0 -1
- package/dist/esm/router/framework/ror/staticProvider.js +0 -1
- package/dist/esm/router/framework/routeDefinitions.js +1 -2
- package/dist/esm/router/framework/routerApiWebhooks.js +0 -1
- package/dist/esm/router/ror.js +0 -1
- package/dist/esm/router/transport/fetch/createFetchRouter.js +0 -2
- package/dist/esm/router/transport/fetch/routes/auth.js +2 -0
- package/dist/esm/router/transport/fetch/routes/deviceLinking.js +36 -147
- package/dist/esm/router/transport/fetch/routes/deviceLinkingOwnerAuthorization.js +3 -2
- package/dist/esm/router/transport/fetch/routes/deviceLinkingResponses.js +130 -0
- package/dist/esm/router/transport/fetch/routes/ecdsaOperationStepUpFactor.js +171 -0
- package/dist/esm/router/transport/fetch/routes/passkeyCustody.js +1 -0
- package/dist/esm/router/transport/fetch/routes/syncAccount.js +7 -2
- package/dist/esm/router/transport/fetch/routes/thresholdEcdsa.js +19 -115
- package/dist/esm/router/transport/fetch/routes/walletRegistration.js +3 -1
- package/dist/esm/shared-ts/src/authorization/walletSessionIssuance.js +0 -1
- package/dist/esm/shared-ts/src/device-linking/authorityActivation.js +0 -2
- package/dist/esm/shared-ts/src/device-linking/contracts.js +16 -1
- package/dist/esm/shared-ts/src/device-linking/digests.js +1 -8
- package/dist/esm/shared-ts/src/near/actions.js +0 -1
- package/dist/esm/shared-ts/src/near/nearClient.js +0 -2
- package/dist/esm/shared-ts/src/signing-lanes/evmFamilySigningKeySlotId.js +1 -1
- package/dist/esm/shared-ts/src/signing-lanes/index.js +1 -6
- package/dist/esm/shared-ts/src/signing-lanes/ownerContinuity.js +1 -1
- package/dist/esm/shared-ts/src/signing-lanes/participantDigest.js +2 -81
- package/dist/esm/shared-ts/src/signing-lanes/participants.js +1 -219
- package/dist/esm/shared-ts/src/signing-lanes/recordParsers.js +0 -3
- package/dist/esm/shared-ts/src/tenant-root/tenantRootOperationRecord.js +1 -2
- package/dist/esm/shared-ts/src/threshold/ecdsaDerivationRoleLocalBootstrap.js +0 -1
- package/dist/esm/shared-ts/src/threshold/keyMaterialBrands.js +1 -22
- package/dist/esm/shared-ts/src/threshold/participants.js +0 -1
- package/dist/esm/shared-ts/src/threshold/signingRootScope.js +0 -1
- package/dist/esm/shared-ts/src/utils/addWalletAuthMethod.js +4 -13
- package/dist/esm/shared-ts/src/utils/canonicalPrimitives.js +1 -7
- package/dist/esm/shared-ts/src/utils/domainIds.js +1 -16
- package/dist/esm/shared-ts/src/utils/ecdsaCapabilityActivation.js +1 -11
- package/dist/esm/shared-ts/src/utils/ecdsaKeyFactsInventory.js +0 -1
- package/dist/esm/shared-ts/src/utils/errors.js +1 -19
- package/dist/esm/shared-ts/src/utils/near.js +1 -1
- package/dist/esm/shared-ts/src/utils/registrationEstablishedSession.js +1 -1
- package/dist/esm/shared-ts/src/utils/registrationIds.js +1 -5
- package/dist/esm/shared-ts/src/utils/registrationIntent.js +0 -1
- package/dist/esm/shared-ts/src/utils/registrationSetupOperation.js +8 -0
- package/dist/esm/shared-ts/src/utils/registrationSignerPlan.js +1 -1
- package/dist/esm/shared-ts/src/utils/routerAbEcdsaDerivation.js +0 -1
- package/dist/esm/shared-ts/src/utils/validation.js +1 -5
- package/dist/esm/shared-ts/src/utils/walletAuthAuthority.js +0 -1
- package/dist/esm/shared-ts/src/utils/walletManagementProtocol.js +6 -0
- package/dist/esm/shared-ts/src/utils/wireSchema.js +2 -13
- package/dist/esm/shared-ts/src/wallet-recovery/backupAcknowledgement.js +6 -24
- package/dist/esm/shared-ts/src/wallet-recovery/recoveryCodeLocator.js +0 -1
- package/dist/esm/shared-ts/src/wallet-recovery/recoveryKeyId.js +5 -6
- package/dist/esm/storage/d1Sql.js +1 -7
- package/dist/esm/threshold/session/signingSessionSeal/crypto/cipher.js +0 -1
- package/dist/esm/threshold/session/signingSessionSeal/guards/backends.js +1 -2
- package/dist/esm/threshold/session/signingSessionSeal/idempotencyBackends.js +0 -1
- package/dist/esm/threshold/session/signingSessionSeal/idempotencyRecords.js +0 -1
- package/dist/esm/threshold/session/signingSessionSeal/options.js +0 -1
- package/dist/esm/wasm/evm_crypto/pkg/evm_crypto_bg.wasm +0 -0
- package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker.js +0 -611
- package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
- package/dist/esm/wasm/shamir3pass_runtime/pkg/shamir3pass_runtime_bg.wasm +0 -0
- package/dist/types/shared-ts/src/authorization/capabilityKinds.d.ts +0 -4
- package/dist/types/shared-ts/src/device-linking/contracts.d.ts +1 -0
- package/dist/types/shared-ts/src/signing-lanes/evmFamilySigningKeySlotId.d.ts +0 -2
- package/dist/types/shared-ts/src/signing-lanes/execution.d.ts +0 -11
- package/dist/types/shared-ts/src/signing-lanes/ids.d.ts +2 -7
- package/dist/types/shared-ts/src/signing-lanes/index.d.ts +0 -4
- package/dist/types/shared-ts/src/signing-lanes/ownerContinuity.d.ts +0 -1
- package/dist/types/shared-ts/src/signing-lanes/participantDigest.d.ts +0 -18
- package/dist/types/shared-ts/src/signing-lanes/participants.d.ts +6 -35
- package/dist/types/shared-ts/src/signing-lanes/rotation.d.ts +6 -843
- package/dist/types/shared-ts/src/threshold/keyMaterialBrands.d.ts +0 -10
- package/dist/types/shared-ts/src/threshold/participants.d.ts +1 -1
- package/dist/types/shared-ts/src/utils/addWalletAuthMethod.d.ts +1 -133
- package/dist/types/shared-ts/src/utils/addWalletAuthMethod.typecheck.d.ts +4 -18
- package/dist/types/shared-ts/src/utils/domainIds.d.ts +0 -12
- package/dist/types/shared-ts/src/utils/errors.d.ts +0 -4
- package/dist/types/shared-ts/src/utils/near.d.ts +0 -20
- package/dist/types/shared-ts/src/utils/normalize.d.ts +0 -2
- package/dist/types/shared-ts/src/utils/registrationSetupOperation.d.ts +3 -0
- package/dist/types/shared-ts/src/utils/validation.d.ts +1 -3
- package/dist/types/shared-ts/src/utils/walletCapabilityBindings.d.ts +0 -1
- package/dist/types/shared-ts/src/utils/walletManagementProtocol.d.ts +3 -0
- package/dist/types/shared-ts/src/utils/wireSchema.d.ts +0 -2
- package/dist/types/shared-ts/src/wallet-recovery/backupAcknowledgement.d.ts +0 -1
- package/dist/types/shared-ts/src/wallet-recovery/recoveryCodeReservation.d.ts +1 -10
- package/dist/types/shared-ts/src/wallet-recovery/recoveryCodes.d.ts +1 -3
- package/dist/types/shared-ts/src/wallet-recovery/recoveryKeyId.d.ts +5 -21
- package/dist/types/wallet-server/src/authorization/lifecycleRouting.d.ts +32 -0
- package/dist/types/wallet-server/src/authorization/lifecycleRouting.typecheck.d.ts +2 -0
- package/dist/types/wallet-server/src/authorization/recoveryRouting.d.ts +22 -0
- package/dist/types/wallet-server/src/authorization/recoveryRouting.typecheck.d.ts +2 -0
- package/dist/types/wallet-server/src/authorization/service.d.ts +8 -1
- package/dist/types/wallet-server/src/authorization/sessionRouting.d.ts +20 -0
- package/dist/types/wallet-server/src/authorization/sessionRouting.typecheck.d.ts +2 -0
- package/dist/types/wallet-server/src/cloud-host.d.ts +31 -9
- package/dist/types/wallet-server/src/core/EmailOtpRecords.d.ts +1 -22
- package/dist/types/wallet-server/src/core/EmailOtpStores.d.ts +1 -79
- package/dist/types/wallet-server/src/core/IdentityStore.d.ts +0 -10
- package/dist/types/wallet-server/src/core/RegistrationCeremonyStore.d.ts +0 -1
- package/dist/types/wallet-server/src/core/ThresholdService/config.d.ts +0 -2
- package/dist/types/wallet-server/src/core/ThresholdService/index.d.ts +1 -3
- package/dist/types/wallet-server/src/core/ThresholdService/kv.d.ts +0 -7
- package/dist/types/wallet-server/src/core/ThresholdService/routerAb/ecdsaDerivationPoolFillHandlers.d.ts +0 -3
- package/dist/types/wallet-server/src/core/ThresholdService/routerAbNormalSigningPolicy.d.ts +0 -1
- package/dist/types/wallet-server/src/core/ThresholdService/stores/WalletSessionStore.d.ts +7 -19
- package/dist/types/wallet-server/src/core/ThresholdService/validation.d.ts +0 -34
- package/dist/types/wallet-server/src/core/WalletAuthMethodStore.d.ts +1 -5
- package/dist/types/wallet-server/src/core/WalletStore.d.ts +0 -3
- package/dist/types/wallet-server/src/core/WebAuthnAuthenticatorStore.d.ts +0 -20
- package/dist/types/wallet-server/src/core/WebAuthnCredentialBindingStore.d.ts +1 -27
- package/dist/types/wallet-server/src/core/WebAuthnLoginChallengeStore.d.ts +2 -16
- package/dist/types/wallet-server/src/core/WebAuthnSyncChallengeStore.d.ts +22 -14
- package/dist/types/wallet-server/src/core/authService/emailOtpConfig.d.ts +0 -24
- package/dist/types/wallet-server/src/core/authService/emailOtpEnrollment.d.ts +1 -70
- package/dist/types/wallet-server/src/core/authService/emailOtpSeal.d.ts +0 -13
- package/dist/types/wallet-server/src/core/authService/githubOAuth.d.ts +2 -1
- package/dist/types/wallet-server/src/core/authService/nearTransactions.d.ts +1 -39
- package/dist/types/wallet-server/src/core/authService/rateLimits.d.ts +0 -17
- package/dist/types/wallet-server/src/core/authService/webauthn.d.ts +0 -125
- package/dist/types/wallet-server/src/core/authService/webauthnOidcHelpers.d.ts +0 -3
- package/dist/types/wallet-server/src/core/authService/webauthnVerificationOutcomes.d.ts +1 -1
- package/dist/types/wallet-server/src/core/authService/webauthnWalletBinding.d.ts +0 -12
- package/dist/types/wallet-server/src/core/config.d.ts +0 -10
- package/dist/types/wallet-server/src/core/d1IdentityStore.d.ts +0 -2
- package/dist/types/wallet-server/src/core/d1TenantStore.d.ts +0 -7
- package/dist/types/wallet-server/src/core/d1WalletAuthMethodStore.d.ts +0 -1
- package/dist/types/wallet-server/src/core/deviceLinking/linkedDeviceBootstrap.d.ts +19 -0
- package/dist/types/wallet-server/src/core/deviceLinking/linkedDeviceSession.d.ts +8 -6
- package/dist/types/wallet-server/src/core/deviceLinking/requestProof.d.ts +2 -5
- package/dist/types/wallet-server/src/core/emailOtpD1Statements.d.ts +10 -7
- package/dist/types/wallet-server/src/core/keyMaterialBrands.d.ts +1 -5
- package/dist/types/wallet-server/src/core/nearRelayerAccountProvisioning.d.ts +0 -1
- package/dist/types/wallet-server/src/core/passkeyCredentialClaims.d.ts +9 -0
- package/dist/types/wallet-server/src/core/routerAbSigning/RouterAbEcdsaPresignRuntime.d.ts +0 -2
- package/dist/types/wallet-server/src/core/routerAbSigning/RouterAbNormalSigningRuntime.d.ts +0 -2
- package/dist/types/wallet-server/src/core/threeRouteRegistrationContracts.d.ts +1 -92
- package/dist/types/wallet-server/src/core/threeRouteRegistrationContracts.typecheck.d.ts +4 -52
- package/dist/types/wallet-server/src/core/thresholdEcdsaChainTarget.d.ts +0 -1
- package/dist/types/wallet-server/src/core/types.d.ts +0 -299
- package/dist/types/wallet-server/src/hosted-wallet-gateway.d.ts +15 -3
- package/dist/types/wallet-server/src/index.d.ts +8 -13
- package/dist/types/wallet-server/src/localRegistrationSetupAuthority.d.ts +13 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/auth/d1AuthorizationAssembly.d.ts +23 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/auth/d1RouterApiAuthConfig.d.ts +25 -3
- package/dist/types/wallet-server/src/router/cloudflare/d1/authorization/d1AuthorizationStore.d.ts +1 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.d.ts +3 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceEmailOtpGrantStore.d.ts +7 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceRequestProofNonceStore.d.ts +1 -10
- package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceRouteService.d.ts +4 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceSessionStore.d.ts +6 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetPlanner.d.ts +1 -13
- package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeService.d.ts +2 -2
- package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeStore.d.ts +1 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpGrantStore.d.ts +0 -2
- package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1EmailOtpRateLimitStore.d.ts +18 -2
- package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpRegistrationAttemptStore.d.ts +29 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpRegistrationRecords.d.ts +3 -16
- package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpSessionResolver.d.ts +7 -2
- package/dist/types/wallet-server/src/router/cloudflare/d1/emailOtp/d1GoogleRegistrationCompletion.d.ts +23 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/identity/d1IdentityService.d.ts +0 -12
- package/dist/types/wallet-server/src/router/cloudflare/d1/near/d1SponsoredNearAccount.d.ts +24 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/near/d1SponsoredNearAccount.typecheck.d.ts +2 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/oidc/d1OidcVerificationService.d.ts +0 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/oidc/googleOidcToken.d.ts +4 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/passkeyCustody/d1PasskeyCustodyRouteService.d.ts +5 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/passkeyCustody/d1WalletCustodyCommitStore.d.ts +9 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore.d.ts +1 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationCeremonyRecords.d.ts +10 -11
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationCeremonyStore.d.ts +3 -2
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationSetupSupport.d.ts +51 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationCommitStore.d.ts +3 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationService.d.ts +30 -47
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationSetup.d.ts +3 -30
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationSetupExecution.d.ts +11 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletAddSignerFinalizeRecord.d.ts +27 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletAddSignerService.d.ts +1 -10
- package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletAuthMethodService.d.ts +2 -2
- package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletAuthorityStore.d.ts +0 -4
- package/dist/types/wallet-server/src/router/cloudflare/d1/webauthn/d1WebAuthnAuthService.d.ts +3 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/webauthn/d1WebAuthnRecords.d.ts +0 -13
- package/dist/types/wallet-server/src/router/cloudflare/d1/webauthn/d1WebAuthnStore.d.ts +23 -10
- package/dist/types/wallet-server/src/router/cloudflare/d1/webauthn/d1WebAuthnStore.typecheck.d.ts +2 -0
- package/dist/types/wallet-server/src/router/cloudflare/runtime/cloudflare.types.d.ts +0 -2
- package/dist/types/wallet-server/src/router/cloudflare/runtime/walletConsoleOps.d.ts +1 -0
- package/dist/types/wallet-server/src/router/cloudflare/runtime/walletConsoleOpsClient.d.ts +2 -0
- package/dist/types/wallet-server/src/router/cloudflare/runtime/walletGateway.d.ts +1 -1
- package/dist/types/wallet-server/src/router/cloudflare/runtime/walletRuntimeOps.d.ts +3 -0
- package/dist/types/wallet-server/src/router/cloudflare-adaptor.d.ts +0 -1
- package/dist/types/wallet-server/src/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistration.d.ts +1 -1
- package/dist/types/wallet-server/src/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistrationPartitioning.d.ts +2 -2
- package/dist/types/wallet-server/src/router/domains/ed25519Yao/export/routerAbEd25519YaoExport.d.ts +2 -2
- package/dist/types/wallet-server/src/router/domains/ed25519Yao/export/routerAbEd25519YaoExport.typecheck.d.ts +2 -0
- package/dist/types/wallet-server/src/router/domains/ed25519Yao/export/routerAbEd25519YaoExportRequestScopedCloudflare.d.ts +2 -0
- package/dist/types/wallet-server/src/router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecoveryRequestScopedCloudflare.d.ts +2 -0
- package/dist/types/wallet-server/src/router/domains/passkeyCustody/passkeyCustodyEnvelopeRetrieval.d.ts +0 -2
- package/dist/types/wallet-server/src/router/domains/passkeyCustody/walletCustodyRegistrationCommit.d.ts +0 -3
- package/dist/types/wallet-server/src/router/domains/signingOperations/routerAbPrivateSigningWorker.d.ts +0 -17
- package/dist/types/wallet-server/src/router/domains/signingOperations/walletExecutionAdmission.d.ts +1 -2
- package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationInputs.d.ts +1 -0
- package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationReservation.d.ts +51 -0
- package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationRoutes.d.ts +2 -10
- package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationSetupPayload.d.ts +2 -2
- package/dist/types/wallet-server/src/router/framework/authServicePort.d.ts +14 -34
- package/dist/types/wallet-server/src/router/framework/googleLoginResolution.typecheck.d.ts +2 -0
- package/dist/types/wallet-server/src/router/framework/registrationSetupDispatch.d.ts +13 -0
- package/dist/types/wallet-server/src/router/transport/fetch/routes/deviceLinking.d.ts +1 -1
- package/dist/types/wallet-server/src/router/transport/fetch/routes/deviceLinkingResponses.d.ts +17 -0
- package/dist/types/wallet-server/src/router/transport/fetch/routes/ecdsaOperationStepUpFactor.d.ts +37 -0
- package/dist/types/wallet-server/src/storage/d1Sql.d.ts +0 -1
- package/migrations/d1-signer/0040_namespace_home_challenges.sql +16 -0
- package/migrations/d1-signer/0041_step_up_admission_expiry.sql +28 -0
- package/migrations/d1-signer/0042_deployment_resource_challenges.sql +4 -0
- package/migrations/d1-signer/0043_google_registration_candidate_claim.sql +2 -0
- package/migrations/d1-signer/0044_linked_device_bootstrap_imports.sql +6 -0
- package/migrations/d1-signer/0045_wallet_owned_capability_receipts.sql +29 -0
- package/migrations/d1-signer/0046_wallet_owned_signing_abuse.sql +41 -0
- package/migrations/d1-signer/0047_remove_unused_near_public_keys.sql +2 -0
- package/migrations/d1-signer/0048_operation_owner_scope.sql +45 -0
- package/package.json +2 -3
- package/src/README.md +11 -3
- package/dist/esm/core/AuthService.js +0 -2
- package/dist/esm/core/NearPublicKeyStore.js +0 -200
- package/dist/esm/core/ThresholdService/stores/CloudflareDurableObjectStore.js +0 -397
- package/dist/esm/core/ThresholdService/stores/KeyStore.js +0 -140
- package/dist/esm/core/ThresholdService/stores/SessionStore.js +0 -361
- package/dist/esm/core/ThresholdService/stores/StoreConfig.js +0 -13
- package/dist/esm/core/ThresholdService/stores/exportReplayGuard.js +0 -7
- package/dist/esm/core/authService/AuthService.js +0 -594
- package/dist/esm/core/authService/bytes.js +0 -19
- package/dist/esm/core/authService/configValues.js +0 -15
- package/dist/esm/core/authService/emailOtpChallengeOperations.js +0 -123
- package/dist/esm/core/authService/emailOtpChallengeProof.js +0 -183
- package/dist/esm/core/authService/emailOtpChallengeVerification.js +0 -264
- package/dist/esm/core/authService/emailOtpChallenges.js +0 -225
- package/dist/esm/core/authService/emailOtpDelivery.js +0 -134
- package/dist/esm/core/authService/emailOtpGrant.js +0 -43
- package/dist/esm/core/authService/emailOtpRegistrationEnrollment.js +0 -144
- package/dist/esm/core/authService/emailOtpUnlock.js +0 -174
- package/dist/esm/core/authService/googleEmailOtpOperations.js +0 -141
- package/dist/esm/core/authService/googleEmailOtpRegistration.js +0 -587
- package/dist/esm/core/authService/identity.js +0 -42
- package/dist/esm/core/authService/identityOperations.js +0 -32
- package/dist/esm/core/authService/nearAccountOperations.js +0 -229
- package/dist/esm/core/authService/nearPublicKeyMetadata.js +0 -108
- package/dist/esm/core/authService/oidcVerification.js +0 -249
- package/dist/esm/core/authService/registrationThresholdHelpers.js +0 -30
- package/dist/esm/core/authService/runtime.js +0 -45
- package/dist/esm/core/authService/storeRegistry.js +0 -102
- package/dist/esm/core/authService/thresholdStoreSummary.js +0 -32
- package/dist/esm/core/authService/webauthnAuthority.js +0 -17
- package/dist/esm/core/defaultConfigsServer.js +0 -9
- package/dist/esm/core/hostedAccountIds.js +0 -225
- package/dist/esm/core/routerAbSigning/createRouterAbSigningRuntimes.js +0 -84
- package/dist/esm/core/signingLanes/LaneAggregateRevocationApplicationService.js +0 -86
- package/dist/esm/core/signingLanes/LaneEnrollmentActivation.js +0 -324
- package/dist/esm/core/signingLanes/LaneEnrollmentRevocation.js +0 -173
- package/dist/esm/core/signingLanes/LaneLifecycleApplicationService.js +0 -198
- package/dist/esm/core/signingLanes/ecdsaServerRetirement.js +0 -73
- package/dist/esm/core/signingLanes/ed25519ServerRetirement.js +0 -68
- package/dist/esm/core/signingLanes/signingWorkerLaneMaterialIdentity.js +0 -0
- package/dist/esm/core/storeBackends.js +0 -208
- package/dist/esm/core/utils.js +0 -14
- package/dist/esm/core/webAuthnStoreBackends.js +0 -198
- package/dist/esm/router/cloudflare/d1/near/d1NearPublicKeyStore.js +0 -49
- package/dist/esm/router/cloudflare/d1/signingLanes/d1EcdsaLanePrivateBindingResolver.js +0 -10
- package/dist/esm/router/cloudflare/d1/signingLanes/d1LaneAggregateRevocationApplicationService.js +0 -22
- package/dist/esm/router/cloudflare/d1/signingLanes/d1LaneEffectJournalStore.js +0 -166
- package/dist/esm/router/cloudflare/d1/signingLanes/d1LaneEnrollmentGateway.js +0 -38
- package/dist/esm/router/cloudflare/d1/signingLanes/d1LaneLifecycleApplicationService.js +0 -20
- package/dist/esm/router/cloudflare/d1/signingLanes/d1LaneLifecycleStore.js +0 -1459
- package/dist/esm/router/cloudflare/d1/signingLanes/d1LaneLockStore.js +0 -114
- package/dist/esm/router/cloudflare/d1/signingLanes/d1LaneProtocolCommitter.js +0 -16
- package/dist/esm/router/cloudflare/d1/signingLanes/d1LaneRecords.js +0 -171
- package/dist/esm/router/cloudflare/d1/signingLanes/index.js +0 -10
- package/dist/esm/router/cloudflare/durableObjects/thresholdStore.js +0 -397
- package/dist/esm/router/cloudflare/signingLanes/cloudflareLaneCurveExecution.js +0 -597
- package/dist/esm/router/cloudflare/signingLanes/cloudflareLaneProtocolCommitter.js +0 -273
- package/dist/esm/router/cloudflare/signingLanes/index.js +0 -4
- package/dist/esm/router/cloudflare/signingLanes/linkedDeviceEd25519CeremonyBinding.js +0 -32
- package/dist/esm/router/transport/fetch/routes/nearPublicKeys.js +0 -27
- package/dist/esm/shared-ts/src/signing-lanes/rotation.js +0 -8
- package/dist/esm/shared-ts/src/signing-lanes/rotationDigests.js +0 -358
- package/dist/esm/shared-ts/src/signing-lanes/rotationLifecycle.js +0 -313
- package/dist/esm/shared-ts/src/signing-lanes/rotationParsers.js +0 -532
- package/dist/esm/shared-ts/src/signing-lanes/rotationProtocolParsers.js +0 -323
- package/dist/esm/shared-ts/src/signing-lanes/rotationWireFields.js +0 -59
- package/dist/types/shared-ts/src/signing-lanes/participantDigest.typecheck.d.ts +0 -2
- package/dist/types/shared-ts/src/signing-lanes/rotation.typecheck.d.ts +0 -2
- package/dist/types/shared-ts/src/signing-lanes/rotationDigests.d.ts +0 -13
- package/dist/types/shared-ts/src/signing-lanes/rotationLifecycle.d.ts +0 -78
- package/dist/types/shared-ts/src/signing-lanes/rotationParsers.d.ts +0 -27
- package/dist/types/shared-ts/src/signing-lanes/rotationProtocolParsers.d.ts +0 -6
- package/dist/types/shared-ts/src/signing-lanes/rotationWireFields.d.ts +0 -20
- package/dist/types/shared-ts/src/wallet-recovery/recoveryCodeAttempt.d.ts +0 -59
- package/dist/types/wallet-server/src/core/AuthService.d.ts +0 -3
- package/dist/types/wallet-server/src/core/NearPublicKeyStore.d.ts +0 -48
- package/dist/types/wallet-server/src/core/ThresholdService/stores/CloudflareDurableObjectStore.d.ts +0 -21
- package/dist/types/wallet-server/src/core/ThresholdService/stores/KeyStore.d.ts +0 -40
- package/dist/types/wallet-server/src/core/ThresholdService/stores/SessionStore.d.ts +0 -98
- package/dist/types/wallet-server/src/core/ThresholdService/stores/StoreConfig.d.ts +0 -4
- package/dist/types/wallet-server/src/core/ThresholdService/stores/ThresholdStoreConfig.typecheck.d.ts +0 -2
- package/dist/types/wallet-server/src/core/ThresholdService/stores/exportReplayGuard.d.ts +0 -3
- package/dist/types/wallet-server/src/core/authService/AuthService.d.ts +0 -490
- package/dist/types/wallet-server/src/core/authService/bytes.d.ts +0 -3
- package/dist/types/wallet-server/src/core/authService/configValues.d.ts +0 -7
- package/dist/types/wallet-server/src/core/authService/emailOtpChallengeOperations.d.ts +0 -109
- package/dist/types/wallet-server/src/core/authService/emailOtpChallengeProof.d.ts +0 -169
- package/dist/types/wallet-server/src/core/authService/emailOtpChallengeVerification.d.ts +0 -47
- package/dist/types/wallet-server/src/core/authService/emailOtpChallenges.d.ts +0 -86
- package/dist/types/wallet-server/src/core/authService/emailOtpDelivery.d.ts +0 -66
- package/dist/types/wallet-server/src/core/authService/emailOtpGrant.d.ts +0 -43
- package/dist/types/wallet-server/src/core/authService/emailOtpRegistrationEnrollment.d.ts +0 -49
- package/dist/types/wallet-server/src/core/authService/emailOtpUnlock.d.ts +0 -64
- package/dist/types/wallet-server/src/core/authService/googleEmailOtpOperations.d.ts +0 -126
- package/dist/types/wallet-server/src/core/authService/googleEmailOtpRegistration.d.ts +0 -169
- package/dist/types/wallet-server/src/core/authService/identity.d.ts +0 -25
- package/dist/types/wallet-server/src/core/authService/identityOperations.d.ts +0 -19
- package/dist/types/wallet-server/src/core/authService/nearAccountOperations.d.ts +0 -55
- package/dist/types/wallet-server/src/core/authService/nearPublicKeyMetadata.d.ts +0 -44
- package/dist/types/wallet-server/src/core/authService/oidcVerification.d.ts +0 -66
- package/dist/types/wallet-server/src/core/authService/registrationThresholdHelpers.d.ts +0 -11
- package/dist/types/wallet-server/src/core/authService/runtime.d.ts +0 -20
- package/dist/types/wallet-server/src/core/authService/storeRegistry.d.ts +0 -53
- package/dist/types/wallet-server/src/core/authService/thresholdStoreSummary.d.ts +0 -3
- package/dist/types/wallet-server/src/core/authService/webauthnAuthority.d.ts +0 -5
- package/dist/types/wallet-server/src/core/defaultConfigsServer.d.ts +0 -5
- package/dist/types/wallet-server/src/core/hostedAccountIds.d.ts +0 -16
- package/dist/types/wallet-server/src/core/routerAbSigning/createRouterAbSigningRuntimes.d.ts +0 -16
- package/dist/types/wallet-server/src/core/signingLanes/LaneAggregateRevocationApplicationService.d.ts +0 -36
- package/dist/types/wallet-server/src/core/signingLanes/LaneEffectJournalStore.d.ts +0 -62
- package/dist/types/wallet-server/src/core/signingLanes/LaneEnrollmentActivation.d.ts +0 -13
- package/dist/types/wallet-server/src/core/signingLanes/LaneEnrollmentRevocation.d.ts +0 -24
- package/dist/types/wallet-server/src/core/signingLanes/LaneLifecycleApplicationService.d.ts +0 -141
- package/dist/types/wallet-server/src/core/signingLanes/LaneLifecycleStore.d.ts +0 -228
- package/dist/types/wallet-server/src/core/signingLanes/ecdsaServerRetirement.d.ts +0 -58
- package/dist/types/wallet-server/src/core/signingLanes/ed25519ServerRetirement.d.ts +0 -30
- package/dist/types/wallet-server/src/core/signingLanes/signingWorkerLaneMaterialIdentity.d.ts +0 -4
- package/dist/types/wallet-server/src/core/storeBackends.d.ts +0 -83
- package/dist/types/wallet-server/src/core/utils.d.ts +0 -3
- package/dist/types/wallet-server/src/core/webAuthnStoreBackends.d.ts +0 -96
- package/dist/types/wallet-server/src/router/cloudflare/d1/near/d1NearPublicKeyStore.d.ts +0 -29
- package/dist/types/wallet-server/src/router/cloudflare/d1/signingLanes/d1EcdsaLanePrivateBindingResolver.d.ts +0 -4
- package/dist/types/wallet-server/src/router/cloudflare/d1/signingLanes/d1LaneAggregateRevocationApplicationService.d.ts +0 -4
- package/dist/types/wallet-server/src/router/cloudflare/d1/signingLanes/d1LaneEffectJournalStore.d.ts +0 -24
- package/dist/types/wallet-server/src/router/cloudflare/d1/signingLanes/d1LaneEnrollmentGateway.d.ts +0 -20
- package/dist/types/wallet-server/src/router/cloudflare/d1/signingLanes/d1LaneLifecycleApplicationService.d.ts +0 -13
- package/dist/types/wallet-server/src/router/cloudflare/d1/signingLanes/d1LaneLifecycleStore.d.ts +0 -51
- package/dist/types/wallet-server/src/router/cloudflare/d1/signingLanes/d1LaneLockStore.d.ts +0 -28
- package/dist/types/wallet-server/src/router/cloudflare/d1/signingLanes/d1LaneProtocolCommitter.d.ts +0 -5
- package/dist/types/wallet-server/src/router/cloudflare/d1/signingLanes/d1LaneRecords.d.ts +0 -107
- package/dist/types/wallet-server/src/router/cloudflare/d1/signingLanes/index.d.ts +0 -10
- package/dist/types/wallet-server/src/router/cloudflare/durableObjects/thresholdStore.d.ts +0 -18
- package/dist/types/wallet-server/src/router/cloudflare/signingLanes/cloudflareLaneCurveExecution.d.ts +0 -217
- package/dist/types/wallet-server/src/router/cloudflare/signingLanes/cloudflareLaneProtocolCommitter.d.ts +0 -73
- package/dist/types/wallet-server/src/router/cloudflare/signingLanes/index.d.ts +0 -4
- package/dist/types/wallet-server/src/router/cloudflare/signingLanes/linkedDeviceEd25519CeremonyBinding.d.ts +0 -6
- package/dist/types/wallet-server/src/router/transport/fetch/routes/nearPublicKeys.d.ts +0 -3
- /package/dist/esm/{core/signingLanes/LaneEffectJournalStore.js → authorization/recoveryRouting.js} +0 -0
- /package/dist/esm/{core/signingLanes/LaneLifecycleStore.js → authorization/sessionRouting.js} +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { parseWalletId } from "../../../../shared-ts/src/utils/domainIds.js";
|
|
1
2
|
import { isPlainObject } from "../../../../shared-ts/src/utils/validation.js";
|
|
2
3
|
import { routerAbMpcMaterialActivationRefToWire } from "../../../../shared-ts/src/utils/routerAbNormalSigningIdentity.js";
|
|
3
4
|
import { parseRouterAbEd25519YaoRegistrationAdmissionRequestV1 } from "../../../../shared-ts/src/utils/routerAbEd25519Yao.js";
|
|
4
5
|
import { deriveSigningRootId } from "../../../../shared-ts/src/threshold/signingRootScope.js";
|
|
5
6
|
import { secureRandomBase64Url } from "../../../../shared-ts/src/utils/secureRandomId.js";
|
|
6
7
|
import { ROUTER_AB_ED25519_NORMAL_SIGNING_STATE_KIND } from "../../../../shared-ts/src/utils/signingSessionSeal.js";
|
|
7
|
-
import { thresholdEd25519AuthorityScopeFromWalletAuthAuthority } from "../../../../core/ThresholdService/validation.js";
|
|
8
8
|
import { computeAddSignerNearEd25519SigningKeyId, computeRegistrationNearEd25519SigningKeyId } from "../../../../shared-ts/src/utils/registrationIds.js";
|
|
9
9
|
import { registrationNearEd25519BranchKey } from "../../../../shared-ts/src/utils/registrationSignerPlan.js";
|
|
10
10
|
import "../../../../shared-ts/src/threshold/sessionPolicy.js";
|
|
11
|
+
import { thresholdEd25519AuthorityScopeFromWalletAuthAuthority } from "../../../../core/ThresholdService/validation.js";
|
|
11
12
|
import { createRouterApiModule } from "../../../framework/modules.js";
|
|
12
13
|
import { InMemoryRouterAbEd25519YaoRegistrationStateV1, createRouterAbEd25519YaoRegistrationModule } from "../registration/routerAbEd25519YaoRegistration.js";
|
|
13
14
|
import { InMemoryRouterAbEd25519YaoRegistrationIntentAuthorizationStateV1 } from "../registration/routerAbEd25519YaoRegistrationIntentAuthorization.js";
|
|
@@ -83,9 +84,12 @@ function isDispatchRootMap(input) {
|
|
|
83
84
|
for (const [key, value] of input) if (typeof key !== "string" || parseRouterAbEd25519YaoTenantRootWireV1(value) === null) return false;
|
|
84
85
|
return true;
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
-
if (!(input
|
|
88
|
-
for (const
|
|
87
|
+
function isWalletOwnershipMap(input) {
|
|
88
|
+
if (!isStringMap(input)) return false;
|
|
89
|
+
for (const [key, walletId] of input) {
|
|
90
|
+
const parsed = parseWalletId(walletId);
|
|
91
|
+
if (!key || !parsed.ok || parsed.value !== walletId) return false;
|
|
92
|
+
}
|
|
89
93
|
return true;
|
|
90
94
|
}
|
|
91
95
|
function hasProductStateCollections(input) {
|
|
@@ -96,7 +100,7 @@ function hasProductStateCollections(input) {
|
|
|
96
100
|
const recovery = input.recovery;
|
|
97
101
|
const exportState = input.export;
|
|
98
102
|
if (!isPlainObject(registration) || !isPlainObject(authorization) || !isPlainObject(recovery) || !isPlainObject(exportState)) return false;
|
|
99
|
-
return isStringMapWithStateKinds(registration.states, REGISTRATION_STATE_KINDS) && isStringMap(registration.lifecycleSessions) && (registration.admissionClaims === void 0 || isStringMapWithStateKinds(registration.admissionClaims, REGISTRATION_ADMISSION_CLAIM_KINDS)) && isDispatchRootMap(registration.dispatchRoots) && Array.isArray(authorization.authorities) && authorization.authorities.every((authority) => isPlainObject(authority) && INTENT_AUTHORITY_KINDS.has(String(authority.kind))) && isStringMapWithStateKinds(recovery.capabilities, CAPABILITY_STATE_KINDS) && isStringMap(recovery.identityCapabilities) && isStringMapWithStateKinds(recovery.recoveries, RECOVERY_STATE_KINDS) && isStringMap(recovery.recoverySessions) && isStringMapWithStateKinds(exportState.exports, EXPORT_STATE_KINDS) &&
|
|
103
|
+
return isStringMapWithStateKinds(registration.states, REGISTRATION_STATE_KINDS) && isStringMap(registration.lifecycleSessions) && (registration.admissionClaims === void 0 || isStringMapWithStateKinds(registration.admissionClaims, REGISTRATION_ADMISSION_CLAIM_KINDS)) && isDispatchRootMap(registration.dispatchRoots) && Array.isArray(authorization.authorities) && authorization.authorities.every((authority) => isPlainObject(authority) && INTENT_AUTHORITY_KINDS.has(String(authority.kind))) && isStringMapWithStateKinds(recovery.capabilities, CAPABILITY_STATE_KINDS) && isStringMap(recovery.identityCapabilities) && isStringMapWithStateKinds(recovery.recoveries, RECOVERY_STATE_KINDS) && isStringMap(recovery.recoverySessions) && isStringMapWithStateKinds(exportState.exports, EXPORT_STATE_KINDS) && isWalletOwnershipMap(exportState.authorizationNonceOwners) && isWalletOwnershipMap(exportState.authorizationUncertainOwners);
|
|
100
104
|
}
|
|
101
105
|
function parseRouterAbEd25519YaoProductRegistrationStateV1(input) {
|
|
102
106
|
if (!hasProductStateCollections(input)) return {
|
|
@@ -105,7 +109,6 @@ function parseRouterAbEd25519YaoProductRegistrationStateV1(input) {
|
|
|
105
109
|
};
|
|
106
110
|
const registration = input.registration;
|
|
107
111
|
const admissionClaims = registration.admissionClaims === void 0 ? /* @__PURE__ */ new Map() : registration.admissionClaims;
|
|
108
|
-
const authorizationUncertain = input.export.authorizationUncertain === void 0 ? /* @__PURE__ */ new Set() : input.export.authorizationUncertain;
|
|
109
112
|
return {
|
|
110
113
|
ok: true,
|
|
111
114
|
value: {
|
|
@@ -120,8 +123,8 @@ function parseRouterAbEd25519YaoProductRegistrationStateV1(input) {
|
|
|
120
123
|
recovery: input.recovery,
|
|
121
124
|
export: {
|
|
122
125
|
exports: input.export.exports,
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
authorizationNonceOwners: input.export.authorizationNonceOwners,
|
|
127
|
+
authorizationUncertainOwners: input.export.authorizationUncertainOwners
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
130
|
};
|
|
@@ -122,15 +122,16 @@ function parseRouterAbEd25519YaoProductRegistrationPartitionRecordJsonV1(input)
|
|
|
122
122
|
return isVersionedJsonObject(input) ? input : null;
|
|
123
123
|
}
|
|
124
124
|
function isEmptyCeremonyState(state) {
|
|
125
|
-
return state.registration.states.size === 0 && state.registration.lifecycleSessions.size === 0 && state.registration.admissionClaims.size === 0 && state.authorization.authorities.length === 0 && state.recovery.recoveries.size === 0 && state.export.exports.size === 0;
|
|
125
|
+
return state.registration.states.size === 0 && state.registration.lifecycleSessions.size === 0 && state.registration.admissionClaims.size === 0 && state.registration.dispatchRoots.size === 0 && state.authorization.authorities.length === 0 && state.recovery.recoveries.size === 0 && state.export.exports.size === 0;
|
|
126
126
|
}
|
|
127
127
|
function isEmptySharedState(state) {
|
|
128
|
-
return state.recovery.capabilities.size === 0 && state.recovery.identityCapabilities.size === 0 && state.recovery.recoverySessions.size === 0 && state.export.
|
|
128
|
+
return state.recovery.capabilities.size === 0 && state.recovery.identityCapabilities.size === 0 && state.recovery.recoverySessions.size === 0 && state.export.authorizationNonceOwners.size === 0 && state.export.authorizationUncertainOwners.size === 0;
|
|
129
129
|
}
|
|
130
130
|
function isCeremonyStateOwnedByLifecycle(state, lifecycleId) {
|
|
131
131
|
for (const value of state.registration.states.values()) if (value.admissionRequest.scope.lifecycle_id !== lifecycleId) return false;
|
|
132
132
|
for (const key of state.registration.lifecycleSessions.keys()) if (key !== lifecycleId) return false;
|
|
133
133
|
for (const key of state.registration.admissionClaims.keys()) if (key !== lifecycleId) return false;
|
|
134
|
+
for (const key of state.registration.dispatchRoots.keys()) if (key !== lifecycleId) return false;
|
|
134
135
|
for (const authority of state.authorization.authorities) if (authority.admissionRequest.scope.lifecycle_id !== lifecycleId) return false;
|
|
135
136
|
for (const value of state.recovery.recoveries.values()) if (value.context.admissionRequest.scope.lifecycle_id !== lifecycleId) return false;
|
|
136
137
|
for (const value of state.export.exports.values()) if (value.request.scope.lifecycle_id !== lifecycleId) return false;
|
|
@@ -19,8 +19,8 @@ function partitionRouterAbEd25519YaoProductRegistrationStateV1(state, lifecycleI
|
|
|
19
19
|
recoveryCapabilities: new Map(state.recovery.capabilities),
|
|
20
20
|
recoveryIdentityCapabilities: new Map(state.recovery.identityCapabilities),
|
|
21
21
|
recoverySessions: new Map(state.recovery.recoverySessions),
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
exportAuthorizationNonceOwners: new Map(state.export.authorizationNonceOwners),
|
|
23
|
+
exportAuthorizationUncertainOwners: new Map(state.export.authorizationUncertainOwners)
|
|
24
24
|
},
|
|
25
25
|
ceremony: {
|
|
26
26
|
kind: "router_ab_ed25519_yao_product_registration_ceremony_state_v1",
|
|
@@ -75,8 +75,8 @@ function mergeRouterAbEd25519YaoProductRegistrationStatePartitionV1(base, partit
|
|
|
75
75
|
},
|
|
76
76
|
export: {
|
|
77
77
|
exports,
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
authorizationNonceOwners: new Map(partition.shared.exportAuthorizationNonceOwners),
|
|
79
|
+
authorizationUncertainOwners: new Map(partition.shared.exportAuthorizationUncertainOwners)
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
}
|
|
@@ -102,8 +102,8 @@ function boundedRouterAbEd25519YaoProductRegistrationSharedStateV1(source) {
|
|
|
102
102
|
recoveryCapabilities,
|
|
103
103
|
recoveryIdentityCapabilities: retainedRecoveryIdentityCapabilities(source.recoveryIdentityCapabilities, recoveryCapabilities),
|
|
104
104
|
recoverySessions: new Map(source.recoverySessions),
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
exportAuthorizationNonceOwners: new Map(source.exportAuthorizationNonceOwners),
|
|
106
|
+
exportAuthorizationUncertainOwners: new Map(source.exportAuthorizationUncertainOwners)
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
function boundedRecoveryCapabilities(source) {
|
|
@@ -45,8 +45,8 @@ function resolveTraceContext(request) {
|
|
|
45
45
|
var InMemoryRouterAbEd25519YaoExportStateV1 = class {
|
|
46
46
|
constructor() {
|
|
47
47
|
this.exports = /* @__PURE__ */ new Map();
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
48
|
+
this.authorizationNonceOwners = /* @__PURE__ */ new Map();
|
|
49
|
+
this.authorizationUncertainOwners = /* @__PURE__ */ new Map();
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
function bytesToHex(bytes) {
|
|
@@ -177,10 +177,10 @@ var InMemoryRouterAbEd25519YaoExportService = class {
|
|
|
177
177
|
this.state = state;
|
|
178
178
|
}
|
|
179
179
|
authorizationIsUncertain(request) {
|
|
180
|
-
return this.state.
|
|
180
|
+
return this.state.authorizationUncertainOwners.has(exportKey(request));
|
|
181
181
|
}
|
|
182
182
|
recordAuthorizationUncertain(request) {
|
|
183
|
-
this.state.
|
|
183
|
+
this.state.authorizationUncertainOwners.set(exportKey(request), request.scope.account_id);
|
|
184
184
|
}
|
|
185
185
|
async admitExport(request, authorizationIdentity, admission, factorRelease, traceContext) {
|
|
186
186
|
const admitted = await admission.admit();
|
|
@@ -256,11 +256,11 @@ var InMemoryRouterAbEd25519YaoExportService = class {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
const nonce = bytesToHex(request.authorization.nonce);
|
|
259
|
-
if (this.state.
|
|
259
|
+
if (this.state.authorizationNonceOwners.has(nonce)) return {
|
|
260
260
|
kind: "completed",
|
|
261
261
|
value: authorizationConflict("export_authorization_replayed", "Ed25519 Yao export authorization was already used")
|
|
262
262
|
};
|
|
263
|
-
this.state.
|
|
263
|
+
this.state.authorizationNonceOwners.set(nonce, request.scope.account_id);
|
|
264
264
|
this.state.exports.set(key, {
|
|
265
265
|
kind: "authorized",
|
|
266
266
|
request,
|
package/dist/esm/router/domains/ed25519Yao/export/routerAbEd25519YaoExportRequestScopedCloudflare.js
CHANGED
|
@@ -2,6 +2,7 @@ import { base64UrlEncode } from "../../../../shared-ts/src/utils/base64.js";
|
|
|
2
2
|
import { alphabetizeStringify, sha256BytesUtf8 } from "../../../../shared-ts/src/utils/digests.js";
|
|
3
3
|
import "../../../../shared-ts/src/utils/encoders.js";
|
|
4
4
|
import "../../../../shared-ts/src/utils/routerAbEd25519Yao.js";
|
|
5
|
+
import { publishWalletLifecycleHome } from "../../../../authorization/lifecycleRouting.js";
|
|
5
6
|
import { normalizeCorsOrigin } from "../../../../core/SessionService.js";
|
|
6
7
|
import { ROUTER_AB_TRACE_ID_HEADER_V1, createRouterAbTraceContextV1, parseRouterAbTraceContextV1 } from "../../../../shared-ts/src/utils/routerAbTraceContext.js";
|
|
7
8
|
import { json, readJson } from "../../../framework/http.js";
|
|
@@ -159,6 +160,8 @@ async function handleAdmissionRequest(context, raw) {
|
|
|
159
160
|
}, { status: 403 });
|
|
160
161
|
const admission = await runAuthorization(context, parsed, expectedOrigin);
|
|
161
162
|
if (!admission.ok) return exportResponse(admission);
|
|
163
|
+
const published = await publishWalletLifecycleHome(context.input.lifecycleRouting ?? null, "yao_export", parsed.protocol);
|
|
164
|
+
if (!published.ok) return exportResponse(published);
|
|
162
165
|
const result = await runAdmission(context, parsed.protocol, admission.authorizationIdentity);
|
|
163
166
|
if (result.ok) return json({
|
|
164
167
|
protocol: result.value,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parseRouterAbEd25519YaoRecoveryActivationExecuteRequestV1, parseRouterAbEd25519YaoRecoveryActivationRequestV1, parseRouterAbEd25519YaoRecoveryAdmissionRequestV1, parseRouterAbEd25519YaoRecoveryStatusRequestV1, parseRouterAbEd25519YaoWarmRecoveryBootstrapRequestV1 } from "../../../../shared-ts/src/utils/routerAbEd25519Yao.js";
|
|
2
|
+
import { publishWalletLifecycleHome } from "../../../../authorization/lifecycleRouting.js";
|
|
2
3
|
import { ROUTER_AB_TRACE_ID_HEADER_V1, createRouterAbTraceContextV1, parseRouterAbTraceContextV1 } from "../../../../shared-ts/src/utils/routerAbTraceContext.js";
|
|
3
4
|
import { json, readJson } from "../../../framework/http.js";
|
|
4
5
|
import { InMemoryRouterAbEd25519YaoRecoveryService, buildWarmRecoveryBootstrapResponse, recoveryAuthorizationBinding } from "./routerAbEd25519YaoRecovery.js";
|
|
@@ -20,6 +21,13 @@ var RecoveryAdmissionRequestRun = class {
|
|
|
20
21
|
value: authorized
|
|
21
22
|
};
|
|
22
23
|
const prepared = this.service(state).prepareAdmitRecovery(this.request, recoveryAuthorizationBinding(authorized.authorization), await this.context.input.backend.resolveRecoveryDispatchRoot(this.request), Date.now());
|
|
24
|
+
if (prepared.kind !== "failed") {
|
|
25
|
+
const published = await publishWalletLifecycleHome(this.context.input.lifecycleRouting ?? null, "yao_recovery", this.request);
|
|
26
|
+
if (!published.ok) return {
|
|
27
|
+
kind: "rejected",
|
|
28
|
+
value: published
|
|
29
|
+
};
|
|
30
|
+
}
|
|
23
31
|
switch (prepared.kind) {
|
|
24
32
|
case "claimed": return {
|
|
25
33
|
kind: "claimed",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { normalizeOptionalTrimmedString } from "../../../shared-ts/src/utils/normalize.js";
|
|
2
|
-
import "../../../shared-ts/src/utils/validation.js";
|
|
3
2
|
import { WALLET_EMAIL_OTP_UNLOCK_OPERATION, isWalletEmailOtpLoginOperation, isWalletUnlockBackend } from "../../../shared-ts/src/utils/emailOtpDomain.js";
|
|
4
3
|
//#region src/router/domains/emailOtp/emailOtpRequestValidation.ts
|
|
5
4
|
function parseWalletUnlockBackend(raw) {
|
|
@@ -84,14 +84,8 @@ async function retrievePasskeyCustodyEnvelope(input) {
|
|
|
84
84
|
envelope: lookup.envelope,
|
|
85
85
|
storeVersion: lookup.storeVersion
|
|
86
86
|
};
|
|
87
|
-
case "retired": return {
|
|
88
|
-
|
|
89
|
-
retiredAtMs: lookup.retiredAtMs
|
|
90
|
-
};
|
|
91
|
-
case "revoked": return {
|
|
92
|
-
kind: "revoked",
|
|
93
|
-
revokedAtMs: lookup.revokedAtMs
|
|
94
|
-
};
|
|
87
|
+
case "retired": return { kind: "retired" };
|
|
88
|
+
case "revoked": return { kind: "revoked" };
|
|
95
89
|
case "digest_mismatch":
|
|
96
90
|
input.logger.error("[passkey-custody] stored envelope failed its ciphertext digest", {
|
|
97
91
|
walletId: String(request.locator.walletId),
|
|
@@ -150,14 +150,8 @@ async function commitWalletCustodyRegistration(input) {
|
|
|
150
150
|
envelopeStoreVersion: stored.envelopeStoreVersion,
|
|
151
151
|
recoverySetStoreVersion: stored.recoverySetStoreVersion
|
|
152
152
|
};
|
|
153
|
-
case "already_exists": return {
|
|
154
|
-
|
|
155
|
-
key: stored.key
|
|
156
|
-
};
|
|
157
|
-
case "custody_already_established": return {
|
|
158
|
-
kind: "custody_already_established",
|
|
159
|
-
walletId: stored.walletId
|
|
160
|
-
};
|
|
153
|
+
case "already_exists": return { kind: "already_exists" };
|
|
154
|
+
case "custody_already_established": return { kind: "custody_already_established" };
|
|
161
155
|
case "inconsistent": return {
|
|
162
156
|
kind: "rejected",
|
|
163
157
|
reason: stored.reason
|
|
@@ -47,18 +47,6 @@ function registrationMaterialSourceV1(input) {
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
function routerAbNormalSigningMaterialSourceFromActiveLaneV1(input) {
|
|
51
|
-
const groupPublicKey = input.groupPublicKey.trim();
|
|
52
|
-
if (groupPublicKey.length === 0) throw new Error("active lane group public key is required");
|
|
53
|
-
return {
|
|
54
|
-
kind: "rotatable_lane",
|
|
55
|
-
lookup: {
|
|
56
|
-
identity: input.identity,
|
|
57
|
-
admittedLaneIdentityDigestB64u: input.admittedLaneIdentityDigestB64u
|
|
58
|
-
},
|
|
59
|
-
group_public_key: groupPublicKey
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
50
|
function nonEmptyString(value) {
|
|
63
51
|
return String(value || "").trim();
|
|
64
52
|
}
|
|
@@ -395,7 +383,7 @@ async function buildRouterAbEd25519PrivateSigningWorkerBody(input) {
|
|
|
395
383
|
const scope = parseRouterAbEd25519NormalSigningScopeV2(input.body.scope);
|
|
396
384
|
const signingContext = privateSigningAuthorizationContext(scope, input.authorization);
|
|
397
385
|
const trustedSourceDigest = await privateSigningTrustedSourceDigest(input.headers);
|
|
398
|
-
const materialSource =
|
|
386
|
+
const materialSource = registrationMaterialSourceV1({
|
|
399
387
|
accountId: scope.account_id,
|
|
400
388
|
materialActivationId: scope.material_activation.activation_id,
|
|
401
389
|
signingWorkerId: scope.signing_worker_id
|
|
@@ -490,8 +478,7 @@ async function buildRouterAbEcdsaDerivationPrivateSigningWorkerBody(input) {
|
|
|
490
478
|
request,
|
|
491
479
|
requestDigest: await routerAbEcdsaDerivationEvmDigestSigningRequestDigestV1(request),
|
|
492
480
|
signingContext,
|
|
493
|
-
trustedSourceDigest
|
|
494
|
-
materialSource: input.materialSource
|
|
481
|
+
trustedSourceDigest
|
|
495
482
|
});
|
|
496
483
|
}
|
|
497
484
|
const request = parseRouterAbEcdsaDerivationEvmDigestSigningFinalizeRequestV1(input.body);
|
|
@@ -500,8 +487,7 @@ async function buildRouterAbEcdsaDerivationPrivateSigningWorkerBody(input) {
|
|
|
500
487
|
request,
|
|
501
488
|
requestDigest: await routerAbEcdsaDerivationEvmDigestSigningFinalizeCoreRequestDigestV1(request),
|
|
502
489
|
signingContext,
|
|
503
|
-
trustedSourceDigest
|
|
504
|
-
materialSource: input.materialSource
|
|
490
|
+
trustedSourceDigest
|
|
505
491
|
});
|
|
506
492
|
}
|
|
507
493
|
function privateEcdsaDerivationSigningWorkerBody(input) {
|
|
@@ -514,7 +500,7 @@ function privateEcdsaDerivationSigningWorkerBody(input) {
|
|
|
514
500
|
intentDigest: input.requestDigest,
|
|
515
501
|
trustedSourceDigest: input.trustedSourceDigest
|
|
516
502
|
}),
|
|
517
|
-
material_source:
|
|
503
|
+
material_source: registrationMaterialSourceV1({
|
|
518
504
|
accountId: input.request.scope.wallet_id,
|
|
519
505
|
materialActivationId: input.request.scope.material_activation.activation_id,
|
|
520
506
|
signingWorkerId: input.request.scope.signing_worker.server_id
|
|
@@ -544,6 +530,6 @@ async function postRouterAbSigningWorkerJson(input) {
|
|
|
544
530
|
};
|
|
545
531
|
}
|
|
546
532
|
//#endregion
|
|
547
|
-
export { ROUTER_AB_ECDSA_DERIVATION_PRIVATE_SIGNING_PATHS, ROUTER_AB_ED25519_PRIVATE_SIGNING_PATHS, buildRouterAbEcdsaDerivationPrivateSigningWorkerBody, buildRouterAbEd25519PrivateSigningWorkerBody, computeRouterAbEd25519NormalSigningAdmissionMaterial, isRouterAbEcdsaSigningWorkerOperationInProgress, parseRouterAbEd25519NormalSigningScopeV2, postRouterAbSigningWorkerJson, replayResponseFromSigningWorkerResult, requirePrivateSigningDigest
|
|
533
|
+
export { ROUTER_AB_ECDSA_DERIVATION_PRIVATE_SIGNING_PATHS, ROUTER_AB_ED25519_PRIVATE_SIGNING_PATHS, buildRouterAbEcdsaDerivationPrivateSigningWorkerBody, buildRouterAbEd25519PrivateSigningWorkerBody, computeRouterAbEd25519NormalSigningAdmissionMaterial, isRouterAbEcdsaSigningWorkerOperationInProgress, parseRouterAbEd25519NormalSigningScopeV2, postRouterAbSigningWorkerJson, replayResponseFromSigningWorkerResult, requirePrivateSigningDigest };
|
|
548
534
|
|
|
549
535
|
//# sourceMappingURL=routerAbPrivateSigningWorker.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { mpcMaterialActivationRefsEqual } from "../../../shared-ts/src/utils/domainIds.js";
|
|
2
2
|
import { CAPABILITY_KINDS, EVM_ECDSA_MPC_OPERATION_KINDS, NEAR_ED25519_MPC_OPERATION_KINDS } from "../../../shared-ts/src/authorization/capabilityKinds.js";
|
|
3
3
|
import { buildWalletSessionCapabilitySubjectsV1, walletSessionCapabilitySubjectsV1Equal } from "../../../authorization/domain.js";
|
|
4
|
-
import { computeOwnerLaneParticipantBindingDigestV1 } from "../../../shared-ts/src/signing-lanes/ownerContinuity.js";
|
|
5
4
|
import { buildPreparedOwnerWalletExecution } from "../../../shared-ts/src/signing-lanes/execution.js";
|
|
5
|
+
import { computeOwnerLaneParticipantBindingDigestV1 } from "../../../shared-ts/src/signing-lanes/ownerContinuity.js";
|
|
6
6
|
import "../../../shared-ts/src/signing-lanes/index.js";
|
|
7
7
|
//#region src/router/domains/signingOperations/walletExecutionAdmission.ts
|
|
8
8
|
function validateWalletSessionAuthorizationV2Context(input) {
|
|
@@ -74,8 +74,7 @@ function resolveWalletSessionAuthorizationV2AdministrationAdmission(input) {
|
|
|
74
74
|
if (!subject || subject.authorityId !== input.authority.authorityId) return admissionRefused("capability_subject_mismatch");
|
|
75
75
|
return {
|
|
76
76
|
ok: true,
|
|
77
|
-
operationKind: "link_devices"
|
|
78
|
-
authorityId: input.authority.authorityId
|
|
77
|
+
operationKind: "link_devices"
|
|
79
78
|
};
|
|
80
79
|
}
|
|
81
80
|
default: return assertNeverWalletSessionAuthorizationV2AdministrationOperation(input.operation.kind);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { parseWalletAuthMethodId, parseWalletAuthorityId, parseWalletId } from "../../../shared-ts/src/utils/domainIds.js";
|
|
2
|
+
import { parseDeviceId } from "../../../shared-ts/src/authorization/capabilityKinds.js";
|
|
3
|
+
import { alphabetizeStringify, sha256HexUtf8 } from "../../../shared-ts/src/utils/digests.js";
|
|
4
|
+
import { isPlainObject, requireCanonicalString } from "../../../shared-ts/src/utils/validation.js";
|
|
5
|
+
import { secureRandomBase64Url } from "../../../shared-ts/src/utils/secureRandomId.js";
|
|
6
|
+
import { createServerAllocatedWalletId } from "../../../shared-ts/src/utils/registrationIds.js";
|
|
7
|
+
//#region src/router/domains/walletRegistration/walletRegistrationReservation.ts
|
|
8
|
+
function requireId(result) {
|
|
9
|
+
if (!result.ok) throw new Error(result.error.message);
|
|
10
|
+
return result.value;
|
|
11
|
+
}
|
|
12
|
+
function parseWalletRegistrationSetupReservation(raw) {
|
|
13
|
+
if (!isPlainObject(raw)) throw new Error("Registration reservation is invalid");
|
|
14
|
+
const ceremonyId = requireCanonicalString(raw.ceremonyId, "ceremonyId");
|
|
15
|
+
const preparationId = requireCanonicalString(raw.preparationId, "preparationId");
|
|
16
|
+
if (!/^wrc_[A-Za-z0-9_-]{43}$/u.test(ceremonyId) || !/^regprep_[A-Za-z0-9_-]{43}$/u.test(preparationId)) throw new Error("Registration reservation ceremony identity is invalid");
|
|
17
|
+
const reservedAtMs = raw.reservedAtMs;
|
|
18
|
+
if (typeof reservedAtMs !== "number" || !Number.isSafeInteger(reservedAtMs) || reservedAtMs <= 0) throw new Error("Registration reservation timestamp is invalid");
|
|
19
|
+
return {
|
|
20
|
+
walletId: requireId(parseWalletId(raw.walletId)),
|
|
21
|
+
ceremonyId,
|
|
22
|
+
preparationId,
|
|
23
|
+
walletAuthorityId: requireId(parseWalletAuthorityId(raw.walletAuthorityId)),
|
|
24
|
+
deviceId: requireId(parseDeviceId(raw.deviceId)),
|
|
25
|
+
walletAuthMethodId: requireId(parseWalletAuthMethodId(raw.walletAuthMethodId)),
|
|
26
|
+
reservedAtMs
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function proposeWalletRegistrationSetup(input) {
|
|
30
|
+
return parseWalletRegistrationSetupReservation({
|
|
31
|
+
walletId: input.request.wallet?.kind === "provided" ? input.request.wallet.walletId : createServerAllocatedWalletId(),
|
|
32
|
+
ceremonyId: `wrc_${secureRandomBase64Url(32)}`,
|
|
33
|
+
preparationId: `regprep_${secureRandomBase64Url(32)}`,
|
|
34
|
+
walletAuthorityId: `wallet-authority:${secureRandomBase64Url(32)}`,
|
|
35
|
+
deviceId: `device:${secureRandomBase64Url(32)}`,
|
|
36
|
+
walletAuthMethodId: `wallet-auth-method:${secureRandomBase64Url(32)}`,
|
|
37
|
+
reservedAtMs: Date.now()
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async function walletRegistrationSetupRequestDigest(namespace, input) {
|
|
41
|
+
if (!input.runtimePolicyScope || input.runtimePolicyScope.orgId !== input.orgId) throw new Error("Registration reservation requires an exact authenticated tenant scope");
|
|
42
|
+
return sha256HexUtf8(alphabetizeStringify({
|
|
43
|
+
namespace,
|
|
44
|
+
runtimePolicyScope: input.runtimePolicyScope,
|
|
45
|
+
expectedOrigin: input.expectedOrigin,
|
|
46
|
+
wallet: input.request.wallet ?? { kind: "server_allocated" },
|
|
47
|
+
authMethod: input.request.authMethod,
|
|
48
|
+
signerSelection: input.request.signerSelection
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
async function completeRegistrationReservation(authority, input) {
|
|
52
|
+
if (!authority) return {
|
|
53
|
+
ok: false,
|
|
54
|
+
code: "registration_authority_unavailable",
|
|
55
|
+
message: "Registration reservation authority is required"
|
|
56
|
+
};
|
|
57
|
+
return authority.complete(input);
|
|
58
|
+
}
|
|
59
|
+
async function admitRegistrationReservationHome(authority, input) {
|
|
60
|
+
if (!authority) return {
|
|
61
|
+
ok: false,
|
|
62
|
+
code: "registration_authority_unavailable",
|
|
63
|
+
message: "Registration reservation authority is required"
|
|
64
|
+
};
|
|
65
|
+
return authority.admitHome(input);
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { admitRegistrationReservationHome, completeRegistrationReservation, parseWalletRegistrationSetupReservation, proposeWalletRegistrationSetup, walletRegistrationSetupRequestDigest };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=walletRegistrationReservation.js.map
|
|
@@ -4,7 +4,6 @@ import { base64UrlDecode } from "../../../shared-ts/src/utils/base64.js";
|
|
|
4
4
|
import { parseDigestB64u } from "../../../shared-ts/src/utils/canonicalPrimitives.js";
|
|
5
5
|
import { base58Encode } from "../../../shared-ts/src/utils/base58.js";
|
|
6
6
|
import "../../../shared-ts/src/utils/encoders.js";
|
|
7
|
-
import { deriveImplicitNearAccountIdFromEd25519PublicKey, parseImplicitNearAccountId } from "../../../shared-ts/src/utils/near.js";
|
|
8
7
|
import { isPlainObject } from "../../../shared-ts/src/utils/validation.js";
|
|
9
8
|
import { ecdsaClientRootPublicKey33B64uFromString } from "../../../shared-ts/src/threshold/ecdsaDerivationRoleLocalBootstrap.js";
|
|
10
9
|
import { normalizeRuntimePolicyScope } from "../../../shared-ts/src/threshold/signingRootScope.js";
|
|
@@ -15,6 +14,7 @@ import { normalizeCorsOrigin } from "../../../core/SessionService.js";
|
|
|
15
14
|
import { thresholdEcdsaChainTargetFromValue } from "../../../core/thresholdEcdsaChainTarget.js";
|
|
16
15
|
import { walletIdFromString } from "../../../shared-ts/src/utils/registrationIds.js";
|
|
17
16
|
import { parseRouterAbTraceContextV1 } from "../../../shared-ts/src/utils/routerAbTraceContext.js";
|
|
17
|
+
import { parseRegistrationSetupOperationId } from "../../../shared-ts/src/utils/registrationSetupOperation.js";
|
|
18
18
|
import { extractBearerCredential, extractRouterApiEnvironmentId } from "../../auth/routerApiKeyAuth.js";
|
|
19
19
|
import { resolvePublishableKeyApiCredentialAuth } from "../../auth/routerApiCredentialAuth.js";
|
|
20
20
|
import { resolveActiveRuntimePolicyScopeForEnvironment, resolveWalletSessionAdministrationAdmission, resolveWalletSessionOperationCredentialAdmission, resolveWalletSessionOperationCredentialAdmissionFromContext } from "../../auth/commonRouterUtils.js";
|
|
@@ -24,6 +24,7 @@ import { parsePasskeyCustodyEnvelopeRecord } from "../../../shared-ts/src/passke
|
|
|
24
24
|
import "../../../shared-ts/src/passkey-custody/index.js";
|
|
25
25
|
import { verifyWalletRegistrationSetupClaims } from "./walletRegistrationSetupPayload.js";
|
|
26
26
|
import { computeWalletEcdsaKeyFactsInventoryChallengeDigestB64u } from "../../../shared-ts/src/utils/ecdsaKeyFactsInventory.js";
|
|
27
|
+
import { deriveImplicitNearAccountIdFromEd25519PublicKey, parseImplicitNearAccountId } from "../../../shared-ts/src/utils/near.js";
|
|
27
28
|
import { normalizeRegistrationSignerPlan, registrationSignerSetSelectionFromPlan } from "../../../shared-ts/src/utils/registrationSignerPlan.js";
|
|
28
29
|
import { addAuthMethodIntentGrantFromString, addSignerIntentGrantFromString, computeAddAuthMethodIntentDigestB64u, computeAddSignerIntentDigestB64u, normalizeAddAuthMethodIntentCaller } from "../../../shared-ts/src/utils/registrationIntent.js";
|
|
29
30
|
//#region src/router/domains/walletRegistration/walletRegistrationRoutes.ts
|
|
@@ -326,6 +327,12 @@ function parseWalletRegistrationSetupWallet(raw) {
|
|
|
326
327
|
};
|
|
327
328
|
}
|
|
328
329
|
function parseWalletRegistrationSetupRequest(body) {
|
|
330
|
+
const registrationOperationId = parseRegistrationSetupOperationId(body.registrationOperationId);
|
|
331
|
+
if (!registrationOperationId) return {
|
|
332
|
+
ok: false,
|
|
333
|
+
code: "invalid_body",
|
|
334
|
+
message: "registrationOperationId is required"
|
|
335
|
+
};
|
|
329
336
|
const signerSelection = parseRegistrationSignerSet(body.signerSelection);
|
|
330
337
|
if (!signerSelection.ok) return signerSelection;
|
|
331
338
|
const authMethod = normalizeRegistrationAuthMethodInput(body.authMethod);
|
|
@@ -339,6 +346,7 @@ function parseWalletRegistrationSetupRequest(body) {
|
|
|
339
346
|
return {
|
|
340
347
|
ok: true,
|
|
341
348
|
value: {
|
|
349
|
+
registrationOperationId,
|
|
342
350
|
...wallet.value ? { wallet: wallet.value } : {},
|
|
343
351
|
signerSelection: signerSelection.value.selection,
|
|
344
352
|
authMethod
|
|
@@ -1556,14 +1564,6 @@ async function handleRouterApiWalletAddSignerIntent(input) {
|
|
|
1556
1564
|
});
|
|
1557
1565
|
return routeJson(result.ok ? 200 : 400, result);
|
|
1558
1566
|
}
|
|
1559
|
-
/**
|
|
1560
|
-
* `POST /wallets/register/setup` — the single admitted entry point that
|
|
1561
|
-
* replaces the bootstrap grant, the intent, and start.
|
|
1562
|
-
*
|
|
1563
|
-
* Authentication is the same API-credential plane the intent route used, so
|
|
1564
|
-
* origin and environment binding are unchanged; what is gone is the stored
|
|
1565
|
-
* grant that used to sit between the check and its only reader.
|
|
1566
|
-
*/
|
|
1567
1567
|
async function handleRouterApiWalletRegistrationSetup(input) {
|
|
1568
1568
|
if (!isPlainObject(input.body)) return routeError(400, "invalid_body", "JSON body required");
|
|
1569
1569
|
const origin = normalizeCorsOrigin(input.origin);
|
|
@@ -1606,7 +1606,7 @@ async function handleRouterApiWalletRegistrationSetup(input) {
|
|
|
1606
1606
|
if (!session) return routeError(500, "internal", "wallet registration setup requires session signing");
|
|
1607
1607
|
const request = parseWalletRegistrationSetupRequest(input.body);
|
|
1608
1608
|
if (!request.ok) return routeError(400, request.code, request.message);
|
|
1609
|
-
|
|
1609
|
+
return input.services.walletRegistration.setupWalletRegistration({
|
|
1610
1610
|
request: request.value,
|
|
1611
1611
|
orgId: principal.orgId,
|
|
1612
1612
|
expectedOrigin: origin,
|
|
@@ -1617,7 +1617,6 @@ async function handleRouterApiWalletRegistrationSetup(input) {
|
|
|
1617
1617
|
signingRootVersion: runtimePolicyScope.signingRootVersion
|
|
1618
1618
|
} : {}
|
|
1619
1619
|
});
|
|
1620
|
-
return routeJson(result.ok ? 200 : 400, result);
|
|
1621
1620
|
}
|
|
1622
1621
|
/**
|
|
1623
1622
|
* `POST /wallets/register/respond` — the authenticated leg.
|
|
@@ -2,14 +2,13 @@ import { base64UrlEncode } from "../../../shared-ts/src/utils/base64.js";
|
|
|
2
2
|
import { alphabetizeStringify, sha256BytesUtf8 } from "../../../shared-ts/src/utils/digests.js";
|
|
3
3
|
import "../../../shared-ts/src/utils/encoders.js";
|
|
4
4
|
import { normalizeOptionalTrimmedString } from "../../../shared-ts/src/utils/normalize.js";
|
|
5
|
-
import "../../../shared-ts/src/utils/validation.js";
|
|
6
5
|
import { normalizeRuntimePolicyScope } from "../../../shared-ts/src/threshold/signingRootScope.js";
|
|
7
6
|
//#region src/router/domains/walletRegistration/walletRegistrationSetupPayload.ts
|
|
8
7
|
/**
|
|
9
8
|
* The opaque payload `/wallets/register/setup` mints and routes 2 and 3 verify.
|
|
10
9
|
*
|
|
11
|
-
* Setup admits the application,
|
|
12
|
-
* preparation in one request. Routes 2 and 3 then need to know that the
|
|
10
|
+
* Setup admits the application, reserves the wallet, and persists the initial
|
|
11
|
+
* preparation facts in one request. Routes 2 and 3 then need to know that the
|
|
13
12
|
* ceremony they are being driven with is the one setup admitted, and with the
|
|
14
13
|
* parameters setup admitted — without paying another storage round trip to
|
|
15
14
|
* find out. The client carries this string and never parses it.
|
|
@@ -454,6 +454,20 @@ async function handleWalletUnlockChallengeRoute(input) {
|
|
|
454
454
|
orgId: body.orgId,
|
|
455
455
|
ttlMs: body.ttlMs
|
|
456
456
|
});
|
|
457
|
+
if (!result.ok && result.code === "wallet_home_unavailable") return {
|
|
458
|
+
status: 503,
|
|
459
|
+
body: {
|
|
460
|
+
...result,
|
|
461
|
+
unlockBackend
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
if (!result.ok && result.code === "wallet_home_conflict") return {
|
|
465
|
+
status: 409,
|
|
466
|
+
body: {
|
|
467
|
+
...result,
|
|
468
|
+
unlockBackend
|
|
469
|
+
}
|
|
470
|
+
};
|
|
457
471
|
return {
|
|
458
472
|
status: result.ok ? 200 : result.code === "internal" ? 500 : 400,
|
|
459
473
|
body: {
|