@trinaryex/mcp 3.8.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.
- package/README.md +73 -7
- package/dist/capture.d.ts +1 -1
- package/dist/capture.js +1 -1
- package/dist/context.d.ts +10 -2
- package/dist/context.js +2 -1
- package/dist/context.js.map +1 -1
- package/dist/registry.js +34 -2
- package/dist/registry.js.map +1 -1
- package/dist/schemas.d.ts +30 -0
- package/dist/schemas.js +45 -0
- package/dist/schemas.js.map +1 -1
- package/dist/tools/coins.d.ts +2 -0
- package/dist/tools/coins.js +146 -0
- package/dist/tools/coins.js.map +1 -0
- package/dist/tools/coinsPrepare.d.ts +2 -0
- package/dist/tools/coinsPrepare.js +446 -0
- package/dist/tools/coinsPrepare.js.map +1 -0
- package/dist/tools/org.d.ts +2 -0
- package/dist/tools/org.js +422 -0
- package/dist/tools/org.js.map +1 -0
- package/dist/tools/orgCommon.d.ts +144 -0
- package/dist/tools/orgCommon.js +210 -0
- package/dist/tools/orgCommon.js.map +1 -0
- package/dist/tools/orgLifecycle.d.ts +2 -0
- package/dist/tools/orgLifecycle.js +753 -0
- package/dist/tools/orgLifecycle.js.map +1 -0
- package/dist/tools/orgPrepare.d.ts +2 -0
- package/dist/tools/orgPrepare.js +1056 -0
- package/dist/tools/orgPrepare.js.map +1 -0
- package/dist/tools/prepare.d.ts +12 -0
- package/dist/tools/prepare.js +119 -7
- package/dist/tools/prepare.js.map +1 -1
- package/dist/tools/read.js +369 -26
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/world.d.ts +2 -0
- package/dist/tools/world.js +208 -0
- package/dist/tools/world.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { big, bigOpt, objectId, suiAddress, u64 } from '../schemas.js';
|
|
3
|
+
import { ACTING_SYNTHETIC, FLAT_CONFIG_SYNTHETIC, PREPARE_SUFFIX, actingShape, assembleConfig, flatConfigShape, openOrg as org, preparedGovernance, proposalConfig, runOptions, runOptionsShape, } from './orgCommon.js';
|
|
4
|
+
/**
|
|
5
|
+
* The cycle-7 Armature groups, prepared unsigned: the organization's own coin,
|
|
6
|
+
* sub-unit lifecycle and parent→child control, the emergency freeze, encrypted
|
|
7
|
+
* entries, governed upgrades, bypass execution, and creating organizations.
|
|
8
|
+
*
|
|
9
|
+
* The return type of each SDK method is its authorization model, and the tools
|
|
10
|
+
* inherit it: a `RunOutcome` method is resolved per caller and may come back
|
|
11
|
+
* `proposed` (check `intent.outcome`), while a cap-holder, member-gated or
|
|
12
|
+
* permissionless method builds one direct call and always reports `executed`.
|
|
13
|
+
*/
|
|
14
|
+
const coinTypeIn = z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1)
|
|
17
|
+
.describe('Fully-qualified Move coin type of the organization’s currency.');
|
|
18
|
+
const treasuryCapId = objectId.describe('The TreasuryCap<T> object id (held in the unit’s capability vault).');
|
|
19
|
+
const moveTypeIn = z
|
|
20
|
+
.string()
|
|
21
|
+
.min(1)
|
|
22
|
+
.describe('Fully-qualified payload Move type, e.g. "0x…::send_coin::SendCoin<0x…::cred::CRED>".');
|
|
23
|
+
const unitTarget = objectId.describe('The CHILD unit to act on; its parent’s board decides.');
|
|
24
|
+
const typeInit = z.object({
|
|
25
|
+
moveType: z.string().min(1),
|
|
26
|
+
displayKey: z.string().min(1),
|
|
27
|
+
config: proposalConfig,
|
|
28
|
+
});
|
|
29
|
+
export const orgLifecycleTools = [
|
|
30
|
+
// ─── creating organizations ────────────────────────────────────────────────
|
|
31
|
+
{
|
|
32
|
+
name: 'prepare_org_create',
|
|
33
|
+
title: 'Prepare: create an organization',
|
|
34
|
+
description: 'Create a three-tier organization in one transaction (tribe_setup::create_tribe_configured): a root unit plus officers and members units, controls wired and the controller types enabled. The sender sits on all three boards and receives the root’s FreezeAdminCap; the sub-units’ caps go to freezeAdmin (default: the sender). The trading types are enabled on the officers unit unless enableTrading is false. Metadata URIs must already be uploaded. The new unit ids are created objects in the effects once submitted.' +
|
|
35
|
+
PREPARE_SUFFIX,
|
|
36
|
+
kind: 'prepare',
|
|
37
|
+
sdkPath: 'orgs.create',
|
|
38
|
+
inputShape: {
|
|
39
|
+
sender: actingShape.sender,
|
|
40
|
+
name: z.string().min(1),
|
|
41
|
+
metadataUri: z.string().min(1),
|
|
42
|
+
board: z
|
|
43
|
+
.array(suiAddress)
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('Root board; defaults to [sender].'),
|
|
46
|
+
officers: z
|
|
47
|
+
.array(suiAddress)
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Officers (the sender is always added).'),
|
|
50
|
+
members: z
|
|
51
|
+
.array(suiAddress)
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('Line members (the sender is always added).'),
|
|
54
|
+
officerName: z.string().optional(),
|
|
55
|
+
memberName: z.string().optional(),
|
|
56
|
+
officerMetadataUri: z.string().optional(),
|
|
57
|
+
memberMetadataUri: z.string().optional(),
|
|
58
|
+
freezeAdmin: suiAddress.optional(),
|
|
59
|
+
enableTrading: z.boolean().optional().describe('Default true.'),
|
|
60
|
+
quoteType: z
|
|
61
|
+
.string()
|
|
62
|
+
.optional()
|
|
63
|
+
.describe('Quote coin the trading types are instantiated at; CRED.'),
|
|
64
|
+
overrides: z
|
|
65
|
+
.object({
|
|
66
|
+
org: z.array(typeInit).optional(),
|
|
67
|
+
officers: z.array(typeInit).optional(),
|
|
68
|
+
members: z.array(typeInit).optional(),
|
|
69
|
+
})
|
|
70
|
+
.optional()
|
|
71
|
+
.describe('Extra ou::ProposalTypeInit entries per tier.'),
|
|
72
|
+
},
|
|
73
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_create', { name: args.name }, () => ctx.writeClient(args.sender).orgs.create({
|
|
74
|
+
name: args.name,
|
|
75
|
+
metadataUri: args.metadataUri,
|
|
76
|
+
board: args.board,
|
|
77
|
+
officers: args.officers,
|
|
78
|
+
members: args.members,
|
|
79
|
+
officerName: args.officerName,
|
|
80
|
+
memberName: args.memberName,
|
|
81
|
+
officerMetadataUri: args.officerMetadataUri,
|
|
82
|
+
memberMetadataUri: args.memberMetadataUri,
|
|
83
|
+
freezeAdmin: args.freezeAdmin,
|
|
84
|
+
enableTrading: args.enableTrading,
|
|
85
|
+
quoteType: args.quoteType,
|
|
86
|
+
overrides: args.overrides,
|
|
87
|
+
})),
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'prepare_org_create_standalone',
|
|
91
|
+
title: 'Prepare: create a standalone unit',
|
|
92
|
+
description: 'Create a single standalone OU (ou::create) — default slots, no parent, no children. The board defaults to [sender]. Its id is a created object in the effects once submitted.' +
|
|
93
|
+
PREPARE_SUFFIX,
|
|
94
|
+
kind: 'prepare',
|
|
95
|
+
sdkPath: 'orgs.createStandalone',
|
|
96
|
+
inputShape: {
|
|
97
|
+
sender: actingShape.sender,
|
|
98
|
+
name: z.string().min(1),
|
|
99
|
+
metadataUri: z.string().min(1),
|
|
100
|
+
board: z.array(suiAddress).optional(),
|
|
101
|
+
},
|
|
102
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_create_standalone', { name: args.name }, () => ctx.writeClient(args.sender).orgs.createStandalone({
|
|
103
|
+
name: args.name,
|
|
104
|
+
metadataUri: args.metadataUri,
|
|
105
|
+
board: args.board,
|
|
106
|
+
})),
|
|
107
|
+
},
|
|
108
|
+
// ─── currency ──────────────────────────────────────────────────────────────
|
|
109
|
+
{
|
|
110
|
+
name: 'prepare_org_currency_enable',
|
|
111
|
+
title: 'Prepare: enable the currency types for a coin',
|
|
112
|
+
description: 'Enable AdoptCurrency, MintCoin, BurnCoin, ReturnCurrencyCap and ConfigureMintAllowance for one coin, each with the bits and TreasuryCap<T> scope its handler needs, in one transaction. config is the base (default 50% quorum); bit-holding types are lifted to 80% approval automatically. Refused when every type is already enabled.' +
|
|
113
|
+
PREPARE_SUFFIX,
|
|
114
|
+
kind: 'prepare',
|
|
115
|
+
sdkPath: 'org.currency.enable',
|
|
116
|
+
inputShape: {
|
|
117
|
+
...actingShape,
|
|
118
|
+
coinType: coinTypeIn,
|
|
119
|
+
config: proposalConfig.optional(),
|
|
120
|
+
...runOptionsShape,
|
|
121
|
+
},
|
|
122
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
123
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_currency_enable', { coinType: args.coinType }, async () => (await org(ctx, args)).currency.enable({ coinType: args.coinType, config: args.config }, runOptions(args))),
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'prepare_org_currency_adopt',
|
|
127
|
+
title: 'Prepare: hand a coin’s TreasuryCap to the organization',
|
|
128
|
+
description: 'Move a TreasuryCap<T> the EXECUTOR owns into the unit’s capability vault (AdoptCurrency<T>). On a slow path the proposal is executed later with prepare_org_execute_proposal + treasuryCapId, by whoever holds the cap.' +
|
|
129
|
+
PREPARE_SUFFIX,
|
|
130
|
+
kind: 'prepare',
|
|
131
|
+
sdkPath: 'org.currency.adopt',
|
|
132
|
+
inputShape: {
|
|
133
|
+
...actingShape,
|
|
134
|
+
coinType: coinTypeIn,
|
|
135
|
+
treasuryCapId: objectId.describe('The TreasuryCap<T> you own.'),
|
|
136
|
+
...runOptionsShape,
|
|
137
|
+
},
|
|
138
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
139
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_currency_adopt', { coinType: args.coinType, treasuryCapId: args.treasuryCapId }, async () => (await org(ctx, args)).currency.adopt({ coinType: args.coinType, treasuryCapId: args.treasuryCapId }, runOptions(args))),
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'prepare_org_currency_mint',
|
|
143
|
+
title: 'Prepare: mint the organization’s coin by vote',
|
|
144
|
+
description: 'Mint into the unit’s treasury, or to recipient, through MintCoin<T> (VAULT_BORROW on TreasuryCap<T>). Typically a proposal — check intent.outcome.' +
|
|
145
|
+
PREPARE_SUFFIX,
|
|
146
|
+
kind: 'prepare',
|
|
147
|
+
sdkPath: 'org.currency.mint',
|
|
148
|
+
inputShape: {
|
|
149
|
+
...actingShape,
|
|
150
|
+
coinType: coinTypeIn,
|
|
151
|
+
treasuryCapId,
|
|
152
|
+
amount: u64,
|
|
153
|
+
recipient: suiAddress
|
|
154
|
+
.optional()
|
|
155
|
+
.describe('Mint to this address instead of the treasury.'),
|
|
156
|
+
...runOptionsShape,
|
|
157
|
+
},
|
|
158
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
159
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_currency_mint', { coinType: args.coinType, amount: args.amount }, async () => (await org(ctx, args)).currency.mint({
|
|
160
|
+
coinType: args.coinType,
|
|
161
|
+
treasuryCapId: args.treasuryCapId,
|
|
162
|
+
amount: big(args.amount),
|
|
163
|
+
recipient: args.recipient,
|
|
164
|
+
}, runOptions(args))),
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: 'prepare_org_currency_mint_allowance',
|
|
168
|
+
title: 'Prepare: mint through MintAllowance by vote',
|
|
169
|
+
description: 'MintAllowance<T> by vote — the same mechanics as prepare_org_currency_mint under the allowance type. For minting WITHOUT a vote as an allowlisted minter, use prepare_org_currency_mint_with_allowance.' +
|
|
170
|
+
PREPARE_SUFFIX,
|
|
171
|
+
kind: 'prepare',
|
|
172
|
+
sdkPath: 'org.currency.mintAllowance',
|
|
173
|
+
inputShape: {
|
|
174
|
+
...actingShape,
|
|
175
|
+
coinType: coinTypeIn,
|
|
176
|
+
treasuryCapId,
|
|
177
|
+
amount: u64,
|
|
178
|
+
recipient: suiAddress.optional(),
|
|
179
|
+
...runOptionsShape,
|
|
180
|
+
},
|
|
181
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
182
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_currency_mint_allowance', { coinType: args.coinType, amount: args.amount }, async () => (await org(ctx, args)).currency.mintAllowance({
|
|
183
|
+
coinType: args.coinType,
|
|
184
|
+
treasuryCapId: args.treasuryCapId,
|
|
185
|
+
amount: big(args.amount),
|
|
186
|
+
recipient: args.recipient,
|
|
187
|
+
}, runOptions(args))),
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'prepare_org_currency_configure_allowance',
|
|
191
|
+
title: 'Prepare: configure the mint allowance',
|
|
192
|
+
description: 'Set who may mint through the MintAllowance<T> bypass and how much per call (ConfigureMintAllowance<T>, by vote).' +
|
|
193
|
+
PREPARE_SUFFIX,
|
|
194
|
+
kind: 'prepare',
|
|
195
|
+
sdkPath: 'org.currency.configureAllowance',
|
|
196
|
+
inputShape: {
|
|
197
|
+
...actingShape,
|
|
198
|
+
coinType: coinTypeIn,
|
|
199
|
+
addMinters: z.array(suiAddress).optional(),
|
|
200
|
+
removeMinters: z.array(suiAddress).optional(),
|
|
201
|
+
maxPerCall: u64.optional().describe('Upper bound on one bypass mint.'),
|
|
202
|
+
enabled: z.boolean().optional(),
|
|
203
|
+
...runOptionsShape,
|
|
204
|
+
},
|
|
205
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
206
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_currency_configure_allowance', { coinType: args.coinType }, async () => (await org(ctx, args)).currency.configureAllowance({
|
|
207
|
+
coinType: args.coinType,
|
|
208
|
+
addMinters: args.addMinters,
|
|
209
|
+
removeMinters: args.removeMinters,
|
|
210
|
+
maxPerCall: bigOpt(args.maxPerCall),
|
|
211
|
+
enabled: args.enabled,
|
|
212
|
+
}, runOptions(args))),
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: 'prepare_org_currency_mint_with_allowance',
|
|
216
|
+
title: 'Prepare: mint as an allowlisted minter (no vote)',
|
|
217
|
+
description: 'Mint WITHOUT a vote through the MintAllowance<T> bypass (currency_ops::mint_allowance_bypass). Not governance: the SENDER must be an allowlisted minter and amount ≤ max_per_call, or it aborts on-chain. bypassCapId defaults to the vault’s ExternalExecutionCap<MintAllowance<T>> — enable bypass first (prepare_org_enable_bypass).' +
|
|
218
|
+
PREPARE_SUFFIX,
|
|
219
|
+
kind: 'prepare',
|
|
220
|
+
sdkPath: 'org.currency.mintWithAllowance',
|
|
221
|
+
inputShape: {
|
|
222
|
+
...actingShape,
|
|
223
|
+
coinType: coinTypeIn,
|
|
224
|
+
treasuryCapId,
|
|
225
|
+
amount: u64,
|
|
226
|
+
recipient: suiAddress.optional(),
|
|
227
|
+
bypassCapId: objectId.optional(),
|
|
228
|
+
unitId: objectId
|
|
229
|
+
.optional()
|
|
230
|
+
.describe('The unit that holds the TreasuryCap; default the seat.'),
|
|
231
|
+
},
|
|
232
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
233
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_currency_mint_with_allowance', { coinType: args.coinType, amount: args.amount }, async () => (await org(ctx, args)).currency.mintWithAllowance({
|
|
234
|
+
coinType: args.coinType,
|
|
235
|
+
treasuryCapId: args.treasuryCapId,
|
|
236
|
+
amount: big(args.amount),
|
|
237
|
+
recipient: args.recipient,
|
|
238
|
+
bypassCapId: args.bypassCapId,
|
|
239
|
+
unitId: args.unitId,
|
|
240
|
+
})),
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: 'prepare_org_currency_burn',
|
|
244
|
+
title: 'Prepare: burn the organization’s coin',
|
|
245
|
+
description: 'Withdraw an amount from the treasury and burn it (BurnCoin<T>: TREASURY_WITHDRAW + VAULT_BORROW).' +
|
|
246
|
+
PREPARE_SUFFIX,
|
|
247
|
+
kind: 'prepare',
|
|
248
|
+
sdkPath: 'org.currency.burn',
|
|
249
|
+
inputShape: {
|
|
250
|
+
...actingShape,
|
|
251
|
+
coinType: coinTypeIn,
|
|
252
|
+
treasuryCapId,
|
|
253
|
+
amount: u64,
|
|
254
|
+
...runOptionsShape,
|
|
255
|
+
},
|
|
256
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
257
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_currency_burn', { coinType: args.coinType, amount: args.amount }, async () => (await org(ctx, args)).currency.burn({
|
|
258
|
+
coinType: args.coinType,
|
|
259
|
+
treasuryCapId: args.treasuryCapId,
|
|
260
|
+
amount: big(args.amount),
|
|
261
|
+
}, runOptions(args))),
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: 'prepare_org_currency_return_cap',
|
|
265
|
+
title: 'Prepare: give a coin’s TreasuryCap back',
|
|
266
|
+
description: 'Extract the TreasuryCap<T> from the unit’s vault and transfer it to recipient (ReturnCurrencyCap<T>, VAULT_EXTRACT). The organization loses control of the coin’s supply.' +
|
|
267
|
+
PREPARE_SUFFIX,
|
|
268
|
+
kind: 'prepare',
|
|
269
|
+
sdkPath: 'org.currency.returnCap',
|
|
270
|
+
inputShape: {
|
|
271
|
+
...actingShape,
|
|
272
|
+
coinType: coinTypeIn,
|
|
273
|
+
treasuryCapId,
|
|
274
|
+
recipient: suiAddress,
|
|
275
|
+
...runOptionsShape,
|
|
276
|
+
},
|
|
277
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
278
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_currency_return_cap', { coinType: args.coinType, recipient: args.recipient }, async () => (await org(ctx, args)).currency.returnCap({
|
|
279
|
+
coinType: args.coinType,
|
|
280
|
+
treasuryCapId: args.treasuryCapId,
|
|
281
|
+
recipient: args.recipient,
|
|
282
|
+
}, runOptions(args))),
|
|
283
|
+
},
|
|
284
|
+
// ─── sub-units: lifecycle & control ────────────────────────────────────────
|
|
285
|
+
{
|
|
286
|
+
name: 'prepare_org_unit_create',
|
|
287
|
+
title: 'Prepare: create a child unit',
|
|
288
|
+
description: 'Create a child unit under the acting unit (or unitId) via CreateSubOU, wired to its parent’s control. Not a default slot: enable it at ≥80% approval first; blocked on controlled sub-units.' +
|
|
289
|
+
PREPARE_SUFFIX,
|
|
290
|
+
kind: 'prepare',
|
|
291
|
+
sdkPath: 'org.units.create',
|
|
292
|
+
inputShape: {
|
|
293
|
+
...actingShape,
|
|
294
|
+
name: z.string().min(1),
|
|
295
|
+
board: z.array(suiAddress).min(1),
|
|
296
|
+
metadataUri: z.string().min(1),
|
|
297
|
+
...runOptionsShape,
|
|
298
|
+
},
|
|
299
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
300
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_unit_create', { name: args.name, board: args.board }, async () => (await org(ctx, args)).units.create({
|
|
301
|
+
name: args.name,
|
|
302
|
+
board: args.board,
|
|
303
|
+
metadataUri: args.metadataUri,
|
|
304
|
+
}, runOptions(args))),
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
name: 'prepare_org_unit_pause',
|
|
308
|
+
title: 'Prepare: pause a child unit',
|
|
309
|
+
description: 'Pause a child unit’s own executions (PauseSubOUExecution through the parent’s SubOUControl — the parent’s board decides). Refused on the root.' +
|
|
310
|
+
PREPARE_SUFFIX,
|
|
311
|
+
kind: 'prepare',
|
|
312
|
+
sdkPath: 'org.units.pause',
|
|
313
|
+
inputShape: {
|
|
314
|
+
...actingShape,
|
|
315
|
+
unitId: unitTarget,
|
|
316
|
+
metadataIpfs: runOptionsShape.metadataIpfs,
|
|
317
|
+
},
|
|
318
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
319
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_unit_pause', { unitId: args.unitId }, async () => (await org(ctx, args)).units.pause({ unitId: args.unitId }, { metadataIpfs: args.metadataIpfs })),
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
name: 'prepare_org_unit_unpause',
|
|
323
|
+
title: 'Prepare: resume a paused child unit',
|
|
324
|
+
description: 'Lift a parent’s pause on a child unit (UnpauseSubOUExecution).' +
|
|
325
|
+
PREPARE_SUFFIX,
|
|
326
|
+
kind: 'prepare',
|
|
327
|
+
sdkPath: 'org.units.unpause',
|
|
328
|
+
inputShape: {
|
|
329
|
+
...actingShape,
|
|
330
|
+
unitId: unitTarget,
|
|
331
|
+
metadataIpfs: runOptionsShape.metadataIpfs,
|
|
332
|
+
},
|
|
333
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
334
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_unit_unpause', { unitId: args.unitId }, async () => (await org(ctx, args)).units.unpause({ unitId: args.unitId }, { metadataIpfs: args.metadataIpfs })),
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
name: 'prepare_org_unit_transfer_cap',
|
|
338
|
+
title: 'Prepare: move a capability down to a child unit',
|
|
339
|
+
description: 'Move a capability from the parent’s vault into a child’s (TransferCapToSubOU, VAULT_EXTRACT). capType is read from the parent’s vault when omitted.' +
|
|
340
|
+
PREPARE_SUFFIX,
|
|
341
|
+
kind: 'prepare',
|
|
342
|
+
sdkPath: 'org.units.transferCap',
|
|
343
|
+
inputShape: {
|
|
344
|
+
...actingShape,
|
|
345
|
+
unitId: unitTarget,
|
|
346
|
+
capId: objectId,
|
|
347
|
+
capType: z.string().optional(),
|
|
348
|
+
metadataIpfs: runOptionsShape.metadataIpfs,
|
|
349
|
+
},
|
|
350
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
351
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_unit_transfer_cap', { unitId: args.unitId, capId: args.capId }, async () => (await org(ctx, args)).units.transferCap({ unitId: args.unitId, capId: args.capId, capType: args.capType }, { metadataIpfs: args.metadataIpfs })),
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: 'prepare_org_unit_reclaim_cap',
|
|
355
|
+
title: 'Prepare: pull a capability back from a child unit',
|
|
356
|
+
description: 'Pull a capability out of a child’s vault back into the parent’s (ReclaimCapFromSubOU). capType is read from the child’s vault when omitted.' +
|
|
357
|
+
PREPARE_SUFFIX,
|
|
358
|
+
kind: 'prepare',
|
|
359
|
+
sdkPath: 'org.units.reclaimCap',
|
|
360
|
+
inputShape: {
|
|
361
|
+
...actingShape,
|
|
362
|
+
unitId: unitTarget,
|
|
363
|
+
capId: objectId,
|
|
364
|
+
capType: z.string().optional(),
|
|
365
|
+
metadataIpfs: runOptionsShape.metadataIpfs,
|
|
366
|
+
},
|
|
367
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
368
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_unit_reclaim_cap', { unitId: args.unitId, capId: args.capId }, async () => (await org(ctx, args)).units.reclaimCap({ unitId: args.unitId, capId: args.capId, capType: args.capType }, { metadataIpfs: args.metadataIpfs })),
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
name: 'prepare_org_unit_spin_out',
|
|
372
|
+
title: 'Prepare: release a child unit (IRREVERSIBLE)',
|
|
373
|
+
description: 'Release a child from its parent (SpinOutSubOU) — IRREVERSIBLE: the parent loses all control. The parent’s vault must hold the child’s FreezeAdminCap (true for units made by prepare_org_unit_create, not for tribe units); it is looked up when exactly one is held, otherwise pass freezeAdminCapId. configs sets the freed unit’s hierarchy-type rules.' +
|
|
374
|
+
PREPARE_SUFFIX,
|
|
375
|
+
kind: 'prepare',
|
|
376
|
+
sdkPath: 'org.units.spinOut',
|
|
377
|
+
inputShape: {
|
|
378
|
+
...actingShape,
|
|
379
|
+
unitId: unitTarget,
|
|
380
|
+
freezeAdminCapId: objectId.optional(),
|
|
381
|
+
configs: z
|
|
382
|
+
.object({
|
|
383
|
+
spawnOu: proposalConfig.optional(),
|
|
384
|
+
spinOutSubOu: proposalConfig.optional(),
|
|
385
|
+
createSubOu: proposalConfig.optional(),
|
|
386
|
+
})
|
|
387
|
+
.optional(),
|
|
388
|
+
metadataIpfs: runOptionsShape.metadataIpfs,
|
|
389
|
+
},
|
|
390
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
391
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_unit_spin_out', { unitId: args.unitId }, async () => (await org(ctx, args)).units.spinOut({
|
|
392
|
+
unitId: args.unitId,
|
|
393
|
+
freezeAdminCapId: args.freezeAdminCapId,
|
|
394
|
+
configs: args.configs,
|
|
395
|
+
}, { metadataIpfs: args.metadataIpfs })),
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: 'prepare_org_spawn_successor',
|
|
399
|
+
title: 'Prepare: spawn a successor unit (IRREVERSIBLE)',
|
|
400
|
+
description: 'Spawn a successor OU and put the acting unit (or unitId) into Migrating (SpawnOU) — IRREVERSIBLE: afterwards only prepare_org_transfer_assets runs on it, and once empty anyone can delete it (prepare_org_unit_destroy).' +
|
|
401
|
+
PREPARE_SUFFIX,
|
|
402
|
+
kind: 'prepare',
|
|
403
|
+
sdkPath: 'org.units.spawnSuccessor',
|
|
404
|
+
inputShape: {
|
|
405
|
+
...actingShape,
|
|
406
|
+
name: z.string().min(1),
|
|
407
|
+
board: z.array(suiAddress).min(1),
|
|
408
|
+
metadataUri: z.string().min(1),
|
|
409
|
+
...runOptionsShape,
|
|
410
|
+
},
|
|
411
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
412
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_spawn_successor', { name: args.name, board: args.board }, async () => (await org(ctx, args)).units.spawnSuccessor({
|
|
413
|
+
name: args.name,
|
|
414
|
+
board: args.board,
|
|
415
|
+
metadataUri: args.metadataUri,
|
|
416
|
+
}, runOptions(args))),
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: 'prepare_org_transfer_assets',
|
|
420
|
+
title: 'Prepare: move a unit’s assets to another unit',
|
|
421
|
+
description: 'Move full coin balances and capabilities to another OU (TransferAssets). Defaults to EVERYTHING the unit holds: every treasury coin and every vault capability. The target’s treasury and vault are read from its OU object.' +
|
|
422
|
+
PREPARE_SUFFIX,
|
|
423
|
+
kind: 'prepare',
|
|
424
|
+
sdkPath: 'org.units.transferAssets',
|
|
425
|
+
inputShape: {
|
|
426
|
+
...actingShape,
|
|
427
|
+
targetOuId: objectId,
|
|
428
|
+
coinTypes: z
|
|
429
|
+
.array(z.string())
|
|
430
|
+
.optional()
|
|
431
|
+
.describe('Default: every coin in the treasury.'),
|
|
432
|
+
capIds: z
|
|
433
|
+
.array(objectId)
|
|
434
|
+
.optional()
|
|
435
|
+
.describe('Default: every capability in the vault.'),
|
|
436
|
+
...runOptionsShape,
|
|
437
|
+
},
|
|
438
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
439
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_transfer_assets', { targetOuId: args.targetOuId }, async () => (await org(ctx, args)).units.transferAssets({
|
|
440
|
+
targetOuId: args.targetOuId,
|
|
441
|
+
coinTypes: args.coinTypes,
|
|
442
|
+
capIds: args.capIds,
|
|
443
|
+
}, runOptions(args))),
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
name: 'prepare_org_unit_destroy',
|
|
447
|
+
title: 'Prepare: delete an emptied, migrating unit',
|
|
448
|
+
description: 'Delete a MIGRATING unit and its four companion objects once its treasury and vault are empty (ou::destroy). PERMISSIONLESS cleanup; aborts on-chain otherwise.' +
|
|
449
|
+
PREPARE_SUFFIX,
|
|
450
|
+
kind: 'prepare',
|
|
451
|
+
sdkPath: 'org.units.destroy',
|
|
452
|
+
inputShape: { ...actingShape, unitId: objectId },
|
|
453
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
454
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_unit_destroy', { unitId: args.unitId }, async () => (await org(ctx, args)).units.destroy({ unitId: args.unitId })),
|
|
455
|
+
},
|
|
456
|
+
// ─── emergency freeze ──────────────────────────────────────────────────────
|
|
457
|
+
{
|
|
458
|
+
name: 'prepare_org_freeze_type',
|
|
459
|
+
title: 'Prepare: freeze a proposal type (cap holder)',
|
|
460
|
+
description: 'Freeze one payload Move type on a unit for its max freeze duration (emergency::freeze_type). The SENDER must own the unit’s FreezeAdminCap; no vote. Generic payloads freeze per instantiation (SendCoin<CRED>, not every SendCoin). Freeze-exempt types abort.' +
|
|
461
|
+
PREPARE_SUFFIX,
|
|
462
|
+
kind: 'prepare',
|
|
463
|
+
sdkPath: 'org.freeze.freezeType',
|
|
464
|
+
inputShape: {
|
|
465
|
+
...actingShape,
|
|
466
|
+
moveType: moveTypeIn,
|
|
467
|
+
freezeAdminCapId: objectId,
|
|
468
|
+
unitId: objectId.optional().describe('Default: the acting seat.'),
|
|
469
|
+
},
|
|
470
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
471
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_freeze_type', { moveType: args.moveType }, async () => (await org(ctx, args)).freeze.freezeType({
|
|
472
|
+
moveType: args.moveType,
|
|
473
|
+
freezeAdminCapId: args.freezeAdminCapId,
|
|
474
|
+
unitId: args.unitId,
|
|
475
|
+
})),
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
name: 'prepare_org_unfreeze_type',
|
|
479
|
+
title: 'Prepare: lift a freeze early (cap holder)',
|
|
480
|
+
description: 'Lift a freeze before it lapses with the FreezeAdminCap (emergency::unfreeze_type); no vote. Without the cap, use prepare_org_unfreeze.' +
|
|
481
|
+
PREPARE_SUFFIX,
|
|
482
|
+
kind: 'prepare',
|
|
483
|
+
sdkPath: 'org.freeze.unfreezeType',
|
|
484
|
+
inputShape: {
|
|
485
|
+
...actingShape,
|
|
486
|
+
moveType: moveTypeIn,
|
|
487
|
+
freezeAdminCapId: objectId,
|
|
488
|
+
unitId: objectId.optional(),
|
|
489
|
+
},
|
|
490
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
491
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_unfreeze_type', { moveType: args.moveType }, async () => (await org(ctx, args)).freeze.unfreezeType({
|
|
492
|
+
moveType: args.moveType,
|
|
493
|
+
freezeAdminCapId: args.freezeAdminCapId,
|
|
494
|
+
unitId: args.unitId,
|
|
495
|
+
})),
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
name: 'prepare_org_unfreeze',
|
|
499
|
+
title: 'Prepare: lift a freeze by vote',
|
|
500
|
+
description: 'Lift a freeze by board vote (UnfreezeProposalType) — no cap needed. Always freeze-exempt, so it works while the freeze is in force.' +
|
|
501
|
+
PREPARE_SUFFIX,
|
|
502
|
+
kind: 'prepare',
|
|
503
|
+
sdkPath: 'org.freeze.unfreeze',
|
|
504
|
+
inputShape: { ...actingShape, moveType: moveTypeIn, ...runOptionsShape },
|
|
505
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
506
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_unfreeze', { moveType: args.moveType }, async () => (await org(ctx, args)).freeze.unfreeze({ moveType: args.moveType }, runOptions(args))),
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
name: 'prepare_org_freeze_set_max_duration',
|
|
510
|
+
title: 'Prepare: change the freeze duration',
|
|
511
|
+
description: 'Change how long a freeze lasts (UpdateFreezeConfig, by vote; enable the type first).' +
|
|
512
|
+
PREPARE_SUFFIX,
|
|
513
|
+
kind: 'prepare',
|
|
514
|
+
sdkPath: 'org.freeze.setMaxDuration',
|
|
515
|
+
inputShape: {
|
|
516
|
+
...actingShape,
|
|
517
|
+
maxFreezeDurationMs: z.number().int().positive(),
|
|
518
|
+
...runOptionsShape,
|
|
519
|
+
},
|
|
520
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
521
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_freeze_set_max_duration', { maxFreezeDurationMs: args.maxFreezeDurationMs }, async () => (await org(ctx, args)).freeze.setMaxDuration({ maxFreezeDurationMs: args.maxFreezeDurationMs }, runOptions(args))),
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
name: 'prepare_org_freeze_update_exempt',
|
|
525
|
+
title: 'Prepare: edit the freeze-exempt set',
|
|
526
|
+
description: 'Add or remove Move types from the set that can never be frozen (UpdateFreezeExemptTypes, by vote; enable the type first).' +
|
|
527
|
+
PREPARE_SUFFIX,
|
|
528
|
+
kind: 'prepare',
|
|
529
|
+
sdkPath: 'org.freeze.updateExempt',
|
|
530
|
+
inputShape: {
|
|
531
|
+
...actingShape,
|
|
532
|
+
add: z.array(z.string()).optional(),
|
|
533
|
+
remove: z.array(z.string()).optional(),
|
|
534
|
+
...runOptionsShape,
|
|
535
|
+
},
|
|
536
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
537
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_freeze_update_exempt', { add: args.add ?? [], remove: args.remove ?? [] }, async () => (await org(ctx, args)).freeze.updateExempt({ add: args.add, remove: args.remove }, runOptions(args))),
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
name: 'prepare_org_freeze_transfer_admin',
|
|
541
|
+
title: 'Prepare: hand the FreezeAdminCap to a new admin',
|
|
542
|
+
description: 'Transfer the unit’s FreezeAdminCap to newAdmin by vote (TransferFreezeAdmin), unfreezing everything. The EXECUTOR must own the cap — on a slow path, the cap holder executes later with prepare_org_execute_proposal + freezeAdminCapId.' +
|
|
543
|
+
PREPARE_SUFFIX,
|
|
544
|
+
kind: 'prepare',
|
|
545
|
+
sdkPath: 'org.freeze.transferAdmin',
|
|
546
|
+
inputShape: {
|
|
547
|
+
...actingShape,
|
|
548
|
+
newAdmin: suiAddress,
|
|
549
|
+
freezeAdminCapId: objectId,
|
|
550
|
+
...runOptionsShape,
|
|
551
|
+
},
|
|
552
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
553
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_freeze_transfer_admin', { newAdmin: args.newAdmin }, async () => (await org(ctx, args)).freeze.transferAdmin({
|
|
554
|
+
newAdmin: args.newAdmin,
|
|
555
|
+
freezeAdminCapId: args.freezeAdminCapId,
|
|
556
|
+
}, runOptions(args))),
|
|
557
|
+
},
|
|
558
|
+
// ─── encrypted entries (member-gated, no vote) ─────────────────────────────
|
|
559
|
+
//
|
|
560
|
+
// These index ciphertext that already exists somewhere else. Encrypting it —
|
|
561
|
+
// and decrypting it — needs a wallet-signed Seal session and lives in
|
|
562
|
+
// `@trinaryex/keyspace`, which this keyless server cannot do. What remains is
|
|
563
|
+
// plain object bookkeeping any current board member may perform.
|
|
564
|
+
{
|
|
565
|
+
name: 'prepare_org_entry_publish',
|
|
566
|
+
title: 'Prepare: index an encrypted entry',
|
|
567
|
+
description: 'Index an already-encrypted blob on a unit (encrypted_entry::publish_entry, max 32 per unit). MEMBER-GATED: any current board member, no vote. This server does not encrypt or upload — encrypt with @trinaryex/keyspace under the unit’s current epoch, upload the ciphertext, then pass where it lives.' +
|
|
568
|
+
PREPARE_SUFFIX,
|
|
569
|
+
kind: 'prepare',
|
|
570
|
+
sdkPath: 'org.entries.publish',
|
|
571
|
+
inputShape: {
|
|
572
|
+
...actingShape,
|
|
573
|
+
location: z
|
|
574
|
+
.string()
|
|
575
|
+
.min(1)
|
|
576
|
+
.describe('Where the ciphertext lives, e.g. a Walrus blob id.'),
|
|
577
|
+
description: z.string(),
|
|
578
|
+
unitId: objectId.optional().describe('Default: the acting seat.'),
|
|
579
|
+
},
|
|
580
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
581
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_entry_publish', { location: args.location }, async () => (await org(ctx, args)).entries.publish({
|
|
582
|
+
location: args.location,
|
|
583
|
+
description: args.description,
|
|
584
|
+
unitId: args.unitId,
|
|
585
|
+
})),
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
name: 'prepare_org_entry_update',
|
|
589
|
+
title: 'Prepare: re-point a stale entry',
|
|
590
|
+
description: 'Re-point a STALE entry at its re-encrypted blob, stamping the current epoch (encrypted_entry::update_entry). Member-gated.' +
|
|
591
|
+
PREPARE_SUFFIX,
|
|
592
|
+
kind: 'prepare',
|
|
593
|
+
sdkPath: 'org.entries.update',
|
|
594
|
+
inputShape: {
|
|
595
|
+
...actingShape,
|
|
596
|
+
entryId: objectId,
|
|
597
|
+
location: z.string().min(1),
|
|
598
|
+
unitId: objectId.optional(),
|
|
599
|
+
},
|
|
600
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
601
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_entry_update', { entryId: args.entryId, location: args.location }, async () => (await org(ctx, args)).entries.update({
|
|
602
|
+
entryId: args.entryId,
|
|
603
|
+
location: args.location,
|
|
604
|
+
unitId: args.unitId,
|
|
605
|
+
})),
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
name: 'prepare_org_entry_edit',
|
|
609
|
+
title: 'Prepare: move an entry’s blob',
|
|
610
|
+
description: 'Point an entry at a new location within the SAME epoch — no re-key (encrypted_entry::edit_entry). Member-gated.' +
|
|
611
|
+
PREPARE_SUFFIX,
|
|
612
|
+
kind: 'prepare',
|
|
613
|
+
sdkPath: 'org.entries.edit',
|
|
614
|
+
inputShape: {
|
|
615
|
+
...actingShape,
|
|
616
|
+
entryId: objectId,
|
|
617
|
+
location: z.string().min(1),
|
|
618
|
+
unitId: objectId.optional(),
|
|
619
|
+
},
|
|
620
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
621
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_entry_edit', { entryId: args.entryId, location: args.location }, async () => (await org(ctx, args)).entries.edit({
|
|
622
|
+
entryId: args.entryId,
|
|
623
|
+
location: args.location,
|
|
624
|
+
unitId: args.unitId,
|
|
625
|
+
})),
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
name: 'prepare_org_entries_rotate_epoch',
|
|
629
|
+
title: 'Prepare: rotate a unit’s encryption epoch',
|
|
630
|
+
description: 'Advance the unit’s encryption epoch, marking every entry stale until it is re-encrypted and updated (encrypted_entry::rotate_encryption_epoch). Member-gated.' +
|
|
631
|
+
PREPARE_SUFFIX,
|
|
632
|
+
kind: 'prepare',
|
|
633
|
+
sdkPath: 'org.entries.rotateEpoch',
|
|
634
|
+
inputShape: { ...actingShape, unitId: objectId.optional() },
|
|
635
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
636
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_entries_rotate_epoch', { unitId: args.unitId ?? null }, async () => (await org(ctx, args)).entries.rotateEpoch({ unitId: args.unitId })),
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
name: 'prepare_org_entry_remove',
|
|
640
|
+
title: 'Prepare: delete an encrypted entry',
|
|
641
|
+
description: 'Unindex and delete an entry (encrypted_entry::remove_entry). The ciphertext itself is not touched. Member-gated.' +
|
|
642
|
+
PREPARE_SUFFIX,
|
|
643
|
+
kind: 'prepare',
|
|
644
|
+
sdkPath: 'org.entries.remove',
|
|
645
|
+
inputShape: {
|
|
646
|
+
...actingShape,
|
|
647
|
+
entryId: objectId,
|
|
648
|
+
unitId: objectId.optional(),
|
|
649
|
+
},
|
|
650
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
651
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_entry_remove', { entryId: args.entryId }, async () => (await org(ctx, args)).entries.remove({
|
|
652
|
+
entryId: args.entryId,
|
|
653
|
+
unitId: args.unitId,
|
|
654
|
+
})),
|
|
655
|
+
},
|
|
656
|
+
// ─── upgrades ──────────────────────────────────────────────────────────────
|
|
657
|
+
{
|
|
658
|
+
name: 'prepare_org_upgrade_propose',
|
|
659
|
+
title: 'Prepare: upgrade a package the unit custodies',
|
|
660
|
+
description: 'Propose — and on a single-vote path, perform — an upgrade of a package whose UpgradeCap sits in the unit’s vault (ProposeUpgrade, VAULT_BORROW). digest, modules and dependencies are exactly what `sui move build --dump-bytecode-as-base64` prints. build is needed only to EXECUTE: omit it when you expect a proposal, and pass it to prepare_org_execute_proposal (as upgrade) once passed.' +
|
|
661
|
+
PREPARE_SUFFIX,
|
|
662
|
+
kind: 'prepare',
|
|
663
|
+
sdkPath: 'org.upgrade.propose',
|
|
664
|
+
inputShape: {
|
|
665
|
+
...actingShape,
|
|
666
|
+
capId: objectId.describe('The UpgradeCap id in the unit’s vault.'),
|
|
667
|
+
packageId: objectId.describe('The package being upgraded.'),
|
|
668
|
+
digest: z
|
|
669
|
+
.array(z.number().int().min(0).max(255))
|
|
670
|
+
.length(32)
|
|
671
|
+
.describe('The new package digest, 32 bytes.'),
|
|
672
|
+
policy: z
|
|
673
|
+
.union([z.literal(0), z.literal(128), z.literal(192)])
|
|
674
|
+
.optional()
|
|
675
|
+
.describe('0 compatible (default), 128 additive, 192 dep-only.'),
|
|
676
|
+
build: z
|
|
677
|
+
.object({
|
|
678
|
+
modules: z
|
|
679
|
+
.array(z.string())
|
|
680
|
+
.min(1)
|
|
681
|
+
.describe('Base64 module bytecode.'),
|
|
682
|
+
dependencies: z.array(objectId),
|
|
683
|
+
})
|
|
684
|
+
.optional(),
|
|
685
|
+
...runOptionsShape,
|
|
686
|
+
},
|
|
687
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
688
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_upgrade_propose', { packageId: args.packageId, capId: args.capId }, async () => (await org(ctx, args)).upgrade.propose({
|
|
689
|
+
capId: args.capId,
|
|
690
|
+
packageId: args.packageId,
|
|
691
|
+
digest: args.digest,
|
|
692
|
+
policy: args.policy,
|
|
693
|
+
build: args.build,
|
|
694
|
+
}, runOptions(args))),
|
|
695
|
+
},
|
|
696
|
+
// ─── bypass execution ──────────────────────────────────────────────────────
|
|
697
|
+
{
|
|
698
|
+
name: 'prepare_org_enable_bypass',
|
|
699
|
+
title: 'Prepare: opt a type into bypass execution',
|
|
700
|
+
description: 'Opt a unit into BYPASS execution for one type (EnableBypassType): the type’s own package may then mint tickets without a vote. Needs 80% of the WHOLE board voting yes; never on a controlled sub-unit. Quorum and approval are basis points.' +
|
|
701
|
+
PREPARE_SUFFIX,
|
|
702
|
+
kind: 'prepare',
|
|
703
|
+
sdkPath: 'org.capabilities.enableBypass',
|
|
704
|
+
inputShape: {
|
|
705
|
+
...actingShape,
|
|
706
|
+
typeKey: z.string().min(1),
|
|
707
|
+
moveType: moveTypeIn,
|
|
708
|
+
...flatConfigShape,
|
|
709
|
+
composableAllowed: z.boolean().optional(),
|
|
710
|
+
...runOptionsShape,
|
|
711
|
+
},
|
|
712
|
+
syntheticParams: {
|
|
713
|
+
...ACTING_SYNTHETIC,
|
|
714
|
+
...FLAT_CONFIG_SYNTHETIC,
|
|
715
|
+
composableAllowed: 'Flattened into the SDK’s nested `config`.',
|
|
716
|
+
},
|
|
717
|
+
derivedParams: {
|
|
718
|
+
config: 'Assembled from the flat quorum / threshold / timing / permission inputs.',
|
|
719
|
+
},
|
|
720
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_enable_bypass', { typeKey: args.typeKey, moveType: args.moveType }, async () => (await org(ctx, args)).capabilities.enableBypass({
|
|
721
|
+
typeKey: args.typeKey,
|
|
722
|
+
moveType: args.moveType,
|
|
723
|
+
config: {
|
|
724
|
+
...assembleConfig(args),
|
|
725
|
+
...(args.composableAllowed !== undefined
|
|
726
|
+
? { composableAllowed: args.composableAllowed }
|
|
727
|
+
: {}),
|
|
728
|
+
},
|
|
729
|
+
}, runOptions(args))),
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
name: 'prepare_org_disable_bypass',
|
|
733
|
+
title: 'Prepare: opt a type out of bypass execution',
|
|
734
|
+
description: 'Opt out of bypass execution (DisableBypassType). capId defaults to the vault’s ExternalExecutionCap<moveType>; typeKey to the slot’s label.' +
|
|
735
|
+
PREPARE_SUFFIX,
|
|
736
|
+
kind: 'prepare',
|
|
737
|
+
sdkPath: 'org.capabilities.disableBypass',
|
|
738
|
+
inputShape: {
|
|
739
|
+
...actingShape,
|
|
740
|
+
moveType: moveTypeIn,
|
|
741
|
+
typeKey: z.string().optional(),
|
|
742
|
+
capId: objectId.optional(),
|
|
743
|
+
...runOptionsShape,
|
|
744
|
+
},
|
|
745
|
+
syntheticParams: ACTING_SYNTHETIC,
|
|
746
|
+
handler: (ctx, args) => preparedGovernance(ctx, args.sender, 'org_disable_bypass', { moveType: args.moveType }, async () => (await org(ctx, args)).capabilities.disableBypass({
|
|
747
|
+
moveType: args.moveType,
|
|
748
|
+
typeKey: args.typeKey,
|
|
749
|
+
capId: args.capId,
|
|
750
|
+
}, runOptions(args))),
|
|
751
|
+
},
|
|
752
|
+
];
|
|
753
|
+
//# sourceMappingURL=orgLifecycle.js.map
|