@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,480 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task-domain transaction builders (TaskManagerNew).
|
|
3
|
+
*
|
|
4
|
+
* Level 1 — pure builders (sync, zero I/O). One per contract write; they take
|
|
5
|
+
* resolved addresses + prepared values and return a TxIntent. ALL argument
|
|
6
|
+
* encoding lives here, byte-for-byte as the CLI encodes it: stringToBytes
|
|
7
|
+
* titles, ipfsCidToBytes32 hashes, parseUnits amounts (18d PT payouts, token
|
|
8
|
+
* registry decimals for bounties), and the v6/legacy createTask arity switch
|
|
9
|
+
* via TaskManagerFeatures + LEGACY_TM_FRAGMENTS.
|
|
10
|
+
*
|
|
11
|
+
* Level 2 — resolved builders (async, `<action>Intent(ctx, params)`). They
|
|
12
|
+
* resolve the org's TaskManager via reads/resolve, replicate the CLI's
|
|
13
|
+
* payout/pricing derivation and read-merge logic, pin metadata via ../ipfs,
|
|
14
|
+
* then delegate to the Level-1 builder. Duplicate checks, idempotency caches,
|
|
15
|
+
* confirmation prompts and lens pre-flights are CLI UX and are deliberately
|
|
16
|
+
* NOT ported.
|
|
17
|
+
*/
|
|
18
|
+
import { ethers } from 'ethers';
|
|
19
|
+
import type { TxIntent } from './intent';
|
|
20
|
+
import { type ExecutionCall } from './governance';
|
|
21
|
+
import { type TaskManagerFeatures } from '../version';
|
|
22
|
+
import type { PopContext } from '../context';
|
|
23
|
+
/** TaskManager.ConfigKey.ROLE_PERM — verified enum index (src/commands/task/perms.ts:49). */
|
|
24
|
+
export declare const CONFIG_KEY_ROLE_PERM = 2;
|
|
25
|
+
/**
|
|
26
|
+
* parseDeadline for the update path: the contract deliberately accepts a
|
|
27
|
+
* PAST absolute deadline here (admin lever — immediately opens a CLAIMED
|
|
28
|
+
* task to takeover), so downgrade parseDeadline's past-check to a flag.
|
|
29
|
+
* Only absolute forms (unix seconds / ISO date) can resolve to the past —
|
|
30
|
+
* relative forms ("7d") are always future — so re-parsing with now=0 never
|
|
31
|
+
* changes relative math. Port of src/commands/task/update.ts parseUpdateDeadline.
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseUpdateDeadline(input: string): {
|
|
34
|
+
value: number;
|
|
35
|
+
isPast: boolean;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Parse a folders-root input: CIDv0 (Qm…), 0x-prefixed bytes32, or "clear".
|
|
39
|
+
* Deliberately stricter than ipfsCidToBytes32 (which keccaks arbitrary
|
|
40
|
+
* strings — a silent footgun for a root pointer).
|
|
41
|
+
* Port of src/commands/task/folders.ts parseFoldersRoot.
|
|
42
|
+
*/
|
|
43
|
+
export declare function parseFoldersRoot(input: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Parse a hat-id input (decimal or 0x hex) into a BigNumber.
|
|
46
|
+
* Port of src/commands/task/perms.ts parseHatId (same message).
|
|
47
|
+
*/
|
|
48
|
+
export declare function parseHatId(input: string | number | ethers.BigNumber): ethers.BigNumber;
|
|
49
|
+
export interface CreateTaskArgs {
|
|
50
|
+
taskManagerAddress: string;
|
|
51
|
+
/** Human PT amount (18 decimals applied here, as `pop task create` does). */
|
|
52
|
+
payout: number | string;
|
|
53
|
+
/** Raw title; encoded with stringToBytes here. */
|
|
54
|
+
title: string;
|
|
55
|
+
/** CIDv0 or bytes32 metadata pointer; converted with ipfsCidToBytes32. */
|
|
56
|
+
metadataHash: string;
|
|
57
|
+
/** Resolved bytes32 project id. */
|
|
58
|
+
projectId: string;
|
|
59
|
+
/** ERC20 bounty token; defaults to AddressZero (no bounty). */
|
|
60
|
+
bountyToken?: string;
|
|
61
|
+
/** Human bounty amount; decimals come from the token registry. */
|
|
62
|
+
bountyAmount?: number | string;
|
|
63
|
+
requiresApplication?: boolean;
|
|
64
|
+
/** Unix seconds (0 = none). v6 orgs only — ignored on the legacy signature. */
|
|
65
|
+
absoluteDeadline?: number;
|
|
66
|
+
/** Seconds (0 = none). v6 orgs only — ignored on the legacy signature. */
|
|
67
|
+
completionWindow?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Feature probe result: `deadlines` picks the 9-arg v6 createTask; without
|
|
70
|
+
* it the pre-v6 7-arg signature is encoded via LEGACY_TM_FRAGMENTS (the
|
|
71
|
+
* synced ABI no longer contains it).
|
|
72
|
+
*/
|
|
73
|
+
features: Pick<TaskManagerFeatures, 'deadlines'>;
|
|
74
|
+
orgId?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Port of `pop task create` — src/commands/task/create.ts (createTask send).
|
|
78
|
+
* v6 9-arg: [payoutWei, titleBytes, metadataHash, pid, bountyToken,
|
|
79
|
+
* bountyPayoutWei, requiresApplication, absoluteDeadline, completionWindow];
|
|
80
|
+
* legacy 7-arg drops the two deadline words and uses LEGACY_TM_FRAGMENTS.
|
|
81
|
+
*/
|
|
82
|
+
export declare function buildCreateTask(a: CreateTaskArgs): TxIntent;
|
|
83
|
+
/** One row of a v6 createTasksBatch call (prepared values; NO pid inside). */
|
|
84
|
+
export interface CreateTaskBatchRow {
|
|
85
|
+
/** Human PT amount (18 decimals applied here). */
|
|
86
|
+
payout: number | string;
|
|
87
|
+
title: string;
|
|
88
|
+
/** CIDv0 or bytes32. */
|
|
89
|
+
metadataHash: string;
|
|
90
|
+
bountyToken?: string;
|
|
91
|
+
bountyAmount?: number | string;
|
|
92
|
+
requiresApplication?: boolean;
|
|
93
|
+
/** Unix seconds (0 = none). */
|
|
94
|
+
absoluteDeadline?: number;
|
|
95
|
+
/** Seconds (0 = none). */
|
|
96
|
+
completionWindow?: number;
|
|
97
|
+
}
|
|
98
|
+
export interface CreateTasksBatchArgs {
|
|
99
|
+
taskManagerAddress: string;
|
|
100
|
+
/** Resolved bytes32 project id (shared by every row). */
|
|
101
|
+
projectId: string;
|
|
102
|
+
tasks: CreateTaskBatchRow[];
|
|
103
|
+
orgId?: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Port of `pop task create-batch` (v6 path) — src/commands/task/create-batch.ts.
|
|
107
|
+
* ONE all-or-nothing createTasksBatch(pid, CreateTaskInput[]) transaction.
|
|
108
|
+
* CreateTaskInput tuple field order must match the createTasksBatch components
|
|
109
|
+
* in the synced ABI (NOTE: no pid inside): payout, title, metadataHash,
|
|
110
|
+
* bountyToken, bountyPayout, requiresApplication, absoluteDeadline,
|
|
111
|
+
* completionWindow.
|
|
112
|
+
*/
|
|
113
|
+
export declare function buildCreateTasksBatch(a: CreateTasksBatchArgs): TxIntent;
|
|
114
|
+
export interface TaskIdArgs {
|
|
115
|
+
taskManagerAddress: string;
|
|
116
|
+
/** Bare numeric id or subgraph composite `<taskManager>-<id>` (parsed here). */
|
|
117
|
+
taskId: string | number;
|
|
118
|
+
orgId?: string;
|
|
119
|
+
}
|
|
120
|
+
/** Port of `pop task claim` — src/commands/task/claim.ts (claimTask send). */
|
|
121
|
+
export declare function buildClaimTask(a: TaskIdArgs): TxIntent;
|
|
122
|
+
/**
|
|
123
|
+
* Port of `pop task unclaim` — src/commands/task/unclaim.ts (unclaimTask send).
|
|
124
|
+
* TaskManager v7 only; the feature gate lives in unclaimTaskIntent (the
|
|
125
|
+
* encoding itself is version-independent).
|
|
126
|
+
*/
|
|
127
|
+
export declare function buildUnclaimTask(a: TaskIdArgs): TxIntent;
|
|
128
|
+
export interface SubmitTaskArgs extends TaskIdArgs {
|
|
129
|
+
/** CIDv0 or bytes32 pointer to the merged submission metadata document. */
|
|
130
|
+
submissionHash: string;
|
|
131
|
+
}
|
|
132
|
+
/** Port of `pop task submit` — src/commands/task/submit.ts (submitTask send). */
|
|
133
|
+
export declare function buildSubmitTask(a: SubmitTaskArgs): TxIntent;
|
|
134
|
+
/**
|
|
135
|
+
* Port of `pop task review --action approve` — src/commands/task/review.ts
|
|
136
|
+
* (completeTask send; releases payout + bounty to the claimer).
|
|
137
|
+
*/
|
|
138
|
+
export declare function buildCompleteTask(a: TaskIdArgs): TxIntent;
|
|
139
|
+
export interface RejectTaskArgs extends TaskIdArgs {
|
|
140
|
+
/** CIDv0 or bytes32 pointer to the pinned `{rejection}` document. */
|
|
141
|
+
rejectionHash: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Port of `pop task review --action reject` — src/commands/task/review.ts
|
|
145
|
+
* (rejectTask send; no payout, task returns to CLAIMED).
|
|
146
|
+
*/
|
|
147
|
+
export declare function buildRejectTask(a: RejectTaskArgs): TxIntent;
|
|
148
|
+
/** Port of `pop task cancel` — src/commands/task/cancel.ts (cancelTask send). */
|
|
149
|
+
export declare function buildCancelTask(a: TaskIdArgs): TxIntent;
|
|
150
|
+
export interface AssignTaskArgs extends TaskIdArgs {
|
|
151
|
+
/** Resolved assignee address. */
|
|
152
|
+
assignee: string;
|
|
153
|
+
}
|
|
154
|
+
/** Port of `pop task assign` — src/commands/task/assign.ts (assignTask send). */
|
|
155
|
+
export declare function buildAssignTask(a: AssignTaskArgs): TxIntent;
|
|
156
|
+
export interface ApplyForTaskArgs extends TaskIdArgs {
|
|
157
|
+
/** CIDv0 or bytes32 pointer to the pinned `{notes, experience}` document. */
|
|
158
|
+
applicationHash: string;
|
|
159
|
+
}
|
|
160
|
+
/** Port of `pop task apply` — src/commands/task/apply.ts (applyForTask send). */
|
|
161
|
+
export declare function buildApplyForTask(a: ApplyForTaskArgs): TxIntent;
|
|
162
|
+
export interface ApproveApplicationArgs extends TaskIdArgs {
|
|
163
|
+
applicant: string;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Port of `pop task approve-app` — src/commands/task/approve-application.ts
|
|
167
|
+
* (approveApplication send).
|
|
168
|
+
*/
|
|
169
|
+
export declare function buildApproveApplication(a: ApproveApplicationArgs): TxIntent;
|
|
170
|
+
export interface UpdateTaskArgs extends TaskIdArgs {
|
|
171
|
+
/** MERGED final payout in wei (the CLI's read-merge produces wei values). */
|
|
172
|
+
payoutWei: ethers.BigNumberish;
|
|
173
|
+
/** Merged final title; encoded with stringToBytes here. */
|
|
174
|
+
title: string;
|
|
175
|
+
/** Merged final metadata pointer (CIDv0 or bytes32; '' ⇒ HashZero). */
|
|
176
|
+
metadataHash: string;
|
|
177
|
+
/** Merged final bounty token (AddressZero = none). */
|
|
178
|
+
bountyToken: string;
|
|
179
|
+
/** Merged final bounty payout in raw token units. */
|
|
180
|
+
bountyPayoutWei: ethers.BigNumberish;
|
|
181
|
+
/** Merged final absolute deadline (unix seconds; 0 = none). */
|
|
182
|
+
absoluteDeadline: number;
|
|
183
|
+
/** Merged final completion window (seconds; 0 = none). */
|
|
184
|
+
completionWindow: number;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Port of `pop task update` — src/commands/task/update.ts (updateTask send).
|
|
188
|
+
* updateTask is a FULL OVERWRITE on-chain (8-arg v6 signature): every field is
|
|
189
|
+
* the merged FINAL value, in wei — use updateTaskIntent for the read-merge.
|
|
190
|
+
* The CLI refuses the pre-v6 6-field signature entirely (features.deadlines
|
|
191
|
+
* gate), so this builder only ever emits the v6 shape.
|
|
192
|
+
*/
|
|
193
|
+
export declare function buildUpdateTask(a: UpdateTaskArgs): TxIntent;
|
|
194
|
+
export interface UpdateTaskMetadataArgs extends TaskIdArgs {
|
|
195
|
+
/** Merged final title; encoded with stringToBytes here. */
|
|
196
|
+
title: string;
|
|
197
|
+
/** Merged final metadata pointer (CIDv0 or bytes32). */
|
|
198
|
+
metadataHash: string;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Port of `pop task edit-meta` — src/commands/task/edit-meta.ts
|
|
202
|
+
* (updateTaskMetadata send). v5+; preserves payout/bounty on-chain but fully
|
|
203
|
+
* overwrites the title + metadata pointer pair.
|
|
204
|
+
*/
|
|
205
|
+
export declare function buildUpdateTaskMetadata(a: UpdateTaskMetadataArgs): TxIntent;
|
|
206
|
+
export interface SetProjectRolePermArgs {
|
|
207
|
+
taskManagerAddress: string;
|
|
208
|
+
/** Resolved bytes32 project id. */
|
|
209
|
+
projectId: string;
|
|
210
|
+
hatId: ethers.BigNumberish;
|
|
211
|
+
/** TaskPerm bitmask (uint8). */
|
|
212
|
+
mask: number;
|
|
213
|
+
orgId?: string;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Port of `pop task perms set` — src/commands/task/perms.ts:309
|
|
217
|
+
* (setProjectRolePerm send; creator-hat/executor gate stays on-chain).
|
|
218
|
+
*/
|
|
219
|
+
export declare function buildSetProjectRolePerm(a: SetProjectRolePermArgs): TxIntent;
|
|
220
|
+
/**
|
|
221
|
+
* The executor-gated setConfig(ROLE_PERM, abi.encode(uint256 hatId, uint8
|
|
222
|
+
* mask)) call `pop task perms propose-global` wraps in a proposal —
|
|
223
|
+
* src/commands/task/perms.ts:418. The CLI encodes via an inline
|
|
224
|
+
* `setConfig(uint8,bytes)` interface; the synced TaskManagerNew ABI carries
|
|
225
|
+
* the same signature, so the calldata is byte-identical.
|
|
226
|
+
*/
|
|
227
|
+
export declare function buildSetGlobalRolePermCall(taskManagerAddress: string, hatId: ethers.BigNumberish, mask: number): ExecutionCall;
|
|
228
|
+
export interface ProposeGlobalRolePermArgs {
|
|
229
|
+
hybridVotingAddress: string;
|
|
230
|
+
taskManagerAddress: string;
|
|
231
|
+
hatId: ethers.BigNumberish;
|
|
232
|
+
mask: number;
|
|
233
|
+
durationMinutes: ethers.BigNumberish;
|
|
234
|
+
/** bytes32 of the pinned proposal metadata (ipfsCidToBytes32 applied by caller or here via CID). */
|
|
235
|
+
descriptionHash: string;
|
|
236
|
+
orgId?: string;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Port of `pop task perms propose-global` — src/commands/task/perms.ts:400.
|
|
240
|
+
* HybridVoting.createProposal(titleBytes, descriptionHash, duration, 2,
|
|
241
|
+
* [[setConfig call], []], []) — option 0 applies the mask, option 1 keeps
|
|
242
|
+
* current. Title matches the CLI's deterministic string.
|
|
243
|
+
*/
|
|
244
|
+
export declare function buildProposeGlobalRolePerm(a: ProposeGlobalRolePermArgs): TxIntent;
|
|
245
|
+
export interface SetFoldersArgs {
|
|
246
|
+
taskManagerAddress: string;
|
|
247
|
+
/** CAS guard: the root believed current (read over RPC, never the subgraph). */
|
|
248
|
+
expectedCurrentRoot: string;
|
|
249
|
+
/** New bytes32 root (use parseFoldersRoot for Qm…/'clear' inputs). */
|
|
250
|
+
newRoot: string;
|
|
251
|
+
orgId?: string;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Port of `pop task folders set` — src/commands/task/folders.ts:286
|
|
255
|
+
* (setFolders send). CAS-guarded: reverts FoldersRootStale when
|
|
256
|
+
* expectedCurrentRoot no longer matches; the CLI's read-retry-once loop is
|
|
257
|
+
* execution-time behavior and stays host-side.
|
|
258
|
+
*/
|
|
259
|
+
export declare function buildSetFolders(a: SetFoldersArgs): TxIntent;
|
|
260
|
+
export interface CreateTaskParams {
|
|
261
|
+
org: string;
|
|
262
|
+
/** Project name, bytes32 pid, or numeric index (resolved like the CLI). */
|
|
263
|
+
project: string;
|
|
264
|
+
name: string;
|
|
265
|
+
description: string;
|
|
266
|
+
/** Omit to price the task from the org's payout convention (refuses to guess when the subgraph is down). */
|
|
267
|
+
payout?: number;
|
|
268
|
+
difficulty?: string;
|
|
269
|
+
estHours?: number;
|
|
270
|
+
location?: string;
|
|
271
|
+
bountyToken?: string;
|
|
272
|
+
bountyAmount?: number;
|
|
273
|
+
requiresApplication?: boolean;
|
|
274
|
+
/** '7d' / ISO / unix (string forms parsed like the CLI); v6 orgs only. */
|
|
275
|
+
deadline?: string | number;
|
|
276
|
+
/** '48h' / seconds; v6 orgs only. */
|
|
277
|
+
completionWindow?: string | number;
|
|
278
|
+
/** Skip detection (offline hosts). */
|
|
279
|
+
features?: TaskManagerFeatures;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Port of `pop task create` — src/commands/task/create.ts. Resolves the org +
|
|
283
|
+
* project, feature-gates the deadline flags, derives the payout exactly as
|
|
284
|
+
* the web app would when omitted, pins the canonical metadata document, and
|
|
285
|
+
* delegates to buildCreateTask. Duplicate-check and idempotency are CLI UX
|
|
286
|
+
* and are not ported.
|
|
287
|
+
*/
|
|
288
|
+
export declare function createTaskIntent(ctx: PopContext, p: CreateTaskParams): Promise<TxIntent>;
|
|
289
|
+
/** One JSONL row of `pop task create-batch` (the file parsing stays host-side). */
|
|
290
|
+
export interface CreateTaskBatchRowParams {
|
|
291
|
+
name: string;
|
|
292
|
+
description: string;
|
|
293
|
+
payout?: number;
|
|
294
|
+
difficulty?: string;
|
|
295
|
+
estHours?: number;
|
|
296
|
+
location?: string;
|
|
297
|
+
bountyToken?: string;
|
|
298
|
+
bountyAmount?: number;
|
|
299
|
+
requiresApplication?: boolean;
|
|
300
|
+
/** Per-row absolute claim deadline (overrides the batch default; v6 only). */
|
|
301
|
+
deadline?: string | number;
|
|
302
|
+
/** Per-row completion window (overrides the batch default; v6 only). */
|
|
303
|
+
completionWindow?: string | number;
|
|
304
|
+
}
|
|
305
|
+
export interface CreateTasksBatchParams {
|
|
306
|
+
org: string;
|
|
307
|
+
/** Passed straight through parseProjectId, as the CLI does (no title lookup). */
|
|
308
|
+
project: string;
|
|
309
|
+
tasks: CreateTaskBatchRowParams[];
|
|
310
|
+
/** Batch-wide defaults; rows may override. */
|
|
311
|
+
deadline?: string | number;
|
|
312
|
+
completionWindow?: string | number;
|
|
313
|
+
features?: TaskManagerFeatures;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Port of `pop task create-batch` — src/commands/task/create-batch.ts.
|
|
317
|
+
* Returns ONE createTasksBatch intent (all-or-nothing) on v6 orgs, or one
|
|
318
|
+
* legacy 7-arg createTask intent PER ROW on pre-v6 orgs (the CLI sends those
|
|
319
|
+
* sequentially; --continue-on-error is host-side execution policy). Per-row
|
|
320
|
+
* metadata is pinned in input order so receipt TaskCreated logs line up.
|
|
321
|
+
*/
|
|
322
|
+
export declare function createTasksBatchIntents(ctx: PopContext, p: CreateTasksBatchParams): Promise<TxIntent[]>;
|
|
323
|
+
export interface TaskActionParams {
|
|
324
|
+
org: string;
|
|
325
|
+
/** Bare numeric id or subgraph composite `<taskManager>-<id>`. */
|
|
326
|
+
task: string | number;
|
|
327
|
+
}
|
|
328
|
+
/** Port of `pop task claim` — src/commands/task/claim.ts. */
|
|
329
|
+
export declare function claimTaskIntent(ctx: PopContext, p: TaskActionParams): Promise<TxIntent>;
|
|
330
|
+
export interface UnclaimTaskParams extends TaskActionParams {
|
|
331
|
+
features?: TaskManagerFeatures;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Port of `pop task unclaim` — src/commands/task/unclaim.ts (TaskManager v7).
|
|
335
|
+
* Feature-gated like the CLI when a provider (or features override) is
|
|
336
|
+
* available; without either the gate is skipped — the encoding is identical
|
|
337
|
+
* and the contract is the authority. The self-vs-force consent tiering and
|
|
338
|
+
* the lens gate are host UX.
|
|
339
|
+
*/
|
|
340
|
+
export declare function unclaimTaskIntent(ctx: PopContext, p: UnclaimTaskParams): Promise<TxIntent>;
|
|
341
|
+
export interface SubmitTaskParams extends TaskActionParams {
|
|
342
|
+
submission: string;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Port of `pop task submit` — src/commands/task/submit.ts. The submission is
|
|
346
|
+
* a FULL OVERWRITE of the task's metadata pointer, so the current document is
|
|
347
|
+
* read first (subgraph → IPFS fallback) and merged; when the base is
|
|
348
|
+
* unrecoverable this REFUSES (exit INFRA) rather than blanking the task's
|
|
349
|
+
* name/description/dueDate. Pre-flight (CLAIMED + claimer) is host UX.
|
|
350
|
+
*/
|
|
351
|
+
export declare function submitTaskIntent(ctx: PopContext, p: SubmitTaskParams): Promise<TxIntent>;
|
|
352
|
+
/** Port of `pop task review --action approve` — src/commands/task/review.ts. */
|
|
353
|
+
export declare function completeTaskIntent(ctx: PopContext, p: TaskActionParams): Promise<TxIntent>;
|
|
354
|
+
export interface RejectTaskParams extends TaskActionParams {
|
|
355
|
+
/** Rejection reason (the CLI requires --reason for reject). */
|
|
356
|
+
reason: string;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Port of `pop task review --action reject` — src/commands/task/review.ts.
|
|
360
|
+
* Pins the `{rejection}` document, then builds rejectTask. (The CLI pins
|
|
361
|
+
* after pre-flight + confirm; core has neither, so the pin is the first step.)
|
|
362
|
+
*/
|
|
363
|
+
export declare function rejectTaskIntent(ctx: PopContext, p: RejectTaskParams): Promise<TxIntent>;
|
|
364
|
+
/** Port of `pop task cancel` — src/commands/task/cancel.ts (DESTRUCTIVE; consent is host UX). */
|
|
365
|
+
export declare function cancelTaskIntent(ctx: PopContext, p: TaskActionParams): Promise<TxIntent>;
|
|
366
|
+
export interface AssignTaskParams extends TaskActionParams {
|
|
367
|
+
/** Assignee address (checksummed via requireAddress). */
|
|
368
|
+
assignee?: string;
|
|
369
|
+
/** Or a username, resolved across all chains like the CLI. */
|
|
370
|
+
username?: string;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Port of `pop task assign` — src/commands/task/assign.ts. --username resolves
|
|
374
|
+
* via the same inline all-chains accounts query; --assignee is validated as an
|
|
375
|
+
* address. One of the two is required.
|
|
376
|
+
*/
|
|
377
|
+
export declare function assignTaskIntent(ctx: PopContext, p: AssignTaskParams): Promise<TxIntent>;
|
|
378
|
+
export interface ApplyForTaskParams extends TaskActionParams {
|
|
379
|
+
notes?: string;
|
|
380
|
+
experience?: string;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Port of `pop task apply` — src/commands/task/apply.ts. Pins the
|
|
384
|
+
* `{notes, experience}` document, then builds applyForTask. The
|
|
385
|
+
* requiresApplication / duplicate-application pre-flights are host UX (the
|
|
386
|
+
* contract's NoApplicationRequired / AlreadyApplied decodes are authoritative).
|
|
387
|
+
*/
|
|
388
|
+
export declare function applyForTaskIntent(ctx: PopContext, p: ApplyForTaskParams): Promise<TxIntent>;
|
|
389
|
+
export interface ApproveApplicationParams extends TaskActionParams {
|
|
390
|
+
applicant: string;
|
|
391
|
+
}
|
|
392
|
+
/** Port of `pop task approve-app` — src/commands/task/approve-application.ts. */
|
|
393
|
+
export declare function approveApplicationIntent(ctx: PopContext, p: ApproveApplicationParams): Promise<TxIntent>;
|
|
394
|
+
export interface UpdateTaskParams extends TaskActionParams {
|
|
395
|
+
payout?: number;
|
|
396
|
+
name?: string;
|
|
397
|
+
description?: string;
|
|
398
|
+
/** ERC20 address, or 'none' to clear the bounty. */
|
|
399
|
+
bountyToken?: string;
|
|
400
|
+
bountyAmount?: number;
|
|
401
|
+
/** A PAST value is deliberately accepted (admin takeover lever). */
|
|
402
|
+
deadline?: string;
|
|
403
|
+
completionWindow?: string;
|
|
404
|
+
features?: TaskManagerFeatures;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Port of `pop task update` — src/commands/task/update.ts. updateTask is a
|
|
408
|
+
* FULL OVERWRITE on-chain, so this reads the current state first (chain via
|
|
409
|
+
* the task lens for payout/bounty/deadlines — ctx.provider required; subgraph
|
|
410
|
+
* + IPFS for title/description/metadata), merges only the fields given, and
|
|
411
|
+
* re-pins metadata ONLY when name/description actually change. Refuses (INFRA)
|
|
412
|
+
* when the overwrite base is unrecoverable. A past deadline is accepted and
|
|
413
|
+
* flagged in meta.summary.deadlineIsPast.
|
|
414
|
+
*/
|
|
415
|
+
export declare function updateTaskIntent(ctx: PopContext, p: UpdateTaskParams): Promise<TxIntent>;
|
|
416
|
+
export interface EditTaskMetadataParams extends TaskActionParams {
|
|
417
|
+
name?: string;
|
|
418
|
+
description?: string;
|
|
419
|
+
features?: TaskManagerFeatures;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Port of `pop task edit-meta` — src/commands/task/edit-meta.ts
|
|
423
|
+
* (updateTaskMetadata; TaskManager v5+). Reads the current name/description
|
|
424
|
+
* (subgraph → IPFS fallback), merges, and re-pins. Returns NULL when the merge
|
|
425
|
+
* is a no-op — the CLI short-circuits with success and never sends. The
|
|
426
|
+
* terminal-status read uses the lens when ctx.provider is present (parity);
|
|
427
|
+
* without one, the contract's BadStatus revert is the authority.
|
|
428
|
+
*/
|
|
429
|
+
export declare function editTaskMetadataIntent(ctx: PopContext, p: EditTaskMetadataParams): Promise<TxIntent | null>;
|
|
430
|
+
export interface SetProjectRolePermParams {
|
|
431
|
+
org: string;
|
|
432
|
+
/** Project bytes32 id or title (resolved via the perms tiers, like the CLI). */
|
|
433
|
+
project: string;
|
|
434
|
+
/** Hat id (decimal or 0x hex). */
|
|
435
|
+
hat: string | number | ethers.BigNumber;
|
|
436
|
+
/** Comma-separated permission list ('create,claim' / 'none') or a raw mask. */
|
|
437
|
+
perms: string | number;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Port of `pop task perms set` — src/commands/task/perms.ts:309. Resolves the
|
|
441
|
+
* project by hex or title (PERMS_QUERY_FULL/LEGACY tiers), parses the perm
|
|
442
|
+
* list into a mask, and builds setProjectRolePerm. The creator-hat/executor
|
|
443
|
+
* gate stays on-chain (masks are not readable per-wearer).
|
|
444
|
+
*/
|
|
445
|
+
export declare function setProjectRolePermIntent(ctx: PopContext, p: SetProjectRolePermParams): Promise<TxIntent>;
|
|
446
|
+
export interface ProposeGlobalRolePermParams {
|
|
447
|
+
org: string;
|
|
448
|
+
hat: string | number | ethers.BigNumber;
|
|
449
|
+
perms: string | number;
|
|
450
|
+
/** Vote duration in minutes (CLI default 60). */
|
|
451
|
+
duration?: number;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Port of `pop task perms propose-global` — src/commands/task/perms.ts:400.
|
|
455
|
+
* setConfig(ROLE_PERM) is executor-only, so the change ships as a HybridVoting
|
|
456
|
+
* proposal whose option-0 batch targets the TaskManager. Pins the proposal
|
|
457
|
+
* metadata {description, optionNames, createdAt} (exact key order), then
|
|
458
|
+
* delegates to buildProposeGlobalRolePerm.
|
|
459
|
+
*/
|
|
460
|
+
export declare function proposeGlobalRolePermIntent(ctx: PopContext, p: ProposeGlobalRolePermParams): Promise<TxIntent>;
|
|
461
|
+
export interface SetFoldersParams {
|
|
462
|
+
org: string;
|
|
463
|
+
/** New folder-tree root: Qm… CIDv0, 0x-prefixed bytes32, or "clear". */
|
|
464
|
+
newRoot: string;
|
|
465
|
+
/**
|
|
466
|
+
* CAS guard override. When omitted it is read from chain via the lens
|
|
467
|
+
* (ctx.provider required) — deliberately NEVER the subgraph: a stale value
|
|
468
|
+
* guarantees the FoldersRootStale revert this read exists to predict.
|
|
469
|
+
*/
|
|
470
|
+
expectedCurrentRoot?: string;
|
|
471
|
+
features?: TaskManagerFeatures;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Port of `pop task folders set` — src/commands/task/folders.ts:286
|
|
475
|
+
* (TaskManager v4+). Parses the new root, auto-fills the CAS expected root
|
|
476
|
+
* from chain, and returns NULL when the root already matches (the CLI reports
|
|
477
|
+
* success without sending). The stale-root retry-once loop is execution-time
|
|
478
|
+
* behavior and stays host-side.
|
|
479
|
+
*/
|
|
480
|
+
export declare function setFoldersIntent(ctx: PopContext, p: SetFoldersParams): Promise<TxIntent | null>;
|