@bananapus/nana-sdk-core 2.38.2 → 2.39.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/dist/cjs/review/heldWrite.d.ts +113 -0
- package/dist/cjs/review/heldWrite.d.ts.map +1 -0
- package/dist/cjs/review/heldWrite.js +551 -0
- package/dist/cjs/review/heldWrite.js.map +1 -0
- package/dist/cjs/review/index.d.ts +2 -0
- package/dist/cjs/review/index.d.ts.map +1 -1
- package/dist/cjs/review/index.js +2 -0
- package/dist/cjs/review/index.js.map +1 -1
- package/dist/cjs/review/messages.d.ts +30 -0
- package/dist/cjs/review/messages.d.ts.map +1 -1
- package/dist/cjs/review/messages.js +34 -1
- package/dist/cjs/review/messages.js.map +1 -1
- package/dist/cjs/review/savedAttempt.d.ts +180 -0
- package/dist/cjs/review/savedAttempt.d.ts.map +1 -0
- package/dist/cjs/review/savedAttempt.js +527 -0
- package/dist/cjs/review/savedAttempt.js.map +1 -0
- package/dist/cjs/review/writeHold.d.ts +94 -2
- package/dist/cjs/review/writeHold.d.ts.map +1 -1
- package/dist/cjs/review/writeHold.js +284 -43
- package/dist/cjs/review/writeHold.js.map +1 -1
- package/dist/cjs/review/writeRecovery.d.ts +58 -0
- package/dist/cjs/review/writeRecovery.d.ts.map +1 -1
- package/dist/cjs/review/writeRecovery.js +159 -2
- package/dist/cjs/review/writeRecovery.js.map +1 -1
- package/dist/esm/review/heldWrite.d.ts +113 -0
- package/dist/esm/review/heldWrite.d.ts.map +1 -0
- package/dist/esm/review/heldWrite.js +544 -0
- package/dist/esm/review/heldWrite.js.map +1 -0
- package/dist/esm/review/index.d.ts +2 -0
- package/dist/esm/review/index.d.ts.map +1 -1
- package/dist/esm/review/index.js +2 -0
- package/dist/esm/review/index.js.map +1 -1
- package/dist/esm/review/messages.d.ts +30 -0
- package/dist/esm/review/messages.d.ts.map +1 -1
- package/dist/esm/review/messages.js +32 -0
- package/dist/esm/review/messages.js.map +1 -1
- package/dist/esm/review/savedAttempt.d.ts +180 -0
- package/dist/esm/review/savedAttempt.d.ts.map +1 -0
- package/dist/esm/review/savedAttempt.js +524 -0
- package/dist/esm/review/savedAttempt.js.map +1 -0
- package/dist/esm/review/writeHold.d.ts +94 -2
- package/dist/esm/review/writeHold.d.ts.map +1 -1
- package/dist/esm/review/writeHold.js +285 -44
- package/dist/esm/review/writeHold.js.map +1 -1
- package/dist/esm/review/writeRecovery.d.ts +58 -0
- package/dist/esm/review/writeRecovery.d.ts.map +1 -1
- package/dist/esm/review/writeRecovery.js +158 -2
- package/dist/esm/review/writeRecovery.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
import { hasSafeService, SAFE_PROPOSAL_AWAITING, waitForSafeExecutionHash, } from "../safeService.js";
|
|
2
|
+
import { HELD_AWAY_SUCCESS_LINE, HELD_CONFIRMING_LINE, HELD_EXPIRED_LINE, HELD_RELEASED_ELSEWHERE_LINE, HELD_RELEASED_LINE, HELD_SUCCESS_LINE, WRITE_HOLD_PENDING_LINE, WRITE_HOLD_REVERTED_LINE, } from "./messages.js";
|
|
3
|
+
import { WriteHeldError, } from "./writeHold.js";
|
|
4
|
+
/** How often a held write is asked again: 30 s by default, kept between 15 s and 60 s. */
|
|
5
|
+
export const HELD_POLL_MS = 30_000;
|
|
6
|
+
const MIN_POLL_MS = 15_000;
|
|
7
|
+
const MAX_POLL_MS = 60_000;
|
|
8
|
+
/** A follower's first looks, a few seconds apart, before it slows to the poll. */
|
|
9
|
+
const FAST_MS = 4_000;
|
|
10
|
+
const FAST_LOOKS = 15;
|
|
11
|
+
/** A direct write's confirming line gives way to the wallet's pending line after this long. */
|
|
12
|
+
const CONFIRMING_MS = 120_000;
|
|
13
|
+
const pollOf = (ms) => Math.min(MAX_POLL_MS, Math.max(MIN_POLL_MS, ms ?? HELD_POLL_MS));
|
|
14
|
+
function pause(ms, signal) {
|
|
15
|
+
return new Promise((resolve) => {
|
|
16
|
+
const timer = setTimeout(done, ms);
|
|
17
|
+
signal.addEventListener("abort", done, { once: true });
|
|
18
|
+
function done() {
|
|
19
|
+
clearTimeout(timer);
|
|
20
|
+
signal.removeEventListener("abort", done);
|
|
21
|
+
resolve();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Follow one held write to its end, whatever becomes of the flow that sent
|
|
27
|
+
* it: a direct transaction by its hold's own reads, a Safe proposal also by
|
|
28
|
+
* Safe's service, whose execution goes to the hold (`onExecuted`) and whose
|
|
29
|
+
* loss ends it unproven (`onUnproven`). It ends only when the hold is clear
|
|
30
|
+
* (an authenticated settlement or an exit) or `signal` aborts: never on its
|
|
31
|
+
* own reading of a receipt, a replacement or an expiry. The hold decides.
|
|
32
|
+
*/
|
|
33
|
+
export async function followHeldWrite(handle, client, { signal, pollMs, fastMs = FAST_MS, }) {
|
|
34
|
+
const now = handle.peek();
|
|
35
|
+
if (now.status !== "clear" &&
|
|
36
|
+
now.record.safe &&
|
|
37
|
+
now.record.hash &&
|
|
38
|
+
!now.record.executed &&
|
|
39
|
+
hasSafeService(now.record.chainId)) {
|
|
40
|
+
const proposal = now.record.hash;
|
|
41
|
+
void waitForSafeExecutionHash(now.record.chainId, proposal, {
|
|
42
|
+
signal,
|
|
43
|
+
client: client,
|
|
44
|
+
})
|
|
45
|
+
.then((execution) => handle.onExecuted(client, execution), () => (signal.aborted ? null : handle.onUnproven(client, proposal)))
|
|
46
|
+
.catch(() => null);
|
|
47
|
+
}
|
|
48
|
+
for (let look = 0; !signal.aborted; look += 1) {
|
|
49
|
+
const state = await handle.state(client).catch(() => null);
|
|
50
|
+
if (state?.status === "clear")
|
|
51
|
+
return state;
|
|
52
|
+
await pause(look < FAST_LOOKS ? fastMs : pollOf(pollMs), signal);
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
/** Reservations seen confirming in this tab: a new view of one never shows it awaiting. */
|
|
57
|
+
const confirmed = new Set();
|
|
58
|
+
/** One follower per reservation in this tab, however many views show it. */
|
|
59
|
+
const followers = new Map();
|
|
60
|
+
function followShared(reservation, handle, client, pollMs) {
|
|
61
|
+
let shared = followers.get(reservation);
|
|
62
|
+
// A follower stopped by its last view, still ending, is never rejoined.
|
|
63
|
+
if (!shared || shared.stop.signal.aborted) {
|
|
64
|
+
const stop = new AbortController();
|
|
65
|
+
const ended = followHeldWrite(handle, client, {
|
|
66
|
+
signal: stop.signal,
|
|
67
|
+
pollMs,
|
|
68
|
+
}).finally(() => {
|
|
69
|
+
if (followers.get(reservation)?.stop === stop)
|
|
70
|
+
followers.delete(reservation);
|
|
71
|
+
});
|
|
72
|
+
shared = { views: 0, stop, ended };
|
|
73
|
+
followers.set(reservation, shared);
|
|
74
|
+
}
|
|
75
|
+
shared.views += 1;
|
|
76
|
+
const joined = shared;
|
|
77
|
+
return {
|
|
78
|
+
ended: joined.ended,
|
|
79
|
+
leave() {
|
|
80
|
+
joined.views -= 1;
|
|
81
|
+
if (joined.views === 0)
|
|
82
|
+
joined.stop.abort();
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Whether `next` would hide an exit `shown` offers without the chain having
|
|
88
|
+
* been checked: an emission, a replay or a contended read
|
|
89
|
+
* (`checked: false`). Only a checked answer removes it.
|
|
90
|
+
*/
|
|
91
|
+
export function hidesShownExit(shown, next) {
|
|
92
|
+
return (!!shown &&
|
|
93
|
+
shown.status !== "clear" &&
|
|
94
|
+
shown.exit &&
|
|
95
|
+
next.status !== "clear" &&
|
|
96
|
+
!next.exit &&
|
|
97
|
+
next.checked !== true);
|
|
98
|
+
}
|
|
99
|
+
/** The line for a settlement. */
|
|
100
|
+
export function settledLine(settled) {
|
|
101
|
+
return settled.result === "success"
|
|
102
|
+
? HELD_SUCCESS_LINE
|
|
103
|
+
: settled.result === "expired"
|
|
104
|
+
? HELD_EXPIRED_LINE
|
|
105
|
+
: WRITE_HOLD_REVERTED_LINE;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* One held write's view, framework-free: its phase and line, the watch
|
|
109
|
+
* (the hold's own events, and a checked read on start, on focus and every
|
|
110
|
+
* poll while held), a shared follower for its hash, its exit, its send and
|
|
111
|
+
* the adoption of a previous deploy's record. Every app binds the same one
|
|
112
|
+
* (useHeldWrite in React), so the same action behaves the same everywhere.
|
|
113
|
+
*
|
|
114
|
+
* - A read the chain didn't check never hides an exit already shown.
|
|
115
|
+
* - Once confirming, a write never goes back to awaiting.
|
|
116
|
+
* - `onSettled` fires once, only for a settlement of what this view saw held.
|
|
117
|
+
* - A hold released without a settlement is `released`: by the user's exit
|
|
118
|
+
* here, or neutrally by another window.
|
|
119
|
+
*/
|
|
120
|
+
export function createHeldWriteView(handle, options) {
|
|
121
|
+
const { client } = options;
|
|
122
|
+
let view = {
|
|
123
|
+
phase: "clear",
|
|
124
|
+
state: null,
|
|
125
|
+
line: null,
|
|
126
|
+
exit: false,
|
|
127
|
+
adopting: !!options.adopt,
|
|
128
|
+
};
|
|
129
|
+
const listeners = new Set();
|
|
130
|
+
/** The reservation this view saw held, and whether its exit here released it. */
|
|
131
|
+
let observed;
|
|
132
|
+
let wasHeld = false;
|
|
133
|
+
let exitedHere;
|
|
134
|
+
const delivered = new Set();
|
|
135
|
+
/** Every reservation this view saw held and hasn't delivered: each is delivered once, whatever is shown. */
|
|
136
|
+
const seen = new Set();
|
|
137
|
+
let following;
|
|
138
|
+
let running = false;
|
|
139
|
+
/** Each start and stop begins a new lifecycle: a read or receipt from an earlier one is dropped. */
|
|
140
|
+
let epoch = 0;
|
|
141
|
+
let live = true;
|
|
142
|
+
let adoption;
|
|
143
|
+
function set(next) {
|
|
144
|
+
view = { ...view, ...next };
|
|
145
|
+
for (const listener of listeners)
|
|
146
|
+
listener();
|
|
147
|
+
}
|
|
148
|
+
function stopFollowing() {
|
|
149
|
+
following?.leave();
|
|
150
|
+
following = undefined;
|
|
151
|
+
}
|
|
152
|
+
function follow(reservation) {
|
|
153
|
+
if (options.follow === false ||
|
|
154
|
+
!running ||
|
|
155
|
+
following?.reservation === reservation)
|
|
156
|
+
return;
|
|
157
|
+
stopFollowing();
|
|
158
|
+
const shared = followShared(reservation, handle, client, options.pollMs);
|
|
159
|
+
const mine = { reservation, leave: shared.leave };
|
|
160
|
+
following = mine;
|
|
161
|
+
const at = epoch;
|
|
162
|
+
void shared.ended.then((end) => {
|
|
163
|
+
if (following === mine)
|
|
164
|
+
following = undefined;
|
|
165
|
+
if (end && at === epoch)
|
|
166
|
+
apply(end);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/** Settlements this view saw, still to tell the app, by reservation: kept across a restart. */
|
|
170
|
+
const undelivered = new Map();
|
|
171
|
+
/**
|
|
172
|
+
* Tell the app of a settlement it saw held, once, while live. Only once its
|
|
173
|
+
* callback ran is it done, and a success acknowledged: a lifecycle change
|
|
174
|
+
* before then leaves it to the next start.
|
|
175
|
+
*/
|
|
176
|
+
function deliver(settled, key) {
|
|
177
|
+
undelivered.set(key, settled);
|
|
178
|
+
if (!live)
|
|
179
|
+
return;
|
|
180
|
+
const at = epoch;
|
|
181
|
+
const done = (receipt) => {
|
|
182
|
+
if (at !== epoch || delivered.has(key))
|
|
183
|
+
return;
|
|
184
|
+
delivered.add(key);
|
|
185
|
+
undelivered.delete(key);
|
|
186
|
+
if ("hash" in settled)
|
|
187
|
+
told.add(settled.hash.toLowerCase());
|
|
188
|
+
options.onSettled?.(settled, receipt);
|
|
189
|
+
present();
|
|
190
|
+
// Told: the hold marks it acknowledged, so no later visit asks again.
|
|
191
|
+
if ("hash" in settled &&
|
|
192
|
+
settled.result === "success" &&
|
|
193
|
+
!settled.acknowledged)
|
|
194
|
+
void handle.acknowledge(settled).catch(() => null);
|
|
195
|
+
};
|
|
196
|
+
if (!options.onSettled || !("hash" in settled)) {
|
|
197
|
+
done(null);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
void client.getTransactionReceipt({ hash: settled.hash }).then((receipt) => done(receipt), () => done(null));
|
|
201
|
+
}
|
|
202
|
+
/** The phase and line a held state shows, monotonic once confirming. */
|
|
203
|
+
function heldView(next) {
|
|
204
|
+
// A held state's reservation is its record's id.
|
|
205
|
+
const reservation = next.record.id;
|
|
206
|
+
const record = next.record;
|
|
207
|
+
if (next.status === "ran-executed" ||
|
|
208
|
+
(record.safe &&
|
|
209
|
+
(record.executed ||
|
|
210
|
+
record.executionHash !== undefined ||
|
|
211
|
+
(record.candidates?.length ?? 0) > 0)))
|
|
212
|
+
confirmed.add(reservation);
|
|
213
|
+
const base = {
|
|
214
|
+
state: next,
|
|
215
|
+
exit: next.exit,
|
|
216
|
+
warning: "warning" in next ? next.warning : undefined,
|
|
217
|
+
notice: next.notice,
|
|
218
|
+
settled: undefined,
|
|
219
|
+
releasedBy: undefined,
|
|
220
|
+
};
|
|
221
|
+
if (next.exit)
|
|
222
|
+
return { ...base, phase: "held", line: next.line };
|
|
223
|
+
if (next.status === "ran-executed")
|
|
224
|
+
return {
|
|
225
|
+
...base,
|
|
226
|
+
phase: "confirming",
|
|
227
|
+
line: HELD_CONFIRMING_LINE,
|
|
228
|
+
};
|
|
229
|
+
if (next.status === "pending-known-hash") {
|
|
230
|
+
if (record.safe)
|
|
231
|
+
return confirmed.has(reservation)
|
|
232
|
+
? {
|
|
233
|
+
...base,
|
|
234
|
+
phase: "confirming",
|
|
235
|
+
line: HELD_CONFIRMING_LINE,
|
|
236
|
+
}
|
|
237
|
+
: {
|
|
238
|
+
...base,
|
|
239
|
+
phase: "awaiting",
|
|
240
|
+
line: SAFE_PROPOSAL_AWAITING,
|
|
241
|
+
};
|
|
242
|
+
// A direct write: confirming, until the wallet has held it a while.
|
|
243
|
+
const since = Number(record.submittedAt ?? record.firstSeenAt);
|
|
244
|
+
const line = next.line === WRITE_HOLD_PENDING_LINE &&
|
|
245
|
+
!(Date.now() - since >= CONFIRMING_MS)
|
|
246
|
+
? HELD_CONFIRMING_LINE
|
|
247
|
+
: next.line;
|
|
248
|
+
return { ...base, phase: "confirming", line };
|
|
249
|
+
}
|
|
250
|
+
return { ...base, phase: "held", line: next.line };
|
|
251
|
+
}
|
|
252
|
+
/** Take a hold state, through the one guard every source goes through. */
|
|
253
|
+
function apply(next) {
|
|
254
|
+
if (!next || hidesShownExit(view.state, next))
|
|
255
|
+
return;
|
|
256
|
+
if (next.status === "clear") {
|
|
257
|
+
const reservation = next.reservation;
|
|
258
|
+
const mine = wasHeld && (!reservation || reservation === observed);
|
|
259
|
+
stopFollowing();
|
|
260
|
+
if (next.settled && mine) {
|
|
261
|
+
seen.delete(observed);
|
|
262
|
+
deliver(next.settled, observed);
|
|
263
|
+
set({
|
|
264
|
+
phase: "settled",
|
|
265
|
+
state: next,
|
|
266
|
+
line: settledLine(next.settled),
|
|
267
|
+
warning: undefined,
|
|
268
|
+
notice: undefined,
|
|
269
|
+
exit: false,
|
|
270
|
+
settled: next.settled,
|
|
271
|
+
releasedBy: undefined,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
else if (mine) {
|
|
275
|
+
const by = exitedHere === observed ? "user" : "other-tab";
|
|
276
|
+
set({
|
|
277
|
+
phase: "released",
|
|
278
|
+
state: next,
|
|
279
|
+
line: by === "user" ? HELD_RELEASED_LINE : HELD_RELEASED_ELSEWHERE_LINE,
|
|
280
|
+
warning: undefined,
|
|
281
|
+
notice: undefined,
|
|
282
|
+
exit: false,
|
|
283
|
+
settled: undefined,
|
|
284
|
+
releasedBy: by,
|
|
285
|
+
});
|
|
286
|
+
options.onReleased?.(by);
|
|
287
|
+
}
|
|
288
|
+
else if (view.phase === "settled" || view.phase === "released") {
|
|
289
|
+
// Already shown: kept, unless the gate below has another success.
|
|
290
|
+
}
|
|
291
|
+
else
|
|
292
|
+
set({
|
|
293
|
+
phase: "clear",
|
|
294
|
+
state: next,
|
|
295
|
+
line: null,
|
|
296
|
+
warning: undefined,
|
|
297
|
+
notice: undefined,
|
|
298
|
+
exit: false,
|
|
299
|
+
settled: next.settled,
|
|
300
|
+
});
|
|
301
|
+
if (mine)
|
|
302
|
+
seen.delete(observed);
|
|
303
|
+
wasHeld = false;
|
|
304
|
+
observed = undefined;
|
|
305
|
+
exitedHere = undefined;
|
|
306
|
+
collect();
|
|
307
|
+
present();
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
const reservation = next.record.id;
|
|
311
|
+
if (observed !== reservation) {
|
|
312
|
+
observed = reservation;
|
|
313
|
+
exitedHere = undefined;
|
|
314
|
+
}
|
|
315
|
+
wasHeld = true;
|
|
316
|
+
seen.add(reservation);
|
|
317
|
+
set(heldView(next));
|
|
318
|
+
if (next.record.hash)
|
|
319
|
+
follow(reservation);
|
|
320
|
+
collect();
|
|
321
|
+
}
|
|
322
|
+
/** Deliver the settlement of every other reservation this view saw held. */
|
|
323
|
+
function collect() {
|
|
324
|
+
for (const reservation of [...seen]) {
|
|
325
|
+
if (reservation === observed)
|
|
326
|
+
continue;
|
|
327
|
+
const settled = handle.settlementOf(reservation);
|
|
328
|
+
if (!settled)
|
|
329
|
+
continue;
|
|
330
|
+
seen.delete(reservation);
|
|
331
|
+
deliver(settled, reservation);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* The send gate, from current evidence alone: any unacknowledged success
|
|
336
|
+
* of the intent or an eligible legacy hold. It holds whatever is shown.
|
|
337
|
+
*/
|
|
338
|
+
function unacknowledged() {
|
|
339
|
+
if (gate())
|
|
340
|
+
throw new Error(HELD_AWAY_SUCCESS_LINE);
|
|
341
|
+
}
|
|
342
|
+
/** Successes this view told the app of: their acknowledgement is under way. */
|
|
343
|
+
const told = new Set();
|
|
344
|
+
/** The gate's success, but for one this view already told the app of. */
|
|
345
|
+
function gate() {
|
|
346
|
+
return handle.unacknowledgedSuccess((hash) => told.has(hash.toLowerCase()));
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Show the gate's success as `succeeded` ("Send it again") once nothing is
|
|
350
|
+
* left to deliver, unless a hold is shown.
|
|
351
|
+
*/
|
|
352
|
+
function present() {
|
|
353
|
+
const success = gate();
|
|
354
|
+
if (!success || undelivered.size)
|
|
355
|
+
return;
|
|
356
|
+
if (view.phase === "awaiting" ||
|
|
357
|
+
view.phase === "confirming" ||
|
|
358
|
+
view.phase === "held")
|
|
359
|
+
return;
|
|
360
|
+
// A success this view saw settle was told, so the gate never names it.
|
|
361
|
+
set({
|
|
362
|
+
phase: "succeeded",
|
|
363
|
+
state: view.state,
|
|
364
|
+
line: HELD_AWAY_SUCCESS_LINE,
|
|
365
|
+
warning: undefined,
|
|
366
|
+
notice: undefined,
|
|
367
|
+
exit: false,
|
|
368
|
+
settled: { result: "success", hash: success.hash },
|
|
369
|
+
releasedBy: undefined,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
/** The gated answer, now. */
|
|
373
|
+
async function check() {
|
|
374
|
+
const at = epoch;
|
|
375
|
+
const next = await handle.state(client).catch(() => null);
|
|
376
|
+
if (at === epoch)
|
|
377
|
+
apply(next);
|
|
378
|
+
return view;
|
|
379
|
+
}
|
|
380
|
+
/** Move a previous deploy's record into the hold, once, before any send. */
|
|
381
|
+
function adopt() {
|
|
382
|
+
const provider = options.adopt;
|
|
383
|
+
if (!provider)
|
|
384
|
+
return Promise.resolve(true);
|
|
385
|
+
adoption ??= (async () => {
|
|
386
|
+
set({ adopting: true });
|
|
387
|
+
// Each answer is this lifecycle's only: a stopped view's late read
|
|
388
|
+
// applies nothing and acknowledges nothing.
|
|
389
|
+
const at = epoch;
|
|
390
|
+
const current = () => {
|
|
391
|
+
if (at !== epoch)
|
|
392
|
+
throw new Error("Stopped while adopting.");
|
|
393
|
+
};
|
|
394
|
+
const snapshot = await handle.state(client);
|
|
395
|
+
current();
|
|
396
|
+
apply(snapshot);
|
|
397
|
+
if (snapshot.status === "clear") {
|
|
398
|
+
const evidence = await provider();
|
|
399
|
+
current();
|
|
400
|
+
if (evidence) {
|
|
401
|
+
const state = await handle.adopt(snapshot, evidence, client);
|
|
402
|
+
current();
|
|
403
|
+
// Unread (the chain, or a lock another writer held): no send until it is.
|
|
404
|
+
if (state.declined === "unreadable")
|
|
405
|
+
throw new Error("The saved write couldn't be checked.");
|
|
406
|
+
apply(state);
|
|
407
|
+
if (state.status !== "clear" || state.settled)
|
|
408
|
+
options.onAdopted?.(state);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
set({ adopting: false });
|
|
412
|
+
return true;
|
|
413
|
+
})().catch(() => {
|
|
414
|
+
// Unchecked: asked again on the next send.
|
|
415
|
+
adoption = undefined;
|
|
416
|
+
set({ adopting: false });
|
|
417
|
+
return false;
|
|
418
|
+
});
|
|
419
|
+
return adoption;
|
|
420
|
+
}
|
|
421
|
+
return {
|
|
422
|
+
get: () => view,
|
|
423
|
+
subscribe(listener) {
|
|
424
|
+
listeners.add(listener);
|
|
425
|
+
return () => void listeners.delete(listener);
|
|
426
|
+
},
|
|
427
|
+
check,
|
|
428
|
+
/**
|
|
429
|
+
* Start watching: the hold's events, a checked read now (after adoption),
|
|
430
|
+
* on focus and every poll while held. Returns the stop.
|
|
431
|
+
*/
|
|
432
|
+
start() {
|
|
433
|
+
running = true;
|
|
434
|
+
live = true;
|
|
435
|
+
epoch += 1;
|
|
436
|
+
// Every settlement a stopped lifecycle never told is told now.
|
|
437
|
+
for (const [key, settled] of [...undelivered])
|
|
438
|
+
deliver(settled, key);
|
|
439
|
+
const unsubscribe = handle.subscribe(apply);
|
|
440
|
+
// An adoption a stopped lifecycle left unfinished runs again here.
|
|
441
|
+
void adopt()
|
|
442
|
+
.then((done) => (done || !running ? done : adopt()))
|
|
443
|
+
.then(() => (running ? check() : view));
|
|
444
|
+
const timer = setInterval(() => {
|
|
445
|
+
const held = view.phase === "awaiting" ||
|
|
446
|
+
view.phase === "confirming" ||
|
|
447
|
+
view.phase === "held";
|
|
448
|
+
const hidden = globalThis.document?.visibilityState === "hidden";
|
|
449
|
+
if (held && !hidden)
|
|
450
|
+
void check();
|
|
451
|
+
}, pollOf(options.pollMs));
|
|
452
|
+
const onFocus = () => void check();
|
|
453
|
+
globalThis.addEventListener?.("focus", onFocus);
|
|
454
|
+
return () => {
|
|
455
|
+
running = false;
|
|
456
|
+
live = false;
|
|
457
|
+
epoch += 1;
|
|
458
|
+
unsubscribe();
|
|
459
|
+
clearInterval(timer);
|
|
460
|
+
globalThis.removeEventListener?.("focus", onFocus);
|
|
461
|
+
stopFollowing();
|
|
462
|
+
};
|
|
463
|
+
},
|
|
464
|
+
/**
|
|
465
|
+
* The user checked their wallet: the exit the shown state offers, asked
|
|
466
|
+
* of the chain once more. True when released: the app reopens its review.
|
|
467
|
+
*/
|
|
468
|
+
async exit() {
|
|
469
|
+
const shown = view.state;
|
|
470
|
+
if (!shown || shown.status === "clear" || !view.exit)
|
|
471
|
+
return false;
|
|
472
|
+
exitedHere = shown.record.id;
|
|
473
|
+
const ended = await handle.exit(shown, { checkedWallet: true }, client);
|
|
474
|
+
if (!ended.released)
|
|
475
|
+
exitedHere = undefined;
|
|
476
|
+
apply(ended.state);
|
|
477
|
+
return ended.released;
|
|
478
|
+
},
|
|
479
|
+
/**
|
|
480
|
+
* Send under the hold, once any adoption is done. A held write refuses
|
|
481
|
+
* with the hold's checked state shown.
|
|
482
|
+
*/
|
|
483
|
+
async send(run) {
|
|
484
|
+
if (!(await adopt()))
|
|
485
|
+
throw new Error("Saved transactions are still being checked. Try again in a moment.");
|
|
486
|
+
unacknowledged();
|
|
487
|
+
// The send's own check may find one too: it says so before the wallet.
|
|
488
|
+
const unsubscribe = handle.subscribe(apply);
|
|
489
|
+
try {
|
|
490
|
+
const hash = await handle.send(client, async (gate) => {
|
|
491
|
+
unacknowledged();
|
|
492
|
+
return run({
|
|
493
|
+
...gate,
|
|
494
|
+
// Asked again at the reservation itself, after any lock retries.
|
|
495
|
+
async beforeSend(actualCall) {
|
|
496
|
+
unacknowledged();
|
|
497
|
+
await gate.beforeSend(actualCall);
|
|
498
|
+
try {
|
|
499
|
+
unacknowledged();
|
|
500
|
+
}
|
|
501
|
+
catch (error) {
|
|
502
|
+
gate.onRejected();
|
|
503
|
+
throw error;
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
unsubscribe();
|
|
509
|
+
apply(handle.peek());
|
|
510
|
+
return hash;
|
|
511
|
+
}
|
|
512
|
+
catch (error) {
|
|
513
|
+
unsubscribe();
|
|
514
|
+
// Its own evidence, checked or not: a contended refusal hides no exit.
|
|
515
|
+
if (error instanceof WriteHeldError)
|
|
516
|
+
apply(error.state);
|
|
517
|
+
else if (view.phase !== "succeeded")
|
|
518
|
+
await check();
|
|
519
|
+
throw error;
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
/**
|
|
523
|
+
* The user saw a success that settled while away and chose to send again:
|
|
524
|
+
* the hold marks it acknowledged, for every reader, and sends are allowed.
|
|
525
|
+
*/
|
|
526
|
+
async acknowledge() {
|
|
527
|
+
const success = gate();
|
|
528
|
+
if (view.phase !== "succeeded" || !success)
|
|
529
|
+
return;
|
|
530
|
+
const at = epoch;
|
|
531
|
+
await handle.acknowledge({ result: success.result, hash: success.hash });
|
|
532
|
+
// Only that success's presentation ends: never a newer hold or its exit.
|
|
533
|
+
if (at === epoch &&
|
|
534
|
+
view.phase === "succeeded" &&
|
|
535
|
+
view.settled !== undefined &&
|
|
536
|
+
"hash" in view.settled &&
|
|
537
|
+
view.settled.hash === success.hash)
|
|
538
|
+
set({ phase: "clear", line: null, settled: undefined, state: null });
|
|
539
|
+
// Another success still unacknowledged is shown next.
|
|
540
|
+
present();
|
|
541
|
+
},
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
//# sourceMappingURL=heldWrite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heldWrite.js","sourceRoot":"","sources":["../../../src/review/heldWrite.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,sBAAsB,E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,EAAE,IAAI,EAAE,CAAC,CAAC;YACvE,sDAAsD;YACtD,OAAO,EAAE,CAAC;QACZ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/review/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/review/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
package/dist/esm/review/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/review/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/review/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
|
@@ -61,5 +61,35 @@ export declare const WRITE_HOLD_SAFE_UNPROVEN_LINE = "This Safe transaction coul
|
|
|
61
61
|
export declare const WRITE_HOLD_MINED_LINE = "Your transaction is onchain, but its result can't be read yet.";
|
|
62
62
|
/** A send whose review went stale because another window's attempt of the same write ended meanwhile. */
|
|
63
63
|
export declare const WRITE_HOLD_STALE_REVIEW_LINE = "This was just sent from another window. Review it again to send another.";
|
|
64
|
+
/** The one line while a sent write, direct or through a Safe, is being confirmed. */
|
|
65
|
+
export declare const HELD_CONFIRMING_LINE = "Confirming your transaction.";
|
|
66
|
+
/** A held write the user released with their exit: they can send it again. */
|
|
67
|
+
export declare const HELD_RELEASED_LINE = "Released. You can send it again.";
|
|
68
|
+
/** A held write another window released: neutral, never a result. */
|
|
69
|
+
export declare const HELD_RELEASED_ELSEWHERE_LINE = "This was released in another window.";
|
|
70
|
+
/** The exit button where the review follows on its own. */
|
|
71
|
+
export declare const HELD_EXIT_LABEL = "I checked my wallet";
|
|
72
|
+
/** The exit button where only the hold is released (an app-wide notice). */
|
|
73
|
+
export declare const HELD_RELEASE_LABEL = "I checked my wallet. Release it";
|
|
74
|
+
/** A held write settled with success on authenticated evidence. */
|
|
75
|
+
export declare const HELD_SUCCESS_LINE = "Your transaction went through.";
|
|
76
|
+
/** A held Safe proposal proven expired before it ran. */
|
|
77
|
+
export declare const HELD_EXPIRED_LINE = "Your Safe proposal expired before it ran.";
|
|
78
|
+
/** A success the hold settled while the user was away: shown until they say to send again. */
|
|
79
|
+
export declare const HELD_AWAY_SUCCESS_LINE = "This went through while you were away.";
|
|
80
|
+
/** The one action on a success settled while away: acknowledge it, then send. */
|
|
81
|
+
export declare const HELD_SEND_AGAIN_LABEL = "Send it again";
|
|
82
|
+
/** A saved attempt that can't be shown here: absence of evidence is never permission to send. */
|
|
83
|
+
export declare const SAVED_ATTEMPT_CHECK_LINE = "This transaction may already be in your wallet, and it cannot be confirmed from here.";
|
|
84
|
+
/** The warning under it. */
|
|
85
|
+
export declare const SAVED_ATTEMPT_CHECK_WARNING = "Check your wallet and the explorer first. Continuing can send it twice.";
|
|
86
|
+
/** The one check action's label: "I checked it. Review it again." or the flow's next step ("Create again"). */
|
|
87
|
+
export declare function checkedItLabel(next?: string): string;
|
|
88
|
+
/** Under a retirement that lasts in this tab alone (`durable: false`). */
|
|
89
|
+
export declare const SAVED_ATTEMPT_TAB_ONLY_LINE = "This applies to this tab only.";
|
|
90
|
+
/** When the browser has storage but can't read it: the warned exit's line. */
|
|
91
|
+
export declare const SAVED_ATTEMPT_UNREADABLE_LINE = "This browser can't read its saved transactions. Check your wallet before sending again.";
|
|
92
|
+
/** The warned exit's label, offered only after a check action found storage unreadable. */
|
|
93
|
+
export declare const SAVED_ATTEMPT_CONTINUE_ANYWAY_LABEL = "I checked my wallet. Continue anyway";
|
|
64
94
|
export {};
|
|
65
95
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/review/messages.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,4FAA4F;AAC5F,KAAK,aAAa,GAAG,KAAK,G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