@andrewkimjoseph/celina-sdk 0.25.7 → 0.25.9

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 (31) hide show
  1. package/build/abis/governance.d.ts +33 -0
  2. package/build/abis/governance.js +28 -0
  3. package/build/abis/governance.js.map +1 -1
  4. package/build/services/governance.service.d.ts +35 -4
  5. package/build/services/governance.service.js +250 -48
  6. package/build/services/governance.service.js.map +1 -1
  7. package/build/src/abis/governance.d.ts +33 -0
  8. package/build/src/abis/governance.js +28 -0
  9. package/build/src/abis/governance.js.map +1 -1
  10. package/build/src/services/governance.service.d.ts +35 -4
  11. package/build/src/services/governance.service.js +250 -48
  12. package/build/src/services/governance.service.js.map +1 -1
  13. package/build/src/tools/domains/governance.js +36 -4
  14. package/build/src/tools/domains/governance.js.map +1 -1
  15. package/build/src/tools/types.d.ts +1 -0
  16. package/build/src/tools/website-sync.js +2 -0
  17. package/build/src/tools/website-sync.js.map +1 -1
  18. package/build/src/utils/governance-queue.d.ts +14 -0
  19. package/build/src/utils/governance-queue.js +11 -0
  20. package/build/src/utils/governance-queue.js.map +1 -1
  21. package/build/tests/catalog/domains/chain-ext.js +26 -1
  22. package/build/tests/catalog/domains/chain-ext.js.map +1 -1
  23. package/build/tools/domains/governance.js +36 -4
  24. package/build/tools/domains/governance.js.map +1 -1
  25. package/build/tools/types.d.ts +1 -0
  26. package/build/tools/website-sync.js +2 -0
  27. package/build/tools/website-sync.js.map +1 -1
  28. package/build/utils/governance-queue.d.ts +14 -0
  29. package/build/utils/governance-queue.js +11 -0
  30. package/build/utils/governance-queue.js.map +1 -1
  31. package/package.json +1 -1
@@ -151,6 +151,39 @@ export declare const governanceAbi: readonly [{
151
151
  readonly type: "bool";
152
152
  }];
153
153
  readonly stateMutability: "view";
154
+ }, {
155
+ readonly type: "function";
156
+ readonly name: "lastDequeue";
157
+ readonly inputs: readonly [];
158
+ readonly outputs: readonly [{
159
+ readonly name: "";
160
+ readonly type: "uint256";
161
+ }];
162
+ readonly stateMutability: "view";
163
+ }, {
164
+ readonly type: "function";
165
+ readonly name: "dequeueFrequency";
166
+ readonly inputs: readonly [];
167
+ readonly outputs: readonly [{
168
+ readonly name: "";
169
+ readonly type: "uint256";
170
+ }];
171
+ readonly stateMutability: "view";
172
+ }, {
173
+ readonly type: "function";
174
+ readonly name: "concurrentProposals";
175
+ readonly inputs: readonly [];
176
+ readonly outputs: readonly [{
177
+ readonly name: "";
178
+ readonly type: "uint256";
179
+ }];
180
+ readonly stateMutability: "view";
181
+ }, {
182
+ readonly type: "function";
183
+ readonly name: "dequeueProposalsIfReady";
184
+ readonly inputs: readonly [];
185
+ readonly outputs: readonly [];
186
+ readonly stateMutability: "nonpayable";
154
187
  }, {
155
188
  readonly type: "function";
156
189
  readonly name: "upvote";
@@ -93,6 +93,34 @@ export const governanceAbi = [
93
93
  outputs: [{ name: "", type: "bool" }],
94
94
  stateMutability: "view",
95
95
  },
96
+ {
97
+ type: "function",
98
+ name: "lastDequeue",
99
+ inputs: [],
100
+ outputs: [{ name: "", type: "uint256" }],
101
+ stateMutability: "view",
102
+ },
103
+ {
104
+ type: "function",
105
+ name: "dequeueFrequency",
106
+ inputs: [],
107
+ outputs: [{ name: "", type: "uint256" }],
108
+ stateMutability: "view",
109
+ },
110
+ {
111
+ type: "function",
112
+ name: "concurrentProposals",
113
+ inputs: [],
114
+ outputs: [{ name: "", type: "uint256" }],
115
+ stateMutability: "view",
116
+ },
117
+ {
118
+ type: "function",
119
+ name: "dequeueProposalsIfReady",
120
+ inputs: [],
121
+ outputs: [],
122
+ stateMutability: "nonpayable",
123
+ },
96
124
  {
97
125
  type: "function",
98
126
  name: "upvote",
@@ -1 +1 @@
1
- {"version":3,"file":"governance.js","sourceRoot":"","sources":["../../src/abis/governance.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QACh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,CAAU,CAAC;AAGrE,MAAM,UAAU,cAAc,CAAC,IAAmB;IAChD,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,uCAAuC,CAAC,CAAC;IACtF,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,sDAAsD;AACtD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM;IACN,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,WAAW;IACX,UAAU;IACV,YAAY;IACZ,UAAU;IACV,WAAW;CACH,CAAC;AAIX,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC;AAC1C,CAAC"}
@@ -37,6 +37,11 @@ export declare class GovernanceService {
37
37
  private fetchProposal;
38
38
  private listProposalIds;
39
39
  private getGovernanceQueue;
40
+ private getDequeueSchedule;
41
+ private formatDequeueSchedule;
42
+ private assertUpvoteNotBlockedByPendingDequeue;
43
+ private getProposalSnapshots;
44
+ private discoverActionableProposals;
40
45
  /**
41
46
  * List governance proposals with pagination and optional CGP metadata.
42
47
  * @param options - Pagination (`page`/`pageSize` or `offset`/`limit`) and filters
@@ -115,7 +120,9 @@ export declare class GovernanceService {
115
120
  proposalId: number;
116
121
  }[]>;
117
122
  /** Proposals currently in Referendum stage with their dequeue index. */
118
- getVotableProposals(): Promise<{
123
+ getVotableProposals(options?: {
124
+ limit?: number;
125
+ }): Promise<{
119
126
  network: "mainnet";
120
127
  proposals: {
121
128
  proposalId: number;
@@ -126,27 +133,47 @@ export declare class GovernanceService {
126
133
  message: string;
127
134
  }>;
128
135
  /** Proposals currently in Queue stage with upvote weight. */
129
- getQueuedProposals(): Promise<{
136
+ getQueuedProposals(options?: {
137
+ limit?: number;
138
+ }): Promise<{
139
+ nextDequeueProposalIds: number[];
140
+ message: string;
141
+ lastDequeue: number;
142
+ lastDequeueISO: string;
143
+ dequeueFrequencySeconds: number;
144
+ concurrentProposals: number;
145
+ dequeueReady: boolean;
146
+ secondsUntilDequeueReady: number;
130
147
  network: "mainnet";
131
148
  proposals: {
132
149
  proposalId: number;
133
150
  upvotes: string;
134
151
  stage: "Queued";
135
152
  url: string;
153
+ upvoteable: boolean;
136
154
  }[];
137
- message: string;
138
155
  }>;
139
156
  /** Queued and Referendum proposals you can upvote or vote on now. */
140
157
  getActionableGovernanceProposals(): Promise<{
158
+ nextDequeueProposalIds: number[];
159
+ message: string;
160
+ lastDequeue: number;
161
+ lastDequeueISO: string;
162
+ dequeueFrequencySeconds: number;
163
+ concurrentProposals: number;
164
+ dequeueReady: boolean;
165
+ secondsUntilDequeueReady: number;
141
166
  network: "mainnet";
142
167
  hasAny: boolean;
143
168
  hasQueued: boolean;
169
+ hasUpvoteableQueued: boolean;
144
170
  hasReferendum: boolean;
145
171
  queued: {
146
172
  proposalId: number;
147
173
  upvotes: string;
148
174
  stage: "Queued";
149
175
  url: string;
176
+ upvoteable: boolean;
150
177
  }[];
151
178
  referendum: {
152
179
  proposalId: number;
@@ -154,7 +181,6 @@ export declare class GovernanceService {
154
181
  stage: "Referendum";
155
182
  url: string;
156
183
  }[];
157
- message: string;
158
184
  }>;
159
185
  /** Referendum votes and queue upvotes cast by an address on Celo governance. */
160
186
  getGovernanceVotes(address: `0x${string}`, options?: GovernanceVotesOptions): Promise<{
@@ -220,6 +246,11 @@ export declare class GovernanceService {
220
246
  prepareVote(from: `0x${string}`, proposalId: number, vote: VoteValueName): Promise<SerializedPreparedFlow>;
221
247
  /** Upvote a Queued governance proposal (one active queue upvote per account). */
222
248
  prepareUpvote(from: `0x${string}`, proposalId: number): Promise<SerializedPreparedFlow>;
249
+ /**
250
+ * Call Governance.dequeueProposalsIfReady (public; anyone can pay gas).
251
+ * When overdue, moves up to concurrentProposals from the queue into Approval.
252
+ */
253
+ prepareDequeueProposalsIfReady(from: `0x${string}`): Promise<SerializedPreparedFlow>;
223
254
  /** Revoke all active referendum votes for an account (bulk on-chain). */
224
255
  prepareRevokeGovernanceVotes(from: `0x${string}`): Promise<SerializedPreparedFlow>;
225
256
  /** Revoke the account's active queue upvote. */
@@ -12,7 +12,7 @@ import { CHAIN } from "../config/chains.js";
12
12
  import { serializePreparedFlow, } from "../types/prepared.js";
13
13
  import { assertCeloAccountRegistered } from "../utils/celo-account.js";
14
14
  import { formatCeloAmount } from "../utils/celo-format.js";
15
- import { lesserAndGreaterAfterRevokeUpvote, lesserAndGreaterAfterUpvote, } from "../utils/governance-queue.js";
15
+ import { isGovernanceDequeueReady, lesserAndGreaterAfterRevokeUpvote, lesserAndGreaterAfterUpvote, proposalIdsNextToDequeue, } from "../utils/governance-queue.js";
16
16
  const STAGE_EXPIRY_MS = {
17
17
  Queued: 4 * 24 * 60 * 60 * 1000,
18
18
  Approval: 24 * 60 * 60 * 1000,
@@ -61,6 +61,7 @@ function getExpiryTimestamp(stage, timestampMs) {
61
61
  const expiry = STAGE_EXPIRY_MS[stage];
62
62
  return expiry ? timestampMs + expiry : null;
63
63
  }
64
+ const ACTIONABLE_PROPOSAL_SCAN_LIMIT = 120;
64
65
  /** Celo on-chain governance proposal reads, CGP enrichment, and LockedGold writes. */
65
66
  export class GovernanceService {
66
67
  clientFactory;
@@ -205,6 +206,138 @@ export class GovernanceService {
205
206
  }))
206
207
  .filter((entry) => entry.proposalId !== 0);
207
208
  }
209
+ async getDequeueSchedule() {
210
+ const client = this.getClient();
211
+ const governance = CELO_CORE_CONTRACTS.governance;
212
+ const [lastDequeue, dequeueFrequency, concurrentProposals] = await Promise.all([
213
+ client.readContract({
214
+ address: governance,
215
+ abi: governanceAbi,
216
+ functionName: "lastDequeue",
217
+ }),
218
+ client.readContract({
219
+ address: governance,
220
+ abi: governanceAbi,
221
+ functionName: "dequeueFrequency",
222
+ }),
223
+ client.readContract({
224
+ address: governance,
225
+ abi: governanceAbi,
226
+ functionName: "concurrentProposals",
227
+ }),
228
+ ]);
229
+ return {
230
+ lastDequeue: Number(lastDequeue),
231
+ dequeueFrequency: Number(dequeueFrequency),
232
+ concurrentProposals: Number(concurrentProposals),
233
+ now: Math.floor(Date.now() / 1000),
234
+ };
235
+ }
236
+ formatDequeueSchedule(schedule, dequeueReady) {
237
+ return {
238
+ lastDequeue: schedule.lastDequeue,
239
+ lastDequeueISO: new Date(schedule.lastDequeue * 1000).toISOString(),
240
+ dequeueFrequencySeconds: schedule.dequeueFrequency,
241
+ concurrentProposals: schedule.concurrentProposals,
242
+ dequeueReady,
243
+ secondsUntilDequeueReady: dequeueReady
244
+ ? 0
245
+ : Math.max(0, schedule.lastDequeue + schedule.dequeueFrequency - schedule.now),
246
+ };
247
+ }
248
+ assertUpvoteNotBlockedByPendingDequeue(proposalId, queue, schedule) {
249
+ if (!isGovernanceDequeueReady(schedule))
250
+ return;
251
+ const nextIds = proposalIdsNextToDequeue(queue, schedule.concurrentProposals);
252
+ if (!nextIds.includes(proposalId))
253
+ return;
254
+ throw new Error(`Cannot upvote proposal ${proposalId}: governance dequeue is overdue. ` +
255
+ `The next write (including upvote) runs dequeueProposalsIfReady first and would remove ` +
256
+ `proposal(s) [${nextIds.join(", ")}] from the queue, then upvote reverts with ` +
257
+ `"cannot upvote a proposal not in the queue". Call execute_dequeue_proposals_if_ready ` +
258
+ `(or prepare_dequeue_proposals_if_ready) first; those proposals move to Approval, then vote in Referendum.`);
259
+ }
260
+ async getProposalSnapshots(proposalIds) {
261
+ const uniqueIds = Array.from(new Set(proposalIds)).filter((id) => id > 0);
262
+ if (uniqueIds.length === 0)
263
+ return new Map();
264
+ const client = this.getClient();
265
+ const governance = CELO_CORE_CONTRACTS.governance;
266
+ const proposalCalls = uniqueIds.map((id) => ({
267
+ address: governance,
268
+ abi: governanceAbi,
269
+ functionName: "getProposal",
270
+ args: [BigInt(id)],
271
+ }));
272
+ const stageCalls = uniqueIds.map((id) => ({
273
+ address: governance,
274
+ abi: governanceAbi,
275
+ functionName: "getProposalStage",
276
+ args: [BigInt(id)],
277
+ }));
278
+ const [proposalResults, stageResults] = await Promise.all([
279
+ client.multicall({ contracts: proposalCalls, allowFailure: true }),
280
+ client.multicall({ contracts: stageCalls, allowFailure: true }),
281
+ ]);
282
+ const snapshots = new Map();
283
+ for (let i = 0; i < uniqueIds.length; i++) {
284
+ const id = uniqueIds[i];
285
+ const proposalResult = proposalResults[i];
286
+ const stageResult = stageResults[i];
287
+ if (!proposalResult ||
288
+ proposalResult.status !== "success" ||
289
+ !stageResult ||
290
+ stageResult.status !== "success") {
291
+ continue;
292
+ }
293
+ const [proposer, deposit, timestampSec, , url] = proposalResult.result;
294
+ if (proposer === "0x0000000000000000000000000000000000000000" &&
295
+ deposit === 0n &&
296
+ timestampSec === 0n) {
297
+ continue;
298
+ }
299
+ snapshots.set(id, {
300
+ stageName: proposalStageName(Number(stageResult.result)),
301
+ url,
302
+ });
303
+ }
304
+ return snapshots;
305
+ }
306
+ async discoverActionableProposals(limit = ACTIONABLE_PROPOSAL_SCAN_LIMIT) {
307
+ const [queueEntriesRaw, dequeueEntriesRaw, dequeueSchedule] = await Promise.all([
308
+ this.getGovernanceQueue(),
309
+ this.getDequeueWithIndices(),
310
+ this.getDequeueSchedule(),
311
+ ]);
312
+ const queueEntries = queueEntriesRaw.filter((entry) => entry.proposalId !== 0);
313
+ const dequeueEntries = dequeueEntriesRaw.filter((entry) => entry.proposalId !== 0);
314
+ const dequeueReady = isGovernanceDequeueReady(dequeueSchedule);
315
+ const nextDequeueProposalIds = dequeueReady
316
+ ? proposalIdsNextToDequeue(queueEntries, dequeueSchedule.concurrentProposals)
317
+ : [];
318
+ const selectedIds = Array.from(new Set([
319
+ ...queueEntries.map((entry) => entry.proposalId),
320
+ ...dequeueEntries.map((entry) => entry.proposalId),
321
+ ]))
322
+ .sort((a, b) => b - a)
323
+ .slice(0, Math.max(limit, 1));
324
+ const selected = new Set(selectedIds);
325
+ const queueLimited = queueEntries
326
+ .filter((entry) => selected.has(entry.proposalId))
327
+ .sort((a, b) => b.proposalId - a.proposalId);
328
+ const dequeueLimited = dequeueEntries
329
+ .filter((entry) => selected.has(entry.proposalId))
330
+ .sort((a, b) => b.proposalId - a.proposalId);
331
+ const snapshots = await this.getProposalSnapshots(selectedIds);
332
+ return {
333
+ queueEntries: queueLimited,
334
+ dequeueEntries: dequeueLimited,
335
+ snapshots,
336
+ dequeueSchedule,
337
+ dequeueReady,
338
+ nextDequeueProposalIds,
339
+ };
340
+ }
208
341
  /**
209
342
  * List governance proposals with pagination and optional CGP metadata.
210
343
  * @param options - Pagination (`page`/`pageSize` or `offset`/`limit`) and filters
@@ -320,25 +453,21 @@ export class GovernanceService {
320
453
  }));
321
454
  }
322
455
  /** Proposals currently in Referendum stage with their dequeue index. */
323
- async getVotableProposals() {
324
- const entries = await this.getDequeueWithIndices();
325
- const votable = [];
326
- for (const entry of entries) {
327
- if (entry.proposalId === 0)
328
- continue;
329
- const proposal = await this.fetchProposal(entry.proposalId, 0, false);
330
- if (!proposal)
331
- continue;
332
- const stageName = proposalStageName(proposal.stage);
333
- if (stageName === "Referendum") {
334
- votable.push({
456
+ async getVotableProposals(options = {}) {
457
+ const { dequeueEntries, snapshots } = await this.discoverActionableProposals(options.limit ?? ACTIONABLE_PROPOSAL_SCAN_LIMIT);
458
+ const votable = dequeueEntries.flatMap((entry) => {
459
+ const snapshot = snapshots.get(entry.proposalId);
460
+ if (!snapshot || snapshot.stageName !== "Referendum")
461
+ return [];
462
+ return [
463
+ {
335
464
  proposalId: entry.proposalId,
336
465
  index: entry.index,
337
- stage: stageName,
338
- url: proposal.url,
339
- });
340
- }
341
- }
466
+ stage: snapshot.stageName,
467
+ url: snapshot.url,
468
+ },
469
+ ];
470
+ });
342
471
  return {
343
472
  network: "mainnet",
344
473
  proposals: votable,
@@ -348,55 +477,98 @@ export class GovernanceService {
348
477
  };
349
478
  }
350
479
  /** Proposals currently in Queue stage with upvote weight. */
351
- async getQueuedProposals() {
352
- const queue = await this.getGovernanceQueue();
353
- const queued = [];
354
- for (const entry of queue) {
355
- const proposal = await this.fetchProposal(entry.proposalId, 0, false);
356
- if (!proposal)
357
- continue;
358
- const stageName = proposalStageName(proposal.stage);
359
- if (stageName === "Queued") {
360
- queued.push({
480
+ async getQueuedProposals(options = {}) {
481
+ const { queueEntries, snapshots, dequeueSchedule, dequeueReady, nextDequeueProposalIds, } = await this.discoverActionableProposals(options.limit ?? ACTIONABLE_PROPOSAL_SCAN_LIMIT);
482
+ const nextDequeueSet = new Set(nextDequeueProposalIds);
483
+ const queued = queueEntries.flatMap((entry) => {
484
+ const snapshot = snapshots.get(entry.proposalId);
485
+ if (!snapshot || snapshot.stageName !== "Queued")
486
+ return [];
487
+ const upvoteable = !dequeueReady || !nextDequeueSet.has(entry.proposalId);
488
+ return [
489
+ {
361
490
  proposalId: entry.proposalId,
362
491
  upvotes: formatCeloAmount(entry.upvotes),
363
- stage: stageName,
364
- url: proposal.url,
365
- });
366
- }
492
+ stage: snapshot.stageName,
493
+ url: snapshot.url,
494
+ upvoteable,
495
+ },
496
+ ];
497
+ });
498
+ const schedule = this.formatDequeueSchedule(dequeueSchedule, dequeueReady);
499
+ let message = queued.length > 0
500
+ ? `${queued.length} proposal(s) in Queue`
501
+ : "No proposals currently in Queue";
502
+ if (dequeueReady && nextDequeueProposalIds.length > 0) {
503
+ message += `. Dequeue overdue — next write will dequeue [${nextDequeueProposalIds.join(", ")}]; those are not upvoteable. Use execute_dequeue_proposals_if_ready.`;
367
504
  }
368
505
  return {
369
506
  network: "mainnet",
370
507
  proposals: queued,
371
- message: queued.length > 0
372
- ? `${queued.length} proposal(s) in Queue`
373
- : "No proposals currently in Queue",
508
+ ...schedule,
509
+ nextDequeueProposalIds,
510
+ message,
374
511
  };
375
512
  }
376
513
  /** Queued and Referendum proposals you can upvote or vote on now. */
377
514
  async getActionableGovernanceProposals() {
378
- const [queuedResult, referendumResult] = await Promise.all([
379
- this.getQueuedProposals(),
380
- this.getVotableProposals(),
381
- ]);
382
- const hasQueued = queuedResult.proposals.length > 0;
383
- const hasReferendum = referendumResult.proposals.length > 0;
384
- const hasAny = hasQueued || hasReferendum;
515
+ const { queueEntries, dequeueEntries, snapshots, dequeueSchedule, dequeueReady, nextDequeueProposalIds, } = await this.discoverActionableProposals();
516
+ const nextDequeueSet = new Set(nextDequeueProposalIds);
517
+ const queued = queueEntries.flatMap((entry) => {
518
+ const snapshot = snapshots.get(entry.proposalId);
519
+ if (!snapshot || snapshot.stageName !== "Queued")
520
+ return [];
521
+ const upvoteable = !dequeueReady || !nextDequeueSet.has(entry.proposalId);
522
+ return [
523
+ {
524
+ proposalId: entry.proposalId,
525
+ upvotes: formatCeloAmount(entry.upvotes),
526
+ stage: snapshot.stageName,
527
+ url: snapshot.url,
528
+ upvoteable,
529
+ },
530
+ ];
531
+ });
532
+ const referendum = dequeueEntries.flatMap((entry) => {
533
+ const snapshot = snapshots.get(entry.proposalId);
534
+ if (!snapshot || snapshot.stageName !== "Referendum")
535
+ return [];
536
+ return [
537
+ {
538
+ proposalId: entry.proposalId,
539
+ index: entry.index,
540
+ stage: snapshot.stageName,
541
+ url: snapshot.url,
542
+ },
543
+ ];
544
+ });
545
+ const upvoteableQueued = queued.filter((p) => p.upvoteable);
546
+ const hasQueued = queued.length > 0;
547
+ const hasUpvoteableQueued = upvoteableQueued.length > 0;
548
+ const hasReferendum = referendum.length > 0;
549
+ const hasAny = hasUpvoteableQueued || hasReferendum;
385
550
  const parts = [];
386
551
  if (hasQueued) {
387
- parts.push(`${queuedResult.proposals.length} Queued`);
552
+ parts.push(`${queued.length} Queued (${upvoteableQueued.length} upvoteable)`);
388
553
  }
389
554
  if (hasReferendum) {
390
- parts.push(`${referendumResult.proposals.length} Referendum`);
555
+ parts.push(`${referendum.length} Referendum`);
556
+ }
557
+ if (dequeueReady && nextDequeueProposalIds.length > 0) {
558
+ parts.push(`dequeue overdue → [${nextDequeueProposalIds.join(", ")}] (use execute_dequeue_proposals_if_ready)`);
391
559
  }
560
+ const schedule = this.formatDequeueSchedule(dequeueSchedule, dequeueReady);
392
561
  return {
393
562
  network: "mainnet",
394
563
  hasAny,
395
564
  hasQueued,
565
+ hasUpvoteableQueued,
396
566
  hasReferendum,
397
- queued: queuedResult.proposals,
398
- referendum: referendumResult.proposals,
399
- message: hasAny ? parts.join(", ") : "No actionable proposals",
567
+ queued,
568
+ referendum,
569
+ ...schedule,
570
+ nextDequeueProposalIds,
571
+ message: parts.length > 0 ? parts.join(", ") : "No actionable proposals",
400
572
  };
401
573
  }
402
574
  /** Referendum votes and queue upvotes cast by an address on Celo governance. */
@@ -702,10 +874,14 @@ export class GovernanceService {
702
874
  const governanceAccount = await this.resolveGovernanceAccount(from);
703
875
  const client = this.getClient();
704
876
  const governance = CELO_CORE_CONTRACTS.governance;
705
- const queue = await this.getGovernanceQueue();
877
+ const [queue, dequeueSchedule] = await Promise.all([
878
+ this.getGovernanceQueue(),
879
+ this.getDequeueSchedule(),
880
+ ]);
706
881
  if (!queue.some((entry) => entry.proposalId === proposalId)) {
707
882
  throw new Error(`Proposal ${proposalId} is not in the governance queue. Use get_queued_proposals to find Queued proposals.`);
708
883
  }
884
+ this.assertUpvoteNotBlockedByPendingDequeue(proposalId, queue, dequeueSchedule);
709
885
  const [existingUpvoteProposalId] = (await client.readContract({
710
886
  address: governance,
711
887
  abi: governanceAbi,
@@ -735,6 +911,32 @@ export class GovernanceService {
735
911
  this.buildStep(governance, data, `Upvote proposal #${proposalId} with ${formatCeloAmount(lockedGold)} locked CELO`),
736
912
  ], `Upvote governance proposal #${proposalId}`);
737
913
  }
914
+ /**
915
+ * Call Governance.dequeueProposalsIfReady (public; anyone can pay gas).
916
+ * When overdue, moves up to concurrentProposals from the queue into Approval.
917
+ */
918
+ async prepareDequeueProposalsIfReady(from) {
919
+ const [queue, dequeueSchedule] = await Promise.all([
920
+ this.getGovernanceQueue(),
921
+ this.getDequeueSchedule(),
922
+ ]);
923
+ const dequeueReady = isGovernanceDequeueReady(dequeueSchedule);
924
+ const nextIds = dequeueReady
925
+ ? proposalIdsNextToDequeue(queue, dequeueSchedule.concurrentProposals)
926
+ : [];
927
+ const data = appendCelinaCalldataTag(encodeFunctionData({
928
+ abi: governanceAbi,
929
+ functionName: "dequeueProposalsIfReady",
930
+ }), this.attributionTags);
931
+ const summary = dequeueReady
932
+ ? nextIds.length > 0
933
+ ? `Dequeue overdue proposals [${nextIds.join(", ")}] into Approval`
934
+ : "Call dequeueProposalsIfReady (queue empty)"
935
+ : `Call dequeueProposalsIfReady (no-op until ${new Date((dequeueSchedule.lastDequeue + dequeueSchedule.dequeueFrequency) * 1000).toISOString()})`;
936
+ return this.toPreparedFlow(from, [
937
+ this.buildStep(CELO_CORE_CONTRACTS.governance, data, summary),
938
+ ], summary);
939
+ }
738
940
  /** Revoke all active referendum votes for an account (bulk on-chain). */
739
941
  async prepareRevokeGovernanceVotes(from) {
740
942
  const governanceAccount = await this.resolveGovernanceAccount(from);