@trinaryex/sdk 3.9.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/DESIGN.md +253 -71
  2. package/README.md +218 -16
  3. package/dist/ReadOnlyClient.d.ts +42 -8
  4. package/dist/TriexClient.d.ts +73 -8
  5. package/dist/armature/OrgClient.d.ts +372 -0
  6. package/dist/armature/OrgClientGroups.d.ts +186 -0
  7. package/dist/armature/OrgsApi.d.ts +69 -0
  8. package/dist/armature/actions.d.ts +75 -0
  9. package/dist/armature/create.d.ts +27 -0
  10. package/dist/armature/currency.d.ts +64 -0
  11. package/dist/armature/executors.d.ts +44 -0
  12. package/dist/armature/governance.d.ts +194 -0
  13. package/dist/armature/harness.d.ts +96 -0
  14. package/dist/armature/lifecycle.d.ts +84 -0
  15. package/dist/armature/plan.d.ts +39 -0
  16. package/dist/armature/proposals.d.ts +51 -0
  17. package/dist/armature/queries.d.ts +16 -0
  18. package/dist/armature/schemas.d.ts +559 -0
  19. package/dist/armature/trading.d.ts +114 -0
  20. package/dist/armature/transactions.d.ts +160 -0
  21. package/dist/armature/treasury.d.ts +41 -0
  22. package/dist/armature/tree.d.ts +13 -0
  23. package/dist/armature/types.d.ts +59 -0
  24. package/dist/armature/upgrade.d.ts +27 -0
  25. package/dist/armature/vault.d.ts +94 -0
  26. package/dist/coins/CoinsApi.d.ts +53 -0
  27. package/dist/coins/funding.d.ts +6 -0
  28. package/dist/coins/money.d.ts +36 -0
  29. package/dist/coins/onchain.d.ts +162 -0
  30. package/dist/coins/schemas.d.ts +456 -0
  31. package/dist/coins/transactions.d.ts +82 -0
  32. package/dist/coins/types.d.ts +115 -0
  33. package/dist/errors.d.ts +11 -1
  34. package/dist/funding.d.ts +2 -2
  35. package/dist/http.d.ts +3 -0
  36. package/dist/index.d.ts +63 -8
  37. package/dist/index.js +10587 -959
  38. package/dist/money.d.ts +15 -0
  39. package/dist/moveAbort.d.ts +28 -0
  40. package/dist/moveAbortCatalog.generated.d.ts +9 -0
  41. package/dist/onchain.d.ts +55 -3
  42. package/dist/paging.d.ts +9 -3
  43. package/dist/queries.d.ts +35 -7
  44. package/dist/schemas.d.ts +1911 -50
  45. package/dist/transactions.d.ts +63 -1
  46. package/dist/types.d.ts +116 -7
  47. package/package.json +3 -1
@@ -0,0 +1,372 @@
1
+ import { ClientWithCoreApi } from '@mysten/sui/client';
2
+ import { Transaction } from '@mysten/sui/transactions';
3
+ import { IndexerClient } from '../queries';
4
+ import { PackageIds, TransactionExecutor, TxResult, OrderSide } from '../types';
5
+ import { ArmaturePkgs, ProposalConfigPatch } from './actions';
6
+ import { DaoGovernance } from './governance';
7
+ import { BlockCode, CompositeEligibility, OuCapabilities, OuProposalAction, PathCandidate, ResolvedPlan } from './harness';
8
+ import { CapabilityVaultContents, LiveProposal } from './proposals';
9
+ import { ProposalConfigInput } from './transactions';
10
+ import { OrderFlags } from './trading';
11
+ import { OuVaultInfo } from './vault';
12
+ import { TreasuryCoinBalance } from './treasury';
13
+ import { HubDaoVault, Org, OrgNode, OrgSeat, OuExecContext, ProposalSummary, VaultPrincipal, VaultRole } from './types';
14
+ import { UpgradeBuild } from './upgrade';
15
+ import { OrgCapabilitiesApi, OrgCurrencyApi, OrgEntriesApi, OrgFreezeApi, OrgUnitsApi, OrgUpgradeApi } from './OrgClientGroups';
16
+ export type RunOutcome = {
17
+ status: 'executed';
18
+ digest: string;
19
+ } | {
20
+ status: 'proposed';
21
+ digest: string;
22
+ proposalId?: string;
23
+ } | {
24
+ status: 'blocked';
25
+ code: BlockCode;
26
+ reason: string;
27
+ };
28
+ export interface RunOptions {
29
+ unitId?: string;
30
+ metadataIpfs?: string;
31
+ }
32
+ export interface ExecuteOptions {
33
+ freezeAdminCapId?: string;
34
+ treasuryCapId?: string;
35
+ upgrade?: UpgradeBuild;
36
+ deleteFrame?: boolean;
37
+ }
38
+ export interface OrgHandleDeps {
39
+ suiClient: ClientWithCoreApi;
40
+ indexer: IndexerClient;
41
+ ids: PackageIds;
42
+ requireExecutor: () => TransactionExecutor;
43
+ address: string;
44
+ }
45
+ export declare class OrgHandle {
46
+ readonly deps: OrgHandleDeps;
47
+ readonly org: Org;
48
+ readonly nodes: OrgNode[];
49
+ readonly seats: OrgSeat[];
50
+ readonly seat: OrgSeat | null;
51
+ readonly governance: OrgGovernanceApi;
52
+ readonly members: OrgMembersApi;
53
+ readonly metadata: OrgMetadataApi;
54
+ readonly types: OrgTypesApi;
55
+ readonly treasury: OrgTreasuryApi;
56
+ readonly orders: OrgOrdersApi;
57
+ readonly vault: OrgVaultApi;
58
+ readonly currency: OrgCurrencyApi;
59
+ readonly units: OrgUnitsApi;
60
+ readonly freeze: OrgFreezeApi;
61
+ readonly entries: OrgEntriesApi;
62
+ readonly upgrade: OrgUpgradeApi;
63
+ readonly capabilities: OrgCapabilitiesApi;
64
+ private readonly govCache;
65
+ private readonly memberCache;
66
+ private readonly vaultCache;
67
+ constructor(deps: OrgHandleDeps, org: Org, preferredSeatDaoId?: string | null);
68
+ get orgId(): string;
69
+ as(daoId: string): OrgHandle;
70
+ requireSeat(): OrgSeat;
71
+ requireContext(): OuExecContext;
72
+ contextFor(unitId?: string): OuExecContext;
73
+ requireNode(unitId?: string): OrgNode;
74
+ pkgs(): ArmaturePkgs;
75
+ aliases(): Map<string, string>;
76
+ gov(daoId: string): Promise<DaoGovernance>;
77
+ isMember(daoId: string): Promise<boolean | undefined>;
78
+ capabilityVault(vaultId: string): Promise<CapabilityVaultContents>;
79
+ capsFor(action: OuProposalAction, ctx: OuExecContext): Promise<OuCapabilities>;
80
+ refresh(): void;
81
+ requireTreasuryId(override?: string): string;
82
+ submit(tx: Transaction): Promise<TxResult>;
83
+ }
84
+ declare class OrgGovernanceApi {
85
+ private readonly h;
86
+ constructor(h: OrgHandle);
87
+ read(daoId?: string): Promise<DaoGovernance>;
88
+ resolve(action: OuProposalAction, opts?: RunOptions): Promise<ResolvedPlan>;
89
+ paths(action: OuProposalAction, opts?: {
90
+ unitId?: string;
91
+ }): Promise<PathCandidate[]>;
92
+ run(action: OuProposalAction, opts?: RunOptions): Promise<RunOutcome>;
93
+ runBatch(actions: OuProposalAction[], opts?: RunOptions): Promise<RunOutcome>;
94
+ canComposite(actions: OuProposalAction[], opts?: {
95
+ unitId?: string;
96
+ }): Promise<CompositeEligibility>;
97
+ runComposite(actions: OuProposalAction[], opts?: RunOptions): Promise<RunOutcome>;
98
+ proposals(): Promise<ProposalSummary[]>;
99
+ proposal(proposalId: string): Promise<LiveProposal | null>;
100
+ private summary;
101
+ private locate;
102
+ vote(params: {
103
+ proposalId: string;
104
+ approve: boolean;
105
+ payloadType?: string;
106
+ unitId?: string;
107
+ }): Promise<TxResult>;
108
+ deleteExpired(params: {
109
+ proposalIds: string[];
110
+ payloadTypes?: Record<string, string>;
111
+ }): Promise<TxResult>;
112
+ expired(): Promise<LiveProposal[]>;
113
+ deleteExhaustedFrame(frameId: string): Promise<TxResult>;
114
+ execute(proposalId: string, opts?: ExecuteOptions): Promise<TxResult>;
115
+ private passedContext;
116
+ private execPlanned;
117
+ }
118
+ declare class OrgMembersApi {
119
+ private readonly h;
120
+ constructor(h: OrgHandle);
121
+ add(addresses: string[], opts?: RunOptions): Promise<RunOutcome>;
122
+ remove(addresses: string[], opts?: RunOptions): Promise<RunOutcome>;
123
+ setBoard(change: {
124
+ add?: string[];
125
+ remove?: string[];
126
+ }, opts?: RunOptions): Promise<RunOutcome>;
127
+ }
128
+ declare class OrgMetadataApi {
129
+ private readonly h;
130
+ constructor(h: OrgHandle);
131
+ update(params: {
132
+ metadataUri: string;
133
+ charterId?: string;
134
+ unitId?: string;
135
+ metadataIpfs?: string;
136
+ }): Promise<RunOutcome>;
137
+ }
138
+ declare class OrgTypesApi {
139
+ private readonly h;
140
+ constructor(h: OrgHandle);
141
+ enable(params: {
142
+ typeKey: string;
143
+ moveType: string;
144
+ config: ProposalConfigInput;
145
+ composableAllowed?: boolean;
146
+ }, opts?: RunOptions): Promise<RunOutcome>;
147
+ disable(typeKey: string, opts?: RunOptions): Promise<RunOutcome>;
148
+ updateConfig(typeKey: string, patch: ProposalConfigPatch, opts?: RunOptions): Promise<RunOutcome>;
149
+ enableComposite(opts?: RunOptions): Promise<RunOutcome>;
150
+ enableSendCoin(coinType?: string, opts?: RunOptions): Promise<RunOutcome>;
151
+ enableSendCoinToOrg(coinType?: string, opts?: RunOptions): Promise<RunOutcome>;
152
+ enableSendSmallPayment(params?: {
153
+ coinType?: string;
154
+ config?: ProposalConfigInput;
155
+ }, opts?: RunOptions): Promise<RunOutcome>;
156
+ enableTrading(params?: {
157
+ quoteType?: string;
158
+ }, opts?: RunOptions): Promise<RunOutcome>;
159
+ }
160
+ declare class OrgTreasuryApi {
161
+ private readonly h;
162
+ constructor(h: OrgHandle);
163
+ balances(treasuryVaultId?: string): Promise<TreasuryCoinBalance[]>;
164
+ balance(coinType?: string, treasuryVaultId?: string): Promise<bigint>;
165
+ deposit(params: {
166
+ amount: bigint;
167
+ coinType?: string;
168
+ treasuryVaultId?: string;
169
+ }): Promise<TxResult>;
170
+ claim(params: {
171
+ coinObjectIds: string[];
172
+ coinType?: string;
173
+ treasuryVaultId?: string;
174
+ }): Promise<TxResult>;
175
+ send(params: {
176
+ recipient: string;
177
+ amount: bigint;
178
+ coinType?: string;
179
+ treasuryVaultId?: string;
180
+ }, opts?: RunOptions): Promise<RunOutcome>;
181
+ sendToOrg(params: {
182
+ recipientTreasuryId: string;
183
+ amount: bigint;
184
+ coinType?: string;
185
+ treasuryVaultId?: string;
186
+ }, opts?: RunOptions): Promise<RunOutcome>;
187
+ sendSmall(params: {
188
+ recipient: string;
189
+ amount: bigint;
190
+ coinType?: string;
191
+ treasuryVaultId?: string;
192
+ }, opts?: RunOptions): Promise<RunOutcome>;
193
+ }
194
+ export interface OrgSweepSkip {
195
+ storageUnitId: string;
196
+ assetId: bigint;
197
+ amount: bigint;
198
+ reason: 'no-vault' | 'unlinked';
199
+ }
200
+ export interface OrgLimitOrderParams extends OrderFlags {
201
+ storageUnitId: string;
202
+ assetId: string;
203
+ side: OrderSide;
204
+ price: bigint;
205
+ quantity: bigint;
206
+ expireAt?: bigint;
207
+ quoteType?: string;
208
+ }
209
+ export interface OrgCoinLimitOrderParams extends OrderFlags {
210
+ poolId: string;
211
+ baseType: string;
212
+ quoteType?: string;
213
+ side: OrderSide;
214
+ price: bigint;
215
+ quantity: bigint;
216
+ expireAt?: bigint;
217
+ depositAmount?: bigint;
218
+ treasuryVaultId?: string;
219
+ }
220
+ export interface OrgTradingAccountCreated {
221
+ tradingAccountId?: string;
222
+ tradingCustodyId?: string;
223
+ }
224
+ declare class OrgOrdersApi {
225
+ private readonly h;
226
+ private readonly custodies;
227
+ private created;
228
+ constructor(h: OrgHandle);
229
+ ensureAccount(): Promise<RunOutcome & OrgTradingAccountCreated>;
230
+ private target;
231
+ private resolvePool;
232
+ limit(params: OrgLimitOrderParams): Promise<RunOutcome>;
233
+ market(params: {
234
+ storageUnitId: string;
235
+ assetId: string;
236
+ side: OrderSide;
237
+ quantity: bigint;
238
+ quoteType?: string;
239
+ selfMatchingOption?: number;
240
+ }): Promise<RunOutcome>;
241
+ cancel(params: {
242
+ storageUnitId: string;
243
+ assetId: string;
244
+ orderId: bigint;
245
+ quoteType?: string;
246
+ }): Promise<RunOutcome>;
247
+ buyFromTreasury(params: OrgLimitOrderParams & {
248
+ depositAmount?: bigint;
249
+ treasuryVaultId?: string;
250
+ bidFeeRate?: bigint;
251
+ }): Promise<RunOutcome>;
252
+ sellFromVault(params: OrgLimitOrderParams & {
253
+ vaultId?: string;
254
+ vaultQuantity?: bigint;
255
+ registrantOrgId?: string;
256
+ }): Promise<RunOutcome>;
257
+ deposit(params: {
258
+ amount: bigint;
259
+ coinType?: string;
260
+ treasuryVaultId?: string;
261
+ }): Promise<RunOutcome>;
262
+ limitCoin(params: OrgCoinLimitOrderParams): Promise<RunOutcome>;
263
+ cancelCoin(params: {
264
+ poolId: string;
265
+ baseType: string;
266
+ quoteType?: string;
267
+ orderId: bigint;
268
+ }): Promise<RunOutcome>;
269
+ enableCoinPair(params: {
270
+ baseType: string;
271
+ quoteType?: string;
272
+ }): Promise<RunOutcome>;
273
+ createPool(params: {
274
+ assetId: bigint;
275
+ storageUnitId?: string;
276
+ collectionId?: string;
277
+ quoteType?: string;
278
+ treasuryVaultId?: string;
279
+ }): Promise<RunOutcome>;
280
+ sweepCoin(params: {
281
+ amount: bigint;
282
+ coinType?: string;
283
+ treasuryVaultId?: string;
284
+ claimFromPool?: string;
285
+ claimFromCoinPool?: {
286
+ poolId: string;
287
+ baseType: string;
288
+ quoteType?: string;
289
+ };
290
+ }): Promise<RunOutcome>;
291
+ sweepItems(params: {
292
+ storageUnitId: string;
293
+ assetId: bigint;
294
+ amount: bigint;
295
+ vaultId?: string;
296
+ collectionId?: string;
297
+ registrantOrgId?: string;
298
+ claimFromPool?: string;
299
+ quoteType?: string;
300
+ }): Promise<RunOutcome>;
301
+ sweepAll(params?: {
302
+ quoteType?: string;
303
+ treasuryVaultId?: string;
304
+ includeCurrency?: boolean;
305
+ }): Promise<RunOutcome & {
306
+ skipped: OrgSweepSkip[];
307
+ }>;
308
+ }
309
+ declare class OrgVaultApi {
310
+ private readonly h;
311
+ constructor(h: OrgHandle);
312
+ atHub(hubId: string): Promise<HubDaoVault[]>;
313
+ resolve(params: {
314
+ storageUnitId: string;
315
+ registrantOrgId?: string;
316
+ }): Promise<string | null>;
317
+ info(vaultId: string): Promise<OuVaultInfo | null>;
318
+ balance(vaultId: string, assetId: bigint): Promise<bigint>;
319
+ init(params: {
320
+ storageUnitId: string;
321
+ vaultConfigId?: string;
322
+ depositPrincipals?: VaultPrincipal[];
323
+ withdrawPrincipals?: VaultPrincipal[];
324
+ editPrincipals?: VaultPrincipal[];
325
+ }): Promise<TxResult>;
326
+ deposit(params: {
327
+ storageUnitId: string;
328
+ items: {
329
+ assetId: bigint;
330
+ amount: bigint;
331
+ }[];
332
+ registrantOrgId?: string;
333
+ vaultId?: string;
334
+ }): Promise<TxResult>;
335
+ withdraw(params: {
336
+ storageUnitId: string;
337
+ items: {
338
+ assetId: bigint;
339
+ amount: bigint;
340
+ }[];
341
+ to?: 'wallet' | 'hangar';
342
+ characterId?: string;
343
+ registrantOrgId?: string;
344
+ vaultId?: string;
345
+ }): Promise<TxResult>;
346
+ grant(params: {
347
+ vaultId: string;
348
+ grants: {
349
+ role: VaultRole;
350
+ principal: VaultPrincipal;
351
+ }[];
352
+ editorOuId?: string;
353
+ }): Promise<TxResult>;
354
+ revoke(params: {
355
+ vaultId: string;
356
+ revocations: {
357
+ role: VaultRole;
358
+ principal: VaultPrincipal;
359
+ }[];
360
+ editorOuId?: string;
361
+ }): Promise<TxResult>;
362
+ rekey(params: {
363
+ vaultId: string;
364
+ newRegistrantOrgId: string;
365
+ editorOuId?: string;
366
+ }): Promise<TxResult>;
367
+ deinit(params: {
368
+ vaultId: string;
369
+ editorOuId?: string;
370
+ }): Promise<TxResult>;
371
+ }
372
+ export {};
@@ -0,0 +1,186 @@
1
+ import { TxResult } from '../types';
2
+ import { FreezeState } from './governance';
3
+ import { SpinOutConfigs } from './lifecycle';
4
+ import { OrgHandle, RunOptions, RunOutcome } from './OrgClient';
5
+ import { CapabilityVaultContents, EncryptedEntry } from './proposals';
6
+ import { ProposalConfigInput } from './transactions';
7
+ import { UpgradeBuild } from './upgrade';
8
+ export declare class OrgCurrencyApi {
9
+ private readonly h;
10
+ constructor(h: OrgHandle);
11
+ private ids;
12
+ enable(params: {
13
+ coinType: string;
14
+ config?: ProposalConfigInput;
15
+ }, opts?: RunOptions): Promise<RunOutcome>;
16
+ adopt(params: {
17
+ coinType: string;
18
+ treasuryCapId: string;
19
+ }, opts?: RunOptions): Promise<RunOutcome>;
20
+ mint(params: {
21
+ coinType: string;
22
+ treasuryCapId: string;
23
+ amount: bigint;
24
+ recipient?: string;
25
+ }, opts?: RunOptions): Promise<RunOutcome>;
26
+ mintAllowance(params: {
27
+ coinType: string;
28
+ treasuryCapId: string;
29
+ amount: bigint;
30
+ recipient?: string;
31
+ }, opts?: RunOptions): Promise<RunOutcome>;
32
+ configureAllowance(params: {
33
+ coinType: string;
34
+ addMinters?: string[];
35
+ removeMinters?: string[];
36
+ maxPerCall?: bigint;
37
+ enabled?: boolean;
38
+ }, opts?: RunOptions): Promise<RunOutcome>;
39
+ mintWithAllowance(params: {
40
+ coinType: string;
41
+ treasuryCapId: string;
42
+ amount: bigint;
43
+ recipient?: string;
44
+ bypassCapId?: string;
45
+ unitId?: string;
46
+ }): Promise<TxResult>;
47
+ burn(params: {
48
+ coinType: string;
49
+ treasuryCapId: string;
50
+ amount: bigint;
51
+ }, opts?: RunOptions): Promise<RunOutcome>;
52
+ returnCap(params: {
53
+ coinType: string;
54
+ treasuryCapId: string;
55
+ recipient: string;
56
+ }, opts?: RunOptions): Promise<RunOutcome>;
57
+ }
58
+ export declare class OrgUnitsApi {
59
+ private readonly h;
60
+ constructor(h: OrgHandle);
61
+ private child;
62
+ private capType;
63
+ create(params: {
64
+ name: string;
65
+ board: string[];
66
+ metadataUri: string;
67
+ }, opts?: RunOptions): Promise<RunOutcome>;
68
+ pause(params: {
69
+ unitId: string;
70
+ }, opts?: RunOptions): Promise<RunOutcome>;
71
+ unpause(params: {
72
+ unitId: string;
73
+ }, opts?: RunOptions): Promise<RunOutcome>;
74
+ transferCap(params: {
75
+ unitId: string;
76
+ capId: string;
77
+ capType?: string;
78
+ }, opts?: RunOptions): Promise<RunOutcome>;
79
+ reclaimCap(params: {
80
+ unitId: string;
81
+ capId: string;
82
+ capType?: string;
83
+ }, opts?: RunOptions): Promise<RunOutcome>;
84
+ spinOut(params: {
85
+ unitId: string;
86
+ freezeAdminCapId?: string;
87
+ configs?: Partial<SpinOutConfigs>;
88
+ }, opts?: RunOptions): Promise<RunOutcome>;
89
+ spawnSuccessor(params: {
90
+ board: string[];
91
+ name: string;
92
+ metadataUri: string;
93
+ }, opts?: RunOptions): Promise<RunOutcome>;
94
+ transferAssets(params: {
95
+ targetOuId: string;
96
+ coinTypes?: string[];
97
+ capIds?: string[];
98
+ }, opts?: RunOptions): Promise<RunOutcome>;
99
+ destroy(params: {
100
+ unitId: string;
101
+ }): Promise<TxResult>;
102
+ }
103
+ export declare class OrgFreezeApi {
104
+ private readonly h;
105
+ constructor(h: OrgHandle);
106
+ private freezeId;
107
+ read(unitId?: string): Promise<FreezeState>;
108
+ freezeType(params: {
109
+ moveType: string;
110
+ freezeAdminCapId: string;
111
+ unitId?: string;
112
+ }): Promise<TxResult>;
113
+ unfreezeType(params: {
114
+ moveType: string;
115
+ freezeAdminCapId: string;
116
+ unitId?: string;
117
+ }): Promise<TxResult>;
118
+ unfreeze(params: {
119
+ moveType: string;
120
+ }, opts?: RunOptions): Promise<RunOutcome>;
121
+ setMaxDuration(params: {
122
+ maxFreezeDurationMs: number;
123
+ }, opts?: RunOptions): Promise<RunOutcome>;
124
+ updateExempt(params: {
125
+ add?: string[];
126
+ remove?: string[];
127
+ }, opts?: RunOptions): Promise<RunOutcome>;
128
+ transferAdmin(params: {
129
+ newAdmin: string;
130
+ freezeAdminCapId: string;
131
+ }, opts?: RunOptions): Promise<RunOutcome>;
132
+ }
133
+ export declare class OrgEntriesApi {
134
+ private readonly h;
135
+ constructor(h: OrgHandle);
136
+ private unit;
137
+ list(unitId?: string): Promise<EncryptedEntry[]>;
138
+ publish(params: {
139
+ location: string;
140
+ description: string;
141
+ unitId?: string;
142
+ }): Promise<TxResult>;
143
+ update(params: {
144
+ entryId: string;
145
+ location: string;
146
+ unitId?: string;
147
+ }): Promise<TxResult>;
148
+ edit(params: {
149
+ entryId: string;
150
+ location: string;
151
+ unitId?: string;
152
+ }): Promise<TxResult>;
153
+ rotateEpoch(params?: {
154
+ unitId?: string;
155
+ }): Promise<TxResult>;
156
+ remove(params: {
157
+ entryId: string;
158
+ unitId?: string;
159
+ }): Promise<TxResult>;
160
+ }
161
+ export declare class OrgUpgradeApi {
162
+ private readonly h;
163
+ constructor(h: OrgHandle);
164
+ propose(params: {
165
+ capId: string;
166
+ packageId: string;
167
+ digest: number[] | Uint8Array;
168
+ policy?: number;
169
+ build?: UpgradeBuild;
170
+ }, opts?: RunOptions): Promise<RunOutcome>;
171
+ }
172
+ export declare class OrgCapabilitiesApi {
173
+ private readonly h;
174
+ constructor(h: OrgHandle);
175
+ list(unitId?: string): Promise<CapabilityVaultContents>;
176
+ enableBypass(params: {
177
+ typeKey: string;
178
+ moveType: string;
179
+ config: ProposalConfigInput;
180
+ }, opts?: RunOptions): Promise<RunOutcome>;
181
+ disableBypass(params: {
182
+ moveType: string;
183
+ typeKey?: string;
184
+ capId?: string;
185
+ }, opts?: RunOptions): Promise<RunOutcome>;
186
+ }
@@ -0,0 +1,69 @@
1
+ import { ClientWithCoreApi } from '@mysten/sui/client';
2
+ import { IndexerClient } from '../queries';
3
+ import { PackageIds, TransactionExecutor, TxResult } from '../types';
4
+ import { TypeInitInput } from './create';
5
+ import { AccessibleKeyspace, HubDaoVault, Org, OrgDirectoryPage, OrgDirectoryParams, OrgNode, OrgSearchParams, OrgSearchResult, OrgSeat, ProposalSummary } from './types';
6
+ export declare class OrgsApi {
7
+ private readonly indexer;
8
+ private readonly requireAddress;
9
+ constructor(indexer: IndexerClient, requireAddress: (override?: string) => string);
10
+ get(orgId: string): Promise<Org>;
11
+ batch(orgIds: string[]): Promise<Org[]>;
12
+ directory(params?: OrgDirectoryParams): Promise<OrgDirectoryPage>;
13
+ forPlayer(address?: string): Promise<Org[]>;
14
+ search(q: string, params?: OrgSearchParams): Promise<OrgSearchResult[]>;
15
+ proposals(orgId: string): Promise<ProposalSummary[]>;
16
+ accessibleKeyspaces(address?: string, role?: 'grant' | 'read' | 'write'): Promise<AccessibleKeyspace[]>;
17
+ vaultsAtHub(hubId: string): Promise<HubDaoVault[]>;
18
+ nodes(orgId: string): Promise<OrgNode[]>;
19
+ seats(orgId: string, address?: string): Promise<OrgSeat[]>;
20
+ seat(orgId: string, preferredDaoId?: string | null, address?: string): Promise<OrgSeat | null>;
21
+ tradingAccount(orgId: string): Promise<{
22
+ tradingAccountId: string;
23
+ node: OrgNode;
24
+ } | null>;
25
+ }
26
+ export interface CreateOrgParams {
27
+ name: string;
28
+ metadataUri: string;
29
+ officers?: string[];
30
+ members?: string[];
31
+ board?: string[];
32
+ officerName?: string;
33
+ memberName?: string;
34
+ officerMetadataUri?: string;
35
+ memberMetadataUri?: string;
36
+ freezeAdmin?: string;
37
+ enableTrading?: boolean;
38
+ quoteType?: string;
39
+ overrides?: {
40
+ org?: TypeInitInput[];
41
+ officers?: TypeInitInput[];
42
+ members?: TypeInitInput[];
43
+ };
44
+ }
45
+ export interface CreatedOrg extends TxResult {
46
+ orgId: string;
47
+ officersId: string;
48
+ membersId: string;
49
+ }
50
+ export interface CreatedOu extends TxResult {
51
+ ouId: string | undefined;
52
+ }
53
+ export interface OrgsWriteDeps {
54
+ suiClient: ClientWithCoreApi;
55
+ ids: PackageIds;
56
+ requireExecutor: () => TransactionExecutor;
57
+ }
58
+ export declare class OrgsWriteApi extends OrgsApi {
59
+ private readonly addressOf;
60
+ private readonly w;
61
+ constructor(indexer: IndexerClient, addressOf: (override?: string) => string, w: OrgsWriteDeps);
62
+ create(params: CreateOrgParams): Promise<CreatedOrg>;
63
+ createStandalone(params: {
64
+ name: string;
65
+ metadataUri: string;
66
+ board?: string[];
67
+ }): Promise<CreatedOu>;
68
+ private identifyTiers;
69
+ }
@@ -0,0 +1,75 @@
1
+ import { Transaction } from '@mysten/sui/transactions';
2
+ import { OuProposalAction } from './harness';
3
+ import { ProposalConfigInput } from './transactions';
4
+ export interface ArmaturePkgs {
5
+ armature: string;
6
+ armatureProposals: string;
7
+ }
8
+ export declare const TRADING_TYPE_CONFIG: ProposalConfigInput;
9
+ export declare const GOVERNANCE_TYPE_CONFIG: ProposalConfigInput;
10
+ export declare const TREASURY_TYPE_CONFIG: ProposalConfigInput;
11
+ export declare const WHOLE_BOARD_TYPE_CONFIG: ProposalConfigInput;
12
+ export declare const COMPOSITE_TYPE_CONFIG: ProposalConfigInput;
13
+ export declare function subOuControlType(armature: string): string;
14
+ export declare function sendCoinTypeKey(coinType: string): string;
15
+ export declare function sendCoinToOuTypeKey(coinType: string): string;
16
+ export declare function genericTypeKey(name: string, typeArg: string): string;
17
+ export declare const DEFAULT_SLOT_TYPES: Record<string, string>;
18
+ export interface TradingTypeEntry {
19
+ typeKey: string;
20
+ moveType: string;
21
+ permissions: number;
22
+ }
23
+ export declare function tradingTypeEntries(tradingPkg: string, quoteType: string, baseTypes?: string[]): TradingTypeEntry[];
24
+ export declare function enableProposalTypeAction(pkgs: ArmaturePkgs, opts: {
25
+ kind: string;
26
+ enabledTypeKey: string;
27
+ enabledMoveType: string;
28
+ config: ProposalConfigInput;
29
+ composableAllowed?: boolean;
30
+ fallbackPolicy?: OuProposalAction['fallbackPolicy'];
31
+ }): OuProposalAction;
32
+ export declare function disableProposalTypeAction(pkgs: ArmaturePkgs, typeKey: string): OuProposalAction;
33
+ export declare function enableSendCoinAction(pkgs: ArmaturePkgs, coinType: string): OuProposalAction;
34
+ export declare function enableSendCoinToOuAction(pkgs: ArmaturePkgs, coinType: string): OuProposalAction;
35
+ export declare function enableCompositeAction(pkgs: ArmaturePkgs): OuProposalAction;
36
+ export declare function enableTradingActions(pkgs: ArmaturePkgs, opts: {
37
+ armatureTrading: string;
38
+ quoteType: string;
39
+ alreadyEnabled?: Set<string>;
40
+ baseTypes?: string[];
41
+ }): OuProposalAction[];
42
+ export interface ProposalConfigPatch {
43
+ quorum?: number;
44
+ approvalThreshold?: number;
45
+ proposeThreshold?: number;
46
+ expiryMs?: number;
47
+ executionDelayMs?: number;
48
+ cooldownMs?: number;
49
+ composableAllowed?: boolean;
50
+ permissions?: number;
51
+ borrowScope?: string[];
52
+ }
53
+ export declare function updateProposalConfigAction(pkgs: ArmaturePkgs, targetTypeKey: string, patch?: ProposalConfigPatch): OuProposalAction;
54
+ export declare function enableBypassTypeAction(pkgs: ArmaturePkgs, opts: {
55
+ typeKey: string;
56
+ moveType: string;
57
+ config: ProposalConfigInput;
58
+ capabilityVaultId: string;
59
+ }): OuProposalAction;
60
+ export declare function disableBypassTypeAction(pkgs: ArmaturePkgs, opts: {
61
+ typeKey: string;
62
+ moveType: string;
63
+ capId: string;
64
+ capabilityVaultId: string;
65
+ }): OuProposalAction;
66
+ export declare function addMembersAction(pkgs: ArmaturePkgs, addresses: string[]): OuProposalAction;
67
+ export declare function removeMembersAction(pkgs: ArmaturePkgs, addresses: string[]): OuProposalAction;
68
+ export declare function addMemberAction(pkgs: ArmaturePkgs, address: string): OuProposalAction;
69
+ export declare function removeMemberAction(pkgs: ArmaturePkgs, address: string): OuProposalAction;
70
+ export declare function setBoardAction(pkgs: ArmaturePkgs, change: {
71
+ add?: string[];
72
+ remove?: string[];
73
+ }): OuProposalAction;
74
+ export declare function updateMetadataAction(pkgs: ArmaturePkgs, metadataUri: string, charterId: string): OuProposalAction;
75
+ export type { Transaction };