@poa-box/core 0.1.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 +201 -0
- package/dist/abis/DirectDemocracyVotingNew.d.ts +749 -0
- package/dist/abis/DirectDemocracyVotingNew.js +961 -0
- package/dist/abis/ERC20.d.ts +90 -0
- package/dist/abis/ERC20.js +125 -0
- package/dist/abis/EducationHubNew.d.ts +590 -0
- package/dist/abis/EducationHubNew.js +762 -0
- package/dist/abis/EligibilityModuleNew.d.ts +1615 -0
- package/dist/abis/EligibilityModuleNew.js +2082 -0
- package/dist/abis/Executor.d.ts +619 -0
- package/dist/abis/Executor.js +796 -0
- package/dist/abis/HybridVotingNew.d.ts +898 -0
- package/dist/abis/HybridVotingNew.js +1149 -0
- package/dist/abis/ImplementationRegistry.d.ts +270 -0
- package/dist/abis/ImplementationRegistry.js +355 -0
- package/dist/abis/OrgDeployerNew.d.ts +1275 -0
- package/dist/abis/OrgDeployerNew.js +1630 -0
- package/dist/abis/OrgRegistry.d.ts +670 -0
- package/dist/abis/OrgRegistry.js +868 -0
- package/dist/abis/ParticipationToken.d.ts +1086 -0
- package/dist/abis/ParticipationToken.js +1415 -0
- package/dist/abis/PasskeyAccount.d.ts +788 -0
- package/dist/abis/PasskeyAccount.js +1019 -0
- package/dist/abis/PasskeyAccountFactory.d.ts +344 -0
- package/dist/abis/PasskeyAccountFactory.js +449 -0
- package/dist/abis/PaymasterHub.d.ts +1603 -0
- package/dist/abis/PaymasterHub.js +2048 -0
- package/dist/abis/PaymentManager.d.ts +520 -0
- package/dist/abis/PaymentManager.js +671 -0
- package/dist/abis/PoaManager.d.ts +344 -0
- package/dist/abis/PoaManager.js +449 -0
- package/dist/abis/QuickJoinNew.d.ts +855 -0
- package/dist/abis/QuickJoinNew.js +1098 -0
- package/dist/abis/TaskManagerNew.d.ts +1236 -0
- package/dist/abis/TaskManagerNew.js +1573 -0
- package/dist/abis/ToggleModule.d.ts +193 -0
- package/dist/abis/ToggleModule.js +255 -0
- package/dist/abis/UniversalAccountRegistry.d.ts +577 -0
- package/dist/abis/UniversalAccountRegistry.js +750 -0
- package/dist/abis/ZkEmailInvites.d.ts +823 -0
- package/dist/abis/ZkEmailInvites.js +1060 -0
- package/dist/abis/external/AaveGovernanceV2.d.ts +128 -0
- package/dist/abis/external/AaveGovernanceV2.js +177 -0
- package/dist/abis/external/AaveGovernanceV3.d.ts +160 -0
- package/dist/abis/external/AaveGovernanceV3.js +220 -0
- package/dist/abis/external/AragonVoting.d.ts +107 -0
- package/dist/abis/external/AragonVoting.js +150 -0
- package/dist/abis/external/CurveGaugeController.d.ts +95 -0
- package/dist/abis/external/CurveGaugeController.js +130 -0
- package/dist/abis/external/CurveVotingEscrow.d.ts +86 -0
- package/dist/abis/external/CurveVotingEscrow.js +116 -0
- package/dist/abis/external/GovernorAlpha.d.ts +172 -0
- package/dist/abis/external/GovernorAlpha.js +228 -0
- package/dist/abis/external/MakerDAOChief.d.ts +92 -0
- package/dist/abis/external/MakerDAOChief.js +129 -0
- package/dist/abis/external/OZGovernor.d.ts +227 -0
- package/dist/abis/external/OZGovernor.js +317 -0
- package/dist/abis/external/SolidlyVotingEscrow.d.ts +196 -0
- package/dist/abis/external/SolidlyVotingEscrow.js +260 -0
- package/dist/abis/index.d.ts +62 -0
- package/dist/abis/index.js +98 -0
- package/dist/chains.d.ts +150 -0
- package/dist/chains.js +320 -0
- package/dist/context.d.ts +48 -0
- package/dist/context.js +38 -0
- package/dist/contracts.d.ts +24 -0
- package/dist/contracts.js +41 -0
- package/dist/encoding.d.ts +58 -0
- package/dist/encoding.js +243 -0
- package/dist/env.d.ts +10 -0
- package/dist/env.js +4 -0
- package/dist/error-catalog.d.ts +41 -0
- package/dist/error-catalog.js +941 -0
- package/dist/errors.d.ts +27 -0
- package/dist/errors.js +60 -0
- package/dist/execute/ethers.d.ts +93 -0
- package/dist/execute/ethers.js +323 -0
- package/dist/execute/index.d.ts +7 -0
- package/dist/execute/index.js +23 -0
- package/dist/execute/sponsored.d.ts +68 -0
- package/dist/execute/sponsored.js +277 -0
- package/dist/exit-codes.d.ts +18 -0
- package/dist/exit-codes.js +21 -0
- package/dist/format.d.ts +21 -0
- package/dist/format.js +89 -0
- package/dist/graph/client.d.ts +298 -0
- package/dist/graph/client.js +702 -0
- package/dist/graph/documents/activity.d.ts +9 -0
- package/dist/graph/documents/activity.js +164 -0
- package/dist/graph/documents/beacons.d.ts +172 -0
- package/dist/graph/documents/beacons.js +345 -0
- package/dist/graph/documents/index.d.ts +21 -0
- package/dist/graph/documents/index.js +57 -0
- package/dist/graph/documents/infrastructure.d.ts +30 -0
- package/dist/graph/documents/infrastructure.js +34 -0
- package/dist/graph/documents/org.d.ts +15 -0
- package/dist/graph/documents/org.js +249 -0
- package/dist/graph/documents/paymaster.d.ts +95 -0
- package/dist/graph/documents/paymaster.js +101 -0
- package/dist/graph/documents/role.d.ts +6 -0
- package/dist/graph/documents/role.js +41 -0
- package/dist/graph/documents/roles.d.ts +50 -0
- package/dist/graph/documents/roles.js +112 -0
- package/dist/graph/documents/task.d.ts +84 -0
- package/dist/graph/documents/task.js +236 -0
- package/dist/graph/documents/token.d.ts +13 -0
- package/dist/graph/documents/token.js +126 -0
- package/dist/graph/documents/treasury.d.ts +39 -0
- package/dist/graph/documents/treasury.js +136 -0
- package/dist/graph/documents/user.d.ts +120 -0
- package/dist/graph/documents/user.js +302 -0
- package/dist/graph/documents/voting-classes.d.ts +69 -0
- package/dist/graph/documents/voting-classes.js +149 -0
- package/dist/graph/documents/voting.d.ts +28 -0
- package/dist/graph/documents/voting.js +163 -0
- package/dist/graph/documents/vouch.d.ts +79 -0
- package/dist/graph/documents/vouch.js +171 -0
- package/dist/graph/documents/zkemail.d.ts +63 -0
- package/dist/graph/documents/zkemail.js +188 -0
- package/dist/graph/index.d.ts +2 -0
- package/dist/graph/index.js +41 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +92 -0
- package/dist/ipfs.d.ts +39 -0
- package/dist/ipfs.js +214 -0
- package/dist/label-aliases.d.ts +31 -0
- package/dist/label-aliases.js +70 -0
- package/dist/metadata/education.d.ts +30 -0
- package/dist/metadata/education.js +31 -0
- package/dist/metadata/index.d.ts +12 -0
- package/dist/metadata/index.js +48 -0
- package/dist/metadata/org.d.ts +92 -0
- package/dist/metadata/org.js +93 -0
- package/dist/metadata/proposal.d.ts +44 -0
- package/dist/metadata/proposal.js +45 -0
- package/dist/metadata/role.d.ts +38 -0
- package/dist/metadata/role.js +35 -0
- package/dist/metadata/task.d.ts +108 -0
- package/dist/metadata/task.js +81 -0
- package/dist/metadata/token.d.ts +32 -0
- package/dist/metadata/token.js +36 -0
- package/dist/metadata/user.d.ts +63 -0
- package/dist/metadata/user.js +70 -0
- package/dist/multicall.d.ts +32 -0
- package/dist/multicall.js +96 -0
- package/dist/payout.d.ts +59 -0
- package/dist/payout.js +96 -0
- package/dist/perms.d.ts +47 -0
- package/dist/perms.js +120 -0
- package/dist/preflight.d.ts +72 -0
- package/dist/preflight.js +269 -0
- package/dist/reads/education.d.ts +79 -0
- package/dist/reads/education.js +122 -0
- package/dist/reads/eligibility.d.ts +377 -0
- package/dist/reads/eligibility.js +687 -0
- package/dist/reads/index.d.ts +16 -0
- package/dist/reads/index.js +55 -0
- package/dist/reads/org.d.ts +258 -0
- package/dist/reads/org.js +220 -0
- package/dist/reads/paymaster.d.ts +147 -0
- package/dist/reads/paymaster.js +235 -0
- package/dist/reads/project.d.ts +33 -0
- package/dist/reads/project.js +62 -0
- package/dist/reads/resolve.d.ts +34 -0
- package/dist/reads/resolve.js +64 -0
- package/dist/reads/task.d.ts +286 -0
- package/dist/reads/task.js +280 -0
- package/dist/reads/token.d.ts +94 -0
- package/dist/reads/token.js +75 -0
- package/dist/reads/treasury.d.ts +222 -0
- package/dist/reads/treasury.js +241 -0
- package/dist/reads/user.d.ts +229 -0
- package/dist/reads/user.js +155 -0
- package/dist/reads/vote.d.ts +296 -0
- package/dist/reads/vote.js +392 -0
- package/dist/reads/zkemail.d.ts +117 -0
- package/dist/reads/zkemail.js +217 -0
- package/dist/similarity.d.ts +36 -0
- package/dist/similarity.js +67 -0
- package/dist/sponsorship-config.d.ts +47 -0
- package/dist/sponsorship-config.js +41 -0
- package/dist/stats.d.ts +11 -0
- package/dist/stats.js +27 -0
- package/dist/task-lens.d.ts +113 -0
- package/dist/task-lens.js +210 -0
- package/dist/tx/education.d.ts +169 -0
- package/dist/tx/education.js +344 -0
- package/dist/tx/eligibility.d.ts +511 -0
- package/dist/tx/eligibility.js +818 -0
- package/dist/tx/governance.d.ts +85 -0
- package/dist/tx/governance.js +87 -0
- package/dist/tx/index.d.ts +17 -0
- package/dist/tx/index.js +56 -0
- package/dist/tx/intent.d.ts +67 -0
- package/dist/tx/intent.js +48 -0
- package/dist/tx/org.d.ts +321 -0
- package/dist/tx/org.js +544 -0
- package/dist/tx/paymaster.d.ts +140 -0
- package/dist/tx/paymaster.js +251 -0
- package/dist/tx/project.d.ts +146 -0
- package/dist/tx/project.js +217 -0
- package/dist/tx/task.d.ts +480 -0
- package/dist/tx/task.js +1149 -0
- package/dist/tx/token.d.ts +96 -0
- package/dist/tx/token.js +165 -0
- package/dist/tx/treasury.d.ts +474 -0
- package/dist/tx/treasury.js +911 -0
- package/dist/tx/user.d.ts +177 -0
- package/dist/tx/user.js +292 -0
- package/dist/tx/vote.d.ts +332 -0
- package/dist/tx/vote.js +762 -0
- package/dist/tx/zkemail.d.ts +90 -0
- package/dist/tx/zkemail.js +210 -0
- package/dist/validation.d.ts +8 -0
- package/dist/validation.js +39 -0
- package/dist/version.d.ts +142 -0
- package/dist/version.js +257 -0
- package/dist/zkemail.d.ts +161 -0
- package/dist/zkemail.js +299 -0
- package/package.json +130 -0
|
@@ -0,0 +1,511 @@
|
|
|
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>;
|