@ottochain/sdk 1.5.0 → 1.6.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 +6 -10
- package/dist/cjs/apps/{governance/state-machines/governance-legislature.json → contracts/state-machines/index.js} +381 -330
- package/dist/cjs/apps/corporate/index.js +12 -24
- package/dist/cjs/apps/corporate/state-machines/index.js +10246 -0
- package/dist/cjs/apps/governance/index.js +11 -22
- package/dist/cjs/apps/governance/state-machines/index.js +4755 -0
- package/dist/cjs/apps/identity/index.js +3 -6
- package/dist/{esm/apps/identity/state-machines/agent-identity.json → cjs/apps/identity/state-machines/index.js} +9 -2
- package/dist/cjs/apps/markets/index.js +2 -5
- package/dist/{esm/apps/markets/state-machines/market-universal.json → cjs/apps/markets/state-machines/index.js} +9 -2
- package/dist/cjs/apps/oracles/index.js +2 -5
- package/dist/{esm/apps/oracles/state-machines/oracle.json → cjs/apps/oracles/state-machines/index.js} +9 -2
- package/dist/cjs/ottochain/index.js +4 -1
- package/dist/cjs/ottochain/normalize.js +17 -3
- package/dist/cjs/ottochain/types.js +12 -0
- package/dist/esm/apps/contracts/index.js +2 -3
- package/dist/esm/apps/{governance/state-machines/governance-legislature.json → contracts/state-machines/index.js} +378 -330
- package/dist/esm/apps/corporate/index.js +2 -11
- package/dist/esm/apps/corporate/state-machines/index.js +10243 -0
- package/dist/esm/apps/governance/index.js +2 -10
- package/dist/esm/apps/governance/state-machines/index.js +4752 -0
- package/dist/esm/apps/identity/index.js +2 -2
- package/dist/{cjs/apps/identity/state-machines/agent-identity.json → esm/apps/identity/state-machines/index.js} +6 -2
- package/dist/esm/apps/markets/index.js +1 -1
- package/dist/{cjs/apps/markets/state-machines/market-universal.json → esm/apps/markets/state-machines/index.js} +6 -2
- package/dist/esm/apps/oracles/index.js +1 -1
- package/dist/{cjs/apps/oracles/state-machines/oracle.json → esm/apps/oracles/state-machines/index.js} +6 -2
- package/dist/esm/ottochain/index.js +2 -0
- package/dist/esm/ottochain/normalize.js +17 -3
- package/dist/esm/ottochain/types.js +11 -1
- package/dist/types/apps/contracts/state-machines/index.d.ts +549 -0
- package/dist/types/apps/corporate/state-machines/index.d.ts +9121 -0
- package/dist/types/apps/governance/state-machines/index.d.ts +3551 -0
- package/dist/types/apps/identity/state-machines/index.d.ts +206 -0
- package/dist/types/apps/markets/state-machines/index.d.ts +448 -0
- package/dist/types/apps/oracles/state-machines/index.d.ts +312 -0
- package/dist/types/ottochain/index.d.ts +2 -1
- package/dist/types/ottochain/normalize.d.ts +14 -0
- package/dist/types/ottochain/types.d.ts +9 -0
- package/package.json +4 -3
- package/dist/cjs/apps/contracts/state-machines/contract.json +0 -352
- package/dist/cjs/apps/contracts/state-machines/escrow.json +0 -354
- package/dist/cjs/apps/corporate/state-machines/corporate-board.json +0 -1064
- package/dist/cjs/apps/corporate/state-machines/corporate-bylaws.json +0 -751
- package/dist/cjs/apps/corporate/state-machines/corporate-committee.json +0 -957
- package/dist/cjs/apps/corporate/state-machines/corporate-compliance.json +0 -1293
- package/dist/cjs/apps/corporate/state-machines/corporate-entity.json +0 -861
- package/dist/cjs/apps/corporate/state-machines/corporate-officers.json +0 -843
- package/dist/cjs/apps/corporate/state-machines/corporate-proxy.json +0 -783
- package/dist/cjs/apps/corporate/state-machines/corporate-resolution.json +0 -1174
- package/dist/cjs/apps/corporate/state-machines/corporate-securities.json +0 -1215
- package/dist/cjs/apps/corporate/state-machines/corporate-shareholders.json +0 -1298
- package/dist/cjs/apps/governance/state-machines/dao-multisig.json +0 -667
- package/dist/cjs/apps/governance/state-machines/dao-single.json +0 -230
- package/dist/cjs/apps/governance/state-machines/dao-threshold.json +0 -624
- package/dist/cjs/apps/governance/state-machines/dao-token.json +0 -638
- package/dist/cjs/apps/governance/state-machines/governance-constitution.json +0 -357
- package/dist/cjs/apps/governance/state-machines/governance-executive.json +0 -387
- package/dist/cjs/apps/governance/state-machines/governance-judiciary.json +0 -558
- package/dist/cjs/apps/governance/state-machines/governance-simple.json +0 -625
- package/dist/esm/apps/contracts/state-machines/contract.json +0 -352
- package/dist/esm/apps/contracts/state-machines/escrow.json +0 -354
- package/dist/esm/apps/corporate/state-machines/corporate-board.json +0 -1064
- package/dist/esm/apps/corporate/state-machines/corporate-bylaws.json +0 -751
- package/dist/esm/apps/corporate/state-machines/corporate-committee.json +0 -957
- package/dist/esm/apps/corporate/state-machines/corporate-compliance.json +0 -1293
- package/dist/esm/apps/corporate/state-machines/corporate-entity.json +0 -861
- package/dist/esm/apps/corporate/state-machines/corporate-officers.json +0 -843
- package/dist/esm/apps/corporate/state-machines/corporate-proxy.json +0 -783
- package/dist/esm/apps/corporate/state-machines/corporate-resolution.json +0 -1174
- package/dist/esm/apps/corporate/state-machines/corporate-securities.json +0 -1215
- package/dist/esm/apps/corporate/state-machines/corporate-shareholders.json +0 -1298
- package/dist/esm/apps/governance/state-machines/dao-multisig.json +0 -667
- package/dist/esm/apps/governance/state-machines/dao-single.json +0 -230
- package/dist/esm/apps/governance/state-machines/dao-threshold.json +0 -624
- package/dist/esm/apps/governance/state-machines/dao-token.json +0 -638
- package/dist/esm/apps/governance/state-machines/governance-constitution.json +0 -357
- package/dist/esm/apps/governance/state-machines/governance-executive.json +0 -387
- package/dist/esm/apps/governance/state-machines/governance-judiciary.json +0 -558
- package/dist/esm/apps/governance/state-machines/governance-simple.json +0 -625
|
@@ -37,9 +37,9 @@ export const DEFAULT_REPUTATION_CONFIG = {
|
|
|
37
37
|
challengeThreshold: 5,
|
|
38
38
|
};
|
|
39
39
|
// ---------------------------------------------------------------------------
|
|
40
|
-
// State Machine JSON
|
|
40
|
+
// State Machine Definition (generated from JSON at build time)
|
|
41
41
|
// ---------------------------------------------------------------------------
|
|
42
|
-
import agentIdentityDef from './state-machines/
|
|
42
|
+
import { agentIdentityDef } from './state-machines/index.js';
|
|
43
43
|
/**
|
|
44
44
|
* Get the agent identity state machine definition.
|
|
45
45
|
*
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated from JSON state machine definitions.
|
|
3
|
+
* DO NOT EDIT - regenerate with: npm run prebuild
|
|
4
|
+
*/
|
|
5
|
+
export const agentIdentityDef = {
|
|
2
6
|
"metadata": {
|
|
3
7
|
"name": "AgentIdentity",
|
|
4
8
|
"description": "Decentralized agent identity with reputation tracking and lifecycle management",
|
|
@@ -267,4 +271,4 @@
|
|
|
267
271
|
"dependencies": []
|
|
268
272
|
}
|
|
269
273
|
]
|
|
270
|
-
}
|
|
274
|
+
};
|
|
@@ -22,7 +22,7 @@ export { MarketType, MarketState, Commitment, Resolution, Market, CreateMarketRe
|
|
|
22
22
|
// ---------------------------------------------------------------------------
|
|
23
23
|
// State Machine JSON Definitions
|
|
24
24
|
// ---------------------------------------------------------------------------
|
|
25
|
-
import marketUniversalDef from './state-machines/
|
|
25
|
+
import { marketUniversalDef } from './state-machines/index.js';
|
|
26
26
|
export const MARKET_DEFINITIONS = {
|
|
27
27
|
Universal: marketUniversalDef,
|
|
28
28
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated from JSON state machine definitions.
|
|
3
|
+
* DO NOT EDIT - regenerate with: npm run prebuild
|
|
4
|
+
*/
|
|
5
|
+
export const marketUniversalDef = {
|
|
2
6
|
"metadata": {
|
|
3
7
|
"name": "Market",
|
|
4
8
|
"description": "Universal market state machine: predictions, auctions, crowdfunding, group buys",
|
|
@@ -618,4 +622,4 @@
|
|
|
618
622
|
"dependencies": []
|
|
619
623
|
}
|
|
620
624
|
]
|
|
621
|
-
}
|
|
625
|
+
};
|
|
@@ -22,7 +22,7 @@ export { OracleState, OracleReputation, SlashingEvent, Oracle, RegisterOracleReq
|
|
|
22
22
|
// ---------------------------------------------------------------------------
|
|
23
23
|
// State Machine JSON Definitions
|
|
24
24
|
// ---------------------------------------------------------------------------
|
|
25
|
-
import oracleDef from './state-machines/
|
|
25
|
+
import { oracleDef } from './state-machines/index.js';
|
|
26
26
|
export const ORACLE_DEFINITIONS = {
|
|
27
27
|
Oracle: oracleDef,
|
|
28
28
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated from JSON state machine definitions.
|
|
3
|
+
* DO NOT EDIT - regenerate with: npm run prebuild
|
|
4
|
+
*/
|
|
5
|
+
export const oracleDef = {
|
|
2
6
|
"metadata": {
|
|
3
7
|
"name": "Oracle",
|
|
4
8
|
"description": "Oracle registration, reputation, and slashing state machine",
|
|
@@ -405,4 +409,4 @@
|
|
|
405
409
|
"dependencies": []
|
|
406
410
|
}
|
|
407
411
|
]
|
|
408
|
-
}
|
|
412
|
+
};
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
// Re-export generated protobuf types (for binary encoding)
|
|
9
9
|
export * as proto from '../generated/index.js';
|
|
10
|
+
// Runtime message type validation
|
|
11
|
+
export { OTTOCHAIN_MESSAGE_TYPES } from './types.js';
|
|
10
12
|
export { decodeOnChainState, getSnapshotOnChainState, getLatestOnChainState, getLogsForFiber, getEventReceipts, getScriptInvocations, extractOnChainState, } from './snapshot.js';
|
|
11
13
|
export { MetagraphClient } from './metagraph-client.js';
|
|
12
14
|
// Transaction helpers (state machine payloads, signing)
|
|
@@ -101,22 +101,36 @@ export function normalizeCreateStateMachine(msg) {
|
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Normalize a TransitionStateMachine message for wire format
|
|
104
|
+
*
|
|
105
|
+
* Scala TransitionStateMachine schema:
|
|
106
|
+
* fiberId: UUID (required)
|
|
107
|
+
* eventName: String (required)
|
|
108
|
+
* payload: JsonLogicValue (required)
|
|
109
|
+
* targetSequenceNumber: FiberOrdinal (required)
|
|
110
|
+
*
|
|
111
|
+
* All fields are required — no Option types, so no null normalization needed.
|
|
104
112
|
*/
|
|
105
113
|
export function normalizeTransitionStateMachine(msg) {
|
|
106
114
|
return {
|
|
107
115
|
fiberId: msg.fiberId,
|
|
108
116
|
eventName: msg.eventName,
|
|
109
|
-
|
|
110
|
-
|
|
117
|
+
payload: msg.payload,
|
|
118
|
+
targetSequenceNumber: msg.targetSequenceNumber,
|
|
111
119
|
};
|
|
112
120
|
}
|
|
113
121
|
/**
|
|
114
122
|
* Normalize an ArchiveStateMachine message for wire format
|
|
123
|
+
*
|
|
124
|
+
* Scala ArchiveStateMachine schema:
|
|
125
|
+
* fiberId: UUID (required)
|
|
126
|
+
* targetSequenceNumber: FiberOrdinal (required)
|
|
127
|
+
*
|
|
128
|
+
* All fields are required — no Option types, so no null normalization needed.
|
|
115
129
|
*/
|
|
116
130
|
export function normalizeArchiveStateMachine(msg) {
|
|
117
131
|
return {
|
|
118
132
|
fiberId: msg.fiberId,
|
|
119
|
-
|
|
133
|
+
targetSequenceNumber: msg.targetSequenceNumber,
|
|
120
134
|
};
|
|
121
135
|
}
|
|
122
136
|
/**
|
|
@@ -7,4 +7,14 @@
|
|
|
7
7
|
* @see modules/models/src/main/scala/xyz/kd5ujc/schema/
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Names of all valid OttochainMessage types.
|
|
12
|
+
* Use this for runtime validation (e.g., in API routes).
|
|
13
|
+
*/
|
|
14
|
+
export const OTTOCHAIN_MESSAGE_TYPES = [
|
|
15
|
+
'CreateStateMachine',
|
|
16
|
+
'TransitionStateMachine',
|
|
17
|
+
'ArchiveStateMachine',
|
|
18
|
+
'CreateScript',
|
|
19
|
+
'InvokeScript',
|
|
20
|
+
];
|
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated from JSON state machine definitions.
|
|
3
|
+
* DO NOT EDIT - regenerate with: npm run prebuild
|
|
4
|
+
*/
|
|
5
|
+
export declare const contractDef: {
|
|
6
|
+
readonly metadata: {
|
|
7
|
+
readonly name: "Contract";
|
|
8
|
+
readonly description: "Agreement between two agents with completion attestation and dispute resolution";
|
|
9
|
+
readonly version: "1.0.0";
|
|
10
|
+
readonly crossReferences: {
|
|
11
|
+
readonly proposerIdentityId: "Links to proposer's AgentIdentity fiber";
|
|
12
|
+
readonly counterpartyIdentityId: "Links to counterparty's AgentIdentity fiber";
|
|
13
|
+
readonly escrowId: "Links to Escrow if payment is escrowed";
|
|
14
|
+
readonly arbitrationPoolId: "Links to ArbitrationPool for dispute resolution";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
readonly states: {
|
|
18
|
+
readonly PROPOSED: {
|
|
19
|
+
readonly id: "PROPOSED";
|
|
20
|
+
readonly isFinal: false;
|
|
21
|
+
readonly metadata: null;
|
|
22
|
+
};
|
|
23
|
+
readonly ACTIVE: {
|
|
24
|
+
readonly id: "ACTIVE";
|
|
25
|
+
readonly isFinal: false;
|
|
26
|
+
readonly metadata: null;
|
|
27
|
+
};
|
|
28
|
+
readonly COMPLETED: {
|
|
29
|
+
readonly id: "COMPLETED";
|
|
30
|
+
readonly isFinal: true;
|
|
31
|
+
readonly metadata: null;
|
|
32
|
+
};
|
|
33
|
+
readonly DISPUTED: {
|
|
34
|
+
readonly id: "DISPUTED";
|
|
35
|
+
readonly isFinal: false;
|
|
36
|
+
readonly metadata: null;
|
|
37
|
+
};
|
|
38
|
+
readonly REJECTED: {
|
|
39
|
+
readonly id: "REJECTED";
|
|
40
|
+
readonly isFinal: true;
|
|
41
|
+
readonly metadata: null;
|
|
42
|
+
};
|
|
43
|
+
readonly CANCELLED: {
|
|
44
|
+
readonly id: "CANCELLED";
|
|
45
|
+
readonly isFinal: true;
|
|
46
|
+
readonly metadata: null;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
readonly initialState: "PROPOSED";
|
|
50
|
+
readonly transitions: readonly [{
|
|
51
|
+
readonly from: "PROPOSED";
|
|
52
|
+
readonly to: "ACTIVE";
|
|
53
|
+
readonly eventName: "accept";
|
|
54
|
+
readonly guard: {
|
|
55
|
+
readonly "===": readonly [{
|
|
56
|
+
readonly var: "event.agent";
|
|
57
|
+
}, {
|
|
58
|
+
readonly var: "state.counterparty";
|
|
59
|
+
}];
|
|
60
|
+
};
|
|
61
|
+
readonly effect: {
|
|
62
|
+
readonly merge: readonly [{
|
|
63
|
+
readonly var: "state";
|
|
64
|
+
}, {
|
|
65
|
+
readonly status: "ACTIVE";
|
|
66
|
+
readonly acceptedAt: {
|
|
67
|
+
readonly var: "$timestamp";
|
|
68
|
+
};
|
|
69
|
+
}];
|
|
70
|
+
};
|
|
71
|
+
readonly dependencies: readonly [];
|
|
72
|
+
}, {
|
|
73
|
+
readonly from: "PROPOSED";
|
|
74
|
+
readonly to: "REJECTED";
|
|
75
|
+
readonly eventName: "reject";
|
|
76
|
+
readonly guard: {
|
|
77
|
+
readonly "===": readonly [{
|
|
78
|
+
readonly var: "event.agent";
|
|
79
|
+
}, {
|
|
80
|
+
readonly var: "state.counterparty";
|
|
81
|
+
}];
|
|
82
|
+
};
|
|
83
|
+
readonly effect: {
|
|
84
|
+
readonly merge: readonly [{
|
|
85
|
+
readonly var: "state";
|
|
86
|
+
}, {
|
|
87
|
+
readonly status: "REJECTED";
|
|
88
|
+
readonly rejectedAt: {
|
|
89
|
+
readonly var: "$timestamp";
|
|
90
|
+
};
|
|
91
|
+
readonly rejectReason: {
|
|
92
|
+
readonly var: "event.reason";
|
|
93
|
+
};
|
|
94
|
+
}];
|
|
95
|
+
};
|
|
96
|
+
readonly dependencies: readonly [];
|
|
97
|
+
}, {
|
|
98
|
+
readonly from: "PROPOSED";
|
|
99
|
+
readonly to: "CANCELLED";
|
|
100
|
+
readonly eventName: "cancel";
|
|
101
|
+
readonly guard: {
|
|
102
|
+
readonly "===": readonly [{
|
|
103
|
+
readonly var: "event.agent";
|
|
104
|
+
}, {
|
|
105
|
+
readonly var: "state.proposer";
|
|
106
|
+
}];
|
|
107
|
+
};
|
|
108
|
+
readonly effect: {
|
|
109
|
+
readonly merge: readonly [{
|
|
110
|
+
readonly var: "state";
|
|
111
|
+
}, {
|
|
112
|
+
readonly status: "CANCELLED";
|
|
113
|
+
readonly cancelledAt: {
|
|
114
|
+
readonly var: "$timestamp";
|
|
115
|
+
};
|
|
116
|
+
}];
|
|
117
|
+
};
|
|
118
|
+
readonly dependencies: readonly [];
|
|
119
|
+
}, {
|
|
120
|
+
readonly from: "ACTIVE";
|
|
121
|
+
readonly to: "ACTIVE";
|
|
122
|
+
readonly eventName: "submit_completion";
|
|
123
|
+
readonly guard: {
|
|
124
|
+
readonly and: readonly [{
|
|
125
|
+
readonly or: readonly [{
|
|
126
|
+
readonly "===": readonly [{
|
|
127
|
+
readonly var: "event.agent";
|
|
128
|
+
}, {
|
|
129
|
+
readonly var: "state.proposer";
|
|
130
|
+
}];
|
|
131
|
+
}, {
|
|
132
|
+
readonly "===": readonly [{
|
|
133
|
+
readonly var: "event.agent";
|
|
134
|
+
}, {
|
|
135
|
+
readonly var: "state.counterparty";
|
|
136
|
+
}];
|
|
137
|
+
}];
|
|
138
|
+
}, {
|
|
139
|
+
readonly "!": readonly [{
|
|
140
|
+
readonly in: readonly [{
|
|
141
|
+
readonly var: "event.agent";
|
|
142
|
+
}, {
|
|
143
|
+
readonly map: readonly [{
|
|
144
|
+
readonly var: "state.completions";
|
|
145
|
+
}, {
|
|
146
|
+
readonly var: "agent";
|
|
147
|
+
}];
|
|
148
|
+
}];
|
|
149
|
+
}];
|
|
150
|
+
}];
|
|
151
|
+
};
|
|
152
|
+
readonly effect: {
|
|
153
|
+
readonly merge: readonly [{
|
|
154
|
+
readonly var: "state";
|
|
155
|
+
}, {
|
|
156
|
+
readonly completions: {
|
|
157
|
+
readonly cat: readonly [{
|
|
158
|
+
readonly var: "state.completions";
|
|
159
|
+
}, readonly [{
|
|
160
|
+
readonly agent: {
|
|
161
|
+
readonly var: "event.agent";
|
|
162
|
+
};
|
|
163
|
+
readonly proof: {
|
|
164
|
+
readonly var: "event.proof";
|
|
165
|
+
};
|
|
166
|
+
readonly submittedAt: {
|
|
167
|
+
readonly var: "$timestamp";
|
|
168
|
+
};
|
|
169
|
+
}]];
|
|
170
|
+
};
|
|
171
|
+
}];
|
|
172
|
+
};
|
|
173
|
+
readonly dependencies: readonly [];
|
|
174
|
+
}, {
|
|
175
|
+
readonly from: "ACTIVE";
|
|
176
|
+
readonly to: "COMPLETED";
|
|
177
|
+
readonly eventName: "finalize";
|
|
178
|
+
readonly guard: {
|
|
179
|
+
readonly ">=": readonly [{
|
|
180
|
+
readonly size: {
|
|
181
|
+
readonly var: "state.completions";
|
|
182
|
+
};
|
|
183
|
+
}, 2];
|
|
184
|
+
};
|
|
185
|
+
readonly effect: {
|
|
186
|
+
readonly merge: readonly [{
|
|
187
|
+
readonly var: "state";
|
|
188
|
+
}, {
|
|
189
|
+
readonly status: "COMPLETED";
|
|
190
|
+
readonly completedAt: {
|
|
191
|
+
readonly var: "$timestamp";
|
|
192
|
+
};
|
|
193
|
+
}];
|
|
194
|
+
};
|
|
195
|
+
readonly dependencies: readonly [];
|
|
196
|
+
}, {
|
|
197
|
+
readonly from: "ACTIVE";
|
|
198
|
+
readonly to: "DISPUTED";
|
|
199
|
+
readonly eventName: "dispute";
|
|
200
|
+
readonly guard: {
|
|
201
|
+
readonly or: readonly [{
|
|
202
|
+
readonly "===": readonly [{
|
|
203
|
+
readonly var: "event.agent";
|
|
204
|
+
}, {
|
|
205
|
+
readonly var: "state.proposer";
|
|
206
|
+
}];
|
|
207
|
+
}, {
|
|
208
|
+
readonly "===": readonly [{
|
|
209
|
+
readonly var: "event.agent";
|
|
210
|
+
}, {
|
|
211
|
+
readonly var: "state.counterparty";
|
|
212
|
+
}];
|
|
213
|
+
}];
|
|
214
|
+
};
|
|
215
|
+
readonly effect: {
|
|
216
|
+
readonly merge: readonly [{
|
|
217
|
+
readonly var: "state";
|
|
218
|
+
}, {
|
|
219
|
+
readonly status: "DISPUTED";
|
|
220
|
+
readonly disputedAt: {
|
|
221
|
+
readonly var: "$timestamp";
|
|
222
|
+
};
|
|
223
|
+
readonly disputeReason: {
|
|
224
|
+
readonly var: "event.reason";
|
|
225
|
+
};
|
|
226
|
+
readonly disputedBy: {
|
|
227
|
+
readonly var: "event.agent";
|
|
228
|
+
};
|
|
229
|
+
}];
|
|
230
|
+
};
|
|
231
|
+
readonly dependencies: readonly [];
|
|
232
|
+
}, {
|
|
233
|
+
readonly from: "DISPUTED";
|
|
234
|
+
readonly to: "COMPLETED";
|
|
235
|
+
readonly eventName: "resolve";
|
|
236
|
+
readonly guard: {
|
|
237
|
+
readonly or: readonly [{
|
|
238
|
+
readonly var: "event.judicialRuling";
|
|
239
|
+
}, {
|
|
240
|
+
readonly and: readonly [{
|
|
241
|
+
readonly "===": readonly [{
|
|
242
|
+
readonly var: "event.proposerApproves";
|
|
243
|
+
}, true];
|
|
244
|
+
}, {
|
|
245
|
+
readonly "===": readonly [{
|
|
246
|
+
readonly var: "event.counterpartyApproves";
|
|
247
|
+
}, true];
|
|
248
|
+
}];
|
|
249
|
+
}];
|
|
250
|
+
};
|
|
251
|
+
readonly effect: {
|
|
252
|
+
readonly merge: readonly [{
|
|
253
|
+
readonly var: "state";
|
|
254
|
+
}, {
|
|
255
|
+
readonly status: "COMPLETED";
|
|
256
|
+
readonly resolvedAt: {
|
|
257
|
+
readonly var: "$timestamp";
|
|
258
|
+
};
|
|
259
|
+
readonly resolution: {
|
|
260
|
+
readonly var: "event.resolution";
|
|
261
|
+
};
|
|
262
|
+
readonly rulingId: {
|
|
263
|
+
readonly var: "event.rulingId";
|
|
264
|
+
};
|
|
265
|
+
}];
|
|
266
|
+
};
|
|
267
|
+
readonly dependencies: readonly [];
|
|
268
|
+
}];
|
|
269
|
+
};
|
|
270
|
+
export declare const escrowDef: {
|
|
271
|
+
readonly metadata: {
|
|
272
|
+
readonly name: "Escrow";
|
|
273
|
+
readonly description: "Asset custody during multi-party transactions with conditional release";
|
|
274
|
+
readonly version: "1.0.0";
|
|
275
|
+
readonly crossReferences: {
|
|
276
|
+
readonly contractId: "Links to Contract SM that created this escrow";
|
|
277
|
+
readonly marketId: "Links to Market SM for market-based escrow";
|
|
278
|
+
readonly insuranceId: "Links to Insurance SM for protected escrow";
|
|
279
|
+
readonly arbitrationPoolId: "Links to ArbitrationPool for dispute resolution";
|
|
280
|
+
readonly treasuryId: "Links to Treasury for fee collection";
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
readonly states: {
|
|
284
|
+
readonly CREATED: {
|
|
285
|
+
readonly id: "CREATED";
|
|
286
|
+
readonly isFinal: false;
|
|
287
|
+
readonly metadata: null;
|
|
288
|
+
};
|
|
289
|
+
readonly FUNDED: {
|
|
290
|
+
readonly id: "FUNDED";
|
|
291
|
+
readonly isFinal: false;
|
|
292
|
+
readonly metadata: null;
|
|
293
|
+
};
|
|
294
|
+
readonly ACTIVE: {
|
|
295
|
+
readonly id: "ACTIVE";
|
|
296
|
+
readonly isFinal: false;
|
|
297
|
+
readonly metadata: null;
|
|
298
|
+
};
|
|
299
|
+
readonly RELEASING: {
|
|
300
|
+
readonly id: "RELEASING";
|
|
301
|
+
readonly isFinal: false;
|
|
302
|
+
readonly metadata: null;
|
|
303
|
+
};
|
|
304
|
+
readonly DISPUTED: {
|
|
305
|
+
readonly id: "DISPUTED";
|
|
306
|
+
readonly isFinal: false;
|
|
307
|
+
readonly metadata: null;
|
|
308
|
+
};
|
|
309
|
+
readonly RELEASED: {
|
|
310
|
+
readonly id: "RELEASED";
|
|
311
|
+
readonly isFinal: true;
|
|
312
|
+
readonly metadata: null;
|
|
313
|
+
};
|
|
314
|
+
readonly REFUNDED: {
|
|
315
|
+
readonly id: "REFUNDED";
|
|
316
|
+
readonly isFinal: true;
|
|
317
|
+
readonly metadata: null;
|
|
318
|
+
};
|
|
319
|
+
readonly SPLIT: {
|
|
320
|
+
readonly id: "SPLIT";
|
|
321
|
+
readonly isFinal: true;
|
|
322
|
+
readonly metadata: null;
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
readonly initialState: "CREATED";
|
|
326
|
+
readonly transitions: readonly [{
|
|
327
|
+
readonly from: "CREATED";
|
|
328
|
+
readonly to: "FUNDED";
|
|
329
|
+
readonly eventName: "deposit";
|
|
330
|
+
readonly guard: {
|
|
331
|
+
readonly and: readonly [{
|
|
332
|
+
readonly "===": readonly [{
|
|
333
|
+
readonly var: "event.agent";
|
|
334
|
+
}, {
|
|
335
|
+
readonly var: "state.depositor";
|
|
336
|
+
}];
|
|
337
|
+
}, {
|
|
338
|
+
readonly ">=": readonly [{
|
|
339
|
+
readonly var: "event.amount";
|
|
340
|
+
}, {
|
|
341
|
+
readonly var: "state.requiredAmount";
|
|
342
|
+
}];
|
|
343
|
+
}];
|
|
344
|
+
};
|
|
345
|
+
readonly effect: {
|
|
346
|
+
readonly merge: readonly [{
|
|
347
|
+
readonly var: "state";
|
|
348
|
+
}, {
|
|
349
|
+
readonly balance: {
|
|
350
|
+
readonly var: "event.amount";
|
|
351
|
+
};
|
|
352
|
+
readonly fundedAt: {
|
|
353
|
+
readonly var: "$timestamp";
|
|
354
|
+
};
|
|
355
|
+
}];
|
|
356
|
+
};
|
|
357
|
+
readonly dependencies: readonly [];
|
|
358
|
+
}, {
|
|
359
|
+
readonly from: "FUNDED";
|
|
360
|
+
readonly to: "ACTIVE";
|
|
361
|
+
readonly eventName: "activate";
|
|
362
|
+
readonly guard: {
|
|
363
|
+
readonly or: readonly [{
|
|
364
|
+
readonly "===": readonly [{
|
|
365
|
+
readonly var: "event.agent";
|
|
366
|
+
}, {
|
|
367
|
+
readonly var: "state.beneficiary";
|
|
368
|
+
}];
|
|
369
|
+
}, {
|
|
370
|
+
readonly var: "state.autoActivate";
|
|
371
|
+
}];
|
|
372
|
+
};
|
|
373
|
+
readonly effect: {
|
|
374
|
+
readonly merge: readonly [{
|
|
375
|
+
readonly var: "state";
|
|
376
|
+
}, {
|
|
377
|
+
readonly activatedAt: {
|
|
378
|
+
readonly var: "$timestamp";
|
|
379
|
+
};
|
|
380
|
+
}];
|
|
381
|
+
};
|
|
382
|
+
readonly dependencies: readonly [];
|
|
383
|
+
}, {
|
|
384
|
+
readonly from: "ACTIVE";
|
|
385
|
+
readonly to: "RELEASING";
|
|
386
|
+
readonly eventName: "request_release";
|
|
387
|
+
readonly guard: {
|
|
388
|
+
readonly "===": readonly [{
|
|
389
|
+
readonly var: "event.agent";
|
|
390
|
+
}, {
|
|
391
|
+
readonly var: "state.beneficiary";
|
|
392
|
+
}];
|
|
393
|
+
};
|
|
394
|
+
readonly effect: {
|
|
395
|
+
readonly merge: readonly [{
|
|
396
|
+
readonly var: "state";
|
|
397
|
+
}, {
|
|
398
|
+
readonly releaseRequest: {
|
|
399
|
+
readonly requestedBy: {
|
|
400
|
+
readonly var: "event.agent";
|
|
401
|
+
};
|
|
402
|
+
readonly amount: {
|
|
403
|
+
readonly var: "event.amount";
|
|
404
|
+
};
|
|
405
|
+
readonly reason: {
|
|
406
|
+
readonly var: "event.reason";
|
|
407
|
+
};
|
|
408
|
+
readonly requestedAt: {
|
|
409
|
+
readonly var: "$timestamp";
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
readonly releaseDeadline: {
|
|
413
|
+
readonly "+": readonly [{
|
|
414
|
+
readonly var: "$timestamp";
|
|
415
|
+
}, {
|
|
416
|
+
readonly var: "state.releaseWindowMs";
|
|
417
|
+
}];
|
|
418
|
+
};
|
|
419
|
+
}];
|
|
420
|
+
};
|
|
421
|
+
readonly dependencies: readonly [];
|
|
422
|
+
}, {
|
|
423
|
+
readonly from: "RELEASING";
|
|
424
|
+
readonly to: "RELEASED";
|
|
425
|
+
readonly eventName: "approve_release";
|
|
426
|
+
readonly guard: {
|
|
427
|
+
readonly or: readonly [{
|
|
428
|
+
readonly "===": readonly [{
|
|
429
|
+
readonly var: "event.agent";
|
|
430
|
+
}, {
|
|
431
|
+
readonly var: "state.depositor";
|
|
432
|
+
}];
|
|
433
|
+
}, {
|
|
434
|
+
readonly ">=": readonly [{
|
|
435
|
+
readonly var: "$timestamp";
|
|
436
|
+
}, {
|
|
437
|
+
readonly var: "state.releaseDeadline";
|
|
438
|
+
}];
|
|
439
|
+
}];
|
|
440
|
+
};
|
|
441
|
+
readonly effect: {
|
|
442
|
+
readonly merge: readonly [{
|
|
443
|
+
readonly var: "state";
|
|
444
|
+
}, {
|
|
445
|
+
readonly releasedAt: {
|
|
446
|
+
readonly var: "$timestamp";
|
|
447
|
+
};
|
|
448
|
+
readonly releasedTo: {
|
|
449
|
+
readonly var: "state.beneficiary";
|
|
450
|
+
};
|
|
451
|
+
}];
|
|
452
|
+
};
|
|
453
|
+
readonly dependencies: readonly [];
|
|
454
|
+
}, {
|
|
455
|
+
readonly from: "RELEASING";
|
|
456
|
+
readonly to: "DISPUTED";
|
|
457
|
+
readonly eventName: "dispute";
|
|
458
|
+
readonly guard: {
|
|
459
|
+
readonly and: readonly [{
|
|
460
|
+
readonly "===": readonly [{
|
|
461
|
+
readonly var: "event.agent";
|
|
462
|
+
}, {
|
|
463
|
+
readonly var: "state.depositor";
|
|
464
|
+
}];
|
|
465
|
+
}, {
|
|
466
|
+
readonly "<": readonly [{
|
|
467
|
+
readonly var: "$timestamp";
|
|
468
|
+
}, {
|
|
469
|
+
readonly var: "state.releaseDeadline";
|
|
470
|
+
}];
|
|
471
|
+
}];
|
|
472
|
+
};
|
|
473
|
+
readonly effect: {
|
|
474
|
+
readonly merge: readonly [{
|
|
475
|
+
readonly var: "state";
|
|
476
|
+
}, {
|
|
477
|
+
readonly disputedAt: {
|
|
478
|
+
readonly var: "$timestamp";
|
|
479
|
+
};
|
|
480
|
+
}];
|
|
481
|
+
};
|
|
482
|
+
readonly spawns: {
|
|
483
|
+
readonly sm: "Judiciary";
|
|
484
|
+
readonly initialData: {
|
|
485
|
+
readonly caseType: "escrow_dispute";
|
|
486
|
+
readonly plaintiff: {
|
|
487
|
+
readonly var: "state.depositor";
|
|
488
|
+
};
|
|
489
|
+
readonly defendant: {
|
|
490
|
+
readonly var: "state.beneficiary";
|
|
491
|
+
};
|
|
492
|
+
readonly claim: {
|
|
493
|
+
readonly escrowId: {
|
|
494
|
+
readonly var: "fiberId";
|
|
495
|
+
};
|
|
496
|
+
readonly amount: {
|
|
497
|
+
readonly var: "state.balance";
|
|
498
|
+
};
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
};
|
|
502
|
+
readonly dependencies: readonly [];
|
|
503
|
+
}, {
|
|
504
|
+
readonly from: "DISPUTED";
|
|
505
|
+
readonly to: "SPLIT";
|
|
506
|
+
readonly eventName: "ruling";
|
|
507
|
+
readonly guard: {
|
|
508
|
+
readonly var: "event.judicialRuling";
|
|
509
|
+
};
|
|
510
|
+
readonly effect: {
|
|
511
|
+
readonly merge: readonly [{
|
|
512
|
+
readonly var: "state";
|
|
513
|
+
}, {
|
|
514
|
+
readonly splits: {
|
|
515
|
+
readonly var: "event.splits";
|
|
516
|
+
};
|
|
517
|
+
readonly rulingId: {
|
|
518
|
+
readonly var: "event.rulingId";
|
|
519
|
+
};
|
|
520
|
+
}];
|
|
521
|
+
};
|
|
522
|
+
readonly dependencies: readonly [];
|
|
523
|
+
}, {
|
|
524
|
+
readonly from: "ACTIVE";
|
|
525
|
+
readonly to: "REFUNDED";
|
|
526
|
+
readonly eventName: "refund";
|
|
527
|
+
readonly guard: {
|
|
528
|
+
readonly or: readonly [{
|
|
529
|
+
readonly var: "event.mutualConsent";
|
|
530
|
+
}, {
|
|
531
|
+
readonly ">=": readonly [{
|
|
532
|
+
readonly var: "$timestamp";
|
|
533
|
+
}, {
|
|
534
|
+
readonly var: "state.expiresAt";
|
|
535
|
+
}];
|
|
536
|
+
}];
|
|
537
|
+
};
|
|
538
|
+
readonly effect: {
|
|
539
|
+
readonly merge: readonly [{
|
|
540
|
+
readonly var: "state";
|
|
541
|
+
}, {
|
|
542
|
+
readonly refundedAt: {
|
|
543
|
+
readonly var: "$timestamp";
|
|
544
|
+
};
|
|
545
|
+
}];
|
|
546
|
+
};
|
|
547
|
+
readonly dependencies: readonly [];
|
|
548
|
+
}];
|
|
549
|
+
};
|