@midnightntwrk/wallet-sdk-capabilities 4.0.0-rc.1 → 4.0.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.
Files changed (62) hide show
  1. package/README.md +10 -3
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/liveness/livenessReads.js +11 -10
  5. package/dist/liveness/livenessService.js +4 -5
  6. package/dist/proving/index.d.ts +1 -0
  7. package/dist/proving/index.js +1 -0
  8. package/dist/proving/provingService.d.ts +16 -49
  9. package/dist/proving/provingService.js +1 -89
  10. package/dist/proving/v8ProvingService.d.ts +34 -7
  11. package/dist/proving/v8ProvingService.js +36 -6
  12. package/dist/proving/v9ProvingService.d.ts +108 -0
  13. package/dist/proving/v9ProvingService.js +146 -0
  14. package/dist/proving/versionedProving.d.ts +22 -4
  15. package/dist/proving/versionedProving.js +28 -2
  16. package/dist/signatures/v8Signatures.d.ts +1 -1
  17. package/dist/simulation/index.d.ts +4 -6
  18. package/dist/simulation/index.js +4 -7
  19. package/dist/simulation/v8/Simulator.d.ts +1 -3
  20. package/dist/simulation/v8/Simulator.js +1 -3
  21. package/dist/simulation/v8/SimulatorState.d.ts +1 -10
  22. package/dist/simulation/v8/SimulatorState.js +1 -9
  23. package/dist/simulation/v8/index.d.ts +1 -1
  24. package/dist/simulation/v8/index.js +1 -1
  25. package/dist/simulation/v9/Simulator.d.ts +0 -2
  26. package/dist/simulation/v9/Simulator.js +0 -2
  27. package/dist/simulation/v9/SimulatorState.d.ts +0 -9
  28. package/dist/simulation/v9/SimulatorState.js +0 -8
  29. package/dist/simulation/v9/index.d.ts +1 -1
  30. package/dist/simulation/v9/index.js +1 -1
  31. package/dist/submission/submissionService.d.ts +57 -9
  32. package/dist/submission/submissionService.js +61 -15
  33. package/dist/transactionLifecycle/SnapshotFormat.d.ts +51 -0
  34. package/dist/transactionLifecycle/SnapshotFormat.js +120 -0
  35. package/dist/transactionLifecycle/index.d.ts +4 -0
  36. package/dist/{pendingTransactions → transactionLifecycle}/index.js +4 -2
  37. package/dist/transactionLifecycle/lifecycle.d.ts +402 -0
  38. package/dist/transactionLifecycle/lifecycle.js +407 -0
  39. package/dist/transactionLifecycle/lifecycleService.d.ts +448 -0
  40. package/dist/transactionLifecycle/lifecycleService.js +350 -0
  41. package/dist/transactionLifecycle/transactionTraits.d.ts +106 -0
  42. package/dist/transactionLifecycle/transactionTraits.js +53 -0
  43. package/dist/validation/blockData.d.ts +23 -4
  44. package/dist/validation/blockData.js +34 -10
  45. package/dist/validation/index.d.ts +1 -0
  46. package/dist/validation/index.js +1 -0
  47. package/dist/validation/promiseBoundary.d.ts +10 -0
  48. package/dist/validation/promiseBoundary.js +30 -0
  49. package/dist/validation/v8ValidationService.d.ts +6 -5
  50. package/dist/validation/v8ValidationService.js +11 -4
  51. package/dist/validation/v9ValidationService.d.ts +30 -0
  52. package/dist/validation/v9ValidationService.js +61 -0
  53. package/dist/validation/validationService.d.ts +54 -32
  54. package/dist/validation/validationService.js +29 -49
  55. package/dist/validation/versionedValidation.d.ts +5 -3
  56. package/dist/validation/versionedValidation.js +5 -3
  57. package/package.json +12 -12
  58. package/dist/pendingTransactions/index.d.ts +0 -2
  59. package/dist/pendingTransactions/pendingTransactions.d.ts +0 -266
  60. package/dist/pendingTransactions/pendingTransactions.js +0 -302
  61. package/dist/pendingTransactions/pendingTransactionsService.d.ts +0 -108
  62. package/dist/pendingTransactions/pendingTransactionsService.js +0 -186
@@ -0,0 +1,448 @@
1
+ import { type ProtocolVersion } from '@midnightntwrk/wallet-sdk-abstractions';
2
+ import { type QueryClient } from '@midnightntwrk/wallet-sdk-indexer-client/effect';
3
+ import { Clock, Effect, type ParseResult, Scope, Stream } from 'effect';
4
+ import type * as rx from 'rxjs';
5
+ import * as Lifecycle from './lifecycle.js';
6
+ import { type FailedTransactionResult, type VersionedTransactionTrait } from './transactionTraits.js';
7
+ /**
8
+ * Where the indexer the default service polls is.
9
+ *
10
+ * @example
11
+ * const connection: IndexerClientConnection = { indexerHttpUrl: 'http://localhost:8088/api/v3/graphql' };
12
+ */
13
+ export type IndexerClientConnection = {
14
+ /** The indexer's GraphQL HTTP endpoint, which the poller asks about each live transaction. */
15
+ indexerHttpUrl: string;
16
+ /** The indexer's GraphQL WebSocket endpoint. The lifecycle service does not use it; other services do. */
17
+ indexerWsUrl?: string;
18
+ };
19
+ /**
20
+ * What the default service is built from.
21
+ *
22
+ * @example
23
+ * const configuration: DefaultTransactionLifecycleServiceConfiguration = {
24
+ * indexerClientConnection: { indexerHttpUrl },
25
+ * };
26
+ */
27
+ export type DefaultTransactionLifecycleServiceConfiguration = {
28
+ /** The indexer the service polls for what the chain made of each live transaction. */
29
+ indexerClientConnection: IndexerClientConnection;
30
+ };
31
+ /**
32
+ * What the chain made of a transaction it included: applied whole (`SUCCESS`), or failed in some (`PARTIAL_SUCCESS`) or
33
+ * all (`FAILURE`) of its segments, with the segments it reported.
34
+ */
35
+ export type InclusionVerdict = Readonly<{
36
+ status: 'SUCCESS';
37
+ }> | FailedTransactionResult;
38
+ /**
39
+ * Holds one lifecycle record per transaction and moves it as the facade and the chain report events. The Effect form of
40
+ * the service; {@link TransactionLifecycleService} is the Promise form the facade drives.
41
+ *
42
+ * @remarks
43
+ * Every move is a pure transition in `lifecycle.ts` applied to the records in one ref, so a move that does not apply to
44
+ * a record's state leaves the records as they were. No move frees a coin: each wallet's own sweep and the facade's
45
+ * release-on-failure do that (ADR 0011).
46
+ */
47
+ export type TransactionLifecycleServiceEffect<TTransaction> = {
48
+ /**
49
+ * Polls the indexer and sweeps once per tick. Each tick asks the indexer about every live record that holds its
50
+ * transaction, then ends the records whose TTL has passed, publishes those ends, and drops every final record whose
51
+ * TTL has passed.
52
+ *
53
+ * @param ticks When to poll. The default service ticks once a second.
54
+ * @returns An effect that runs until the provided scope closes.
55
+ */
56
+ startPolling: (ticks: Stream.Stream<unknown>) => Effect.Effect<void, Error, QueryClient | Scope.Scope>;
57
+ /**
58
+ * The records, now and each time they move.
59
+ *
60
+ * @returns A stream that starts with the records as they stand.
61
+ */
62
+ state: () => Stream.Stream<Lifecycle.TransactionLifecycle<TTransaction>>;
63
+ /**
64
+ * Records a transaction as balanced, at the clock's time.
65
+ *
66
+ * @param facts The balanced transaction, with its proofs erased, and what the record keeps of it.
67
+ * @returns An effect that applies the move.
68
+ */
69
+ balanced: (facts: Lifecycle.TransactionFacts<TTransaction>) => Effect.Effect<void>;
70
+ /**
71
+ * Records a transaction as finalized, at the clock's time, folding every record it covers into one.
72
+ *
73
+ * @param facts The finalized transaction and what the record keeps of it.
74
+ * @returns An effect that applies the move.
75
+ */
76
+ finalized: (facts: Lifecycle.TransactionFacts<TTransaction>) => Effect.Effect<void>;
77
+ /**
78
+ * Records a transaction as submitted, at the clock's time, which becomes its submission time.
79
+ *
80
+ * @param facts The submitted transaction and what the record keeps of it.
81
+ * @returns An effect that applies the move.
82
+ */
83
+ submitted: (facts: Lifecycle.TransactionFacts<TTransaction>) => Effect.Effect<void>;
84
+ /**
85
+ * Records that the transaction holding any of `identifiers` was reverted: its coins were given back, so no chain will
86
+ * be asked to include it.
87
+ *
88
+ * @param identifiers The reverted transaction's identifiers.
89
+ * @returns An effect that applies the move.
90
+ */
91
+ reverted: (identifiers: readonly string[]) => Effect.Effect<void>;
92
+ /**
93
+ * Gives up on every live transaction built for an epoch the chain has left by `chainNow`. A record whose version was
94
+ * never known is left as it was.
95
+ *
96
+ * @param chainNow The protocol version the chain has reached.
97
+ * @returns An effect that applies the move.
98
+ */
99
+ orphanBeyond: (chainNow: ProtocolVersion.ProtocolVersion) => Effect.Effect<void>;
100
+ /**
101
+ * Records that a block included the transaction holding any of `identifiers`, with the chain's `verdict`. A success
102
+ * confirms it; a failure or partial success rejects a finalized or submitted record with the verdict.
103
+ *
104
+ * @param identifiers The included transaction's identifiers.
105
+ * @param verdict What the chain made of it.
106
+ * @returns An effect that applies the move.
107
+ */
108
+ included: (identifiers: readonly string[], verdict: InclusionVerdict) => Effect.Effect<void>;
109
+ /**
110
+ * The records as they stand, written in the stored format with the traits the service reads them with.
111
+ *
112
+ * @returns An effect that gives the store, in the current format version.
113
+ */
114
+ serializeState: () => Effect.Effect<string>;
115
+ };
116
+ /**
117
+ * The lifecycle records in a ref, moved by the pure transitions in `lifecycle.ts` with the clock's time.
118
+ *
119
+ * @example
120
+ * const service = new TransactionLifecycleServiceEffectImpl(traits);
121
+ * yield * service.balanced({ tx: erased, identifiers, intentHashes, inputs, ttl, protocolVersion });
122
+ */
123
+ export declare class TransactionLifecycleServiceEffectImpl<TTransaction> implements TransactionLifecycleServiceEffect<TTransaction> {
124
+ #private;
125
+ /**
126
+ * Builds a service holding the records a previous one stored.
127
+ *
128
+ * @example
129
+ * const service = yield * TransactionLifecycleServiceEffectImpl.restore(stored, traits);
130
+ *
131
+ * @param data What `Lifecycle.serialize` wrote.
132
+ * @param txTraits The traits each record's transaction is read with, chosen by its version.
133
+ * @returns The service, or why the payload could not be read.
134
+ */
135
+ static restore<TTransaction>(data: string, txTraits: VersionedTransactionTrait<TTransaction>): Effect.Effect<TransactionLifecycleServiceEffectImpl<TTransaction>, ParseResult.ParseError>;
136
+ /**
137
+ * Builds a service, empty or holding `initialState`.
138
+ *
139
+ * @param txTraits The trait each record's transaction is read with, chosen by the version it was built for.
140
+ * @param initialState The records to begin with; none when left out.
141
+ */
142
+ constructor(txTraits: VersionedTransactionTrait<TTransaction>, initialState?: Lifecycle.TransactionLifecycle<TTransaction>);
143
+ /**
144
+ * The records, now and each time they move.
145
+ *
146
+ * @remarks
147
+ * Every write publishes, whether or not it moved anything, so consecutive identical values are dropped. A transition
148
+ * that moves nothing returns the very state it was given, so comparing by identity never hides a real move.
149
+ * @returns A stream that starts with the records as they stand.
150
+ */
151
+ state(): Stream.Stream<Lifecycle.TransactionLifecycle<TTransaction>>;
152
+ /**
153
+ * Polls the indexer and sweeps once per tick.
154
+ *
155
+ * @remarks
156
+ * Each tick asks the indexer first and sweeps after, so an inclusion found on the tick a TTL passes is recorded
157
+ * before the TTL could end the record: the inclusion happened within the TTL.
158
+ *
159
+ * The ticks are drained within the provided scope, so closing that scope stops the poller.
160
+ * @param ticks When to poll.
161
+ * @returns An effect that runs until the provided scope closes.
162
+ */
163
+ startPolling(ticks: Stream.Stream<unknown>): Effect.Effect<void, Error, QueryClient | Scope.Scope>;
164
+ /**
165
+ * Records a transaction as balanced, at the clock's time. See `Lifecycle.balanced` for which records it replaces.
166
+ *
167
+ * @param facts The balanced transaction, with its proofs erased, and what the record keeps of it.
168
+ * @returns An effect that applies the move.
169
+ */
170
+ balanced(facts: Lifecycle.TransactionFacts<TTransaction>): Effect.Effect<void>;
171
+ /**
172
+ * Records a transaction as finalized, at the clock's time. See `Lifecycle.finalized` for which records it folds.
173
+ *
174
+ * @param facts The finalized transaction and what the record keeps of it.
175
+ * @returns An effect that applies the move.
176
+ */
177
+ finalized(facts: Lifecycle.TransactionFacts<TTransaction>): Effect.Effect<void>;
178
+ /**
179
+ * Records a transaction as submitted, at the clock's time, which becomes its submission time.
180
+ *
181
+ * @param facts The submitted transaction and what the record keeps of it.
182
+ * @returns An effect that applies the move.
183
+ */
184
+ submitted(facts: Lifecycle.TransactionFacts<TTransaction>): Effect.Effect<void>;
185
+ /**
186
+ * Records that the transaction holding any of `identifiers` was reverted.
187
+ *
188
+ * @param identifiers The reverted transaction's identifiers.
189
+ * @returns An effect that applies the move.
190
+ */
191
+ reverted(identifiers: readonly string[]): Effect.Effect<void>;
192
+ /**
193
+ * Gives up on every live transaction built for an epoch the chain has left by `chainNow`.
194
+ *
195
+ * @param chainNow The protocol version the chain has reached.
196
+ * @returns An effect that applies the move.
197
+ */
198
+ orphanBeyond(chainNow: ProtocolVersion.ProtocolVersion): Effect.Effect<void>;
199
+ /**
200
+ * Records that a block included the transaction holding any of `identifiers`: confirmed on a success, rejected with
201
+ * the verdict on a failure or partial success.
202
+ *
203
+ * @param identifiers The included transaction's identifiers.
204
+ * @param verdict What the chain made of it.
205
+ * @returns An effect that applies the move.
206
+ */
207
+ included(identifiers: readonly string[], verdict: InclusionVerdict): Effect.Effect<void>;
208
+ /**
209
+ * The records as they stand, written in the stored format with the traits the service was built with.
210
+ *
211
+ * @example
212
+ * const stored = yield * service.serializeState();
213
+ *
214
+ * @returns An effect that gives the store, in the current format version.
215
+ */
216
+ serializeState(): Effect.Effect<string>;
217
+ /**
218
+ * Ends what has passed its TTL, then drops it, as two writes: a record that ends because its TTL passed is due to be
219
+ * dropped at once, so publishing between them is the only way a caller ever sees that end.
220
+ */
221
+ private sweep;
222
+ /**
223
+ * Asks the indexer about every live record that holds its transaction, whichever live state it is in, so a
224
+ * transaction submitted outside the facade is confirmed too. A record without its transaction has nothing to ask by.
225
+ */
226
+ private poll;
227
+ private moveNow;
228
+ }
229
+ /**
230
+ * The {@link TransactionLifecycleServiceEffect} as the facade drives it: promises in, an observable out.
231
+ *
232
+ * @remarks
233
+ * A custom service passed through the facade's `InitParams.transactionLifecycleService` must implement every member,
234
+ * `serializeState` included, so an application can save the store whichever service holds it.
235
+ * @example
236
+ * const service = await TransactionLifecycleServiceImpl.init({ txTraits, configuration });
237
+ * await service.start();
238
+ * service.state().subscribe((lifecycle) => console.log(lifecycle.records.length));
239
+ * await service.stop();
240
+ */
241
+ export type TransactionLifecycleService<TTransaction> = {
242
+ /**
243
+ * Starts polling the indexer and sweeping records whose TTL has passed, in the background.
244
+ *
245
+ * @returns Resolves once polling has started.
246
+ */
247
+ start: () => Promise<void>;
248
+ /**
249
+ * Stops polling. No indexer query and no sweep runs after it resolves.
250
+ *
251
+ * @returns Resolves once polling has stopped.
252
+ */
253
+ stop: () => Promise<void>;
254
+ /**
255
+ * The records, now and each time they move.
256
+ *
257
+ * @returns An observable that starts with the records as they stand.
258
+ */
259
+ state: () => rx.Observable<Lifecycle.TransactionLifecycle<TTransaction>>;
260
+ /**
261
+ * Records a transaction as balanced, at the service's clock time.
262
+ *
263
+ * @param facts The balanced transaction, with its proofs erased, and what the record keeps of it.
264
+ * @returns Resolves once the move is applied.
265
+ */
266
+ balanced: (facts: Lifecycle.TransactionFacts<TTransaction>) => Promise<void>;
267
+ /**
268
+ * Records a transaction as finalized, at the service's clock time, folding every record it covers into one.
269
+ *
270
+ * @param facts The finalized transaction and what the record keeps of it.
271
+ * @returns Resolves once the move is applied.
272
+ */
273
+ finalized: (facts: Lifecycle.TransactionFacts<TTransaction>) => Promise<void>;
274
+ /**
275
+ * Records a transaction as submitted, at the service's clock time, which becomes its submission time.
276
+ *
277
+ * @param facts The submitted transaction and what the record keeps of it.
278
+ * @returns Resolves once the move is applied.
279
+ */
280
+ submitted: (facts: Lifecycle.TransactionFacts<TTransaction>) => Promise<void>;
281
+ /**
282
+ * Records that the transaction holding any of `identifiers` was reverted.
283
+ *
284
+ * @param identifiers The reverted transaction's identifiers.
285
+ * @returns Resolves once the move is applied.
286
+ */
287
+ reverted: (identifiers: readonly string[]) => Promise<void>;
288
+ /**
289
+ * Gives up on every live transaction built for an epoch the chain has left by `chainNow`.
290
+ *
291
+ * @param chainNow The protocol version the chain has reached.
292
+ * @returns Resolves once the move is applied.
293
+ */
294
+ orphanBeyond: (chainNow: ProtocolVersion.ProtocolVersion) => Promise<void>;
295
+ /**
296
+ * Records that a block included the transaction holding any of `identifiers`, with the chain's `verdict`.
297
+ *
298
+ * @param identifiers The included transaction's identifiers.
299
+ * @param verdict What the chain made of it.
300
+ * @returns Resolves once the move is applied.
301
+ */
302
+ included: (identifiers: readonly string[], verdict: InclusionVerdict) => Promise<void>;
303
+ /**
304
+ * Writes the records as they stand, in the stored format, for `TransactionLifecycleServiceImpl.restore` to read back.
305
+ *
306
+ * @returns The store, in the current format version.
307
+ */
308
+ serializeState: () => Promise<string>;
309
+ };
310
+ /**
311
+ * What {@link TransactionLifecycleServiceImpl.init} builds a service from.
312
+ *
313
+ * @example
314
+ * const initParams: TransactionLifecycleServiceInitParams<LifecycleTx> = {
315
+ * txTraits: lifecycleTransactionTraits(configuration.forks.v9),
316
+ * configuration: { indexerClientConnection: { indexerHttpUrl } },
317
+ * clock,
318
+ * };
319
+ */
320
+ export type TransactionLifecycleServiceInitParams<TTransaction> = {
321
+ /** The trait each record's transaction is read with, chosen by the protocol version it was built for. */
322
+ txTraits: VersionedTransactionTrait<TTransaction>;
323
+ /** The records to begin with; none when left out. */
324
+ initialState?: Lifecycle.TransactionLifecycle<TTransaction>;
325
+ /** The indexer the service polls. */
326
+ configuration: DefaultTransactionLifecycleServiceConfiguration;
327
+ /** What every move and sweep reads the time from; the system clock when left out. */
328
+ clock?: WallClock;
329
+ };
330
+ /**
331
+ * A source of the current time, as the facade keeps one.
332
+ *
333
+ * @example
334
+ * const clock: WallClock = { now: () => new Date() };
335
+ */
336
+ export type WallClock = Readonly<{
337
+ /** The current time. */
338
+ now: () => Date;
339
+ }>;
340
+ /**
341
+ * Runs a {@link TransactionLifecycleServiceEffectImpl}, polling the configured indexer once a second between `start` and
342
+ * `stop`.
343
+ *
344
+ * @example
345
+ * const service = await TransactionLifecycleServiceImpl.init({ txTraits, configuration });
346
+ * await service.start();
347
+ */
348
+ export declare class TransactionLifecycleServiceImpl<TTransaction> implements TransactionLifecycleService<TTransaction> {
349
+ #private;
350
+ /**
351
+ * Builds a service, empty or holding `initialState`.
352
+ *
353
+ * @param initParams The traits records are read with, the indexer to poll, and any records to begin with.
354
+ * @returns The service, not yet polling.
355
+ */
356
+ static init<TTransaction>(initParams: TransactionLifecycleServiceInitParams<TTransaction>): Promise<TransactionLifecycleServiceImpl<TTransaction>>;
357
+ /**
358
+ * Builds a service holding the records a previous one stored.
359
+ *
360
+ * @param data What `Lifecycle.serialize` wrote.
361
+ * @param txTraits The traits each record's transaction is read with.
362
+ * @param configuration The indexer to poll.
363
+ * @param clock What every move and sweep reads the time from; the system clock when left out.
364
+ * @returns The service, not yet polling; rejects with why the payload could not be read.
365
+ */
366
+ static restore<TTransaction>(data: string, txTraits: VersionedTransactionTrait<TTransaction>, configuration: DefaultTransactionLifecycleServiceConfiguration, clock?: WallClock): Promise<TransactionLifecycleServiceImpl<TTransaction>>;
367
+ /**
368
+ * Wraps an Effect service. Prefer {@link TransactionLifecycleServiceImpl.init} or
369
+ * {@link TransactionLifecycleServiceImpl.restore}, which build the scope and clock for you.
370
+ *
371
+ * @param effectService The service whose records this one holds.
372
+ * @param scope The scope polling runs in; {@link stop} closes it.
373
+ * @param configuration The indexer to poll.
374
+ * @param clock What every move and sweep reads the time from.
375
+ */
376
+ constructor(effectService: TransactionLifecycleServiceEffect<TTransaction>, scope: Scope.CloseableScope, configuration: DefaultTransactionLifecycleServiceConfiguration, clock: Clock.Clock);
377
+ /**
378
+ * Starts polling the configured indexer once a second, in the background, until {@link stop}.
379
+ *
380
+ * @returns Resolves once polling has started.
381
+ */
382
+ start(): Promise<void>;
383
+ /**
384
+ * Stops polling by closing the scope it runs in. No indexer query and no sweep runs after it resolves; the records
385
+ * are kept, so they can still be read and saved.
386
+ *
387
+ * @returns Resolves once polling has stopped.
388
+ */
389
+ stop(): Promise<void>;
390
+ /**
391
+ * The records, now and each time they move.
392
+ *
393
+ * @returns An observable that starts with the records as they stand.
394
+ */
395
+ state(): rx.Observable<Lifecycle.TransactionLifecycle<TTransaction>>;
396
+ /**
397
+ * Records a transaction as balanced, at the service's clock time.
398
+ *
399
+ * @param facts The balanced transaction, with its proofs erased, and what the record keeps of it.
400
+ * @returns Resolves once the move is applied.
401
+ */
402
+ balanced(facts: Lifecycle.TransactionFacts<TTransaction>): Promise<void>;
403
+ /**
404
+ * Records a transaction as finalized, at the service's clock time.
405
+ *
406
+ * @param facts The finalized transaction and what the record keeps of it.
407
+ * @returns Resolves once the move is applied.
408
+ */
409
+ finalized(facts: Lifecycle.TransactionFacts<TTransaction>): Promise<void>;
410
+ /**
411
+ * Records a transaction as submitted, at the service's clock time, which becomes its submission time.
412
+ *
413
+ * @param facts The submitted transaction and what the record keeps of it.
414
+ * @returns Resolves once the move is applied.
415
+ */
416
+ submitted(facts: Lifecycle.TransactionFacts<TTransaction>): Promise<void>;
417
+ /**
418
+ * Records that the transaction holding any of `identifiers` was reverted.
419
+ *
420
+ * @param identifiers The reverted transaction's identifiers.
421
+ * @returns Resolves once the move is applied.
422
+ */
423
+ reverted(identifiers: readonly string[]): Promise<void>;
424
+ /**
425
+ * Gives up on every live transaction built for an epoch the chain has left by `chainNow`.
426
+ *
427
+ * @param chainNow The protocol version the chain has reached.
428
+ * @returns Resolves once the move is applied.
429
+ */
430
+ orphanBeyond(chainNow: ProtocolVersion.ProtocolVersion): Promise<void>;
431
+ /**
432
+ * Records that a block included the transaction holding any of `identifiers`, with the chain's `verdict`.
433
+ *
434
+ * @param identifiers The included transaction's identifiers.
435
+ * @param verdict What the chain made of it.
436
+ * @returns Resolves once the move is applied.
437
+ */
438
+ included(identifiers: readonly string[], verdict: InclusionVerdict): Promise<void>;
439
+ /**
440
+ * Writes the records as they stand, with the traits the service was built with, for {@link restore} to read back.
441
+ *
442
+ * @example
443
+ * const stored = await facade.transactionLifecycleService.serializeState();
444
+ *
445
+ * @returns The store, in the current format version.
446
+ */
447
+ serializeState(): Promise<string>;
448
+ }