@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,377 +0,0 @@
1
- /**
2
- * Shared EligibilityModule read layer for the vouch + role domains.
3
- * Port of src/commands/vouch/helpers.ts (plus the subgraph list reads from
4
- * src/commands/vouch/list.ts and src/commands/role/applications.ts): functions
5
- * take the GraphClient / provider explicitly instead of importing
6
- * process-global singletons.
7
- *
8
- * Both domains read the same module, whose admin surface is superAdmin-gated.
9
- * Facts VERIFIED against contracts origin/main src/EligibilityModule.sol:
10
- *
11
- * - `superAdmin()` public getter exists; every eligibility/hat-admin write is
12
- * `onlySuperAdmin` (setWearerEligibility, setDefaultEligibility,
13
- * clearWearerEligibility, batchSetWearerEligibility, setDefaultEligibility,
14
- * createHatWithEligibility, mintHatToAddress, batchMintHats, pause/unpause,
15
- * transferSuperAdmin, setUserJoinTime, setUserJoinTimeNow, configureVouching,
16
- * resetVouches, clearWearerVouches).
17
- * - VouchConfig struct: (uint32 quorum, uint256 membershipHatId, uint8 flags)
18
- * with flags bit 0 = enabled (ENABLED_FLAG 0x01) and bit 1 =
19
- * combineWithHierarchy (COMBINE_HIERARCHY_FLAG 0x02). Getter: getVouchConfig.
20
- * - Rate limiting: getMaxDailyVouches() (DEFAULT_MAX_DAILY_VOUCHES = 20 when
21
- * unset), getCurrentDailyVouchCount(user) keyed by UTC day
22
- * (block.timestamp / 86400), getUserJoinTime(user), and the authoritative
23
- * combined answer canUserVouch(user).
24
- * - vouchFor does NOT auto-mint at quorum: reaching quorum makes
25
- * getWearerStatus() return eligible, and the wearer claims explicitly via
26
- * claimVouchedHat (claim-based pattern per the contract doc comment).
27
- *
28
- * READ SOURCING (subgraph vs RPC), settled 2026-07-30 against the live
29
- * poa-gnosis-v-1 / poa-arb-v-1 deployments:
30
- *
31
- * - DISPLAY reads (pop vouch status, pop vouch config show) go SUBGRAPH-FIRST
32
- * with the RPC getter kept as fallback: VouchConfig.{quorum,membershipHatId,
33
- * enabled,combinesWithHierarchy} and a count of active Vouch rows are
34
- * verified-populated and byte-for-byte equal to the on-chain values.
35
- * - VOUCH COUNTS ARE EPOCH-SCOPED. configureVouching/batchConfigureVouching/
36
- * resetVouches bump vouchConfigEpoch[hatId] and clearWearerVouches parks
37
- * wearerVouchEpoch on a 2^256-1 sentinel; currentVouchCount() returns 0 when
38
- * the two disagree, and NO event marks the individual vouches dead. Counting
39
- * active Vouch rows therefore overcounts after any reconfiguration and would
40
- * report quorum met against a contract that says zero. Newer deployments
41
- * index the epochs (WearerVouchState), which is exact; older ones can only
42
- * detect the ambiguity and refuse. See graph/documents/vouch.ts for both tiers.
43
- * - WRITE PRE-FLIGHT reads stay on RPC. superAdmin(), paused(),
44
- * hasVouched(), hasActiveApplication(), getWearerStatus(), getDefaultRules()
45
- * and the vouch-for/claim gates all exist to PREDICT A REVERT; indexing lag
46
- * there either broadcasts a doomed transaction or blocks a valid one.
47
- * They are instead batched through Multicall3 so each pre-flight costs ONE
48
- * round-trip instead of N.
49
- * - NO subgraph field exists for getMaxDailyVouches(),
50
- * getCurrentDailyVouchCount() or canUserVouch(); UserJoinTime has ZERO rows
51
- * on the live Gnosis deployment. The whole VoucherGate therefore stays RPC.
52
- */
53
- import { ethers } from 'ethers';
54
- import type { GraphClient } from '../graph/client';
55
- import { VOUCH_FLAG_ENABLED, VOUCH_FLAG_COMBINE_HIERARCHY } from '../perms';
56
- export { VOUCH_FLAG_ENABLED, VOUCH_FLAG_COMBINE_HIERARCHY };
57
- /**
58
- * Resolve an org to its EligibilityModule address.
59
- * Port of src/commands/vouch/helpers.ts resolveEligibilityModule.
60
- */
61
- export declare function resolveEligibilityModule(client: GraphClient, orgIdOrName: string | undefined, chainId?: number): Promise<{
62
- orgId: string;
63
- eligibilityModuleAddress: string;
64
- }>;
65
- /** Parse a --hat argument (decimal or 0x-hex) into a BigNumber hat ID. */
66
- export declare function parseHatId(input: string | number): ethers.BigNumber;
67
- /** Decoded VouchConfig tuple (quorum, membershipHatId, flags). */
68
- export interface VouchConfigView {
69
- quorum: number;
70
- membershipHatId: string;
71
- enabled: boolean;
72
- combineWithHierarchy: boolean;
73
- }
74
- /** Decode a raw getVouchConfig/vouchConfigs result into named fields. */
75
- export declare function decodeVouchConfig(raw: {
76
- quorum: ethers.BigNumberish;
77
- membershipHatId: ethers.BigNumberish;
78
- flags: ethers.BigNumberish;
79
- }): VouchConfigView;
80
- /** One EligibilityModule view call in a Multicall3 batch. */
81
- export interface EligibilityRead {
82
- fn: string;
83
- args: any[];
84
- }
85
- /**
86
- * Batch EligibilityModule view calls into ONE Multicall3 round-trip
87
- * (multicall.ts degrades to parallel provider.call on chains without the
88
- * canonical deployment, so callers always get one result per call).
89
- *
90
- * Every caller is a write pre-flight, so a sub-call that reverts must NEVER be
91
- * silently decoded as a falsy answer: Multicall3.tryAggregate is invoked with
92
- * requireSuccess=false, and any call that comes back unsuccessful is re-issued
93
- * through the ethers contract so the original error propagates exactly as it
94
- * did before batching.
95
- *
96
- * Return shape matches `contract.fn(...)`: a single output is unwrapped, a
97
- * multi-output (getWearerStatus, getDefaultRules) stays an ethers Result with
98
- * both named and positional access.
99
- */
100
- export declare function batchEligibilityReadsSettled(provider: ethers.providers.Provider, eligibilityModuleAddress: string, reads: EligibilityRead[]): Promise<PromiseSettledResult<any>[]>;
101
- /** batchEligibilityReadsSettled, rethrowing the first failure (Promise.all semantics). */
102
- export declare function batchEligibilityReads(provider: ethers.providers.Provider, eligibilityModuleAddress: string, reads: EligibilityRead[]): Promise<any[]>;
103
- /**
104
- * Subgraph read of a hat's vouch config. Returns null — meaning "fall back to
105
- * the RPC getter" — when the query fails, when the row is missing (absence is
106
- * ambiguous between never-configured and not-yet-indexed), or when a field is
107
- * null on an older deployment.
108
- */
109
- export declare function fetchVouchConfigFromSubgraph(client: GraphClient, eligibilityModuleAddress: string, hatId: ethers.BigNumber, chainId?: number): Promise<VouchConfigView | null>;
110
- /** What `pop vouch config show` reads: the hat config + the org-wide rate limit. */
111
- export interface VouchConfigStatus {
112
- config: VouchConfigView;
113
- /** getMaxDailyVouches() — ALWAYS RPC, no subgraph field exists. */
114
- maxDailyVouches: number;
115
- source: 'subgraph' | 'rpc';
116
- }
117
- /**
118
- * Port of `pop vouch config show` — src/commands/vouch/config.ts.
119
- * Config is SUBGRAPH-FIRST (display only) with getVouchConfig() as fallback;
120
- * `preferSubgraph: false` (the CLI's explicit --rpc) pins the config read to
121
- * the provider. getMaxDailyVouches() has no subgraph field and stays on chain.
122
- */
123
- export declare function readVouchConfigStatus(client: GraphClient, provider: ethers.providers.Provider, eligibilityModuleAddress: string, hatId: ethers.BigNumber, opts?: {
124
- chainId?: number;
125
- preferSubgraph?: boolean;
126
- }): Promise<VouchConfigStatus>;
127
- /** Wearer-side vouch progress for `pop vouch status` (display only). */
128
- export interface WearerVouchState {
129
- config: VouchConfigView;
130
- currentCount: number;
131
- }
132
- /**
133
- * Subgraph read of a hat's vouch config PLUS the wearer's current vouch count.
134
- * Returns null to mean "fall back to RPC".
135
- *
136
- * Two tiers (graph/documents/vouch.ts): the epoch mirror when the deployment indexes
137
- * it — which is exact, and lets a reconfigured hat still be served from the subgraph —
138
- * and the legacy active-row count, which can only refuse to answer once an epoch bump
139
- * is suspected. `queryWithFieldFallback` drops to the legacy tier on the unknown-field
140
- * validation error, so this works before and after the subgraph ships.
141
- */
142
- export declare function fetchWearerVouchStateFromSubgraph(client: GraphClient, eligibilityModuleAddress: string, hatId: ethers.BigNumber, wearer: string, chainId?: number): Promise<WearerVouchState | null>;
143
- /**
144
- * RPC read of the same wearer-side state, batched into one round-trip.
145
- * `enabled` is derived from the config flags rather than a separate
146
- * isVouchingEnabled() call — the contract's getter is literally
147
- * `_isVouchingEnabled(vouchConfigs[hatId].flags)` (VERIFIED in
148
- * src/EligibilityModule.sol), so the answer is identical.
149
- */
150
- export declare function readWearerVouchStateOnchain(provider: ethers.providers.Provider, eligibilityModuleAddress: string, hatId: ethers.BigNumberish, wearer: string): Promise<WearerVouchState>;
151
- /**
152
- * Wearer-side vouch progress, SUBGRAPH-FIRST with the RPC batch as fallback.
153
- * Display-only (`pop vouch status`) — never used to gate a write.
154
- *
155
- * `preferSubgraph: false` (set when the caller pinned an explicit RPC node)
156
- * skips the subgraph entirely so an explicitly targeted node stays the
157
- * source of truth.
158
- */
159
- export declare function readWearerVouchState(client: GraphClient, provider: ethers.providers.Provider, eligibilityModuleAddress: string, hatId: ethers.BigNumber, wearer: string, opts?: {
160
- chainId?: number;
161
- preferSubgraph?: boolean;
162
- }): Promise<{
163
- state: WearerVouchState;
164
- source: 'subgraph' | 'rpc';
165
- }>;
166
- /**
167
- * Read the module's superAdmin address (public getter, verified).
168
- *
169
- * NOT sourced from the subgraph even though EligibilityModuleContract
170
- * .superAdmin is populated and matches on chain (verified: module
171
- * 0x27114cb7… → 0x23f90b38… on both). Every caller is requireSuperAdmin, a
172
- * pure revert predictor for the onlySuperAdmin modifier. Indexing lag over a
173
- * transferSuperAdmin would either broadcast a doomed admin transaction (the
174
- * outgoing admin still looks authorised) or hard-block the incoming one, and
175
- * these are all write paths where one extra eth_call is noise next to the
176
- * transaction itself.
177
- */
178
- export declare function getSuperAdmin(provider: ethers.providers.Provider, eligibilityModuleAddress: string): Promise<string>;
179
- /**
180
- * Fail fast (exit 4) when the signer is not the module superAdmin, naming
181
- * who the superAdmin actually is — BEFORE any gas is spent. Returns the
182
- * superAdmin address on success. All EligibilityModule admin writes are
183
- * onlySuperAdmin (verified, see module header).
184
- */
185
- export declare function requireSuperAdmin(provider: ethers.providers.Provider, eligibilityModuleAddress: string, signerAddress: string, action: string): Promise<string>;
186
- /**
187
- * requireSuperAdmin PLUS one extra pre-flight read, in ONE Multicall3
188
- * round-trip instead of two sequential eth_calls to the same contract.
189
- *
190
- * The two are independent: a superAdmin() failure raises the same
191
- * PreconditionError requireSuperAdmin does, while a failure of the extra read
192
- * (older module without the getter, for instance) is returned as
193
- * `{ extra: null, extraError }` so callers can keep downgrading it to a
194
- * skipped soft check rather than blocking the write.
195
- */
196
- export declare function requireSuperAdminWithRead<T = any>(provider: ethers.providers.Provider, eligibilityModuleAddress: string, signerAddress: string, action: string, extra: EligibilityRead): Promise<{
197
- admin: string;
198
- extra: T | null;
199
- extraError: any;
200
- }>;
201
- /** Signer-side vouching gate: the rate-limit/grace reads behind canUserVouch. */
202
- export interface VoucherGate {
203
- canVouch: boolean;
204
- dailyUsed: number;
205
- maxDaily: number;
206
- /** Unix seconds; 0 = never set (no restriction applies). */
207
- joinTime: number;
208
- }
209
- /**
210
- * Read the signer-side vouching gate in ONE Multicall3 round-trip:
211
- * canUserVouch (the authoritative on-chain answer), getCurrentDailyVouchCount
212
- * vs getMaxDailyVouches, and getUserJoinTime for the new-account grace.
213
- */
214
- export declare function readVoucherGate(provider: ethers.providers.Provider, eligibilityModuleAddress: string, voucher: string): Promise<VoucherGate>;
215
- /**
216
- * Human reason why a signer cannot vouch right now, derived from the gate
217
- * reads. canUserVouch is authoritative; this maps its `false` to the same
218
- * friendly reasons the contract enforces (daily rate limit, else the
219
- * new-account grace). Returns null when the signer can vouch.
220
- */
221
- export declare function vouchRestriction(gate: VoucherGate, now?: number): {
222
- message: string;
223
- suggestion: string;
224
- } | null;
225
- /** "2/3 used today" quota fragment shared by vouch status + vouch for. */
226
- export declare function vouchQuotaLabel(gate: VoucherGate): string;
227
- /** Everything `pop vouch for` pre-flights in one read batch. */
228
- export interface VouchPreflightState {
229
- gate: VoucherGate;
230
- config: VouchConfigView;
231
- /** Wearer's current (epoch-aware) vouch count for the hat. */
232
- currentCount: number;
233
- }
234
- /**
235
- * Pre-flight reads for `pop vouch for`, in ONE Multicall3 round-trip (was six
236
- * separate eth_calls): the signer gate, the hat's vouch config
237
- * (enabled/quorum), and the wearer's current count for the progress line.
238
- *
239
- * Deliberately RPC — this gates a write, and every field predicts a revert
240
- * (VouchingNotEnabled, NewUserVouchingRestricted, VouchingRateLimitExceeded).
241
- */
242
- export declare function readVouchPreflight(provider: ethers.providers.Provider, eligibilityModuleAddress: string, hatId: ethers.BigNumberish, voucher: string, wearer: string): Promise<VouchPreflightState>;
243
- /**
244
- * Fail fast (exit 4) on every vouch precondition the contract would revert
245
- * on: vouching disabled, daily rate limit, new-account grace. Mirrors
246
- * vouchFor's own gate order so the friendly message matches the revert the
247
- * tx would have produced. Port of `pop vouch for`'s gateVouch —
248
- * src/commands/vouch/for.ts.
249
- */
250
- export declare function gateVouch(state: VouchPreflightState, hatId: string): void;
251
- /** Claim-side pre-flight state for `pop vouch claim`. */
252
- export interface ClaimGateState {
253
- eligible: boolean;
254
- standing: boolean;
255
- config: VouchConfigView;
256
- currentCount: number;
257
- }
258
- /**
259
- * Read getWearerStatus + vouch progress for a claim pre-flight, in ONE
260
- * Multicall3 round-trip (was three eth_calls).
261
- *
262
- * getWearerStatus stays RPC on purpose. Besides gating a write, the subgraph's
263
- * WearerEligibility entity is NOT equivalent: it only materialises when an
264
- * admin sets a wearer-specific rule. VERIFIED live — wearer
265
- * 0x1302e867… reached quorum on hat 29089782865237956866… and
266
- * getWearerStatus() returns (true, true) on chain, yet the Gnosis subgraph has
267
- * ZERO WearerEligibility rows for that address. Sourcing the claim gate from
268
- * the subgraph would reject every vouch-eligible claimer.
269
- */
270
- export declare function readClaimGate(provider: ethers.providers.Provider, eligibilityModuleAddress: string, wearer: string, hatId: ethers.BigNumberish): Promise<ClaimGateState>;
271
- /**
272
- * True when the signer's own vouch record exists (raw, epoch-unaware).
273
- *
274
- * RPC-only: the sole caller is `pop vouch revoke`'s pre-flight, which exists
275
- * to predict revokeVouch's HasNotVouched revert. The subgraph could answer it
276
- * (Vouch filtered on hatId+wearer+voucher+isActive is populated), but a stale
277
- * "false" blocks a legitimate revoke and a stale "true" broadcasts a doomed
278
- * one.
279
- */
280
- export declare function hasVouched(provider: ethers.providers.Provider, eligibilityModuleAddress: string, hatId: ethers.BigNumberish, wearer: string, voucher: string): Promise<boolean>;
281
- /** What `pop vouch revoke` pre-flights, in one Multicall3 round-trip. */
282
- export interface RevokeGate {
283
- /** Raw `vouchers[hat][wearer][voucher]` — true even for a superseded epoch. */
284
- hasVouched: boolean;
285
- /** Epoch-aware `currentVouchCount(hat, wearer)`; 0 proves revokeVouch reverts. */
286
- currentCount: number;
287
- }
288
- /**
289
- * Revoke pre-flight, RPC-only (it predicts a revert, so indexing lag is not
290
- * acceptable) and batched into ONE round-trip.
291
- *
292
- * `hasVouched` ALONE IS NOT SUFFICIENT: the getter returns the raw `vouchers`
293
- * mapping with no epoch filter (VERIFIED, contracts origin/main — it is a bare
294
- * `return _layout().vouchers[hatId][wearer][voucher]`), while revokeVouch first
295
- * requires `wearerVouchEpoch[hatId][wearer] == vouchConfigEpoch[hatId]`. After a
296
- * configureVouching/resetVouches/clearWearerVouches, hasVouched still says true
297
- * and the transaction still reverts HasNotVouched.
298
- *
299
- * currentVouchCount closes most of that gap: it returns 0 for exactly the stale-epoch
300
- * case, and a zero count also makes the `newCount = count - 1` underflow unavoidable —
301
- * so `currentCount == 0` guarantees a revert and can be blocked with no false negatives.
302
- *
303
- * One residual case stays unpredictable off-chain: the wearer's epoch is current
304
- * (someone else vouched after the bump) but THIS voucher's record is not. There is no
305
- * getter for voucherRecordEpoch, so the decoded HasNotVouched revert still covers it.
306
- */
307
- export declare function readRevokeGate(provider: ethers.providers.Provider, eligibilityModuleAddress: string, hatId: ethers.BigNumberish, wearer: string, voucher: string): Promise<RevokeGate>;
308
- /**
309
- * True when `applicant` has an active application for `hatId`.
310
- *
311
- * RPC-only. RoleApplication.active IS populated on the live subgraph, but the
312
- * ONLY caller of this helper is `pop role withdraw-application`'s pre-flight
313
- * (src/commands/role/withdraw-application.ts), which predicts the
314
- * NoActiveApplication revert — there is no display caller. `pop role
315
- * applications` reads the subgraph via listRoleApplications below.
316
- */
317
- export declare function hasActiveApplication(provider: ethers.providers.Provider, eligibilityModuleAddress: string, hatId: ethers.BigNumberish, applicant: string): Promise<boolean>;
318
- /**
319
- * Read paused() (superAdmin emergency-pause state).
320
- *
321
- * RPC-only. EligibilityModuleContract.isPaused is populated and agrees with
322
- * chain (verified: false on module 0x27114cb7… both ways), but the only caller
323
- * is `pop role admin pause/unpause`, which uses it to predict OpenZeppelin's
324
- * ExpectedPause / EnforcedPause revert.
325
- */
326
- export declare function isPaused(provider: ethers.providers.Provider, eligibilityModuleAddress: string): Promise<boolean>;
327
- /** One row of FETCH_VOUCHES_FOR_ORG (raw subgraph entity shape). */
328
- export interface VouchRow {
329
- id: string;
330
- hatId: string;
331
- wearer: string;
332
- wearerUsername: string | null;
333
- voucher: string;
334
- voucherUsername: string | null;
335
- vouchCount: string | null;
336
- isActive: boolean;
337
- createdAt: string | null;
338
- }
339
- /**
340
- * Port of `pop vouch list` — src/commands/vouch/list.ts. Pure subgraph
341
- * (FETCH_VOUCHES_FOR_ORG); display only, never a quorum decision (see the
342
- * document's isActive epoch note in graph/documents/vouch.ts). `hatId` filter
343
- * is applied client-side by string equality, exactly as the CLI does.
344
- */
345
- export declare function listVouches(client: GraphClient, eligibilityModuleAddress: string, opts?: {
346
- hatId?: string;
347
- chainId?: number;
348
- }): Promise<VouchRow[]>;
349
- /** One row of FETCH_ALL/USER_ROLE_APPLICATIONS (raw subgraph entity shape). */
350
- export interface RoleApplicationRow {
351
- id: string;
352
- hatId: string;
353
- applicant: string;
354
- applicantUsername: string | null;
355
- applicationHash: string;
356
- active: boolean;
357
- appliedAt: string | null;
358
- }
359
- /**
360
- * Port of `pop role applications` — src/commands/role/applications.ts.
361
- * Pure subgraph: FETCH_USER_ROLE_APPLICATIONS when `applicant` is given
362
- * (lowercased, as the CLI does), else FETCH_ALL_ROLE_APPLICATIONS — both
363
- * filtered by eligibilityModuleId. `hatId` filter is applied client-side by
364
- * string equality, exactly as the CLI does.
365
- */
366
- export declare function listRoleApplications(client: GraphClient, eligibilityModuleAddress: string, opts?: {
367
- applicant?: string;
368
- hatId?: string;
369
- chainId?: number;
370
- }): Promise<RoleApplicationRow[]>;
371
- /**
372
- * Resolve a role name to its hat ID by querying the org's roles.
373
- * Port of `pop vouch for`'s resolveRoleToHatId — src/commands/vouch/for.ts —
374
- * minus the TTY disambiguation select (CLI UX): exact match first, then
375
- * partial; multiple matches always fail with the candidate list.
376
- */
377
- export declare function resolveRoleNameToHatId(client: GraphClient, orgIdOrName: string, roleName: string, chainId?: number): Promise<string>;