@daski/pay 0.3.1 → 0.4.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 (101) hide show
  1. package/README.md +18 -11
  2. package/dist/bin/daski.js +26 -11
  3. package/dist/bin/daski.js.map +1 -1
  4. package/dist/chain/reader.d.ts +92 -0
  5. package/dist/chain/reader.d.ts.map +1 -0
  6. package/dist/chain/reader.js +130 -0
  7. package/dist/chain/reader.js.map +1 -0
  8. package/dist/commands/approval.js +2 -2
  9. package/dist/commands/approval.js.map +1 -1
  10. package/dist/commands/buy.d.ts +0 -1
  11. package/dist/commands/buy.d.ts.map +1 -1
  12. package/dist/commands/buy.js +15 -22
  13. package/dist/commands/buy.js.map +1 -1
  14. package/dist/commands/confirmation.d.ts +322 -4
  15. package/dist/commands/confirmation.d.ts.map +1 -1
  16. package/dist/commands/confirmation.js +771 -60
  17. package/dist/commands/confirmation.js.map +1 -1
  18. package/dist/commands/doctor.d.ts +20 -0
  19. package/dist/commands/doctor.d.ts.map +1 -1
  20. package/dist/commands/doctor.js +204 -59
  21. package/dist/commands/doctor.js.map +1 -1
  22. package/dist/commands/order.d.ts +37 -6
  23. package/dist/commands/order.d.ts.map +1 -1
  24. package/dist/commands/order.js +181 -103
  25. package/dist/commands/order.js.map +1 -1
  26. package/dist/commands/signPayment.d.ts.map +1 -1
  27. package/dist/commands/signPayment.js +8 -3
  28. package/dist/commands/signPayment.js.map +1 -1
  29. package/dist/commands/wallet.d.ts +3 -0
  30. package/dist/commands/wallet.d.ts.map +1 -1
  31. package/dist/commands/wallet.js +72 -16
  32. package/dist/commands/wallet.js.map +1 -1
  33. package/dist/config.d.ts +10 -2
  34. package/dist/config.d.ts.map +1 -1
  35. package/dist/config.js +41 -1
  36. package/dist/config.js.map +1 -1
  37. package/dist/context.d.ts +28 -3
  38. package/dist/context.d.ts.map +1 -1
  39. package/dist/context.js +72 -3
  40. package/dist/context.js.map +1 -1
  41. package/dist/gateway/client.d.ts +20 -17
  42. package/dist/gateway/client.d.ts.map +1 -1
  43. package/dist/gateway/client.js +62 -43
  44. package/dist/gateway/client.js.map +1 -1
  45. package/dist/gateway/lifecycle.d.ts +4 -1
  46. package/dist/gateway/lifecycle.d.ts.map +1 -1
  47. package/dist/gateway/lifecycle.js +10 -5
  48. package/dist/gateway/lifecycle.js.map +1 -1
  49. package/dist/gateway/metadata.d.ts +66 -0
  50. package/dist/gateway/metadata.d.ts.map +1 -0
  51. package/dist/gateway/metadata.js +152 -0
  52. package/dist/gateway/metadata.js.map +1 -0
  53. package/dist/gateway/purchase.d.ts +51 -67
  54. package/dist/gateway/purchase.d.ts.map +1 -1
  55. package/dist/gateway/purchase.js +153 -125
  56. package/dist/gateway/purchase.js.map +1 -1
  57. package/dist/host.d.ts +41 -0
  58. package/dist/host.d.ts.map +1 -0
  59. package/dist/host.js +112 -0
  60. package/dist/host.js.map +1 -0
  61. package/dist/index.d.ts +12 -6
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +10 -4
  64. package/dist/index.js.map +1 -1
  65. package/dist/signers/circleAgent.d.ts +37 -0
  66. package/dist/signers/circleAgent.d.ts.map +1 -0
  67. package/dist/signers/circleAgent.js +244 -0
  68. package/dist/signers/circleAgent.js.map +1 -0
  69. package/dist/signers/contract.d.ts +34 -0
  70. package/dist/signers/contract.d.ts.map +1 -0
  71. package/dist/signers/contract.js +47 -0
  72. package/dist/signers/contract.js.map +1 -0
  73. package/dist/signers/index.d.ts +16 -7
  74. package/dist/signers/index.d.ts.map +1 -1
  75. package/dist/signers/index.js +7 -3
  76. package/dist/signers/index.js.map +1 -1
  77. package/dist/signers/local.d.ts +5 -1
  78. package/dist/signers/local.d.ts.map +1 -1
  79. package/dist/signers/local.js +16 -3
  80. package/dist/signers/local.js.map +1 -1
  81. package/dist/signers/selfTest.d.ts +32 -12
  82. package/dist/signers/selfTest.d.ts.map +1 -1
  83. package/dist/signers/selfTest.js +85 -12
  84. package/dist/signers/selfTest.js.map +1 -1
  85. package/dist/signers/signature.d.ts +10 -0
  86. package/dist/signers/signature.d.ts.map +1 -0
  87. package/dist/signers/signature.js +11 -0
  88. package/dist/signers/signature.js.map +1 -0
  89. package/dist/store/keystore.d.ts +48 -6
  90. package/dist/store/keystore.d.ts.map +1 -1
  91. package/dist/store/keystore.js +414 -110
  92. package/dist/store/keystore.js.map +1 -1
  93. package/dist/store/lock.d.ts +59 -0
  94. package/dist/store/lock.d.ts.map +1 -0
  95. package/dist/store/lock.js +269 -0
  96. package/dist/store/lock.js.map +1 -0
  97. package/dist/store/orders.d.ts +49 -9
  98. package/dist/store/orders.d.ts.map +1 -1
  99. package/dist/store/orders.js +173 -37
  100. package/dist/store/orders.js.map +1 -1
  101. package/package.json +2 -2
@@ -0,0 +1,59 @@
1
+ import type { CliError } from "../cli/errors.js";
2
+ /** Why an acquisition gave up: a live or unverifiable owner kept it past the wait, or a reclaim was left by a dead process. */
3
+ export type LockRefusal = "held" | "orphaned";
4
+ /**
5
+ * The facts a lock owner's identity is recorded from and checked against.
6
+ * Injectable so a test can describe another boot, namespace, or host without
7
+ * switching any of them.
8
+ */
9
+ export interface LockHost {
10
+ platform: NodeJS.Platform;
11
+ hostname(): string;
12
+ /** Linux: `/proc/sys/kernel/random/boot_id`; undefined when it cannot be read. */
13
+ bootId(): string | undefined;
14
+ /** Linux: this process's pid namespace (`/proc/self/ns/pid`); undefined when it cannot be read. */
15
+ pidNamespace(): string | undefined;
16
+ /** Linux: field 22 of `/proc/<pid>/stat`; `gone` when `/proc/<pid>` is absent; undefined when it cannot be read. */
17
+ startTime(pid: number): string | "gone" | undefined;
18
+ /** `process.kill(pid, 0)`: false only on ESRCH (a permission error still means the process exists). */
19
+ signalable(pid: number): boolean;
20
+ }
21
+ export interface FileLockOptions {
22
+ /** How long to wait for a live (or unverifiable) owner before giving up. */
23
+ waitMs: number;
24
+ /** The error raised when the wait expires (`held`) or recovery needs a person (`orphaned`). */
25
+ locked: (reason: LockRefusal) => CliError;
26
+ /** Where this process runs; defaults to the real host. */
27
+ host?: LockHost | undefined;
28
+ }
29
+ /** True when a process with this id exists (a permission error still means it exists). */
30
+ export declare function processAlive(pid: number): boolean;
31
+ /**
32
+ * Field 22 of a `/proc/<pid>/stat` line: the start time in clock ticks since
33
+ * boot. The command name (field 2) may contain spaces and parentheses, so
34
+ * fields are counted from the last closing parenthesis, after which field 3
35
+ * is first.
36
+ */
37
+ export declare function startTimeFromStat(stat: string): string | undefined;
38
+ /** The real host's facts. */
39
+ export declare function nativeLockHost(platform?: NodeJS.Platform): LockHost;
40
+ /**
41
+ * This process's identity as its lock tokens record it: `linux/<boot id>/<pid
42
+ * namespace>/<start time>`, or `host/<hostname>` off Linux. A part that cannot
43
+ * be read is left empty, which no reader verifies, so such a lock is only
44
+ * ever removed by hand.
45
+ */
46
+ export declare function lockIdentity(host: LockHost, pid?: number): string;
47
+ export type OwnerState = "alive" | "gone" | "unverifiable";
48
+ /**
49
+ * Whether the owner a token names is still running. `gone` only when the
50
+ * recorded identity is verifiable from here and shows it: on Linux the same
51
+ * boot and pid namespace with `/proc/<pid>` absent or a different start time
52
+ * (the pid was reused); elsewhere the same hostname with ESRCH. Anything else
53
+ * (another boot, namespace, or host; `/proc` unavailable; a token without an
54
+ * identity) is `unverifiable`, which is treated like `alive`: never reclaimed.
55
+ */
56
+ export declare function ownerState(host: LockHost, token: string): OwnerState;
57
+ export declare function withFileLock<T>(lock: string, options: FileLockOptions, run: () => Promise<T>): Promise<T>;
58
+ export declare function withFileLockSync<T>(lock: string, options: FileLockOptions, run: () => T): T;
59
+ //# sourceMappingURL=lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/store/lock.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,+HAA+H;AAC/H,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,CAAC;AAE9C;;;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xB,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACpB,OAAO,CAAC,CAAC,CAAC,CAiBZ;AAID,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAiB3F"}
@@ -0,0 +1,269 @@
1
+ /**
2
+ * Cross-process exclusive locks as files.
3
+ *
4
+ * A lock is created atomically and already populated: its owner (`pid random
5
+ * identity`) is written to a private staging file that is hard-linked into
6
+ * place, so two creators cannot both succeed and a lock is never observed
7
+ * empty. It is reclaimed only when that owner is verifiably gone (a live
8
+ * process may legitimately hold a lock for minutes, so elapsed time never
9
+ * decides), and reclamation is serialized through a reclaim lock: two waiters
10
+ * that both read a dead owner's token would otherwise both unlink, one of
11
+ * them removing the live lock the other had just created. A reclaim lock
12
+ * whose own owner died is not recovered automatically; that needs a person,
13
+ * and the error says so. Release removes the file only while it still
14
+ * records this owner.
15
+ *
16
+ * A pid alone does not identify a process across the places one state
17
+ * directory can be shared: a container mount or Windows and WSL see each
18
+ * other's pids in different namespaces, so `process.kill(pid, 0)` answers
19
+ * ESRCH for a live owner. The token therefore records where the owner runs:
20
+ * on Linux the kernel boot id, the pid namespace, and the owner's start time
21
+ * (field 22 of `/proc/<pid>/stat`, which a reused pid does not repeat); on
22
+ * other platforms the hostname. An owner is reclaimable only when that
23
+ * identity can be verified from here and shows the process gone; an owner
24
+ * from another boot, namespace, or host, or one recorded without an identity,
25
+ * cannot be verified and is never reclaimed, so the waiter fails closed with
26
+ * the "locked, remove manually" remediation instead.
27
+ *
28
+ * Two flavours share the logic. The asynchronous one serializes keystore
29
+ * updates and one order's confirmation journal across gateway and chain
30
+ * calls. The synchronous one guards every whole-file read-modify-write of
31
+ * the order store, whose functions are synchronous; its critical section is
32
+ * milliseconds, so a short blocking wait is acceptable.
33
+ */
34
+ import { closeSync, linkSync, mkdirSync, openSync, readFileSync, readlinkSync, rmSync, writeSync } from "node:fs";
35
+ import { randomBytes } from "node:crypto";
36
+ import { hostname } from "node:os";
37
+ import { dirname } from "node:path";
38
+ const POLL_MS = 25;
39
+ const SYNC_POLL_MS = 5;
40
+ /** True when a process with this id exists (a permission error still means it exists). */
41
+ export function processAlive(pid) {
42
+ if (!Number.isInteger(pid) || pid <= 0)
43
+ return false;
44
+ try {
45
+ process.kill(pid, 0);
46
+ return true;
47
+ }
48
+ catch (error) {
49
+ return error.code !== "ESRCH";
50
+ }
51
+ }
52
+ function readTrimmed(path) {
53
+ try {
54
+ return readFileSync(path, "utf8").trim();
55
+ }
56
+ catch {
57
+ return undefined;
58
+ }
59
+ }
60
+ /**
61
+ * Field 22 of a `/proc/<pid>/stat` line: the start time in clock ticks since
62
+ * boot. The command name (field 2) may contain spaces and parentheses, so
63
+ * fields are counted from the last closing parenthesis, after which field 3
64
+ * is first.
65
+ */
66
+ export function startTimeFromStat(stat) {
67
+ const end = stat.lastIndexOf(")");
68
+ if (end < 0)
69
+ return undefined;
70
+ const start = stat.slice(end + 1).trim().split(/\s+/)[22 - 3];
71
+ return start !== undefined && /^\d+$/.test(start) ? start : undefined;
72
+ }
73
+ /** The real host's facts. */
74
+ export function nativeLockHost(platform = process.platform) {
75
+ return {
76
+ platform,
77
+ hostname: () => hostname(),
78
+ bootId: () => readTrimmed("/proc/sys/kernel/random/boot_id"),
79
+ pidNamespace: () => {
80
+ try {
81
+ return /\[(\d+)\]/.exec(readlinkSync("/proc/self/ns/pid"))?.[1];
82
+ }
83
+ catch {
84
+ return undefined;
85
+ }
86
+ },
87
+ startTime: (pid) => {
88
+ let stat;
89
+ try {
90
+ stat = readFileSync(`/proc/${pid}/stat`, "utf8");
91
+ }
92
+ catch (error) {
93
+ return error.code === "ENOENT" ? "gone" : undefined;
94
+ }
95
+ return startTimeFromStat(stat);
96
+ },
97
+ signalable: processAlive,
98
+ };
99
+ }
100
+ /**
101
+ * This process's identity as its lock tokens record it: `linux/<boot id>/<pid
102
+ * namespace>/<start time>`, or `host/<hostname>` off Linux. A part that cannot
103
+ * be read is left empty, which no reader verifies, so such a lock is only
104
+ * ever removed by hand.
105
+ */
106
+ export function lockIdentity(host, pid = process.pid) {
107
+ if (host.platform !== "linux")
108
+ return `host/${host.hostname()}`;
109
+ const start = host.startTime(pid);
110
+ return ["linux", host.bootId() ?? "", host.pidNamespace() ?? "", start === undefined || start === "gone" ? "" : start].join("/");
111
+ }
112
+ /**
113
+ * Whether the owner a token names is still running. `gone` only when the
114
+ * recorded identity is verifiable from here and shows it: on Linux the same
115
+ * boot and pid namespace with `/proc/<pid>` absent or a different start time
116
+ * (the pid was reused); elsewhere the same hostname with ESRCH. Anything else
117
+ * (another boot, namespace, or host; `/proc` unavailable; a token without an
118
+ * identity) is `unverifiable`, which is treated like `alive`: never reclaimed.
119
+ */
120
+ export function ownerState(host, token) {
121
+ const [pidText, , identity] = token.split(" ");
122
+ const pid = Number(pidText);
123
+ if (!Number.isInteger(pid) || pid <= 0 || identity === undefined)
124
+ return "unverifiable";
125
+ const parts = identity.split("/");
126
+ if (parts[0] === "linux" && parts.length === 4) {
127
+ const [, bootId, namespace, start] = parts;
128
+ if (host.platform !== "linux" || !bootId || !namespace || !start)
129
+ return "unverifiable";
130
+ if (host.bootId() !== bootId || host.pidNamespace() !== namespace)
131
+ return "unverifiable";
132
+ const current = host.startTime(pid);
133
+ if (current === "gone")
134
+ return "gone";
135
+ if (current === undefined)
136
+ return "unverifiable";
137
+ return current === start ? "alive" : "gone";
138
+ }
139
+ if (parts[0] === "host" && parts.length === 2 && parts[1]) {
140
+ if (host.platform === "linux" || host.hostname() !== parts[1])
141
+ return "unverifiable";
142
+ return host.signalable(pid) ? "alive" : "gone";
143
+ }
144
+ return "unverifiable";
145
+ }
146
+ function owner(host) {
147
+ return `${process.pid} ${randomBytes(8).toString("hex")} ${lockIdentity(host)}`;
148
+ }
149
+ /** Create `path` holding `token`, atomically and populated; false when it exists. */
150
+ function createExclusive(path, token) {
151
+ const staging = `${path}.${token.split(" ")[1]}.staging`;
152
+ const fd = openSync(staging, "wx", 0o600);
153
+ try {
154
+ writeSync(fd, token);
155
+ }
156
+ finally {
157
+ closeSync(fd);
158
+ }
159
+ try {
160
+ linkSync(staging, path);
161
+ return true;
162
+ }
163
+ catch (error) {
164
+ if (error.code !== "EEXIST")
165
+ throw error;
166
+ return false;
167
+ }
168
+ finally {
169
+ rmSync(staging, { force: true });
170
+ }
171
+ }
172
+ /** What a lock file records and whether that owner still runs; null when the file is absent. */
173
+ function recorded(path, host) {
174
+ let content;
175
+ try {
176
+ content = readFileSync(path, "utf8");
177
+ }
178
+ catch (error) {
179
+ if (error.code === "ENOENT")
180
+ return null;
181
+ throw error;
182
+ }
183
+ return { content, state: ownerState(host, content) };
184
+ }
185
+ /** Remove the lock only while it still records this owner. */
186
+ function release(path, token) {
187
+ let current;
188
+ try {
189
+ current = readFileSync(path, "utf8");
190
+ }
191
+ catch {
192
+ return;
193
+ }
194
+ if (current === token)
195
+ rmSync(path, { force: true });
196
+ }
197
+ function attempt(lock, token, host) {
198
+ if (createExclusive(lock, token))
199
+ return "acquired";
200
+ const current = recorded(lock, host);
201
+ if (!current)
202
+ return "retry";
203
+ // A live owner keeps it; so does one that cannot be verified from here.
204
+ if (current.state !== "gone")
205
+ return "held";
206
+ // The owner died holding it. Only the holder of the reclaim lock unlinks,
207
+ // and only the exact file it inspected.
208
+ const reclaim = `${lock}.reclaim`;
209
+ if (!createExclusive(reclaim, token)) {
210
+ const reclaimer = recorded(reclaim, host);
211
+ return reclaimer?.state === "gone" ? "orphaned" : "retry";
212
+ }
213
+ try {
214
+ const again = recorded(lock, host);
215
+ if (again && again.content === current.content && again.state === "gone")
216
+ rmSync(lock, { force: true });
217
+ }
218
+ finally {
219
+ release(reclaim, token);
220
+ }
221
+ return "retry";
222
+ }
223
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
224
+ export async function withFileLock(lock, options, run) {
225
+ mkdirSync(dirname(lock), { recursive: true, mode: 0o700 });
226
+ const host = options.host ?? nativeLockHost();
227
+ const token = owner(host);
228
+ const deadline = Date.now() + options.waitMs;
229
+ for (;;) {
230
+ const outcome = attempt(lock, token, host);
231
+ if (outcome === "acquired")
232
+ break;
233
+ if (outcome === "orphaned")
234
+ throw options.locked("orphaned");
235
+ if (Date.now() > deadline)
236
+ throw options.locked("held");
237
+ await sleep(POLL_MS);
238
+ }
239
+ try {
240
+ return await run();
241
+ }
242
+ finally {
243
+ release(lock, token);
244
+ }
245
+ }
246
+ const waiter = new Int32Array(new SharedArrayBuffer(4));
247
+ export function withFileLockSync(lock, options, run) {
248
+ mkdirSync(dirname(lock), { recursive: true, mode: 0o700 });
249
+ const host = options.host ?? nativeLockHost();
250
+ const token = owner(host);
251
+ const deadline = Date.now() + options.waitMs;
252
+ for (;;) {
253
+ const outcome = attempt(lock, token, host);
254
+ if (outcome === "acquired")
255
+ break;
256
+ if (outcome === "orphaned")
257
+ throw options.locked("orphaned");
258
+ if (Date.now() > deadline)
259
+ throw options.locked("held");
260
+ Atomics.wait(waiter, 0, 0, SYNC_POLL_MS);
261
+ }
262
+ try {
263
+ return run();
264
+ }
265
+ finally {
266
+ release(lock, token);
267
+ }
268
+ }
269
+ //# sourceMappingURL=lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock.js","sourceRoot":"","sources":["../../src/store/lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAClH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiCpC,MAAM,OAAO,GAAG,EAAE,CA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S,CAAC;QACT,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { Address, Hex } from "viem";
1
2
  export type OrderState = "INTENT_RECORDED" | "AUTHORIZED" | "SUBMITTED" | "FULFILLED" | "INPUT_REQUIRED" | "PROVIDER_FAILED" | "CANCELED" | "PENDING_RECONCILIATION"
2
3
  /** The gateway said the authorization did not settle; nothing was charged. */
3
4
  | "NOT_SETTLED";
@@ -7,6 +8,43 @@ export interface ReadCapability {
7
8
  /** Unix seconds. */
8
9
  expiresAt: number;
9
10
  }
11
+ /** A sponsored review submission retained for retries while sponsorship is pending. */
12
+ export interface ConfirmationSubmissionRecord {
13
+ action: "confirmation" | "revoke-confirmation";
14
+ request: {
15
+ phase: "submit";
16
+ submission: "sponsored";
17
+ preparationId: string;
18
+ signature: string;
19
+ };
20
+ }
21
+ export type ConfirmationTxState = "prepared" | "submitted" | "observed" | "abandoned";
22
+ /** What the direct-mode call commits to, so a receipt can be bound to it later. */
23
+ export interface ConfirmationTxExpected {
24
+ schema: Hex;
25
+ recipient: Address;
26
+ refUID: Hex;
27
+ /** keccak256 of the attestation data. */
28
+ dataHash: Hex;
29
+ /** For a revocation: the attestation being revoked. */
30
+ uid?: Hex | undefined;
31
+ }
32
+ /**
33
+ * A direct-mode confirmation the wallet's own tool submits. `submitted` means
34
+ * a hash was recorded and nothing has been verified yet; `observed` means the
35
+ * receipt, the EAS event, the attestation, and the gateway's final read
36
+ * all agree.
37
+ */
38
+ export interface ConfirmationTxRecord {
39
+ action: "attest" | "revoke";
40
+ callHash: Hex;
41
+ expected: ConfirmationTxExpected;
42
+ txHash?: Hex | undefined;
43
+ state: ConfirmationTxState;
44
+ /** The attestation the observed receipt created or revoked. */
45
+ uid?: Hex | undefined;
46
+ preparedAt: string;
47
+ }
10
48
  export interface OrderRecord {
11
49
  /** The gateway's order handle, once known. */
12
50
  handle?: string | undefined;
@@ -24,15 +62,9 @@ export interface OrderRecord {
24
62
  /** The recomputed authorization nonce; identifies the order on-chain. */
25
63
  authorizationNonce?: string | undefined;
26
64
  readCapability?: ReadCapability | undefined;
27
- /** A review submission retained for retries while sponsorship is pending. */
28
- confirmationSubmission?: {
29
- action: "confirmation" | "revoke-confirmation";
30
- request: {
31
- phase: "submit";
32
- preparationId: string;
33
- signature: string;
34
- };
35
- } | undefined;
65
+ confirmationSubmission?: ConfirmationSubmissionRecord | undefined;
66
+ /** The direct-mode confirmation in flight or last observed, if any. */
67
+ confirmationTx?: ConfirmationTxRecord | undefined;
36
68
  createdAt: string;
37
69
  updatedAt: string;
38
70
  /** The request body, kept so an interrupted purchase can be replayed byte-identically. */
@@ -45,6 +77,14 @@ export declare function findByIntent(intentId: string): OrderRecord | undefined;
45
77
  /** Inserts or updates by intent id. The intent id is the stable key. */
46
78
  export declare function upsertOrder(record: OrderRecord): OrderRecord;
47
79
  export declare function updateOrder(intentId: string, changes: Partial<Omit<OrderRecord, "intentId" | "createdAt">>): OrderRecord | undefined;
80
+ /**
81
+ * Serializes one order's confirmation journal across processes. The
82
+ * read-check-write of a preparation spans gateway and chain calls; without
83
+ * the lock two preparations both find nothing pending and the later write
84
+ * drops the earlier validated call's tracking. The lock is reclaimed only
85
+ * when its owner is gone, never by age: the owner may be waiting on a person.
86
+ */
87
+ export declare function withOrderLock<T>(intentId: string, run: () => Promise<T>): Promise<T>;
48
88
  /** True when the record consumed no session budget and its identifier may be signed for again. */
49
89
  export declare function isUnspent(record: OrderRecord): boolean;
50
90
  /** Total atomic USDC authorized for a profile: the §4.1.5 session running total. */
@@ -1 +1 @@
1
- {"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../src/store/orders.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,gBAAgB,GAChB,iBAAiB,GACjB,UAAU,GACV,wBAAwB;AAC1B,8EAA8E;GAC5E,aAAa,C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