@ottochain/sdk 1.6.0 → 2.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.
- package/dist/cjs/apps/contracts/index.js +18 -13
- package/dist/cjs/apps/contracts/state-machines/index.js +139 -7
- package/dist/cjs/apps/corporate/index.js +18 -20
- package/dist/cjs/apps/corporate/state-machines/index.js +535 -6336
- package/dist/cjs/apps/governance/index.js +32 -31
- package/dist/cjs/apps/governance/state-machines/index.js +498 -2315
- package/dist/cjs/apps/identity/index.js +15 -7
- package/dist/cjs/apps/identity/state-machines/index.js +516 -4
- package/dist/cjs/apps/index.js +15 -13
- package/dist/cjs/apps/markets/index.js +23 -10
- package/dist/cjs/apps/markets/state-machines/index.js +1904 -230
- package/dist/esm/apps/contracts/index.js +16 -13
- package/dist/esm/apps/contracts/state-machines/index.js +138 -6
- package/dist/esm/apps/corporate/index.js +14 -20
- package/dist/esm/apps/corporate/state-machines/index.js +534 -6335
- package/dist/esm/apps/governance/index.js +26 -30
- package/dist/esm/apps/governance/state-machines/index.js +497 -2314
- package/dist/esm/apps/identity/index.js +13 -7
- package/dist/esm/apps/identity/state-machines/index.js +515 -3
- package/dist/esm/apps/index.js +14 -12
- package/dist/esm/apps/markets/index.js +19 -10
- package/dist/esm/apps/markets/state-machines/index.js +1903 -229
- package/dist/types/apps/contracts/index.d.ts +661 -9
- package/dist/types/apps/contracts/state-machines/index.d.ts +109 -6
- package/dist/types/apps/corporate/index.d.ts +4015 -7
- package/dist/types/apps/corporate/state-machines/index.d.ts +472 -5587
- package/dist/types/apps/governance/index.d.ts +2151 -12
- package/dist/types/apps/governance/state-machines/index.d.ts +462 -1875
- package/dist/types/apps/identity/index.d.ts +601 -4
- package/dist/types/apps/identity/state-machines/index.d.ts +393 -3
- package/dist/types/apps/index.d.ts +14 -12
- package/dist/types/apps/markets/index.d.ts +1690 -7
- package/dist/types/apps/markets/state-machines/index.d.ts +1416 -184
- package/package.json +1 -1
- package/dist/cjs/apps/oracles/index.js +0 -59
- package/dist/cjs/apps/oracles/state-machines/index.js +0 -415
- package/dist/esm/apps/oracles/index.js +0 -42
- package/dist/esm/apps/oracles/state-machines/index.js +0 -412
- package/dist/types/apps/oracles/index.d.ts +0 -34
- package/dist/types/apps/oracles/state-machines/index.d.ts +0 -312
|
@@ -9,22 +9,674 @@
|
|
|
9
9
|
* ContractState,
|
|
10
10
|
* Contract,
|
|
11
11
|
* getContractDefinition,
|
|
12
|
-
*
|
|
12
|
+
* CONTRACTS_DEFINITIONS
|
|
13
13
|
* } from '@ottochain/sdk/apps/contracts';
|
|
14
14
|
*
|
|
15
|
-
* const
|
|
15
|
+
* const agreementDef = getContractDefinition('agreement');
|
|
16
|
+
* const escrowDef = getContractDefinition('escrow');
|
|
16
17
|
* ```
|
|
17
18
|
*
|
|
18
19
|
* @packageDocumentation
|
|
19
20
|
*/
|
|
20
21
|
export { ContractState, Contract, ProposeContractRequest, AcceptContractRequest, CompleteContractRequest, RejectContractRequest, DisputeContractRequest, ContractDefinition, contractStateFromJSON, contractStateToJSON, } from '../../generated/ottochain/apps/contracts/v1/contract.js';
|
|
21
|
-
|
|
22
|
-
export
|
|
22
|
+
import { contractUniversalDef, contractAgreementDef, contractEscrowDef } from './state-machines/index.js';
|
|
23
|
+
export { contractUniversalDef, contractAgreementDef, contractEscrowDef };
|
|
24
|
+
/** All contract state machine definitions */
|
|
25
|
+
export declare const CONTRACTS_DEFINITIONS: {
|
|
26
|
+
readonly universal: {
|
|
27
|
+
readonly metadata: {
|
|
28
|
+
readonly name: "ContractUniversal";
|
|
29
|
+
readonly description: "Minimal contract state machine - extend for custom use cases";
|
|
30
|
+
readonly version: "1.0.0";
|
|
31
|
+
};
|
|
32
|
+
readonly states: {
|
|
33
|
+
readonly PROPOSED: {
|
|
34
|
+
readonly id: "PROPOSED";
|
|
35
|
+
readonly isFinal: false;
|
|
36
|
+
readonly metadata: null;
|
|
37
|
+
};
|
|
38
|
+
readonly ACTIVE: {
|
|
39
|
+
readonly id: "ACTIVE";
|
|
40
|
+
readonly isFinal: false;
|
|
41
|
+
readonly metadata: null;
|
|
42
|
+
};
|
|
43
|
+
readonly COMPLETED: {
|
|
44
|
+
readonly id: "COMPLETED";
|
|
45
|
+
readonly isFinal: true;
|
|
46
|
+
readonly metadata: null;
|
|
47
|
+
};
|
|
48
|
+
readonly CANCELLED: {
|
|
49
|
+
readonly id: "CANCELLED";
|
|
50
|
+
readonly isFinal: true;
|
|
51
|
+
readonly metadata: null;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
readonly initialState: "PROPOSED";
|
|
55
|
+
readonly transitions: readonly [{
|
|
56
|
+
readonly from: "PROPOSED";
|
|
57
|
+
readonly to: "ACTIVE";
|
|
58
|
+
readonly eventName: "accept";
|
|
59
|
+
readonly guard: {
|
|
60
|
+
readonly "==": readonly [1, 1];
|
|
61
|
+
};
|
|
62
|
+
readonly effect: {
|
|
63
|
+
readonly merge: readonly [{
|
|
64
|
+
readonly var: "state";
|
|
65
|
+
}, {
|
|
66
|
+
readonly status: "ACTIVE";
|
|
67
|
+
readonly acceptedAt: {
|
|
68
|
+
readonly var: "$timestamp";
|
|
69
|
+
};
|
|
70
|
+
}];
|
|
71
|
+
};
|
|
72
|
+
readonly dependencies: readonly [];
|
|
73
|
+
}, {
|
|
74
|
+
readonly from: "PROPOSED";
|
|
75
|
+
readonly to: "CANCELLED";
|
|
76
|
+
readonly eventName: "cancel";
|
|
77
|
+
readonly guard: {
|
|
78
|
+
readonly "==": readonly [1, 1];
|
|
79
|
+
};
|
|
80
|
+
readonly effect: {
|
|
81
|
+
readonly merge: readonly [{
|
|
82
|
+
readonly var: "state";
|
|
83
|
+
}, {
|
|
84
|
+
readonly status: "CANCELLED";
|
|
85
|
+
readonly cancelledAt: {
|
|
86
|
+
readonly var: "$timestamp";
|
|
87
|
+
};
|
|
88
|
+
}];
|
|
89
|
+
};
|
|
90
|
+
readonly dependencies: readonly [];
|
|
91
|
+
}, {
|
|
92
|
+
readonly from: "ACTIVE";
|
|
93
|
+
readonly to: "COMPLETED";
|
|
94
|
+
readonly eventName: "complete";
|
|
95
|
+
readonly guard: {
|
|
96
|
+
readonly "==": readonly [1, 1];
|
|
97
|
+
};
|
|
98
|
+
readonly effect: {
|
|
99
|
+
readonly merge: readonly [{
|
|
100
|
+
readonly var: "state";
|
|
101
|
+
}, {
|
|
102
|
+
readonly status: "COMPLETED";
|
|
103
|
+
readonly completedAt: {
|
|
104
|
+
readonly var: "$timestamp";
|
|
105
|
+
};
|
|
106
|
+
}];
|
|
107
|
+
};
|
|
108
|
+
readonly dependencies: readonly [];
|
|
109
|
+
}, {
|
|
110
|
+
readonly from: "ACTIVE";
|
|
111
|
+
readonly to: "CANCELLED";
|
|
112
|
+
readonly eventName: "cancel";
|
|
113
|
+
readonly guard: {
|
|
114
|
+
readonly "==": readonly [1, 1];
|
|
115
|
+
};
|
|
116
|
+
readonly effect: {
|
|
117
|
+
readonly merge: readonly [{
|
|
118
|
+
readonly var: "state";
|
|
119
|
+
}, {
|
|
120
|
+
readonly status: "CANCELLED";
|
|
121
|
+
readonly cancelledAt: {
|
|
122
|
+
readonly var: "$timestamp";
|
|
123
|
+
};
|
|
124
|
+
}];
|
|
125
|
+
};
|
|
126
|
+
readonly dependencies: readonly [];
|
|
127
|
+
}];
|
|
128
|
+
};
|
|
129
|
+
readonly agreement: {
|
|
130
|
+
readonly metadata: {
|
|
131
|
+
readonly name: "ContractAgreement";
|
|
132
|
+
readonly description: "Two-party agreement with mutual completion attestation and dispute resolution";
|
|
133
|
+
readonly version: "1.0.0";
|
|
134
|
+
readonly crossReferences: {
|
|
135
|
+
readonly proposerIdentityId: "Links to proposer's AgentIdentity fiber";
|
|
136
|
+
readonly counterpartyIdentityId: "Links to counterparty's AgentIdentity fiber";
|
|
137
|
+
readonly escrowId: "Links to Escrow if payment is escrowed";
|
|
138
|
+
readonly arbitrationPoolId: "Links to ArbitrationPool for dispute resolution";
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
readonly states: {
|
|
142
|
+
readonly PROPOSED: {
|
|
143
|
+
readonly id: "PROPOSED";
|
|
144
|
+
readonly isFinal: false;
|
|
145
|
+
readonly metadata: null;
|
|
146
|
+
};
|
|
147
|
+
readonly ACTIVE: {
|
|
148
|
+
readonly id: "ACTIVE";
|
|
149
|
+
readonly isFinal: false;
|
|
150
|
+
readonly metadata: null;
|
|
151
|
+
};
|
|
152
|
+
readonly COMPLETED: {
|
|
153
|
+
readonly id: "COMPLETED";
|
|
154
|
+
readonly isFinal: true;
|
|
155
|
+
readonly metadata: null;
|
|
156
|
+
};
|
|
157
|
+
readonly DISPUTED: {
|
|
158
|
+
readonly id: "DISPUTED";
|
|
159
|
+
readonly isFinal: false;
|
|
160
|
+
readonly metadata: null;
|
|
161
|
+
};
|
|
162
|
+
readonly REJECTED: {
|
|
163
|
+
readonly id: "REJECTED";
|
|
164
|
+
readonly isFinal: true;
|
|
165
|
+
readonly metadata: null;
|
|
166
|
+
};
|
|
167
|
+
readonly CANCELLED: {
|
|
168
|
+
readonly id: "CANCELLED";
|
|
169
|
+
readonly isFinal: true;
|
|
170
|
+
readonly metadata: null;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
readonly initialState: "PROPOSED";
|
|
174
|
+
readonly transitions: readonly [{
|
|
175
|
+
readonly from: "PROPOSED";
|
|
176
|
+
readonly to: "ACTIVE";
|
|
177
|
+
readonly eventName: "accept";
|
|
178
|
+
readonly guard: {
|
|
179
|
+
readonly "===": readonly [{
|
|
180
|
+
readonly var: "event.agent";
|
|
181
|
+
}, {
|
|
182
|
+
readonly var: "state.counterparty";
|
|
183
|
+
}];
|
|
184
|
+
};
|
|
185
|
+
readonly effect: {
|
|
186
|
+
readonly merge: readonly [{
|
|
187
|
+
readonly var: "state";
|
|
188
|
+
}, {
|
|
189
|
+
readonly status: "ACTIVE";
|
|
190
|
+
readonly acceptedAt: {
|
|
191
|
+
readonly var: "$timestamp";
|
|
192
|
+
};
|
|
193
|
+
}];
|
|
194
|
+
};
|
|
195
|
+
readonly dependencies: readonly [];
|
|
196
|
+
}, {
|
|
197
|
+
readonly from: "PROPOSED";
|
|
198
|
+
readonly to: "REJECTED";
|
|
199
|
+
readonly eventName: "reject";
|
|
200
|
+
readonly guard: {
|
|
201
|
+
readonly "===": readonly [{
|
|
202
|
+
readonly var: "event.agent";
|
|
203
|
+
}, {
|
|
204
|
+
readonly var: "state.counterparty";
|
|
205
|
+
}];
|
|
206
|
+
};
|
|
207
|
+
readonly effect: {
|
|
208
|
+
readonly merge: readonly [{
|
|
209
|
+
readonly var: "state";
|
|
210
|
+
}, {
|
|
211
|
+
readonly status: "REJECTED";
|
|
212
|
+
readonly rejectedAt: {
|
|
213
|
+
readonly var: "$timestamp";
|
|
214
|
+
};
|
|
215
|
+
readonly rejectReason: {
|
|
216
|
+
readonly var: "event.reason";
|
|
217
|
+
};
|
|
218
|
+
}];
|
|
219
|
+
};
|
|
220
|
+
readonly dependencies: readonly [];
|
|
221
|
+
}, {
|
|
222
|
+
readonly from: "PROPOSED";
|
|
223
|
+
readonly to: "CANCELLED";
|
|
224
|
+
readonly eventName: "cancel";
|
|
225
|
+
readonly guard: {
|
|
226
|
+
readonly "===": readonly [{
|
|
227
|
+
readonly var: "event.agent";
|
|
228
|
+
}, {
|
|
229
|
+
readonly var: "state.proposer";
|
|
230
|
+
}];
|
|
231
|
+
};
|
|
232
|
+
readonly effect: {
|
|
233
|
+
readonly merge: readonly [{
|
|
234
|
+
readonly var: "state";
|
|
235
|
+
}, {
|
|
236
|
+
readonly status: "CANCELLED";
|
|
237
|
+
readonly cancelledAt: {
|
|
238
|
+
readonly var: "$timestamp";
|
|
239
|
+
};
|
|
240
|
+
}];
|
|
241
|
+
};
|
|
242
|
+
readonly dependencies: readonly [];
|
|
243
|
+
}, {
|
|
244
|
+
readonly from: "ACTIVE";
|
|
245
|
+
readonly to: "ACTIVE";
|
|
246
|
+
readonly eventName: "submit_completion";
|
|
247
|
+
readonly guard: {
|
|
248
|
+
readonly and: readonly [{
|
|
249
|
+
readonly or: readonly [{
|
|
250
|
+
readonly "===": readonly [{
|
|
251
|
+
readonly var: "event.agent";
|
|
252
|
+
}, {
|
|
253
|
+
readonly var: "state.proposer";
|
|
254
|
+
}];
|
|
255
|
+
}, {
|
|
256
|
+
readonly "===": readonly [{
|
|
257
|
+
readonly var: "event.agent";
|
|
258
|
+
}, {
|
|
259
|
+
readonly var: "state.counterparty";
|
|
260
|
+
}];
|
|
261
|
+
}];
|
|
262
|
+
}, {
|
|
263
|
+
readonly "!": readonly [{
|
|
264
|
+
readonly in: readonly [{
|
|
265
|
+
readonly var: "event.agent";
|
|
266
|
+
}, {
|
|
267
|
+
readonly map: readonly [{
|
|
268
|
+
readonly var: "state.completions";
|
|
269
|
+
}, {
|
|
270
|
+
readonly var: "agent";
|
|
271
|
+
}];
|
|
272
|
+
}];
|
|
273
|
+
}];
|
|
274
|
+
}];
|
|
275
|
+
};
|
|
276
|
+
readonly effect: {
|
|
277
|
+
readonly merge: readonly [{
|
|
278
|
+
readonly var: "state";
|
|
279
|
+
}, {
|
|
280
|
+
readonly completions: {
|
|
281
|
+
readonly cat: readonly [{
|
|
282
|
+
readonly var: "state.completions";
|
|
283
|
+
}, readonly [{
|
|
284
|
+
readonly agent: {
|
|
285
|
+
readonly var: "event.agent";
|
|
286
|
+
};
|
|
287
|
+
readonly proof: {
|
|
288
|
+
readonly var: "event.proof";
|
|
289
|
+
};
|
|
290
|
+
readonly submittedAt: {
|
|
291
|
+
readonly var: "$timestamp";
|
|
292
|
+
};
|
|
293
|
+
}]];
|
|
294
|
+
};
|
|
295
|
+
}];
|
|
296
|
+
};
|
|
297
|
+
readonly dependencies: readonly [];
|
|
298
|
+
}, {
|
|
299
|
+
readonly from: "ACTIVE";
|
|
300
|
+
readonly to: "COMPLETED";
|
|
301
|
+
readonly eventName: "finalize";
|
|
302
|
+
readonly guard: {
|
|
303
|
+
readonly ">=": readonly [{
|
|
304
|
+
readonly size: {
|
|
305
|
+
readonly var: "state.completions";
|
|
306
|
+
};
|
|
307
|
+
}, 2];
|
|
308
|
+
};
|
|
309
|
+
readonly effect: {
|
|
310
|
+
readonly merge: readonly [{
|
|
311
|
+
readonly var: "state";
|
|
312
|
+
}, {
|
|
313
|
+
readonly status: "COMPLETED";
|
|
314
|
+
readonly completedAt: {
|
|
315
|
+
readonly var: "$timestamp";
|
|
316
|
+
};
|
|
317
|
+
}];
|
|
318
|
+
};
|
|
319
|
+
readonly dependencies: readonly [];
|
|
320
|
+
}, {
|
|
321
|
+
readonly from: "ACTIVE";
|
|
322
|
+
readonly to: "DISPUTED";
|
|
323
|
+
readonly eventName: "dispute";
|
|
324
|
+
readonly guard: {
|
|
325
|
+
readonly or: readonly [{
|
|
326
|
+
readonly "===": readonly [{
|
|
327
|
+
readonly var: "event.agent";
|
|
328
|
+
}, {
|
|
329
|
+
readonly var: "state.proposer";
|
|
330
|
+
}];
|
|
331
|
+
}, {
|
|
332
|
+
readonly "===": readonly [{
|
|
333
|
+
readonly var: "event.agent";
|
|
334
|
+
}, {
|
|
335
|
+
readonly var: "state.counterparty";
|
|
336
|
+
}];
|
|
337
|
+
}];
|
|
338
|
+
};
|
|
339
|
+
readonly effect: {
|
|
340
|
+
readonly merge: readonly [{
|
|
341
|
+
readonly var: "state";
|
|
342
|
+
}, {
|
|
343
|
+
readonly status: "DISPUTED";
|
|
344
|
+
readonly disputedAt: {
|
|
345
|
+
readonly var: "$timestamp";
|
|
346
|
+
};
|
|
347
|
+
readonly disputeReason: {
|
|
348
|
+
readonly var: "event.reason";
|
|
349
|
+
};
|
|
350
|
+
readonly disputedBy: {
|
|
351
|
+
readonly var: "event.agent";
|
|
352
|
+
};
|
|
353
|
+
}];
|
|
354
|
+
};
|
|
355
|
+
readonly dependencies: readonly [];
|
|
356
|
+
}, {
|
|
357
|
+
readonly from: "DISPUTED";
|
|
358
|
+
readonly to: "COMPLETED";
|
|
359
|
+
readonly eventName: "resolve";
|
|
360
|
+
readonly guard: {
|
|
361
|
+
readonly or: readonly [{
|
|
362
|
+
readonly var: "event.judicialRuling";
|
|
363
|
+
}, {
|
|
364
|
+
readonly and: readonly [{
|
|
365
|
+
readonly "===": readonly [{
|
|
366
|
+
readonly var: "event.proposerApproves";
|
|
367
|
+
}, true];
|
|
368
|
+
}, {
|
|
369
|
+
readonly "===": readonly [{
|
|
370
|
+
readonly var: "event.counterpartyApproves";
|
|
371
|
+
}, true];
|
|
372
|
+
}];
|
|
373
|
+
}];
|
|
374
|
+
};
|
|
375
|
+
readonly effect: {
|
|
376
|
+
readonly merge: readonly [{
|
|
377
|
+
readonly var: "state";
|
|
378
|
+
}, {
|
|
379
|
+
readonly status: "COMPLETED";
|
|
380
|
+
readonly resolvedAt: {
|
|
381
|
+
readonly var: "$timestamp";
|
|
382
|
+
};
|
|
383
|
+
readonly resolution: {
|
|
384
|
+
readonly var: "event.resolution";
|
|
385
|
+
};
|
|
386
|
+
readonly rulingId: {
|
|
387
|
+
readonly var: "event.rulingId";
|
|
388
|
+
};
|
|
389
|
+
}];
|
|
390
|
+
};
|
|
391
|
+
readonly dependencies: readonly [];
|
|
392
|
+
}];
|
|
393
|
+
};
|
|
394
|
+
readonly escrow: {
|
|
395
|
+
readonly metadata: {
|
|
396
|
+
readonly name: "ContractEscrow";
|
|
397
|
+
readonly description: "Asset custody with conditional release, dispute resolution, and split payments";
|
|
398
|
+
readonly version: "1.0.0";
|
|
399
|
+
readonly crossReferences: {
|
|
400
|
+
readonly contractId: "Links to Contract SM that created this escrow";
|
|
401
|
+
readonly marketId: "Links to Market SM for market-based escrow";
|
|
402
|
+
readonly insuranceId: "Links to Insurance SM for protected escrow";
|
|
403
|
+
readonly arbitrationPoolId: "Links to ArbitrationPool for dispute resolution";
|
|
404
|
+
readonly treasuryId: "Links to Treasury for fee collection";
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
readonly states: {
|
|
408
|
+
readonly CREATED: {
|
|
409
|
+
readonly id: "CREATED";
|
|
410
|
+
readonly isFinal: false;
|
|
411
|
+
readonly metadata: null;
|
|
412
|
+
};
|
|
413
|
+
readonly FUNDED: {
|
|
414
|
+
readonly id: "FUNDED";
|
|
415
|
+
readonly isFinal: false;
|
|
416
|
+
readonly metadata: null;
|
|
417
|
+
};
|
|
418
|
+
readonly ACTIVE: {
|
|
419
|
+
readonly id: "ACTIVE";
|
|
420
|
+
readonly isFinal: false;
|
|
421
|
+
readonly metadata: null;
|
|
422
|
+
};
|
|
423
|
+
readonly RELEASING: {
|
|
424
|
+
readonly id: "RELEASING";
|
|
425
|
+
readonly isFinal: false;
|
|
426
|
+
readonly metadata: null;
|
|
427
|
+
};
|
|
428
|
+
readonly DISPUTED: {
|
|
429
|
+
readonly id: "DISPUTED";
|
|
430
|
+
readonly isFinal: false;
|
|
431
|
+
readonly metadata: null;
|
|
432
|
+
};
|
|
433
|
+
readonly RELEASED: {
|
|
434
|
+
readonly id: "RELEASED";
|
|
435
|
+
readonly isFinal: true;
|
|
436
|
+
readonly metadata: null;
|
|
437
|
+
};
|
|
438
|
+
readonly REFUNDED: {
|
|
439
|
+
readonly id: "REFUNDED";
|
|
440
|
+
readonly isFinal: true;
|
|
441
|
+
readonly metadata: null;
|
|
442
|
+
};
|
|
443
|
+
readonly SPLIT: {
|
|
444
|
+
readonly id: "SPLIT";
|
|
445
|
+
readonly isFinal: true;
|
|
446
|
+
readonly metadata: null;
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
readonly initialState: "CREATED";
|
|
450
|
+
readonly transitions: readonly [{
|
|
451
|
+
readonly from: "CREATED";
|
|
452
|
+
readonly to: "FUNDED";
|
|
453
|
+
readonly eventName: "deposit";
|
|
454
|
+
readonly guard: {
|
|
455
|
+
readonly and: readonly [{
|
|
456
|
+
readonly "===": readonly [{
|
|
457
|
+
readonly var: "event.agent";
|
|
458
|
+
}, {
|
|
459
|
+
readonly var: "state.depositor";
|
|
460
|
+
}];
|
|
461
|
+
}, {
|
|
462
|
+
readonly ">=": readonly [{
|
|
463
|
+
readonly var: "event.amount";
|
|
464
|
+
}, {
|
|
465
|
+
readonly var: "state.requiredAmount";
|
|
466
|
+
}];
|
|
467
|
+
}];
|
|
468
|
+
};
|
|
469
|
+
readonly effect: {
|
|
470
|
+
readonly merge: readonly [{
|
|
471
|
+
readonly var: "state";
|
|
472
|
+
}, {
|
|
473
|
+
readonly balance: {
|
|
474
|
+
readonly var: "event.amount";
|
|
475
|
+
};
|
|
476
|
+
readonly fundedAt: {
|
|
477
|
+
readonly var: "$timestamp";
|
|
478
|
+
};
|
|
479
|
+
}];
|
|
480
|
+
};
|
|
481
|
+
readonly dependencies: readonly [];
|
|
482
|
+
}, {
|
|
483
|
+
readonly from: "FUNDED";
|
|
484
|
+
readonly to: "ACTIVE";
|
|
485
|
+
readonly eventName: "activate";
|
|
486
|
+
readonly guard: {
|
|
487
|
+
readonly or: readonly [{
|
|
488
|
+
readonly "===": readonly [{
|
|
489
|
+
readonly var: "event.agent";
|
|
490
|
+
}, {
|
|
491
|
+
readonly var: "state.beneficiary";
|
|
492
|
+
}];
|
|
493
|
+
}, {
|
|
494
|
+
readonly var: "state.autoActivate";
|
|
495
|
+
}];
|
|
496
|
+
};
|
|
497
|
+
readonly effect: {
|
|
498
|
+
readonly merge: readonly [{
|
|
499
|
+
readonly var: "state";
|
|
500
|
+
}, {
|
|
501
|
+
readonly activatedAt: {
|
|
502
|
+
readonly var: "$timestamp";
|
|
503
|
+
};
|
|
504
|
+
}];
|
|
505
|
+
};
|
|
506
|
+
readonly dependencies: readonly [];
|
|
507
|
+
}, {
|
|
508
|
+
readonly from: "ACTIVE";
|
|
509
|
+
readonly to: "RELEASING";
|
|
510
|
+
readonly eventName: "request_release";
|
|
511
|
+
readonly guard: {
|
|
512
|
+
readonly "===": readonly [{
|
|
513
|
+
readonly var: "event.agent";
|
|
514
|
+
}, {
|
|
515
|
+
readonly var: "state.beneficiary";
|
|
516
|
+
}];
|
|
517
|
+
};
|
|
518
|
+
readonly effect: {
|
|
519
|
+
readonly merge: readonly [{
|
|
520
|
+
readonly var: "state";
|
|
521
|
+
}, {
|
|
522
|
+
readonly releaseRequest: {
|
|
523
|
+
readonly requestedBy: {
|
|
524
|
+
readonly var: "event.agent";
|
|
525
|
+
};
|
|
526
|
+
readonly amount: {
|
|
527
|
+
readonly var: "event.amount";
|
|
528
|
+
};
|
|
529
|
+
readonly reason: {
|
|
530
|
+
readonly var: "event.reason";
|
|
531
|
+
};
|
|
532
|
+
readonly requestedAt: {
|
|
533
|
+
readonly var: "$timestamp";
|
|
534
|
+
};
|
|
535
|
+
};
|
|
536
|
+
readonly releaseDeadline: {
|
|
537
|
+
readonly "+": readonly [{
|
|
538
|
+
readonly var: "$timestamp";
|
|
539
|
+
}, {
|
|
540
|
+
readonly var: "state.releaseWindowMs";
|
|
541
|
+
}];
|
|
542
|
+
};
|
|
543
|
+
}];
|
|
544
|
+
};
|
|
545
|
+
readonly dependencies: readonly [];
|
|
546
|
+
}, {
|
|
547
|
+
readonly from: "RELEASING";
|
|
548
|
+
readonly to: "RELEASED";
|
|
549
|
+
readonly eventName: "approve_release";
|
|
550
|
+
readonly guard: {
|
|
551
|
+
readonly or: readonly [{
|
|
552
|
+
readonly "===": readonly [{
|
|
553
|
+
readonly var: "event.agent";
|
|
554
|
+
}, {
|
|
555
|
+
readonly var: "state.depositor";
|
|
556
|
+
}];
|
|
557
|
+
}, {
|
|
558
|
+
readonly ">=": readonly [{
|
|
559
|
+
readonly var: "$timestamp";
|
|
560
|
+
}, {
|
|
561
|
+
readonly var: "state.releaseDeadline";
|
|
562
|
+
}];
|
|
563
|
+
}];
|
|
564
|
+
};
|
|
565
|
+
readonly effect: {
|
|
566
|
+
readonly merge: readonly [{
|
|
567
|
+
readonly var: "state";
|
|
568
|
+
}, {
|
|
569
|
+
readonly releasedAt: {
|
|
570
|
+
readonly var: "$timestamp";
|
|
571
|
+
};
|
|
572
|
+
readonly releasedTo: {
|
|
573
|
+
readonly var: "state.beneficiary";
|
|
574
|
+
};
|
|
575
|
+
}];
|
|
576
|
+
};
|
|
577
|
+
readonly dependencies: readonly [];
|
|
578
|
+
}, {
|
|
579
|
+
readonly from: "RELEASING";
|
|
580
|
+
readonly to: "DISPUTED";
|
|
581
|
+
readonly eventName: "dispute";
|
|
582
|
+
readonly guard: {
|
|
583
|
+
readonly and: readonly [{
|
|
584
|
+
readonly "===": readonly [{
|
|
585
|
+
readonly var: "event.agent";
|
|
586
|
+
}, {
|
|
587
|
+
readonly var: "state.depositor";
|
|
588
|
+
}];
|
|
589
|
+
}, {
|
|
590
|
+
readonly "<": readonly [{
|
|
591
|
+
readonly var: "$timestamp";
|
|
592
|
+
}, {
|
|
593
|
+
readonly var: "state.releaseDeadline";
|
|
594
|
+
}];
|
|
595
|
+
}];
|
|
596
|
+
};
|
|
597
|
+
readonly effect: {
|
|
598
|
+
readonly merge: readonly [{
|
|
599
|
+
readonly var: "state";
|
|
600
|
+
}, {
|
|
601
|
+
readonly disputedAt: {
|
|
602
|
+
readonly var: "$timestamp";
|
|
603
|
+
};
|
|
604
|
+
}];
|
|
605
|
+
};
|
|
606
|
+
readonly spawns: {
|
|
607
|
+
readonly sm: "Judiciary";
|
|
608
|
+
readonly initialData: {
|
|
609
|
+
readonly caseType: "escrow_dispute";
|
|
610
|
+
readonly plaintiff: {
|
|
611
|
+
readonly var: "state.depositor";
|
|
612
|
+
};
|
|
613
|
+
readonly defendant: {
|
|
614
|
+
readonly var: "state.beneficiary";
|
|
615
|
+
};
|
|
616
|
+
readonly claim: {
|
|
617
|
+
readonly escrowId: {
|
|
618
|
+
readonly var: "fiberId";
|
|
619
|
+
};
|
|
620
|
+
readonly amount: {
|
|
621
|
+
readonly var: "state.balance";
|
|
622
|
+
};
|
|
623
|
+
};
|
|
624
|
+
};
|
|
625
|
+
};
|
|
626
|
+
readonly dependencies: readonly [];
|
|
627
|
+
}, {
|
|
628
|
+
readonly from: "DISPUTED";
|
|
629
|
+
readonly to: "SPLIT";
|
|
630
|
+
readonly eventName: "ruling";
|
|
631
|
+
readonly guard: {
|
|
632
|
+
readonly var: "event.judicialRuling";
|
|
633
|
+
};
|
|
634
|
+
readonly effect: {
|
|
635
|
+
readonly merge: readonly [{
|
|
636
|
+
readonly var: "state";
|
|
637
|
+
}, {
|
|
638
|
+
readonly splits: {
|
|
639
|
+
readonly var: "event.splits";
|
|
640
|
+
};
|
|
641
|
+
readonly rulingId: {
|
|
642
|
+
readonly var: "event.rulingId";
|
|
643
|
+
};
|
|
644
|
+
}];
|
|
645
|
+
};
|
|
646
|
+
readonly dependencies: readonly [];
|
|
647
|
+
}, {
|
|
648
|
+
readonly from: "ACTIVE";
|
|
649
|
+
readonly to: "REFUNDED";
|
|
650
|
+
readonly eventName: "refund";
|
|
651
|
+
readonly guard: {
|
|
652
|
+
readonly or: readonly [{
|
|
653
|
+
readonly var: "event.mutualConsent";
|
|
654
|
+
}, {
|
|
655
|
+
readonly ">=": readonly [{
|
|
656
|
+
readonly var: "$timestamp";
|
|
657
|
+
}, {
|
|
658
|
+
readonly var: "state.expiresAt";
|
|
659
|
+
}];
|
|
660
|
+
}];
|
|
661
|
+
};
|
|
662
|
+
readonly effect: {
|
|
663
|
+
readonly merge: readonly [{
|
|
664
|
+
readonly var: "state";
|
|
665
|
+
}, {
|
|
666
|
+
readonly refundedAt: {
|
|
667
|
+
readonly var: "$timestamp";
|
|
668
|
+
};
|
|
669
|
+
}];
|
|
670
|
+
};
|
|
671
|
+
readonly dependencies: readonly [];
|
|
672
|
+
}];
|
|
673
|
+
};
|
|
674
|
+
};
|
|
675
|
+
export type ContractType = keyof typeof CONTRACTS_DEFINITIONS;
|
|
23
676
|
/**
|
|
24
|
-
* Get
|
|
25
|
-
|
|
26
|
-
export declare function getContractDefinition(): unknown;
|
|
27
|
-
/**
|
|
28
|
-
* Get the escrow state machine definition.
|
|
677
|
+
* Get a contract state machine definition by type.
|
|
678
|
+
* @param type - 'universal' | 'agreement' | 'escrow' (default: 'agreement')
|
|
29
679
|
*/
|
|
680
|
+
export declare function getContractDefinition(type?: ContractType): unknown;
|
|
681
|
+
/** @deprecated Use getContractDefinition('escrow') */
|
|
30
682
|
export declare function getEscrowDefinition(): unknown;
|