@ottochain/sdk 1.6.0 → 1.7.0-beta.2
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/constants.js +28 -14
- package/dist/cjs/apps/identity/index.js +54 -23
- 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/cjs/generated/google/protobuf/struct.js +1 -1
- package/dist/cjs/generated/google/protobuf/timestamp.js +1 -1
- package/dist/cjs/generated/index.js +19 -22
- package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +1 -1
- package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
- package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +1 -1
- package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +12 -12
- package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +1689 -0
- package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +1 -1
- package/dist/cjs/generated/ottochain/v1/common.js +1 -1
- package/dist/cjs/generated/ottochain/v1/fiber.js +1 -1
- package/dist/cjs/generated/ottochain/v1/messages.js +1 -1
- package/dist/cjs/generated/ottochain/v1/records.js +1 -1
- 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/constants.js +27 -13
- package/dist/esm/apps/identity/index.js +32 -15
- 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/esm/generated/google/protobuf/struct.js +1 -1
- package/dist/esm/generated/google/protobuf/timestamp.js +1 -1
- package/dist/esm/generated/index.js +2 -3
- package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +1 -1
- package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
- package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +1 -1
- package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +2 -2
- package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +1677 -0
- package/dist/esm/generated/ottochain/apps/markets/v1/market.js +1 -1
- package/dist/esm/generated/ottochain/v1/common.js +1 -1
- package/dist/esm/generated/ottochain/v1/fiber.js +1 -1
- package/dist/esm/generated/ottochain/v1/messages.js +1 -1
- package/dist/esm/generated/ottochain/v1/records.js +1 -1
- 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/constants.d.ts +10 -5
- package/dist/types/apps/identity/index.d.ts +620 -12
- 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/dist/types/generated/index.d.ts +1 -2
- package/dist/types/generated/ottochain/apps/identity/v1/attestation.d.ts +1 -1
- package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +208 -0
- 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/cjs/generated/ottochain/apps/identity/v1/agent.js +0 -619
- package/dist/cjs/generated/ottochain/apps/oracles/v1/oracle.js +0 -1223
- package/dist/esm/apps/oracles/index.js +0 -42
- package/dist/esm/apps/oracles/state-machines/index.js +0 -412
- package/dist/esm/generated/ottochain/apps/identity/v1/agent.js +0 -610
- package/dist/esm/generated/ottochain/apps/oracles/v1/oracle.js +0 -1217
- package/dist/types/apps/oracles/index.d.ts +0 -34
- package/dist/types/apps/oracles/state-machines/index.d.ts +0 -312
- package/dist/types/generated/ottochain/apps/identity/v1/agent.d.ts +0 -94
- package/dist/types/generated/ottochain/apps/oracles/v1/oracle.d.ts +0 -150
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Oracles Application
|
|
3
|
-
*
|
|
4
|
-
* Types and utilities for oracles on OttoChain.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import {
|
|
9
|
-
* OracleState,
|
|
10
|
-
* Oracle,
|
|
11
|
-
* getOracleDefinition,
|
|
12
|
-
* DEFAULT_ORACLE_CONFIG
|
|
13
|
-
* } from '@ottochain/sdk/apps/oracles';
|
|
14
|
-
*
|
|
15
|
-
* const oracleDef = getOracleDefinition();
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @packageDocumentation
|
|
19
|
-
*/
|
|
20
|
-
export { OracleState, OracleReputation, SlashingEvent, Oracle, RegisterOracleRequest, ActivateOracleRequest, AddStakeRequest, WithdrawStakeRequest, SlashOracleRequest, WithdrawOracleRequest, OracleDefinition, oracleStateFromJSON, oracleStateToJSON, } from '../../generated/ottochain/apps/oracles/v1/oracle.js';
|
|
21
|
-
export type OracleDefinitionType = 'Oracle';
|
|
22
|
-
export declare const ORACLE_DEFINITIONS: Record<OracleDefinitionType, unknown>;
|
|
23
|
-
/**
|
|
24
|
-
* Get the oracle state machine definition.
|
|
25
|
-
*/
|
|
26
|
-
export declare function getOracleDefinition(type?: OracleDefinitionType): unknown;
|
|
27
|
-
/**
|
|
28
|
-
* Default oracle configuration.
|
|
29
|
-
*/
|
|
30
|
-
export declare const DEFAULT_ORACLE_CONFIG: {
|
|
31
|
-
minStake: number;
|
|
32
|
-
baseReputation: number;
|
|
33
|
-
reputationDecay: number;
|
|
34
|
-
};
|
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-generated from JSON state machine definitions.
|
|
3
|
-
* DO NOT EDIT - regenerate with: npm run prebuild
|
|
4
|
-
*/
|
|
5
|
-
export declare const oracleDef: {
|
|
6
|
-
readonly metadata: {
|
|
7
|
-
readonly name: "Oracle";
|
|
8
|
-
readonly description: "Oracle registration, reputation, and slashing state machine";
|
|
9
|
-
readonly version: "1.0.0";
|
|
10
|
-
};
|
|
11
|
-
readonly states: {
|
|
12
|
-
readonly UNREGISTERED: {
|
|
13
|
-
readonly id: "UNREGISTERED";
|
|
14
|
-
readonly isFinal: false;
|
|
15
|
-
readonly metadata: null;
|
|
16
|
-
};
|
|
17
|
-
readonly REGISTERED: {
|
|
18
|
-
readonly id: "REGISTERED";
|
|
19
|
-
readonly isFinal: false;
|
|
20
|
-
readonly metadata: null;
|
|
21
|
-
};
|
|
22
|
-
readonly ACTIVE: {
|
|
23
|
-
readonly id: "ACTIVE";
|
|
24
|
-
readonly isFinal: false;
|
|
25
|
-
readonly metadata: null;
|
|
26
|
-
};
|
|
27
|
-
readonly SLASHED: {
|
|
28
|
-
readonly id: "SLASHED";
|
|
29
|
-
readonly isFinal: false;
|
|
30
|
-
readonly metadata: null;
|
|
31
|
-
};
|
|
32
|
-
readonly WITHDRAWN: {
|
|
33
|
-
readonly id: "WITHDRAWN";
|
|
34
|
-
readonly isFinal: true;
|
|
35
|
-
readonly metadata: null;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
readonly initialState: "UNREGISTERED";
|
|
39
|
-
readonly transitions: readonly [{
|
|
40
|
-
readonly from: "UNREGISTERED";
|
|
41
|
-
readonly to: "REGISTERED";
|
|
42
|
-
readonly eventName: "register";
|
|
43
|
-
readonly guard: {
|
|
44
|
-
readonly ">=": readonly [{
|
|
45
|
-
readonly var: "event.stake";
|
|
46
|
-
}, {
|
|
47
|
-
readonly var: "state.minStake";
|
|
48
|
-
}];
|
|
49
|
-
};
|
|
50
|
-
readonly effect: {
|
|
51
|
-
readonly merge: readonly [{
|
|
52
|
-
readonly var: "state";
|
|
53
|
-
}, {
|
|
54
|
-
readonly status: "REGISTERED";
|
|
55
|
-
readonly address: {
|
|
56
|
-
readonly var: "event.agent";
|
|
57
|
-
};
|
|
58
|
-
readonly stake: {
|
|
59
|
-
readonly var: "event.stake";
|
|
60
|
-
};
|
|
61
|
-
readonly registeredAt: {
|
|
62
|
-
readonly var: "$timestamp";
|
|
63
|
-
};
|
|
64
|
-
readonly reputation: {
|
|
65
|
-
readonly accuracy: 100;
|
|
66
|
-
readonly totalResolutions: 0;
|
|
67
|
-
readonly disputesWon: 0;
|
|
68
|
-
readonly disputesLost: 0;
|
|
69
|
-
};
|
|
70
|
-
readonly domains: {
|
|
71
|
-
readonly var: "event.domains";
|
|
72
|
-
};
|
|
73
|
-
readonly slashingHistory: readonly [];
|
|
74
|
-
}];
|
|
75
|
-
};
|
|
76
|
-
readonly dependencies: readonly [];
|
|
77
|
-
}, {
|
|
78
|
-
readonly from: "REGISTERED";
|
|
79
|
-
readonly to: "ACTIVE";
|
|
80
|
-
readonly eventName: "activate";
|
|
81
|
-
readonly guard: {
|
|
82
|
-
readonly or: readonly [{
|
|
83
|
-
readonly "===": readonly [{
|
|
84
|
-
readonly var: "event.agent";
|
|
85
|
-
}, {
|
|
86
|
-
readonly var: "state.address";
|
|
87
|
-
}];
|
|
88
|
-
}, {
|
|
89
|
-
readonly var: "event.adminOverride";
|
|
90
|
-
}];
|
|
91
|
-
};
|
|
92
|
-
readonly effect: {
|
|
93
|
-
readonly merge: readonly [{
|
|
94
|
-
readonly var: "state";
|
|
95
|
-
}, {
|
|
96
|
-
readonly status: "ACTIVE";
|
|
97
|
-
readonly activatedAt: {
|
|
98
|
-
readonly var: "$timestamp";
|
|
99
|
-
};
|
|
100
|
-
}];
|
|
101
|
-
};
|
|
102
|
-
readonly dependencies: readonly [];
|
|
103
|
-
}, {
|
|
104
|
-
readonly from: "ACTIVE";
|
|
105
|
-
readonly to: "ACTIVE";
|
|
106
|
-
readonly eventName: "add_stake";
|
|
107
|
-
readonly guard: {
|
|
108
|
-
readonly and: readonly [{
|
|
109
|
-
readonly "===": readonly [{
|
|
110
|
-
readonly var: "event.agent";
|
|
111
|
-
}, {
|
|
112
|
-
readonly var: "state.address";
|
|
113
|
-
}];
|
|
114
|
-
}, {
|
|
115
|
-
readonly ">": readonly [{
|
|
116
|
-
readonly var: "event.amount";
|
|
117
|
-
}, 0];
|
|
118
|
-
}];
|
|
119
|
-
};
|
|
120
|
-
readonly effect: {
|
|
121
|
-
readonly merge: readonly [{
|
|
122
|
-
readonly var: "state";
|
|
123
|
-
}, {
|
|
124
|
-
readonly stake: {
|
|
125
|
-
readonly "+": readonly [{
|
|
126
|
-
readonly var: "state.stake";
|
|
127
|
-
}, {
|
|
128
|
-
readonly var: "event.amount";
|
|
129
|
-
}];
|
|
130
|
-
};
|
|
131
|
-
readonly lastStakeAt: {
|
|
132
|
-
readonly var: "$timestamp";
|
|
133
|
-
};
|
|
134
|
-
}];
|
|
135
|
-
};
|
|
136
|
-
readonly dependencies: readonly [];
|
|
137
|
-
}, {
|
|
138
|
-
readonly from: "ACTIVE";
|
|
139
|
-
readonly to: "ACTIVE";
|
|
140
|
-
readonly eventName: "record_resolution";
|
|
141
|
-
readonly guard: {
|
|
142
|
-
readonly var: "event.marketId";
|
|
143
|
-
};
|
|
144
|
-
readonly effect: {
|
|
145
|
-
readonly merge: readonly [{
|
|
146
|
-
readonly var: "state";
|
|
147
|
-
}, {
|
|
148
|
-
readonly reputation: {
|
|
149
|
-
readonly merge: readonly [{
|
|
150
|
-
readonly var: "state.reputation";
|
|
151
|
-
}, {
|
|
152
|
-
readonly totalResolutions: {
|
|
153
|
-
readonly "+": readonly [{
|
|
154
|
-
readonly var: "state.reputation.totalResolutions";
|
|
155
|
-
}, 1];
|
|
156
|
-
};
|
|
157
|
-
readonly accuracy: {
|
|
158
|
-
readonly if: readonly [{
|
|
159
|
-
readonly var: "event.correct";
|
|
160
|
-
}, {
|
|
161
|
-
readonly var: "state.reputation.accuracy";
|
|
162
|
-
}, {
|
|
163
|
-
readonly "-": readonly [{
|
|
164
|
-
readonly var: "state.reputation.accuracy";
|
|
165
|
-
}, 5];
|
|
166
|
-
}];
|
|
167
|
-
};
|
|
168
|
-
}];
|
|
169
|
-
};
|
|
170
|
-
readonly lastResolutionAt: {
|
|
171
|
-
readonly var: "$timestamp";
|
|
172
|
-
};
|
|
173
|
-
}];
|
|
174
|
-
};
|
|
175
|
-
readonly dependencies: readonly [];
|
|
176
|
-
}, {
|
|
177
|
-
readonly from: "ACTIVE";
|
|
178
|
-
readonly to: "SLASHED";
|
|
179
|
-
readonly eventName: "slash";
|
|
180
|
-
readonly guard: {
|
|
181
|
-
readonly and: readonly [{
|
|
182
|
-
readonly var: "event.reason";
|
|
183
|
-
}, {
|
|
184
|
-
readonly ">": readonly [{
|
|
185
|
-
readonly var: "event.amount";
|
|
186
|
-
}, 0];
|
|
187
|
-
}, {
|
|
188
|
-
readonly "<=": readonly [{
|
|
189
|
-
readonly var: "event.amount";
|
|
190
|
-
}, {
|
|
191
|
-
readonly var: "state.stake";
|
|
192
|
-
}];
|
|
193
|
-
}];
|
|
194
|
-
};
|
|
195
|
-
readonly effect: {
|
|
196
|
-
readonly merge: readonly [{
|
|
197
|
-
readonly var: "state";
|
|
198
|
-
}, {
|
|
199
|
-
readonly status: "SLASHED";
|
|
200
|
-
readonly stake: {
|
|
201
|
-
readonly "-": readonly [{
|
|
202
|
-
readonly var: "state.stake";
|
|
203
|
-
}, {
|
|
204
|
-
readonly var: "event.amount";
|
|
205
|
-
}];
|
|
206
|
-
};
|
|
207
|
-
readonly slashingHistory: {
|
|
208
|
-
readonly cat: readonly [{
|
|
209
|
-
readonly var: "state.slashingHistory";
|
|
210
|
-
}, readonly [{
|
|
211
|
-
readonly reason: {
|
|
212
|
-
readonly var: "event.reason";
|
|
213
|
-
};
|
|
214
|
-
readonly amount: {
|
|
215
|
-
readonly var: "event.amount";
|
|
216
|
-
};
|
|
217
|
-
readonly marketId: {
|
|
218
|
-
readonly var: "event.marketId";
|
|
219
|
-
};
|
|
220
|
-
readonly slashedAt: {
|
|
221
|
-
readonly var: "$timestamp";
|
|
222
|
-
};
|
|
223
|
-
}]];
|
|
224
|
-
};
|
|
225
|
-
readonly slashedAt: {
|
|
226
|
-
readonly var: "$timestamp";
|
|
227
|
-
};
|
|
228
|
-
}];
|
|
229
|
-
};
|
|
230
|
-
readonly dependencies: readonly [];
|
|
231
|
-
}, {
|
|
232
|
-
readonly from: "SLASHED";
|
|
233
|
-
readonly to: "ACTIVE";
|
|
234
|
-
readonly eventName: "reactivate";
|
|
235
|
-
readonly guard: {
|
|
236
|
-
readonly and: readonly [{
|
|
237
|
-
readonly "===": readonly [{
|
|
238
|
-
readonly var: "event.agent";
|
|
239
|
-
}, {
|
|
240
|
-
readonly var: "state.address";
|
|
241
|
-
}];
|
|
242
|
-
}, {
|
|
243
|
-
readonly ">=": readonly [{
|
|
244
|
-
readonly var: "state.stake";
|
|
245
|
-
}, {
|
|
246
|
-
readonly var: "state.minStake";
|
|
247
|
-
}];
|
|
248
|
-
}];
|
|
249
|
-
};
|
|
250
|
-
readonly effect: {
|
|
251
|
-
readonly merge: readonly [{
|
|
252
|
-
readonly var: "state";
|
|
253
|
-
}, {
|
|
254
|
-
readonly status: "ACTIVE";
|
|
255
|
-
readonly reactivatedAt: {
|
|
256
|
-
readonly var: "$timestamp";
|
|
257
|
-
};
|
|
258
|
-
}];
|
|
259
|
-
};
|
|
260
|
-
readonly dependencies: readonly [];
|
|
261
|
-
}, {
|
|
262
|
-
readonly from: "ACTIVE";
|
|
263
|
-
readonly to: "WITHDRAWN";
|
|
264
|
-
readonly eventName: "withdraw";
|
|
265
|
-
readonly guard: {
|
|
266
|
-
readonly "===": readonly [{
|
|
267
|
-
readonly var: "event.agent";
|
|
268
|
-
}, {
|
|
269
|
-
readonly var: "state.address";
|
|
270
|
-
}];
|
|
271
|
-
};
|
|
272
|
-
readonly effect: {
|
|
273
|
-
readonly merge: readonly [{
|
|
274
|
-
readonly var: "state";
|
|
275
|
-
}, {
|
|
276
|
-
readonly status: "WITHDRAWN";
|
|
277
|
-
readonly withdrawnAt: {
|
|
278
|
-
readonly var: "$timestamp";
|
|
279
|
-
};
|
|
280
|
-
readonly finalStake: {
|
|
281
|
-
readonly var: "state.stake";
|
|
282
|
-
};
|
|
283
|
-
}];
|
|
284
|
-
};
|
|
285
|
-
readonly dependencies: readonly [];
|
|
286
|
-
}, {
|
|
287
|
-
readonly from: "SLASHED";
|
|
288
|
-
readonly to: "WITHDRAWN";
|
|
289
|
-
readonly eventName: "withdraw";
|
|
290
|
-
readonly guard: {
|
|
291
|
-
readonly "===": readonly [{
|
|
292
|
-
readonly var: "event.agent";
|
|
293
|
-
}, {
|
|
294
|
-
readonly var: "state.address";
|
|
295
|
-
}];
|
|
296
|
-
};
|
|
297
|
-
readonly effect: {
|
|
298
|
-
readonly merge: readonly [{
|
|
299
|
-
readonly var: "state";
|
|
300
|
-
}, {
|
|
301
|
-
readonly status: "WITHDRAWN";
|
|
302
|
-
readonly withdrawnAt: {
|
|
303
|
-
readonly var: "$timestamp";
|
|
304
|
-
};
|
|
305
|
-
readonly finalStake: {
|
|
306
|
-
readonly var: "state.stake";
|
|
307
|
-
};
|
|
308
|
-
}];
|
|
309
|
-
};
|
|
310
|
-
readonly dependencies: readonly [];
|
|
311
|
-
}];
|
|
312
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
export declare const protobufPackage = "ottochain.apps.identity.v1";
|
|
3
|
-
/** Agent lifecycle states in the identity state machine */
|
|
4
|
-
export declare enum AgentState {
|
|
5
|
-
AGENT_STATE_UNSPECIFIED = "AGENT_STATE_UNSPECIFIED",
|
|
6
|
-
/** AGENT_STATE_REGISTERED - Initial state after registration */
|
|
7
|
-
AGENT_STATE_REGISTERED = "AGENT_STATE_REGISTERED",
|
|
8
|
-
/** AGENT_STATE_ACTIVE - Activated and participating */
|
|
9
|
-
AGENT_STATE_ACTIVE = "AGENT_STATE_ACTIVE",
|
|
10
|
-
/** AGENT_STATE_CHALLENGED - Under dispute/challenge */
|
|
11
|
-
AGENT_STATE_CHALLENGED = "AGENT_STATE_CHALLENGED",
|
|
12
|
-
/** AGENT_STATE_SUSPENDED - Challenge upheld, temporarily suspended */
|
|
13
|
-
AGENT_STATE_SUSPENDED = "AGENT_STATE_SUSPENDED",
|
|
14
|
-
/** AGENT_STATE_PROBATION - Recovering from suspension */
|
|
15
|
-
AGENT_STATE_PROBATION = "AGENT_STATE_PROBATION",
|
|
16
|
-
/** AGENT_STATE_WITHDRAWN - Voluntarily exited (terminal) */
|
|
17
|
-
AGENT_STATE_WITHDRAWN = "AGENT_STATE_WITHDRAWN",
|
|
18
|
-
UNRECOGNIZED = "UNRECOGNIZED"
|
|
19
|
-
}
|
|
20
|
-
export declare function agentStateFromJSON(object: any): AgentState;
|
|
21
|
-
export declare function agentStateToJSON(object: AgentState): string;
|
|
22
|
-
export declare function agentStateToNumber(object: AgentState): number;
|
|
23
|
-
/** Platform where agent identity is linked */
|
|
24
|
-
export declare enum Platform {
|
|
25
|
-
PLATFORM_UNSPECIFIED = "PLATFORM_UNSPECIFIED",
|
|
26
|
-
PLATFORM_DISCORD = "PLATFORM_DISCORD",
|
|
27
|
-
PLATFORM_TELEGRAM = "PLATFORM_TELEGRAM",
|
|
28
|
-
PLATFORM_TWITTER = "PLATFORM_TWITTER",
|
|
29
|
-
PLATFORM_GITHUB = "PLATFORM_GITHUB",
|
|
30
|
-
PLATFORM_CUSTOM = "PLATFORM_CUSTOM",
|
|
31
|
-
UNRECOGNIZED = "UNRECOGNIZED"
|
|
32
|
-
}
|
|
33
|
-
export declare function platformFromJSON(object: any): Platform;
|
|
34
|
-
export declare function platformToJSON(object: Platform): string;
|
|
35
|
-
export declare function platformToNumber(object: Platform): number;
|
|
36
|
-
/** Platform identity link */
|
|
37
|
-
export interface PlatformLink {
|
|
38
|
-
platform: Platform;
|
|
39
|
-
platformUserId: string;
|
|
40
|
-
platformUsername: string;
|
|
41
|
-
linkedAt?: Date | undefined;
|
|
42
|
-
verified: boolean;
|
|
43
|
-
}
|
|
44
|
-
/** Agent identity on-chain state */
|
|
45
|
-
export interface AgentIdentity {
|
|
46
|
-
address: string;
|
|
47
|
-
publicKey: string;
|
|
48
|
-
displayName: string;
|
|
49
|
-
reputation: number;
|
|
50
|
-
state: AgentState;
|
|
51
|
-
platformLinks: PlatformLink[];
|
|
52
|
-
createdAt?: Date | undefined;
|
|
53
|
-
updatedAt?: Date | undefined;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* State machine definition for AgentIdentity workflow
|
|
57
|
-
* This defines the valid states and transitions
|
|
58
|
-
*/
|
|
59
|
-
export interface AgentIdentityDefinition {
|
|
60
|
-
/** Default: 10 */
|
|
61
|
-
initialReputation: number;
|
|
62
|
-
/** Min rep to activate (default: 0) */
|
|
63
|
-
activationThreshold: number;
|
|
64
|
-
/** How long suspension lasts */
|
|
65
|
-
suspensionDurationEpochs: number;
|
|
66
|
-
}
|
|
67
|
-
export declare const PlatformLink: MessageFns<PlatformLink>;
|
|
68
|
-
export declare const AgentIdentity: MessageFns<AgentIdentity>;
|
|
69
|
-
export declare const AgentIdentityDefinition: MessageFns<AgentIdentityDefinition>;
|
|
70
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
71
|
-
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
72
|
-
$case: string;
|
|
73
|
-
} ? {
|
|
74
|
-
[K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
|
|
75
|
-
} & {
|
|
76
|
-
$case: T["$case"];
|
|
77
|
-
} : T extends {} ? {
|
|
78
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
79
|
-
} : Partial<T>;
|
|
80
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
81
|
-
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
82
|
-
[K in keyof P]: Exact<P[K], I[K]>;
|
|
83
|
-
} & {
|
|
84
|
-
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
85
|
-
};
|
|
86
|
-
export interface MessageFns<T> {
|
|
87
|
-
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
88
|
-
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
89
|
-
fromJSON(object: any): T;
|
|
90
|
-
toJSON(message: T): unknown;
|
|
91
|
-
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
92
|
-
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
93
|
-
}
|
|
94
|
-
export {};
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
export declare const protobufPackage = "ottochain.apps.oracles.v1";
|
|
3
|
-
/** Oracle lifecycle states */
|
|
4
|
-
export declare enum OracleState {
|
|
5
|
-
ORACLE_STATE_UNSPECIFIED = "ORACLE_STATE_UNSPECIFIED",
|
|
6
|
-
/** ORACLE_STATE_UNREGISTERED - Not yet registered */
|
|
7
|
-
ORACLE_STATE_UNREGISTERED = "ORACLE_STATE_UNREGISTERED",
|
|
8
|
-
/** ORACLE_STATE_REGISTERED - Registered but not yet active */
|
|
9
|
-
ORACLE_STATE_REGISTERED = "ORACLE_STATE_REGISTERED",
|
|
10
|
-
/** ORACLE_STATE_ACTIVE - Active and eligible for markets */
|
|
11
|
-
ORACLE_STATE_ACTIVE = "ORACLE_STATE_ACTIVE",
|
|
12
|
-
/** ORACLE_STATE_SLASHED - Penalized for misbehavior */
|
|
13
|
-
ORACLE_STATE_SLASHED = "ORACLE_STATE_SLASHED",
|
|
14
|
-
/** ORACLE_STATE_WITHDRAWN - Voluntarily exited (terminal) */
|
|
15
|
-
ORACLE_STATE_WITHDRAWN = "ORACLE_STATE_WITHDRAWN",
|
|
16
|
-
UNRECOGNIZED = "UNRECOGNIZED"
|
|
17
|
-
}
|
|
18
|
-
export declare function oracleStateFromJSON(object: any): OracleState;
|
|
19
|
-
export declare function oracleStateToJSON(object: OracleState): string;
|
|
20
|
-
export declare function oracleStateToNumber(object: OracleState): number;
|
|
21
|
-
/** Oracle reputation metrics */
|
|
22
|
-
export interface OracleReputation {
|
|
23
|
-
/** Accuracy as percentage (0-100) */
|
|
24
|
-
accuracyPercentage: number;
|
|
25
|
-
/** Total markets resolved */
|
|
26
|
-
totalResolutions: number;
|
|
27
|
-
/** Disputes resolved in oracle's favor */
|
|
28
|
-
disputesWon: number;
|
|
29
|
-
/** Disputes resolved against oracle */
|
|
30
|
-
disputesLost: number;
|
|
31
|
-
}
|
|
32
|
-
/** Record of a slashing event */
|
|
33
|
-
export interface SlashingEvent {
|
|
34
|
-
/** Description of infraction */
|
|
35
|
-
reason: string;
|
|
36
|
-
/** Amount slashed from stake */
|
|
37
|
-
amount: number;
|
|
38
|
-
/** Market where infraction occurred */
|
|
39
|
-
marketId: string;
|
|
40
|
-
/** When slashing occurred */
|
|
41
|
-
timestamp?: Date | undefined;
|
|
42
|
-
}
|
|
43
|
-
/** Oracle identity and state */
|
|
44
|
-
export interface Oracle {
|
|
45
|
-
/** Unique oracle identifier */
|
|
46
|
-
id: string;
|
|
47
|
-
/** Oracle's DAG address */
|
|
48
|
-
address: string;
|
|
49
|
-
/** Current staked amount */
|
|
50
|
-
stake: number;
|
|
51
|
-
/** Reputation metrics */
|
|
52
|
-
reputation?: OracleReputation | undefined;
|
|
53
|
-
/** Current accuracy score (0-100) */
|
|
54
|
-
accuracy: number;
|
|
55
|
-
/** Total markets resolved */
|
|
56
|
-
marketsResolved: number;
|
|
57
|
-
/** Dispute rate percentage (0-100) */
|
|
58
|
-
disputeRate: number;
|
|
59
|
-
/** Expertise domains (e.g., "sports", "crypto", "politics") */
|
|
60
|
-
domains: string[];
|
|
61
|
-
/** Current oracle state */
|
|
62
|
-
state: OracleState;
|
|
63
|
-
/** History of slashing events */
|
|
64
|
-
slashingHistory: SlashingEvent[];
|
|
65
|
-
/** Registration timestamp */
|
|
66
|
-
registeredAt?: Date | undefined;
|
|
67
|
-
/** Last state update timestamp */
|
|
68
|
-
updatedAt?: Date | undefined;
|
|
69
|
-
}
|
|
70
|
-
/** Register a new oracle */
|
|
71
|
-
export interface RegisterOracleRequest {
|
|
72
|
-
address: string;
|
|
73
|
-
initialStake: number;
|
|
74
|
-
domains: string[];
|
|
75
|
-
}
|
|
76
|
-
/** Activate a registered oracle */
|
|
77
|
-
export interface ActivateOracleRequest {
|
|
78
|
-
oracleId: string;
|
|
79
|
-
address: string;
|
|
80
|
-
}
|
|
81
|
-
/** Add stake to oracle */
|
|
82
|
-
export interface AddStakeRequest {
|
|
83
|
-
oracleId: string;
|
|
84
|
-
address: string;
|
|
85
|
-
amount: number;
|
|
86
|
-
}
|
|
87
|
-
/** Withdraw stake (initiates cooldown) */
|
|
88
|
-
export interface WithdrawStakeRequest {
|
|
89
|
-
oracleId: string;
|
|
90
|
-
address: string;
|
|
91
|
-
amount: number;
|
|
92
|
-
}
|
|
93
|
-
/** Slash an oracle for misbehavior */
|
|
94
|
-
export interface SlashOracleRequest {
|
|
95
|
-
oracleId: string;
|
|
96
|
-
marketId: string;
|
|
97
|
-
reason: string;
|
|
98
|
-
amount: number;
|
|
99
|
-
}
|
|
100
|
-
/** Withdraw oracle from service */
|
|
101
|
-
export interface WithdrawOracleRequest {
|
|
102
|
-
oracleId: string;
|
|
103
|
-
address: string;
|
|
104
|
-
}
|
|
105
|
-
/** Oracle state machine definition */
|
|
106
|
-
export interface OracleDefinition {
|
|
107
|
-
/** Minimum stake to activate */
|
|
108
|
-
minStake: number;
|
|
109
|
-
/** Epochs before slashed oracle can recover */
|
|
110
|
-
slashCooldownEpochs: number;
|
|
111
|
-
/** Min accuracy to remain active (0-100) */
|
|
112
|
-
accuracyThreshold: number;
|
|
113
|
-
/** Max dispute rate before auto-slash (0-100) */
|
|
114
|
-
maxDisputeRate: number;
|
|
115
|
-
}
|
|
116
|
-
export declare const OracleReputation: MessageFns<OracleReputation>;
|
|
117
|
-
export declare const SlashingEvent: MessageFns<SlashingEvent>;
|
|
118
|
-
export declare const Oracle: MessageFns<Oracle>;
|
|
119
|
-
export declare const RegisterOracleRequest: MessageFns<RegisterOracleRequest>;
|
|
120
|
-
export declare const ActivateOracleRequest: MessageFns<ActivateOracleRequest>;
|
|
121
|
-
export declare const AddStakeRequest: MessageFns<AddStakeRequest>;
|
|
122
|
-
export declare const WithdrawStakeRequest: MessageFns<WithdrawStakeRequest>;
|
|
123
|
-
export declare const SlashOracleRequest: MessageFns<SlashOracleRequest>;
|
|
124
|
-
export declare const WithdrawOracleRequest: MessageFns<WithdrawOracleRequest>;
|
|
125
|
-
export declare const OracleDefinition: MessageFns<OracleDefinition>;
|
|
126
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
127
|
-
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
128
|
-
$case: string;
|
|
129
|
-
} ? {
|
|
130
|
-
[K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
|
|
131
|
-
} & {
|
|
132
|
-
$case: T["$case"];
|
|
133
|
-
} : T extends {} ? {
|
|
134
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
135
|
-
} : Partial<T>;
|
|
136
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
137
|
-
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
138
|
-
[K in keyof P]: Exact<P[K], I[K]>;
|
|
139
|
-
} & {
|
|
140
|
-
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
141
|
-
};
|
|
142
|
-
export interface MessageFns<T> {
|
|
143
|
-
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
144
|
-
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
145
|
-
fromJSON(object: any): T;
|
|
146
|
-
toJSON(message: T): unknown;
|
|
147
|
-
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
148
|
-
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
149
|
-
}
|
|
150
|
-
export {};
|