@seams/wallet-server 0.12.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/artifact-manifest.json +18 -13
  2. package/cloudflare-router-ab/build/deriver-a/build-stamp.json +1 -1
  3. package/cloudflare-router-ab/build/deriver-b/build-stamp.json +1 -1
  4. package/cloudflare-router-ab/build/router/build-stamp.json +1 -1
  5. package/cloudflare-router-ab/build/signing-worker/build-stamp.json +1 -1
  6. package/cloudflare-router-ab/build/tenant-root-control-plane/build-stamp.json +1 -1
  7. package/dist/esm/cloud-host.js +2 -2
  8. package/dist/esm/local-hosted-wallet-gateway-worker.js +4 -2
  9. package/dist/esm/localHostedWalletGatewayHandler.js +20 -7
  10. package/dist/esm/router/cloudflare/d1/registration/d1WalletExecutionAuthority.js +109 -14
  11. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationService.js +16 -2
  12. package/dist/esm/router/cloudflare/d1/registration/walletRegistrationEstablishedSessionIssuer.js +7 -12
  13. package/dist/esm/router/cloudflare.js +1 -1
  14. package/dist/esm/router/domains/walletRegistration/walletRegistrationRoutes.js +1 -1
  15. package/dist/types/wallet-server/src/cloud-host.d.ts +1 -1
  16. package/dist/types/wallet-server/src/localHostedWalletGatewayHandler.d.ts +2 -0
  17. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletExecutionAuthority.d.ts +22 -2
  18. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationService.d.ts +1 -1
  19. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/walletRegistrationEstablishedSessionIssuer.d.ts +1 -1
  20. package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationReservation.d.ts +13 -18
  21. package/dist/types/wallet-server/src/router/framework/authServicePort.d.ts +1 -1
  22. package/migrations/d1-signer/0081_registration_directory_publications.sql +26 -0
  23. package/package.json +1 -1
@@ -2,17 +2,17 @@
2
2
  "schemaVersion": "seams_wallet_server_artifact_manifest_v1",
3
3
  "package": {
4
4
  "name": "@seams/wallet-server",
5
- "version": "0.12.0"
5
+ "version": "0.13.1"
6
6
  },
7
7
  "workers": {
8
8
  "router": {
9
9
  "entry": "cloudflare-router-ab/build/router/worker/shim.mjs",
10
- "fingerprint": "2fd5f566e80be8a45b7d0c94dfcca5ab4a9b3872cad979f8d377785645b3e345",
10
+ "fingerprint": "f5e15eee6a1b0c3bac63d190a0a41ffc8e7d100008b365325d2e0a58e901ced5",
11
11
  "files": [
12
12
  {
13
13
  "path": "cloudflare-router-ab/build/router/build-stamp.json",
14
14
  "bytes": 119,
15
- "sha256": "81b88975abfe55d4d7bda8340b0e9e5563d92f0b558977b2893017d98e03a868"
15
+ "sha256": "02e5d42b40b3c1f23086f2fd01e267e127cb4dcd2c08a7c0c1bf98c65089c4e1"
16
16
  },
17
17
  {
18
18
  "path": "cloudflare-router-ab/build/router/index.js",
@@ -38,12 +38,12 @@
38
38
  },
39
39
  "deriver-a": {
40
40
  "entry": "cloudflare-router-ab/build/deriver-a/worker/shim.mjs",
41
- "fingerprint": "d3db01b58444514a1a227c57b75b4a1b7b72239f9fbbf5af5e941afcca99f948",
41
+ "fingerprint": "d0f496976221491ecbc4cae94e21c3f78448f9ce473a34ed80bc5a8db7581b7b",
42
42
  "files": [
43
43
  {
44
44
  "path": "cloudflare-router-ab/build/deriver-a/build-stamp.json",
45
45
  "bytes": 122,
46
- "sha256": "500990fe495d3b5d6a306bc16dd114fa88d26aade0188b5df27a011a03c6b701"
46
+ "sha256": "db3270f4400dd891d6a3895f9a0356575e4cfc89b9b4f8ed579cfd181d442e66"
47
47
  },
48
48
  {
49
49
  "path": "cloudflare-router-ab/build/deriver-a/index.js",
@@ -69,12 +69,12 @@
69
69
  },
70
70
  "deriver-b": {
71
71
  "entry": "cloudflare-router-ab/build/deriver-b/worker/shim.mjs",
72
- "fingerprint": "b5bf7343edfbb39e3e44a8bfc0640ed6fcaab5c934767c2c181ee0e37d60a9d5",
72
+ "fingerprint": "a963e689c205c3e6049c958aa4ebe33ddd0c59ecf043557ce8dbc240a200b47c",
73
73
  "files": [
74
74
  {
75
75
  "path": "cloudflare-router-ab/build/deriver-b/build-stamp.json",
76
76
  "bytes": 122,
77
- "sha256": "c45d527106bc969c61920d0b2fd308b994571c7e0fa2eebc963a49eb1c1b95a8"
77
+ "sha256": "f7d69f0225ebeb0fa1f50b8c6d33c5ff1d55532e328e40010bd8cf2c076c279c"
78
78
  },
79
79
  {
80
80
  "path": "cloudflare-router-ab/build/deriver-b/index.js",
@@ -100,12 +100,12 @@
100
100
  },
101
101
  "signing-worker": {
102
102
  "entry": "cloudflare-router-ab/build/signing-worker/worker/shim.mjs",
103
- "fingerprint": "6318d7738ca6279c3bb5bea15fbabf22801c65a2bd8539b3e7ac6f15b70766fc",
103
+ "fingerprint": "46eb5d9087374ec190499cf40ee8acc7293212dd2979c0801744d8b45ea48721",
104
104
  "files": [
105
105
  {
106
106
  "path": "cloudflare-router-ab/build/signing-worker/build-stamp.json",
107
107
  "bytes": 127,
108
- "sha256": "bd2c319cacf96f564d634e09f36a47e161ba8ae62c0a2b4ba6ec72a672cebd79"
108
+ "sha256": "299820c73a56cb67d3497c551958101cbd4d6c921f54d154c6a92c72d7d15624"
109
109
  },
110
110
  {
111
111
  "path": "cloudflare-router-ab/build/signing-worker/index.js",
@@ -131,12 +131,12 @@
131
131
  },
132
132
  "tenant-root-control-plane": {
133
133
  "entry": "cloudflare-router-ab/build/tenant-root-control-plane/worker/shim.mjs",
134
- "fingerprint": "64320555ffb6332ee555f5759504a59a43dc137958b7da9520ec51ba71259d1c",
134
+ "fingerprint": "d5abed28f0ebcea1d045114ad97d700dc070beab76bd6b7d2b51881652d8a459",
135
135
  "files": [
136
136
  {
137
137
  "path": "cloudflare-router-ab/build/tenant-root-control-plane/build-stamp.json",
138
138
  "bytes": 139,
139
- "sha256": "e45ea44efe8e43b2c5512c186cacce42e23b2c8538d03bbf40c31eb3d99a7827"
139
+ "sha256": "663087809f659d2d604f0d7be06db7afdada14555123b4ac124752cdb4ddfae1"
140
140
  },
141
141
  {
142
142
  "path": "cloudflare-router-ab/build/tenant-root-control-plane/index.js",
@@ -164,8 +164,8 @@
164
164
  "migrations": {
165
165
  "signer": {
166
166
  "directory": "migrations/d1-signer",
167
- "head": "0080_registration_setup_rate_limits.sql",
168
- "fingerprint": "e681d4d38cdeb9246774a40219aa877793bee08e9cb28079f2b992597f6ee871",
167
+ "head": "0081_registration_directory_publications.sql",
168
+ "fingerprint": "1c939bacda72ec3c83a8fd1381668810b82c2963b3d3fda3a9670e916c6ae9d0",
169
169
  "files": [
170
170
  {
171
171
  "path": "migrations/d1-signer/0001_signer_d1_initial.sql",
@@ -566,6 +566,11 @@
566
566
  "path": "migrations/d1-signer/0080_registration_setup_rate_limits.sql",
567
567
  "bytes": 465,
568
568
  "sha256": "7ed04e03b49e5399e6ae0df7d2d7f46e737f8a783b13799ad5ed1b9b65a7d22a"
569
+ },
570
+ {
571
+ "path": "migrations/d1-signer/0081_registration_directory_publications.sql",
572
+ "bytes": 1599,
573
+ "sha256": "d386b3949a736393f74a0f67da4b1350826813acd2f5cc975e853efc21d032f9"
569
574
  }
570
575
  ]
571
576
  },
@@ -1 +1 @@
1
- {"profile":"release","wallet_objects":true,"features":"strict-worker-deriver-a-entrypoint","started_at_ms":1792171647892}
1
+ {"profile":"release","wallet_objects":true,"features":"strict-worker-deriver-a-entrypoint","started_at_ms":1792253288115}
@@ -1 +1 @@
1
- {"profile":"release","wallet_objects":true,"features":"strict-worker-deriver-b-entrypoint","started_at_ms":1792171876604}
1
+ {"profile":"release","wallet_objects":true,"features":"strict-worker-deriver-b-entrypoint","started_at_ms":1792253457587}
@@ -1 +1 @@
1
- {"profile":"release","wallet_objects":true,"features":"strict-worker-router-entrypoint","started_at_ms":1792172099307}
1
+ {"profile":"release","wallet_objects":true,"features":"strict-worker-router-entrypoint","started_at_ms":1792253613062}
@@ -1 +1 @@
1
- {"profile":"release","wallet_objects":true,"features":"strict-worker-signing-worker-entrypoint","started_at_ms":1792171336433}
1
+ {"profile":"release","wallet_objects":true,"features":"strict-worker-signing-worker-entrypoint","started_at_ms":1792253066021}
@@ -1 +1 @@
1
- {"profile":"release","wallet_objects":false,"features":"strict-worker-tenant-root-control-plane-entrypoint","started_at_ms":1792172311014}
1
+ {"profile":"release","wallet_objects":false,"features":"strict-worker-tenant-root-control-plane-entrypoint","started_at_ms":1792253763521}
@@ -73,7 +73,7 @@ import { createStaticWalletConsoleBindingV1, handleStaticWalletConsoleRequestV1,
73
73
  import { parseWebAuthnSyncChallengeRecord } from "./router/cloudflare/d1/webauthn/d1WebAuthnRecords.js";
74
74
  import { CloudflareD1WebAuthnStore, prepareD1WebAuthnAuthenticatorInsertStatement, prepareD1WebAuthnAuthenticatorPutStatement } from "./router/cloudflare/d1/webauthn/d1WebAuthnStore.js";
75
75
  import { CloudflareD1WebAuthnAuthService } from "./router/cloudflare/d1/webauthn/d1WebAuthnAuthService.js";
76
- import { admitD1EstablishedWalletHome } from "./router/cloudflare/d1/registration/d1WalletExecutionAuthority.js";
76
+ import { admitD1EstablishedWalletHome, resumeRegistrationDirectoryPublicationsV1 } from "./router/cloudflare/d1/registration/d1WalletExecutionAuthority.js";
77
77
  import { parseLinkedDeviceSessionRecordV1 } from "./core/deviceLinking/linkedDeviceSessionRecord.js";
78
78
  import { D1LinkedDeviceSourceContributionPreparationPlannerV1, createD1LinkedDeviceSourceContributionPreparationPlannerV1, linkedDeviceX25519RecipientPublicKeyB64uV1 } from "./router/cloudflare/d1/deviceLinking/d1LinkedDeviceSourceContributionPreparationPlanner.js";
79
79
  import { D1LinkedDeviceAuthorityInstallServiceV1, parseInstalledEcdsaCustodySnapshotV1, readD1LinkedDeviceEcdsaSourceV1, readD1LinkedDeviceEd25519SourceV1 } from "./router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.js";
@@ -131,4 +131,4 @@ import { handleRouterAbEd25519YaoRecoveryRequestScopedCloudflareV1 } from "./rou
131
131
  import { RouterAbEd25519YaoRecoveryWalletSessionAuthorizationAdapter } from "./router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecoveryWalletSessionAuthorization.js";
132
132
  import { keccak256Bytes } from "./shared-ts/src/utils/keccak.js";
133
133
  import { decodeEvmBlockHeader, decodeEvmTransactionByHash, decodeEvmTransactionCall, decodeEvmTransactionReceipt, parseRpcHexQuantity } from "./shared-ts/src/utils/evmRpcResults.js";
134
- export { API_CREDENTIAL_ROUTE_SCOPES, API_CREDENTIAL_TYPES, ActionType, CLOUDFLARE_ROUTER_ED25519_YAO_SOURCE_PRESERVING_EXECUTE_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ECDSA_ACTIVATE_RESERVATION_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ECDSA_DEACTIVATE_RESERVATION_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ECDSA_RESERVE_INACTIVE_SOURCE_PRESERVING_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ED25519_YAO_ACTIVATE_RESERVATION_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ED25519_YAO_DEACTIVATE_RESERVATION_PATH_V1, CloudflareD1AuthorizationStore, CloudflareD1GoogleEmailOtpRegistrationAttemptStore, CloudflareD1OidcJwksCache, CloudflareD1RouterAbEd25519YaoCapabilityPersistence, CloudflareD1RouterAbNormalSigningAdmissionStore, CloudflareD1VaultProxyStore, CloudflareD1VersionedJsonRecordStore, CloudflareD1VersionedJsonRecordStoreError, CloudflareD1WebAuthnAuthService, CloudflareD1WebAuthnStore, CloudflareDurableObjectVersionedJsonRecordStore, CloudflareOrdinaryInactiveSignerMaterialDeactivationWorkerV1, CloudflareOrdinaryInactiveSignerMaterialReservationWorkerV1, CloudflareVersionedJsonRecordStoreError, CrossSiteSessionCookieAdapter, D1IdentityStore, D1LinkedDeviceAuthorityInstallServiceV1, D1LinkedDeviceEd25519ExportRootStoreV1, D1LinkedDeviceRequestProofNonceStoreV1, D1LinkedDeviceSessionStoreV1, D1LinkedDeviceSourceContributionPreparationPlannerV1, D1LinkedDeviceTargetAuthenticatorStoreV1, D1LinkedDeviceTargetCredentialProviderV1, D1LinkedDeviceTargetPlannerV1, D1WalletAuthMethodStore, D1WalletObjectAddresses, D1WalletStore, D1_BATCH_CAS_GUARD_SQL, DEFAULT_SESSION_COOKIE_NAME, DEFAULT_WALLET_CONSOLE_SIGNED_DELEGATE_ROUTE_V1, DEFAULT_WALLET_CONSOLE_SPONSORED_EVM_CALL_ROUTE_V1, DEFAULT_WALLET_SESSION_REMAINING_USES, DEFAULT_WALLET_SESSION_TTL_MS, ED25519_SIGNER_ACTIVATION_ID_PATH, InMemoryRouterAbEd25519YaoExportService, InMemoryRouterAbEd25519YaoExportStateV1, InMemoryRouterAbEd25519YaoRegistrationIntentAuthorizationAdapter, InMemoryRouterAbEd25519YaoRegistrationService, InMemoryRouterAbNormalSigningAdmissionStore, LINKED_DEVICE_OWNER_AUTHORIZATION_PATH_V1, LinkedDeviceRetiredTargetRegistrationShapeErrorV1, LinkedDeviceSourceFamilyUnavailableErrorV1, LinkedDeviceWebAuthnRegistrationVerifierV1, LocalRegistrationSetupAuthority, MAX_WALLET_SESSION_REMAINING_USES, MAX_WALLET_SESSION_TTL_MS, PUBLIC_PROOF_TYPES, ROUTER_AB_ECDSA_DERIVATION_PRIVATE_SIGNING_PATHS, ROUTER_AB_ED25519_PRIVATE_SIGNING_PATHS, ROUTER_AB_ED25519_YAO_CAPABILITY_REPLACEMENT_TABLE_V1, ROUTER_AB_ED25519_YAO_EXPORT_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_EXPORT_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_ACTIVATE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_STATUS_PATH_V1, ROUTER_AB_ED25519_YAO_REGISTRATION_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_REGISTRATION_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_SHARED_STATE_RECORD_KEY_V1, ROUTER_AB_ED25519_YAO_WARM_RECOVERY_BOOTSTRAP_PATH_V1, ROUTER_AB_MPC_ROUTER_ORIGIN, ROUTER_AB_PUBLIC_KEYSET_PATH, ROUTER_AB_PUBLIC_KEYSET_VERSION_V2, ROUTER_AB_PUBLIC_KEYSET_WELL_KNOWN_PATH, ROUTER_AB_SIGNING_WORKER_ORIGIN, ROUTER_AB_TRACE_ID_HEADER_V1, ROUTER_API_CREDENTIAL_SCOPES, ROUTE_SERVICE_KEYS, RouterAbEcdsaPresignRuntime, RouterAbEd25519YaoExportOwnerProofAuthorizationAdapter, RouterAbEd25519YaoHttpRegistrationBackend, RouterAbEd25519YaoRecoveryWalletSessionAuthorizationAdapter, SESSION_CAS_GUARD_SQL, SessionService, StaticCloudflareTenantStorageRouteResolver, UnavailableOrdinaryInactiveSignerMaterialDeactivationWorkerV1, UnavailableOrdinaryInactiveSignerMaterialReservationWorkerV1, WALLET_AUTH_METHOD_D1_STORE, WALLET_AUTH_METHOD_STORE_D1_SCHEMA_SQL, WALLET_AUTH_METHOD_STORE_D1_SCHEMA_V2_SQL, WALLET_CONSOLE_API_WALLET_DETAIL_PREFIX_V1, WALLET_CONSOLE_OPS_BASE_PATH_V1, WALLET_CONSOLE_OP_PATHS_V1, WALLET_CONSOLE_SERVICE_ORIGIN_V1, WALLET_CONSOLE_SIGNED_DELEGATE_ROUTE_ID_V1, WALLET_CONSOLE_SPONSORED_EVM_CALL_ROUTE_ID_V1, WALLET_CONTROL_AUTH_MARKER_V1, WALLET_CONTROL_BASE_PATH_V1, WALLET_CONTROL_SERVICE_ORIGIN_V1, WALLET_RUNTIME_OPS_BASE_PATH_V1, WALLET_RUNTIME_OP_PATHS_V1, WALLET_RUNTIME_SERVICE_ORIGIN_V1, WALLET_STORE_D1_SCHEMA_SQL, WalletHomeCustodyBinding, WalletLifecycleLocator, WalletObjectAddressSnapshot, WalletPlacementRoutes, abusePrincipalKey, addSecp256k1PublicKeys33, admitD1EstablishedWalletHome, admitRouterAbEcdsaReusableWalletSessionOperation, applyRouteMetering, assertUniqueRouterApiRouteDefinitions, authenticateDeviceLinkingOwnerWalletSessionRequestV1, authenticateRouterAbEcdsaOperationStepUp, authenticateRouterAbWalletOperationStepUp, authenticateRouterAbWalletOperationStepUpIdentity, authorizeRouterAbEcdsaDerivationNormalSigningRoute, authorizeRouterAbEd25519NormalSigningRoute, base64UrlDecode, base64UrlEncode, bindWalletAuthMethodIdentity, bindWalletAuthMethodIdentityV2, buildCorsOrigins, buildRouterAbEcdsaDerivationPrivateSigningWorkerBody, buildRouterAbEcdsaOwnerOperationStepUpPreparation, buildRouterAbEd25519OwnerOperationStepUpPreparation, buildRouterAbEd25519PrivateSigningWorkerBody, buildRouterAbEd25519YaoAddSignerAdmissionRequestV1, buildRouterAbEd25519YaoProductAdmissionRequestV1, buildTenantRootIdentityFromAuthenticatedDeploymentV1, buildVerifiedLinkInputV1, buildVerifiedTargetFactorV1, buildWalletEcdsaSignerRecord, claimRouterAbEcdsaOperationStepUp, coerceLogger, coerceRouterLogger, completeRouterAbEcdsaOperation, computeEip1559TxHash, computeLinkedDeviceSessionClaimDigestV1, computeRouterAbEd25519NormalSigningAdmissionMaterial, computeVerifiedTargetFactorVerificationDigestV1, createCloudflareD1RouterAbNormalSigningAdmissionStore, createCloudflareD1RouterApiAuthService, createCloudflareD1VersionedJsonRecordStore, createCloudflareDurableObjectVersionedJsonRecordStore, createCloudflareLinkedDeviceEd25519SourcePreservingRouterEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialActivationEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialActivationPortV1, createCloudflareOrdinaryInactiveSignerMaterialDeactivationEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialDeactivationPortV1, createCloudflareOrdinaryInactiveSignerMaterialReservationEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialReservationServiceV1, createCloudflareRouter, createCloudflareTenantStorageRoute, createCloudflareWalletGatewayRouterV1, createD1LinkedDeviceOwnerAuthorizationMetadataSourceV1, createD1LinkedDeviceOwnerAuthorizationProviderV1, createD1LinkedDeviceOwnerSourceChildReaderV1, createD1LinkedDeviceRouteServiceV1, createD1LinkedDeviceSessionServiceV1, createD1LinkedDeviceSourceContributionPreparationPlannerV1, createD1LinkedDeviceVerifiedLinkSourceReaderV1, createDeviceLinkingOwnerRequestAuthenticatorV1, createEd25519SessionAdapter, createInMemoryRouterAbNormalSigningAdmissionAdapter, createInMemoryRouterAbNormalSigningAdmissionStore, createInMemoryRouterApiRuntimeSnapshotConsumer, createRouterAbEcdsaEd25519CeremonyTokenIssuer, createRouterAbEcdsaStrictPostRegistrationPort, createRouterAbEcdsaStrictRegistrationPort, createRouterAbEd25519YaoCeremonyStateStoreV1, createRouterAbEd25519YaoExportModule, createRouterAbEd25519YaoHttpRegistrationBackendFromEnv, createRouterAbEd25519YaoMaterialActivationRefV1, createRouterAbEd25519YaoProductRegistrationCompositionFromPortsV1, createRouterAbEd25519YaoProductRegistrationPartitionedStateStoreFromD1V1, createRouterAbEd25519YaoProductRegistrationPartitionedStateStoreV1, createRouterAbEd25519YaoProductRegistrationRequestScopedRuntimeV1, createRouterAbEd25519YaoProductRegistrationRuntimeV1, createRouterAbEd25519YaoProductRegistrationStateFromPartsV1, createRouterAbEd25519YaoProductRegistrationStateV1, createRouterAbEd25519YaoRegistrationModule, createRouterAbNormalSigningAdmissionAdapter, createRouterAbServiceBindingFetch, createRouterApiModule, createRouterApiRouteDefinitions, createSignerD1DoStorageTarget, createSigningSessionSealOptions, createStaticCloudflareTenantStorageRouteResolver, createStaticCloudflareTenantStorageRouteResolverFromBindings, createStaticWalletConsoleBindingV1, createUnavailableOrdinaryInactiveSignerMaterialDeactivationPortV1, createUnavailableOrdinaryInactiveSignerMaterialReservationWorkerV1, createWalletConsoleOpsClient, createWalletConsoleRelayProxyExtensionV1, createWalletControlClientBindings, createWalletRegistrationContextResolver, createWalletRuntimeOpsHandler, d1ChangedRows, d1Integer, d1Number, decideRouterAbEcdsaOwnerOperationAuthorization, decideRouterAbEd25519OwnerOperationAuthorization, decodeEvmBlockHeader, decodeEvmTransactionByHash, decodeEvmTransactionCall, decodeEvmTransactionReceipt, decodeJsonRpcEnvelope, decodeWalletConsoleTenantRootActiveLineageRequestV1, decodeWalletConsoleTenantRootActiveLineageResponseV1, defineRoute, defineRouteExtension, deriveJwtExpiresAtIso, deriveRecoveryCodeLocatorV1FromBytes, digestOpaqueValue, encodeEip1559SignedTxFromSignature65, encodeRouterAbEd25519YaoProductRegistrationPartitionRecordV1, encodeRouterAbEd25519YaoProductRegistrationStateV1, encodeSessionJsonSegment, encodeTenantRootIdentityV1, enforceDelegatePolicy, enforceRoutePolicy, ensureEvmCryptoWasm, ensureLeadingSlash, ensureWalletAuthMethodStoreD1Schema, ensureWalletStoreD1Schema, evaluateRouterAbNormalSigningAdmission, executeRouterAbEd25519YaoAdmittedRegistrationV1, executeSignedDelegateWithRelayer, extractBearerCredential, extractRouterApiEnvironmentId, findRouteDefinitionById, findRouteDefinitionForRequest, formatD1ExecStatement, getRouterApiRouteExtensionDefinitions, getRouterApiRouteExtensionRoutes, getRouterApiRouteExtensionsForTransport, handleRouterAbEcdsaDerivationNormalSigningRouteCore, handleRouterAbEd25519YaoExportRequestScopedCloudflareV1, handleRouterAbEd25519YaoRecoveryRequestScopedCloudflareV1, handleRouterAbEd25519YaoRegistrationRequestScopedCloudflareV1, handleStaticWalletConsoleRequestV1, handleWalletControlRequest, headersToRecord, isD1DatabaseLike, isObject, isPlainObject, json, jsonFailure, keccak256Bytes, linkedDeviceSignerManifestsEqualV1, linkedDeviceX25519RecipientPublicKeyB64uV1, loadCloudflareSignerWasmModule, matchesRouteDefinitionRequest, mergeRouterAbEd25519YaoProductRegistrationStatePartitionV1, mintRouterAbEd25519YaoRegistrationIdentityV1, normalizeBoundedPositiveInteger, normalizeCorsOrigin, normalizeD1RouterApiAuthOptions, normalizeHashToBytes, normalizeLinkedDevicePasskeyTargetConfigurationV1, normalizeLogger, normalizeLowercaseString, normalizeSessionString, normalizeSessionTtlSeconds, normalizeSourceIp, normalizeTrimmedString, normalizeWalletAuthMethod, normalizeWalletAuthMethodV2, parseBooleanFlag, parseBooleanJwtClaim, parseCacheControlMaxAgeSec, parseCsvList, parseD1JsonArrayColumn, parseD1JsonColumn, parseD1JsonObjectColumn, parseD1LinkedDeviceSessionRowV1, parseD1LinkedDeviceSessionTranscriptRowV1, parseGoogleEmailOtpRegistrationAttemptRecord, parseGoogleEmailOtpRegistrationOfferCandidates, parseGoogleJwks, parseGoogleLoginVerifyRequest, parseInstalledEcdsaCustodySnapshotV1, parseJwtAud, parseLinkedDeviceSessionRecordV1, parseOrgId, parseRecoveryCodeLocatorV1, parseRouterAbEcdsaEd25519PrivateJwk, parseRouterAbEcdsaPresignRuntimeConfig, parseRouterAbEcdsaStrictRegistrationTopology, parseRouterAbEd25519NormalSigningScopeV2, parseRouterAbEd25519OperationStepUpScope, parseRouterAbEd25519YaoActivationKeysetFromEnvV1, parseRouterAbEd25519YaoCeremonyKeyV1, parseRouterAbEd25519YaoExportAdmissionEnvelopeV1, parseRouterAbEd25519YaoExportExecuteEnvelopeV1, parseRouterAbEd25519YaoProductRegistrationPartitionRecordJsonV1, parseRouterAbEd25519YaoProductRegistrationPartitionRecordV1, parseRouterAbEd25519YaoProductRegistrationStateJsonV1, parseRouterAbEd25519YaoProductRegistrationStateV1, parseRouterAbEd25519YaoRegistrationAdmissionReadV1, parseRouterAbEd25519YaoRegistrationRouterAnswerV1, parseRouterAbEd25519YaoTenantRootWireV1, parseRouterAbOperationStepUpOperation, parseRouterAbPublicKeysetV2, parseRpcHexQuantity, parseRs256JwtForVerification, parseSessionJwt, parseSigningSessionSealRootConfig, parseStaticWalletConsoleBindingConfigV1, parseStoredRouterAbEcdsaPendingActivationV1, parseWalletEd25519SignerRecord, parseWalletId, parseWalletRecoveryOperationId, parseWalletRegistrationContextResponse, parseWalletRegistrationSetupRequest, parseWalletRegistrationSetupReservation, parseWalletRuntimeExecuteSignedDelegateRequest, parseWalletRuntimeExecuteSignedDelegateResponse, parseWalletRuntimeExecuteSignedDelegateResult, parseWalletRuntimeRelayerAccount, parseWalletRuntimeWalletIdentitiesResult, parseWalletRuntimeWalletIdentityRequest, parseWebAuthnRpId, parseWebAuthnSyncChallengeRecord, partitionRouterAbEd25519YaoProductRegistrationStateV1, postRouterAbSigningWorkerJson, prepareD1TenantStatement, prepareD1WalletAuthMethodInsertStatement, prepareD1WalletAuthMethodPutStatement, prepareD1WalletAuthMethodV2PutStatement, prepareD1WalletPutSignerStatement, prepareD1WalletPutSubjectStatement, prepareD1WebAuthnAuthenticatorInsertStatement, prepareD1WebAuthnAuthenticatorPutStatement, projectRouterAbEd25519YaoExactWalletSession, proposeWalletRegistrationSetup, publishableKeyRoutePrincipal, queryD1All, queryD1One, randomTenantRootCreationGrantBytesV1, readD1LinkedDeviceEcdsaSourceV1, readD1LinkedDeviceEd25519SourceV1, readEnvironmentCsv, readEnvironmentString, readJson, registrationPreparationIdFromString, requireD1RouterApiAuthScopeString, requireEnvironmentString, requireNormalizedSessionString, requireRuntimePolicyScope, resolveFreshRouterAbEcdsaMaterialActivation, resolvePublishableKeyApiCredentialAuth, resolveRequestOriginRateLimitKeyFromFetchHeaders, resolveRouterAbEd25519YaoCeremonyKeyFromRequestV1, resolveRuntimeTenantRootLineage, resolveSecretKeyApiCredentialAuth, resolveSourceIpFromFetchHeaders, resolveWalletRegistrationContext, routeError, routeJson, routerAbEcdsaAtomicAuthorizationConfigured, routerAbEcdsaOperationInProgressResult, routerAbEcdsaOwnerOperationFailureResult, routerAbEcdsaRecordedResponse, routerAbEcdsaReplayHttpResponse, routerAbEcdsaReplayResult, routerAbEcdsaReplayUnavailableResult, routerAbEcdsaStrictRegistrationFactsBindingJson, routerAbEcdsaStrictRegistrationRequestBindingJson, routerAbEcdsaStrictRegistrationRequestMatchesFacts, routerAbEd25519OwnerOperationFailureResult, routerAbEd25519YaoAdmittedRegistrationAuthorityV1, routerAbEd25519YaoPartitionedStateAfterStoredCommitV1, routerAbEd25519YaoPersistedCapabilityMatchesLookupV1, routerAbEd25519YaoRegistrationExecutionTimingEntriesV1, routerAbEd25519YaoRegistrationSigningRootIdV1, routerAbEd25519YaoTenantRootWireV1, runRouterAbEd25519YaoProductRegistrationRequestScopedV1, runRouterAbEd25519YaoRegistrationSideEffectV1, runRouterAbEd25519YaoRegistrationTwoPhaseV1, runRouterAbPrewarmScheduledV1, runtimePolicyScopeKey, sameRouterAbEd25519YaoSharedStateCanonicalEncodingV1, secp256k1PrivateKey32ToPublicKey33, secp256k1PublicKey33ToEthereumAddress, secureRandomBase36, secureRandomBase64Url, selectWalletEd25519Signer, sessionJwtTimeClaims, sha256Bytes, sha256BytesSync, signSecp256k1Recoverable, signTenantRootCreationGrantV1, tenantRootIdentityDigestB64uV1, tenantStorageRouteBackendFamily, tenantStorageRouteDiagnostic, toFetchRouteResponse, normalizeOptionalTrimmedString as toOptionalTrimmedString, toResponse, toSessionArrayBufferCopy, unavailableRegistrationContext, validateDelegateExpiryAndNonce, validateGoogleIdTokenClaims, validateRuntimeSnapshotExpectation, validateSecp256k1PublicKey33, verifyGoogleOidcToken, verifyRs256JwtSignature, verifySecp256k1Bip340SignatureAgainstPublicKey33, verifySecp256k1RecoverableSignatureAgainstPublicKey33, walletAuthMethodId, walletAuthMethodV2Id, walletConsoleApiWalletGetRouteDefinitionV1, walletConsoleApiWalletListRouteDefinitionV1, walletConsoleApiWalletSearchRouteDefinitionV1, walletConsoleRelayRouteDefinitionsV1, walletConsoleSignedDelegateRouteDefinitionV1, walletConsoleSponsoredEvmCallRouteDefinitionV1, walletObjectIdentity, walletRegistrationContext, walletRegistrationSetupRequestDigest, webAuthnCredentialIdB64uFromCredential, withCors };
134
+ export { API_CREDENTIAL_ROUTE_SCOPES, API_CREDENTIAL_TYPES, ActionType, CLOUDFLARE_ROUTER_ED25519_YAO_SOURCE_PRESERVING_EXECUTE_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ECDSA_ACTIVATE_RESERVATION_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ECDSA_DEACTIVATE_RESERVATION_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ECDSA_RESERVE_INACTIVE_SOURCE_PRESERVING_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ED25519_YAO_ACTIVATE_RESERVATION_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ED25519_YAO_DEACTIVATE_RESERVATION_PATH_V1, CloudflareD1AuthorizationStore, CloudflareD1GoogleEmailOtpRegistrationAttemptStore, CloudflareD1OidcJwksCache, CloudflareD1RouterAbEd25519YaoCapabilityPersistence, CloudflareD1RouterAbNormalSigningAdmissionStore, CloudflareD1VaultProxyStore, CloudflareD1VersionedJsonRecordStore, CloudflareD1VersionedJsonRecordStoreError, CloudflareD1WebAuthnAuthService, CloudflareD1WebAuthnStore, CloudflareDurableObjectVersionedJsonRecordStore, CloudflareOrdinaryInactiveSignerMaterialDeactivationWorkerV1, CloudflareOrdinaryInactiveSignerMaterialReservationWorkerV1, CloudflareVersionedJsonRecordStoreError, CrossSiteSessionCookieAdapter, D1IdentityStore, D1LinkedDeviceAuthorityInstallServiceV1, D1LinkedDeviceEd25519ExportRootStoreV1, D1LinkedDeviceRequestProofNonceStoreV1, D1LinkedDeviceSessionStoreV1, D1LinkedDeviceSourceContributionPreparationPlannerV1, D1LinkedDeviceTargetAuthenticatorStoreV1, D1LinkedDeviceTargetCredentialProviderV1, D1LinkedDeviceTargetPlannerV1, D1WalletAuthMethodStore, D1WalletObjectAddresses, D1WalletStore, D1_BATCH_CAS_GUARD_SQL, DEFAULT_SESSION_COOKIE_NAME, DEFAULT_WALLET_CONSOLE_SIGNED_DELEGATE_ROUTE_V1, DEFAULT_WALLET_CONSOLE_SPONSORED_EVM_CALL_ROUTE_V1, DEFAULT_WALLET_SESSION_REMAINING_USES, DEFAULT_WALLET_SESSION_TTL_MS, ED25519_SIGNER_ACTIVATION_ID_PATH, InMemoryRouterAbEd25519YaoExportService, InMemoryRouterAbEd25519YaoExportStateV1, InMemoryRouterAbEd25519YaoRegistrationIntentAuthorizationAdapter, InMemoryRouterAbEd25519YaoRegistrationService, InMemoryRouterAbNormalSigningAdmissionStore, LINKED_DEVICE_OWNER_AUTHORIZATION_PATH_V1, LinkedDeviceRetiredTargetRegistrationShapeErrorV1, LinkedDeviceSourceFamilyUnavailableErrorV1, LinkedDeviceWebAuthnRegistrationVerifierV1, LocalRegistrationSetupAuthority, MAX_WALLET_SESSION_REMAINING_USES, MAX_WALLET_SESSION_TTL_MS, PUBLIC_PROOF_TYPES, ROUTER_AB_ECDSA_DERIVATION_PRIVATE_SIGNING_PATHS, ROUTER_AB_ED25519_PRIVATE_SIGNING_PATHS, ROUTER_AB_ED25519_YAO_CAPABILITY_REPLACEMENT_TABLE_V1, ROUTER_AB_ED25519_YAO_EXPORT_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_EXPORT_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_ACTIVATE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_STATUS_PATH_V1, ROUTER_AB_ED25519_YAO_REGISTRATION_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_REGISTRATION_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_SHARED_STATE_RECORD_KEY_V1, ROUTER_AB_ED25519_YAO_WARM_RECOVERY_BOOTSTRAP_PATH_V1, ROUTER_AB_MPC_ROUTER_ORIGIN, ROUTER_AB_PUBLIC_KEYSET_PATH, ROUTER_AB_PUBLIC_KEYSET_VERSION_V2, ROUTER_AB_PUBLIC_KEYSET_WELL_KNOWN_PATH, ROUTER_AB_SIGNING_WORKER_ORIGIN, ROUTER_AB_TRACE_ID_HEADER_V1, ROUTER_API_CREDENTIAL_SCOPES, ROUTE_SERVICE_KEYS, RouterAbEcdsaPresignRuntime, RouterAbEd25519YaoExportOwnerProofAuthorizationAdapter, RouterAbEd25519YaoHttpRegistrationBackend, RouterAbEd25519YaoRecoveryWalletSessionAuthorizationAdapter, SESSION_CAS_GUARD_SQL, SessionService, StaticCloudflareTenantStorageRouteResolver, UnavailableOrdinaryInactiveSignerMaterialDeactivationWorkerV1, UnavailableOrdinaryInactiveSignerMaterialReservationWorkerV1, WALLET_AUTH_METHOD_D1_STORE, WALLET_AUTH_METHOD_STORE_D1_SCHEMA_SQL, WALLET_AUTH_METHOD_STORE_D1_SCHEMA_V2_SQL, WALLET_CONSOLE_API_WALLET_DETAIL_PREFIX_V1, WALLET_CONSOLE_OPS_BASE_PATH_V1, WALLET_CONSOLE_OP_PATHS_V1, WALLET_CONSOLE_SERVICE_ORIGIN_V1, WALLET_CONSOLE_SIGNED_DELEGATE_ROUTE_ID_V1, WALLET_CONSOLE_SPONSORED_EVM_CALL_ROUTE_ID_V1, WALLET_CONTROL_AUTH_MARKER_V1, WALLET_CONTROL_BASE_PATH_V1, WALLET_CONTROL_SERVICE_ORIGIN_V1, WALLET_RUNTIME_OPS_BASE_PATH_V1, WALLET_RUNTIME_OP_PATHS_V1, WALLET_RUNTIME_SERVICE_ORIGIN_V1, WALLET_STORE_D1_SCHEMA_SQL, WalletHomeCustodyBinding, WalletLifecycleLocator, WalletObjectAddressSnapshot, WalletPlacementRoutes, abusePrincipalKey, addSecp256k1PublicKeys33, admitD1EstablishedWalletHome, admitRouterAbEcdsaReusableWalletSessionOperation, applyRouteMetering, assertUniqueRouterApiRouteDefinitions, authenticateDeviceLinkingOwnerWalletSessionRequestV1, authenticateRouterAbEcdsaOperationStepUp, authenticateRouterAbWalletOperationStepUp, authenticateRouterAbWalletOperationStepUpIdentity, authorizeRouterAbEcdsaDerivationNormalSigningRoute, authorizeRouterAbEd25519NormalSigningRoute, base64UrlDecode, base64UrlEncode, bindWalletAuthMethodIdentity, bindWalletAuthMethodIdentityV2, buildCorsOrigins, buildRouterAbEcdsaDerivationPrivateSigningWorkerBody, buildRouterAbEcdsaOwnerOperationStepUpPreparation, buildRouterAbEd25519OwnerOperationStepUpPreparation, buildRouterAbEd25519PrivateSigningWorkerBody, buildRouterAbEd25519YaoAddSignerAdmissionRequestV1, buildRouterAbEd25519YaoProductAdmissionRequestV1, buildTenantRootIdentityFromAuthenticatedDeploymentV1, buildVerifiedLinkInputV1, buildVerifiedTargetFactorV1, buildWalletEcdsaSignerRecord, claimRouterAbEcdsaOperationStepUp, coerceLogger, coerceRouterLogger, completeRouterAbEcdsaOperation, computeEip1559TxHash, computeLinkedDeviceSessionClaimDigestV1, computeRouterAbEd25519NormalSigningAdmissionMaterial, computeVerifiedTargetFactorVerificationDigestV1, createCloudflareD1RouterAbNormalSigningAdmissionStore, createCloudflareD1RouterApiAuthService, createCloudflareD1VersionedJsonRecordStore, createCloudflareDurableObjectVersionedJsonRecordStore, createCloudflareLinkedDeviceEd25519SourcePreservingRouterEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialActivationEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialActivationPortV1, createCloudflareOrdinaryInactiveSignerMaterialDeactivationEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialDeactivationPortV1, createCloudflareOrdinaryInactiveSignerMaterialReservationEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialReservationServiceV1, createCloudflareRouter, createCloudflareTenantStorageRoute, createCloudflareWalletGatewayRouterV1, createD1LinkedDeviceOwnerAuthorizationMetadataSourceV1, createD1LinkedDeviceOwnerAuthorizationProviderV1, createD1LinkedDeviceOwnerSourceChildReaderV1, createD1LinkedDeviceRouteServiceV1, createD1LinkedDeviceSessionServiceV1, createD1LinkedDeviceSourceContributionPreparationPlannerV1, createD1LinkedDeviceVerifiedLinkSourceReaderV1, createDeviceLinkingOwnerRequestAuthenticatorV1, createEd25519SessionAdapter, createInMemoryRouterAbNormalSigningAdmissionAdapter, createInMemoryRouterAbNormalSigningAdmissionStore, createInMemoryRouterApiRuntimeSnapshotConsumer, createRouterAbEcdsaEd25519CeremonyTokenIssuer, createRouterAbEcdsaStrictPostRegistrationPort, createRouterAbEcdsaStrictRegistrationPort, createRouterAbEd25519YaoCeremonyStateStoreV1, createRouterAbEd25519YaoExportModule, createRouterAbEd25519YaoHttpRegistrationBackendFromEnv, createRouterAbEd25519YaoMaterialActivationRefV1, createRouterAbEd25519YaoProductRegistrationCompositionFromPortsV1, createRouterAbEd25519YaoProductRegistrationPartitionedStateStoreFromD1V1, createRouterAbEd25519YaoProductRegistrationPartitionedStateStoreV1, createRouterAbEd25519YaoProductRegistrationRequestScopedRuntimeV1, createRouterAbEd25519YaoProductRegistrationRuntimeV1, createRouterAbEd25519YaoProductRegistrationStateFromPartsV1, createRouterAbEd25519YaoProductRegistrationStateV1, createRouterAbEd25519YaoRegistrationModule, createRouterAbNormalSigningAdmissionAdapter, createRouterAbServiceBindingFetch, createRouterApiModule, createRouterApiRouteDefinitions, createSignerD1DoStorageTarget, createSigningSessionSealOptions, createStaticCloudflareTenantStorageRouteResolver, createStaticCloudflareTenantStorageRouteResolverFromBindings, createStaticWalletConsoleBindingV1, createUnavailableOrdinaryInactiveSignerMaterialDeactivationPortV1, createUnavailableOrdinaryInactiveSignerMaterialReservationWorkerV1, createWalletConsoleOpsClient, createWalletConsoleRelayProxyExtensionV1, createWalletControlClientBindings, createWalletRegistrationContextResolver, createWalletRuntimeOpsHandler, d1ChangedRows, d1Integer, d1Number, decideRouterAbEcdsaOwnerOperationAuthorization, decideRouterAbEd25519OwnerOperationAuthorization, decodeEvmBlockHeader, decodeEvmTransactionByHash, decodeEvmTransactionCall, decodeEvmTransactionReceipt, decodeJsonRpcEnvelope, decodeWalletConsoleTenantRootActiveLineageRequestV1, decodeWalletConsoleTenantRootActiveLineageResponseV1, defineRoute, defineRouteExtension, deriveJwtExpiresAtIso, deriveRecoveryCodeLocatorV1FromBytes, digestOpaqueValue, encodeEip1559SignedTxFromSignature65, encodeRouterAbEd25519YaoProductRegistrationPartitionRecordV1, encodeRouterAbEd25519YaoProductRegistrationStateV1, encodeSessionJsonSegment, encodeTenantRootIdentityV1, enforceDelegatePolicy, enforceRoutePolicy, ensureEvmCryptoWasm, ensureLeadingSlash, ensureWalletAuthMethodStoreD1Schema, ensureWalletStoreD1Schema, evaluateRouterAbNormalSigningAdmission, executeRouterAbEd25519YaoAdmittedRegistrationV1, executeSignedDelegateWithRelayer, extractBearerCredential, extractRouterApiEnvironmentId, findRouteDefinitionById, findRouteDefinitionForRequest, formatD1ExecStatement, getRouterApiRouteExtensionDefinitions, getRouterApiRouteExtensionRoutes, getRouterApiRouteExtensionsForTransport, handleRouterAbEcdsaDerivationNormalSigningRouteCore, handleRouterAbEd25519YaoExportRequestScopedCloudflareV1, handleRouterAbEd25519YaoRecoveryRequestScopedCloudflareV1, handleRouterAbEd25519YaoRegistrationRequestScopedCloudflareV1, handleStaticWalletConsoleRequestV1, handleWalletControlRequest, headersToRecord, isD1DatabaseLike, isObject, isPlainObject, json, jsonFailure, keccak256Bytes, linkedDeviceSignerManifestsEqualV1, linkedDeviceX25519RecipientPublicKeyB64uV1, loadCloudflareSignerWasmModule, matchesRouteDefinitionRequest, mergeRouterAbEd25519YaoProductRegistrationStatePartitionV1, mintRouterAbEd25519YaoRegistrationIdentityV1, normalizeBoundedPositiveInteger, normalizeCorsOrigin, normalizeD1RouterApiAuthOptions, normalizeHashToBytes, normalizeLinkedDevicePasskeyTargetConfigurationV1, normalizeLogger, normalizeLowercaseString, normalizeSessionString, normalizeSessionTtlSeconds, normalizeSourceIp, normalizeTrimmedString, normalizeWalletAuthMethod, normalizeWalletAuthMethodV2, parseBooleanFlag, parseBooleanJwtClaim, parseCacheControlMaxAgeSec, parseCsvList, parseD1JsonArrayColumn, parseD1JsonColumn, parseD1JsonObjectColumn, parseD1LinkedDeviceSessionRowV1, parseD1LinkedDeviceSessionTranscriptRowV1, parseGoogleEmailOtpRegistrationAttemptRecord, parseGoogleEmailOtpRegistrationOfferCandidates, parseGoogleJwks, parseGoogleLoginVerifyRequest, parseInstalledEcdsaCustodySnapshotV1, parseJwtAud, parseLinkedDeviceSessionRecordV1, parseOrgId, parseRecoveryCodeLocatorV1, parseRouterAbEcdsaEd25519PrivateJwk, parseRouterAbEcdsaPresignRuntimeConfig, parseRouterAbEcdsaStrictRegistrationTopology, parseRouterAbEd25519NormalSigningScopeV2, parseRouterAbEd25519OperationStepUpScope, parseRouterAbEd25519YaoActivationKeysetFromEnvV1, parseRouterAbEd25519YaoCeremonyKeyV1, parseRouterAbEd25519YaoExportAdmissionEnvelopeV1, parseRouterAbEd25519YaoExportExecuteEnvelopeV1, parseRouterAbEd25519YaoProductRegistrationPartitionRecordJsonV1, parseRouterAbEd25519YaoProductRegistrationPartitionRecordV1, parseRouterAbEd25519YaoProductRegistrationStateJsonV1, parseRouterAbEd25519YaoProductRegistrationStateV1, parseRouterAbEd25519YaoRegistrationAdmissionReadV1, parseRouterAbEd25519YaoRegistrationRouterAnswerV1, parseRouterAbEd25519YaoTenantRootWireV1, parseRouterAbOperationStepUpOperation, parseRouterAbPublicKeysetV2, parseRpcHexQuantity, parseRs256JwtForVerification, parseSessionJwt, parseSigningSessionSealRootConfig, parseStaticWalletConsoleBindingConfigV1, parseStoredRouterAbEcdsaPendingActivationV1, parseWalletEd25519SignerRecord, parseWalletId, parseWalletRecoveryOperationId, parseWalletRegistrationContextResponse, parseWalletRegistrationSetupRequest, parseWalletRegistrationSetupReservation, parseWalletRuntimeExecuteSignedDelegateRequest, parseWalletRuntimeExecuteSignedDelegateResponse, parseWalletRuntimeExecuteSignedDelegateResult, parseWalletRuntimeRelayerAccount, parseWalletRuntimeWalletIdentitiesResult, parseWalletRuntimeWalletIdentityRequest, parseWebAuthnRpId, parseWebAuthnSyncChallengeRecord, partitionRouterAbEd25519YaoProductRegistrationStateV1, postRouterAbSigningWorkerJson, prepareD1TenantStatement, prepareD1WalletAuthMethodInsertStatement, prepareD1WalletAuthMethodPutStatement, prepareD1WalletAuthMethodV2PutStatement, prepareD1WalletPutSignerStatement, prepareD1WalletPutSubjectStatement, prepareD1WebAuthnAuthenticatorInsertStatement, prepareD1WebAuthnAuthenticatorPutStatement, projectRouterAbEd25519YaoExactWalletSession, proposeWalletRegistrationSetup, publishableKeyRoutePrincipal, queryD1All, queryD1One, randomTenantRootCreationGrantBytesV1, readD1LinkedDeviceEcdsaSourceV1, readD1LinkedDeviceEd25519SourceV1, readEnvironmentCsv, readEnvironmentString, readJson, registrationPreparationIdFromString, requireD1RouterApiAuthScopeString, requireEnvironmentString, requireNormalizedSessionString, requireRuntimePolicyScope, resolveFreshRouterAbEcdsaMaterialActivation, resolvePublishableKeyApiCredentialAuth, resolveRequestOriginRateLimitKeyFromFetchHeaders, resolveRouterAbEd25519YaoCeremonyKeyFromRequestV1, resolveRuntimeTenantRootLineage, resolveSecretKeyApiCredentialAuth, resolveSourceIpFromFetchHeaders, resolveWalletRegistrationContext, resumeRegistrationDirectoryPublicationsV1, routeError, routeJson, routerAbEcdsaAtomicAuthorizationConfigured, routerAbEcdsaOperationInProgressResult, routerAbEcdsaOwnerOperationFailureResult, routerAbEcdsaRecordedResponse, routerAbEcdsaReplayHttpResponse, routerAbEcdsaReplayResult, routerAbEcdsaReplayUnavailableResult, routerAbEcdsaStrictRegistrationFactsBindingJson, routerAbEcdsaStrictRegistrationRequestBindingJson, routerAbEcdsaStrictRegistrationRequestMatchesFacts, routerAbEd25519OwnerOperationFailureResult, routerAbEd25519YaoAdmittedRegistrationAuthorityV1, routerAbEd25519YaoPartitionedStateAfterStoredCommitV1, routerAbEd25519YaoPersistedCapabilityMatchesLookupV1, routerAbEd25519YaoRegistrationExecutionTimingEntriesV1, routerAbEd25519YaoRegistrationSigningRootIdV1, routerAbEd25519YaoTenantRootWireV1, runRouterAbEd25519YaoProductRegistrationRequestScopedV1, runRouterAbEd25519YaoRegistrationSideEffectV1, runRouterAbEd25519YaoRegistrationTwoPhaseV1, runRouterAbPrewarmScheduledV1, runtimePolicyScopeKey, sameRouterAbEd25519YaoSharedStateCanonicalEncodingV1, secp256k1PrivateKey32ToPublicKey33, secp256k1PublicKey33ToEthereumAddress, secureRandomBase36, secureRandomBase64Url, selectWalletEd25519Signer, sessionJwtTimeClaims, sha256Bytes, sha256BytesSync, signSecp256k1Recoverable, signTenantRootCreationGrantV1, tenantRootIdentityDigestB64uV1, tenantStorageRouteBackendFamily, tenantStorageRouteDiagnostic, toFetchRouteResponse, normalizeOptionalTrimmedString as toOptionalTrimmedString, toResponse, toSessionArrayBufferCopy, unavailableRegistrationContext, validateDelegateExpiryAndNonce, validateGoogleIdTokenClaims, validateRuntimeSnapshotExpectation, validateSecp256k1PublicKey33, verifyGoogleOidcToken, verifyRs256JwtSignature, verifySecp256k1Bip340SignatureAgainstPublicKey33, verifySecp256k1RecoverableSignatureAgainstPublicKey33, walletAuthMethodId, walletAuthMethodV2Id, walletConsoleApiWalletGetRouteDefinitionV1, walletConsoleApiWalletListRouteDefinitionV1, walletConsoleApiWalletSearchRouteDefinitionV1, walletConsoleRelayRouteDefinitionsV1, walletConsoleSignedDelegateRouteDefinitionV1, walletConsoleSponsoredEvmCallRouteDefinitionV1, walletObjectIdentity, walletRegistrationContext, walletRegistrationSetupRequestDigest, webAuthnCredentialIdB64uFromCredential, withCors };
@@ -1,12 +1,14 @@
1
1
  import { runRouterAbPrewarmScheduledV1 } from "./router/cloudflare/runtime/routerAbPrewarm.js";
2
2
  import "./cloud-host.js";
3
- import { handleLocalHostedWalletGatewayRequestV1 } from "./localHostedWalletGatewayHandler.js";
3
+ import { handleLocalHostedWalletGatewayRequestV1, resumeLocalRegistrationDirectoryPublicationsV1 } from "./localHostedWalletGatewayHandler.js";
4
4
  //#region src/local-hosted-wallet-gateway-worker.ts
5
5
  async function fetch(request, env, ctx) {
6
6
  return await handleLocalHostedWalletGatewayRequestV1(request, env, ctx);
7
7
  }
8
8
  async function scheduled(event, env, _ctx) {
9
- await runRouterAbPrewarmScheduledV1(event, env);
9
+ const [prewarm, publications] = await Promise.allSettled([runRouterAbPrewarmScheduledV1(event, env), resumeLocalRegistrationDirectoryPublicationsV1(env)]);
10
+ if (prewarm.status === "rejected") throw prewarm.reason;
11
+ if (publications.status === "rejected") throw publications.reason;
10
12
  }
11
13
  var local_hosted_wallet_gateway_worker_default = {
12
14
  fetch,
@@ -5,6 +5,7 @@ import { LocalRegistrationSetupAuthority } from "./localRegistrationSetupAuthori
5
5
  import { WALLET_CONSOLE_OP_PATHS_V1 } from "./router/cloudflare/runtime/walletConsoleOps.js";
6
6
  import { WalletHomeCustodyBinding } from "./router/cloudflare/runtime/routerAbServiceBindings.js";
7
7
  import { createStaticWalletConsoleBindingV1, parseStaticWalletConsoleBindingConfigV1 } from "./router/cloudflare/runtime/staticWalletConsoleBinding.js";
8
+ import { resumeRegistrationDirectoryPublicationsV1 } from "./router/cloudflare/d1/registration/d1WalletExecutionAuthority.js";
8
9
  import { handleSplitGatewayRequest } from "./hosted-wallet-gateway.js";
9
10
  import { localPresignCancellationProbe } from "./localIntendedPresignCancellation.js";
10
11
  import { LOCAL_INTENDED_YAO_FAULT_HEADER_V1, LOCAL_INTENDED_YAO_FAULT_TOKEN_HEADER_V1, LocalIntendedYaoFaultControllerV1, parseLocalIntendedYaoFaultModeV1, parseLocalIntendedYaoFaultTokenV1, requestWithoutLocalIntendedYaoFaultHeadersV1, responseWithLocalIntendedYaoFaultOutcomeV1 } from "./localIntendedYaoFault.js";
@@ -99,6 +100,23 @@ async function handleEcdsaRespondFault(request, env, ctx, dependencies, fault, e
99
100
  }
100
101
  return Response.json({ code: "invalid_intended_ecdsa_fault" }, { status: 400 });
101
102
  }
103
+ function localTenantScope(env, config) {
104
+ return {
105
+ namespace: requireCanonicalString(env.SEAMS_TENANT_STORAGE_NAMESPACE, "Local namespace"),
106
+ orgId: config.deployment.orgId,
107
+ projectId: config.deployment.projectId,
108
+ envId: config.deployment.environmentKey
109
+ };
110
+ }
111
+ /** Sends the due directory publications to the local registration authority. */
112
+ async function resumeLocalRegistrationDirectoryPublicationsV1(env) {
113
+ const scope = localTenantScope(env, parseStaticWalletConsoleBindingConfigV1(JSON.parse(env.WALLET_LOCAL_DEPLOYMENT_JSON)));
114
+ await resumeRegistrationDirectoryPublicationsV1({
115
+ database: env.SIGNER_DB,
116
+ scope,
117
+ registrationAuthority: new LocalRegistrationSetupAuthority(env.SIGNER_DB, scope)
118
+ });
119
+ }
102
120
  /**
103
121
  * The local Gateway: the hosted Gateway handler plus the intended-suite
104
122
  * transport faults, which a request arms with local-only headers. The local
@@ -106,12 +124,7 @@ async function handleEcdsaRespondFault(request, env, ctx, dependencies, fault, e
106
124
  */
107
125
  async function handleLocalHostedWalletGatewayRequestV1(request, env, ctx, dependencies) {
108
126
  const config = parseStaticWalletConsoleBindingConfigV1(JSON.parse(env.WALLET_LOCAL_DEPLOYMENT_JSON));
109
- const tenantScope = {
110
- namespace: requireCanonicalString(env.SEAMS_TENANT_STORAGE_NAMESPACE, "Local namespace"),
111
- orgId: config.deployment.orgId,
112
- projectId: config.deployment.projectId,
113
- envId: config.deployment.environmentKey
114
- };
127
+ const tenantScope = localTenantScope(env, config);
115
128
  dependencies = {
116
129
  emailOtpDeliveryProvider: dependencies?.emailOtpDeliveryProvider,
117
130
  signerWasm: dependencies?.signerWasm,
@@ -328,6 +341,6 @@ async function handleEcdsaFinalizeFault(request, env, ctx, dependencies, rawMode
328
341
  }, ctx, dependencies), controller.consumeOutcome(), token);
329
342
  }
330
343
  //#endregion
331
- export { handleLocalHostedWalletGatewayRequestV1 };
344
+ export { handleLocalHostedWalletGatewayRequestV1, resumeLocalRegistrationDirectoryPublicationsV1 };
332
345
 
333
346
  //# sourceMappingURL=localHostedWalletGatewayHandler.js.map
@@ -1,6 +1,9 @@
1
1
  import { D1_BATCH_CAS_GUARD_SQL } from "../../../../storage/d1Sql.js";
2
2
  import { prepareD1TenantStatement } from "../../../../core/d1TenantStore.js";
3
3
  //#region src/router/cloudflare/d1/registration/d1WalletExecutionAuthority.ts
4
+ /** The finalize response normally delivers first; the scheduled resumption waits this long. */
5
+ const DIRECTORY_PUBLICATION_FIRST_RETRY_MS = 6e4;
6
+ const DIRECTORY_PUBLICATION_MAX_RETRY_MS = 36e5;
4
7
  var D1WalletExecutionAuthority = class {
5
8
  constructor(database, scope, registration) {
6
9
  this.database = database;
@@ -83,23 +86,104 @@ var D1WalletExecutionAuthority = class {
83
86
  await this.database.batch(this.prepareState(input, "retired"));
84
87
  return completed;
85
88
  }
86
- async publishEstablished(input) {
87
- if (input.registration.state === "active") return {
88
- ok: true,
89
- activation: null
90
- };
91
- const completed = await this.registration.complete({
92
- ceremonyId: input.registration.ceremonyId,
89
+ prepareEstablished(input) {
90
+ if (input.registration.state === "active") return null;
91
+ const publication = {
93
92
  walletId: input.registration.walletId,
94
- outcome: "established",
95
- session: input.session
96
- });
97
- if (!completed.ok) return completed;
93
+ ceremonyId: input.registration.ceremonyId,
94
+ digest: input.session.digest,
95
+ expiresAtMs: input.session.expiresAtMs,
96
+ attempts: 0
97
+ };
98
98
  return {
99
- ok: true,
100
- activation: { statements: this.prepareState(input.registration, "active") }
99
+ statements: [...this.prepareState(input.registration, "active"), prepareD1TenantStatement(this.database, this.scope, `INSERT INTO wallet_registration_directory_publications
100
+ (namespace, org_id, project_id, env_id, wallet_id, ceremony_id,
101
+ session_digest, session_expires_at_ms, next_attempt_at_ms)
102
+ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9)
103
+ ON CONFLICT DO NOTHING`, [
104
+ publication.walletId,
105
+ publication.ceremonyId,
106
+ publication.digest,
107
+ publication.expiresAtMs,
108
+ Date.now() + DIRECTORY_PUBLICATION_FIRST_RETRY_MS
109
+ ])],
110
+ publish: async () => {
111
+ try {
112
+ await this.deliver(publication);
113
+ } catch (error) {
114
+ console.warn("[wallet-registration] directory publication stays pending", error);
115
+ }
116
+ }
101
117
  };
102
118
  }
119
+ /** Sends the publications that are due, oldest first, one at a time. */
120
+ async resumeDirectoryPublications(input) {
121
+ const due = await prepareD1TenantStatement(this.database, this.scope, `SELECT wallet_id, ceremony_id, session_digest, session_expires_at_ms, attempts
122
+ FROM wallet_registration_directory_publications
123
+ WHERE namespace = ?1 AND org_id = ?2 AND project_id = ?3 AND env_id = ?4
124
+ AND state = 'pending' AND next_attempt_at_ms <= ?5
125
+ ORDER BY next_attempt_at_ms LIMIT ?6`, [input.nowMs, input.limit]).all();
126
+ if (!due.success) throw new Error("Registration directory publication read failed");
127
+ const delivered = {
128
+ acknowledged: 0,
129
+ deferred: 0,
130
+ refused: 0
131
+ };
132
+ for (const row of due.results ?? []) {
133
+ const outcome = await this.deliver({
134
+ walletId: row.wallet_id,
135
+ ceremonyId: row.ceremony_id,
136
+ digest: row.session_digest,
137
+ expiresAtMs: row.session_expires_at_ms,
138
+ attempts: row.attempts
139
+ });
140
+ delivered[outcome] += 1;
141
+ }
142
+ return delivered;
143
+ }
144
+ async deliver(publication) {
145
+ let completed;
146
+ try {
147
+ completed = await this.registration.complete({
148
+ ceremonyId: publication.ceremonyId,
149
+ walletId: publication.walletId,
150
+ outcome: "established",
151
+ session: {
152
+ kind: "credential",
153
+ walletId: publication.walletId,
154
+ digest: publication.digest,
155
+ expiresAtMs: publication.expiresAtMs
156
+ }
157
+ });
158
+ } catch (error) {
159
+ console.warn("[wallet-registration] directory publication deferred", error);
160
+ const delayMs = Math.min(DIRECTORY_PUBLICATION_FIRST_RETRY_MS * 2 ** Math.min(publication.attempts + 1, 16), DIRECTORY_PUBLICATION_MAX_RETRY_MS);
161
+ await this.preparePublicationUpdate(publication, `attempts = attempts + 1, next_attempt_at_ms = ?7`, [Date.now() + delayMs]).run();
162
+ return "deferred";
163
+ }
164
+ if (!completed.ok) {
165
+ console.error("[wallet-registration] directory refused an established registration", {
166
+ walletId: publication.walletId,
167
+ ceremonyId: publication.ceremonyId,
168
+ code: completed.code
169
+ });
170
+ await this.preparePublicationUpdate(publication, `state = 'refused'`, []).run();
171
+ return "refused";
172
+ }
173
+ await prepareD1TenantStatement(this.database, this.scope, `DELETE FROM wallet_registration_directory_publications
174
+ WHERE namespace = ?1 AND org_id = ?2 AND project_id = ?3 AND env_id = ?4
175
+ AND wallet_id = ?5 AND ceremony_id = ?6 AND state = 'pending'`, [publication.walletId, publication.ceremonyId]).run();
176
+ return "acknowledged";
177
+ }
178
+ preparePublicationUpdate(publication, assignments, values) {
179
+ return prepareD1TenantStatement(this.database, this.scope, `UPDATE wallet_registration_directory_publications SET ${assignments}
180
+ WHERE namespace = ?1 AND org_id = ?2 AND project_id = ?3 AND env_id = ?4
181
+ AND wallet_id = ?5 AND ceremony_id = ?6 AND state = 'pending'`, [
182
+ publication.walletId,
183
+ publication.ceremonyId,
184
+ ...values
185
+ ]);
186
+ }
103
187
  async fixCancellation(input) {
104
188
  await this.database.batch([prepareD1TenantStatement(this.database, this.scope, `UPDATE wallet_execution_generations
105
189
  SET registration_completion = 'cancelled', state = 'retired'
@@ -162,7 +246,18 @@ async function admitD1EstablishedWalletHome(database, scope, input) {
162
246
  ownershipGeneration: row.generation
163
247
  };
164
248
  }
249
+ /**
250
+ * Sends the due directory publications of one tenant scope. The Gateway's
251
+ * scheduled handler runs it, so a publication that the finalize response could
252
+ * not deliver still reaches the directory.
253
+ */
254
+ function resumeRegistrationDirectoryPublicationsV1(input) {
255
+ return new D1WalletExecutionAuthority(input.database, input.scope, input.registrationAuthority).resumeDirectoryPublications({
256
+ nowMs: input.nowMs ?? Date.now(),
257
+ limit: input.limit ?? 20
258
+ });
259
+ }
165
260
  //#endregion
166
- export { D1WalletExecutionAuthority, admitD1EstablishedWalletHome, prepareD1RegistrationHomeReservation };
261
+ export { D1WalletExecutionAuthority, admitD1EstablishedWalletHome, prepareD1RegistrationHomeReservation, resumeRegistrationDirectoryPublicationsV1 };
167
262
 
168
263
  //# sourceMappingURL=d1WalletExecutionAuthority.js.map
@@ -68,6 +68,17 @@ async function buildRespondEd25519AdmissionRequest(input) {
68
68
  materialActivation: mint.materialActivation
69
69
  });
70
70
  }
71
+ /**
72
+ * Sends the directory publication that a completed registration operation
73
+ * recorded as pending. The response does not wait for it when the runtime keeps
74
+ * background work; a failed delivery stays pending for the scheduled resumption.
75
+ */
76
+ async function publishCompletedRegistration(execution, waitUntil) {
77
+ const activation = registrationCommitActivation(execution);
78
+ if (!activation) return;
79
+ if (waitUntil) waitUntil(activation.publish());
80
+ else await activation.publish();
81
+ }
71
82
  function ignoreRespondExecutionFailure() {
72
83
  return null;
73
84
  }
@@ -2425,7 +2436,9 @@ var CloudflareD1WalletRegistrationService = class {
2425
2436
  recordRegistrationServerTiming(serverTiming, "near_finalize_side_effect", sideEffectStartedAtMs);
2426
2437
  switch (run.kind) {
2427
2438
  case "executed":
2428
- case "exact_replay": break;
2439
+ case "exact_replay":
2440
+ await publishCompletedRegistration(run.value, waitUntil);
2441
+ break;
2429
2442
  case "request_conflict": return {
2430
2443
  ok: false,
2431
2444
  code: "idempotency_conflict",
@@ -2767,7 +2780,7 @@ var CloudflareD1WalletRegistrationService = class {
2767
2780
  * before execution; an ambiguous outcome after the custody call stays
2768
2781
  * `uncertain` rather than being guessed either way.
2769
2782
  */
2770
- async activateWalletRegistration(input, traceContext, serverTiming) {
2783
+ async activateWalletRegistration(input, traceContext, serverTiming, waitUntil) {
2771
2784
  try {
2772
2785
  const verifiedSetup = await verifyWalletRegistrationSetupClaims(input.verifier, input.signedSetup, {
2773
2786
  registrationCeremonyId: input.registrationCeremonyId,
@@ -2830,6 +2843,7 @@ var CloudflareD1WalletRegistrationService = class {
2830
2843
  switch (run.kind) {
2831
2844
  case "executed":
2832
2845
  case "exact_replay":
2846
+ await publishCompletedRegistration(run.value, waitUntil);
2833
2847
  if (run.value.response.ok && run.value.response.kind === "evm_family_ecdsa") await cleanupFinalizedRegistrationCeremony({
2834
2848
  store: this.getRegistrationCeremonyIntentStore(),
2835
2849
  registrationCeremonyId: claims.registrationCeremonyId
@@ -49,9 +49,9 @@ function requireWalletSessionPrincipalId(value) {
49
49
  if (!parsed.ok) throw new Error(`Wallet Session principal is invalid: ${parsed.error.message}`);
50
50
  return parsed.value;
51
51
  }
52
- function publishCommittedRegistration(home, committed) {
53
- if (!committed.registration) throw new Error("Registration publication requires a committed registration session");
54
- return home.publishEstablished({
52
+ function prepareCommittedRegistrationActivation(home, committed) {
53
+ if (!committed.registration) throw new Error("Registration activation requires a committed registration session");
54
+ return home.prepareEstablished({
55
55
  registration: committed.registration,
56
56
  session: committed.publication
57
57
  });
@@ -346,13 +346,11 @@ async function issueDirectRegistrationEstablishedEcdsaSession(input) {
346
346
  runtimePolicyScope: input.runtimePolicyScope,
347
347
  keyHandle
348
348
  });
349
- const published = await publishCommittedRegistration(input.homeCompletion, committed);
350
- if (!published.ok) throw new Error(published.message);
351
349
  return directRegistrationResultFromIssue({
352
350
  directIssue,
353
351
  authorization,
354
352
  tokens,
355
- activation: published.activation
353
+ activation: prepareCommittedRegistrationActivation(input.homeCompletion, committed)
356
354
  });
357
355
  }
358
356
  async function issueDirectRegistrationEstablishedEd25519Session(input) {
@@ -417,16 +415,13 @@ async function issueDirectRegistrationEstablishedEd25519Session(input) {
417
415
  }).ed25519,
418
416
  predecessor: input.predecessor
419
417
  });
420
- const [publication, preparation] = await Promise.allSettled([publishCommittedRegistration(input.homeCompletion, committed), input.onSessionCommitted?.(projectDirectRegistrationSession(authorization, tokens))]);
421
- if (publication.status === "rejected") throw publication.reason;
422
- if (preparation.status === "rejected") throw preparation.reason;
423
- const published = publication.value;
424
- if (!published.ok) throw new Error(published.message);
418
+ const activation = prepareCommittedRegistrationActivation(input.homeCompletion, committed);
419
+ await input.onSessionCommitted?.(projectDirectRegistrationSession(authorization, tokens));
425
420
  return directRegistrationResultFromIssue({
426
421
  directIssue,
427
422
  authorization,
428
423
  tokens,
429
- activation: published.activation
424
+ activation
430
425
  });
431
426
  }
432
427
  function projectCurrentNearRegistrationSession(authorization, tokens) {
@@ -14366,7 +14366,7 @@ async function handleRouterApiWalletRegistrationActivate(input) {
14366
14366
  ...body.emailOtpEnrollment ? { emailOtpEnrollment: body.emailOtpEnrollment } : {},
14367
14367
  ...body.walletCustodyCommit !== void 0 ? { walletCustodyCommit: body.walletCustodyCommit } : {},
14368
14368
  verifier: session
14369
- }, traceContext.value ?? void 0, serverTiming);
14369
+ }, traceContext.value ?? void 0, serverTiming, input.waitUntil);
14370
14370
  if (!result.ok) return routeJson(400, result);
14371
14371
  if (!isEmailOtpWalletRegistrationActivateSuccessV2(result) && !isPasskeyWalletRegistrationActivateSuccessV2(result)) return routeError(500, "internal", "Wallet registration activation returned an invalid authority");
14372
14372
  return routeJson(200, result, { headers: registrationServerTimingHeaders(serverTiming) });
@@ -1891,7 +1891,7 @@ async function handleRouterApiWalletRegistrationActivate(input) {
1891
1891
  ...body.emailOtpEnrollment ? { emailOtpEnrollment: body.emailOtpEnrollment } : {},
1892
1892
  ...body.walletCustodyCommit !== void 0 ? { walletCustodyCommit: body.walletCustodyCommit } : {},
1893
1893
  verifier: session
1894
- }, traceContext.value ?? void 0, serverTiming);
1894
+ }, traceContext.value ?? void 0, serverTiming, input.waitUntil);
1895
1895
  if (!result.ok) return routeJson(400, result);
1896
1896
  if (!isEmailOtpWalletRegistrationActivateSuccessV2(result) && !isPasskeyWalletRegistrationActivateSuccessV2(result)) return routeError(500, "internal", "Wallet registration activation returned an invalid authority");
1897
1897
  return routeJson(200, result, { headers: registrationServerTimingHeaders(serverTiming) });
@@ -119,7 +119,7 @@ export type { LinkedDeviceBootstrapStore, LinkedDeviceBootstrapResult, } from '.
119
119
  export { parseLinkedDeviceSessionRecordV1 } from './core/deviceLinking/linkedDeviceSessionRecord';
120
120
  export type { LinkedDeviceSessionRecordV1 } from './core/deviceLinking/linkedDeviceSessionRecord';
121
121
  export { computeLinkedDeviceSessionClaimDigestV1 } from '../../shared-ts/src/device-linking/digests';
122
- export { admitD1EstablishedWalletHome } from './router/cloudflare/d1/registration/d1WalletExecutionAuthority';
122
+ export { admitD1EstablishedWalletHome, resumeRegistrationDirectoryPublicationsV1, type RegistrationDirectoryPublicationDelivery, } from './router/cloudflare/d1/registration/d1WalletExecutionAuthority';
123
123
  export { D1WalletObjectAddresses } from './router/cloudflare/d1/walletObjectAddresses';
124
124
  export { walletObjectIdentity, WalletObjectAddressSnapshot, type WalletObjectIdentity } from './router/cloudflare/runtime/walletObjectAddresses';
125
125
  //# sourceMappingURL=cloud-host.d.ts.map
@@ -3,6 +3,8 @@ import type { CfExecutionContext } from './router/cloudflare/runtime/cloudflare.
3
3
  export type LocalHostedWalletGatewayEnv = CloudflareD1GatewayBaseEnv & {
4
4
  readonly WALLET_LOCAL_DEPLOYMENT_JSON: string;
5
5
  };
6
+ /** Sends the due directory publications to the local registration authority. */
7
+ export declare function resumeLocalRegistrationDirectoryPublicationsV1(env: LocalHostedWalletGatewayEnv): Promise<void>;
6
8
  /**
7
9
  * The local Gateway: the hosted Gateway handler plus the intended-suite
8
10
  * transport faults, which a request arms with local-only headers. The local
@@ -1,6 +1,6 @@
1
1
  import { type D1TenantScope } from '../../../../core/d1TenantStore';
2
2
  import type { D1DatabaseLike, D1ResultLike } from '../../../../storage/tenantRoute';
3
- import type { RegistrationEstablishedPublication, WalletExecutionAuthority, WalletRegistrationHomeAuthority, WalletRegistrationReservationAuthority } from '../../../domains/walletRegistration/walletRegistrationReservation';
3
+ import type { RegistrationActivationWrite, WalletExecutionAuthority, WalletRegistrationHomeAuthority, WalletRegistrationReservationAuthority } from '../../../domains/walletRegistration/walletRegistrationReservation';
4
4
  type Authority = WalletRegistrationReservationAuthority;
5
5
  type HomeAdmission = Awaited<ReturnType<Authority['admitHome']>>;
6
6
  type OrdinaryAdmission = Awaited<ReturnType<WalletExecutionAuthority['admitEstablishedHome']>>;
@@ -10,6 +10,7 @@ type RegistrationHomeRow = {
10
10
  readonly registration_completion: string;
11
11
  readonly relocation_blocked: number;
12
12
  };
13
+ export type RegistrationDirectoryPublicationDelivery = 'acknowledged' | 'deferred' | 'refused';
13
14
  export declare class D1WalletExecutionAuthority implements WalletRegistrationHomeAuthority, WalletExecutionAuthority {
14
15
  private readonly database;
15
16
  private readonly scope;
@@ -26,7 +27,14 @@ export declare class D1WalletExecutionAuthority implements WalletRegistrationHom
26
27
  readonly code: string;
27
28
  readonly message: string;
28
29
  }>;
29
- publishEstablished(input: Parameters<WalletRegistrationHomeAuthority['publishEstablished']>[0]): Promise<RegistrationEstablishedPublication>;
30
+ prepareEstablished(input: Parameters<WalletRegistrationHomeAuthority['prepareEstablished']>[0]): RegistrationActivationWrite | null;
31
+ /** Sends the publications that are due, oldest first, one at a time. */
32
+ resumeDirectoryPublications(input: {
33
+ readonly nowMs: number;
34
+ readonly limit: number;
35
+ }): Promise<Record<RegistrationDirectoryPublicationDelivery, number>>;
36
+ private deliver;
37
+ private preparePublicationUpdate;
30
38
  private fixCancellation;
31
39
  /** The state update with its guard. The guard reads the row count of the update before it. */
32
40
  private prepareState;
@@ -37,5 +45,17 @@ export declare function prepareD1RegistrationHomeReservation(database: D1Databas
37
45
  readonly ownershipGeneration: number;
38
46
  }): import("../../../cloudflare-adaptor").D1PreparedStatementLike[];
39
47
  export declare function admitD1EstablishedWalletHome(database: D1DatabaseLike, scope: D1TenantScope, input: Parameters<WalletExecutionAuthority['admitEstablishedHome']>[0]): Promise<OrdinaryAdmission>;
48
+ /**
49
+ * Sends the due directory publications of one tenant scope. The Gateway's
50
+ * scheduled handler runs it, so a publication that the finalize response could
51
+ * not deliver still reaches the directory.
52
+ */
53
+ export declare function resumeRegistrationDirectoryPublicationsV1(input: {
54
+ readonly database: D1DatabaseLike;
55
+ readonly scope: D1TenantScope;
56
+ readonly registrationAuthority: Authority;
57
+ readonly nowMs?: number;
58
+ readonly limit?: number;
59
+ }): Promise<Record<RegistrationDirectoryPublicationDelivery, number>>;
40
60
  export {};
41
61
  //# sourceMappingURL=d1WalletExecutionAuthority.d.ts.map
@@ -320,7 +320,7 @@ export declare class CloudflareD1WalletRegistrationService {
320
320
  * before execution; an ambiguous outcome after the custody call stays
321
321
  * `uncertain` rather than being guessed either way.
322
322
  */
323
- activateWalletRegistration(input: WalletRegistrationActivateInput, traceContext?: RouterAbTraceContextV1, serverTiming?: Array<readonly [string, number]>): Promise<WalletRegistrationActivateResponseV2>;
323
+ activateWalletRegistration(input: WalletRegistrationActivateInput, traceContext?: RouterAbTraceContextV1, serverTiming?: Array<readonly [string, number]>, waitUntil?: (promise: Promise<unknown>) => void): Promise<WalletRegistrationActivateResponseV2>;
324
324
  /**
325
325
  * Router/SigningWorker activation followed by the blocking finalize
326
326
  * persistence, as one unit inside the operation row. The commit is told the
@@ -18,7 +18,7 @@ type RegistrationEstablishedSessionIssuanceDependencies = {
18
18
  readonly authorizationService: RegistrationEstablishedSessionIssuerAuthorizationService;
19
19
  readonly authorizationTenantId: TenantId;
20
20
  readonly foundingAuthority: ActiveWalletAuthorityV1;
21
- readonly homeCompletion: Pick<WalletRegistrationHomeAuthority, 'publishEstablished'>;
21
+ readonly homeCompletion: Pick<WalletRegistrationHomeAuthority, 'prepareEstablished'>;
22
22
  };
23
23
  export type RegistrationInitialSessionCommit = {
24
24
  readonly kind: 'uncommitted';
@@ -93,37 +93,32 @@ export interface WalletRegistrationReservationAuthority {
93
93
  })): Promise<ReservationOutcome>;
94
94
  }
95
95
  /**
96
- * The local write that makes an established registration active. It follows
97
- * the acknowledged directory write. It commits in the batch of the record
96
+ * The local write that makes an established registration active and records
97
+ * its directory publication as pending. It commits in the batch of the record
98
98
  * that completes the registration operation, or it does not commit.
99
99
  */
100
100
  export type RegistrationActivationWrite = {
101
101
  readonly statements: readonly D1PreparedStatementLike[];
102
- };
103
- export type RegistrationEstablishedPublication = {
104
- readonly ok: true;
105
- /** None when an earlier completion already activated the registration. */
106
- readonly activation: RegistrationActivationWrite | null;
107
- readonly code?: never;
108
- readonly message?: never;
109
- } | {
110
- readonly ok: false;
111
- readonly code: string;
112
- readonly message: string;
113
- readonly activation?: never;
102
+ /**
103
+ * Sends the pending directory publication. Call it only after the statements
104
+ * commit. It never throws: a failed delivery stays pending for the next attempt.
105
+ */
106
+ readonly publish: () => Promise<void>;
114
107
  };
115
108
  /** The registration authority at the wallet's home, which owns the local activation. */
116
109
  export interface WalletRegistrationHomeAuthority extends Pick<WalletRegistrationReservationAuthority, 'reserve' | 'admitHome'> {
117
110
  /**
118
- * Publishes the committed registration decision to its directory and prepares the
119
- * activation. The caller commits the activation with its completion record.
111
+ * Prepares the activation of the committed registration decision with its
112
+ * pending directory publication. None when an earlier completion already
113
+ * activated the registration. The caller commits the activation with its
114
+ * completion record, then publishes.
120
115
  */
121
- publishEstablished(input: {
116
+ prepareEstablished(input: {
122
117
  readonly registration: CommittedWalletRegistration;
123
118
  readonly session: WalletSessionLocatorPublication & {
124
119
  readonly kind: 'credential';
125
120
  };
126
- }): Promise<RegistrationEstablishedPublication>;
121
+ }): RegistrationActivationWrite | null;
127
122
  /** Fixes a definitive cancellation, publishes it, and retires the local home. */
128
123
  cancel(input: {
129
124
  readonly ceremonyId: string;
@@ -1033,7 +1033,7 @@ export interface RouterApiWalletRegistrationService {
1033
1033
  setupWalletRegistration(input: WalletRegistrationSetupInput): Promise<RouteResponse>;
1034
1034
  respondWalletRegistration(input: WalletRegistrationRespondInput, traceContext?: RouterAbTraceContextV1, serverTiming?: Array<readonly [string, number]>, waitUntil?: (promise: Promise<unknown>) => void): Promise<WalletRegistrationRespondResponseV2>;
1035
1035
  authorizeWalletRegistrationNearAdmission(input: WalletRegistrationNearAdmissionInput): Promise<WalletRegistrationNearAdmissionResponseV2>;
1036
- activateWalletRegistration(input: WalletRegistrationActivateInput, traceContext?: RouterAbTraceContextV1, serverTiming?: Array<readonly [string, number]>): Promise<WalletRegistrationActivateResponseV2>;
1036
+ activateWalletRegistration(input: WalletRegistrationActivateInput, traceContext?: RouterAbTraceContextV1, serverTiming?: Array<readonly [string, number]>, waitUntil?: (promise: Promise<unknown>) => void): Promise<WalletRegistrationActivateResponseV2>;
1037
1037
  completeWalletRegistrationNearProvisioning(input: WalletRegistrationNearProvisioningInput, serverTiming?: Array<readonly [string, number]>, waitUntil?: (promise: Promise<unknown>) => void): Promise<WalletRegistrationNearProvisioningResponseV2>;
1038
1038
  refreshEd25519YaoWalletSession(input: RouterAbEd25519YaoBudgetRefreshRequestV1): Promise<RouterAbEd25519YaoBudgetRefreshResponseV1>;
1039
1039
  provisionEd25519YaoWalletSession(input: RouterAbEd25519YaoVerifiedWalletUnlockRequestV1): Promise<RouterAbEd25519YaoVerifiedWalletUnlockResponseV1>;
@@ -0,0 +1,26 @@
1
+ -- An active registration home whose directory write has no acknowledgement yet.
2
+ -- The batch that completes the registration operation and activates the home
3
+ -- inserts the row; the acknowledgement deletes it. A refused row stays for an operator.
4
+ CREATE TABLE wallet_registration_directory_publications (
5
+ namespace TEXT NOT NULL, org_id TEXT NOT NULL, project_id TEXT NOT NULL, env_id TEXT NOT NULL,
6
+ wallet_id TEXT NOT NULL,
7
+ ceremony_id TEXT NOT NULL CHECK(length(ceremony_id) > 0),
8
+ session_digest TEXT NOT NULL CHECK(length(session_digest) > 0),
9
+ session_expires_at_ms INTEGER NOT NULL
10
+ CHECK(session_expires_at_ms > 0 AND session_expires_at_ms <= 9007199254740991),
11
+ state TEXT NOT NULL DEFAULT 'pending' CHECK(state IN ('pending', 'refused')),
12
+ attempts INTEGER NOT NULL DEFAULT 0 CHECK(attempts >= 0),
13
+ next_attempt_at_ms INTEGER NOT NULL CHECK(next_attempt_at_ms > 0),
14
+ PRIMARY KEY(namespace, org_id, project_id, env_id, wallet_id)
15
+ );
16
+
17
+ CREATE INDEX wallet_registration_directory_publications_due
18
+ ON wallet_registration_directory_publications(namespace, org_id, project_id, env_id, state, next_attempt_at_ms);
19
+
20
+ CREATE TRIGGER wallet_registration_directory_publication_identity
21
+ BEFORE UPDATE ON wallet_registration_directory_publications
22
+ WHEN NEW.wallet_id IS NOT OLD.wallet_id OR NEW.ceremony_id IS NOT OLD.ceremony_id
23
+ OR NEW.session_digest IS NOT OLD.session_digest
24
+ OR NEW.session_expires_at_ms IS NOT OLD.session_expires_at_ms
25
+ OR (OLD.state = 'refused' AND NEW.state != 'refused')
26
+ BEGIN SELECT RAISE(ABORT, 'wallet_registration_directory_publication_conflicts'); END;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seams/wallet-server",
3
- "version": "0.12.0",
3
+ "version": "0.13.1",
4
4
  "type": "module",
5
5
  "description": "Seams server TypeScript SDK for NEAR and EVM-family wallets",
6
6
  "main": "./dist/esm/index.js",