@trinaryex/sdk 3.9.0 → 5.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/DESIGN.md +253 -71
- package/README.md +220 -16
- package/dist/ReadOnlyClient.d.ts +42 -8
- package/dist/TriexClient.d.ts +73 -8
- package/dist/armature/OrgClient.d.ts +372 -0
- package/dist/armature/OrgClientGroups.d.ts +186 -0
- package/dist/armature/OrgsApi.d.ts +69 -0
- package/dist/armature/actions.d.ts +75 -0
- package/dist/armature/create.d.ts +27 -0
- package/dist/armature/currency.d.ts +64 -0
- package/dist/armature/executors.d.ts +44 -0
- package/dist/armature/governance.d.ts +194 -0
- package/dist/armature/harness.d.ts +96 -0
- package/dist/armature/lifecycle.d.ts +84 -0
- package/dist/armature/plan.d.ts +39 -0
- package/dist/armature/proposals.d.ts +51 -0
- package/dist/armature/queries.d.ts +16 -0
- package/dist/armature/schemas.d.ts +559 -0
- package/dist/armature/trading.d.ts +114 -0
- package/dist/armature/transactions.d.ts +160 -0
- package/dist/armature/treasury.d.ts +41 -0
- package/dist/armature/tree.d.ts +13 -0
- package/dist/armature/types.d.ts +59 -0
- package/dist/armature/upgrade.d.ts +27 -0
- package/dist/armature/vault.d.ts +94 -0
- package/dist/coins/CoinsApi.d.ts +53 -0
- package/dist/coins/funding.d.ts +6 -0
- package/dist/coins/money.d.ts +36 -0
- package/dist/coins/onchain.d.ts +162 -0
- package/dist/coins/schemas.d.ts +456 -0
- package/dist/coins/transactions.d.ts +82 -0
- package/dist/coins/types.d.ts +115 -0
- package/dist/errors.d.ts +11 -1
- package/dist/funding.d.ts +2 -2
- package/dist/http.d.ts +3 -0
- package/dist/index.d.ts +63 -8
- package/dist/index.js +10620 -959
- package/dist/money.d.ts +15 -0
- package/dist/moveAbort.d.ts +28 -0
- package/dist/moveAbortCatalog.generated.d.ts +9 -0
- package/dist/onchain.d.ts +55 -3
- package/dist/paging.d.ts +9 -3
- package/dist/queries.d.ts +35 -7
- package/dist/schemas.d.ts +2257 -50
- package/dist/transactions.d.ts +63 -1
- package/dist/types.d.ts +118 -7
- package/package.json +3 -1
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ProposalConfig } from './governance';
|
|
3
|
+
export interface OrgMetadata {
|
|
4
|
+
imageUrl?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
version?: number;
|
|
7
|
+
errorReason?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const OrgMetadataSchema: z.ZodPipe<z.ZodObject<{
|
|
10
|
+
image_url: z.ZodOptional<z.ZodString>;
|
|
11
|
+
description: z.ZodOptional<z.ZodString>;
|
|
12
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
error_reason: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strip>, z.ZodTransform<OrgMetadata, {
|
|
15
|
+
image_url?: string | undefined;
|
|
16
|
+
description?: string | undefined;
|
|
17
|
+
version?: number | undefined;
|
|
18
|
+
error_reason?: string | undefined;
|
|
19
|
+
}>>;
|
|
20
|
+
export declare const OrgActorSchema: z.ZodPipe<z.ZodObject<{
|
|
21
|
+
type: z.ZodLiteral<"player">;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
24
|
+
type: "player";
|
|
25
|
+
name: string;
|
|
26
|
+
}, {
|
|
27
|
+
type: "player";
|
|
28
|
+
name: string;
|
|
29
|
+
}>>;
|
|
30
|
+
export type OrgActor = z.output<typeof OrgActorSchema>;
|
|
31
|
+
export interface Org {
|
|
32
|
+
orgId: string;
|
|
33
|
+
charterId: string | null;
|
|
34
|
+
treasuryId: string | null;
|
|
35
|
+
capabilityVaultId: string | null;
|
|
36
|
+
emergencyFreezeId: string | null;
|
|
37
|
+
name: string | null;
|
|
38
|
+
metadataUri: string | null;
|
|
39
|
+
metadata: OrgMetadata;
|
|
40
|
+
members: string[];
|
|
41
|
+
ous: Org[];
|
|
42
|
+
actors?: Record<string, OrgActor>;
|
|
43
|
+
tradingAccountId: string | null;
|
|
44
|
+
subdaoControlCapId: string | null;
|
|
45
|
+
}
|
|
46
|
+
export declare const OrgSchema: z.ZodType<Org, unknown>;
|
|
47
|
+
export declare const OrgListSchema: z.ZodArray<z.ZodType<Org, unknown, z.core.$ZodTypeInternals<Org, unknown>>>;
|
|
48
|
+
export interface OrgDirectoryEntry {
|
|
49
|
+
orgId: string;
|
|
50
|
+
name: string;
|
|
51
|
+
treasuryId: string;
|
|
52
|
+
imageUrl?: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
memberCount: number;
|
|
55
|
+
}
|
|
56
|
+
export declare const OrgDirectoryEntrySchema: z.ZodPipe<z.ZodObject<{
|
|
57
|
+
org_id: z.ZodString;
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
treasury_id: z.ZodString;
|
|
60
|
+
image_url: z.ZodOptional<z.ZodString>;
|
|
61
|
+
description: z.ZodOptional<z.ZodString>;
|
|
62
|
+
member_count: z.ZodNumber;
|
|
63
|
+
}, z.core.$strip>, z.ZodTransform<OrgDirectoryEntry, {
|
|
64
|
+
org_id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
treasury_id: string;
|
|
67
|
+
member_count: number;
|
|
68
|
+
image_url?: string | undefined;
|
|
69
|
+
description?: string | undefined;
|
|
70
|
+
}>>;
|
|
71
|
+
export declare const OrgDirectoryPageSchema: z.ZodPipe<z.ZodObject<{
|
|
72
|
+
data: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
73
|
+
org_id: z.ZodString;
|
|
74
|
+
name: z.ZodString;
|
|
75
|
+
treasury_id: z.ZodString;
|
|
76
|
+
image_url: z.ZodOptional<z.ZodString>;
|
|
77
|
+
description: z.ZodOptional<z.ZodString>;
|
|
78
|
+
member_count: z.ZodNumber;
|
|
79
|
+
}, z.core.$strip>, z.ZodTransform<OrgDirectoryEntry, {
|
|
80
|
+
org_id: string;
|
|
81
|
+
name: string;
|
|
82
|
+
treasury_id: string;
|
|
83
|
+
member_count: number;
|
|
84
|
+
image_url?: string | undefined;
|
|
85
|
+
description?: string | undefined;
|
|
86
|
+
}>>>;
|
|
87
|
+
next_cursor: z.ZodNullable<z.ZodString>;
|
|
88
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
89
|
+
entries: OrgDirectoryEntry[];
|
|
90
|
+
nextCursor: string | null;
|
|
91
|
+
}, {
|
|
92
|
+
data: OrgDirectoryEntry[];
|
|
93
|
+
next_cursor: string | null;
|
|
94
|
+
}>>;
|
|
95
|
+
export interface OrgSearchResult {
|
|
96
|
+
orgId: string;
|
|
97
|
+
name: string;
|
|
98
|
+
treasuryId: string;
|
|
99
|
+
imageUrl?: string;
|
|
100
|
+
description?: string;
|
|
101
|
+
rootOrgId: string;
|
|
102
|
+
rootName: string;
|
|
103
|
+
depth: number;
|
|
104
|
+
}
|
|
105
|
+
export declare const OrgSearchResultSchema: z.ZodPipe<z.ZodObject<{
|
|
106
|
+
org_id: z.ZodString;
|
|
107
|
+
name: z.ZodString;
|
|
108
|
+
treasury_id: z.ZodString;
|
|
109
|
+
image_url: z.ZodOptional<z.ZodString>;
|
|
110
|
+
description: z.ZodOptional<z.ZodString>;
|
|
111
|
+
root_org_id: z.ZodString;
|
|
112
|
+
root_name: z.ZodString;
|
|
113
|
+
depth: z.ZodNumber;
|
|
114
|
+
}, z.core.$strip>, z.ZodTransform<OrgSearchResult, {
|
|
115
|
+
org_id: string;
|
|
116
|
+
name: string;
|
|
117
|
+
treasury_id: string;
|
|
118
|
+
root_org_id: string;
|
|
119
|
+
root_name: string;
|
|
120
|
+
depth: number;
|
|
121
|
+
image_url?: string | undefined;
|
|
122
|
+
description?: string | undefined;
|
|
123
|
+
}>>;
|
|
124
|
+
export declare const OrgSearchResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
125
|
+
orgs: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
126
|
+
org_id: z.ZodString;
|
|
127
|
+
name: z.ZodString;
|
|
128
|
+
treasury_id: z.ZodString;
|
|
129
|
+
image_url: z.ZodOptional<z.ZodString>;
|
|
130
|
+
description: z.ZodOptional<z.ZodString>;
|
|
131
|
+
root_org_id: z.ZodString;
|
|
132
|
+
root_name: z.ZodString;
|
|
133
|
+
depth: z.ZodNumber;
|
|
134
|
+
}, z.core.$strip>, z.ZodTransform<OrgSearchResult, {
|
|
135
|
+
org_id: string;
|
|
136
|
+
name: string;
|
|
137
|
+
treasury_id: string;
|
|
138
|
+
root_org_id: string;
|
|
139
|
+
root_name: string;
|
|
140
|
+
depth: number;
|
|
141
|
+
image_url?: string | undefined;
|
|
142
|
+
description?: string | undefined;
|
|
143
|
+
}>>>>;
|
|
144
|
+
}, z.core.$strip>, z.ZodTransform<OrgSearchResult[], {
|
|
145
|
+
orgs?: OrgSearchResult[] | undefined;
|
|
146
|
+
}>>;
|
|
147
|
+
export declare const ProposalCompositeStepSchema: z.ZodPipe<z.ZodObject<{
|
|
148
|
+
step_index: z.ZodNumber;
|
|
149
|
+
step_type_key: z.ZodString;
|
|
150
|
+
step_type: z.ZodNullable<z.ZodString>;
|
|
151
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
152
|
+
stepIndex: number;
|
|
153
|
+
stepTypeKey: string;
|
|
154
|
+
stepType: string | null;
|
|
155
|
+
}, {
|
|
156
|
+
step_index: number;
|
|
157
|
+
step_type_key: string;
|
|
158
|
+
step_type: string | null;
|
|
159
|
+
}>>;
|
|
160
|
+
export declare const ProposalConfigWireSchema: z.ZodPipe<z.ZodObject<{
|
|
161
|
+
quorum: z.ZodNumber;
|
|
162
|
+
approval_threshold: z.ZodNumber;
|
|
163
|
+
propose_threshold: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
164
|
+
expiry_ms: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
165
|
+
execution_delay_ms: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
166
|
+
cooldown_ms: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
167
|
+
composable_allowed: z.ZodBoolean;
|
|
168
|
+
permissions: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
169
|
+
borrow_scope: z.ZodArray<z.ZodString>;
|
|
170
|
+
}, z.core.$strip>, z.ZodTransform<ProposalConfig, {
|
|
171
|
+
quorum: number;
|
|
172
|
+
approval_threshold: number;
|
|
173
|
+
propose_threshold: number;
|
|
174
|
+
expiry_ms: number;
|
|
175
|
+
execution_delay_ms: number;
|
|
176
|
+
cooldown_ms: number;
|
|
177
|
+
composable_allowed: boolean;
|
|
178
|
+
permissions: number;
|
|
179
|
+
borrow_scope: string[];
|
|
180
|
+
}>>;
|
|
181
|
+
export declare const ProposalSummarySchema: z.ZodPipe<z.ZodObject<{
|
|
182
|
+
proposal_id: z.ZodString;
|
|
183
|
+
org_id: z.ZodString;
|
|
184
|
+
type_key: z.ZodNullable<z.ZodString>;
|
|
185
|
+
proposer: z.ZodNullable<z.ZodString>;
|
|
186
|
+
status: z.ZodEnum<{
|
|
187
|
+
pending: "pending";
|
|
188
|
+
passed: "passed";
|
|
189
|
+
executed: "executed";
|
|
190
|
+
expired: "expired";
|
|
191
|
+
}>;
|
|
192
|
+
yes_weight: z.ZodNumber;
|
|
193
|
+
no_weight: z.ZodNumber;
|
|
194
|
+
payload_type: z.ZodNullable<z.ZodString>;
|
|
195
|
+
frame_id: z.ZodNullable<z.ZodString>;
|
|
196
|
+
created_checkpoint: z.ZodNumber;
|
|
197
|
+
metadata_ipfs: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
198
|
+
config: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
|
|
199
|
+
quorum: z.ZodNumber;
|
|
200
|
+
approval_threshold: z.ZodNumber;
|
|
201
|
+
propose_threshold: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
202
|
+
expiry_ms: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
203
|
+
execution_delay_ms: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
204
|
+
cooldown_ms: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
205
|
+
composable_allowed: z.ZodBoolean;
|
|
206
|
+
permissions: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
207
|
+
borrow_scope: z.ZodArray<z.ZodString>;
|
|
208
|
+
}, z.core.$strip>, z.ZodTransform<ProposalConfig, {
|
|
209
|
+
quorum: number;
|
|
210
|
+
approval_threshold: number;
|
|
211
|
+
propose_threshold: number;
|
|
212
|
+
expiry_ms: number;
|
|
213
|
+
execution_delay_ms: number;
|
|
214
|
+
cooldown_ms: number;
|
|
215
|
+
composable_allowed: boolean;
|
|
216
|
+
permissions: number;
|
|
217
|
+
borrow_scope: string[];
|
|
218
|
+
}>>>>;
|
|
219
|
+
created_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
220
|
+
composite: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
221
|
+
step_index: z.ZodNumber;
|
|
222
|
+
step_type_key: z.ZodString;
|
|
223
|
+
step_type: z.ZodNullable<z.ZodString>;
|
|
224
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
225
|
+
stepIndex: number;
|
|
226
|
+
stepTypeKey: string;
|
|
227
|
+
stepType: string | null;
|
|
228
|
+
}, {
|
|
229
|
+
step_index: number;
|
|
230
|
+
step_type_key: string;
|
|
231
|
+
step_type: string | null;
|
|
232
|
+
}>>>>;
|
|
233
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
234
|
+
proposalId: string;
|
|
235
|
+
orgId: string;
|
|
236
|
+
typeKey: string | null;
|
|
237
|
+
proposer: string | null;
|
|
238
|
+
status: "pending" | "passed" | "executed" | "expired";
|
|
239
|
+
yesWeight: number;
|
|
240
|
+
noWeight: number;
|
|
241
|
+
payloadType: string | null;
|
|
242
|
+
frameId: string | null;
|
|
243
|
+
createdCheckpoint: number;
|
|
244
|
+
metadataIpfs: string | null;
|
|
245
|
+
config: ProposalConfig | null;
|
|
246
|
+
createdMs: number | null;
|
|
247
|
+
composite: {
|
|
248
|
+
stepIndex: number;
|
|
249
|
+
stepTypeKey: string;
|
|
250
|
+
stepType: string | null;
|
|
251
|
+
}[] | undefined;
|
|
252
|
+
}, {
|
|
253
|
+
proposal_id: string;
|
|
254
|
+
org_id: string;
|
|
255
|
+
type_key: string | null;
|
|
256
|
+
proposer: string | null;
|
|
257
|
+
status: "pending" | "passed" | "executed" | "expired";
|
|
258
|
+
yes_weight: number;
|
|
259
|
+
no_weight: number;
|
|
260
|
+
payload_type: string | null;
|
|
261
|
+
frame_id: string | null;
|
|
262
|
+
created_checkpoint: number;
|
|
263
|
+
metadata_ipfs?: string | null | undefined;
|
|
264
|
+
config?: ProposalConfig | null | undefined;
|
|
265
|
+
created_ms?: number | null | undefined;
|
|
266
|
+
composite?: {
|
|
267
|
+
stepIndex: number;
|
|
268
|
+
stepTypeKey: string;
|
|
269
|
+
stepType: string | null;
|
|
270
|
+
}[] | undefined;
|
|
271
|
+
}>>;
|
|
272
|
+
export declare const ProposalSummaryListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
273
|
+
proposal_id: z.ZodString;
|
|
274
|
+
org_id: z.ZodString;
|
|
275
|
+
type_key: z.ZodNullable<z.ZodString>;
|
|
276
|
+
proposer: z.ZodNullable<z.ZodString>;
|
|
277
|
+
status: z.ZodEnum<{
|
|
278
|
+
pending: "pending";
|
|
279
|
+
passed: "passed";
|
|
280
|
+
executed: "executed";
|
|
281
|
+
expired: "expired";
|
|
282
|
+
}>;
|
|
283
|
+
yes_weight: z.ZodNumber;
|
|
284
|
+
no_weight: z.ZodNumber;
|
|
285
|
+
payload_type: z.ZodNullable<z.ZodString>;
|
|
286
|
+
frame_id: z.ZodNullable<z.ZodString>;
|
|
287
|
+
created_checkpoint: z.ZodNumber;
|
|
288
|
+
metadata_ipfs: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
289
|
+
config: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
|
|
290
|
+
quorum: z.ZodNumber;
|
|
291
|
+
approval_threshold: z.ZodNumber;
|
|
292
|
+
propose_threshold: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
293
|
+
expiry_ms: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
294
|
+
execution_delay_ms: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
295
|
+
cooldown_ms: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
296
|
+
composable_allowed: z.ZodBoolean;
|
|
297
|
+
permissions: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>;
|
|
298
|
+
borrow_scope: z.ZodArray<z.ZodString>;
|
|
299
|
+
}, z.core.$strip>, z.ZodTransform<ProposalConfig, {
|
|
300
|
+
quorum: number;
|
|
301
|
+
approval_threshold: number;
|
|
302
|
+
propose_threshold: number;
|
|
303
|
+
expiry_ms: number;
|
|
304
|
+
execution_delay_ms: number;
|
|
305
|
+
cooldown_ms: number;
|
|
306
|
+
composable_allowed: boolean;
|
|
307
|
+
permissions: number;
|
|
308
|
+
borrow_scope: string[];
|
|
309
|
+
}>>>>;
|
|
310
|
+
created_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
311
|
+
composite: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
312
|
+
step_index: z.ZodNumber;
|
|
313
|
+
step_type_key: z.ZodString;
|
|
314
|
+
step_type: z.ZodNullable<z.ZodString>;
|
|
315
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
316
|
+
stepIndex: number;
|
|
317
|
+
stepTypeKey: string;
|
|
318
|
+
stepType: string | null;
|
|
319
|
+
}, {
|
|
320
|
+
step_index: number;
|
|
321
|
+
step_type_key: string;
|
|
322
|
+
step_type: string | null;
|
|
323
|
+
}>>>>;
|
|
324
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
325
|
+
proposalId: string;
|
|
326
|
+
orgId: string;
|
|
327
|
+
typeKey: string | null;
|
|
328
|
+
proposer: string | null;
|
|
329
|
+
status: "pending" | "passed" | "executed" | "expired";
|
|
330
|
+
yesWeight: number;
|
|
331
|
+
noWeight: number;
|
|
332
|
+
payloadType: string | null;
|
|
333
|
+
frameId: string | null;
|
|
334
|
+
createdCheckpoint: number;
|
|
335
|
+
metadataIpfs: string | null;
|
|
336
|
+
config: ProposalConfig | null;
|
|
337
|
+
createdMs: number | null;
|
|
338
|
+
composite: {
|
|
339
|
+
stepIndex: number;
|
|
340
|
+
stepTypeKey: string;
|
|
341
|
+
stepType: string | null;
|
|
342
|
+
}[] | undefined;
|
|
343
|
+
}, {
|
|
344
|
+
proposal_id: string;
|
|
345
|
+
org_id: string;
|
|
346
|
+
type_key: string | null;
|
|
347
|
+
proposer: string | null;
|
|
348
|
+
status: "pending" | "passed" | "executed" | "expired";
|
|
349
|
+
yes_weight: number;
|
|
350
|
+
no_weight: number;
|
|
351
|
+
payload_type: string | null;
|
|
352
|
+
frame_id: string | null;
|
|
353
|
+
created_checkpoint: number;
|
|
354
|
+
metadata_ipfs?: string | null | undefined;
|
|
355
|
+
config?: ProposalConfig | null | undefined;
|
|
356
|
+
created_ms?: number | null | undefined;
|
|
357
|
+
composite?: {
|
|
358
|
+
stepIndex: number;
|
|
359
|
+
stepTypeKey: string;
|
|
360
|
+
stepType: string | null;
|
|
361
|
+
}[] | undefined;
|
|
362
|
+
}>>>;
|
|
363
|
+
export declare const AccessibleKeyspaceSchema: z.ZodPipe<z.ZodObject<{
|
|
364
|
+
acl_id: z.ZodString;
|
|
365
|
+
matched_org_id: z.ZodNullable<z.ZodString>;
|
|
366
|
+
name: z.ZodString;
|
|
367
|
+
registrant_org_id: z.ZodNullable<z.ZodString>;
|
|
368
|
+
match_via: z.ZodEnum<{
|
|
369
|
+
created: "created";
|
|
370
|
+
player_grant: "player_grant";
|
|
371
|
+
machine_grant: "machine_grant";
|
|
372
|
+
ou_grant: "ou_grant";
|
|
373
|
+
}>;
|
|
374
|
+
roles: z.ZodArray<z.ZodEnum<{
|
|
375
|
+
grant: "grant";
|
|
376
|
+
read: "read";
|
|
377
|
+
write: "write";
|
|
378
|
+
}>>;
|
|
379
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
380
|
+
aclId: string;
|
|
381
|
+
matchedOrgId: string | null;
|
|
382
|
+
name: string;
|
|
383
|
+
registrantOrgId: string | null;
|
|
384
|
+
matchVia: "created" | "player_grant" | "machine_grant" | "ou_grant";
|
|
385
|
+
roles: ("grant" | "read" | "write")[];
|
|
386
|
+
}, {
|
|
387
|
+
acl_id: string;
|
|
388
|
+
matched_org_id: string | null;
|
|
389
|
+
name: string;
|
|
390
|
+
registrant_org_id: string | null;
|
|
391
|
+
match_via: "created" | "player_grant" | "machine_grant" | "ou_grant";
|
|
392
|
+
roles: ("grant" | "read" | "write")[];
|
|
393
|
+
}>>;
|
|
394
|
+
export declare const AccessibleKeyspaceListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
395
|
+
acl_id: z.ZodString;
|
|
396
|
+
matched_org_id: z.ZodNullable<z.ZodString>;
|
|
397
|
+
name: z.ZodString;
|
|
398
|
+
registrant_org_id: z.ZodNullable<z.ZodString>;
|
|
399
|
+
match_via: z.ZodEnum<{
|
|
400
|
+
created: "created";
|
|
401
|
+
player_grant: "player_grant";
|
|
402
|
+
machine_grant: "machine_grant";
|
|
403
|
+
ou_grant: "ou_grant";
|
|
404
|
+
}>;
|
|
405
|
+
roles: z.ZodArray<z.ZodEnum<{
|
|
406
|
+
grant: "grant";
|
|
407
|
+
read: "read";
|
|
408
|
+
write: "write";
|
|
409
|
+
}>>;
|
|
410
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
411
|
+
aclId: string;
|
|
412
|
+
matchedOrgId: string | null;
|
|
413
|
+
name: string;
|
|
414
|
+
registrantOrgId: string | null;
|
|
415
|
+
matchVia: "created" | "player_grant" | "machine_grant" | "ou_grant";
|
|
416
|
+
roles: ("grant" | "read" | "write")[];
|
|
417
|
+
}, {
|
|
418
|
+
acl_id: string;
|
|
419
|
+
matched_org_id: string | null;
|
|
420
|
+
name: string;
|
|
421
|
+
registrant_org_id: string | null;
|
|
422
|
+
match_via: "created" | "player_grant" | "machine_grant" | "ou_grant";
|
|
423
|
+
roles: ("grant" | "read" | "write")[];
|
|
424
|
+
}>>>;
|
|
425
|
+
export declare const VaultAclEntrySchema: z.ZodPipe<z.ZodObject<{
|
|
426
|
+
role: z.ZodEnum<{
|
|
427
|
+
deposit: "deposit";
|
|
428
|
+
withdraw: "withdraw";
|
|
429
|
+
edit: "edit";
|
|
430
|
+
}>;
|
|
431
|
+
principal_kind: z.ZodEnum<{
|
|
432
|
+
ou: "ou";
|
|
433
|
+
player: "player";
|
|
434
|
+
machine: "machine";
|
|
435
|
+
}>;
|
|
436
|
+
principal_value: z.ZodString;
|
|
437
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
438
|
+
role: "deposit" | "withdraw" | "edit";
|
|
439
|
+
principal: {
|
|
440
|
+
kind: "ou" | "player" | "machine";
|
|
441
|
+
value: string;
|
|
442
|
+
};
|
|
443
|
+
}, {
|
|
444
|
+
role: "deposit" | "withdraw" | "edit";
|
|
445
|
+
principal_kind: "ou" | "player" | "machine";
|
|
446
|
+
principal_value: string;
|
|
447
|
+
}>>;
|
|
448
|
+
export declare const HubDaoVaultSchema: z.ZodPipe<z.ZodObject<{
|
|
449
|
+
vault_id: z.ZodString;
|
|
450
|
+
registrant_dao_id: z.ZodNullable<z.ZodString>;
|
|
451
|
+
hub_id: z.ZodString;
|
|
452
|
+
collection_id: z.ZodNullable<z.ZodString>;
|
|
453
|
+
status: z.ZodString;
|
|
454
|
+
acl: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
455
|
+
role: z.ZodEnum<{
|
|
456
|
+
deposit: "deposit";
|
|
457
|
+
withdraw: "withdraw";
|
|
458
|
+
edit: "edit";
|
|
459
|
+
}>;
|
|
460
|
+
principal_kind: z.ZodEnum<{
|
|
461
|
+
ou: "ou";
|
|
462
|
+
player: "player";
|
|
463
|
+
machine: "machine";
|
|
464
|
+
}>;
|
|
465
|
+
principal_value: z.ZodString;
|
|
466
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
467
|
+
role: "deposit" | "withdraw" | "edit";
|
|
468
|
+
principal: {
|
|
469
|
+
kind: "ou" | "player" | "machine";
|
|
470
|
+
value: string;
|
|
471
|
+
};
|
|
472
|
+
}, {
|
|
473
|
+
role: "deposit" | "withdraw" | "edit";
|
|
474
|
+
principal_kind: "ou" | "player" | "machine";
|
|
475
|
+
principal_value: string;
|
|
476
|
+
}>>>;
|
|
477
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
478
|
+
vaultId: string;
|
|
479
|
+
registrantOrgId: string | null;
|
|
480
|
+
hubId: string;
|
|
481
|
+
collectionId: string | null;
|
|
482
|
+
status: string;
|
|
483
|
+
acl: {
|
|
484
|
+
role: "deposit" | "withdraw" | "edit";
|
|
485
|
+
principal: {
|
|
486
|
+
kind: "ou" | "player" | "machine";
|
|
487
|
+
value: string;
|
|
488
|
+
};
|
|
489
|
+
}[];
|
|
490
|
+
}, {
|
|
491
|
+
vault_id: string;
|
|
492
|
+
registrant_dao_id: string | null;
|
|
493
|
+
hub_id: string;
|
|
494
|
+
collection_id: string | null;
|
|
495
|
+
status: string;
|
|
496
|
+
acl: {
|
|
497
|
+
role: "deposit" | "withdraw" | "edit";
|
|
498
|
+
principal: {
|
|
499
|
+
kind: "ou" | "player" | "machine";
|
|
500
|
+
value: string;
|
|
501
|
+
};
|
|
502
|
+
}[];
|
|
503
|
+
}>>;
|
|
504
|
+
export declare const HubDaoVaultListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
505
|
+
vault_id: z.ZodString;
|
|
506
|
+
registrant_dao_id: z.ZodNullable<z.ZodString>;
|
|
507
|
+
hub_id: z.ZodString;
|
|
508
|
+
collection_id: z.ZodNullable<z.ZodString>;
|
|
509
|
+
status: z.ZodString;
|
|
510
|
+
acl: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
511
|
+
role: z.ZodEnum<{
|
|
512
|
+
deposit: "deposit";
|
|
513
|
+
withdraw: "withdraw";
|
|
514
|
+
edit: "edit";
|
|
515
|
+
}>;
|
|
516
|
+
principal_kind: z.ZodEnum<{
|
|
517
|
+
ou: "ou";
|
|
518
|
+
player: "player";
|
|
519
|
+
machine: "machine";
|
|
520
|
+
}>;
|
|
521
|
+
principal_value: z.ZodString;
|
|
522
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
523
|
+
role: "deposit" | "withdraw" | "edit";
|
|
524
|
+
principal: {
|
|
525
|
+
kind: "ou" | "player" | "machine";
|
|
526
|
+
value: string;
|
|
527
|
+
};
|
|
528
|
+
}, {
|
|
529
|
+
role: "deposit" | "withdraw" | "edit";
|
|
530
|
+
principal_kind: "ou" | "player" | "machine";
|
|
531
|
+
principal_value: string;
|
|
532
|
+
}>>>;
|
|
533
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
534
|
+
vaultId: string;
|
|
535
|
+
registrantOrgId: string | null;
|
|
536
|
+
hubId: string;
|
|
537
|
+
collectionId: string | null;
|
|
538
|
+
status: string;
|
|
539
|
+
acl: {
|
|
540
|
+
role: "deposit" | "withdraw" | "edit";
|
|
541
|
+
principal: {
|
|
542
|
+
kind: "ou" | "player" | "machine";
|
|
543
|
+
value: string;
|
|
544
|
+
};
|
|
545
|
+
}[];
|
|
546
|
+
}, {
|
|
547
|
+
vault_id: string;
|
|
548
|
+
registrant_dao_id: string | null;
|
|
549
|
+
hub_id: string;
|
|
550
|
+
collection_id: string | null;
|
|
551
|
+
status: string;
|
|
552
|
+
acl: {
|
|
553
|
+
role: "deposit" | "withdraw" | "edit";
|
|
554
|
+
principal: {
|
|
555
|
+
kind: "ou" | "player" | "machine";
|
|
556
|
+
value: string;
|
|
557
|
+
};
|
|
558
|
+
}[];
|
|
559
|
+
}>>>;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { ClientWithCoreApi } from '@mysten/sui/client';
|
|
2
|
+
import { Transaction } from '@mysten/sui/transactions';
|
|
3
|
+
import { CreatedObject } from '../execute';
|
|
4
|
+
import { OuProposalAction } from './harness';
|
|
5
|
+
import { normalizeMoveType } from './governance';
|
|
6
|
+
export { normalizeMoveType };
|
|
7
|
+
export interface TradingContext {
|
|
8
|
+
armatureTrading: string;
|
|
9
|
+
tradingCustodyId: string;
|
|
10
|
+
tradingAccountId: string;
|
|
11
|
+
feePolicyId: string;
|
|
12
|
+
}
|
|
13
|
+
export interface OrderFlags {
|
|
14
|
+
orderType?: number;
|
|
15
|
+
selfMatchingOption?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface TradingProposalType {
|
|
18
|
+
typeKey: string;
|
|
19
|
+
moveType: string;
|
|
20
|
+
permissions: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function tradingProposalTypes(armatureTrading: string, quoteType: string): TradingProposalType[];
|
|
23
|
+
export declare function coinPairProposalTypes(armatureTrading: string, baseType: string, quoteType: string): TradingProposalType[];
|
|
24
|
+
export declare function createMulticoinPoolProposalType(armatureTrading: string, quoteType: string): TradingProposalType;
|
|
25
|
+
export declare function setupTradingAccountAction(armature: {
|
|
26
|
+
armatureTrading: string;
|
|
27
|
+
}): OuProposalAction;
|
|
28
|
+
export declare function depositCoinToBookAction(ctx: TradingContext, params: {
|
|
29
|
+
coinType: string;
|
|
30
|
+
amount: bigint;
|
|
31
|
+
treasuryVaultId: string;
|
|
32
|
+
}): OuProposalAction;
|
|
33
|
+
export declare function depositFromOuVaultToBookAction(ctx: TradingContext, params: {
|
|
34
|
+
vaultId: string;
|
|
35
|
+
assetId: bigint;
|
|
36
|
+
amount: bigint;
|
|
37
|
+
}): OuProposalAction;
|
|
38
|
+
export declare function createMulticoinPoolAction(pkgs: {
|
|
39
|
+
armatureTrading: string;
|
|
40
|
+
triexRegistryId: string;
|
|
41
|
+
feePolicyId: string;
|
|
42
|
+
}, params: {
|
|
43
|
+
quoteType: string;
|
|
44
|
+
collectionId: string;
|
|
45
|
+
assetId: bigint;
|
|
46
|
+
treasuryVaultId: string;
|
|
47
|
+
}): OuProposalAction;
|
|
48
|
+
interface LimitOrderFields extends OrderFlags {
|
|
49
|
+
poolId: string;
|
|
50
|
+
price: bigint;
|
|
51
|
+
quantity: bigint;
|
|
52
|
+
isBid: boolean;
|
|
53
|
+
expireTimestamp: bigint;
|
|
54
|
+
}
|
|
55
|
+
export declare function placeLimitOrderAction(ctx: TradingContext, params: {
|
|
56
|
+
quoteType: string;
|
|
57
|
+
} & LimitOrderFields): OuProposalAction;
|
|
58
|
+
export declare function placeMarketOrderAction(ctx: TradingContext, params: {
|
|
59
|
+
quoteType: string;
|
|
60
|
+
poolId: string;
|
|
61
|
+
quantity: bigint;
|
|
62
|
+
isBid: boolean;
|
|
63
|
+
selfMatchingOption?: number;
|
|
64
|
+
}): OuProposalAction;
|
|
65
|
+
export declare function cancelOrderAction(ctx: TradingContext, params: {
|
|
66
|
+
quoteType: string;
|
|
67
|
+
poolId: string;
|
|
68
|
+
orderId: bigint;
|
|
69
|
+
}): OuProposalAction;
|
|
70
|
+
export declare function placeLimitOrderCoinAction(ctx: TradingContext, params: {
|
|
71
|
+
baseType: string;
|
|
72
|
+
quoteType: string;
|
|
73
|
+
} & LimitOrderFields): OuProposalAction;
|
|
74
|
+
export declare function cancelOrderCoinAction(ctx: TradingContext, params: {
|
|
75
|
+
baseType: string;
|
|
76
|
+
quoteType: string;
|
|
77
|
+
poolId: string;
|
|
78
|
+
orderId: bigint;
|
|
79
|
+
}): OuProposalAction;
|
|
80
|
+
export declare function sweepCoinToTreasuryAction(ctx: TradingContext, params: {
|
|
81
|
+
coinType: string;
|
|
82
|
+
amount: bigint;
|
|
83
|
+
treasuryVaultId: string;
|
|
84
|
+
}): OuProposalAction;
|
|
85
|
+
export declare function sweepMulticoinToOuVaultAction(ctx: TradingContext, params: {
|
|
86
|
+
vaultId: string;
|
|
87
|
+
collectionId: string;
|
|
88
|
+
assetId: bigint;
|
|
89
|
+
amount: bigint;
|
|
90
|
+
}): OuProposalAction;
|
|
91
|
+
export declare function appendClaimSettled(tx: Transaction, args: {
|
|
92
|
+
triex: string;
|
|
93
|
+
quoteType: string;
|
|
94
|
+
poolId: string;
|
|
95
|
+
tradingAccountId: string;
|
|
96
|
+
}): void;
|
|
97
|
+
export declare function appendClaimSettledCoin(tx: Transaction, args: {
|
|
98
|
+
triex: string;
|
|
99
|
+
baseType: string;
|
|
100
|
+
quoteType: string;
|
|
101
|
+
poolId: string;
|
|
102
|
+
tradingAccountId: string;
|
|
103
|
+
}): void;
|
|
104
|
+
export interface TradingCustodyInfo {
|
|
105
|
+
tradingCustodyId: string;
|
|
106
|
+
ouId: string;
|
|
107
|
+
tradingAccountId: string;
|
|
108
|
+
}
|
|
109
|
+
export declare function fetchTradingCustody(suiClient: ClientWithCoreApi, tradingAccountId: string): Promise<TradingCustodyInfo>;
|
|
110
|
+
export declare function extractCreatedTradingCustody(createdObjects: CreatedObject[]): {
|
|
111
|
+
tradingCustodyId: string;
|
|
112
|
+
tradingAccountId: string;
|
|
113
|
+
} | null;
|
|
114
|
+
export declare function withEnabledTypeKey(action: OuProposalAction, bindings: Map<string, string>): OuProposalAction;
|