@poa-box/core 0.1.0 → 1.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 (95) hide show
  1. package/README.md +2 -0
  2. package/dist/abis/AuthorityRouter.d.ts +448 -0
  3. package/dist/abis/AuthorityRouter.js +584 -0
  4. package/dist/abis/CutoverVerifier.d.ts +194 -0
  5. package/dist/abis/CutoverVerifier.js +259 -0
  6. package/dist/abis/DirectDemocracyVotingNew.d.ts +168 -30
  7. package/dist/abis/DirectDemocracyVotingNew.js +214 -35
  8. package/dist/abis/EducationHubNew.d.ts +32 -75
  9. package/dist/abis/EducationHubNew.js +38 -94
  10. package/dist/abis/Executor.d.ts +56 -86
  11. package/dist/abis/Executor.js +68 -104
  12. package/dist/abis/HybridVotingNew.d.ts +279 -35
  13. package/dist/abis/HybridVotingNew.js +357 -40
  14. package/dist/abis/{EligibilityModuleNew.d.ts → MembershipAuthority.d.ts} +1437 -718
  15. package/dist/abis/{EligibilityModuleNew.js → MembershipAuthority.js} +1821 -899
  16. package/dist/abis/OrgDeployerNew.d.ts +193 -127
  17. package/dist/abis/OrgDeployerNew.js +244 -160
  18. package/dist/abis/OrgRegistry.d.ts +40 -0
  19. package/dist/abis/OrgRegistry.js +51 -0
  20. package/dist/abis/ParticipationToken.d.ts +32 -75
  21. package/dist/abis/ParticipationToken.js +38 -94
  22. package/dist/abis/PasskeyAccount.d.ts +28 -0
  23. package/dist/abis/PasskeyAccount.js +35 -0
  24. package/dist/abis/PaymasterHub.d.ts +527 -47
  25. package/dist/abis/PaymasterHub.js +750 -135
  26. package/dist/abis/QuickJoinNew.d.ts +59 -170
  27. package/dist/abis/QuickJoinNew.js +71 -215
  28. package/dist/abis/TaskManagerNew.d.ts +27 -44
  29. package/dist/abis/TaskManagerNew.js +31 -52
  30. package/dist/abis/UniversalAccountRegistry.d.ts +24 -0
  31. package/dist/abis/UniversalAccountRegistry.js +30 -0
  32. package/dist/abis/ZkEmailInvites.d.ts +44 -0
  33. package/dist/abis/ZkEmailInvites.js +55 -0
  34. package/dist/abis/index.d.ts +6 -4
  35. package/dist/abis/index.js +10 -7
  36. package/dist/chains.js +3 -3
  37. package/dist/error-catalog.js +125 -7
  38. package/dist/graph/documents/activity.d.ts +3 -1
  39. package/dist/graph/documents/activity.js +19 -14
  40. package/dist/graph/documents/org.d.ts +4 -4
  41. package/dist/graph/documents/org.js +10 -4
  42. package/dist/graph/documents/task.d.ts +10 -1
  43. package/dist/graph/documents/task.js +157 -3
  44. package/dist/graph/documents/user.d.ts +5 -30
  45. package/dist/graph/documents/user.js +2 -42
  46. package/dist/graph/documents/voting-classes.d.ts +23 -2
  47. package/dist/graph/documents/voting-classes.js +119 -10
  48. package/dist/metadata/index.d.ts +0 -1
  49. package/dist/metadata/index.js +1 -2
  50. package/dist/perms.d.ts +0 -15
  51. package/dist/perms.js +1 -21
  52. package/dist/preflight.d.ts +2 -2
  53. package/dist/preflight.js +14 -22
  54. package/dist/reads/authority.d.ts +33 -0
  55. package/dist/reads/authority.js +196 -0
  56. package/dist/reads/index.d.ts +1 -1
  57. package/dist/reads/index.js +2 -2
  58. package/dist/reads/org.d.ts +20 -20
  59. package/dist/reads/org.js +94 -28
  60. package/dist/reads/project.js +3 -3
  61. package/dist/reads/resolve.d.ts +1 -1
  62. package/dist/reads/resolve.js +12 -3
  63. package/dist/reads/task.d.ts +44 -22
  64. package/dist/reads/task.js +126 -67
  65. package/dist/reads/user.d.ts +8 -43
  66. package/dist/reads/user.js +27 -44
  67. package/dist/reads/vote.d.ts +26 -2
  68. package/dist/reads/vote.js +104 -23
  69. package/dist/tx/authority.d.ts +33 -0
  70. package/dist/tx/authority.js +62 -0
  71. package/dist/tx/governance.d.ts +6 -0
  72. package/dist/tx/governance.js +20 -2
  73. package/dist/tx/index.d.ts +1 -1
  74. package/dist/tx/index.js +2 -2
  75. package/dist/tx/org.d.ts +23 -18
  76. package/dist/tx/org.js +203 -67
  77. package/dist/tx/project.d.ts +3 -2
  78. package/dist/tx/project.js +28 -10
  79. package/dist/tx/task.d.ts +13 -24
  80. package/dist/tx/task.js +45 -85
  81. package/dist/tx/user.d.ts +2 -40
  82. package/dist/tx/user.js +2 -76
  83. package/dist/tx/vote.d.ts +5 -0
  84. package/dist/tx/vote.js +54 -43
  85. package/dist/version.d.ts +0 -5
  86. package/dist/version.js +1 -13
  87. package/package.json +1 -1
  88. package/dist/abis/ToggleModule.d.ts +0 -193
  89. package/dist/abis/ToggleModule.js +0 -255
  90. package/dist/metadata/role.d.ts +0 -38
  91. package/dist/metadata/role.js +0 -35
  92. package/dist/reads/eligibility.d.ts +0 -377
  93. package/dist/reads/eligibility.js +0 -687
  94. package/dist/tx/eligibility.d.ts +0 -511
  95. package/dist/tx/eligibility.js +0 -818
@@ -1,511 +0,0 @@
1
- /**
2
- * EligibilityModuleNew transaction builders — the vouch/* and role/* write
3
- * surface (both CLI domains write to the same module).
4
- *
5
- * Level 1 (`build*`): pure, synchronous — resolved module address + prepared
6
- * values in, TxIntent out. ALL argument encoding lives here and matches the
7
- * CLI's executeTx calls byte-for-byte.
8
- *
9
- * Level 2 (`*Intent`): async — resolve the org's eligibility module via the
10
- * subgraph, replicate the CLI's derivations (role-name→hatId, single-vs-batch
11
- * method choice, metadata pinning for role applications, the audit-M-03
12
- * vouch/default-eligibility conflict guard), then delegate to Level 1.
13
- *
14
- * NOT ported into builders (host concerns, run them via reads/eligibility +
15
- * preflight.ts exactly as the CLI does): requireSuperAdmin, the vouch-for /
16
- * claim / revoke revert-prediction gates, gas-balance checks, idempotency,
17
- * and confirmation prompts. The ONE preflight that IS ported is the M-03
18
- * conflict guard in configureVouchingIntent / setDefaultEligibilityIntent,
19
- * because its state check + callStatic simulation is the only version-proof
20
- * predictor of the DefaultEligibilityConflictsWithVouch revert and the CLI
21
- * enforces it inline (src/commands/vouch/config.ts,
22
- * src/commands/role/eligibility.ts).
23
- */
24
- import { ethers } from 'ethers';
25
- import type { TxIntent } from './intent';
26
- import type { PopContext } from '../context';
27
- export interface VouchForArgs {
28
- eligibilityModuleAddress: string;
29
- wearer: string;
30
- hatId: ethers.BigNumberish;
31
- orgId?: string;
32
- }
33
- /** Port of `pop vouch for` — src/commands/vouch/for.ts: vouchFor(wearer, hatId). */
34
- export declare function buildVouchFor(a: VouchForArgs): TxIntent;
35
- export interface ClaimVouchedHatArgs {
36
- eligibilityModuleAddress: string;
37
- hatId: ethers.BigNumberish;
38
- orgId?: string;
39
- }
40
- /**
41
- * Port of `pop vouch claim` — src/commands/vouch/claim.ts:
42
- * claimVouchedHat(hatId). Claim-based pattern — quorum never auto-mints.
43
- */
44
- export declare function buildClaimVouchedHat(a: ClaimVouchedHatArgs): TxIntent;
45
- export interface RevokeVouchArgs {
46
- eligibilityModuleAddress: string;
47
- wearer: string;
48
- hatId: ethers.BigNumberish;
49
- orgId?: string;
50
- }
51
- /** Port of `pop vouch revoke` — src/commands/vouch/revoke.ts: revokeVouch(wearer, hatId). */
52
- export declare function buildRevokeVouch(a: RevokeVouchArgs): TxIntent;
53
- export interface ResetVouchesArgs {
54
- eligibilityModuleAddress: string;
55
- hatId: ethers.BigNumberish;
56
- orgId?: string;
57
- }
58
- /**
59
- * Port of `pop vouch reset` (no --wearer) — src/commands/vouch/reset.ts:
60
- * resetVouches(hatId). DESTRUCTIVE, superAdmin-only: DELETES the hat's
61
- * VouchConfig (vouching becomes disabled) and bumps the vouch epoch so every
62
- * existing vouch for the hat is invalidated.
63
- */
64
- export declare function buildResetVouches(a: ResetVouchesArgs): TxIntent;
65
- export interface ClearWearerVouchesArgs {
66
- eligibilityModuleAddress: string;
67
- wearer: string;
68
- hatId: ethers.BigNumberish;
69
- orgId?: string;
70
- }
71
- /**
72
- * Port of `pop vouch reset --wearer` — src/commands/vouch/reset.ts:
73
- * clearWearerVouches(wearer, hatId). Surgical per-wearer invalidation
74
- * (sentinel epoch + count wipe); other wearers' vouches and the hat's config
75
- * are untouched. superAdmin-only.
76
- */
77
- export declare function buildClearWearerVouches(a: ClearWearerVouchesArgs): TxIntent;
78
- export interface ConfigureVouchingArgs {
79
- eligibilityModuleAddress: string;
80
- hatId: ethers.BigNumberish;
81
- /** uint32; 0 disables vouching (`enabled` is derived on-chain as quorum > 0). */
82
- quorum: number;
83
- membershipHatId: ethers.BigNumberish;
84
- combineWithHierarchy: boolean;
85
- orgId?: string;
86
- }
87
- /**
88
- * Port of `pop vouch config set` — src/commands/vouch/config.ts:
89
- * configureVouching(hatId, quorum, membershipHatId, combineWithHierarchy).
90
- * superAdmin-only; configuring bumps the hat's vouch epoch, invalidating all
91
- * existing vouches.
92
- */
93
- export declare function buildConfigureVouching(a: ConfigureVouchingArgs): TxIntent;
94
- export interface ApplyForRoleArgs {
95
- eligibilityModuleAddress: string;
96
- hatId: ethers.BigNumberish;
97
- /** bytes32 — ipfsCidToBytes32 of the pinned role-application metadata. */
98
- applicationHash: string;
99
- orgId?: string;
100
- }
101
- /**
102
- * Port of `pop role apply` — src/commands/role/apply.ts:
103
- * applyForRole(hatId, applicationHash). Signaling only — grants no
104
- * eligibility.
105
- */
106
- export declare function buildApplyForRole(a: ApplyForRoleArgs): TxIntent;
107
- export interface WithdrawApplicationArgs {
108
- eligibilityModuleAddress: string;
109
- hatId: ethers.BigNumberish;
110
- orgId?: string;
111
- }
112
- /**
113
- * Port of `pop role withdraw-application` —
114
- * src/commands/role/withdraw-application.ts: withdrawApplication(hatId).
115
- */
116
- export declare function buildWithdrawApplication(a: WithdrawApplicationArgs): TxIntent;
117
- export interface CreateHatWithEligibilityArgs {
118
- eligibilityModuleAddress: string;
119
- parentHatId: ethers.BigNumberish;
120
- /** Role name — stored as the hat `details` string. */
121
- details: string;
122
- /** uint32 — max simultaneous wearers. */
123
- maxSupply: number;
124
- mutable: boolean;
125
- /** Hat image URI; empty string when omitted (CLI: `argv.image ?? ''`). */
126
- imageURI?: string;
127
- defaultEligible: boolean;
128
- defaultStanding: boolean;
129
- /** Addresses to mint the new hat to immediately; empty when omitted. */
130
- mintTo?: string[];
131
- /**
132
- * Per-mint-to flags. Default TRUE per address — the CLI ALWAYS forces true
133
- * so initial wearers are eligible regardless of the hat defaults.
134
- */
135
- wearerEligibleFlags?: boolean[];
136
- wearerStandingFlags?: boolean[];
137
- orgId?: string;
138
- }
139
- /**
140
- * Port of `pop role create` — src/commands/role/create.ts:
141
- * createHatWithEligibility(CreateHatParams). The tuple is built in EXACT ABI
142
- * order (verified in abi CreateHatParams components):
143
- * (uint256 parentHatId, string details, uint32 maxSupply, bool _mutable,
144
- * string imageURI, bool defaultEligible, bool defaultStanding,
145
- * address[] mintToAddresses, bool[] wearerEligibleFlags,
146
- * bool[] wearerStandingFlags)
147
- * superAdmin-only.
148
- */
149
- export declare function buildCreateHatWithEligibility(a: CreateHatWithEligibilityArgs): TxIntent;
150
- export interface SetWearerEligibilityArgs {
151
- eligibilityModuleAddress: string;
152
- wearer: string;
153
- hatId: ethers.BigNumberish;
154
- eligible: boolean;
155
- standing: boolean;
156
- orgId?: string;
157
- }
158
- /**
159
- * Port of `pop role eligibility set` (single-wearer) —
160
- * src/commands/role/eligibility.ts:
161
- * setWearerEligibility(wearer, hatId, eligible, standing). superAdmin-only.
162
- */
163
- export declare function buildSetWearerEligibility(a: SetWearerEligibilityArgs): TxIntent;
164
- export interface BatchSetWearerEligibilityArgs {
165
- eligibilityModuleAddress: string;
166
- hatId: ethers.BigNumberish;
167
- wearers: string[];
168
- eligibleFlags: boolean[];
169
- standingFlags: boolean[];
170
- orgId?: string;
171
- }
172
- /**
173
- * Port of `pop role eligibility set --file` (batch) —
174
- * src/commands/role/eligibility.ts:
175
- * batchSetWearerEligibility(hatId, wearers[], eligibleFlags[], standingFlags[]).
176
- * superAdmin-only.
177
- */
178
- export declare function buildBatchSetWearerEligibility(a: BatchSetWearerEligibilityArgs): TxIntent;
179
- export interface ClearWearerEligibilityArgs {
180
- eligibilityModuleAddress: string;
181
- wearer: string;
182
- hatId: ethers.BigNumberish;
183
- orgId?: string;
184
- }
185
- /**
186
- * Port of `pop role eligibility clear` — src/commands/role/eligibility.ts:
187
- * clearWearerEligibility(wearer, hatId) — removes the wearer-specific rule so
188
- * the hat DEFAULTS apply again. superAdmin-only.
189
- */
190
- export declare function buildClearWearerEligibility(a: ClearWearerEligibilityArgs): TxIntent;
191
- export interface SetDefaultEligibilityArgs {
192
- eligibilityModuleAddress: string;
193
- hatId: ethers.BigNumberish;
194
- eligible: boolean;
195
- standing: boolean;
196
- orgId?: string;
197
- }
198
- /**
199
- * Port of `pop role eligibility set-default` —
200
- * src/commands/role/eligibility.ts:
201
- * setDefaultEligibility(hatId, eligible, standing). superAdmin-only. See
202
- * setDefaultEligibilityIntent for the audit-M-03 conflict guard the CLI runs
203
- * before this write.
204
- */
205
- export declare function buildSetDefaultEligibility(a: SetDefaultEligibilityArgs): TxIntent;
206
- export interface TransferSuperAdminArgs {
207
- eligibilityModuleAddress: string;
208
- newSuperAdmin: string;
209
- orgId?: string;
210
- }
211
- /**
212
- * Port of `pop role admin transfer` — src/commands/role/admin.ts:
213
- * transferSuperAdmin(newSuperAdmin). DESTRUCTIVE — hands over the ENTIRE
214
- * module (roles, eligibility, vouching, pause). superAdmin-only.
215
- */
216
- export declare function buildTransferSuperAdmin(a: TransferSuperAdminArgs): TxIntent;
217
- export interface MintHatToAddressArgs {
218
- eligibilityModuleAddress: string;
219
- hatId: ethers.BigNumberish;
220
- wearer: string;
221
- orgId?: string;
222
- }
223
- /**
224
- * Port of `pop role admin mint` (single wearer) — src/commands/role/admin.ts:
225
- * mintHatToAddress(hatId, wearer). superAdmin-only.
226
- */
227
- export declare function buildMintHatToAddress(a: MintHatToAddressArgs): TxIntent;
228
- export interface BatchMintHatsArgs {
229
- eligibilityModuleAddress: string;
230
- hatIds: ethers.BigNumberish[];
231
- wearers: string[];
232
- orgId?: string;
233
- }
234
- /**
235
- * Port of `pop role admin mint` (comma-separated wearers) —
236
- * src/commands/role/admin.ts: batchMintHats(hatIds[], wearers[]). The CLI
237
- * replicates ONE hat per wearer (`wearers.map(() => hatId)`); mintHatsIntent
238
- * derives that. superAdmin-only.
239
- */
240
- export declare function buildBatchMintHats(a: BatchMintHatsArgs): TxIntent;
241
- export interface PauseArgs {
242
- eligibilityModuleAddress: string;
243
- orgId?: string;
244
- }
245
- /** Port of `pop role admin pause` — src/commands/role/admin.ts: pause(). superAdmin-only. */
246
- export declare function buildPause(a: PauseArgs): TxIntent;
247
- /** Port of `pop role admin unpause` — src/commands/role/admin.ts: unpause(). superAdmin-only. */
248
- export declare function buildUnpause(a: PauseArgs): TxIntent;
249
- export interface SetUserJoinTimeArgs {
250
- eligibilityModuleAddress: string;
251
- user: string;
252
- /** Unix seconds. */
253
- joinTime: ethers.BigNumberish;
254
- orgId?: string;
255
- }
256
- /**
257
- * Port of `pop role admin set-join-time --timestamp` —
258
- * src/commands/role/admin.ts: setUserJoinTime(user, joinTime). Governs the
259
- * new-account vouching grace. superAdmin-only.
260
- */
261
- export declare function buildSetUserJoinTime(a: SetUserJoinTimeArgs): TxIntent;
262
- export interface SetUserJoinTimeNowArgs {
263
- eligibilityModuleAddress: string;
264
- user: string;
265
- orgId?: string;
266
- }
267
- /**
268
- * Port of `pop role admin set-join-time` (no --timestamp) —
269
- * src/commands/role/admin.ts: setUserJoinTimeNow(user) — uses the current
270
- * block time. superAdmin-only.
271
- */
272
- export declare function buildSetUserJoinTimeNow(a: SetUserJoinTimeNowArgs): TxIntent;
273
- export interface VouchForParams {
274
- org: string;
275
- /** Address of the user to vouch for. */
276
- wearer: string;
277
- /** Hat ID; either this or `role` is required. */
278
- hat?: string | number;
279
- /** Role name — resolved to a hat ID via the subgraph, as the CLI's --role. */
280
- role?: string;
281
- /**
282
- * The signing address, when known — enables the CLI's self-vouch guard
283
- * ("You cannot vouch for yourself.").
284
- */
285
- voucher?: string;
286
- }
287
- /** Port of `pop vouch for` — src/commands/vouch/for.ts (org + role-name resolution). */
288
- export declare function vouchForIntent(ctx: PopContext, params: VouchForParams): Promise<TxIntent>;
289
- export interface ClaimVouchedHatParams {
290
- org: string;
291
- hat: string | number;
292
- }
293
- /** Port of `pop vouch claim` — src/commands/vouch/claim.ts (org resolution). */
294
- export declare function claimVouchedHatIntent(ctx: PopContext, params: ClaimVouchedHatParams): Promise<TxIntent>;
295
- export interface RevokeVouchParams {
296
- org: string;
297
- /** Address whose vouch to revoke (the wearer YOU vouched for). */
298
- wearer: string;
299
- hat: string | number;
300
- }
301
- /** Port of `pop vouch revoke` — src/commands/vouch/revoke.ts (org resolution). */
302
- export declare function revokeVouchIntent(ctx: PopContext, params: RevokeVouchParams): Promise<TxIntent>;
303
- export interface ResetVouchesParams {
304
- org: string;
305
- hat: string | number;
306
- /** When set: surgical clearWearerVouches(wearer, hat); else resetVouches(hat). */
307
- wearer?: string;
308
- }
309
- /**
310
- * Port of `pop vouch reset` — src/commands/vouch/reset.ts. Derives the method
311
- * exactly as the CLI does: --wearer → clearWearerVouches (surgical), no
312
- * --wearer → resetVouches (deletes the VouchConfig + bumps the epoch).
313
- * DESTRUCTIVE, superAdmin-only.
314
- */
315
- export declare function resetVouchesIntent(ctx: PopContext, params: ResetVouchesParams): Promise<TxIntent>;
316
- export interface ConfigureVouchingParams {
317
- org: string;
318
- hat: string | number;
319
- /** Vouches required to become claimable; 0 disables vouching. */
320
- quorum: number;
321
- /** Hat whose wearers are allowed to vouch. */
322
- membershipHat: string | number;
323
- combineHierarchy?: boolean;
324
- /**
325
- * The signing address — used by the M-03 callStatic simulation, which the
326
- * CLI runs from the real superAdmin. Guard is skipped when absent.
327
- */
328
- from?: string;
329
- /** false skips the M-03 conflict guard (the CLI's --no-preflight). */
330
- preflight?: boolean;
331
- }
332
- /**
333
- * Port of `pop vouch config set` — src/commands/vouch/config.ts, including the
334
- * audit-M-03 reverse-direction guard: enabling vouching WITH combine-hierarchy
335
- * on a hat that is already default-eligible reverts
336
- * DefaultEligibilityConflictsWithVouch on modules that implement the check —
337
- * everyone is eligible anyway, so the quorum would be a no-op. The state is
338
- * detected via getDefaultRules, then the exact call is simulated from `from`
339
- * (state alone is version-ambiguous — deployed v6 modules accept it). Only a
340
- * contract revert blocks; transport failures degrade and let gas estimation be
341
- * the real gate. Requires ctx.provider + params.from to run.
342
- */
343
- export declare function configureVouchingIntent(ctx: PopContext, params: ConfigureVouchingParams): Promise<TxIntent>;
344
- export interface ApplyForRoleParams {
345
- org: string;
346
- hat: string | number;
347
- notes?: string;
348
- experience?: string;
349
- /** Override the appliedAt timestamp (unix ms). Default Date.now(). */
350
- appliedAt?: number;
351
- }
352
- /**
353
- * Port of `pop role apply` — src/commands/role/apply.ts. Pins the
354
- * {notes, experience, appliedAt} application metadata (metadata/role.ts —
355
- * key order preserved for frontend/subgraph parity), converts the CID to
356
- * bytes32, then delegates to buildApplyForRole. The pinned document rides in
357
- * meta.ipfs.
358
- */
359
- export declare function applyForRoleIntent(ctx: PopContext, params: ApplyForRoleParams): Promise<TxIntent>;
360
- export interface WithdrawApplicationParams {
361
- org: string;
362
- hat: string | number;
363
- }
364
- /**
365
- * Port of `pop role withdraw-application` —
366
- * src/commands/role/withdraw-application.ts (org resolution).
367
- */
368
- export declare function withdrawApplicationIntent(ctx: PopContext, params: WithdrawApplicationParams): Promise<TxIntent>;
369
- /** Parse "--mint-to a,b,c" into checksummed addresses (empty when omitted). */
370
- export declare function parseMintTo(input: string | undefined): string[];
371
- export interface CreateRoleParams {
372
- org: string;
373
- parentHat: string | number;
374
- /** Role name (stored as the hat details). */
375
- name: string;
376
- image?: string;
377
- /** Default 1000, as the CLI. */
378
- maxSupply?: number;
379
- mutable?: boolean;
380
- defaultEligible?: boolean;
381
- defaultStanding?: boolean;
382
- /** Comma-separated string (CLI --mint-to) or a prepared address array. */
383
- mintTo?: string | string[];
384
- }
385
- /**
386
- * Port of `pop role create` — src/commands/role/create.ts: validates
387
- * max-supply (uint32), parses/checksums --mint-to, forces the per-mint-to
388
- * eligible/standing flags TRUE, then delegates to
389
- * buildCreateHatWithEligibility. superAdmin-only.
390
- */
391
- export declare function createHatWithEligibilityIntent(ctx: PopContext, params: CreateRoleParams): Promise<TxIntent>;
392
- export interface SetWearerEligibilityParams {
393
- org: string;
394
- hat: string | number;
395
- wearer: string;
396
- /** Default true (the CLI's --eligible default; --no-eligible → false). */
397
- eligible?: boolean;
398
- /** Default true (the CLI's --standing default; --no-standing → false). */
399
- standing?: boolean;
400
- }
401
- /**
402
- * Port of `pop role eligibility set` (single wearer) —
403
- * src/commands/role/eligibility.ts. superAdmin-only.
404
- */
405
- export declare function setWearerEligibilityIntent(ctx: PopContext, params: SetWearerEligibilityParams): Promise<TxIntent>;
406
- /** One batch entry — the CLI's --file JSON row shape. */
407
- export interface EligibilityBatchEntry {
408
- wearer: string;
409
- /** Default true when omitted, as in the CLI's batch file format. */
410
- eligible?: boolean;
411
- standing?: boolean;
412
- }
413
- export interface BatchSetWearerEligibilityParams {
414
- org: string;
415
- hat: string | number;
416
- entries: EligibilityBatchEntry[];
417
- }
418
- /**
419
- * Port of `pop role eligibility set --file` —
420
- * src/commands/role/eligibility.ts: validates the entries (the CLI's batch
421
- * JSON shape, minus the fs read — the host loads the file), defaults
422
- * eligible/standing to true, and encodes
423
- * batchSetWearerEligibility(hatId, wearers[], eligibles[], standings[]).
424
- * superAdmin-only.
425
- */
426
- export declare function batchSetWearerEligibilityIntent(ctx: PopContext, params: BatchSetWearerEligibilityParams): Promise<TxIntent>;
427
- export interface ClearWearerEligibilityParams {
428
- org: string;
429
- hat: string | number;
430
- wearer: string;
431
- }
432
- /**
433
- * Port of `pop role eligibility clear` — src/commands/role/eligibility.ts.
434
- * superAdmin-only.
435
- */
436
- export declare function clearWearerEligibilityIntent(ctx: PopContext, params: ClearWearerEligibilityParams): Promise<TxIntent>;
437
- export interface SetDefaultEligibilityParams {
438
- org: string;
439
- hat: string | number;
440
- /** Default true — a bare set-default hits the M-03 guard, as in the CLI. */
441
- eligible?: boolean;
442
- standing?: boolean;
443
- /**
444
- * The signing address — used by the M-03 callStatic simulation, which the
445
- * CLI runs from the real superAdmin. Guard is skipped when absent.
446
- */
447
- from?: string;
448
- /** false skips the M-03 conflict guard (the CLI's --no-preflight). */
449
- preflight?: boolean;
450
- }
451
- /**
452
- * Port of `pop role eligibility set-default` —
453
- * src/commands/role/eligibility.ts, including the audit-M-03 guard: making a
454
- * hat default-eligible while it uses vouching WITH combineWithHierarchy
455
- * reverts DefaultEligibilityConflictsWithVouch — an open hat makes the vouch
456
- * quorum meaningless. The state is detected via getVouchConfig +
457
- * vouchConflictsWithDefaultEligibility (../perms — the browser-pure rule the
458
- * CLI uses), then the exact call is simulated from `from`, because the state
459
- * check alone is version-ambiguous: the deployed v6 modules ACCEPT the write
460
- * (verified live — 17/19 live VouchConfig rows are in the "conflicting"
461
- * state, so blocking on state alone would refuse a valid write on nearly
462
- * every hat). Only a contract revert blocks; transport failures degrade and
463
- * let gas estimation be the real gate. Requires ctx.provider + params.from.
464
- * superAdmin-only.
465
- */
466
- export declare function setDefaultEligibilityIntent(ctx: PopContext, params: SetDefaultEligibilityParams): Promise<TxIntent>;
467
- export interface TransferSuperAdminParams {
468
- org: string;
469
- /** New superAdmin address. */
470
- to: string;
471
- /** Current signer, when known — enables the CLI's self-transfer guard. */
472
- from?: string;
473
- }
474
- /**
475
- * Port of `pop role admin transfer` — src/commands/role/admin.ts.
476
- * DESTRUCTIVE, superAdmin-only.
477
- */
478
- export declare function transferSuperAdminIntent(ctx: PopContext, params: TransferSuperAdminParams): Promise<TxIntent>;
479
- export interface MintHatsParams {
480
- org: string;
481
- hat: string | number;
482
- /** Comma-separated string (CLI --wearer) or a prepared address array. */
483
- wearer: string | string[];
484
- }
485
- /**
486
- * Port of `pop role admin mint` — src/commands/role/admin.ts. Derives the
487
- * method exactly as the CLI does: one wearer → mintHatToAddress(hat, wearer);
488
- * several → batchMintHats(hat replicated per wearer, wearers).
489
- * superAdmin-only.
490
- */
491
- export declare function mintHatsIntent(ctx: PopContext, params: MintHatsParams): Promise<TxIntent>;
492
- export interface PauseParams {
493
- org: string;
494
- }
495
- /** Port of `pop role admin pause` — src/commands/role/admin.ts. superAdmin-only. */
496
- export declare function pauseIntent(ctx: PopContext, params: PauseParams): Promise<TxIntent>;
497
- /** Port of `pop role admin unpause` — src/commands/role/admin.ts. superAdmin-only. */
498
- export declare function unpauseIntent(ctx: PopContext, params: PauseParams): Promise<TxIntent>;
499
- export interface SetJoinTimeParams {
500
- org: string;
501
- user: string;
502
- /** Unix seconds; omit to use the current block time via setUserJoinTimeNow. */
503
- timestamp?: number;
504
- }
505
- /**
506
- * Port of `pop role admin set-join-time` — src/commands/role/admin.ts.
507
- * Derives the method exactly as the CLI does: --timestamp →
508
- * setUserJoinTime(user, ts); omitted → setUserJoinTimeNow(user).
509
- * superAdmin-only.
510
- */
511
- export declare function setUserJoinTimeIntent(ctx: PopContext, params: SetJoinTimeParams): Promise<TxIntent>;