@seams/wallet-server 0.10.2 → 0.12.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 +33 -1812
- package/artifact-manifest.json +28 -28
- 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/start-local-role-workers.mjs +3 -0
- package/cloudflare-router-ab/scripts/start-local-wallet-system.mjs +3 -0
- package/dist/esm/cloud-host.js +7 -7
- package/dist/esm/core/ThresholdService/kv.js +1 -218
- package/dist/esm/hosted-wallet-gateway.js +1 -1
- package/dist/esm/index.js +3 -4
- package/dist/esm/localHostedWalletGatewayHandler.js +17 -11
- package/dist/esm/localIntendedYaoFault.js +34 -3
- package/dist/esm/localIntendedYaoRecoveryFault.js +19 -16
- package/dist/esm/localIntendedYaoSigningFault.js +31 -16
- package/dist/esm/router/auth/routerApiKeyAuth.js +1 -13
- package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthService.js +3 -3
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceOwnerAuthorizationProvider.js +1 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecords.js +1 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecoveryService.js +1 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpSessionResolver.js +1 -1
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore.js +19 -0
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyRecords.js +5 -5
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyStore.js +5 -2
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationSetupSupport.js +7 -1
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationCommitStore.js +29 -4
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationRead.js +6 -3
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationService.js +51 -29
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationSetupExecution.js +23 -7
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAddSignerFinalizeRecord.js +1 -1
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAddSignerService.js +2 -2
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthMethodService.js +3 -3
- package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnAuthService.js +1 -1
- package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnRecords.js +1 -1
- package/dist/esm/router/cloudflare-adaptor.js +2 -3
- package/dist/esm/router/cloudflare.js +2470 -2515
- package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistration.js +1 -1
- package/dist/esm/router/domains/walletRegistration/walletRegistrationRoutes.js +39 -32
- package/dist/esm/router/framework/registrationSetupDispatch.js +11 -3
- package/dist/esm/router/framework/routeResponses.js +1 -5
- package/dist/esm/router/transport/fetch/routes/deviceLinkingOwnerAuthorization.js +1 -1
- package/dist/esm/router/transport/fetch/routes/passkeyCustody.js +2 -2
- package/dist/esm/router/transport/fetch/routes/thresholdEd25519.js +51 -24
- package/dist/esm/shared-ts/src/utils/validation.js +5 -1
- package/dist/esm/threshold/session/signingSessionSeal/guards/backends.js +2 -98
- package/dist/esm/threshold/session/signingSessionSeal/idempotencyBackends.js +2 -69
- package/dist/esm/threshold/session/signingSessionSeal/index.js +3 -4
- package/dist/esm/wasm/evm_crypto/pkg/evm_crypto_bg.wasm +0 -0
- 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/wallet-server/src/cloud-host.d.ts +1 -0
- package/dist/types/wallet-server/src/core/ThresholdService/kv.d.ts +0 -29
- package/dist/types/wallet-server/src/localHostedWalletGatewayHandler.d.ts +1 -1
- package/dist/types/wallet-server/src/localIntendedYaoFault.d.ts +13 -3
- package/dist/types/wallet-server/src/localIntendedYaoRecoveryFault.d.ts +4 -2
- package/dist/types/wallet-server/src/localIntendedYaoSigningFault.d.ts +4 -2
- package/dist/types/wallet-server/src/router/auth/routerApiKeyAuth.d.ts +0 -8
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore.d.ts +2 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationCeremonyStore.d.ts +1 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationSetupSupport.d.ts +2 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationCommitStore.d.ts +25 -5
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationRead.d.ts +15 -0
- package/dist/types/wallet-server/src/router/cloudflare-adaptor.d.ts +1 -3
- package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationInputs.d.ts +2 -0
- package/dist/types/wallet-server/src/router/framework/routeResponses.d.ts +0 -2
- package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/guards/backends.d.ts +1 -16
- package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/idempotencyBackends.d.ts +1 -16
- package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/index.d.ts +5 -6
- package/package.json +2 -9
- package/src/README.md +5 -3
- package/dist/esm/router/cloudflare/runtime/createSelfHostedCloudflareSigningWorker.js +0 -93
- package/dist/esm/router/express-adaptor.js +0 -84
- package/dist/esm/router/express.js +0 -26400
- package/dist/esm/router/node/nodeHostedWalletGateway.js +0 -64
- package/dist/esm/router/node/nodeHostedWalletGatewayCheck.js +0 -163
- package/dist/esm/router/node/nodeHostedWalletGatewayMain.js +0 -120
- package/dist/esm/router/node/nodeHttp.js +0 -79
- package/dist/esm/router/node/nodeSqlite.js +0 -43
- package/dist/esm/router/node/signerSqlMigrations.js +0 -48
- package/dist/esm/storage/syncSqlite.js +0 -79
- package/dist/esm/threshold/session/signingSessionSeal/transport/express.js +0 -75
- package/dist/types/wallet-server/src/router/cloudflare/runtime/createSelfHostedCloudflareSigningWorker.d.ts +0 -23
- package/dist/types/wallet-server/src/router/express-adaptor.d.ts +0 -22
- package/dist/types/wallet-server/src/router/node/nodeHostedWalletGateway.d.ts +0 -34
- package/dist/types/wallet-server/src/router/node/nodeHostedWalletGatewayCheck.d.ts +0 -21
- package/dist/types/wallet-server/src/router/node/nodeHostedWalletGatewayMain.d.ts +0 -2
- package/dist/types/wallet-server/src/router/node/nodeHttp.d.ts +0 -13
- package/dist/types/wallet-server/src/router/node/nodeSqlite.d.ts +0 -22
- package/dist/types/wallet-server/src/router/node/signerSqlMigrations.d.ts +0 -20
- package/dist/types/wallet-server/src/storage/syncSqlite.d.ts +0 -28
- package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/transport/express.d.ts +0 -12
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { normalizeOptionalTrimmedString } from "../../../shared-ts/src/utils/normalize.js";
|
|
2
|
-
import {
|
|
3
|
-
import { createInMemorySigningSessionSealIdempotencyStore } from "./idempotency.js";
|
|
2
|
+
import { UpstashRedisRestClient } from "../../../core/ThresholdService/kv.js";
|
|
4
3
|
import { parseCurrentSigningSessionSealIdempotencyResultRecord, parseCurrentSigningSessionSealIdempotencyStoredEntry } from "./idempotencyRecords.js";
|
|
5
4
|
//#region src/threshold/session/signingSessionSeal/idempotencyBackends.ts
|
|
6
5
|
const DEFAULT_KEY_PREFIX = "threshold:signing-session-seal:idempotency:";
|
|
@@ -55,76 +54,10 @@ var UpstashSigningSessionSealIdempotencyStore = class {
|
|
|
55
54
|
}, ttlMs);
|
|
56
55
|
}
|
|
57
56
|
};
|
|
58
|
-
var RedisTcpSigningSessionSealIdempotencyStore = class {
|
|
59
|
-
constructor(options) {
|
|
60
|
-
this.client = new RedisTcpClient(options.redisUrl);
|
|
61
|
-
this.keyPrefix = normalizeOptionalTrimmedString(options.keyPrefix) || DEFAULT_KEY_PREFIX;
|
|
62
|
-
this.nowMs = options.nowMs || Date.now;
|
|
63
|
-
}
|
|
64
|
-
async get(input) {
|
|
65
|
-
const key = prefixedKey(this.keyPrefix, input.key);
|
|
66
|
-
if (!key) return null;
|
|
67
|
-
const entry = parseCurrentSigningSessionSealIdempotencyStoredEntry(await redisGetJson(this.client, key));
|
|
68
|
-
if (!entry) return null;
|
|
69
|
-
if (entry.expiresAtMs <= input.nowMs) {
|
|
70
|
-
try {
|
|
71
|
-
await redisDel(this.client, key);
|
|
72
|
-
} catch {}
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
return entry.result;
|
|
76
|
-
}
|
|
77
|
-
async set(input) {
|
|
78
|
-
const key = prefixedKey(this.keyPrefix, input.key);
|
|
79
|
-
if (!key) return;
|
|
80
|
-
const expiresAtMs = toPositiveInt(input.expiresAtMs);
|
|
81
|
-
if (expiresAtMs === void 0) return;
|
|
82
|
-
const normalizedResult = parseCurrentSigningSessionSealIdempotencyResultRecord(input.result);
|
|
83
|
-
if (!normalizedResult) return;
|
|
84
|
-
const ttlMs = ttlMsUntilExpiry(expiresAtMs, this.nowMs());
|
|
85
|
-
if (ttlMs <= 0) return;
|
|
86
|
-
await redisSetJson(this.client, key, {
|
|
87
|
-
result: normalizedResult,
|
|
88
|
-
expiresAtMs
|
|
89
|
-
}, ttlMs);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
57
|
function createUpstashSigningSessionSealIdempotencyStore(options) {
|
|
93
58
|
return new UpstashSigningSessionSealIdempotencyStore(options);
|
|
94
59
|
}
|
|
95
|
-
function createRedisTcpSigningSessionSealIdempotencyStore(options) {
|
|
96
|
-
return new RedisTcpSigningSessionSealIdempotencyStore(options);
|
|
97
|
-
}
|
|
98
|
-
function resolveSigningSessionSealIdempotencyFromEnv(input) {
|
|
99
|
-
const idempotencyKind = normalizeOptionalTrimmedString(input.idempotencyKind || "").toLowerCase();
|
|
100
|
-
const upstashUrl = normalizeOptionalTrimmedString(input.upstashUrl || "");
|
|
101
|
-
const upstashToken = normalizeOptionalTrimmedString(input.upstashToken || "");
|
|
102
|
-
const redisUrl = normalizeOptionalTrimmedString(input.redisUrl || "");
|
|
103
|
-
const keyPrefix = normalizeOptionalTrimmedString(input.keyPrefix || "") || DEFAULT_KEY_PREFIX;
|
|
104
|
-
const ttlMs = toPositiveInt(input.ttlMs);
|
|
105
|
-
const selectedKind = idempotencyKind || (upstashUrl || upstashToken ? "upstash-redis-rest" : redisUrl ? "redis-tcp" : "in-memory");
|
|
106
|
-
let store;
|
|
107
|
-
if (selectedKind === "upstash-redis-rest") {
|
|
108
|
-
if (!upstashUrl || !upstashToken) throw new Error("Upstash signing session-seal idempotency requires both upstashUrl and upstashToken");
|
|
109
|
-
store = createUpstashSigningSessionSealIdempotencyStore({
|
|
110
|
-
url: upstashUrl,
|
|
111
|
-
token: upstashToken,
|
|
112
|
-
keyPrefix
|
|
113
|
-
});
|
|
114
|
-
} else if (selectedKind === "redis-tcp") {
|
|
115
|
-
if (!redisUrl) throw new Error("Redis TCP signing session-seal idempotency requires redisUrl");
|
|
116
|
-
store = createRedisTcpSigningSessionSealIdempotencyStore({
|
|
117
|
-
redisUrl,
|
|
118
|
-
keyPrefix
|
|
119
|
-
});
|
|
120
|
-
} else if (selectedKind === "in-memory") store = createInMemorySigningSessionSealIdempotencyStore();
|
|
121
|
-
else throw new Error(`Unsupported signing session-seal idempotency kind "${selectedKind}". Expected in-memory, upstash-redis-rest, or redis-tcp.`);
|
|
122
|
-
return {
|
|
123
|
-
store,
|
|
124
|
-
...ttlMs ? { ttlMs } : {}
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
60
|
//#endregion
|
|
128
|
-
export {
|
|
61
|
+
export { createUpstashSigningSessionSealIdempotencyStore };
|
|
129
62
|
|
|
130
63
|
//# sourceMappingURL=idempotencyBackends.js.map
|
|
@@ -7,7 +7,6 @@ import { createSigningSessionSealService } from "./service.js";
|
|
|
7
7
|
import { createSigningSessionSealRoutesOptions } from "./routesOptions.js";
|
|
8
8
|
import { createSigningSessionSealOptions, parseSigningSessionSealRootConfig } from "./options.js";
|
|
9
9
|
import { createInMemorySigningSessionSealIdempotencyStore } from "./idempotency.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
export { authorizeSigningSessionSealRequest, buildSigningSessionSealApplyPath, buildSigningSessionSealRemovePath, composeSigningSessionSealGuards, createInMemorySigningSessionSealIdempotencyStore, createInMemorySigningSessionSealRateLimiter, createPassthroughSigningSessionSealCipherAdapter, createRedisTcpSigningSessionSealIdempotencyStore, createRedisTcpSigningSessionSealRateLimiter, createSigningSessionSealAuditLogger, createSigningSessionSealCipherAdapter, createSigningSessionSealOptions, createSigningSessionSealRateLimitGuard, createSigningSessionSealRoutesOptions, createSigningSessionSealService, createSigningSessionSealShamir3PassCipherAdapter, createUpstashSigningSessionSealIdempotencyStore, createUpstashSigningSessionSealRateLimiter, encodeSigningSessionSealServerLockContext, handleSigningSessionSealRoutes, parseSigningSessionSealApplyBody, parseSigningSessionSealRemoveBody, parseSigningSessionSealRootConfig, registerSigningSessionSealRoutes, resolveSigningSessionSealBasePath, resolveSigningSessionSealIdempotencyFromEnv, resolveSigningSessionSealRateLimitFromEnv, signingSessionSealAuthorizeStatusCode, signingSessionSealStatusCode };
|
|
10
|
+
import { createUpstashSigningSessionSealRateLimiter } from "./guards/backends.js";
|
|
11
|
+
import { createUpstashSigningSessionSealIdempotencyStore } from "./idempotencyBackends.js";
|
|
12
|
+
export { authorizeSigningSessionSealRequest, buildSigningSessionSealApplyPath, buildSigningSessionSealRemovePath, composeSigningSessionSealGuards, createInMemorySigningSessionSealIdempotencyStore, createInMemorySigningSessionSealRateLimiter, createPassthroughSigningSessionSealCipherAdapter, createSigningSessionSealAuditLogger, createSigningSessionSealCipherAdapter, createSigningSessionSealOptions, createSigningSessionSealRateLimitGuard, createSigningSessionSealRoutesOptions, createSigningSessionSealService, createSigningSessionSealShamir3PassCipherAdapter, createUpstashSigningSessionSealIdempotencyStore, createUpstashSigningSessionSealRateLimiter, encodeSigningSessionSealServerLockContext, handleSigningSessionSealRoutes, parseSigningSessionSealApplyBody, parseSigningSessionSealRemoveBody, parseSigningSessionSealRootConfig, resolveSigningSessionSealBasePath, signingSessionSealAuthorizeStatusCode, signingSessionSealStatusCode };
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -6,6 +6,7 @@ export * from './core/logger';
|
|
|
6
6
|
export * from './core/routerAbSigning/RouterAbEcdsaPresignRuntime';
|
|
7
7
|
export * from './core/types';
|
|
8
8
|
export * from './delegateAction';
|
|
9
|
+
export { LocalRegistrationSetupAuthority } from './localRegistrationSetupAuthority';
|
|
9
10
|
export * from './router/framework/apiCredentialPorts';
|
|
10
11
|
export { createWalletRegistrationContextResolver, unavailableRegistrationContext, walletRegistrationContext, } from './router/auth/walletRegistrationContext';
|
|
11
12
|
export { parseWalletRegistrationSetupRequest } from './router/domains/walletRegistration/walletRegistrationRoutes';
|
|
@@ -13,33 +13,4 @@ export declare class UpstashRedisRestClient {
|
|
|
13
13
|
setJson(key: string, value: unknown, ttlMs?: number): Promise<void>;
|
|
14
14
|
eval(script: string, keys: string[], args: string[]): Promise<unknown | null>;
|
|
15
15
|
}
|
|
16
|
-
export type RedisResp = {
|
|
17
|
-
type: 'simple';
|
|
18
|
-
value: string;
|
|
19
|
-
} | {
|
|
20
|
-
type: 'error';
|
|
21
|
-
value: string;
|
|
22
|
-
} | {
|
|
23
|
-
type: 'integer';
|
|
24
|
-
value: number;
|
|
25
|
-
} | {
|
|
26
|
-
type: 'bulk';
|
|
27
|
-
value: string | null;
|
|
28
|
-
};
|
|
29
|
-
export declare class RedisTcpClient {
|
|
30
|
-
private readonly url;
|
|
31
|
-
private socket;
|
|
32
|
-
private buffer;
|
|
33
|
-
private pending;
|
|
34
|
-
private connecting;
|
|
35
|
-
constructor(redisUrl: string);
|
|
36
|
-
private ensureConnected;
|
|
37
|
-
private connect;
|
|
38
|
-
private drain;
|
|
39
|
-
private failAll;
|
|
40
|
-
send(args: string[]): Promise<RedisResp>;
|
|
41
|
-
}
|
|
42
|
-
export declare function redisGetJson(client: RedisTcpClient, key: string): Promise<unknown | null>;
|
|
43
|
-
export declare function redisDel(client: RedisTcpClient, key: string): Promise<void>;
|
|
44
|
-
export declare function redisSetJson(client: RedisTcpClient, key: string, value: unknown, ttlMs?: number): Promise<void>;
|
|
45
16
|
//# sourceMappingURL=kv.d.ts.map
|
|
@@ -6,7 +6,7 @@ export type LocalHostedWalletGatewayEnv = CloudflareD1GatewayBaseEnv & {
|
|
|
6
6
|
/**
|
|
7
7
|
* The local Gateway: the hosted Gateway handler plus the intended-suite
|
|
8
8
|
* transport faults, which a request arms with local-only headers. The local
|
|
9
|
-
* Worker
|
|
9
|
+
* Worker serves through this handler.
|
|
10
10
|
*/
|
|
11
11
|
export declare function handleLocalHostedWalletGatewayRequestV1(request: Request, env: LocalHostedWalletGatewayEnv, ctx: CfExecutionContext, dependencies?: HostedWalletGatewayDependenciesV1): Promise<Response>;
|
|
12
12
|
//# sourceMappingURL=localHostedWalletGatewayHandler.d.ts.map
|
|
@@ -5,9 +5,13 @@ export declare const LOCAL_INTENDED_YAO_FAULT_TOKEN_HEADER_V1 = "x-seams-intende
|
|
|
5
5
|
* execute, and expects the Gateway to send the identical request again.
|
|
6
6
|
* - `return_terminal_burned_once` has the Router end the first execute
|
|
7
7
|
* burned, and expects the Gateway to answer that failure without retrying.
|
|
8
|
+
* - `answer_retryable_while_running_once` lets the Router keep running the
|
|
9
|
+
* first execute, and answers the Gateway at once that it failed
|
|
10
|
+
* recoverably, as a Deriver that refused a late preparation does. The
|
|
11
|
+
* Router's claim stays held until that run records its answer.
|
|
8
12
|
*/
|
|
9
|
-
type LocalIntendedYaoFaultModeV1 = 'drop_router_response_once' | 'return_terminal_burned_once';
|
|
10
|
-
type LocalIntendedYaoFaultProofV1 = 'exact_request_replayed' | 'terminal_failure_not_retried';
|
|
13
|
+
type LocalIntendedYaoFaultModeV1 = 'drop_router_response_once' | 'return_terminal_burned_once' | 'answer_retryable_while_running_once';
|
|
14
|
+
type LocalIntendedYaoFaultProofV1 = 'exact_request_replayed' | 'terminal_failure_not_retried' | 'execution_left_running';
|
|
11
15
|
type LocalIntendedYaoFaultViolationV1 = 'fault_already_armed' | 'router_execute_not_observed' | 'router_first_response_failed' | 'router_retry_not_observed' | 'router_retry_body_changed' | 'router_retry_trace_changed' | 'router_retry_marked_as_replay' | 'router_retry_response_failed' | 'router_terminal_not_recorded' | 'unexpected_additional_execute';
|
|
12
16
|
type LocalIntendedYaoFaultOutcomeV1 = {
|
|
13
17
|
readonly kind: 'proved';
|
|
@@ -22,10 +26,16 @@ type LocalIntendedYaoFaultTokenV1 = {
|
|
|
22
26
|
export declare function parseLocalIntendedYaoFaultModeV1(value: string | null): LocalIntendedYaoFaultModeV1 | null;
|
|
23
27
|
export declare function parseLocalIntendedYaoFaultTokenV1(value: string | null): LocalIntendedYaoFaultTokenV1 | null;
|
|
24
28
|
export declare function isLocalIntendedYaoFaultTokenV1(value: string | null): value is string;
|
|
29
|
+
/** Reconstructs a local fault request from its persisted boundary value. */
|
|
30
|
+
export declare function parseLocalIntendedKeptRouterRequestV1(value: unknown): Request;
|
|
25
31
|
export declare class LocalIntendedYaoFaultControllerV1 {
|
|
26
32
|
private readonly baseFetch;
|
|
33
|
+
/** Keeps a Router call alive after the Gateway answered without it. */
|
|
34
|
+
private readonly keepRunning;
|
|
27
35
|
private state;
|
|
28
|
-
constructor(baseFetch: typeof globalThis.fetch
|
|
36
|
+
constructor(baseFetch: typeof globalThis.fetch,
|
|
37
|
+
/** Keeps a Router call alive after the Gateway answered without it. */
|
|
38
|
+
keepRunning: (running: Promise<unknown>) => void);
|
|
29
39
|
arm(mode: LocalIntendedYaoFaultModeV1): void;
|
|
30
40
|
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
31
41
|
consumeOutcome(): LocalIntendedYaoFaultOutcomeV1;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { D1RegistrationCeremonyRecordStore } from './router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore';
|
|
1
2
|
export declare const LOCAL_INTENDED_YAO_RECOVERY_FAULT_HEADER_V1 = "x-seams-intended-yao-recovery-fault-v1";
|
|
2
3
|
export declare const LOCAL_INTENDED_YAO_RECOVERY_FAULT_TOKEN_HEADER_V1 = "x-seams-intended-yao-recovery-fault-token-v1";
|
|
3
4
|
/**
|
|
@@ -28,17 +29,18 @@ export declare class LocalIntendedYaoRecoveryFaultControllerV1 {
|
|
|
28
29
|
private readonly baseFetch;
|
|
29
30
|
private readonly mode;
|
|
30
31
|
private readonly token;
|
|
32
|
+
private readonly storage;
|
|
31
33
|
private executed;
|
|
32
34
|
private failed;
|
|
33
35
|
private kept;
|
|
34
|
-
constructor(baseFetch: typeof globalThis.fetch, mode: 'lose_router_recovery_replies' | 'withhold_router_recovery_execute', token: string);
|
|
36
|
+
constructor(baseFetch: typeof globalThis.fetch, mode: 'lose_router_recovery_replies' | 'withhold_router_recovery_execute', token: string, storage: D1RegistrationCeremonyRecordStore);
|
|
35
37
|
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
36
38
|
outcome(): LocalIntendedYaoRecoveryFaultOutcomeV1;
|
|
37
39
|
}
|
|
38
40
|
/** Sends the execution kept under `token` to the Router, exactly. */
|
|
39
41
|
export declare function releaseLocalIntendedYaoRecoveryExecuteV1(router: {
|
|
40
42
|
fetch(request: Request): Promise<Response>;
|
|
41
|
-
}, token: string): Promise<Response>;
|
|
43
|
+
}, token: string, storage: D1RegistrationCeremonyRecordStore): Promise<Response>;
|
|
42
44
|
export declare function requestWithoutLocalIntendedYaoRecoveryFaultHeadersV1(request: Request): Request;
|
|
43
45
|
export declare function responseWithLocalIntendedYaoRecoveryFaultOutcomeV1(response: Response, outcome: LocalIntendedYaoRecoveryFaultOutcomeV1, token: string): Response;
|
|
44
46
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { D1RegistrationCeremonyRecordStore } from './router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore';
|
|
1
2
|
export declare const LOCAL_INTENDED_YAO_SIGNING_FAULT_HEADER_V1 = "x-seams-intended-yao-signing-fault-v1";
|
|
2
3
|
export declare const LOCAL_INTENDED_YAO_SIGNING_FAULT_TOKEN_HEADER_V1 = "x-seams-intended-yao-signing-fault-token-v1";
|
|
3
4
|
export declare const ROUTER_AB_ED25519_SIGNING_FINALIZE_PATH_V1 = "/router-ab/ed25519/sign";
|
|
@@ -20,8 +21,9 @@ export declare class LocalIntendedYaoSigningFaultControllerV1 {
|
|
|
20
21
|
private readonly baseFetch;
|
|
21
22
|
private readonly mode;
|
|
22
23
|
private readonly token;
|
|
24
|
+
private readonly storage;
|
|
23
25
|
private kept;
|
|
24
|
-
constructor(baseFetch: typeof globalThis.fetch, mode: 'capture_signing_finalize' | 'withhold_signing_finalize', token: string);
|
|
26
|
+
constructor(baseFetch: typeof globalThis.fetch, mode: 'capture_signing_finalize' | 'withhold_signing_finalize', token: string, storage: D1RegistrationCeremonyRecordStore);
|
|
25
27
|
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
26
28
|
private keep;
|
|
27
29
|
outcome(): string;
|
|
@@ -29,7 +31,7 @@ export declare class LocalIntendedYaoSigningFaultControllerV1 {
|
|
|
29
31
|
/** Sends the finalize kept under `token` to the Router again, exactly. */
|
|
30
32
|
export declare function releaseLocalIntendedYaoSigningFinalizeV1(router: {
|
|
31
33
|
fetch(request: Request): Promise<Response>;
|
|
32
|
-
}, token: string): Promise<Response>;
|
|
34
|
+
}, token: string, storage: D1RegistrationCeremonyRecordStore): Promise<Response>;
|
|
33
35
|
export declare function requestWithoutLocalIntendedYaoSigningFaultHeadersV1(request: Request): Request;
|
|
34
36
|
export declare function responseWithLocalIntendedYaoSigningFaultOutcomeV1(response: Response, outcome: string): Response;
|
|
35
37
|
export {};
|
|
@@ -2,15 +2,7 @@ type HeaderBag = Headers | Record<string, unknown>;
|
|
|
2
2
|
export declare function extractBearerCredential(headers: HeaderBag): string | null;
|
|
3
3
|
export declare function normalizeSourceIp(raw: string | undefined): string | null;
|
|
4
4
|
export declare function extractRouterApiEnvironmentId(headers: HeaderBag): string | null;
|
|
5
|
-
export declare function resolveSourceIpFromExpressRequest(input: {
|
|
6
|
-
headers: Record<string, unknown>;
|
|
7
|
-
ip?: string | null;
|
|
8
|
-
}): string | null;
|
|
9
5
|
export declare function resolveSourceIpFromFetchHeaders(headers: HeaderBag): string | null;
|
|
10
|
-
export declare function resolveRequestOriginRateLimitKeyFromExpressRequest(input: {
|
|
11
|
-
headers: Record<string, unknown>;
|
|
12
|
-
ip?: string | null;
|
|
13
|
-
}): string;
|
|
14
6
|
export declare function resolveRequestOriginRateLimitKeyFromFetchHeaders(headers: HeaderBag): string;
|
|
15
7
|
export {};
|
|
16
8
|
//# sourceMappingURL=routerApiKeyAuth.d.ts.map
|
|
@@ -40,6 +40,8 @@ export declare class D1RegistrationCeremonyRecordStore {
|
|
|
40
40
|
constructor(options: D1RegistrationCeremonyRecordStoreOptions);
|
|
41
41
|
get(scope: string, id: string): Promise<D1RegistrationCeremonyStoredRecord | null>;
|
|
42
42
|
prepareGet(scope: string, id: string): D1PreparedStatementLike;
|
|
43
|
+
/** Load the ceremony's immutable founding identities and their current records together. */
|
|
44
|
+
prepareFoundingRecordsRead(id: string): D1PreparedStatementLike;
|
|
43
45
|
parseGet(scope: string, id: string, row: StoredRow | null): Promise<D1RegistrationCeremonyStoredRecord | null>;
|
|
44
46
|
putExact(mutation: D1RegistrationCeremonyRecordMutation): Promise<void>;
|
|
45
47
|
insertOrRead(mutation: D1RegistrationCeremonyRecordMutation): Promise<D1RegistrationCeremonyStoredRecord>;
|
|
@@ -32,6 +32,7 @@ export declare class CloudflareD1RegistrationCeremonyIntentStore {
|
|
|
32
32
|
reserveSetupCeremony(proposed: StoredWalletRegistrationCeremony, ownershipGeneration: number): Promise<StoredWalletRegistrationCeremony>;
|
|
33
33
|
getCeremony(registrationCeremonyId: string): Promise<StoredWalletRegistrationCeremony | null>;
|
|
34
34
|
prepareCeremonyRead(registrationCeremonyId: string): D1PreparedStatementLike;
|
|
35
|
+
prepareFoundingRecordsRead(registrationCeremonyId: string): D1PreparedStatementLike;
|
|
35
36
|
parseCeremonyRead(registrationCeremonyId: string, result: D1ResultLike<Record<string, unknown>>): Promise<StoredWalletRegistrationCeremony | null>;
|
|
36
37
|
parseCeremonySnapshotRead(registrationCeremonyId: string, result: D1ResultLike<Record<string, unknown>>): Promise<D1WalletRegistrationEcdsaCeremonyClaimV1 | null>;
|
|
37
38
|
getCeremonySnapshot(registrationCeremonyId: string): Promise<D1WalletRegistrationEcdsaCeremonyClaimV1 | null>;
|
|
@@ -48,6 +48,8 @@ type RegistrationIntentSignerBranches = {
|
|
|
48
48
|
readonly evmFamilyEcdsa: RegistrationEvmFamilyEcdsaSignerPlan | null;
|
|
49
49
|
};
|
|
50
50
|
export declare function recordRegistrationServerTiming(sink: Array<readonly [string, number]>, name: string, startedAtMs: number): void;
|
|
51
|
+
/** The `Server-Timing` header of a registration route's recorded waits. */
|
|
52
|
+
export declare function registrationServerTimingHeaders(serverTiming: readonly (readonly [string, number])[]): Record<string, string> | undefined;
|
|
51
53
|
export declare function recordRegistrationPromiseTiming<T>(args: {
|
|
52
54
|
readonly sink: Array<readonly [string, number]>;
|
|
53
55
|
readonly name: string;
|
|
@@ -2,6 +2,7 @@ import { type PasskeyCredentialClaims } from '../../../../core/passkeyCredential
|
|
|
2
2
|
import type { ActiveWalletAuthorityV1 } from '../../../../../../shared-ts/src/authorization/walletAuthority';
|
|
3
3
|
import { type ActiveWalletAuthMethodRecordV2 } from '../../../../../../shared-ts/src/utils/walletAuthMethodRecord';
|
|
4
4
|
import { type RegistrationAuthority } from '../../../../../../shared-ts/src/utils/registrationAuthMethodInput';
|
|
5
|
+
import type { Variant } from '../../../../../../shared-ts/src/utils/variant';
|
|
5
6
|
import type { WalletRecord, WalletSignerRecord } from '../../../../core/WalletStore';
|
|
6
7
|
import type { D1DatabaseLike, D1PreparedStatementLike, D1ResultLike } from '../../../../storage/tenantRoute';
|
|
7
8
|
import type { D1EmailOtpRegistrationCommitPlan } from '../emailOtp/d1EmailOtpRegistrationEnrollmentFinalizer';
|
|
@@ -41,11 +42,11 @@ export type HeldRegistrationPasskeyClaim = {
|
|
|
41
42
|
export interface D1WalletRegistrationCommitStore {
|
|
42
43
|
/**
|
|
43
44
|
* Claims the authority's passkey through shared authority, unless `held`
|
|
44
|
-
* records that the same claim was already granted for this ceremony.
|
|
45
|
-
*
|
|
46
|
-
* the claim
|
|
45
|
+
* records that the same claim was already granted for this ceremony. Uses
|
|
46
|
+
* the founding snapshot when supplied; otherwise reads the named records
|
|
47
|
+
* beside the claim. The returned commit performs no additional read.
|
|
47
48
|
*/
|
|
48
|
-
reserveAuthority(authority: RegistrationAuthority, held: HeldRegistrationPasskeyClaim | null, founding:
|
|
49
|
+
reserveAuthority(authority: RegistrationAuthority, held: HeldRegistrationPasskeyClaim | null, founding: RegistrationFoundingRead | null): Promise<ReservedWalletRegistrationCommit>;
|
|
49
50
|
/**
|
|
50
51
|
* Claims a verified passkey before finalization and records a granted
|
|
51
52
|
* claim. A refusal records nothing, so finalization claims again and
|
|
@@ -62,6 +63,25 @@ export interface D1WalletRegistrationCommitStore {
|
|
|
62
63
|
deleteHeldPasskeyClaim(registrationCeremonyId: string): Promise<void>;
|
|
63
64
|
}
|
|
64
65
|
type FoundingRecordIds = Pick<D1WalletRegistrationOperationPreparedV1, 'walletAuthorityId' | 'walletAuthMethodId'>;
|
|
66
|
+
export type RegistrationFoundingRead = {
|
|
67
|
+
readonly kind: 'read';
|
|
68
|
+
readonly ids: FoundingRecordIds;
|
|
69
|
+
readonly records?: never;
|
|
70
|
+
} | {
|
|
71
|
+
readonly kind: 'snapshot';
|
|
72
|
+
readonly records: StoredFoundingRecords;
|
|
73
|
+
readonly ids?: never;
|
|
74
|
+
};
|
|
75
|
+
export type RegistrationFoundingSnapshot = Variant<RegistrationFoundingRead, 'kind', 'snapshot'>;
|
|
76
|
+
export declare function parseRegistrationFoundingRead(result: D1ResultLike<Record<string, unknown>>): RegistrationFoundingSnapshot | null;
|
|
77
|
+
/** A registration's founding authority and auth method rows from one database snapshot. */
|
|
78
|
+
type StoredFoundingRecords = FoundingRecordIds & {
|
|
79
|
+
readonly authorityRow: D1RegistrationRecordJsonRow | null;
|
|
80
|
+
readonly authMethodRow: D1RegistrationRecordJsonRow | null;
|
|
81
|
+
};
|
|
82
|
+
type D1RegistrationRecordJsonRow = {
|
|
83
|
+
readonly record_json?: unknown;
|
|
84
|
+
};
|
|
65
85
|
export declare class CloudflareD1WalletRegistrationCommitStore implements D1WalletRegistrationCommitStore {
|
|
66
86
|
private readonly database;
|
|
67
87
|
private readonly scope;
|
|
@@ -74,7 +94,7 @@ export declare class CloudflareD1WalletRegistrationCommitStore implements D1Wall
|
|
|
74
94
|
readonly projectId: string;
|
|
75
95
|
readonly envId: string;
|
|
76
96
|
});
|
|
77
|
-
reserveAuthority(authority: RegistrationAuthority, held: HeldRegistrationPasskeyClaim | null, founding:
|
|
97
|
+
reserveAuthority(authority: RegistrationAuthority, held: HeldRegistrationPasskeyClaim | null, founding: RegistrationFoundingRead | null): Promise<ReservedWalletRegistrationCommit>;
|
|
78
98
|
claimPasskeyAhead(input: {
|
|
79
99
|
readonly registrationCeremonyId: string;
|
|
80
100
|
readonly authority: RegistrationAuthority;
|
package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationRead.d.ts
CHANGED
|
@@ -40,6 +40,21 @@ export declare class D1WalletRegistrationRead {
|
|
|
40
40
|
} | {
|
|
41
41
|
ok: true;
|
|
42
42
|
operation: import("../../../cloudflare-adaptor").VersionedJsonRecordReadResult<D1WalletRegistrationNearProvisioningSideEffectRecord>;
|
|
43
|
+
readFounding: () => {
|
|
44
|
+
readonly kind: "snapshot";
|
|
45
|
+
readonly records: {
|
|
46
|
+
readonly walletAuthMethodId: import("../../../../../../shared-ts/src/utils").WalletAuthMethodId;
|
|
47
|
+
readonly walletAuthorityId: import("../../../../../../shared-ts/src/utils").WalletAuthorityId;
|
|
48
|
+
} & {
|
|
49
|
+
readonly authorityRow: {
|
|
50
|
+
readonly record_json?: unknown;
|
|
51
|
+
} | null;
|
|
52
|
+
readonly authMethodRow: {
|
|
53
|
+
readonly record_json?: unknown;
|
|
54
|
+
} | null;
|
|
55
|
+
};
|
|
56
|
+
readonly ids?: never;
|
|
57
|
+
} | null;
|
|
43
58
|
decision: import("../../../domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoLifecycleDecision").RouterAbEd25519YaoLifecycleDecisionV1 | null;
|
|
44
59
|
heldPasskeyClaim: import("./d1WalletRegistrationCommitStore").HeldRegistrationPasskeyClaim | null;
|
|
45
60
|
readCeremony: () => Promise<import("../../../../core/RegistrationCeremonyStore").StoredWalletRegistrationCeremony | null>;
|
|
@@ -42,10 +42,8 @@ export type { CloudflareTenantStorageRoute, CloudflareTenantTopology, D1BindingN
|
|
|
42
42
|
export { StaticCloudflareTenantStorageRouteResolver, createCloudflareTenantStorageRoute, createSignerD1DoStorageTarget, createStaticCloudflareTenantStorageRouteResolver, createStaticCloudflareTenantStorageRouteResolverFromBindings, } from '../storage/tenantRoute';
|
|
43
43
|
export type { InMemoryRouterApiRuntimeSnapshotConsumer, RouterApiRuntimeSnapshotPublishedUpdate, } from './framework/runtimeSnapshotConsumer';
|
|
44
44
|
export { createInMemoryRouterApiRuntimeSnapshotConsumer, validateRuntimeSnapshotExpectation, } from './framework/runtimeSnapshotConsumer';
|
|
45
|
-
export { extractBearerCredential, extractRouterApiEnvironmentId,
|
|
45
|
+
export { extractBearerCredential, extractRouterApiEnvironmentId, resolveSourceIpFromFetchHeaders, } from './auth/routerApiKeyAuth';
|
|
46
46
|
export { createCloudflareRouter } from './cloudflare/runtime/createCloudflareRouter';
|
|
47
|
-
export type { SelfHostedCloudflareSigningWorkerFactoryInput } from './cloudflare/runtime/createSelfHostedCloudflareSigningWorker';
|
|
48
|
-
export { createSelfHostedCloudflareSigningRouter, createSelfHostedCloudflareSigningWorker, } from './cloudflare/runtime/createSelfHostedCloudflareSigningWorker';
|
|
49
47
|
export { CloudflareDurableObjectVersionedJsonRecordStore, CloudflareVersionedJsonRecordStoreError, createCloudflareDurableObjectVersionedJsonRecordStore, } from './cloudflare/durableObjects/versionedJsonRecordStore';
|
|
50
48
|
export type { CloudflareVersionedJsonRecordStoreOptions } from './cloudflare/durableObjects/versionedJsonRecordStore';
|
|
51
49
|
export type { VersionedJsonObject, VersionedJsonRecordPutResult, VersionedJsonRecordReadResult, VersionedJsonValue, } from './framework/versionedJsonRecordStore';
|
package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationInputs.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export type WalletRegistrationSetupInput = {
|
|
|
21
21
|
readonly runtimePolicyScope?: ThresholdRuntimePolicyScope;
|
|
22
22
|
readonly signingRootId?: string;
|
|
23
23
|
readonly signingRootVersion?: string;
|
|
24
|
+
/** Collects the `[name, ms]` waits of this setup for its `Server-Timing` header. */
|
|
25
|
+
readonly serverTiming?: Array<readonly [string, number]>;
|
|
24
26
|
};
|
|
25
27
|
export type WalletRegistrationRespondInput = {
|
|
26
28
|
readonly registrationCeremonyId: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Response as ExpressResponse } from 'express';
|
|
2
1
|
import type { RouteResponse } from './routeExecutionContext';
|
|
3
2
|
import type { RoutePolicyFailureCode } from './routeAuthPolicy';
|
|
4
3
|
import type { RouteUsageData } from './routeMeteringPolicy';
|
|
@@ -12,6 +11,5 @@ export declare function routeJson<TBody>(status: number, body: TBody, options?:
|
|
|
12
11
|
usage?: RouteUsageData;
|
|
13
12
|
}): RouteResponse<TBody>;
|
|
14
13
|
export declare function routeError(status: number, code: RouteErrorBody['code'], message: string): RouteResponse<RouteErrorBody>;
|
|
15
|
-
export declare function sendExpressRouteResponse<TBody>(res: ExpressResponse, response: RouteResponse<TBody>): void;
|
|
16
14
|
export declare function toFetchRouteResponse<TBody>(response: RouteResponse<TBody>): Response;
|
|
17
15
|
//# sourceMappingURL=routeResponses.d.ts.map
|
package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/guards/backends.d.ts
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SigningSessionSealRateLimiter } from './index';
|
|
2
2
|
export interface CreateUpstashSigningSessionSealRateLimiterOptions {
|
|
3
3
|
url: string;
|
|
4
4
|
token: string;
|
|
5
5
|
keyPrefix?: string;
|
|
6
6
|
}
|
|
7
|
-
export interface CreateRedisTcpSigningSessionSealRateLimiterOptions {
|
|
8
|
-
redisUrl: string;
|
|
9
|
-
keyPrefix?: string;
|
|
10
|
-
}
|
|
11
7
|
export declare function createUpstashSigningSessionSealRateLimiter(options: CreateUpstashSigningSessionSealRateLimiterOptions): SigningSessionSealRateLimiter;
|
|
12
|
-
export declare function createRedisTcpSigningSessionSealRateLimiter(options: CreateRedisTcpSigningSessionSealRateLimiterOptions): SigningSessionSealRateLimiter;
|
|
13
|
-
export interface CreateSigningSessionSealRateLimitFromEnvInput {
|
|
14
|
-
limiterKind?: 'in-memory' | 'upstash-redis-rest' | 'redis-tcp' | null;
|
|
15
|
-
upstashUrl?: string | null;
|
|
16
|
-
upstashToken?: string | null;
|
|
17
|
-
redisUrl?: string | null;
|
|
18
|
-
keyPrefix?: string | null;
|
|
19
|
-
limit: number;
|
|
20
|
-
windowMs: number;
|
|
21
|
-
}
|
|
22
|
-
export declare function resolveSigningSessionSealRateLimitFromEnv(input: CreateSigningSessionSealRateLimitFromEnvInput): Pick<CreateSigningSessionSealRateLimitGuardOptions, 'limiter' | 'limit' | 'windowMs'>;
|
|
23
8
|
//# sourceMappingURL=backends.d.ts.map
|
package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/idempotencyBackends.d.ts
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
import type { SigningSessionSealIdempotencyStore
|
|
1
|
+
import type { SigningSessionSealIdempotencyStore } from './signingSessionSeal.types';
|
|
2
2
|
export interface CreateUpstashSigningSessionSealIdempotencyStoreOptions {
|
|
3
3
|
url: string;
|
|
4
4
|
token: string;
|
|
5
5
|
keyPrefix?: string;
|
|
6
6
|
nowMs?: () => number;
|
|
7
7
|
}
|
|
8
|
-
export interface CreateRedisTcpSigningSessionSealIdempotencyStoreOptions {
|
|
9
|
-
redisUrl: string;
|
|
10
|
-
keyPrefix?: string;
|
|
11
|
-
nowMs?: () => number;
|
|
12
|
-
}
|
|
13
8
|
export declare function createUpstashSigningSessionSealIdempotencyStore(options: CreateUpstashSigningSessionSealIdempotencyStoreOptions): SigningSessionSealIdempotencyStore;
|
|
14
|
-
export declare function createRedisTcpSigningSessionSealIdempotencyStore(options: CreateRedisTcpSigningSessionSealIdempotencyStoreOptions): SigningSessionSealIdempotencyStore;
|
|
15
|
-
export interface CreateSigningSessionSealIdempotencyFromEnvInput {
|
|
16
|
-
idempotencyKind?: string | null;
|
|
17
|
-
upstashUrl?: string | null;
|
|
18
|
-
upstashToken?: string | null;
|
|
19
|
-
redisUrl?: string | null;
|
|
20
|
-
keyPrefix?: string | null;
|
|
21
|
-
ttlMs?: number | null;
|
|
22
|
-
}
|
|
23
|
-
export declare function resolveSigningSessionSealIdempotencyFromEnv(input: CreateSigningSessionSealIdempotencyFromEnvInput): SigningSessionSealServiceIdempotencyOptions;
|
|
24
9
|
//# sourceMappingURL=idempotencyBackends.d.ts.map
|
|
@@ -4,9 +4,9 @@ export type { CreateSigningSessionSealAuditLoggerOptions } from './observability
|
|
|
4
4
|
export type { CreateSigningSessionSealRoutesOptionsInput } from './routesOptions';
|
|
5
5
|
export type { CreateSigningSessionSealOptionsInput } from './options';
|
|
6
6
|
export type { CreateSigningSessionSealRateLimitGuardOptions, InMemorySigningSessionSealRateLimiterOptions, SigningSessionSealRateLimitConsumeInput, SigningSessionSealRateLimitConsumeResult, SigningSessionSealRateLimiter, SigningSessionSealRateLimitRejectedEvent, } from './guards';
|
|
7
|
-
export type {
|
|
8
|
-
export type {
|
|
9
|
-
export { signingSessionSealAuthorizeStatusCode, signingSessionSealStatusCode } from './transport/shared';
|
|
7
|
+
export type { CreateUpstashSigningSessionSealRateLimiterOptions, } from './guards/backends';
|
|
8
|
+
export type { CreateUpstashSigningSessionSealIdempotencyStoreOptions, } from './idempotencyBackends';
|
|
9
|
+
export { signingSessionSealAuthorizeStatusCode, signingSessionSealStatusCode, } from './transport/shared';
|
|
10
10
|
export { buildSigningSessionSealApplyPath, buildSigningSessionSealRemovePath, resolveSigningSessionSealBasePath, parseSigningSessionSealApplyBody, parseSigningSessionSealRemoveBody, authorizeSigningSessionSealRequest, } from './transport/shared';
|
|
11
11
|
export { createSigningSessionSealCipherAdapter, createPassthroughSigningSessionSealCipherAdapter, createSigningSessionSealShamir3PassCipherAdapter, encodeSigningSessionSealServerLockContext, } from './crypto/cipher';
|
|
12
12
|
export { createSigningSessionSealService } from './service';
|
|
@@ -15,9 +15,8 @@ export { createSigningSessionSealAuditLogger } from './observability/audit';
|
|
|
15
15
|
export { createSigningSessionSealRoutesOptions } from './routesOptions';
|
|
16
16
|
export { createSigningSessionSealOptions, parseSigningSessionSealRootConfig } from './options';
|
|
17
17
|
export { createInMemorySigningSessionSealRateLimiter, createSigningSessionSealRateLimitGuard, } from './guards';
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
18
|
+
export { createUpstashSigningSessionSealRateLimiter, } from './guards/backends';
|
|
19
|
+
export { createUpstashSigningSessionSealIdempotencyStore, } from './idempotencyBackends';
|
|
20
20
|
export { composeSigningSessionSealGuards } from './guards';
|
|
21
|
-
export { registerSigningSessionSealRoutes } from './transport/express';
|
|
22
21
|
export { handleSigningSessionSealRoutes } from './transport/fetch';
|
|
23
22
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seams/wallet-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Seams server TypeScript SDK for NEAR and EVM-family wallets",
|
|
6
6
|
"main": "./dist/esm/index.js",
|
|
@@ -19,11 +19,6 @@
|
|
|
19
19
|
"import": "./dist/esm/index.js",
|
|
20
20
|
"default": "./dist/esm/index.js"
|
|
21
21
|
},
|
|
22
|
-
"./router/express": {
|
|
23
|
-
"types": "./dist/types/wallet-server/src/router/express-adaptor.d.ts",
|
|
24
|
-
"import": "./dist/esm/router/express.js",
|
|
25
|
-
"default": "./dist/esm/router/express.js"
|
|
26
|
-
},
|
|
27
22
|
"./router/cloudflare": {
|
|
28
23
|
"types": "./dist/types/wallet-server/src/router/cloudflare-adaptor.d.ts",
|
|
29
24
|
"import": "./dist/esm/router/cloudflare.js",
|
|
@@ -120,12 +115,10 @@
|
|
|
120
115
|
"homepage": "https://github.com/seams-tech/seams-wallet#readme",
|
|
121
116
|
"dependencies": {
|
|
122
117
|
"@simplewebauthn/server": "^13.2.2",
|
|
123
|
-
"bs58": "^6.0.0"
|
|
124
|
-
"express": "^4.21.2"
|
|
118
|
+
"bs58": "^6.0.0"
|
|
125
119
|
},
|
|
126
120
|
"devDependencies": {
|
|
127
121
|
"@near-js/types": "^2.4.0",
|
|
128
|
-
"@types/express": "^4.17.21",
|
|
129
122
|
"@types/node": "^20.19.9",
|
|
130
123
|
"rolldown": "^1.0.0-beta.27",
|
|
131
124
|
"typescript": "^5.8.3"
|
package/src/README.md
CHANGED
|
@@ -76,7 +76,7 @@ Use fresh wallets when measuring this change.
|
|
|
76
76
|
It does not authorize wallet ownership.
|
|
77
77
|
|
|
78
78
|
```ts
|
|
79
|
-
import {
|
|
79
|
+
import { createCloudflareRouter } from '@seams/wallet-server/router/cloudflare';
|
|
80
80
|
import { createSigningSessionSealOptions } from '@seams/wallet-server';
|
|
81
81
|
|
|
82
82
|
const signingSessionSeal = createSigningSessionSealOptions({
|
|
@@ -85,10 +85,12 @@ const signingSessionSeal = createSigningSessionSealOptions({
|
|
|
85
85
|
acceptedWarmKeyVersions: ['signing-session-seal-production-r2'],
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
const fetch = createCloudflareRouter(service, {
|
|
89
89
|
threshold,
|
|
90
90
|
signingSessionSeal,
|
|
91
|
-
})
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export default { fetch };
|
|
92
94
|
```
|
|
93
95
|
|
|
94
96
|
Store the random 32-byte root secret in a secrets manager. Retain accepted old
|