From 54bd563bf9de831c9b2964918005511ef767e798 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 11:29:22 -0300 Subject: [PATCH 01/30] docs: add snapshot voting reminder design spec Co-Authored-By: Claude Opus 4.6 --- ...6-04-01-snapshot-voting-reminder-design.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 docs/superpowers/specs/2026-04-01-snapshot-voting-reminder-design.md diff --git a/docs/superpowers/specs/2026-04-01-snapshot-voting-reminder-design.md b/docs/superpowers/specs/2026-04-01-snapshot-voting-reminder-design.md new file mode 100644 index 00000000..d2a84002 --- /dev/null +++ b/docs/superpowers/specs/2026-04-01-snapshot-voting-reminder-design.md @@ -0,0 +1,142 @@ +# Snapshot Voting Reminder — Design Spec + +## Overview + +Add voting reminders for off-chain (Snapshot) proposals. When 75% of a Snapshot proposal's voting period has elapsed, users who haven't voted receive a reminder via Telegram/Slack. + +## Key Decisions + +- **Single threshold:** 75% (with 5% window: 75-80%) +- **Single message template:** moderate urgency tone +- **NotificationTypeId:** `offchain-voting-reminder-75` +- **Approach:** Generalize existing `VotingReminderTrigger` with a normalized `VotingReminderProposal` interface. Mapper functions handle field differences between on-chain and off-chain. Separate dispatcher handler for off-chain. + +## Architecture + +### Data Flow + +``` +OffchainProposalRepository.listActiveForReminder() + -> mapOffchainToReminderProposal() (mapper) + -> VotingReminderTrigger (filters by 75-80% window) + -> VotingReminderEvent via RabbitMQ (dispatcher-queue) + -> OffchainVotingReminderTriggerHandler (dispatcher) + -> getFollowedAddresses(daoId) + -> getOffchainProposalNonVoters(proposalId, addresses) + -> offchainVotingReminderMessages template + -> RabbitMQ -> Telegram/Slack consumers +``` + +### Normalized Interface + +```typescript +interface VotingReminderProposal { + id: string; + daoId: string; + title?: string; + description?: string; + startTime: number; + endTime: number; + link?: string; // proposal URL (Snapshot link for off-chain) + discussion?: string; // forum discussion URL (off-chain only) +} +``` + +Note: `description` is optional because off-chain proposals don't have a description field. `link` and `discussion` are optional — only populated for off-chain proposals and used by the dispatcher handler to build Snapshot/discussion buttons. + +Both `ProposalRepository` and `OffchainProposalRepository` implement: + +```typescript +interface VotingReminderDataSource { + listActiveForReminder(): Promise; +} +``` + +### Mapper Functions + +Located in `apps/logic-system/src/mappers/proposal-reminder.mapper.ts`: + +- `mapOnchainToReminderProposal(p: ProposalOnChain): VotingReminderProposal` — maps `timestamp -> startTime`, `endTimestamp -> endTime`, `description -> description` +- `mapOffchainToReminderProposal(p: OffchainProposal): VotingReminderProposal` — maps `(start ?? created) -> startTime`, `end -> endTime`, `link -> link`, `discussion -> discussion`. Uses `start` (actual voting start) when available, falls back to `created`. + +### Trigger Generalization + +`VotingReminderTrigger` becomes generic, accepting `VotingReminderDataSource` instead of `ProposalDataSource`. The trigger works exclusively with `VotingReminderProposal` — no knowledge of on-chain vs off-chain. + +Existing on-chain triggers (30%, 60%, 90%) continue working with the same logic, just with `ProposalRepository.listActiveForReminder()` as data source. + +## New Files + +| File | Purpose | +|------|---------| +| `apps/logic-system/src/mappers/proposal-reminder.mapper.ts` | Mapper functions for on-chain and off-chain proposals | +| `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts` | Dispatcher handler for off-chain voting reminders | +| `packages/messages/src/triggers/offchain-voting-reminder.ts` | Message template | + +## Modified Files + +| File | Change | +|------|--------| +| `packages/anticapture-client/src/anticapture-client.ts` | Add `getOffchainProposalNonVoters(proposalId, addresses)` method | +| `packages/messages/src/notification-types.ts` | Add `OffchainVotingReminder75 = 'offchain-voting-reminder-75'` to enum and `NOTIFICATION_TYPES` record | +| `apps/logic-system/src/triggers/voting-reminder-trigger.ts` | Generalize to work with `VotingReminderProposal` and `VotingReminderDataSource` | +| `apps/logic-system/src/repositories/proposal.repository.ts` | Add `listActiveForReminder()` using `mapOnchainToReminderProposal` | +| `apps/logic-system/src/repositories/offchain-proposal.repository.ts` | Add `listActiveForReminder()` using `mapOffchainToReminderProposal` | +| `apps/logic-system/src/app.ts` | Register new off-chain trigger (threshold 75) + pass updated repos to existing triggers + add to `stop()` and `resetTriggers()` | +| `apps/dispatcher/src/app.ts` | Register `OffchainVotingReminderTriggerHandler` for `OffchainVotingReminder75` | +| `packages/messages/src/triggers/buttons.ts` | Add button config for off-chain voting reminder (Snapshot link + discussion link) | +| Relevant `index.ts` files | Update exports | + +## AntiCapture Client + +New method: + +```typescript +async getOffchainProposalNonVoters( + proposalId: string, + addresses?: string[] +): Promise +``` + +Calls GraphQL `offchainProposalNonVoters(id, addresses, orderDirection)`. Returns same `ProposalNonVoter` interface (`{ voter, votingPower }`) as the on-chain equivalent. Does not require `daoId` — the Snapshot proposal ID already identifies the DAO. + +## Dispatcher Handler + +`OffchainVotingReminderTriggerHandler` — separate handler from on-chain. Differences: + +| Aspect | On-chain | Off-chain | +|--------|----------|-----------| +| Non-voters query | `getProposalNonVoters(proposalId, daoId, addresses)` | `getOffchainProposalNonVoters(proposalId, addresses)` | +| Message template | `votingReminderMessages` (4 urgency levels) | `offchainVotingReminderMessages` (single template) | +| Buttons | On-chain proposal link | Snapshot link + discussion link | + +Receives the same normalized `VotingReminderEvent` from the Logic System. The event includes `link` and `discussion` fields (carried from the normalized proposal) so the handler can build Snapshot/discussion buttons without extra API calls. + +## Message Template + +Single template with moderate urgency: + +``` +⏰ Snapshot Voting Reminder - {{daoId}} + +Proposal: "{{title}}" + +⏱️ Time remaining: {{timeRemaining}} +📊 {{thresholdPercentage}}% of voting period has passed +🗳️ {{address}}'s vote hasn't been recorded yet + +Don't miss your chance to participate! +``` + +## Prerequisites + +- **API Gateway:** The `offchainProposalNonVoters` GraphQL query must be deployed and available. The anticapture-client must be regenerated to include the new query types. +- **Start time:** The off-chain mapper uses `start` (actual voting start) when available in `OffchainProposalItem`, falling back to `created`. If `start` is not in the current schema, it should be added to `OffchainProposalItemSchema` in `packages/anticapture-client/src/schemas.ts`. + +## Testing + +- **Service layer:** `offchain-voting-reminder-trigger.service.test.ts` (dispatcher handler) +- **Repository layer:** Tests for `listActiveForReminder()` in both repositories +- **Integration test:** End-to-end flow in `apps/integrated-tests/` +- **No mapper tests** +- Use `/testing` skill during implementation From 38ab041fb07269af9999f40f08388c6dd5c97c93 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 11:40:00 -0300 Subject: [PATCH 02/30] docs: add snapshot voting reminder implementation plan Co-Authored-By: Claude Opus 4.6 --- .../2026-04-01-snapshot-voting-reminder.md | 889 ++++++++++++++++++ 1 file changed, 889 insertions(+) create mode 100644 docs/superpowers/plans/2026-04-01-snapshot-voting-reminder.md diff --git a/docs/superpowers/plans/2026-04-01-snapshot-voting-reminder.md b/docs/superpowers/plans/2026-04-01-snapshot-voting-reminder.md new file mode 100644 index 00000000..18f62893 --- /dev/null +++ b/docs/superpowers/plans/2026-04-01-snapshot-voting-reminder.md @@ -0,0 +1,889 @@ +# Snapshot Voting Reminder Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Add voting reminders for off-chain (Snapshot) proposals at the 75% threshold, reusing the generalized `VotingReminderTrigger`. + +**Architecture:** Generalize the existing `VotingReminderTrigger` to work with a normalized `VotingReminderProposal` interface. Mapper functions translate on-chain and off-chain proposal shapes. A new dispatcher handler processes off-chain reminders with its own message template and Snapshot-specific buttons. + +**Tech Stack:** TypeScript, RabbitMQ, Zod, Jest, Fastify, GraphQL + +**Spec:** `docs/superpowers/specs/2026-04-01-snapshot-voting-reminder-design.md` + +--- + +## File Map + +### New Files +| File | Responsibility | +|------|---------------| +| `apps/logic-system/src/mappers/proposal-reminder.mapper.ts` | Pure mapper functions: on-chain → `VotingReminderProposal`, off-chain → `VotingReminderProposal` | +| `apps/logic-system/src/interfaces/voting-reminder.interface.ts` | `VotingReminderProposal` and `VotingReminderDataSource` interfaces | +| `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts` | Dispatcher handler for off-chain voting reminders | +| `packages/messages/src/triggers/offchain-voting-reminder.ts` | Message template for Snapshot voting reminders | +| `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts` | Unit tests for the off-chain handler | + +### Modified Files +| File | Change | +|------|--------| +| `packages/anticapture-client/src/schemas.ts` | Add `start` to `OffchainProposalItemSchema`, add `SafeOffchainProposalNonVotersResponseSchema` | +| `packages/anticapture-client/src/anticapture-client.ts` | Add `getOffchainProposalNonVoters()` method | +| `packages/anticapture-client/src/index.ts` | Export new types if needed | +| `packages/messages/src/notification-types.ts` | Add `OffchainVotingReminder75` to enum and `NOTIFICATION_TYPES` | +| `packages/messages/src/triggers/buttons.ts` | Add `offchainVotingReminder` button config | +| `packages/messages/src/index.ts` | Export new offchain voting reminder messages | +| `apps/logic-system/src/triggers/voting-reminder-trigger.ts` | Refactor to use `VotingReminderProposal` and `VotingReminderDataSource` | +| `apps/logic-system/src/repositories/proposal.repository.ts` | Add `listActiveForReminder()` | +| `apps/logic-system/src/repositories/offchain-proposal.repository.ts` | Add `listActiveForReminder()` | +| `apps/logic-system/src/app.ts` | Register off-chain trigger, update existing triggers, add to `stop()`/`resetTriggers()` | +| `apps/dispatcher/src/app.ts` | Register `OffchainVotingReminderTriggerHandler` | + +--- + +## Task 1: Messages Package — NotificationTypeId + Template + Buttons + +**Files:** +- Modify: `packages/messages/src/notification-types.ts` +- Create: `packages/messages/src/triggers/offchain-voting-reminder.ts` +- Modify: `packages/messages/src/triggers/buttons.ts` +- Modify: `packages/messages/src/index.ts` + +- [ ] **Step 1: Add enum entry** + +In `packages/messages/src/notification-types.ts`, add to the enum: + +```typescript +OffchainVotingReminder75 = 'offchain-voting-reminder-75', +``` + +And to the `NOTIFICATION_TYPES` record: + +```typescript +[NotificationTypeId.OffchainVotingReminder75]: 'Offchain Vote Reminder 75%', +``` + +- [ ] **Step 2: Create message template** + +Create `packages/messages/src/triggers/offchain-voting-reminder.ts`: + +```typescript +export const offchainVotingReminderMessages = { + default: `⏰ Snapshot Voting Reminder - {{daoId}} + +Proposal: "{{title}}" + +⏱️ Time remaining: {{timeRemaining}} +📊 {{thresholdPercentage}}% of voting period has passed +🗳️ {{address}}'s vote hasn't been recorded yet + +Don't miss your chance to participate!`, +}; +``` + +- [ ] **Step 3: Add button config** + +In `packages/messages/src/triggers/buttons.ts`, add to `ctaButtonConfigs`: + +```typescript +offchainVotingReminder: { + text: 'Cast your vote', + buildUrl: ({ proposalUrl }) => + proposalUrl || BASE_URL +}, +``` + +- [ ] **Step 4: Update exports** + +In `packages/messages/src/index.ts`, add: + +```typescript +export * from './triggers/offchain-voting-reminder'; +``` + +- [ ] **Step 5: Build messages package to verify** + +Run: `cd packages/messages && pnpm build` +Expected: Build succeeds with no errors + +- [ ] **Step 6: Commit** + +```bash +git add packages/messages/ +git commit -m "feat: add offchain voting reminder message template, enum, and button config" +``` + +--- + +## Task 2: AntiCapture Client — Schema + `getOffchainProposalNonVoters()` + +**Files:** +- Modify: `packages/anticapture-client/src/schemas.ts` +- Modify: `packages/anticapture-client/src/anticapture-client.ts` +- Modify: `packages/anticapture-client/src/index.ts` + +- [ ] **Step 1: Add `start` to `OffchainProposalItemSchema`** + +In `packages/anticapture-client/src/schemas.ts`, update `OffchainProposalItemSchema`: + +```typescript +export const OffchainProposalItemSchema = z.object({ + id: z.string(), + title: z.string(), + discussion: z.string(), + link: z.string(), + state: z.string(), + start: z.number().optional(), + created: z.number(), + end: z.number(), +}); +``` + +Note: `start` is optional for backwards compatibility with responses that may not include it. + +- [ ] **Step 2: Add Zod schema for offchain non-voters response** + +In `packages/anticapture-client/src/schemas.ts`, add after `SafeProposalNonVotersResponseSchema`: + +```typescript +export const SafeOffchainProposalNonVotersResponseSchema = z.object({ + offchainProposalNonVoters: z.object({ + items: z.array(z.object({ + voter: z.string(), + votingPower: z.string().optional() + }).nullable()), + totalCount: z.number().optional() + }).nullable() +}).transform((data) => { + if (!data.offchainProposalNonVoters) { + console.warn('OffchainProposalNonVotersResponse has null offchainProposalNonVoters:', data); + return { offchainProposalNonVoters: { items: [], totalCount: 0 } }; + } + return { + offchainProposalNonVoters: { + ...data.offchainProposalNonVoters, + items: data.offchainProposalNonVoters.items.filter((item): item is { voter: string; votingPower?: string } => item !== null) + } + }; +}); +``` + +- [ ] **Step 3: Add `getOffchainProposalNonVoters` method** + +In `packages/anticapture-client/src/anticapture-client.ts`, add the import for the new schema and add the method. + +First, add the import: +```typescript +import { SafeOffchainProposalNonVotersResponseSchema } from './schemas'; +``` + +Then add the method to the `AnticaptureClient` class (after `getProposalNonVoters`): + +```typescript +/** + * Fetches addresses that haven't voted on a specific offchain (Snapshot) proposal + * @param proposalId The Snapshot proposal ID to check + * @param addresses Optional array of addresses to filter by + * @returns List of non-voters + */ +async getOffchainProposalNonVoters( + proposalId: string, + addresses?: string[], +): Promise<{ voter: string; votingPower?: string }[]> { + try { + const response = await this.httpClient.post('', { + query: `query OffchainProposalNonVoters($id: String!, $addresses: String, $orderDirection: String) { + offchainProposalNonVoters(id: $id, addresses: $addresses, orderDirection: $orderDirection) { + items { + voter + votingPower + } + } + }`, + variables: { + id: proposalId, + ...(addresses && { addresses: addresses.join(',') }), + orderDirection: 'desc' + } + }, { headers: this.buildHeaders() }); + + if (response.data.errors) { + throw new Error(JSON.stringify(response.data.errors)); + } + + const validated = SafeOffchainProposalNonVotersResponseSchema.parse( + this.toLowercase(response.data.data) + ); + + return validated.offchainProposalNonVoters.items; + } catch (error) { + console.warn(`Error fetching offchain non-voters for proposal ${proposalId}:`, error); + return []; + } +} +``` + +**Important:** Check how the `addresses` parameter is passed in the actual GraphQL query by testing against the local API Gateway endpoint. The query from the user used `addresses: "0x89EdE..."` as a single string. Adjust accordingly — it might be a comma-separated string rather than an array. + +- [ ] **Step 4: Build anticapture-client package to verify** + +Run: `cd packages/anticapture-client && pnpm build` +Expected: Build succeeds + +- [ ] **Step 5: Commit** + +```bash +git add packages/anticapture-client/ +git commit -m "feat: add getOffchainProposalNonVoters method and start field to OffchainProposalItemSchema" +``` + +--- + +## Task 3: Logic System — Interfaces + Mappers + +**Files:** +- Create: `apps/logic-system/src/interfaces/voting-reminder.interface.ts` +- Create: `apps/logic-system/src/mappers/proposal-reminder.mapper.ts` + +- [ ] **Step 1: Create normalized interfaces** + +Create `apps/logic-system/src/interfaces/voting-reminder.interface.ts`: + +```typescript +/** + * Normalized proposal data for voting reminders. + * Both on-chain and off-chain proposals are mapped to this shape. + */ +export interface VotingReminderProposal { + id: string; + daoId: string; + title?: string; + description?: string; + startTime: number; + endTime: number; + link?: string; + discussion?: string; +} + +/** + * Data source interface for fetching proposals ready for voting reminders. + * Implemented by both ProposalRepository and OffchainProposalRepository. + */ +export interface VotingReminderDataSource { + listActiveForReminder(): Promise; +} +``` + +- [ ] **Step 2: Create mapper functions** + +Create `apps/logic-system/src/mappers/proposal-reminder.mapper.ts`: + +```typescript +import { ProposalOnChain } from '../interfaces/proposal.interface'; +import { OffchainProposal } from '../interfaces/offchain-proposal.interface'; +import { VotingReminderProposal } from '../interfaces/voting-reminder.interface'; + +/** + * Maps an on-chain proposal to the normalized VotingReminderProposal shape. + */ +export function mapOnchainToReminderProposal(p: ProposalOnChain): VotingReminderProposal { + return { + id: p.id, + daoId: p.daoId, + title: p.title || undefined, + description: p.description, + startTime: Number(p.timestamp), + endTime: Number(p.endTimestamp), + }; +} + +/** + * Maps an off-chain (Snapshot) proposal to the normalized VotingReminderProposal shape. + * Uses `start` (actual voting start) when available, falls back to `created`. + */ +export function mapOffchainToReminderProposal(p: OffchainProposal): VotingReminderProposal { + return { + id: p.id, + daoId: p.daoId, + title: p.title || undefined, + startTime: p.start ?? p.created, + endTime: p.end, + link: p.link, + discussion: p.discussion, + }; +} +``` + +Note: Check whether `OffchainProposal` type has a `start` field after the schema update in Task 2. The `OffchainProposal` is defined as `OffchainProposalItem & { daoId: string }` in `apps/logic-system/src/interfaces/offchain-proposal.interface.ts`, so it inherits the `start` field from the schema update. + +- [ ] **Step 3: Commit** + +```bash +git add apps/logic-system/src/interfaces/voting-reminder.interface.ts apps/logic-system/src/mappers/ +git commit -m "feat: add VotingReminderProposal interface and mapper functions" +``` + +--- + +## Task 4: Logic System — Generalize `VotingReminderTrigger` + +**Files:** +- Modify: `apps/logic-system/src/triggers/voting-reminder-trigger.ts` + +- [ ] **Step 1: Refactor trigger to use normalized interface** + +Replace the current `VotingReminderTrigger` implementation. Key changes: + +1. Change `extends Trigger` to `extends Trigger` +2. Replace `ProposalDataSource` with `VotingReminderDataSource` in constructor +3. Replace all direct field access (`proposal.timestamp`, `proposal.endTimestamp`) with `proposal.startTime`, `proposal.endTime` +4. Remove `parseInt` calls (data is already normalized as numbers) +5. Add `link` and `discussion` to the `VotingReminderEvent` interface +6. Pass `link` and `discussion` through in `createReminderEvent()` +7. `fetchData()` calls `this.dataSource.listActiveForReminder()` instead of `this.proposalRepository.listAll()` + +Updated `VotingReminderEvent`: + +```typescript +export interface VotingReminderEvent { + id: string; + daoId: string; + title?: string; + description?: string; + startTimestamp: number; + endTimestamp: number; + timeElapsedPercentage: number; + thresholdPercentage: number; + link?: string; + discussion?: string; +} +``` + +Updated constants and constructor — add a `triggerIdPrefix` parameter to allow different prefixes for on-chain vs off-chain: + +```typescript +const DEFAULT_TRIGGER_ID_PREFIX = 'voting-reminder'; +const DEFAULT_WINDOW_SIZE = 5; + +constructor( + private readonly dispatcherService: DispatcherService, + private readonly dataSource: VotingReminderDataSource, + interval: number, + thresholdPercentage: number = 75, + windowSize: number = DEFAULT_WINDOW_SIZE, + triggerIdPrefix: string = DEFAULT_TRIGGER_ID_PREFIX +) { + super(`${triggerIdPrefix}-${thresholdPercentage}`, interval); + ... +} +``` + +This way, on-chain triggers keep using `'voting-reminder'` (default) and the off-chain trigger passes `'offchain-voting-reminder'` to produce `offchain-voting-reminder-75` — matching `NotificationTypeId.OffchainVotingReminder75`. + +Updated `filterEligibleProposals`: + +```typescript +private filterEligibleProposals(proposals: VotingReminderProposal[]): VotingReminderProposal[] { + const now = Math.floor(Date.now() / 1000); + + return proposals.filter(proposal => { + if (!proposal) return false; + + const startTime = proposal.startTime; + const endTime = proposal.endTime; + + if (now <= startTime || now >= endTime) return false; + + const timeElapsedPercentage = this.calculateTimeElapsedPercentage(startTime, endTime, now); + const threshold = this.thresholdPercentage; + const windowEnd = Math.min(threshold + this.windowSize, 100); + + return timeElapsedPercentage >= threshold && timeElapsedPercentage <= windowEnd; + }); +} +``` + +Updated `createReminderEvent`: + +```typescript +private createReminderEvent(proposal: VotingReminderProposal): VotingReminderEvent { + const now = Math.floor(Date.now() / 1000); + const timeElapsedPercentage = this.calculateTimeElapsedPercentage( + proposal.startTime, proposal.endTime, now + ); + + return { + id: proposal.id, + daoId: proposal.daoId, + title: proposal.title, + description: proposal.description, + startTimestamp: proposal.startTime, + endTimestamp: proposal.endTime, + timeElapsedPercentage: Math.round(timeElapsedPercentage * 100) / 100, + thresholdPercentage: this.thresholdPercentage, + link: proposal.link, + discussion: proposal.discussion, + }; +} +``` + +Updated `fetchData`: + +```typescript +protected async fetchData(): Promise { + return await this.dataSource.listActiveForReminder(); +} +``` + +- [ ] **Step 2: Update the on-chain VotingReminderTriggerHandler** + +In `apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts`, update `createReminderMessage`: + +1. Handle optional `description`: +```typescript +const title = event.title || FormattingService.extractTitle(event.description ?? ''); +``` + +2. Fix existing `address` placeholder bug — add `address` to replacePlaceholders call: +```typescript +return replacePlaceholders(messageTemplate, { + daoId: event.daoId, + title, + timeRemaining, + thresholdPercentage: event.thresholdPercentage.toString(), + address: address || '' +}); +``` + +- [ ] **Step 3: Update existing `voting-reminder-trigger.test.ts`** + +The existing test at `apps/logic-system/tests/voting-reminder-trigger.test.ts` creates `ProposalOnChain` objects with string fields (`timestamp`, `endTimestamp`). After refactoring, the trigger expects `VotingReminderProposal` with numeric `startTime`/`endTime`. + +Update the test to: +1. Use `VotingReminderProposal` objects instead of `ProposalOnChain` +2. Mock `dataSource.listActiveForReminder()` instead of `proposalRepository.listAll()` +3. Use numeric timestamp fields (`startTime`, `endTime`) instead of string fields + +- [ ] **Step 4: Build logic-system to verify compilation** + +Run: `cd apps/logic-system && pnpm build` +Expected: May fail because `app.ts` still passes old repository type. That's fine — we'll fix it in Task 5. + +- [ ] **Step 5: Commit** + +```bash +git add apps/logic-system/src/triggers/ apps/logic-system/tests/ apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts +git commit -m "refactor: generalize VotingReminderTrigger to use normalized VotingReminderProposal interface" +``` + +--- + +## Task 5: Logic System — Update Repositories + App Wiring + +**Files:** +- Modify: `apps/logic-system/src/repositories/proposal.repository.ts` +- Modify: `apps/logic-system/src/repositories/offchain-proposal.repository.ts` +- Modify: `apps/logic-system/src/app.ts` + +- [ ] **Step 1: Add `listActiveForReminder()` to `ProposalRepository`** + +In `apps/logic-system/src/repositories/proposal.repository.ts`: + +Import the mapper and interface: +```typescript +import { VotingReminderProposal, VotingReminderDataSource } from '../interfaces/voting-reminder.interface'; +import { mapOnchainToReminderProposal } from '../mappers/proposal-reminder.mapper'; +``` + +Add `implements VotingReminderDataSource` to the class and add the method: + +```typescript +async listActiveForReminder(): Promise { + const proposals = await this.listAll({ status: 'ACTIVE', includeOptimisticProposals: false }); + return proposals.map(mapOnchainToReminderProposal); +} +``` + +- [ ] **Step 2: Add `listActiveForReminder()` to `OffchainProposalRepository`** + +In `apps/logic-system/src/repositories/offchain-proposal.repository.ts`: + +Import the mapper and interface: +```typescript +import { VotingReminderProposal, VotingReminderDataSource } from '../interfaces/voting-reminder.interface'; +import { mapOffchainToReminderProposal } from '../mappers/proposal-reminder.mapper'; +``` + +Add `implements VotingReminderDataSource` to the class and add the method: + +```typescript +async listActiveForReminder(): Promise { + const proposals = await this.listAll({ status: 'active' }); + return proposals.map(mapOffchainToReminderProposal); +} +``` + +- [ ] **Step 3: Wire up in `app.ts`** + +In `apps/logic-system/src/app.ts`: + +Add the new trigger field: +```typescript +private offchainVotingReminderTrigger75!: VotingReminderTrigger; +``` + +In `initializeRabbitMQ`, add the new trigger instance (note the `triggerIdPrefix` to produce `offchain-voting-reminder-75`): +```typescript +this.offchainVotingReminderTrigger75 = new VotingReminderTrigger( + dispatcherService, + offchainProposalRepository, + triggerInterval, + 75, // 75% threshold + 5, // default window size + 'offchain-voting-reminder' // prefix → produces ID 'offchain-voting-reminder-75' +); +``` + +Update the existing on-chain voting reminder triggers to pass the `proposalRepository` (which now implements `VotingReminderDataSource`). The constructor signature changed from `ProposalDataSource` to `VotingReminderDataSource`, but since `ProposalRepository` now implements both, this should just work. + +In `start()`, add: +```typescript +this.offchainVotingReminderTrigger75.start(); +``` + +In `stop()`, add: +```typescript +await this.offchainVotingReminderTrigger75.stop(); +``` + +In `resetTriggers()`, add stop calls for all voting reminder triggers (currently missing for on-chain too). Since `stop()` only calls `clearInterval` (no real async I/O), use fire-and-forget to avoid making `resetTriggers` async (which would be a breaking change for callers in integration tests): +```typescript +if (this.votingReminderTrigger30) { + this.votingReminderTrigger30.stop(); +} +if (this.votingReminderTrigger60) { + this.votingReminderTrigger60.stop(); +} +if (this.votingReminderTrigger90) { + this.votingReminderTrigger90.stop(); +} +if (this.offchainVotingReminderTrigger75) { + this.offchainVotingReminderTrigger75.stop(); +} +``` + +- [ ] **Step 4: Build logic-system to verify** + +Run: `cd apps/logic-system && pnpm build` +Expected: Build succeeds + +- [ ] **Step 5: Run existing tests** + +Run: `cd apps/logic-system && pnpm test` +Expected: All existing tests pass (the generalization should not break them) + +- [ ] **Step 6: Commit** + +```bash +git add apps/logic-system/ +git commit -m "feat: add listActiveForReminder to repositories and wire offchain voting reminder trigger" +``` + +--- + +## Task 6: Dispatcher — Off-chain Voting Reminder Handler + +**Files:** +- Create: `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts` +- Modify: `apps/dispatcher/src/app.ts` + +- [ ] **Step 1: Create the handler** + +Create `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts`. + +This handler is based on `voting-reminder-trigger.service.ts` with these differences: +- Uses `getOffchainProposalNonVoters(proposalId, addresses)` — no `daoId` param +- Uses `offchainVotingReminderMessages.default` template (single template) +- Uses `offchainVotingReminder` button type with `proposalUrl` from event's `link` field +- Adds discussion button if event has `discussion` field + +```typescript +import type { NotificationTypeId } from '@notification-system/messages'; +import { BaseTriggerHandler } from './base-trigger.service'; +import { DispatcherMessage, MessageProcessingResult } from '../../interfaces/dispatcher-message.interface'; +import { NotificationClientFactory } from '../notification/notification-factory.service'; +import { ISubscriptionClient } from '../../interfaces/subscription-client.interface'; +import { AnticaptureClient } from '@notification-system/anticapture-client'; +import { FormattingService } from '../formatting.service'; +import { offchainVotingReminderMessages, replacePlaceholders, buildButtons } from '@notification-system/messages'; +import { BatchNotificationService } from '../batch-notification.service'; + +interface VotingReminderEvent { + id: string; + daoId: string; + title?: string; + description?: string; + startTimestamp: number; + endTimestamp: number; + timeElapsedPercentage: number; + thresholdPercentage: number; + link?: string; + discussion?: string; +} + +interface ProcessingResult { + sent: number; + skipped: number; + failed: number; +} + +export class OffchainVotingReminderTriggerHandler extends BaseTriggerHandler { + private readonly batchNotificationService: BatchNotificationService; + + constructor( + protected readonly subscriptionClient: ISubscriptionClient, + protected readonly notificationFactory: NotificationClientFactory, + anticaptureClient: AnticaptureClient + ) { + super(subscriptionClient, notificationFactory, anticaptureClient); + this.batchNotificationService = new BatchNotificationService(subscriptionClient, notificationFactory); + } + + async handleMessage(message: DispatcherMessage): Promise { + const events = message.events; + + if (!events || events.length === 0) { + return { + messageId: `offchain-voting-reminder-empty-${Date.now()}`, + timestamp: new Date().toISOString() + }; + } + + const processedCount: ProcessingResult = { sent: 0, skipped: 0, failed: 0 }; + + for (const event of events) { + try { + const result = await this.processReminderEvent(event, message.triggerId); + processedCount.sent += result.sent; + processedCount.skipped += result.skipped; + processedCount.failed += result.failed; + } catch (error) { + processedCount.failed++; + } + } + + console.log(`[OffchainVotingReminderHandler] Processing complete - Sent: ${processedCount.sent}, Skipped: ${processedCount.skipped}, Failed: ${processedCount.failed}`); + + return { + messageId: `offchain-voting-reminder-${Date.now()}`, + timestamp: new Date().toISOString() + }; + } + + private async processReminderEvent(event: VotingReminderEvent, triggerType: NotificationTypeId): Promise { + const subscribedAddresses = await this.subscriptionClient.getFollowedAddresses(event.daoId); + + if (subscribedAddresses.length === 0) { + return { sent: 0, skipped: 1, failed: 0 }; + } + + const nonVotingAddresses = await this.getNonVotingAddresses(event.id, subscribedAddresses); + + if (nonVotingAddresses.length === 0) { + return { sent: 0, skipped: 1, failed: 0 }; + } + + const buttons = buildButtons({ + triggerType: 'offchainVotingReminder', + proposalUrl: event.link, + discussionUrl: event.discussion, + }); + + const sentCount = await this.batchNotificationService.sendBatchNotifications( + nonVotingAddresses, + event.daoId, + triggerType, + () => `${event.id}-${event.thresholdPercentage}-offchain-reminder`, + (address) => this.createReminderMessage(event, address), + (address) => ({ + triggerType: 'offchainVotingReminder', + proposalId: event.id, + thresholdPercentage: event.thresholdPercentage, + timeElapsedPercentage: event.timeElapsedPercentage, + timeRemaining: FormattingService.calculateTimeRemaining(event.endTimestamp), + addresses: { address: address } + }), + () => buttons + ); + + return { sent: sentCount, skipped: 0, failed: 0 }; + } + + private async getNonVotingAddresses( + proposalId: string, + subscribedAddresses: string[] + ): Promise { + const nonVoters = await this.anticaptureClient!.getOffchainProposalNonVoters( + proposalId, + subscribedAddresses + ); + return nonVoters.map(nv => nv.voter); + } + + private createReminderMessage(event: VotingReminderEvent, address?: string): string { + const timeRemaining = FormattingService.calculateTimeRemaining(event.endTimestamp); + const title = event.title || 'Untitled Proposal'; + + return replacePlaceholders(offchainVotingReminderMessages.default, { + daoId: event.daoId, + title, + timeRemaining, + thresholdPercentage: event.thresholdPercentage.toString(), + address: address || '' + }); + } +} +``` + +- [ ] **Step 2: Register handler in dispatcher `app.ts`** + +In `apps/dispatcher/src/app.ts`: + +Add import: +```typescript +import { OffchainVotingReminderTriggerHandler } from './services/triggers/offchain-voting-reminder-trigger.service'; +``` + +Add handler registration (after the existing voting reminder handlers): +```typescript +triggerProcessorService.addHandler( + NotificationTypeId.OffchainVotingReminder75, + new OffchainVotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient) +); +``` + +- [ ] **Step 3: Build dispatcher to verify** + +Run: `cd apps/dispatcher && pnpm build` +Expected: Build succeeds + +- [ ] **Step 4: Commit** + +```bash +git add apps/dispatcher/ +git commit -m "feat: add OffchainVotingReminderTriggerHandler and register in dispatcher" +``` + +--- + +## Task 7: Tests — Service Layer (Dispatcher Handler) + +**Files:** +- Create: `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts` + +Use `/testing` skill before writing tests. + +- [ ] **Step 1: Write tests for the handler** + +Follow the same pattern as `voting-reminder-trigger.service.test.ts`. Key test cases: + +1. **Empty events** — returns early with empty message result +2. **No subscribed addresses** — skips processing, returns skipped count +3. **No non-voting addresses** — all users already voted, skips +4. **Successful send** — processes event, calls `getOffchainProposalNonVoters` (without daoId), sends via batch, verifies message template used is `offchainVotingReminderMessages.default` +5. **Buttons include Snapshot link** — verifies `buildButtons` called with `triggerType: 'offchainVotingReminder'` and `proposalUrl` +6. **Discussion link** — verifies discussion button is included when event has `discussion` field + +Mock setup: same pattern as existing test — mock `subscriptionClient`, `notificationFactory`, `anticaptureClient` with `getOffchainProposalNonVoters` instead of `getProposalNonVoters`. + +- [ ] **Step 2: Run tests** + +Run: `cd apps/dispatcher && pnpm test` +Expected: All tests pass (new + existing) + +- [ ] **Step 3: Commit** + +```bash +git add apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts +git commit -m "test: add unit tests for OffchainVotingReminderTriggerHandler" +``` + +--- + +## Task 8: Tests — Repository Layer + +Use `/testing` skill before writing tests. + +- [ ] **Step 1: Create repository test files and add `listActiveForReminder` tests** + +No existing repository test files exist, so create: +- `apps/logic-system/src/repositories/offchain-proposal.repository.test.ts` +- `apps/logic-system/src/repositories/proposal.repository.test.ts` + +For `OffchainProposalRepository`, test that: +1. `listActiveForReminder()` calls `listAll({ status: 'active' })` +2. Results are mapped correctly (fields renamed: `created/start -> startTime`, `end -> endTime`, `link` and `discussion` carried through) +3. `start` field used when available, falls back to `created` + +For `ProposalRepository`, test that: +1. `listActiveForReminder()` calls `listAll({ status: 'ACTIVE', includeOptimisticProposals: false })` +2. Results are mapped correctly (`timestamp -> startTime`, `endTimestamp -> endTime`) + +- [ ] **Step 2: Run tests** + +Run: `cd apps/logic-system && pnpm test` +Expected: All tests pass + +- [ ] **Step 3: Commit** + +```bash +git add apps/logic-system/ +git commit -m "test: add listActiveForReminder tests for proposal repositories" +``` + +--- + +## Task 9: Integration Test + +Use `/testing` skill before writing tests. + +**Files:** +- Create: `apps/integrated-tests/tests/telegram/offchain-voting-reminder-trigger.test.ts` + +- [ ] **Step 1: Write integration test** + +Follow the pattern from `apps/integrated-tests/tests/telegram/voting-reminder-trigger.test.ts`. Key differences: + +1. Use off-chain proposal factory (Snapshot proposal shape with `created`/`end` timestamps) +2. Set up GraphQL mock to return active Snapshot proposals at ~77% elapsed time (within 75-80% window) +3. Mock `offchainProposalNonVoters` GraphQL endpoint to return test addresses +4. Verify Telegram notification received with correct template (Snapshot Voting Reminder) +5. Test that proposals outside the window (e.g., 50% elapsed) do NOT trigger reminders +6. Test that users who already voted do NOT receive reminders + +- [ ] **Step 2: Run integration test** + +Run: `cd apps/integrated-tests && pnpm test -- --testPathPattern=offchain-voting-reminder` +Expected: Test passes + +- [ ] **Step 3: Commit** + +```bash +git add apps/integrated-tests/ +git commit -m "test: add integration test for offchain voting reminder flow" +``` + +--- + +## Task 10: Final Verification + +- [ ] **Step 1: Full build** + +Run: `pnpm build` (from root) +Expected: All packages and apps build successfully + +- [ ] **Step 2: Full test suite** + +Run: `pnpm test` (from root) +Expected: All tests pass + +- [ ] **Step 3: Final commit if any cleanup needed** From bc76400eeaff04234ae9d9c9c08808e1e81866ac Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 11:44:24 -0300 Subject: [PATCH 03/30] feat: add offchain voting reminder message template, enum, and button config Co-Authored-By: Claude Sonnet 4.6 --- packages/messages/src/index.ts | 1 + packages/messages/src/notification-types.ts | 2 ++ packages/messages/src/triggers/buttons.ts | 5 +++++ .../messages/src/triggers/offchain-voting-reminder.ts | 11 +++++++++++ 4 files changed, 19 insertions(+) create mode 100644 packages/messages/src/triggers/offchain-voting-reminder.ts diff --git a/packages/messages/src/index.ts b/packages/messages/src/index.ts index 29c10728..9eeceb0d 100644 --- a/packages/messages/src/index.ts +++ b/packages/messages/src/index.ts @@ -13,6 +13,7 @@ export * from './triggers/voting-power'; export * from './triggers/offchain-vote-cast'; export * from './triggers/non-voting'; export * from './triggers/delegation-change'; +export * from './triggers/offchain-voting-reminder'; export * from './triggers/buttons'; // Export UI messages diff --git a/packages/messages/src/notification-types.ts b/packages/messages/src/notification-types.ts index 5a1920ab..6a161e90 100644 --- a/packages/messages/src/notification-types.ts +++ b/packages/messages/src/notification-types.ts @@ -10,6 +10,7 @@ export enum NotificationTypeId { VoteConfirmation = 'vote-confirmation', OffchainVoteCast = 'offchain-vote-cast', OffchainProposalFinished = 'offchain-proposal-finished', + OffchainVotingReminder75 = 'offchain-voting-reminder-75', } export const NOTIFICATION_TYPES: Record = { @@ -24,4 +25,5 @@ export const NOTIFICATION_TYPES: Record = { [NotificationTypeId.VoteConfirmation]: 'Vote Confirmation', [NotificationTypeId.OffchainVoteCast]: 'Offchain Vote', [NotificationTypeId.OffchainProposalFinished]: 'Offchain Proposal Finished', + [NotificationTypeId.OffchainVotingReminder75]: 'Offchain Vote Reminder 75%', }; diff --git a/packages/messages/src/triggers/buttons.ts b/packages/messages/src/triggers/buttons.ts index e6be6f81..645baea4 100644 --- a/packages/messages/src/triggers/buttons.ts +++ b/packages/messages/src/triggers/buttons.ts @@ -73,6 +73,11 @@ const ctaButtonConfigs: Record = { text: 'View proposal results', buildUrl: ({ proposalUrl }) => proposalUrl || BASE_URL + }, + offchainVotingReminder: { + text: 'Cast your vote', + buildUrl: ({ proposalUrl }) => + proposalUrl || BASE_URL } }; diff --git a/packages/messages/src/triggers/offchain-voting-reminder.ts b/packages/messages/src/triggers/offchain-voting-reminder.ts new file mode 100644 index 00000000..61d9cd18 --- /dev/null +++ b/packages/messages/src/triggers/offchain-voting-reminder.ts @@ -0,0 +1,11 @@ +export const offchainVotingReminderMessages = { + default: `⏰ Snapshot Voting Reminder - {{daoId}} + +Proposal: "{{title}}" + +⏱️ Time remaining: {{timeRemaining}} +📊 {{thresholdPercentage}}% of voting period has passed +🗳️ {{address}}'s vote hasn't been recorded yet + +Don't miss your chance to participate!`, +}; From 1c24657e308b336468e19ac6c2dd9118036c13f8 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 15:30:48 -0300 Subject: [PATCH 04/30] feat: add getOffchainProposalNonVoters method and start field to OffchainProposalItemSchema - Add `start` optional field to OffchainProposalItemSchema for Snapshot voting start time - Add SafeOffchainProposalNonVotersResponseSchema with null-filtering transform - Add getOffchainProposalNonVoters() method to AnticaptureClient - Export QueryInput_Proposals_Status_Items and OrderDirection from anticapture-client index - Fix breaking type changes from regenerated graphql.ts (unified OrderDirection enum, FeedEventType/FeedRelevance moved to top-level, number fields replacing string timestamps, GetProposalByIdQuery now returns union type with ErrorResponse) Co-Authored-By: Claude Sonnet 4.6 --- .../triggers/non-voting-handler.service.ts | 10 +- .../vote-confirmation-trigger.service.test.ts | 6 +- .../src/interfaces/proposal.interface.ts | 4 +- .../src/repositories/proposal.repository.ts | 29 +- .../repositories/voting-power.repository.ts | 6 +- .../src/triggers/new-proposal-trigger.ts | 2 +- .../src/triggers/proposal-finished-trigger.ts | 2 +- .../src/triggers/voting-reminder-trigger.ts | 8 +- .../dist/anticapture-client.d.ts | 10 + .../dist/anticapture-client.js | 42 +- packages/anticapture-client/dist/gql/gql.d.ts | 28 +- packages/anticapture-client/dist/gql/gql.js | 14 +- .../anticapture-client/dist/gql/graphql.d.ts | 2495 ++++++++--------- .../anticapture-client/dist/gql/graphql.js | 389 +-- packages/anticapture-client/dist/index.d.ts | 2 +- packages/anticapture-client/dist/index.js | 8 +- packages/anticapture-client/dist/schemas.d.ts | 73 +- packages/anticapture-client/dist/schemas.js | 27 +- .../src/anticapture-client.ts | 55 +- packages/anticapture-client/src/index.ts | 6 +- packages/anticapture-client/src/schemas.ts | 26 +- 21 files changed, 1525 insertions(+), 1717 deletions(-) diff --git a/apps/dispatcher/src/services/triggers/non-voting-handler.service.ts b/apps/dispatcher/src/services/triggers/non-voting-handler.service.ts index 3ee6d440..2c0f966c 100644 --- a/apps/dispatcher/src/services/triggers/non-voting-handler.service.ts +++ b/apps/dispatcher/src/services/triggers/non-voting-handler.service.ts @@ -3,7 +3,7 @@ import { DispatcherMessage, MessageProcessingResult } from '../../interfaces/dis import { ISubscriptionClient } from '../../interfaces/subscription-client.interface'; import { NotificationClientFactory } from '../notification/notification-factory.service'; import { ProposalFinishedNotification } from '../../interfaces/notification-client.interface'; -import { AnticaptureClient, QueryInput_Proposals_OrderDirection } from '@notification-system/anticapture-client'; +import { AnticaptureClient, OrderDirection, QueryInput_Proposals_Status_Items } from '@notification-system/anticapture-client'; import { BatchNotificationService } from '../batch-notification.service'; import { FormattingService } from '../formatting.service'; import { ValidationService } from '../validation.service'; @@ -161,9 +161,9 @@ export class NonVotingHandler extends BaseTriggerHandler { const proposals = await this.anticaptureClient!.listProposals({ - status: ['EXECUTED', 'SUCCEEDED', 'DEFEATED', 'EXPIRED', 'CANCELED'], + status: [QueryInput_Proposals_Status_Items.Executed, QueryInput_Proposals_Status_Items.Succeeded, QueryInput_Proposals_Status_Items.Defeated, QueryInput_Proposals_Status_Items.Expired, QueryInput_Proposals_Status_Items.Canceled], limit: NonVotingHandler.PROPOSALS_TO_CHECK * NonVotingHandler.FETCH_MARGIN_MULTIPLIER, - orderDirection: QueryInput_Proposals_OrderDirection.Desc + orderDirection: OrderDirection.Desc }, daoId); // If proposals is undefined or empty, return empty array @@ -174,13 +174,13 @@ export class NonVotingHandler extends BaseTriggerHandler { if (!a || !b) return 0; - return parseInt(b.endTimestamp) - parseInt(a.endTimestamp); + return (b.endTimestamp ?? 0) - (a.endTimestamp ?? 0); }); // Filter proposals that ended up to the current moment (includes current) // and get the most recent PROPOSALS_TO_CHECK proposals return sortedByEndTime - .filter(p => p && parseInt(p.endTimestamp) <= currentEndTimestamp) + .filter(p => p && (p.endTimestamp ?? 0) <= currentEndTimestamp) .slice(0, NonVotingHandler.PROPOSALS_TO_CHECK); } } \ No newline at end of file diff --git a/apps/dispatcher/src/services/triggers/vote-confirmation-trigger.service.test.ts b/apps/dispatcher/src/services/triggers/vote-confirmation-trigger.service.test.ts index 2e512660..b5829559 100644 --- a/apps/dispatcher/src/services/triggers/vote-confirmation-trigger.service.test.ts +++ b/apps/dispatcher/src/services/triggers/vote-confirmation-trigger.service.test.ts @@ -44,9 +44,9 @@ describe('VoteConfirmationTriggerHandler', () => { await handler.handleMessage({ triggerId: NotificationTypeId.VoteConfirmation, events: [ - { daoId: 'test-dao', proposalId: 'proposal-1', voterAddress: '0xVoter123', support: 1, votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 1' }, - { daoId: 'test-dao', proposalId: 'proposal-2', voterAddress: '0xVoter123', support: 0, votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 2' }, - { daoId: 'test-dao', proposalId: 'proposal-3', voterAddress: '0xVoter123', support: 2, votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 3' }, + { daoId: 'test-dao', proposalId: 'proposal-1', voterAddress: '0xVoter123', support: '1', votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 1' }, + { daoId: 'test-dao', proposalId: 'proposal-2', voterAddress: '0xVoter123', support: '0', votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 2' }, + { daoId: 'test-dao', proposalId: 'proposal-3', voterAddress: '0xVoter123', support: '2', votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 3' }, ] }); diff --git a/apps/logic-system/src/interfaces/proposal.interface.ts b/apps/logic-system/src/interfaces/proposal.interface.ts index 48351e8d..1a01e14f 100644 --- a/apps/logic-system/src/interfaces/proposal.interface.ts +++ b/apps/logic-system/src/interfaces/proposal.interface.ts @@ -1,6 +1,8 @@ import type { GetProposalByIdQuery } from '@notification-system/anticapture-client'; -export type ProposalOnChain = GetProposalByIdQuery['proposal']; +// Extract only the OnchainProposal variant (not ErrorResponse) from the union +type RawProposal = NonNullable; +export type ProposalOnChain = Extract; export type ProposalOrNull = ProposalOnChain | null; /** diff --git a/apps/logic-system/src/repositories/proposal.repository.ts b/apps/logic-system/src/repositories/proposal.repository.ts index 181b6bbf..30007c2f 100644 --- a/apps/logic-system/src/repositories/proposal.repository.ts +++ b/apps/logic-system/src/repositories/proposal.repository.ts @@ -1,4 +1,3 @@ -import { QueryInput_Proposals_IncludeOptimisticProposals as boolEnum } from '@notification-system/anticapture-client/dist/gql/graphql'; import { ProposalDataSource, ProposalOnChain, ProposalOrNull, ListProposalsOptions } from '../interfaces/proposal.interface'; import { AnticaptureClient, ListProposalsQueryVariables } from '@notification-system/anticapture-client'; @@ -10,17 +9,19 @@ export class ProposalRepository implements ProposalDataSource { } async getById(id: string): Promise { - return await this.anticaptureClient.getProposalById(id); + const result = await this.anticaptureClient.getProposalById(id); + if (!result || result.__typename !== 'OnchainProposal') return null; + return result as ProposalOnChain; } async listAll(options?: ListProposalsOptions, limit: number = 100): Promise { const variables: ListProposalsQueryVariables = {}; - - // Status filtering + + // Status filtering if (options?.status) { - variables.status = options.status; + variables.status = options.status as any; } - + // Date filtering if (options?.fromDate) { variables.fromDate = options.fromDate; @@ -30,32 +31,32 @@ export class ProposalRepository implements ProposalDataSource { variables.fromEndDate = options.fromEndDate; } - // Optimistic proposal filtering + // Optimistic proposal filtering - now a plain boolean if (options?.includeOptimisticProposals !== undefined) { - variables.includeOptimisticProposals = options.includeOptimisticProposals ? boolEnum.True : boolEnum.False; + variables.includeOptimisticProposals = options.includeOptimisticProposals; } // Pagination if (options?.limit) { variables.limit = Math.min(options.limit, limit); - } - + } + if (options?.skip) { variables.skip = options.skip; } - + // Ordering - enum requires cast if (options?.orderDirection === 'asc') { variables.orderDirection = 'asc' as any; } else if (options?.orderDirection === 'desc') { variables.orderDirection = 'desc' as any; } - + const daoId = options?.daoId; const result = await this.anticaptureClient.listProposals(variables, daoId); - + // Filter out null values and ensure we return ProposalOnChain[] return (result || []).filter(proposal => proposal !== null) as ProposalOnChain[]; } -} \ No newline at end of file +} diff --git a/apps/logic-system/src/repositories/voting-power.repository.ts b/apps/logic-system/src/repositories/voting-power.repository.ts index 4c4fc1ee..bd7157a5 100644 --- a/apps/logic-system/src/repositories/voting-power.repository.ts +++ b/apps/logic-system/src/repositories/voting-power.repository.ts @@ -3,7 +3,7 @@ import { ListHistoricalVotingPowerQueryVariables, ProcessedVotingPowerHistory, QueryInput_HistoricalVotingPower_OrderBy, - QueryInput_HistoricalVotingPower_OrderDirection + OrderDirection } from '@notification-system/anticapture-client'; export class VotingPowerRepository { @@ -17,9 +17,9 @@ export class VotingPowerRepository { const variables: ListHistoricalVotingPowerQueryVariables = { // Always order by timestamp ascending for chronological processing orderBy: QueryInput_HistoricalVotingPower_OrderBy.Timestamp, - orderDirection: QueryInput_HistoricalVotingPower_OrderDirection.Asc, + orderDirection: OrderDirection.Asc, limit: 100, - fromDate: timestampGt + fromDate: parseInt(timestampGt, 10) }; return await this.anticaptureClient.listVotingPowerHistory(variables); diff --git a/apps/logic-system/src/triggers/new-proposal-trigger.ts b/apps/logic-system/src/triggers/new-proposal-trigger.ts index 4b3aff8f..1e78dd61 100644 --- a/apps/logic-system/src/triggers/new-proposal-trigger.ts +++ b/apps/logic-system/src/triggers/new-proposal-trigger.ts @@ -55,7 +55,7 @@ export class NewProposalTrigger extends Trigger { daoId: proposal?.daoId || '', title: proposal?.title || undefined, description: proposal?.description || '', - endTimestamp: proposal?.endTimestamp ? parseInt(proposal.endTimestamp) : 0, + endTimestamp: proposal?.endTimestamp ?? 0, status: proposal?.status || 'unknown', forVotes: proposal?.forVotes || '0', againstVotes: proposal?.againstVotes || '0', diff --git a/apps/logic-system/src/triggers/voting-reminder-trigger.ts b/apps/logic-system/src/triggers/voting-reminder-trigger.ts index cbb3785f..f2b30696 100644 --- a/apps/logic-system/src/triggers/voting-reminder-trigger.ts +++ b/apps/logic-system/src/triggers/voting-reminder-trigger.ts @@ -85,8 +85,8 @@ export class VotingReminderTrigger extends Trigger { return false; } - const startTime = parseInt(proposal.timestamp); - const endTime = parseInt(proposal.endTimestamp); + const startTime = proposal.timestamp; + const endTime = proposal.endTimestamp; // Skip if proposal is not active if (now <= startTime || now >= endTime) { @@ -131,8 +131,8 @@ export class VotingReminderTrigger extends Trigger { } const now = Math.floor(Date.now() / 1000); - const startTime = parseInt(proposal.timestamp); - const endTime = parseInt(proposal.endTimestamp); + const startTime = proposal.timestamp; + const endTime = proposal.endTimestamp; const timeElapsedPercentage = this.calculateTimeElapsedPercentage(startTime, endTime, now); return { diff --git a/packages/anticapture-client/dist/anticapture-client.d.ts b/packages/anticapture-client/dist/anticapture-client.d.ts index 5a5c22a4..ce17e6ee 100644 --- a/packages/anticapture-client/dist/anticapture-client.d.ts +++ b/packages/anticapture-client/dist/anticapture-client.d.ts @@ -72,6 +72,16 @@ export declare class AnticaptureClient { * @returns List of non-voters with their voting power details */ getProposalNonVoters(proposalId: string, daoId: string, addresses?: string[]): Promise; + /** + * Fetches addresses that haven't voted on a specific offchain (Snapshot) proposal + * @param proposalId The Snapshot proposal ID to check + * @param addresses Optional array of addresses to filter by + * @returns List of non-voters + */ + getOffchainProposalNonVoters(proposalId: string, addresses?: string[]): Promise<{ + voter: string; + votingPower?: string; + }[]>; /** * List recent votes from all DAOs since a given timestamp * @param timestampGt Fetch votes with timestamp greater than this value (unix timestamp as string) diff --git a/packages/anticapture-client/dist/anticapture-client.js b/packages/anticapture-client/dist/anticapture-client.js index 3950edd5..3e448b93 100644 --- a/packages/anticapture-client/dist/anticapture-client.js +++ b/packages/anticapture-client/dist/anticapture-client.js @@ -172,10 +172,10 @@ class AnticaptureClient { } // Sort globally by timestamp desc (most recent first) if (variables?.fromEndDate) { - allProposals.sort((a, b) => parseInt(b?.endTimestamp || '0') - parseInt(a?.endTimestamp || '0')); + allProposals.sort((a, b) => (b?.endTimestamp ?? 0) - (a?.endTimestamp ?? 0)); } else { - allProposals.sort((a, b) => parseInt(b?.timestamp || '0') - parseInt(a?.timestamp || '0') || 0); + allProposals.sort((a, b) => (b?.timestamp ?? 0) - (a?.timestamp ?? 0)); } return allProposals; } @@ -257,6 +257,40 @@ class AnticaptureClient { return []; } } + /** + * Fetches addresses that haven't voted on a specific offchain (Snapshot) proposal + * @param proposalId The Snapshot proposal ID to check + * @param addresses Optional array of addresses to filter by + * @returns List of non-voters + */ + async getOffchainProposalNonVoters(proposalId, addresses) { + try { + const response = await this.httpClient.post('', { + query: `query OffchainProposalNonVoters($id: String!, $addresses: String, $orderDirection: String) { + offchainProposalNonVoters(id: $id, addresses: $addresses, orderDirection: $orderDirection) { + items { + voter + votingPower + } + } + }`, + variables: { + id: proposalId, + ...(addresses && { addresses: addresses.join(',') }), + orderDirection: 'desc' + } + }, { headers: this.buildHeaders() }); + if (response.data.errors) { + throw new Error(JSON.stringify(response.data.errors)); + } + const validated = schemas_1.SafeOffchainProposalNonVotersResponseSchema.parse(this.toLowercase(response.data.data)); + return validated.offchainProposalNonVoters.items; + } + catch (error) { + console.warn(`Error fetching offchain non-voters for proposal ${proposalId}:`, error); + return []; + } + } /** * List recent votes from all DAOs since a given timestamp * @param timestampGt Fetch votes with timestamp greater than this value (unix timestamp as string) @@ -273,7 +307,7 @@ class AnticaptureClient { fromDate: parseInt(timestampGt), limit, orderBy: graphql_2.QueryInput_Votes_OrderBy.Timestamp, - orderDirection: graphql_2.QueryInput_Votes_OrderDirection.Asc + orderDirection: graphql_2.OrderDirection.Asc }); // Add daoId to each vote return votes.map(vote => ({ @@ -380,7 +414,7 @@ class AnticaptureClient { fromDate, limit, orderBy: graphql_2.QueryInput_VotesOffchain_OrderBy.Timestamp, - orderDirection: graphql_2.QueryInput_VotesOffchain_OrderDirection.Asc + orderDirection: graphql_2.OrderDirection.Asc }); return votes.map(vote => ({ ...vote, diff --git a/packages/anticapture-client/dist/gql/gql.d.ts b/packages/anticapture-client/dist/gql/gql.d.ts index 84696ea7..c50823f1 100644 --- a/packages/anticapture-client/dist/gql/gql.d.ts +++ b/packages/anticapture-client/dist/gql/gql.d.ts @@ -13,13 +13,13 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document- */ type Documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": typeof types.GetDaOsDocument; - "query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": typeof types.ListOffchainProposalsDocument; - "query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": typeof types.ListOffchainVotesDocument; - "query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": typeof types.ProposalNonVotersDocument; - "query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": typeof types.GetProposalByIdDocument; - "query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": typeof types.GetEventRelevanceThresholdDocument; - "query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": typeof types.ListVotesDocument; - "query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": typeof types.ListHistoricalVotingPowerDocument; + "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": typeof types.ListOffchainProposalsDocument; + "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": typeof types.ListOffchainVotesDocument; + "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": typeof types.ProposalNonVotersDocument; + "query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": typeof types.GetProposalByIdDocument; + "query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": typeof types.GetEventRelevanceThresholdDocument; + "query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": typeof types.ListVotesDocument; + "query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": typeof types.ListHistoricalVotingPowerDocument; }; declare const documents: Documents; /** @@ -42,30 +42,30 @@ export declare function graphql(source: "query GetDAOs {\n daos {\n items {\ /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"]; +export declare function graphql(source: "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"]; +export declare function graphql(source: "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"): (typeof documents)["query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"]; +export declare function graphql(source: "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"): (typeof documents)["query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"): (typeof documents)["query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"]; +export declare function graphql(source: "query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"): (typeof documents)["query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"): (typeof documents)["query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"]; +export declare function graphql(source: "query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"): (typeof documents)["query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"): (typeof documents)["query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"]; +export declare function graphql(source: "query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"): (typeof documents)["query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"): (typeof documents)["query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"]; +export declare function graphql(source: "query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"): (typeof documents)["query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"]; export type DocumentType> = TDocumentNode extends DocumentNode ? TType : never; export {}; diff --git a/packages/anticapture-client/dist/gql/gql.js b/packages/anticapture-client/dist/gql/gql.js index 06200e73..1e50e3e1 100644 --- a/packages/anticapture-client/dist/gql/gql.js +++ b/packages/anticapture-client/dist/gql/gql.js @@ -38,13 +38,13 @@ exports.graphql = graphql; const types = __importStar(require("./graphql")); const documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": types.GetDaOsDocument, - "query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": types.ListOffchainProposalsDocument, - "query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": types.ListOffchainVotesDocument, - "query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": types.ProposalNonVotersDocument, - "query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": types.GetProposalByIdDocument, - "query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": types.GetEventRelevanceThresholdDocument, - "query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": types.ListVotesDocument, - "query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": types.ListHistoricalVotingPowerDocument, + "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": types.ListOffchainProposalsDocument, + "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": types.ListOffchainVotesDocument, + "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": types.ProposalNonVotersDocument, + "query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": types.GetProposalByIdDocument, + "query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": types.GetEventRelevanceThresholdDocument, + "query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": types.ListVotesDocument, + "query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": types.ListHistoricalVotingPowerDocument, }; function graphql(source) { return documents[source] ?? {}; diff --git a/packages/anticapture-client/dist/gql/graphql.d.ts b/packages/anticapture-client/dist/gql/graphql.d.ts index 2c0a56ec..76bc59cd 100644 --- a/packages/anticapture-client/dist/gql/graphql.d.ts +++ b/packages/anticapture-client/dist/gql/graphql.d.ts @@ -42,13 +42,13 @@ export type Scalars = { input: number; output: number; }; - /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ - JSON: { + /** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */ + DateTime: { input: any; output: any; }; - /** Integers that will have a value of 0 or more. */ - NonNegativeInt: { + /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ + JSON: { input: any; output: any; }; @@ -56,12 +56,82 @@ export type Scalars = { input: any; output: any; }; - /** Integers that will have a value greater than 0. */ - PositiveInt: { + /** A field whose value conforms to the standard URL format as specified in RFC3986: https://www.ietf.org/rfc/rfc3986.txt. */ + URL: { input: any; output: any; }; }; +/** Balance delta for a single account across two timestamps. */ +export type AccountBalanceVariation = { + __typename?: 'AccountBalanceVariation'; + /** Absolute balance change encoded as a decimal string. */ + absoluteChange: Scalars['String']['output']; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Balance at the end of the comparison window. */ + currentBalance: Scalars['String']['output']; + /** Relative balance change encoded as a decimal string. */ + percentageChange: Scalars['String']['output']; + /** Balance at the start of the comparison window. */ + previousBalance: Scalars['String']['output']; +}; +/** Balance variation response for a single account. */ +export type AccountBalanceVariationsByAccountIdResponse = { + __typename?: 'AccountBalanceVariationsByAccountIdResponse'; + data: AccountBalanceVariation; + period: PeriodResponse; +}; +/** List of balance variations for multiple accounts in the selected period. */ +export type AccountBalanceVariationsResponse = { + __typename?: 'AccountBalanceVariationsResponse'; + items: Array>; + period: PeriodResponse; +}; +export type AccountBalanceWithVariation = { + __typename?: 'AccountBalanceWithVariation'; + address: Scalars['String']['output']; + balance: Scalars['String']['output']; + delegate: Scalars['String']['output']; + tokenId: Scalars['String']['output']; + variation: AccountBalanceVariation; +}; +export type AccountBalanceWithVariationResponse = { + __typename?: 'AccountBalanceWithVariationResponse'; + data: AccountBalanceWithVariation; + period: PeriodResponse; +}; +export type AccountBalancesWithVariationResponse = { + __typename?: 'AccountBalancesWithVariationResponse'; + items: Array>; + period: PeriodResponse; + totalCount: Scalars['Int']['output']; +}; +/** Aggregated interaction metrics between the requested account and another account. */ +export type AccountInteraction = { + __typename?: 'AccountInteraction'; + /** Counterparty account ID. */ + accountId: Scalars['String']['output']; + /** Net amount transferred between the requested account and the counterparty. */ + amountTransferred: Scalars['String']['output']; + /** Gross transfer volume between the requested account and the counterparty. */ + totalVolume: Scalars['String']['output']; + /** Number of transfers observed for the interaction pair. */ + transferCount: Scalars['String']['output']; +}; +/** Paginated list of account interaction aggregates. */ +export type AccountInteractionsResponse = { + __typename?: 'AccountInteractionsResponse'; + items: Array>; + period: PeriodResponse; + totalCount: Scalars['Int']['output']; +}; +/** Active token supply for the selected comparison window. */ +export type ActiveSupplyResponse = { + __typename?: 'ActiveSupplyResponse'; + /** Active token supply encoded as a decimal string. */ + activeSupply: Scalars['String']['output']; +}; export type AverageDelegationPercentageItem = { __typename?: 'AverageDelegationPercentageItem'; date: Scalars['String']['output']; @@ -77,9 +147,132 @@ export type AverageDelegationPercentagePage = { */ totalCount: Scalars['Int']['output']; }; +/** Average turnout comparison between two adjacent time windows. */ +export type AverageTurnoutComparisonResponse = { + __typename?: 'AverageTurnoutComparisonResponse'; + /** Relative change between current and previous periods. */ + changeRate: Scalars['Float']['output']; + /** Average turnout for the current period encoded as a string. */ + currentAverageTurnout: Scalars['String']['output']; + /** Average turnout for the previous period encoded as a string. */ + oldAverageTurnout: Scalars['String']['output']; +}; export type DaoList = { __typename?: 'DAOList'; - items: Array; + items: Array; + totalCount: Scalars['Int']['output']; +}; +/** Current governance parameters and feature flags for the active DAO. */ +export type DaoResponse = { + __typename?: 'DaoResponse'; + alreadySupportCalldataReview: Scalars['Boolean']['output']; + chainId: Scalars['Int']['output']; + id: Scalars['String']['output']; + proposalThreshold: Scalars['String']['output']; + quorum: Scalars['String']['output']; + supportOffchainData: Scalars['Boolean']['output']; + timelockDelay: Scalars['String']['output']; + votingDelay: Scalars['String']['output']; + votingPeriod: Scalars['String']['output']; +}; +export declare enum DaysWindow { + '7d' = "_7d", + '30d' = "_30d", + '90d' = "_90d", + '180d' = "_180d", + '365d' = "_365d" +} +/** Single delegation transfer event in the historical delegation feed. */ +export type DelegationItem = { + __typename?: 'DelegationItem'; + amount: Scalars['String']['output']; + delegateAddress: Scalars['String']['output']; + delegatorAddress: Scalars['String']['output']; + timestamp: Scalars['String']['output']; + transactionHash: Scalars['String']['output']; +}; +export type DelegationPercentageItem = { + __typename?: 'DelegationPercentageItem'; + /** Unix day bucket represented as a timestamp string. */ + date: Scalars['String']['output']; + /** Delegation percentage value for the day bucket. */ + high: Scalars['String']['output']; +}; +export type DelegationPercentageResponse = { + __typename?: 'DelegationPercentageResponse'; + items: Array>; + pageInfo: PageInfo; + /** Total number of matching day buckets. */ + totalCount: Scalars['Int']['output']; +}; +/** Paginated historical delegations response. */ +export type DelegationsResponse = { + __typename?: 'DelegationsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +/** Aggregated delegation amount and latest timestamp for one delegator. */ +export type DelegatorItem = { + __typename?: 'DelegatorItem'; + amount: Scalars['String']['output']; + delegatorAddress: Scalars['String']['output']; + timestamp: Scalars['String']['output']; +}; +/** Paginated delegators for a delegate address. */ +export type DelegatorsResponse = { + __typename?: 'DelegatorsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +/** Generic error payload returned by the API. */ +export type ErrorResponse = { + __typename?: 'ErrorResponse'; + /** Human-readable error message */ + error: Scalars['String']['output']; + /** Optional implementation detail or validation context for the error. */ + message?: Maybe; +}; +/** Resolved threshold for a feed event type and relevance level. */ +export type EventRelevanceThresholdResponse = { + __typename?: 'EventRelevanceThresholdResponse'; + /** Threshold value encoded as a decimal string. */ + threshold: Scalars['String']['output']; +}; +/** Filter events by governance activity type. */ +export declare enum FeedEventType { + Delegation = "DELEGATION", + Proposal = "PROPOSAL", + ProposalExtended = "PROPOSAL_EXTENDED", + Transfer = "TRANSFER", + Vote = "VOTE" +} +/** Single event in the governance activity feed. */ +export type FeedItem = { + __typename?: 'FeedItem'; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Type-specific metadata for the feed event. */ + metadata?: Maybe; + relevance: FeedRelevance; + /** Event timestamp in Unix seconds. */ + timestamp: Scalars['Int']['output']; + /** Transaction hash. */ + txHash: Scalars['String']['output']; + type: FeedEventType; + /** Optional event value encoded as a decimal string when applicable. */ + value?: Maybe; +}; +/** Filter events by relevance tier. */ +export declare enum FeedRelevance { + High = "HIGH", + Low = "LOW", + Medium = "MEDIUM" +} +/** Paginated governance activity feed response. */ +export type FeedResponse = { + __typename?: 'FeedResponse'; + items: Array>; + /** Total number of matching feed events. */ totalCount: Scalars['Int']['output']; }; export declare enum HttpMethod { @@ -93,6 +286,218 @@ export declare enum HttpMethod { Put = "PUT", Trace = "TRACE" } +/** Single historical balance record enriched with transfer context. */ +export type HistoricalBalance = { + __typename?: 'HistoricalBalance'; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Account balance after the historical event. */ + balance: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Balance change introduced by the historical event. */ + delta: Scalars['String']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Event timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; + transfer: HistoricalBalanceTransfer; +}; +/** Transfer event associated with a historical balance row. */ +export type HistoricalBalanceTransfer = { + __typename?: 'HistoricalBalanceTransfer'; + /** Sender address. */ + from: Scalars['String']['output']; + /** Recipient address. */ + to: Scalars['String']['output']; + /** Transferred amount encoded as a decimal string. */ + value: Scalars['String']['output']; +}; +/** Paginated historical balance records for one account. */ +export type HistoricalBalancesResponse = { + __typename?: 'HistoricalBalancesResponse'; + items: Array>; + /** Total number of matching historical balance rows. */ + totalCount: Scalars['Int']['output']; +}; +/** Single historical voting power record enriched with delegation and transfer context. */ +export type HistoricalVotingPower = { + __typename?: 'HistoricalVotingPower'; + /** Account address. */ + accountId: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + delegation?: Maybe; + /** Voting power change introduced by the event. */ + delta: Scalars['String']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Event timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; + transfer?: Maybe; + /** Voting power after the event, encoded as a decimal string. */ + votingPower: Scalars['String']['output']; +}; +/** Delegation event associated with a historical voting power row. */ +export type HistoricalVotingPowerDelegation = { + __typename?: 'HistoricalVotingPowerDelegation'; + from: Scalars['String']['output']; + previousDelegate?: Maybe; + to: Scalars['String']['output']; + value: Scalars['String']['output']; +}; +/** Transfer event associated with a historical voting power row. */ +export type HistoricalVotingPowerTransfer = { + __typename?: 'HistoricalVotingPowerTransfer'; + from: Scalars['String']['output']; + to: Scalars['String']['output']; + value: Scalars['String']['output']; +}; +/** Paginated historical voting power records. */ +export type HistoricalVotingPowersResponse = { + __typename?: 'HistoricalVotingPowersResponse'; + items: Array>; + /** Total number of matching historical voting power rows. */ + totalCount: Scalars['Int']['output']; +}; +/** Response payload describing the latest update time for a chart. */ +export type LastUpdateResponse = { + __typename?: 'LastUpdateResponse'; + /** Latest refresh time in ISO-8601 format. */ + lastUpdate: Scalars['DateTime']['output']; +}; +export type OffchainProposal = { + __typename?: 'OffchainProposal'; + /** Address or ENS of the author. */ + author: Scalars['String']['output']; + /** Proposal body. */ + body: Scalars['String']['output']; + choices: Array>; + /** Creation timestamp in Unix seconds. */ + created: Scalars['Int']['output']; + /** Discussion URL or thread reference. */ + discussion: Scalars['String']['output']; + /** Voting end timestamp in Unix seconds. */ + end: Scalars['Int']['output']; + /** Whether the proposal was flagged by Snapshot. */ + flagged: Scalars['Boolean']['output']; + /** Snapshot proposal identifier. */ + id: Scalars['String']['output']; + /** Canonical Snapshot proposal URL. */ + link: Scalars['String']['output']; + network: Scalars['String']['output']; + scores: Array>; + snapshot?: Maybe; + /** Snapshot space identifier. */ + spaceId: Scalars['String']['output']; + /** Voting start timestamp in Unix seconds. */ + start: Scalars['Int']['output']; + /** Current Snapshot proposal state. */ + state: Scalars['String']['output']; + strategies: Array>; + /** Proposal title. */ + title: Scalars['String']['output']; + /** Snapshot proposal type. */ + type: Scalars['String']['output']; + /** Last update timestamp in Unix seconds. */ + updated: Scalars['Int']['output']; +}; +export type OffchainProposalsResponse = { + __typename?: 'OffchainProposalsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +export type OffchainVote = { + __typename?: 'OffchainVote'; + choice: Scalars['JSON']['output']; + created: Scalars['Int']['output']; + proposalId: Scalars['String']['output']; + proposalTitle?: Maybe; + reason: Scalars['String']['output']; + voter: Scalars['String']['output']; + vp?: Maybe; +}; +export type OffchainVotesResponse = { + __typename?: 'OffchainVotesResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +export type OnchainProposal = { + __typename?: 'OnchainProposal'; + /** Abstain votes, encoded as a decimal string. */ + abstainVotes: Scalars['String']['output']; + /** Votes cast against, encoded as a decimal string. */ + againstVotes: Scalars['String']['output']; + /** Encoded calldata payloads executed by the proposal. */ + calldatas: Array>; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Proposal body. */ + description: Scalars['String']['output']; + /** End block number. */ + endBlock: Scalars['Int']['output']; + /** Proposal end timestamp in Unix seconds. */ + endTimestamp: Scalars['Int']['output']; + /** Votes cast in favor, encoded as a decimal string. */ + forVotes: Scalars['String']['output']; + /** Onchain proposal identifier. */ + id: Scalars['String']['output']; + /** Optional proposal type discriminator. */ + proposalType?: Maybe; + /** Address that created the proposal. */ + proposerAccountId: Scalars['String']['output']; + /** Required quorum encoded as a decimal string. */ + quorum: Scalars['String']['output']; + /** Start block number. */ + startBlock: Scalars['Int']['output']; + /** Proposal start timestamp in Unix seconds. */ + startTimestamp: Scalars['Int']['output']; + /** Current proposal status. */ + status: Scalars['String']['output']; + /** Contract targets invoked by the proposal. */ + targets: Array>; + /** Proposal creation timestamp in Unix seconds. */ + timestamp: Scalars['Int']['output']; + /** Proposal title. */ + title: Scalars['String']['output']; + /** Proposal creation transaction hash. */ + txHash: Scalars['String']['output']; + /** ETH values attached to each call, encoded as strings. */ + values: Array>; +}; +export type OnchainProposalsResponse = { + __typename?: 'OnchainProposalsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +export type OnchainVote = { + __typename?: 'OnchainVote'; + proposalId: Scalars['String']['output']; + proposalTitle?: Maybe; + reason?: Maybe; + /** Governance vote direction. */ + support?: Maybe; + /** Vote timestamp in Unix seconds. */ + timestamp: Scalars['Int']['output']; + transactionHash: Scalars['String']['output']; + voterAddress: Scalars['String']['output']; + /** Voting power encoded as a decimal string. */ + votingPower: Scalars['String']['output']; +}; +export type OnchainVotesResponse = { + __typename?: 'OnchainVotesResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +/** Sort direction for ordered query results. */ +export declare enum OrderDirection { + Asc = "asc", + Desc = "desc" +} export type PageInfo = { __typename?: 'PageInfo'; endDate?: Maybe; @@ -100,21 +505,108 @@ export type PageInfo = { hasPreviousPage: Scalars['Boolean']['output']; startDate?: Maybe; }; +/** Inclusive time period represented as ISO-8601 timestamps. */ +export type PeriodResponse = { + __typename?: 'PeriodResponse'; + endTimestamp: Scalars['String']['output']; + startTimestamp: Scalars['String']['output']; +}; +/** Combined proposal and delegate vote context for one activity row. */ +export type ProposalActivityItem = { + __typename?: 'ProposalActivityItem'; + proposal: ProposalActivityProposal; + userVote?: Maybe; +}; +/** Proposal snapshot included in the delegate activity response. */ +export type ProposalActivityProposal = { + __typename?: 'ProposalActivityProposal'; + /** Abstain votes, encoded as a decimal string. */ + abstainVotes: Scalars['String']['output']; + /** Votes cast against, encoded as a decimal string. */ + againstVotes: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Proposal body. */ + description: Scalars['String']['output']; + /** End block number. */ + endBlock: Scalars['Float']['output']; + /** Votes cast in favor, encoded as a decimal string. */ + forVotes: Scalars['String']['output']; + /** Onchain proposal identifier. */ + id: Scalars['String']['output']; + /** Address that created the proposal. */ + proposerAccountId: Scalars['String']['output']; + /** Start block number. */ + startBlock: Scalars['Float']['output']; + /** Current proposal status. */ + status: Scalars['String']['output']; + /** Proposal creation timestamp in Unix seconds as a string. */ + timestamp?: Maybe; + /** Proposal title. */ + title: Scalars['String']['output']; +}; +/** Delegate proposal activity metrics and proposal-by-proposal history. */ +export type ProposalActivityResponse = { + __typename?: 'ProposalActivityResponse'; + /** Delegate address. */ + address: Scalars['String']['output']; + /** Average seconds between the delegate vote and proposal end time. */ + avgTimeBeforeEnd: Scalars['Float']['output']; + /** Whether the delegate never cast a vote. */ + neverVoted: Scalars['Boolean']['output']; + proposals: Array>; + /** Total proposals reviewed in the dataset. */ + totalProposals: Scalars['Int']['output']; + /** Number of proposals the delegate voted on. */ + votedProposals: Scalars['Int']['output']; + /** Share of proposals where the delegate sided with outcome. */ + winRate: Scalars['Float']['output']; + /** Share of delegate votes cast in support. */ + yesRate: Scalars['Float']['output']; +}; +/** Vote cast by the requested delegate for a given proposal. */ +export type ProposalActivityUserVote = { + __typename?: 'ProposalActivityUserVote'; + /** Vote identifier. */ + id: Scalars['String']['output']; + /** Related proposal ID. */ + proposalId: Scalars['String']['output']; + /** Optional vote rationale. */ + reason?: Maybe; + /** Governance vote direction. */ + support: Scalars['String']['output']; + /** Vote timestamp in Unix seconds as a string. */ + timestamp?: Maybe; + /** Address that cast the vote. */ + voterAccountId: Scalars['String']['output']; + /** Voting power used by the delegate, encoded as a string. */ + votingPower?: Maybe; +}; +/** Proposal launch comparison between two adjacent time windows. */ +export type ProposalsComparisonResponse = { + __typename?: 'ProposalsComparisonResponse'; + /** Relative change between current and previous periods. */ + changeRate: Scalars['Float']['output']; + /** Number of proposals launched in the current period. */ + currentProposalsLaunched: Scalars['Int']['output']; + /** Number of proposals launched in the comparison period. */ + oldProposalsLaunched: Scalars['Int']['output']; +}; export type Query = { __typename?: 'Query'; /** Returns account balance information for a specific address */ - accountBalanceByAccountId?: Maybe; + accountBalanceByAccountId?: Maybe; /** Returns a mapping of the biggest variations to account balances associated by account address */ - accountBalanceVariations?: Maybe; + accountBalanceVariations?: Maybe; /** Returns a the changes to balance by period and accountId */ - accountBalanceVariationsByAccountId?: Maybe; + accountBalanceVariationsByAccountId?: Maybe; /** Returns sorted and paginated account balance records */ - accountBalances?: Maybe; + accountBalances?: Maybe; /** * Returns a mapping of the largest interactions between accounts. * Positive amounts signify net token transfers FROM
, whilst negative amounts refer to net transfers TO
*/ - accountInteractions?: Maybe; + accountInteractions?: Maybe; /** * Average delegation percentage across all supported DAOs by day. * Returns the mean delegation percentage for each day in the specified range. @@ -122,142 +614,142 @@ export type Query = { */ averageDelegationPercentageByDay: AverageDelegationPercentagePage; /** Get active token supply for DAO */ - compareActiveSupply?: Maybe; + compareActiveSupply?: Maybe; /** Compare average turnout between time periods */ - compareAverageTurnout?: Maybe; + compareAverageTurnout?: Maybe; /** Compare cex supply between periods */ - compareCexSupply?: Maybe; + compareCexSupply?: Maybe; /** Compare circulating supply between periods */ - compareCirculatingSupply?: Maybe; + compareCirculatingSupply?: Maybe; /** Compare delegated supply between periods */ - compareDelegatedSupply?: Maybe; + compareDelegatedSupply?: Maybe; /** Compare dex supply between periods */ - compareDexSupply?: Maybe; + compareDexSupply?: Maybe; /** Compare lending supply between periods */ - compareLendingSupply?: Maybe; + compareLendingSupply?: Maybe; /** Compare number of proposals between time periods */ - compareProposals?: Maybe; + compareProposals?: Maybe; /** Compare total supply between periods */ - compareTotalSupply?: Maybe; + compareTotalSupply?: Maybe; /** Compare treasury between periods */ - compareTreasury?: Maybe; + compareTreasury?: Maybe; /** Compare number of votes between time periods */ - compareVotes?: Maybe; + compareVotes?: Maybe; /** Returns current governance parameters for this DAO */ - dao?: Maybe; + dao?: Maybe; /** Get all DAOs */ daos: DaoList; /** Get delegation percentage day buckets with forward-fill */ - delegationPercentageByDay?: Maybe; + delegationPercentageByDay?: Maybe; /** Get current delegations for an account */ - delegations?: Maybe; + delegations?: Maybe; /** Get current delegators of an account with voting power */ - delegators?: Maybe; + delegators?: Maybe; /** Get feed events */ - feedEvents?: Maybe; + feedEvents?: Maybe; /** Returns label information from Arkham, ENS data, and whether the address is an EOA or contract. Arkham data is stored permanently. ENS data is cached with a configurable TTL. */ getAddress?: Maybe; /** Returns label information from Arkham, ENS data, and address type for multiple addresses. Maximum 100 addresses per request. Arkham data is stored permanently. ENS data is cached with a configurable TTL. */ getAddresses?: Maybe; /** Get historical DAO Token Treasury value (governance token quantity × token price) */ - getDaoTokenTreasury?: Maybe; + getDaoTokenTreasury?: Maybe; /** Get event relevance threshold */ - getEventRelevanceThreshold?: Maybe; + getEventRelevanceThreshold?: Maybe; /** Get historical Liquid Treasury (treasury without DAO tokens) from external providers (DefiLlama/Dune) */ - getLiquidTreasury?: Maybe; + getLiquidTreasury?: Maybe; /** Get historical Total Treasury (liquid treasury + DAO token treasury) */ - getTotalTreasury?: Maybe; - /** TODO */ - historicalBalances?: Maybe; + getTotalTreasury?: Maybe; + /** Returns historical balance deltas for one account, enriched with the transfer that caused each change. */ + historicalBalances?: Maybe; /** Get historical delegations for an account, with optional filtering and sorting */ - historicalDelegations?: Maybe; + historicalDelegations?: Maybe; /** Get historical market data for a specific token */ - historicalTokenData?: Maybe>>; + historicalTokenData?: Maybe>>; /** Returns a list of voting power changes. */ - historicalVotingPower?: Maybe; + historicalVotingPower?: Maybe; /** Returns a list of voting power changes for a specific account */ - historicalVotingPowerByAccountId?: Maybe; + historicalVotingPowerByAccountId?: Maybe; /** Get the last update time */ - lastUpdate?: Maybe; + lastUpdate?: Maybe; /** Returns a single offchain (Snapshot) proposal by its ID */ - offchainProposalById?: Maybe; + offchainProposalById?: Maybe; /** Returns a list of offchain (Snapshot) proposals */ - offchainProposals?: Maybe; + offchainProposals?: Maybe; /** Returns a single proposal by its ID */ - proposal?: Maybe; + proposal?: Maybe; /** Returns the active delegates that did not vote on a given proposal */ - proposalNonVoters?: Maybe; + proposalNonVoters?: Maybe; /** Returns a list of proposal */ - proposals?: Maybe; + proposals?: Maybe; /** Returns proposal activity data including voting history, win rates, and detailed proposal information for the specified delegate within the given time window */ - proposalsActivity?: Maybe; + proposalsActivity?: Maybe; /** Get property data for a specific token */ - token?: Maybe; + token?: Maybe; /** Returns token related metrics for a single metric type. */ - tokenMetrics?: Maybe; + tokenMetrics?: Maybe; /** Get transactions with their associated transfers and delegations, with optional filtering and sorting */ - transactions?: Maybe; + transactions?: Maybe; /** Get transfers of a given address */ - transfers?: Maybe; + transfers?: Maybe; /** Get all votes ordered by timestamp or voting power */ - votes?: Maybe; + votes?: Maybe; /** Returns a paginated list of votes cast on a specific proposal */ - votesByProposalId?: Maybe; + votesByProposalId?: Maybe; /** Returns a list of offchain (Snapshot) votes */ - votesOffchain?: Maybe; + votesOffchain?: Maybe; /** Returns a paginated list of offchain (Snapshot) votes for a specific proposal */ - votesOffchainByProposalId?: Maybe; + votesOffchainByProposalId?: Maybe; /** Returns voting power information for a specific address (account) */ - votingPowerByAccountId?: Maybe; + votingPowerByAccountId?: Maybe; /** Returns a mapping of the voting power changes within a time frame for the given addresses */ - votingPowerVariations?: Maybe; + votingPowerVariations?: Maybe; /** Returns a the changes to voting power by period and accountId */ - votingPowerVariationsByAccountId?: Maybe; + votingPowerVariationsByAccountId?: Maybe; /** Returns sorted and paginated account voting power records */ - votingPowers?: Maybe; + votingPowers?: Maybe; }; export type QueryAccountBalanceByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAccountBalanceVariationsArgs = { - addresses?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + addresses?: InputMaybe>>; + fromDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAccountBalanceVariationsByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAccountBalancesArgs = { - addresses?: InputMaybe; - delegates?: InputMaybe; + addresses?: InputMaybe>>; + delegates?: InputMaybe>>; excludeDaoAddresses?: InputMaybe; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryAccountInteractionsArgs = { address: Scalars['String']['input']; filterAddress?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; maxAmount?: InputMaybe; minAmount?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAverageDelegationPercentageByDayArgs = { after?: InputMaybe; @@ -268,132 +760,132 @@ export type QueryAverageDelegationPercentageByDayArgs = { startDate: Scalars['String']['input']; }; export type QueryCompareActiveSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareAverageTurnoutArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareCexSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareCirculatingSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareDelegatedSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareDexSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareLendingSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareProposalsArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareTotalSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareTreasuryArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareVotesArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryDelegationPercentageByDayArgs = { - after?: InputMaybe; - before?: InputMaybe; - endDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - startDate?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + endDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + startDate?: InputMaybe; }; export type QueryDelegationsArgs = { address: Scalars['String']['input']; }; export type QueryDelegatorsArgs = { address: Scalars['String']['input']; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; }; export type QueryFeedEventsArgs = { - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; + orderDirection?: InputMaybe; relevance?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; type?: InputMaybe; }; export type QueryGetAddressArgs = { address: Scalars['String']['input']; }; export type QueryGetAddressesArgs = { - addresses: Scalars['JSON']['input']; + addresses: Array>; }; export type QueryGetDaoTokenTreasuryArgs = { - days?: InputMaybe; - order?: InputMaybe; + days?: InputMaybe; + orderDirection?: InputMaybe; }; export type QueryGetEventRelevanceThresholdArgs = { - relevance: QueryInput_GetEventRelevanceThreshold_Relevance; - type: QueryInput_GetEventRelevanceThreshold_Type; + relevance: FeedRelevance; + type: FeedEventType; }; export type QueryGetLiquidTreasuryArgs = { - days?: InputMaybe; - order?: InputMaybe; + days?: InputMaybe; + orderDirection?: InputMaybe; }; export type QueryGetTotalTreasuryArgs = { - days?: InputMaybe; - order?: InputMaybe; + days?: InputMaybe; + orderDirection?: InputMaybe; }; export type QueryHistoricalBalancesArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryHistoricalDelegationsArgs = { address: Scalars['String']['input']; - delegateAddressIn?: InputMaybe; + delegateAddressIn?: InputMaybe>>; fromValue?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; toValue?: InputMaybe; }; export type QueryHistoricalTokenDataArgs = { - limit?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; }; export type QueryHistoricalVotingPowerArgs = { address?: InputMaybe; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryHistoricalVotingPowerByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryLastUpdateArgs = { @@ -403,1282 +895,597 @@ export type QueryOffchainProposalByIdArgs = { id: Scalars['String']['input']; }; export type QueryOffchainProposalsArgs = { - endDate?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - status?: InputMaybe; + endDate?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + status?: InputMaybe>>; }; export type QueryProposalArgs = { id: Scalars['String']['input']; }; export type QueryProposalNonVotersArgs = { - addresses?: InputMaybe; + addresses?: InputMaybe>>; id: Scalars['String']['input']; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; }; export type QueryProposalsArgs = { - fromDate?: InputMaybe; - fromEndDate?: InputMaybe; - includeOptimisticProposals?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - status?: InputMaybe; + fromDate?: InputMaybe; + fromEndDate?: InputMaybe; + includeOptimisticProposals?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + status?: InputMaybe>>; }; export type QueryProposalsActivityArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; userVoteFilter?: InputMaybe; }; export type QueryTokenArgs = { currency?: InputMaybe; }; export type QueryTokenMetricsArgs = { - endDate?: InputMaybe; - limit?: InputMaybe; + endDate?: InputMaybe; + limit?: InputMaybe; metricType: QueryInput_TokenMetrics_MetricType; - orderDirection?: InputMaybe; - skip?: InputMaybe; - startDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + startDate?: InputMaybe; }; export type QueryTransactionsArgs = { - affectedSupply?: InputMaybe; + affectedSupply?: InputMaybe>>; from?: InputMaybe; fromDate?: InputMaybe; - includes?: InputMaybe; - limit?: InputMaybe; + includes?: InputMaybe>>; + limit?: InputMaybe; maxAmount?: InputMaybe; minAmount?: InputMaybe; - offset?: InputMaybe; - sortBy?: InputMaybe; - sortOrder?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; to?: InputMaybe; toDate?: InputMaybe; }; export type QueryTransfersArgs = { address: Scalars['String']['input']; from?: InputMaybe; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; - offset?: InputMaybe; - sortBy?: InputMaybe; - sortOrder?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; to?: InputMaybe; - toDate?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryVotesArgs = { - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - support?: InputMaybe; - toDate?: InputMaybe; - voterAddressIn?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + support?: InputMaybe; + toDate?: InputMaybe; + voterAddressIn?: InputMaybe>>; }; export type QueryVotesByProposalIdArgs = { - fromDate?: InputMaybe; + fromDate?: InputMaybe; id: Scalars['String']['input']; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - support?: InputMaybe; - toDate?: InputMaybe; - voterAddressIn?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + support?: InputMaybe; + toDate?: InputMaybe; + voterAddressIn?: InputMaybe>>; }; export type QueryVotesOffchainArgs = { - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; - voterAddresses?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; + voterAddresses?: InputMaybe>>; }; export type QueryVotesOffchainByProposalIdArgs = { - fromDate?: InputMaybe; + fromDate?: InputMaybe; id: Scalars['String']['input']; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; - voterAddresses?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; + voterAddresses?: InputMaybe>>; }; export type QueryVotingPowerByAccountIdArgs = { accountId: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryVotingPowerVariationsArgs = { - addresses?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + addresses?: InputMaybe>>; + fromDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; }; export type QueryVotingPowerVariationsByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; -}; -export type QueryVotingPowersArgs = { - addresses?: InputMaybe; - fromDate?: InputMaybe; - fromValue?: InputMaybe; - limit?: InputMaybe; - orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; - toValue?: InputMaybe; -}; -export type AccountBalanceByAccountId_200_Response = { - __typename?: 'accountBalanceByAccountId_200_response'; - data: Query_AccountBalanceByAccountId_Data; - period: Query_AccountBalanceByAccountId_Period; -}; -export type AccountBalanceVariationsByAccountId_200_Response = { - __typename?: 'accountBalanceVariationsByAccountId_200_response'; - data: Query_AccountBalanceVariationsByAccountId_Data; - period: Query_AccountBalanceVariationsByAccountId_Period; -}; -export type AccountBalanceVariations_200_Response = { - __typename?: 'accountBalanceVariations_200_response'; - items: Array>; - period: Query_AccountBalanceVariations_Period; -}; -export type AccountBalances_200_Response = { - __typename?: 'accountBalances_200_response'; - items: Array>; - period: Query_AccountBalances_Period; - totalCount: Scalars['Float']['output']; -}; -export type AccountInteractions_200_Response = { - __typename?: 'accountInteractions_200_response'; - items: Array>; - period: Query_AccountInteractions_Period; - totalCount: Scalars['Float']['output']; -}; -export type CompareActiveSupply_200_Response = { - __typename?: 'compareActiveSupply_200_response'; - activeSupply: Scalars['String']['output']; -}; -export type CompareAverageTurnout_200_Response = { - __typename?: 'compareAverageTurnout_200_response'; - changeRate: Scalars['Float']['output']; - currentAverageTurnout: Scalars['String']['output']; - oldAverageTurnout: Scalars['String']['output']; -}; -export type CompareCexSupply_200_Response = { - __typename?: 'compareCexSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentCexSupply: Scalars['String']['output']; - oldCexSupply: Scalars['String']['output']; -}; -export type CompareCirculatingSupply_200_Response = { - __typename?: 'compareCirculatingSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentCirculatingSupply: Scalars['String']['output']; - oldCirculatingSupply: Scalars['String']['output']; -}; -export type CompareDelegatedSupply_200_Response = { - __typename?: 'compareDelegatedSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentDelegatedSupply: Scalars['String']['output']; - oldDelegatedSupply: Scalars['String']['output']; -}; -export type CompareDexSupply_200_Response = { - __typename?: 'compareDexSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentDexSupply: Scalars['String']['output']; - oldDexSupply: Scalars['String']['output']; -}; -export type CompareLendingSupply_200_Response = { - __typename?: 'compareLendingSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentLendingSupply: Scalars['String']['output']; - oldLendingSupply: Scalars['String']['output']; -}; -export type CompareProposals_200_Response = { - __typename?: 'compareProposals_200_response'; - changeRate: Scalars['Float']['output']; - currentProposalsLaunched: Scalars['Float']['output']; - oldProposalsLaunched: Scalars['Float']['output']; -}; -export type CompareTotalSupply_200_Response = { - __typename?: 'compareTotalSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentTotalSupply: Scalars['String']['output']; - oldTotalSupply: Scalars['String']['output']; -}; -export type CompareTreasury_200_Response = { - __typename?: 'compareTreasury_200_response'; - changeRate: Scalars['Float']['output']; - currentTreasury: Scalars['String']['output']; - oldTreasury: Scalars['String']['output']; -}; -export type CompareVotes_200_Response = { - __typename?: 'compareVotes_200_response'; - changeRate: Scalars['Float']['output']; - currentVotes: Scalars['Float']['output']; - oldVotes: Scalars['Float']['output']; -}; -export type Dao_200_Response = { - __typename?: 'dao_200_response'; - alreadySupportCalldataReview: Scalars['Boolean']['output']; - chainId: Scalars['Float']['output']; - id: Scalars['String']['output']; - proposalThreshold: Scalars['String']['output']; - quorum: Scalars['String']['output']; - supportOffchainData: Scalars['Boolean']['output']; - timelockDelay: Scalars['String']['output']; - votingDelay: Scalars['String']['output']; - votingPeriod: Scalars['String']['output']; -}; -export type DelegationPercentageByDay_200_Response = { - __typename?: 'delegationPercentageByDay_200_response'; - items: Array>; - pageInfo: Query_DelegationPercentageByDay_PageInfo; - totalCount: Scalars['Float']['output']; -}; -export type Delegations_200_Response = { - __typename?: 'delegations_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type Delegators_200_Response = { - __typename?: 'delegators_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type FeedEvents_200_Response = { - __typename?: 'feedEvents_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type GetAddress_200_Response = { - __typename?: 'getAddress_200_response'; - address: Scalars['String']['output']; - arkham?: Maybe; - ens?: Maybe; - isContract: Scalars['Boolean']['output']; -}; -export type GetAddresses_200_Response = { - __typename?: 'getAddresses_200_response'; - results: Array>; -}; -export type GetDaoTokenTreasury_200_Response = { - __typename?: 'getDaoTokenTreasury_200_response'; - items: Array>; - /** Total number of items */ - totalCount: Scalars['Float']['output']; -}; -export type GetEventRelevanceThreshold_200_Response = { - __typename?: 'getEventRelevanceThreshold_200_response'; - threshold: Scalars['String']['output']; -}; -export type GetLiquidTreasury_200_Response = { - __typename?: 'getLiquidTreasury_200_response'; - items: Array>; - /** Total number of items */ - totalCount: Scalars['Float']['output']; -}; -export type GetTotalTreasury_200_Response = { - __typename?: 'getTotalTreasury_200_response'; - items: Array>; - /** Total number of items */ - totalCount: Scalars['Float']['output']; -}; -export type HistoricalBalances_200_Response = { - __typename?: 'historicalBalances_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type HistoricalDelegations_200_Response = { - __typename?: 'historicalDelegations_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type HistoricalVotingPowerByAccountId_200_Response = { - __typename?: 'historicalVotingPowerByAccountId_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type HistoricalVotingPower_200_Response = { - __typename?: 'historicalVotingPower_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type LastUpdate_200_Response = { - __typename?: 'lastUpdate_200_response'; - lastUpdate: Scalars['String']['output']; -}; -export type OffchainProposalById_200_Response = { - __typename?: 'offchainProposalById_200_response'; - author: Scalars['String']['output']; - body: Scalars['String']['output']; - created: Scalars['Float']['output']; - discussion: Scalars['String']['output']; - end: Scalars['Float']['output']; - flagged: Scalars['Boolean']['output']; - id: Scalars['String']['output']; - link: Scalars['String']['output']; - spaceId: Scalars['String']['output']; - start: Scalars['Float']['output']; - state: Scalars['String']['output']; - title: Scalars['String']['output']; - type: Scalars['String']['output']; - updated: Scalars['Float']['output']; -}; -export type OffchainProposals_200_Response = { - __typename?: 'offchainProposals_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type ProposalNonVoters_200_Response = { - __typename?: 'proposalNonVoters_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type Proposal_200_Response = { - __typename?: 'proposal_200_response'; - abstainVotes: Scalars['String']['output']; - againstVotes: Scalars['String']['output']; - calldatas: Array>; - daoId: Scalars['String']['output']; - description: Scalars['String']['output']; - endBlock: Scalars['Float']['output']; - endTimestamp: Scalars['String']['output']; - forVotes: Scalars['String']['output']; - id: Scalars['String']['output']; - proposalType?: Maybe; - proposerAccountId: Scalars['String']['output']; - quorum: Scalars['String']['output']; - startBlock: Scalars['Float']['output']; - startTimestamp: Scalars['String']['output']; - status: Scalars['String']['output']; - targets: Array>; - timestamp: Scalars['String']['output']; - title: Scalars['String']['output']; - txHash: Scalars['String']['output']; - values: Array>; -}; -export type ProposalsActivity_200_Response = { - __typename?: 'proposalsActivity_200_response'; - address: Scalars['String']['output']; - avgTimeBeforeEnd: Scalars['Float']['output']; - neverVoted: Scalars['Boolean']['output']; - proposals: Array>; - totalProposals: Scalars['Float']['output']; - votedProposals: Scalars['Float']['output']; - winRate: Scalars['Float']['output']; - yesRate: Scalars['Float']['output']; -}; -export type Proposals_200_Response = { - __typename?: 'proposals_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export declare enum QueryInput_AccountBalanceVariations_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_AccountBalances_OrderBy { - Balance = "balance", - SignedVariation = "signedVariation", - Variation = "variation" -} -export declare enum QueryInput_AccountBalances_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_AccountInteractions_OrderBy { - Count = "count", - Volume = "volume" -} -export declare enum QueryInput_AccountInteractions_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_CompareActiveSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareAverageTurnout_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareCexSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareCirculatingSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareDelegatedSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareDexSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareLendingSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareProposals_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareTotalSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareTreasury_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareVotes_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_DelegationPercentageByDay_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_Delegators_OrderBy { - Amount = "amount", - Timestamp = "timestamp" -} -export declare enum QueryInput_Delegators_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_FeedEvents_OrderBy { - Timestamp = "timestamp", - Value = "value" -} -export declare enum QueryInput_FeedEvents_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_FeedEvents_Relevance { - High = "HIGH", - Low = "LOW", - Medium = "MEDIUM" -} -export declare enum QueryInput_FeedEvents_Type { - Delegation = "DELEGATION", - Proposal = "PROPOSAL", - ProposalExtended = "PROPOSAL_EXTENDED", - Transfer = "TRANSFER", - Vote = "VOTE" -} -export declare enum QueryInput_GetDaoTokenTreasury_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_GetDaoTokenTreasury_Order { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_GetEventRelevanceThreshold_Relevance { - High = "HIGH", - Low = "LOW", - Medium = "MEDIUM" -} -export declare enum QueryInput_GetEventRelevanceThreshold_Type { - Delegation = "DELEGATION", - Proposal = "PROPOSAL", - ProposalExtended = "PROPOSAL_EXTENDED", - Transfer = "TRANSFER", - Vote = "VOTE" -} -export declare enum QueryInput_GetLiquidTreasury_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_GetLiquidTreasury_Order { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_GetTotalTreasury_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_GetTotalTreasury_Order { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_HistoricalBalances_OrderBy { - Delta = "delta", - Timestamp = "timestamp" -} -export declare enum QueryInput_HistoricalBalances_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_HistoricalDelegations_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_HistoricalVotingPowerByAccountId_OrderBy { - Delta = "delta", - Timestamp = "timestamp" -} -export declare enum QueryInput_HistoricalVotingPowerByAccountId_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_HistoricalVotingPower_OrderBy { - Delta = "delta", - Timestamp = "timestamp" -} -export declare enum QueryInput_HistoricalVotingPower_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_LastUpdate_Chart { - AttackProfitability = "attack_profitability", - CostComparison = "cost_comparison", - TokenDistribution = "token_distribution" -} -export declare enum QueryInput_OffchainProposals_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_ProposalNonVoters_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_ProposalsActivity_OrderBy { - Timestamp = "timestamp", - VoteTiming = "voteTiming", - VotingPower = "votingPower" -} -export declare enum QueryInput_ProposalsActivity_OrderDirection { - Asc = "asc", - Desc = "desc" -} -/** Filter proposals by vote type. Can be: 'yes' (For votes), 'no' (Against votes), 'abstain' (Abstain votes), 'no-vote' (Didn't vote) */ -export declare enum QueryInput_ProposalsActivity_UserVoteFilter { - Abstain = "abstain", - No = "no", - NoVote = "no_vote", - Yes = "yes" -} -export declare enum QueryInput_Proposals_IncludeOptimisticProposals { - False = "FALSE", - True = "TRUE" -} -export declare enum QueryInput_Proposals_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_TokenMetrics_MetricType { - CexSupply = "CEX_SUPPLY", - CirculatingSupply = "CIRCULATING_SUPPLY", - DelegatedSupply = "DELEGATED_SUPPLY", - DexSupply = "DEX_SUPPLY", - LendingSupply = "LENDING_SUPPLY", - TotalSupply = "TOTAL_SUPPLY", - Treasury = "TREASURY" -} -export declare enum QueryInput_TokenMetrics_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_Token_Currency { - Eth = "eth", - Usd = "usd" -} -export declare enum QueryInput_Transactions_SortOrder { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_Transfers_SortBy { - Amount = "amount", - Timestamp = "timestamp" -} -export declare enum QueryInput_Transfers_SortOrder { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_VotesByProposalId_OrderBy { - Timestamp = "timestamp", - VotingPower = "votingPower" -} -export declare enum QueryInput_VotesByProposalId_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_VotesOffchainByProposalId_OrderBy { - Timestamp = "timestamp", - VotingPower = "votingPower" -} -export declare enum QueryInput_VotesOffchainByProposalId_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_VotesOffchain_OrderBy { - Timestamp = "timestamp", - VotingPower = "votingPower" -} -export declare enum QueryInput_VotesOffchain_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_Votes_OrderBy { - Timestamp = "timestamp", - VotingPower = "votingPower" -} -export declare enum QueryInput_Votes_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_VotingPowerVariations_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_VotingPowers_OrderBy { - Balance = "balance", - DelegationsCount = "delegationsCount", - SignedVariation = "signedVariation", - Total = "total", - Variation = "variation", - VotingPower = "votingPower" -} -export declare enum QueryInput_VotingPowers_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export type Query_AccountBalanceByAccountId_Data = { - __typename?: 'query_accountBalanceByAccountId_data'; - address: Scalars['String']['output']; - balance: Scalars['String']['output']; - delegate: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - variation: Query_AccountBalanceByAccountId_Data_Variation; -}; -export type Query_AccountBalanceByAccountId_Data_Variation = { - __typename?: 'query_accountBalanceByAccountId_data_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; -}; -export type Query_AccountBalanceByAccountId_Period = { - __typename?: 'query_accountBalanceByAccountId_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; -export type Query_AccountBalanceVariationsByAccountId_Data = { - __typename?: 'query_accountBalanceVariationsByAccountId_data'; - absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentBalance: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; -}; -export type Query_AccountBalanceVariationsByAccountId_Period = { - __typename?: 'query_accountBalanceVariationsByAccountId_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; -export type Query_AccountBalanceVariations_Items_Items = { - __typename?: 'query_accountBalanceVariations_items_items'; - absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentBalance: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; -}; -export type Query_AccountBalanceVariations_Period = { - __typename?: 'query_accountBalanceVariations_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; -export type Query_AccountBalances_Items_Items = { - __typename?: 'query_accountBalances_items_items'; - address: Scalars['String']['output']; - balance: Scalars['String']['output']; - delegate: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - variation: Query_AccountBalances_Items_Items_Variation; -}; -export type Query_AccountBalances_Items_Items_Variation = { - __typename?: 'query_accountBalances_items_items_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; -}; -export type Query_AccountBalances_Period = { - __typename?: 'query_accountBalances_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; -export type Query_AccountInteractions_Items_Items = { - __typename?: 'query_accountInteractions_items_items'; - accountId: Scalars['String']['output']; - amountTransferred: Scalars['String']['output']; - totalVolume: Scalars['String']['output']; - transferCount: Scalars['String']['output']; -}; -export type Query_AccountInteractions_Period = { - __typename?: 'query_accountInteractions_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; -export type Query_DelegationPercentageByDay_Items_Items = { - __typename?: 'query_delegationPercentageByDay_items_items'; - date: Scalars['String']['output']; - high: Scalars['String']['output']; -}; -export type Query_DelegationPercentageByDay_PageInfo = { - __typename?: 'query_delegationPercentageByDay_pageInfo'; - endDate?: Maybe; - hasNextPage: Scalars['Boolean']['output']; - startDate?: Maybe; -}; -export type Query_Delegations_Items_Items = { - __typename?: 'query_delegations_items_items'; - amount: Scalars['String']['output']; - delegateAddress: Scalars['String']['output']; - delegatorAddress: Scalars['String']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; -export type Query_Delegators_Items_Items = { - __typename?: 'query_delegators_items_items'; - amount: Scalars['String']['output']; - delegatorAddress: Scalars['String']['output']; - timestamp: Scalars['String']['output']; -}; -export type Query_FeedEvents_Items_Items = { - __typename?: 'query_feedEvents_items_items'; - logIndex: Scalars['Float']['output']; - metadata?: Maybe; - relevance: Query_FeedEvents_Items_Items_Relevance; - timestamp: Scalars['Float']['output']; - txHash: Scalars['String']['output']; - type: Query_FeedEvents_Items_Items_Type; - value?: Maybe; -}; -export declare enum Query_FeedEvents_Items_Items_Relevance { - High = "HIGH", - Low = "LOW", - Medium = "MEDIUM" -} -export declare enum Query_FeedEvents_Items_Items_Type { - Delegation = "DELEGATION", - Proposal = "PROPOSAL", - ProposalExtended = "PROPOSAL_EXTENDED", - Transfer = "TRANSFER", - Vote = "VOTE" -} -export type Query_GetAddress_Arkham = { - __typename?: 'query_getAddress_arkham'; - entity?: Maybe; - entityType?: Maybe; - label?: Maybe; - twitter?: Maybe; -}; -export type Query_GetAddress_Ens = { - __typename?: 'query_getAddress_ens'; - avatar?: Maybe; - banner?: Maybe; - name?: Maybe; -}; -export type Query_GetAddresses_Results_Items = { - __typename?: 'query_getAddresses_results_items'; - address: Scalars['String']['output']; - arkham?: Maybe; - ens?: Maybe; - isContract: Scalars['Boolean']['output']; -}; -export type Query_GetAddresses_Results_Items_Arkham = { - __typename?: 'query_getAddresses_results_items_arkham'; - entity?: Maybe; - entityType?: Maybe; - label?: Maybe; - twitter?: Maybe; -}; -export type Query_GetAddresses_Results_Items_Ens = { - __typename?: 'query_getAddresses_results_items_ens'; - avatar?: Maybe; - banner?: Maybe; - name?: Maybe; -}; -export type Query_GetDaoTokenTreasury_Items_Items = { - __typename?: 'query_getDaoTokenTreasury_items_items'; - /** Unix timestamp in milliseconds */ - date: Scalars['Float']['output']; - /** Treasury value in USD */ - value: Scalars['Float']['output']; -}; -export type Query_GetLiquidTreasury_Items_Items = { - __typename?: 'query_getLiquidTreasury_items_items'; - /** Unix timestamp in milliseconds */ - date: Scalars['Float']['output']; - /** Treasury value in USD */ - value: Scalars['Float']['output']; -}; -export type Query_GetTotalTreasury_Items_Items = { - __typename?: 'query_getTotalTreasury_items_items'; - /** Unix timestamp in milliseconds */ - date: Scalars['Float']['output']; - /** Treasury value in USD */ - value: Scalars['Float']['output']; -}; -export type Query_HistoricalBalances_Items_Items = { - __typename?: 'query_historicalBalances_items_items'; - accountId: Scalars['String']['output']; - balance: Scalars['String']['output']; - daoId: Scalars['String']['output']; - delta: Scalars['String']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; - transfer: Query_HistoricalBalances_Items_Items_Transfer; -}; -export type Query_HistoricalBalances_Items_Items_Transfer = { - __typename?: 'query_historicalBalances_items_items_transfer'; - from: Scalars['String']['output']; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; -export type Query_HistoricalDelegations_Items_Items = { - __typename?: 'query_historicalDelegations_items_items'; - amount: Scalars['String']['output']; - delegateAddress: Scalars['String']['output']; - delegatorAddress: Scalars['String']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; -export type Query_HistoricalTokenData_Items = { - __typename?: 'query_historicalTokenData_items'; - price: Scalars['String']['output']; - timestamp: Scalars['Float']['output']; -}; -export type Query_HistoricalVotingPowerByAccountId_Items_Items = { - __typename?: 'query_historicalVotingPowerByAccountId_items_items'; - accountId: Scalars['String']['output']; - daoId: Scalars['String']['output']; - delegation?: Maybe; - delta: Scalars['String']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; - transfer?: Maybe; - votingPower: Scalars['String']['output']; -}; -export type Query_HistoricalVotingPowerByAccountId_Items_Items_Delegation = { - __typename?: 'query_historicalVotingPowerByAccountId_items_items_delegation'; - from: Scalars['String']['output']; - previousDelegate?: Maybe; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; -export type Query_HistoricalVotingPowerByAccountId_Items_Items_Transfer = { - __typename?: 'query_historicalVotingPowerByAccountId_items_items_transfer'; - from: Scalars['String']['output']; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; -export type Query_HistoricalVotingPower_Items_Items = { - __typename?: 'query_historicalVotingPower_items_items'; - accountId: Scalars['String']['output']; - daoId: Scalars['String']['output']; - delegation?: Maybe; - delta: Scalars['String']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; - transfer?: Maybe; - votingPower: Scalars['String']['output']; -}; -export type Query_HistoricalVotingPower_Items_Items_Delegation = { - __typename?: 'query_historicalVotingPower_items_items_delegation'; - from: Scalars['String']['output']; - previousDelegate?: Maybe; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; -export type Query_HistoricalVotingPower_Items_Items_Transfer = { - __typename?: 'query_historicalVotingPower_items_items_transfer'; - from: Scalars['String']['output']; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; -export type Query_OffchainProposals_Items_Items = { - __typename?: 'query_offchainProposals_items_items'; - author: Scalars['String']['output']; - body: Scalars['String']['output']; - created: Scalars['Float']['output']; - discussion: Scalars['String']['output']; - end: Scalars['Float']['output']; - flagged: Scalars['Boolean']['output']; - id: Scalars['String']['output']; - link: Scalars['String']['output']; - spaceId: Scalars['String']['output']; - start: Scalars['Float']['output']; - state: Scalars['String']['output']; - title: Scalars['String']['output']; - type: Scalars['String']['output']; - updated: Scalars['Float']['output']; -}; -export type Query_ProposalNonVoters_Items_Items = { - __typename?: 'query_proposalNonVoters_items_items'; - lastVoteTimestamp: Scalars['Float']['output']; - voter: Scalars['String']['output']; - votingPower: Scalars['String']['output']; - votingPowerVariation: Scalars['String']['output']; -}; -export type Query_ProposalsActivity_Proposals_Items = { - __typename?: 'query_proposalsActivity_proposals_items'; - proposal: Query_ProposalsActivity_Proposals_Items_Proposal; - userVote?: Maybe; -}; -export type Query_ProposalsActivity_Proposals_Items_Proposal = { - __typename?: 'query_proposalsActivity_proposals_items_proposal'; - abstainVotes: Scalars['String']['output']; - againstVotes: Scalars['String']['output']; - daoId: Scalars['String']['output']; - description: Scalars['String']['output']; - endBlock: Scalars['Float']['output']; - forVotes: Scalars['String']['output']; - id: Scalars['String']['output']; - proposerAccountId: Scalars['String']['output']; - startBlock: Scalars['Float']['output']; - status: Scalars['String']['output']; - timestamp?: Maybe; - title: Scalars['String']['output']; -}; -export type Query_ProposalsActivity_Proposals_Items_UserVote = { - __typename?: 'query_proposalsActivity_proposals_items_userVote'; - id: Scalars['String']['output']; - proposalId: Scalars['String']['output']; - reason?: Maybe; - support?: Maybe; - timestamp?: Maybe; - voterAccountId: Scalars['String']['output']; - votingPower: Scalars['String']['output']; -}; -export type Query_Proposals_Items_Items = { - __typename?: 'query_proposals_items_items'; - abstainVotes: Scalars['String']['output']; - againstVotes: Scalars['String']['output']; - calldatas: Array>; - daoId: Scalars['String']['output']; - description: Scalars['String']['output']; - endBlock: Scalars['Float']['output']; - endTimestamp: Scalars['String']['output']; - forVotes: Scalars['String']['output']; - id: Scalars['String']['output']; - proposalType?: Maybe; - proposerAccountId: Scalars['String']['output']; - quorum: Scalars['String']['output']; - startBlock: Scalars['Float']['output']; - startTimestamp: Scalars['String']['output']; - status: Scalars['String']['output']; - targets: Array>; - timestamp: Scalars['String']['output']; - title: Scalars['String']['output']; - txHash: Scalars['String']['output']; - values: Array>; + fromDate?: InputMaybe; + toDate?: InputMaybe; +}; +export type QueryVotingPowersArgs = { + addresses?: InputMaybe>>; + fromDate?: InputMaybe; + fromValue?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; + toValue?: InputMaybe; +}; +/** Supply metric comparison between current and previous periods. */ +export type SupplyComparisonResponse = { + __typename?: 'SupplyComparisonResponse'; + changeRate: Scalars['Float']['output']; + currentValue: Scalars['String']['output']; + previousValue: Scalars['String']['output']; +}; +export type TokenHistoricalPriceItem = { + __typename?: 'TokenHistoricalPriceItem'; + /** Historical price value as a decimal string. */ + price: Scalars['String']['output']; + /** Unix timestamp in seconds. */ + timestamp: Scalars['Int']['output']; }; -export type Query_TokenMetrics_Items_Items = { - __typename?: 'query_tokenMetrics_items_items'; +export type TokenMetricItem = { + __typename?: 'TokenMetricItem'; + /** Unix day bucket represented as a timestamp string. */ date: Scalars['String']['output']; + /** Highest observed value for the period. */ high: Scalars['String']['output']; + /** Total volume observed for the period. */ volume: Scalars['String']['output']; }; -export type Query_TokenMetrics_PageInfo = { - __typename?: 'query_tokenMetrics_pageInfo'; - endDate?: Maybe; - hasNextPage: Scalars['Boolean']['output']; - startDate?: Maybe; +export type TokenMetricsResponse = { + __typename?: 'TokenMetricsResponse'; + items: Array>; + pageInfo: PageInfo; +}; +/** Token properties enriched with the current token price. */ +export type TokenPropertiesResponse = { + __typename?: 'TokenPropertiesResponse'; + cexSupply: Scalars['String']['output']; + circulatingSupply: Scalars['String']['output']; + /** Token decimals. */ + decimals: Scalars['Int']['output']; + delegatedSupply: Scalars['String']['output']; + dexSupply: Scalars['String']['output']; + id: Scalars['String']['output']; + lendingSupply: Scalars['String']['output']; + name?: Maybe; + nonCirculatingSupply: Scalars['String']['output']; + price: Scalars['String']['output']; + totalSupply: Scalars['String']['output']; + treasury: Scalars['String']['output']; }; -export type Query_Transactions_Items_Items = { - __typename?: 'query_transactions_items_items'; - delegations: Array>; +/** Transaction response enriched with transfer and delegation events. */ +export type Transaction = { + __typename?: 'Transaction'; + delegations: Array>; + /** Resolved sender address, if known. */ from?: Maybe; + /** Whether the transaction touched a centralized exchange. */ isCex: Scalars['Boolean']['output']; + /** Whether the transaction touched a decentralized exchange. */ isDex: Scalars['Boolean']['output']; + /** Whether the transaction touched a lending protocol. */ isLending: Scalars['Boolean']['output']; + /** Whether the transaction counts toward total tracked supply. */ isTotal: Scalars['Boolean']['output']; + /** Transaction timestamp in Unix seconds as a string. */ timestamp: Scalars['String']['output']; + /** Resolved recipient address, if known. */ to?: Maybe; + /** Transaction hash. */ transactionHash: Scalars['String']['output']; - transfers: Array>; + transfers: Array>; }; -export type Query_Transactions_Items_Items_Delegations_Items = { - __typename?: 'query_transactions_items_items_delegations_items'; +/** Delegation event embedded within a transaction response. */ +export type TransactionDelegation = { + __typename?: 'TransactionDelegation'; + /** DAO identifier. */ daoId: Scalars['String']['output']; + /** Delegate address. */ delegateAccountId: Scalars['String']['output']; + /** Delegated amount encoded as a decimal string. */ delegatedValue: Scalars['String']['output']; + /** Delegator address. */ delegatorAccountId: Scalars['String']['output']; + /** Whether the delegation touched a centralized exchange. */ isCex: Scalars['Boolean']['output']; + /** Whether the delegation touched a decentralized exchange. */ isDex: Scalars['Boolean']['output']; + /** Whether the delegation touched a lending protocol. */ isLending: Scalars['Boolean']['output']; + /** Whether the delegation counts toward total tracked supply. */ isTotal: Scalars['Boolean']['output']; - logIndex: Scalars['Float']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Previous delegate address, if one existed. */ previousDelegate?: Maybe; + /** Delegation timestamp in Unix seconds as a string. */ timestamp: Scalars['String']['output']; + /** Transaction hash. */ transactionHash: Scalars['String']['output']; }; -export type Query_Transactions_Items_Items_Transfers_Items = { - __typename?: 'query_transactions_items_items_transfers_items'; - amount: Scalars['String']['output']; - daoId: Scalars['String']['output']; - fromAccountId: Scalars['String']['output']; - isCex: Scalars['Boolean']['output']; - isDex: Scalars['Boolean']['output']; - isLending: Scalars['Boolean']['output']; - isTotal: Scalars['Boolean']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - toAccountId: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; +/** Paginated transactions with embedded transfer and delegation data. */ +export type TransactionsResponse = { + __typename?: 'TransactionsResponse'; + items: Array>; + /** Total number of matching transactions. */ + totalCount: Scalars['Int']['output']; }; -export type Query_Transfers_Items_Items = { - __typename?: 'query_transfers_items_items'; +export type Transfer = { + __typename?: 'Transfer'; + /** Transferred amount encoded as a decimal string. */ amount: Scalars['String']['output']; + /** DAO identifier. */ daoId: Scalars['String']['output']; + /** Sender address. */ fromAccountId: Scalars['String']['output']; + /** Whether the transfer touched a centralized exchange. */ isCex: Scalars['Boolean']['output']; + /** Whether the transfer touched a decentralized exchange. */ isDex: Scalars['Boolean']['output']; + /** Whether the transfer touched a lending protocol. */ isLending: Scalars['Boolean']['output']; + /** Whether the transfer counts toward total tracked supply. */ isTotal: Scalars['Boolean']['output']; - logIndex: Scalars['Float']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Transfer timestamp in Unix seconds as a string. */ timestamp: Scalars['String']['output']; + /** Recipient address. */ toAccountId: Scalars['String']['output']; + /** Token contract address. */ tokenId: Scalars['String']['output']; + /** Transaction hash. */ transactionHash: Scalars['String']['output']; }; -export type Query_VotesByProposalId_Items_Items = { - __typename?: 'query_votesByProposalId_items_items'; - proposalId: Scalars['String']['output']; - proposalTitle?: Maybe; - reason?: Maybe; - support?: Maybe; - timestamp: Scalars['Int']['output']; - transactionHash: Scalars['String']['output']; - voterAddress: Scalars['String']['output']; - votingPower: Scalars['String']['output']; +export type TransfersResponse = { + __typename?: 'TransfersResponse'; + items: Array>; + /** Total number of matching transfers. */ + totalCount: Scalars['Int']['output']; }; -export type Query_VotesOffchainByProposalId_Items_Items = { - __typename?: 'query_votesOffchainByProposalId_items_items'; - choice?: Maybe; - created: Scalars['Float']['output']; - proposalId: Scalars['String']['output']; - proposalTitle: Scalars['String']['output']; - reason: Scalars['String']['output']; - voter: Scalars['String']['output']; - vp?: Maybe; +/** Single treasury time-series datapoint. */ +export type TreasuryItem = { + __typename?: 'TreasuryItem'; + /** Unix timestamp in milliseconds */ + date: Scalars['Float']['output']; + /** Treasury value in USD */ + value: Scalars['Float']['output']; }; -export type Query_VotesOffchain_Items_Items = { - __typename?: 'query_votesOffchain_items_items'; - choice?: Maybe; - created: Scalars['Float']['output']; - proposalId: Scalars['String']['output']; - proposalTitle: Scalars['String']['output']; - reason: Scalars['String']['output']; - voter: Scalars['String']['output']; - vp?: Maybe; +/** Paginated treasury time-series response. */ +export type TreasuryResponse = { + __typename?: 'TreasuryResponse'; + items: Array>; + /** Total number of items */ + totalCount: Scalars['Int']['output']; }; -export type Query_Votes_Items_Items = { - __typename?: 'query_votes_items_items'; - proposalId: Scalars['String']['output']; - proposalTitle?: Maybe; - reason?: Maybe; - support?: Maybe; - timestamp: Scalars['Int']['output']; - transactionHash: Scalars['String']['output']; - voterAddress: Scalars['String']['output']; +/** Voter or non-voter record associated with a proposal. */ +export type Voter = { + __typename?: 'Voter'; + lastVoteTimestamp: Scalars['Float']['output']; + voter: Scalars['String']['output']; votingPower: Scalars['String']['output']; + votingPowerVariation: Scalars['String']['output']; }; -export type Query_VotingPowerByAccountId_Variation = { - __typename?: 'query_votingPowerByAccountId_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; +/** Paginated voter or non-voter records for a proposal. */ +export type VotersResponse = { + __typename?: 'VotersResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +/** Vote-count comparison between two adjacent time windows. */ +export type VotesComparisonResponse = { + __typename?: 'VotesComparisonResponse'; + /** Relative change between current and previous periods. */ + changeRate: Scalars['Float']['output']; + /** Number of votes cast in the current period. */ + currentVotes: Scalars['Int']['output']; + /** Number of votes cast in the comparison period. */ + oldVotes: Scalars['Int']['output']; +}; +/** Current voting power snapshot for one account. */ +export type VotingPower = { + __typename?: 'VotingPower'; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Current token balance encoded as a decimal string. */ + balance?: Maybe; + /** Total delegations associated with the account. */ + delegationsCount: Scalars['Int']['output']; + /** Total proposals created by the account. */ + proposalsCount: Scalars['Int']['output']; + variation: VotingPowerVariationField; + /** Total votes cast by the account. */ + votesCount: Scalars['Int']['output']; + /** Current voting power encoded as a decimal string. */ + votingPower: Scalars['String']['output']; }; -export type Query_VotingPowerVariationsByAccountId_Data = { - __typename?: 'query_votingPowerVariationsByAccountId_data'; +/** Voting power delta for a single account across two timestamps. */ +export type VotingPowerVariation = { + __typename?: 'VotingPowerVariation'; + /** Absolute voting power change encoded as a decimal string. */ absoluteChange: Scalars['String']['output']; + /** Account address. */ accountId: Scalars['String']['output']; + /** Voting power at the end of the comparison window. */ currentVotingPower: Scalars['String']['output']; + /** Relative voting power change encoded as a decimal string. */ percentageChange: Scalars['String']['output']; + /** Voting power at the start of the comparison window. */ previousVotingPower: Scalars['String']['output']; }; -export type Query_VotingPowerVariationsByAccountId_Period = { - __typename?: 'query_votingPowerVariationsByAccountId_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; -export type Query_VotingPowerVariations_Items_Items = { - __typename?: 'query_votingPowerVariations_items_items'; +/** Embedded voting power delta metadata for a current voting power row. */ +export type VotingPowerVariationField = { + __typename?: 'VotingPowerVariationField'; absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentVotingPower: Scalars['String']['output']; percentageChange: Scalars['String']['output']; - previousVotingPower: Scalars['String']['output']; }; -export type Query_VotingPowerVariations_Period = { - __typename?: 'query_votingPowerVariations_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; +/** Voting power variation response for a single account. */ +export type VotingPowerVariationsByAccountIdResponse = { + __typename?: 'VotingPowerVariationsByAccountIdResponse'; + data: VotingPowerVariation; + period: PeriodResponse; +}; +/** List of voting power variations for multiple accounts in the selected period. */ +export type VotingPowerVariationsResponse = { + __typename?: 'VotingPowerVariationsResponse'; + items: Array>; + period: PeriodResponse; +}; +/** Paginated current voting power records. */ +export type VotingPowersResponse = { + __typename?: 'VotingPowersResponse'; + items: Array>; + /** Total number of matching voting power rows. */ + totalCount: Scalars['Int']['output']; }; -export type Query_VotingPowers_Items_Items = { - __typename?: 'query_votingPowers_items_items'; - accountId: Scalars['String']['output']; - balance?: Maybe; - delegationsCount: Scalars['Float']['output']; - proposalsCount: Scalars['Float']['output']; - variation: Query_VotingPowers_Items_Items_Variation; - votesCount: Scalars['Float']['output']; - votingPower: Scalars['String']['output']; +export type GetAddress_200_Response = { + __typename?: 'getAddress_200_response'; + /** EIP-55 checksummed Ethereum address */ + address: Scalars['String']['output']; + arkham?: Maybe; + ens?: Maybe; + /** Whether the address is a smart contract (true) or an externally-owned account (false) */ + isContract: Scalars['Boolean']['output']; }; -export type Query_VotingPowers_Items_Items_Variation = { - __typename?: 'query_votingPowers_items_items_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; +export type GetAddresses_200_Response = { + __typename?: 'getAddresses_200_response'; + /** Enrichment results for each successfully resolved address. Addresses that failed to resolve are omitted. */ + results: Array>; }; -export declare enum Timestamp_Const { +export type OffchainProposalById_Response = ErrorResponse | OffchainProposal; +export type Proposal_Response = ErrorResponse | OnchainProposal; +export declare enum QueryInput_AccountBalances_OrderBy { + Balance = "balance", + SignedVariation = "signedVariation", + Variation = "variation" +} +/** Field used to sort interaction rows. */ +export declare enum QueryInput_AccountInteractions_OrderBy { + Count = "count", + Volume = "volume" +} +export declare enum QueryInput_Delegators_OrderBy { + Amount = "amount", + Timestamp = "timestamp" +} +/** Field used to sort feed events. */ +export declare enum QueryInput_FeedEvents_OrderBy { + Timestamp = "timestamp", + Value = "value" +} +/** Filter events by relevance tier. */ +export declare enum QueryInput_FeedEvents_Relevance { + High = "HIGH", + Low = "LOW", + Medium = "MEDIUM" +} +/** Filter events by governance activity type. */ +export declare enum QueryInput_FeedEvents_Type { + Delegation = "DELEGATION", + Proposal = "PROPOSAL", + ProposalExtended = "PROPOSAL_EXTENDED", + Transfer = "TRANSFER", + Vote = "VOTE" +} +/** Field used to sort historical balance rows. */ +export declare enum QueryInput_HistoricalBalances_OrderBy { + Delta = "delta", + Timestamp = "timestamp" +} +/** Field used to sort historical voting power rows. */ +export declare enum QueryInput_HistoricalVotingPowerByAccountId_OrderBy { + Delta = "delta", + Timestamp = "timestamp" +} +/** Field used to sort historical voting power rows. */ +export declare enum QueryInput_HistoricalVotingPower_OrderBy { + Delta = "delta", + Timestamp = "timestamp" +} +/** Chart identifier whose freshness timestamp should be returned. */ +export declare enum QueryInput_LastUpdate_Chart { + AttackProfitability = "attack_profitability", + CostComparison = "cost_comparison", + TokenDistribution = "token_distribution" +} +export declare enum QueryInput_OffchainProposals_Status_Items { + Active = "active", + Closed = "closed", + Pending = "pending" +} +/** Field used to sort proposal activity results. */ +export declare enum QueryInput_ProposalsActivity_OrderBy { + Timestamp = "timestamp", + VoteTiming = "voteTiming", + VotingPower = "votingPower" +} +/** Optional vote filter. Use yes, no, abstain, or no-vote to narrow the result set. */ +export declare enum QueryInput_ProposalsActivity_UserVoteFilter { + Abstain = "abstain", + No = "no", + NoVote = "no_vote", + Yes = "yes" +} +export declare enum QueryInput_Proposals_Status_Items { + Active = "ACTIVE", + Canceled = "CANCELED", + Defeated = "DEFEATED", + Executed = "EXECUTED", + Expired = "EXPIRED", + NoQuorum = "NO_QUORUM", + Pending = "PENDING", + PendingExecution = "PENDING_EXECUTION", + Queued = "QUEUED", + Succeeded = "SUCCEEDED", + Vetoed = "VETOED" +} +/** Metric family to query. */ +export declare enum QueryInput_TokenMetrics_MetricType { + CexSupply = "CEX_SUPPLY", + CirculatingSupply = "CIRCULATING_SUPPLY", + DelegatedSupply = "DELEGATED_SUPPLY", + DexSupply = "DEX_SUPPLY", + LendingSupply = "LENDING_SUPPLY", + TotalSupply = "TOTAL_SUPPLY", + Treasury = "TREASURY" +} +/** Currency to use when fetching token price data. */ +export declare enum QueryInput_Token_Currency { + Eth = "eth", + Usd = "usd" +} +export declare enum QueryInput_Transactions_AffectedSupply_Items { + Cex = "CEX", + Dex = "DEX", + Lending = "LENDING", + Total = "TOTAL", + Unassigned = "UNASSIGNED" +} +export declare enum QueryInput_Transactions_Includes_Items { + Delegation = "DELEGATION", + Transfer = "TRANSFER" +} +/** Field used to sort transfers. */ +export declare enum QueryInput_Transfers_OrderBy { + Amount = "amount", Timestamp = "timestamp" } -export type TokenMetrics_200_Response = { - __typename?: 'tokenMetrics_200_response'; - items: Array>; - pageInfo: Query_TokenMetrics_PageInfo; +/** Sort votes by timestamp or voting power. */ +export declare enum QueryInput_VotesByProposalId_OrderBy { + Timestamp = "timestamp", + VotingPower = "votingPower" +} +/** Sort votes by timestamp or voting power. */ +export declare enum QueryInput_VotesOffchainByProposalId_OrderBy { + Timestamp = "timestamp", + VotingPower = "votingPower" +} +/** Sort votes by timestamp or voting power. */ +export declare enum QueryInput_VotesOffchain_OrderBy { + Timestamp = "timestamp", + VotingPower = "votingPower" +} +/** Sort votes by timestamp or voting power. */ +export declare enum QueryInput_Votes_OrderBy { + Timestamp = "timestamp", + VotingPower = "votingPower" +} +export declare enum QueryInput_VotingPowers_OrderBy { + Balance = "balance", + DelegationsCount = "delegationsCount", + SignedVariation = "signedVariation", + Total = "total", + Variation = "variation", + VotingPower = "votingPower" +} +/** Arkham Intelligence label data. null when no data is available for the address. */ +export type Query_GetAddress_Arkham = { + __typename?: 'query_getAddress_arkham'; + /** Human-readable name of the entity that owns the address according to Arkham Intelligence */ + entity?: Maybe; + /** Category of the entity (e.g. 'individual', 'exchange', 'protocol', 'fund') */ + entityType?: Maybe; + /** Fine-grained label for the specific address within the entity */ + label?: Maybe; + /** Twitter/X handle associated with the entity, without '@' */ + twitter?: Maybe; }; -export type Token_200_Response = { - __typename?: 'token_200_response'; - cexSupply: Scalars['String']['output']; - circulatingSupply: Scalars['String']['output']; - decimals: Scalars['Float']['output']; - delegatedSupply: Scalars['String']['output']; - dexSupply: Scalars['String']['output']; - id: Scalars['String']['output']; - lendingSupply: Scalars['String']['output']; +/** ENS (Ethereum Name Service) data. null when no ENS name is registered for the address. Cached with a configurable TTL. */ +export type Query_GetAddress_Ens = { + __typename?: 'query_getAddress_ens'; + /** URL of the ENS avatar image */ + avatar?: Maybe; + /** URL of the ENS profile banner image */ + banner?: Maybe; + /** Primary ENS name reverse-resolved for this address */ name?: Maybe; - nonCirculatingSupply: Scalars['String']['output']; - price: Scalars['String']['output']; - totalSupply: Scalars['String']['output']; - treasury: Scalars['String']['output']; }; -export type Transactions_200_Response = { - __typename?: 'transactions_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type Transfers_200_Response = { - __typename?: 'transfers_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type VotesByProposalId_200_Response = { - __typename?: 'votesByProposalId_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type VotesOffchainByProposalId_200_Response = { - __typename?: 'votesOffchainByProposalId_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type VotesOffchain_200_Response = { - __typename?: 'votesOffchain_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type Votes_200_Response = { - __typename?: 'votes_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type VotingPowerByAccountId_200_Response = { - __typename?: 'votingPowerByAccountId_200_response'; - accountId: Scalars['String']['output']; - balance?: Maybe; - delegationsCount: Scalars['Float']['output']; - proposalsCount: Scalars['Float']['output']; - variation: Query_VotingPowerByAccountId_Variation; - votesCount: Scalars['Float']['output']; - votingPower: Scalars['String']['output']; +export type Query_GetAddresses_Results_Items = { + __typename?: 'query_getAddresses_results_items'; + /** EIP-55 checksummed Ethereum address */ + address: Scalars['String']['output']; + arkham?: Maybe; + ens?: Maybe; + /** Whether the address is a smart contract (true) or an externally-owned account (false) */ + isContract: Scalars['Boolean']['output']; }; -export type VotingPowerVariationsByAccountId_200_Response = { - __typename?: 'votingPowerVariationsByAccountId_200_response'; - data: Query_VotingPowerVariationsByAccountId_Data; - period: Query_VotingPowerVariationsByAccountId_Period; +/** Arkham Intelligence label data. null when no data is available for the address. */ +export type Query_GetAddresses_Results_Items_Arkham = { + __typename?: 'query_getAddresses_results_items_arkham'; + /** Human-readable name of the entity that owns the address according to Arkham Intelligence */ + entity?: Maybe; + /** Category of the entity (e.g. 'individual', 'exchange', 'protocol', 'fund') */ + entityType?: Maybe; + /** Fine-grained label for the specific address within the entity */ + label?: Maybe; + /** Twitter/X handle associated with the entity, without '@' */ + twitter?: Maybe; }; -export type VotingPowerVariations_200_Response = { - __typename?: 'votingPowerVariations_200_response'; - items: Array>; - period: Query_VotingPowerVariations_Period; +/** ENS (Ethereum Name Service) data. null when no ENS name is registered for the address. Cached with a configurable TTL. */ +export type Query_GetAddresses_Results_Items_Ens = { + __typename?: 'query_getAddresses_results_items_ens'; + /** URL of the ENS avatar image */ + avatar?: Maybe; + /** URL of the ENS profile banner image */ + banner?: Maybe; + /** Primary ENS name reverse-resolved for this address */ + name?: Maybe; }; -export type VotingPowers_200_Response = { - __typename?: 'votingPowers_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; +export type Query_OffchainProposals_Items_Items_Strategies_Items = { + __typename?: 'query_offchainProposals_items_items_strategies_items'; + name: Scalars['String']['output']; + network: Scalars['String']['output']; + params: Scalars['JSON']['output']; }; +export type Token_Response = ErrorResponse | TokenPropertiesResponse; export type GetDaOsQueryVariables = Exact<{ [key: string]: never; }>; @@ -1687,7 +1494,7 @@ export type GetDaOsQuery = { daos: { __typename?: 'DAOList'; items: Array<{ - __typename?: 'dao_200_response'; + __typename?: 'DaoResponse'; id: string; votingDelay: string; chainId: number; @@ -1697,20 +1504,20 @@ export type GetDaOsQuery = { }; }; export type ListOffchainProposalsQueryVariables = Exact<{ - skip?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - status?: InputMaybe; - fromDate?: InputMaybe; - endDate?: InputMaybe; + skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + status?: InputMaybe> | InputMaybe>; + fromDate?: InputMaybe; + endDate?: InputMaybe; }>; export type ListOffchainProposalsQuery = { __typename?: 'Query'; offchainProposals?: { - __typename?: 'offchainProposals_200_response'; + __typename?: 'OffchainProposalsResponse'; totalCount: number; items: Array<{ - __typename?: 'query_offchainProposals_items_items'; + __typename?: 'OffchainProposal'; id: string; title: string; discussion: string; @@ -1722,25 +1529,25 @@ export type ListOffchainProposalsQuery = { } | null; }; export type ListOffchainVotesQueryVariables = Exact<{ - fromDate?: InputMaybe; - toDate?: InputMaybe; - limit?: InputMaybe; - skip?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - voterAddresses?: InputMaybe; + orderDirection?: InputMaybe; + voterAddresses?: InputMaybe> | InputMaybe>; }>; export type ListOffchainVotesQuery = { __typename?: 'Query'; votesOffchain?: { - __typename?: 'votesOffchain_200_response'; + __typename?: 'OffchainVotesResponse'; totalCount: number; items: Array<{ - __typename?: 'query_votesOffchain_items_items'; + __typename?: 'OffchainVote'; voter: string; created: number; proposalId: string; - proposalTitle: string; + proposalTitle?: string | null; reason: string; vp?: number | null; } | null>; @@ -1748,14 +1555,14 @@ export type ListOffchainVotesQuery = { }; export type ProposalNonVotersQueryVariables = Exact<{ id: Scalars['String']['input']; - addresses?: InputMaybe; + addresses?: InputMaybe> | InputMaybe>; }>; export type ProposalNonVotersQuery = { __typename?: 'Query'; proposalNonVoters?: { - __typename?: 'proposalNonVoters_200_response'; + __typename?: 'VotersResponse'; items: Array<{ - __typename?: 'query_proposalNonVoters_items_items'; + __typename?: 'Voter'; voter: string; } | null>; } | null; @@ -1766,7 +1573,9 @@ export type GetProposalByIdQueryVariables = Exact<{ export type GetProposalByIdQuery = { __typename?: 'Query'; proposal?: { - __typename?: 'proposal_200_response'; + __typename?: 'ErrorResponse'; + } | { + __typename?: 'OnchainProposal'; id: string; daoId: string; proposerAccountId: string; @@ -1774,8 +1583,8 @@ export type GetProposalByIdQuery = { description: string; startBlock: number; endBlock: number; - endTimestamp: string; - timestamp: string; + endTimestamp: number; + timestamp: number; status: string; forVotes: string; againstVotes: string; @@ -1784,21 +1593,21 @@ export type GetProposalByIdQuery = { } | null; }; export type ListProposalsQueryVariables = Exact<{ - skip?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - status?: InputMaybe; - fromDate?: InputMaybe; - fromEndDate?: InputMaybe; - includeOptimisticProposals?: InputMaybe; + skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + status?: InputMaybe> | InputMaybe>; + fromDate?: InputMaybe; + fromEndDate?: InputMaybe; + includeOptimisticProposals?: InputMaybe; }>; export type ListProposalsQuery = { __typename?: 'Query'; proposals?: { - __typename?: 'proposals_200_response'; + __typename?: 'OnchainProposalsResponse'; totalCount: number; items: Array<{ - __typename?: 'query_proposals_items_items'; + __typename?: 'OnchainProposal'; id: string; daoId: string; proposerAccountId: string; @@ -1806,8 +1615,8 @@ export type ListProposalsQuery = { description: string; startBlock: number; endBlock: number; - endTimestamp: string; - timestamp: string; + endTimestamp: number; + timestamp: number; status: string; forVotes: string; againstVotes: string; @@ -1817,37 +1626,37 @@ export type ListProposalsQuery = { } | null; }; export type GetEventRelevanceThresholdQueryVariables = Exact<{ - relevance: QueryInput_GetEventRelevanceThreshold_Relevance; - type: QueryInput_GetEventRelevanceThreshold_Type; + relevance: FeedRelevance; + type: FeedEventType; }>; export type GetEventRelevanceThresholdQuery = { __typename?: 'Query'; getEventRelevanceThreshold?: { - __typename?: 'getEventRelevanceThreshold_200_response'; + __typename?: 'EventRelevanceThresholdResponse'; threshold: string; } | null; }; export type ListVotesQueryVariables = Exact<{ - voterAddressIn?: InputMaybe; - fromDate?: InputMaybe; - toDate?: InputMaybe; - limit?: InputMaybe; - skip?: InputMaybe; + voterAddressIn?: InputMaybe> | InputMaybe>; + fromDate?: InputMaybe; + toDate?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - support?: InputMaybe; + orderDirection?: InputMaybe; + support?: InputMaybe; }>; export type ListVotesQuery = { __typename?: 'Query'; votes?: { - __typename?: 'votes_200_response'; + __typename?: 'OnchainVotesResponse'; totalCount: number; items: Array<{ - __typename?: 'query_votes_items_items'; + __typename?: 'OnchainVote'; transactionHash: string; proposalId: string; voterAddress: string; - support?: number | null; + support?: string | null; votingPower: string; timestamp: number; reason?: string | null; @@ -1856,20 +1665,20 @@ export type ListVotesQuery = { } | null; }; export type ListHistoricalVotingPowerQueryVariables = Exact<{ - limit?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - fromDate?: InputMaybe; + orderDirection?: InputMaybe; + fromDate?: InputMaybe; address?: InputMaybe; }>; export type ListHistoricalVotingPowerQuery = { __typename?: 'Query'; historicalVotingPower?: { - __typename?: 'historicalVotingPower_200_response'; + __typename?: 'HistoricalVotingPowersResponse'; totalCount: number; items: Array<{ - __typename?: 'query_historicalVotingPower_items_items'; + __typename?: 'HistoricalVotingPower'; accountId: string; timestamp: string; votingPower: string; @@ -1878,14 +1687,14 @@ export type ListHistoricalVotingPowerQuery = { transactionHash: string; logIndex: number; delegation?: { - __typename?: 'query_historicalVotingPower_items_items_delegation'; + __typename?: 'HistoricalVotingPowerDelegation'; from: string; to: string; value: string; previousDelegate?: string | null; } | null; transfer?: { - __typename?: 'query_historicalVotingPower_items_items_transfer'; + __typename?: 'HistoricalVotingPowerTransfer'; from: string; to: string; value: string; diff --git a/packages/anticapture-client/dist/gql/graphql.js b/packages/anticapture-client/dist/gql/graphql.js index 71c30fdb..bb4fdeb2 100644 --- a/packages/anticapture-client/dist/gql/graphql.js +++ b/packages/anticapture-client/dist/gql/graphql.js @@ -1,7 +1,30 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.QueryInput_Token_Currency = exports.QueryInput_TokenMetrics_OrderDirection = exports.QueryInput_TokenMetrics_MetricType = exports.QueryInput_Proposals_OrderDirection = exports.QueryInput_Proposals_IncludeOptimisticProposals = exports.QueryInput_ProposalsActivity_UserVoteFilter = exports.QueryInput_ProposalsActivity_OrderDirection = exports.QueryInput_ProposalsActivity_OrderBy = exports.QueryInput_ProposalNonVoters_OrderDirection = exports.QueryInput_OffchainProposals_OrderDirection = exports.QueryInput_LastUpdate_Chart = exports.QueryInput_HistoricalVotingPower_OrderDirection = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.QueryInput_HistoricalVotingPowerByAccountId_OrderDirection = exports.QueryInput_HistoricalVotingPowerByAccountId_OrderBy = exports.QueryInput_HistoricalDelegations_OrderDirection = exports.QueryInput_HistoricalBalances_OrderDirection = exports.QueryInput_HistoricalBalances_OrderBy = exports.QueryInput_GetTotalTreasury_Order = exports.QueryInput_GetTotalTreasury_Days = exports.QueryInput_GetLiquidTreasury_Order = exports.QueryInput_GetLiquidTreasury_Days = exports.QueryInput_GetEventRelevanceThreshold_Type = exports.QueryInput_GetEventRelevanceThreshold_Relevance = exports.QueryInput_GetDaoTokenTreasury_Order = exports.QueryInput_GetDaoTokenTreasury_Days = exports.QueryInput_FeedEvents_Type = exports.QueryInput_FeedEvents_Relevance = exports.QueryInput_FeedEvents_OrderDirection = exports.QueryInput_FeedEvents_OrderBy = exports.QueryInput_Delegators_OrderDirection = exports.QueryInput_Delegators_OrderBy = exports.QueryInput_DelegationPercentageByDay_OrderDirection = exports.QueryInput_CompareVotes_Days = exports.QueryInput_CompareTreasury_Days = exports.QueryInput_CompareTotalSupply_Days = exports.QueryInput_CompareProposals_Days = exports.QueryInput_CompareLendingSupply_Days = exports.QueryInput_CompareDexSupply_Days = exports.QueryInput_CompareDelegatedSupply_Days = exports.QueryInput_CompareCirculatingSupply_Days = exports.QueryInput_CompareCexSupply_Days = exports.QueryInput_CompareAverageTurnout_Days = exports.QueryInput_CompareActiveSupply_Days = exports.QueryInput_AccountInteractions_OrderDirection = exports.QueryInput_AccountInteractions_OrderBy = exports.QueryInput_AccountBalances_OrderDirection = exports.QueryInput_AccountBalances_OrderBy = exports.QueryInput_AccountBalanceVariations_OrderDirection = exports.HttpMethod = void 0; -exports.ListHistoricalVotingPowerDocument = exports.ListVotesDocument = exports.GetEventRelevanceThresholdDocument = exports.ListProposalsDocument = exports.GetProposalByIdDocument = exports.ProposalNonVotersDocument = exports.ListOffchainVotesDocument = exports.ListOffchainProposalsDocument = exports.GetDaOsDocument = exports.Timestamp_Const = exports.Query_FeedEvents_Items_Items_Type = exports.Query_FeedEvents_Items_Items_Relevance = exports.QueryInput_VotingPowers_OrderDirection = exports.QueryInput_VotingPowers_OrderBy = exports.QueryInput_VotingPowerVariations_OrderDirection = exports.QueryInput_Votes_OrderDirection = exports.QueryInput_Votes_OrderBy = exports.QueryInput_VotesOffchain_OrderDirection = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_VotesOffchainByProposalId_OrderDirection = exports.QueryInput_VotesOffchainByProposalId_OrderBy = exports.QueryInput_VotesByProposalId_OrderDirection = exports.QueryInput_VotesByProposalId_OrderBy = exports.QueryInput_Transfers_SortOrder = exports.QueryInput_Transfers_SortBy = exports.QueryInput_Transactions_SortOrder = void 0; +exports.ListHistoricalVotingPowerDocument = exports.ListVotesDocument = exports.GetEventRelevanceThresholdDocument = exports.ListProposalsDocument = exports.GetProposalByIdDocument = exports.ProposalNonVotersDocument = exports.ListOffchainVotesDocument = exports.ListOffchainProposalsDocument = exports.GetDaOsDocument = exports.QueryInput_VotingPowers_OrderBy = exports.QueryInput_Votes_OrderBy = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_VotesOffchainByProposalId_OrderBy = exports.QueryInput_VotesByProposalId_OrderBy = exports.QueryInput_Transfers_OrderBy = exports.QueryInput_Transactions_Includes_Items = exports.QueryInput_Transactions_AffectedSupply_Items = exports.QueryInput_Token_Currency = exports.QueryInput_TokenMetrics_MetricType = exports.QueryInput_Proposals_Status_Items = exports.QueryInput_ProposalsActivity_UserVoteFilter = exports.QueryInput_ProposalsActivity_OrderBy = exports.QueryInput_OffchainProposals_Status_Items = exports.QueryInput_LastUpdate_Chart = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.QueryInput_HistoricalVotingPowerByAccountId_OrderBy = exports.QueryInput_HistoricalBalances_OrderBy = exports.QueryInput_FeedEvents_Type = exports.QueryInput_FeedEvents_Relevance = exports.QueryInput_FeedEvents_OrderBy = exports.QueryInput_Delegators_OrderBy = exports.QueryInput_AccountInteractions_OrderBy = exports.QueryInput_AccountBalances_OrderBy = exports.OrderDirection = exports.HttpMethod = exports.FeedRelevance = exports.FeedEventType = exports.DaysWindow = void 0; +var DaysWindow; +(function (DaysWindow) { + DaysWindow["7d"] = "_7d"; + DaysWindow["30d"] = "_30d"; + DaysWindow["90d"] = "_90d"; + DaysWindow["180d"] = "_180d"; + DaysWindow["365d"] = "_365d"; +})(DaysWindow || (exports.DaysWindow = DaysWindow = {})); +/** Filter events by governance activity type. */ +var FeedEventType; +(function (FeedEventType) { + FeedEventType["Delegation"] = "DELEGATION"; + FeedEventType["Proposal"] = "PROPOSAL"; + FeedEventType["ProposalExtended"] = "PROPOSAL_EXTENDED"; + FeedEventType["Transfer"] = "TRANSFER"; + FeedEventType["Vote"] = "VOTE"; +})(FeedEventType || (exports.FeedEventType = FeedEventType = {})); +/** Filter events by relevance tier. */ +var FeedRelevance; +(function (FeedRelevance) { + FeedRelevance["High"] = "HIGH"; + FeedRelevance["Low"] = "LOW"; + FeedRelevance["Medium"] = "MEDIUM"; +})(FeedRelevance || (exports.FeedRelevance = FeedRelevance = {})); var HttpMethod; (function (HttpMethod) { HttpMethod["Connect"] = "CONNECT"; @@ -14,151 +37,43 @@ var HttpMethod; HttpMethod["Put"] = "PUT"; HttpMethod["Trace"] = "TRACE"; })(HttpMethod || (exports.HttpMethod = HttpMethod = {})); -var QueryInput_AccountBalanceVariations_OrderDirection; -(function (QueryInput_AccountBalanceVariations_OrderDirection) { - QueryInput_AccountBalanceVariations_OrderDirection["Asc"] = "asc"; - QueryInput_AccountBalanceVariations_OrderDirection["Desc"] = "desc"; -})(QueryInput_AccountBalanceVariations_OrderDirection || (exports.QueryInput_AccountBalanceVariations_OrderDirection = QueryInput_AccountBalanceVariations_OrderDirection = {})); +/** Sort direction for ordered query results. */ +var OrderDirection; +(function (OrderDirection) { + OrderDirection["Asc"] = "asc"; + OrderDirection["Desc"] = "desc"; +})(OrderDirection || (exports.OrderDirection = OrderDirection = {})); var QueryInput_AccountBalances_OrderBy; (function (QueryInput_AccountBalances_OrderBy) { QueryInput_AccountBalances_OrderBy["Balance"] = "balance"; QueryInput_AccountBalances_OrderBy["SignedVariation"] = "signedVariation"; QueryInput_AccountBalances_OrderBy["Variation"] = "variation"; })(QueryInput_AccountBalances_OrderBy || (exports.QueryInput_AccountBalances_OrderBy = QueryInput_AccountBalances_OrderBy = {})); -var QueryInput_AccountBalances_OrderDirection; -(function (QueryInput_AccountBalances_OrderDirection) { - QueryInput_AccountBalances_OrderDirection["Asc"] = "asc"; - QueryInput_AccountBalances_OrderDirection["Desc"] = "desc"; -})(QueryInput_AccountBalances_OrderDirection || (exports.QueryInput_AccountBalances_OrderDirection = QueryInput_AccountBalances_OrderDirection = {})); +/** Field used to sort interaction rows. */ var QueryInput_AccountInteractions_OrderBy; (function (QueryInput_AccountInteractions_OrderBy) { QueryInput_AccountInteractions_OrderBy["Count"] = "count"; QueryInput_AccountInteractions_OrderBy["Volume"] = "volume"; })(QueryInput_AccountInteractions_OrderBy || (exports.QueryInput_AccountInteractions_OrderBy = QueryInput_AccountInteractions_OrderBy = {})); -var QueryInput_AccountInteractions_OrderDirection; -(function (QueryInput_AccountInteractions_OrderDirection) { - QueryInput_AccountInteractions_OrderDirection["Asc"] = "asc"; - QueryInput_AccountInteractions_OrderDirection["Desc"] = "desc"; -})(QueryInput_AccountInteractions_OrderDirection || (exports.QueryInput_AccountInteractions_OrderDirection = QueryInput_AccountInteractions_OrderDirection = {})); -var QueryInput_CompareActiveSupply_Days; -(function (QueryInput_CompareActiveSupply_Days) { - QueryInput_CompareActiveSupply_Days["7d"] = "_7d"; - QueryInput_CompareActiveSupply_Days["30d"] = "_30d"; - QueryInput_CompareActiveSupply_Days["90d"] = "_90d"; - QueryInput_CompareActiveSupply_Days["180d"] = "_180d"; - QueryInput_CompareActiveSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareActiveSupply_Days || (exports.QueryInput_CompareActiveSupply_Days = QueryInput_CompareActiveSupply_Days = {})); -var QueryInput_CompareAverageTurnout_Days; -(function (QueryInput_CompareAverageTurnout_Days) { - QueryInput_CompareAverageTurnout_Days["7d"] = "_7d"; - QueryInput_CompareAverageTurnout_Days["30d"] = "_30d"; - QueryInput_CompareAverageTurnout_Days["90d"] = "_90d"; - QueryInput_CompareAverageTurnout_Days["180d"] = "_180d"; - QueryInput_CompareAverageTurnout_Days["365d"] = "_365d"; -})(QueryInput_CompareAverageTurnout_Days || (exports.QueryInput_CompareAverageTurnout_Days = QueryInput_CompareAverageTurnout_Days = {})); -var QueryInput_CompareCexSupply_Days; -(function (QueryInput_CompareCexSupply_Days) { - QueryInput_CompareCexSupply_Days["7d"] = "_7d"; - QueryInput_CompareCexSupply_Days["30d"] = "_30d"; - QueryInput_CompareCexSupply_Days["90d"] = "_90d"; - QueryInput_CompareCexSupply_Days["180d"] = "_180d"; - QueryInput_CompareCexSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareCexSupply_Days || (exports.QueryInput_CompareCexSupply_Days = QueryInput_CompareCexSupply_Days = {})); -var QueryInput_CompareCirculatingSupply_Days; -(function (QueryInput_CompareCirculatingSupply_Days) { - QueryInput_CompareCirculatingSupply_Days["7d"] = "_7d"; - QueryInput_CompareCirculatingSupply_Days["30d"] = "_30d"; - QueryInput_CompareCirculatingSupply_Days["90d"] = "_90d"; - QueryInput_CompareCirculatingSupply_Days["180d"] = "_180d"; - QueryInput_CompareCirculatingSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareCirculatingSupply_Days || (exports.QueryInput_CompareCirculatingSupply_Days = QueryInput_CompareCirculatingSupply_Days = {})); -var QueryInput_CompareDelegatedSupply_Days; -(function (QueryInput_CompareDelegatedSupply_Days) { - QueryInput_CompareDelegatedSupply_Days["7d"] = "_7d"; - QueryInput_CompareDelegatedSupply_Days["30d"] = "_30d"; - QueryInput_CompareDelegatedSupply_Days["90d"] = "_90d"; - QueryInput_CompareDelegatedSupply_Days["180d"] = "_180d"; - QueryInput_CompareDelegatedSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareDelegatedSupply_Days || (exports.QueryInput_CompareDelegatedSupply_Days = QueryInput_CompareDelegatedSupply_Days = {})); -var QueryInput_CompareDexSupply_Days; -(function (QueryInput_CompareDexSupply_Days) { - QueryInput_CompareDexSupply_Days["7d"] = "_7d"; - QueryInput_CompareDexSupply_Days["30d"] = "_30d"; - QueryInput_CompareDexSupply_Days["90d"] = "_90d"; - QueryInput_CompareDexSupply_Days["180d"] = "_180d"; - QueryInput_CompareDexSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareDexSupply_Days || (exports.QueryInput_CompareDexSupply_Days = QueryInput_CompareDexSupply_Days = {})); -var QueryInput_CompareLendingSupply_Days; -(function (QueryInput_CompareLendingSupply_Days) { - QueryInput_CompareLendingSupply_Days["7d"] = "_7d"; - QueryInput_CompareLendingSupply_Days["30d"] = "_30d"; - QueryInput_CompareLendingSupply_Days["90d"] = "_90d"; - QueryInput_CompareLendingSupply_Days["180d"] = "_180d"; - QueryInput_CompareLendingSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareLendingSupply_Days || (exports.QueryInput_CompareLendingSupply_Days = QueryInput_CompareLendingSupply_Days = {})); -var QueryInput_CompareProposals_Days; -(function (QueryInput_CompareProposals_Days) { - QueryInput_CompareProposals_Days["7d"] = "_7d"; - QueryInput_CompareProposals_Days["30d"] = "_30d"; - QueryInput_CompareProposals_Days["90d"] = "_90d"; - QueryInput_CompareProposals_Days["180d"] = "_180d"; - QueryInput_CompareProposals_Days["365d"] = "_365d"; -})(QueryInput_CompareProposals_Days || (exports.QueryInput_CompareProposals_Days = QueryInput_CompareProposals_Days = {})); -var QueryInput_CompareTotalSupply_Days; -(function (QueryInput_CompareTotalSupply_Days) { - QueryInput_CompareTotalSupply_Days["7d"] = "_7d"; - QueryInput_CompareTotalSupply_Days["30d"] = "_30d"; - QueryInput_CompareTotalSupply_Days["90d"] = "_90d"; - QueryInput_CompareTotalSupply_Days["180d"] = "_180d"; - QueryInput_CompareTotalSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareTotalSupply_Days || (exports.QueryInput_CompareTotalSupply_Days = QueryInput_CompareTotalSupply_Days = {})); -var QueryInput_CompareTreasury_Days; -(function (QueryInput_CompareTreasury_Days) { - QueryInput_CompareTreasury_Days["7d"] = "_7d"; - QueryInput_CompareTreasury_Days["30d"] = "_30d"; - QueryInput_CompareTreasury_Days["90d"] = "_90d"; - QueryInput_CompareTreasury_Days["180d"] = "_180d"; - QueryInput_CompareTreasury_Days["365d"] = "_365d"; -})(QueryInput_CompareTreasury_Days || (exports.QueryInput_CompareTreasury_Days = QueryInput_CompareTreasury_Days = {})); -var QueryInput_CompareVotes_Days; -(function (QueryInput_CompareVotes_Days) { - QueryInput_CompareVotes_Days["7d"] = "_7d"; - QueryInput_CompareVotes_Days["30d"] = "_30d"; - QueryInput_CompareVotes_Days["90d"] = "_90d"; - QueryInput_CompareVotes_Days["180d"] = "_180d"; - QueryInput_CompareVotes_Days["365d"] = "_365d"; -})(QueryInput_CompareVotes_Days || (exports.QueryInput_CompareVotes_Days = QueryInput_CompareVotes_Days = {})); -var QueryInput_DelegationPercentageByDay_OrderDirection; -(function (QueryInput_DelegationPercentageByDay_OrderDirection) { - QueryInput_DelegationPercentageByDay_OrderDirection["Asc"] = "asc"; - QueryInput_DelegationPercentageByDay_OrderDirection["Desc"] = "desc"; -})(QueryInput_DelegationPercentageByDay_OrderDirection || (exports.QueryInput_DelegationPercentageByDay_OrderDirection = QueryInput_DelegationPercentageByDay_OrderDirection = {})); var QueryInput_Delegators_OrderBy; (function (QueryInput_Delegators_OrderBy) { QueryInput_Delegators_OrderBy["Amount"] = "amount"; QueryInput_Delegators_OrderBy["Timestamp"] = "timestamp"; })(QueryInput_Delegators_OrderBy || (exports.QueryInput_Delegators_OrderBy = QueryInput_Delegators_OrderBy = {})); -var QueryInput_Delegators_OrderDirection; -(function (QueryInput_Delegators_OrderDirection) { - QueryInput_Delegators_OrderDirection["Asc"] = "asc"; - QueryInput_Delegators_OrderDirection["Desc"] = "desc"; -})(QueryInput_Delegators_OrderDirection || (exports.QueryInput_Delegators_OrderDirection = QueryInput_Delegators_OrderDirection = {})); +/** Field used to sort feed events. */ var QueryInput_FeedEvents_OrderBy; (function (QueryInput_FeedEvents_OrderBy) { QueryInput_FeedEvents_OrderBy["Timestamp"] = "timestamp"; QueryInput_FeedEvents_OrderBy["Value"] = "value"; })(QueryInput_FeedEvents_OrderBy || (exports.QueryInput_FeedEvents_OrderBy = QueryInput_FeedEvents_OrderBy = {})); -var QueryInput_FeedEvents_OrderDirection; -(function (QueryInput_FeedEvents_OrderDirection) { - QueryInput_FeedEvents_OrderDirection["Asc"] = "asc"; - QueryInput_FeedEvents_OrderDirection["Desc"] = "desc"; -})(QueryInput_FeedEvents_OrderDirection || (exports.QueryInput_FeedEvents_OrderDirection = QueryInput_FeedEvents_OrderDirection = {})); +/** Filter events by relevance tier. */ var QueryInput_FeedEvents_Relevance; (function (QueryInput_FeedEvents_Relevance) { QueryInput_FeedEvents_Relevance["High"] = "HIGH"; QueryInput_FeedEvents_Relevance["Low"] = "LOW"; QueryInput_FeedEvents_Relevance["Medium"] = "MEDIUM"; })(QueryInput_FeedEvents_Relevance || (exports.QueryInput_FeedEvents_Relevance = QueryInput_FeedEvents_Relevance = {})); +/** Filter events by governance activity type. */ var QueryInput_FeedEvents_Type; (function (QueryInput_FeedEvents_Type) { QueryInput_FeedEvents_Type["Delegation"] = "DELEGATION"; @@ -167,122 +82,45 @@ var QueryInput_FeedEvents_Type; QueryInput_FeedEvents_Type["Transfer"] = "TRANSFER"; QueryInput_FeedEvents_Type["Vote"] = "VOTE"; })(QueryInput_FeedEvents_Type || (exports.QueryInput_FeedEvents_Type = QueryInput_FeedEvents_Type = {})); -var QueryInput_GetDaoTokenTreasury_Days; -(function (QueryInput_GetDaoTokenTreasury_Days) { - QueryInput_GetDaoTokenTreasury_Days["7d"] = "_7d"; - QueryInput_GetDaoTokenTreasury_Days["30d"] = "_30d"; - QueryInput_GetDaoTokenTreasury_Days["90d"] = "_90d"; - QueryInput_GetDaoTokenTreasury_Days["180d"] = "_180d"; - QueryInput_GetDaoTokenTreasury_Days["365d"] = "_365d"; -})(QueryInput_GetDaoTokenTreasury_Days || (exports.QueryInput_GetDaoTokenTreasury_Days = QueryInput_GetDaoTokenTreasury_Days = {})); -var QueryInput_GetDaoTokenTreasury_Order; -(function (QueryInput_GetDaoTokenTreasury_Order) { - QueryInput_GetDaoTokenTreasury_Order["Asc"] = "asc"; - QueryInput_GetDaoTokenTreasury_Order["Desc"] = "desc"; -})(QueryInput_GetDaoTokenTreasury_Order || (exports.QueryInput_GetDaoTokenTreasury_Order = QueryInput_GetDaoTokenTreasury_Order = {})); -var QueryInput_GetEventRelevanceThreshold_Relevance; -(function (QueryInput_GetEventRelevanceThreshold_Relevance) { - QueryInput_GetEventRelevanceThreshold_Relevance["High"] = "HIGH"; - QueryInput_GetEventRelevanceThreshold_Relevance["Low"] = "LOW"; - QueryInput_GetEventRelevanceThreshold_Relevance["Medium"] = "MEDIUM"; -})(QueryInput_GetEventRelevanceThreshold_Relevance || (exports.QueryInput_GetEventRelevanceThreshold_Relevance = QueryInput_GetEventRelevanceThreshold_Relevance = {})); -var QueryInput_GetEventRelevanceThreshold_Type; -(function (QueryInput_GetEventRelevanceThreshold_Type) { - QueryInput_GetEventRelevanceThreshold_Type["Delegation"] = "DELEGATION"; - QueryInput_GetEventRelevanceThreshold_Type["Proposal"] = "PROPOSAL"; - QueryInput_GetEventRelevanceThreshold_Type["ProposalExtended"] = "PROPOSAL_EXTENDED"; - QueryInput_GetEventRelevanceThreshold_Type["Transfer"] = "TRANSFER"; - QueryInput_GetEventRelevanceThreshold_Type["Vote"] = "VOTE"; -})(QueryInput_GetEventRelevanceThreshold_Type || (exports.QueryInput_GetEventRelevanceThreshold_Type = QueryInput_GetEventRelevanceThreshold_Type = {})); -var QueryInput_GetLiquidTreasury_Days; -(function (QueryInput_GetLiquidTreasury_Days) { - QueryInput_GetLiquidTreasury_Days["7d"] = "_7d"; - QueryInput_GetLiquidTreasury_Days["30d"] = "_30d"; - QueryInput_GetLiquidTreasury_Days["90d"] = "_90d"; - QueryInput_GetLiquidTreasury_Days["180d"] = "_180d"; - QueryInput_GetLiquidTreasury_Days["365d"] = "_365d"; -})(QueryInput_GetLiquidTreasury_Days || (exports.QueryInput_GetLiquidTreasury_Days = QueryInput_GetLiquidTreasury_Days = {})); -var QueryInput_GetLiquidTreasury_Order; -(function (QueryInput_GetLiquidTreasury_Order) { - QueryInput_GetLiquidTreasury_Order["Asc"] = "asc"; - QueryInput_GetLiquidTreasury_Order["Desc"] = "desc"; -})(QueryInput_GetLiquidTreasury_Order || (exports.QueryInput_GetLiquidTreasury_Order = QueryInput_GetLiquidTreasury_Order = {})); -var QueryInput_GetTotalTreasury_Days; -(function (QueryInput_GetTotalTreasury_Days) { - QueryInput_GetTotalTreasury_Days["7d"] = "_7d"; - QueryInput_GetTotalTreasury_Days["30d"] = "_30d"; - QueryInput_GetTotalTreasury_Days["90d"] = "_90d"; - QueryInput_GetTotalTreasury_Days["180d"] = "_180d"; - QueryInput_GetTotalTreasury_Days["365d"] = "_365d"; -})(QueryInput_GetTotalTreasury_Days || (exports.QueryInput_GetTotalTreasury_Days = QueryInput_GetTotalTreasury_Days = {})); -var QueryInput_GetTotalTreasury_Order; -(function (QueryInput_GetTotalTreasury_Order) { - QueryInput_GetTotalTreasury_Order["Asc"] = "asc"; - QueryInput_GetTotalTreasury_Order["Desc"] = "desc"; -})(QueryInput_GetTotalTreasury_Order || (exports.QueryInput_GetTotalTreasury_Order = QueryInput_GetTotalTreasury_Order = {})); +/** Field used to sort historical balance rows. */ var QueryInput_HistoricalBalances_OrderBy; (function (QueryInput_HistoricalBalances_OrderBy) { QueryInput_HistoricalBalances_OrderBy["Delta"] = "delta"; QueryInput_HistoricalBalances_OrderBy["Timestamp"] = "timestamp"; })(QueryInput_HistoricalBalances_OrderBy || (exports.QueryInput_HistoricalBalances_OrderBy = QueryInput_HistoricalBalances_OrderBy = {})); -var QueryInput_HistoricalBalances_OrderDirection; -(function (QueryInput_HistoricalBalances_OrderDirection) { - QueryInput_HistoricalBalances_OrderDirection["Asc"] = "asc"; - QueryInput_HistoricalBalances_OrderDirection["Desc"] = "desc"; -})(QueryInput_HistoricalBalances_OrderDirection || (exports.QueryInput_HistoricalBalances_OrderDirection = QueryInput_HistoricalBalances_OrderDirection = {})); -var QueryInput_HistoricalDelegations_OrderDirection; -(function (QueryInput_HistoricalDelegations_OrderDirection) { - QueryInput_HistoricalDelegations_OrderDirection["Asc"] = "asc"; - QueryInput_HistoricalDelegations_OrderDirection["Desc"] = "desc"; -})(QueryInput_HistoricalDelegations_OrderDirection || (exports.QueryInput_HistoricalDelegations_OrderDirection = QueryInput_HistoricalDelegations_OrderDirection = {})); +/** Field used to sort historical voting power rows. */ var QueryInput_HistoricalVotingPowerByAccountId_OrderBy; (function (QueryInput_HistoricalVotingPowerByAccountId_OrderBy) { QueryInput_HistoricalVotingPowerByAccountId_OrderBy["Delta"] = "delta"; QueryInput_HistoricalVotingPowerByAccountId_OrderBy["Timestamp"] = "timestamp"; })(QueryInput_HistoricalVotingPowerByAccountId_OrderBy || (exports.QueryInput_HistoricalVotingPowerByAccountId_OrderBy = QueryInput_HistoricalVotingPowerByAccountId_OrderBy = {})); -var QueryInput_HistoricalVotingPowerByAccountId_OrderDirection; -(function (QueryInput_HistoricalVotingPowerByAccountId_OrderDirection) { - QueryInput_HistoricalVotingPowerByAccountId_OrderDirection["Asc"] = "asc"; - QueryInput_HistoricalVotingPowerByAccountId_OrderDirection["Desc"] = "desc"; -})(QueryInput_HistoricalVotingPowerByAccountId_OrderDirection || (exports.QueryInput_HistoricalVotingPowerByAccountId_OrderDirection = QueryInput_HistoricalVotingPowerByAccountId_OrderDirection = {})); +/** Field used to sort historical voting power rows. */ var QueryInput_HistoricalVotingPower_OrderBy; (function (QueryInput_HistoricalVotingPower_OrderBy) { QueryInput_HistoricalVotingPower_OrderBy["Delta"] = "delta"; QueryInput_HistoricalVotingPower_OrderBy["Timestamp"] = "timestamp"; })(QueryInput_HistoricalVotingPower_OrderBy || (exports.QueryInput_HistoricalVotingPower_OrderBy = QueryInput_HistoricalVotingPower_OrderBy = {})); -var QueryInput_HistoricalVotingPower_OrderDirection; -(function (QueryInput_HistoricalVotingPower_OrderDirection) { - QueryInput_HistoricalVotingPower_OrderDirection["Asc"] = "asc"; - QueryInput_HistoricalVotingPower_OrderDirection["Desc"] = "desc"; -})(QueryInput_HistoricalVotingPower_OrderDirection || (exports.QueryInput_HistoricalVotingPower_OrderDirection = QueryInput_HistoricalVotingPower_OrderDirection = {})); +/** Chart identifier whose freshness timestamp should be returned. */ var QueryInput_LastUpdate_Chart; (function (QueryInput_LastUpdate_Chart) { QueryInput_LastUpdate_Chart["AttackProfitability"] = "attack_profitability"; QueryInput_LastUpdate_Chart["CostComparison"] = "cost_comparison"; QueryInput_LastUpdate_Chart["TokenDistribution"] = "token_distribution"; })(QueryInput_LastUpdate_Chart || (exports.QueryInput_LastUpdate_Chart = QueryInput_LastUpdate_Chart = {})); -var QueryInput_OffchainProposals_OrderDirection; -(function (QueryInput_OffchainProposals_OrderDirection) { - QueryInput_OffchainProposals_OrderDirection["Asc"] = "asc"; - QueryInput_OffchainProposals_OrderDirection["Desc"] = "desc"; -})(QueryInput_OffchainProposals_OrderDirection || (exports.QueryInput_OffchainProposals_OrderDirection = QueryInput_OffchainProposals_OrderDirection = {})); -var QueryInput_ProposalNonVoters_OrderDirection; -(function (QueryInput_ProposalNonVoters_OrderDirection) { - QueryInput_ProposalNonVoters_OrderDirection["Asc"] = "asc"; - QueryInput_ProposalNonVoters_OrderDirection["Desc"] = "desc"; -})(QueryInput_ProposalNonVoters_OrderDirection || (exports.QueryInput_ProposalNonVoters_OrderDirection = QueryInput_ProposalNonVoters_OrderDirection = {})); +var QueryInput_OffchainProposals_Status_Items; +(function (QueryInput_OffchainProposals_Status_Items) { + QueryInput_OffchainProposals_Status_Items["Active"] = "active"; + QueryInput_OffchainProposals_Status_Items["Closed"] = "closed"; + QueryInput_OffchainProposals_Status_Items["Pending"] = "pending"; +})(QueryInput_OffchainProposals_Status_Items || (exports.QueryInput_OffchainProposals_Status_Items = QueryInput_OffchainProposals_Status_Items = {})); +/** Field used to sort proposal activity results. */ var QueryInput_ProposalsActivity_OrderBy; (function (QueryInput_ProposalsActivity_OrderBy) { QueryInput_ProposalsActivity_OrderBy["Timestamp"] = "timestamp"; QueryInput_ProposalsActivity_OrderBy["VoteTiming"] = "voteTiming"; QueryInput_ProposalsActivity_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_ProposalsActivity_OrderBy || (exports.QueryInput_ProposalsActivity_OrderBy = QueryInput_ProposalsActivity_OrderBy = {})); -var QueryInput_ProposalsActivity_OrderDirection; -(function (QueryInput_ProposalsActivity_OrderDirection) { - QueryInput_ProposalsActivity_OrderDirection["Asc"] = "asc"; - QueryInput_ProposalsActivity_OrderDirection["Desc"] = "desc"; -})(QueryInput_ProposalsActivity_OrderDirection || (exports.QueryInput_ProposalsActivity_OrderDirection = QueryInput_ProposalsActivity_OrderDirection = {})); -/** Filter proposals by vote type. Can be: 'yes' (For votes), 'no' (Against votes), 'abstain' (Abstain votes), 'no-vote' (Didn't vote) */ +/** Optional vote filter. Use yes, no, abstain, or no-vote to narrow the result set. */ var QueryInput_ProposalsActivity_UserVoteFilter; (function (QueryInput_ProposalsActivity_UserVoteFilter) { QueryInput_ProposalsActivity_UserVoteFilter["Abstain"] = "abstain"; @@ -290,16 +128,21 @@ var QueryInput_ProposalsActivity_UserVoteFilter; QueryInput_ProposalsActivity_UserVoteFilter["NoVote"] = "no_vote"; QueryInput_ProposalsActivity_UserVoteFilter["Yes"] = "yes"; })(QueryInput_ProposalsActivity_UserVoteFilter || (exports.QueryInput_ProposalsActivity_UserVoteFilter = QueryInput_ProposalsActivity_UserVoteFilter = {})); -var QueryInput_Proposals_IncludeOptimisticProposals; -(function (QueryInput_Proposals_IncludeOptimisticProposals) { - QueryInput_Proposals_IncludeOptimisticProposals["False"] = "FALSE"; - QueryInput_Proposals_IncludeOptimisticProposals["True"] = "TRUE"; -})(QueryInput_Proposals_IncludeOptimisticProposals || (exports.QueryInput_Proposals_IncludeOptimisticProposals = QueryInput_Proposals_IncludeOptimisticProposals = {})); -var QueryInput_Proposals_OrderDirection; -(function (QueryInput_Proposals_OrderDirection) { - QueryInput_Proposals_OrderDirection["Asc"] = "asc"; - QueryInput_Proposals_OrderDirection["Desc"] = "desc"; -})(QueryInput_Proposals_OrderDirection || (exports.QueryInput_Proposals_OrderDirection = QueryInput_Proposals_OrderDirection = {})); +var QueryInput_Proposals_Status_Items; +(function (QueryInput_Proposals_Status_Items) { + QueryInput_Proposals_Status_Items["Active"] = "ACTIVE"; + QueryInput_Proposals_Status_Items["Canceled"] = "CANCELED"; + QueryInput_Proposals_Status_Items["Defeated"] = "DEFEATED"; + QueryInput_Proposals_Status_Items["Executed"] = "EXECUTED"; + QueryInput_Proposals_Status_Items["Expired"] = "EXPIRED"; + QueryInput_Proposals_Status_Items["NoQuorum"] = "NO_QUORUM"; + QueryInput_Proposals_Status_Items["Pending"] = "PENDING"; + QueryInput_Proposals_Status_Items["PendingExecution"] = "PENDING_EXECUTION"; + QueryInput_Proposals_Status_Items["Queued"] = "QUEUED"; + QueryInput_Proposals_Status_Items["Succeeded"] = "SUCCEEDED"; + QueryInput_Proposals_Status_Items["Vetoed"] = "VETOED"; +})(QueryInput_Proposals_Status_Items || (exports.QueryInput_Proposals_Status_Items = QueryInput_Proposals_Status_Items = {})); +/** Metric family to query. */ var QueryInput_TokenMetrics_MetricType; (function (QueryInput_TokenMetrics_MetricType) { QueryInput_TokenMetrics_MetricType["CexSupply"] = "CEX_SUPPLY"; @@ -310,76 +153,55 @@ var QueryInput_TokenMetrics_MetricType; QueryInput_TokenMetrics_MetricType["TotalSupply"] = "TOTAL_SUPPLY"; QueryInput_TokenMetrics_MetricType["Treasury"] = "TREASURY"; })(QueryInput_TokenMetrics_MetricType || (exports.QueryInput_TokenMetrics_MetricType = QueryInput_TokenMetrics_MetricType = {})); -var QueryInput_TokenMetrics_OrderDirection; -(function (QueryInput_TokenMetrics_OrderDirection) { - QueryInput_TokenMetrics_OrderDirection["Asc"] = "asc"; - QueryInput_TokenMetrics_OrderDirection["Desc"] = "desc"; -})(QueryInput_TokenMetrics_OrderDirection || (exports.QueryInput_TokenMetrics_OrderDirection = QueryInput_TokenMetrics_OrderDirection = {})); +/** Currency to use when fetching token price data. */ var QueryInput_Token_Currency; (function (QueryInput_Token_Currency) { QueryInput_Token_Currency["Eth"] = "eth"; QueryInput_Token_Currency["Usd"] = "usd"; })(QueryInput_Token_Currency || (exports.QueryInput_Token_Currency = QueryInput_Token_Currency = {})); -var QueryInput_Transactions_SortOrder; -(function (QueryInput_Transactions_SortOrder) { - QueryInput_Transactions_SortOrder["Asc"] = "asc"; - QueryInput_Transactions_SortOrder["Desc"] = "desc"; -})(QueryInput_Transactions_SortOrder || (exports.QueryInput_Transactions_SortOrder = QueryInput_Transactions_SortOrder = {})); -var QueryInput_Transfers_SortBy; -(function (QueryInput_Transfers_SortBy) { - QueryInput_Transfers_SortBy["Amount"] = "amount"; - QueryInput_Transfers_SortBy["Timestamp"] = "timestamp"; -})(QueryInput_Transfers_SortBy || (exports.QueryInput_Transfers_SortBy = QueryInput_Transfers_SortBy = {})); -var QueryInput_Transfers_SortOrder; -(function (QueryInput_Transfers_SortOrder) { - QueryInput_Transfers_SortOrder["Asc"] = "asc"; - QueryInput_Transfers_SortOrder["Desc"] = "desc"; -})(QueryInput_Transfers_SortOrder || (exports.QueryInput_Transfers_SortOrder = QueryInput_Transfers_SortOrder = {})); +var QueryInput_Transactions_AffectedSupply_Items; +(function (QueryInput_Transactions_AffectedSupply_Items) { + QueryInput_Transactions_AffectedSupply_Items["Cex"] = "CEX"; + QueryInput_Transactions_AffectedSupply_Items["Dex"] = "DEX"; + QueryInput_Transactions_AffectedSupply_Items["Lending"] = "LENDING"; + QueryInput_Transactions_AffectedSupply_Items["Total"] = "TOTAL"; + QueryInput_Transactions_AffectedSupply_Items["Unassigned"] = "UNASSIGNED"; +})(QueryInput_Transactions_AffectedSupply_Items || (exports.QueryInput_Transactions_AffectedSupply_Items = QueryInput_Transactions_AffectedSupply_Items = {})); +var QueryInput_Transactions_Includes_Items; +(function (QueryInput_Transactions_Includes_Items) { + QueryInput_Transactions_Includes_Items["Delegation"] = "DELEGATION"; + QueryInput_Transactions_Includes_Items["Transfer"] = "TRANSFER"; +})(QueryInput_Transactions_Includes_Items || (exports.QueryInput_Transactions_Includes_Items = QueryInput_Transactions_Includes_Items = {})); +/** Field used to sort transfers. */ +var QueryInput_Transfers_OrderBy; +(function (QueryInput_Transfers_OrderBy) { + QueryInput_Transfers_OrderBy["Amount"] = "amount"; + QueryInput_Transfers_OrderBy["Timestamp"] = "timestamp"; +})(QueryInput_Transfers_OrderBy || (exports.QueryInput_Transfers_OrderBy = QueryInput_Transfers_OrderBy = {})); +/** Sort votes by timestamp or voting power. */ var QueryInput_VotesByProposalId_OrderBy; (function (QueryInput_VotesByProposalId_OrderBy) { QueryInput_VotesByProposalId_OrderBy["Timestamp"] = "timestamp"; QueryInput_VotesByProposalId_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_VotesByProposalId_OrderBy || (exports.QueryInput_VotesByProposalId_OrderBy = QueryInput_VotesByProposalId_OrderBy = {})); -var QueryInput_VotesByProposalId_OrderDirection; -(function (QueryInput_VotesByProposalId_OrderDirection) { - QueryInput_VotesByProposalId_OrderDirection["Asc"] = "asc"; - QueryInput_VotesByProposalId_OrderDirection["Desc"] = "desc"; -})(QueryInput_VotesByProposalId_OrderDirection || (exports.QueryInput_VotesByProposalId_OrderDirection = QueryInput_VotesByProposalId_OrderDirection = {})); +/** Sort votes by timestamp or voting power. */ var QueryInput_VotesOffchainByProposalId_OrderBy; (function (QueryInput_VotesOffchainByProposalId_OrderBy) { QueryInput_VotesOffchainByProposalId_OrderBy["Timestamp"] = "timestamp"; QueryInput_VotesOffchainByProposalId_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_VotesOffchainByProposalId_OrderBy || (exports.QueryInput_VotesOffchainByProposalId_OrderBy = QueryInput_VotesOffchainByProposalId_OrderBy = {})); -var QueryInput_VotesOffchainByProposalId_OrderDirection; -(function (QueryInput_VotesOffchainByProposalId_OrderDirection) { - QueryInput_VotesOffchainByProposalId_OrderDirection["Asc"] = "asc"; - QueryInput_VotesOffchainByProposalId_OrderDirection["Desc"] = "desc"; -})(QueryInput_VotesOffchainByProposalId_OrderDirection || (exports.QueryInput_VotesOffchainByProposalId_OrderDirection = QueryInput_VotesOffchainByProposalId_OrderDirection = {})); +/** Sort votes by timestamp or voting power. */ var QueryInput_VotesOffchain_OrderBy; (function (QueryInput_VotesOffchain_OrderBy) { QueryInput_VotesOffchain_OrderBy["Timestamp"] = "timestamp"; QueryInput_VotesOffchain_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_VotesOffchain_OrderBy || (exports.QueryInput_VotesOffchain_OrderBy = QueryInput_VotesOffchain_OrderBy = {})); -var QueryInput_VotesOffchain_OrderDirection; -(function (QueryInput_VotesOffchain_OrderDirection) { - QueryInput_VotesOffchain_OrderDirection["Asc"] = "asc"; - QueryInput_VotesOffchain_OrderDirection["Desc"] = "desc"; -})(QueryInput_VotesOffchain_OrderDirection || (exports.QueryInput_VotesOffchain_OrderDirection = QueryInput_VotesOffchain_OrderDirection = {})); +/** Sort votes by timestamp or voting power. */ var QueryInput_Votes_OrderBy; (function (QueryInput_Votes_OrderBy) { QueryInput_Votes_OrderBy["Timestamp"] = "timestamp"; QueryInput_Votes_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_Votes_OrderBy || (exports.QueryInput_Votes_OrderBy = QueryInput_Votes_OrderBy = {})); -var QueryInput_Votes_OrderDirection; -(function (QueryInput_Votes_OrderDirection) { - QueryInput_Votes_OrderDirection["Asc"] = "asc"; - QueryInput_Votes_OrderDirection["Desc"] = "desc"; -})(QueryInput_Votes_OrderDirection || (exports.QueryInput_Votes_OrderDirection = QueryInput_Votes_OrderDirection = {})); -var QueryInput_VotingPowerVariations_OrderDirection; -(function (QueryInput_VotingPowerVariations_OrderDirection) { - QueryInput_VotingPowerVariations_OrderDirection["Asc"] = "asc"; - QueryInput_VotingPowerVariations_OrderDirection["Desc"] = "desc"; -})(QueryInput_VotingPowerVariations_OrderDirection || (exports.QueryInput_VotingPowerVariations_OrderDirection = QueryInput_VotingPowerVariations_OrderDirection = {})); var QueryInput_VotingPowers_OrderBy; (function (QueryInput_VotingPowers_OrderBy) { QueryInput_VotingPowers_OrderBy["Balance"] = "balance"; @@ -389,35 +211,12 @@ var QueryInput_VotingPowers_OrderBy; QueryInput_VotingPowers_OrderBy["Variation"] = "variation"; QueryInput_VotingPowers_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_VotingPowers_OrderBy || (exports.QueryInput_VotingPowers_OrderBy = QueryInput_VotingPowers_OrderBy = {})); -var QueryInput_VotingPowers_OrderDirection; -(function (QueryInput_VotingPowers_OrderDirection) { - QueryInput_VotingPowers_OrderDirection["Asc"] = "asc"; - QueryInput_VotingPowers_OrderDirection["Desc"] = "desc"; -})(QueryInput_VotingPowers_OrderDirection || (exports.QueryInput_VotingPowers_OrderDirection = QueryInput_VotingPowers_OrderDirection = {})); -var Query_FeedEvents_Items_Items_Relevance; -(function (Query_FeedEvents_Items_Items_Relevance) { - Query_FeedEvents_Items_Items_Relevance["High"] = "HIGH"; - Query_FeedEvents_Items_Items_Relevance["Low"] = "LOW"; - Query_FeedEvents_Items_Items_Relevance["Medium"] = "MEDIUM"; -})(Query_FeedEvents_Items_Items_Relevance || (exports.Query_FeedEvents_Items_Items_Relevance = Query_FeedEvents_Items_Items_Relevance = {})); -var Query_FeedEvents_Items_Items_Type; -(function (Query_FeedEvents_Items_Items_Type) { - Query_FeedEvents_Items_Items_Type["Delegation"] = "DELEGATION"; - Query_FeedEvents_Items_Items_Type["Proposal"] = "PROPOSAL"; - Query_FeedEvents_Items_Items_Type["ProposalExtended"] = "PROPOSAL_EXTENDED"; - Query_FeedEvents_Items_Items_Type["Transfer"] = "TRANSFER"; - Query_FeedEvents_Items_Items_Type["Vote"] = "VOTE"; -})(Query_FeedEvents_Items_Items_Type || (exports.Query_FeedEvents_Items_Items_Type = Query_FeedEvents_Items_Items_Type = {})); -var Timestamp_Const; -(function (Timestamp_Const) { - Timestamp_Const["Timestamp"] = "timestamp"; -})(Timestamp_Const || (exports.Timestamp_Const = Timestamp_Const = {})); exports.GetDaOsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetDAOs" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "daos" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingDelay" } }, { "kind": "Field", "name": { "kind": "Name", "value": "chainId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "alreadySupportCalldataReview" } }, { "kind": "Field", "name": { "kind": "Name", "value": "supportOffchainData" } }] } }] } }] } }] }; -exports.ListOffchainProposalsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainProposals" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "NonNegativeInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "PositiveInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_offchainProposals_orderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "offchainProposals" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "status" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "endDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "discussion" } }, { "kind": "Field", "name": { "kind": "Name", "value": "link" } }, { "kind": "Field", "name": { "kind": "Name", "value": "state" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "end" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; -exports.ListOffchainVotesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainVotes" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "NonNegativeInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votesOffchain_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votesOffchain_orderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "votesOffchain" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "toDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "voterAddresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalTitle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "vp" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; -exports.ProposalNonVotersDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ProposalNonVoters" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposalNonVoters" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "addresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }] } }] } }] } }] }; -exports.GetProposalByIdDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetProposalById" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposal" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "daoId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposerAccountId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endTimestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "forVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "againstVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "abstainVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "txHash" } }] } }] } }] }; -exports.ListProposalsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListProposals" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "NonNegativeInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "PositiveInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_proposals_orderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromEndDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "includeOptimisticProposals" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_proposals_includeOptimisticProposals" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposals" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "status" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromEndDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromEndDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "includeOptimisticProposals" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "includeOptimisticProposals" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "daoId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposerAccountId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endTimestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "forVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "againstVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "abstainVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "txHash" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; -exports.GetEventRelevanceThresholdDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetEventRelevanceThreshold" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "relevance" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_getEventRelevanceThreshold_relevance" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "type" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_getEventRelevanceThreshold_type" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "getEventRelevanceThreshold" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "relevance" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "relevance" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "type" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "type" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "threshold" } }] } }] } }] }; -exports.ListVotesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListVotes" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddressIn" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "NonNegativeInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votes_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votes_orderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "support" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "votes" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "voterAddressIn" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddressIn" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "toDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "support" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "support" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "transactionHash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "voterAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "support" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalTitle" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; -exports.ListHistoricalVotingPowerDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListHistoricalVotingPower" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "PositiveInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "NonNegativeInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_historicalVotingPower_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_historicalVotingPower_orderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "historicalVotingPower" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "address" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }, { "kind": "Field", "name": { "kind": "Name", "value": "delta" } }, { "kind": "Field", "name": { "kind": "Name", "value": "daoId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactionHash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "logIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "delegation" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "from" } }, { "kind": "Field", "name": { "kind": "Name", "value": "to" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }, { "kind": "Field", "name": { "kind": "Name", "value": "previousDelegate" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "transfer" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "from" } }, { "kind": "Field", "name": { "kind": "Name", "value": "to" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; +exports.ListOffchainProposalsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainProposals" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_offchainProposals_status_items" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "offchainProposals" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "status" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "endDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "discussion" } }, { "kind": "Field", "name": { "kind": "Name", "value": "link" } }, { "kind": "Field", "name": { "kind": "Name", "value": "state" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "end" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; +exports.ListOffchainVotesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainVotes" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votesOffchain_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "votesOffchain" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "toDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "voterAddresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalTitle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "vp" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; +exports.ProposalNonVotersDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ProposalNonVoters" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposalNonVoters" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "addresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }] } }] } }] } }] }; +exports.GetProposalByIdDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetProposalById" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposal" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "OnchainProposal" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "daoId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposerAccountId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endTimestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "forVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "againstVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "abstainVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "txHash" } }] } }] } }] } }] }; +exports.ListProposalsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListProposals" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_proposals_status_items" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromEndDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "includeOptimisticProposals" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Boolean" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposals" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "status" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromEndDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromEndDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "includeOptimisticProposals" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "includeOptimisticProposals" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "daoId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposerAccountId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endTimestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "forVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "againstVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "abstainVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "txHash" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; +exports.GetEventRelevanceThresholdDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetEventRelevanceThreshold" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "relevance" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "FeedRelevance" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "type" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "FeedEventType" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "getEventRelevanceThreshold" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "relevance" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "relevance" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "type" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "type" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "threshold" } }] } }] } }] }; +exports.ListVotesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListVotes" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddressIn" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votes_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "support" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "votes" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "voterAddressIn" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddressIn" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "toDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "support" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "support" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "transactionHash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "voterAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "support" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalTitle" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; +exports.ListHistoricalVotingPowerDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListHistoricalVotingPower" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_historicalVotingPower_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "historicalVotingPower" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "address" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }, { "kind": "Field", "name": { "kind": "Name", "value": "delta" } }, { "kind": "Field", "name": { "kind": "Name", "value": "daoId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactionHash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "logIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "delegation" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "from" } }, { "kind": "Field", "name": { "kind": "Name", "value": "to" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }, { "kind": "Field", "name": { "kind": "Name", "value": "previousDelegate" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "transfer" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "from" } }, { "kind": "Field", "name": { "kind": "Name", "value": "to" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; diff --git a/packages/anticapture-client/dist/index.d.ts b/packages/anticapture-client/dist/index.d.ts index 83cbf673..d230889f 100644 --- a/packages/anticapture-client/dist/index.d.ts +++ b/packages/anticapture-client/dist/index.d.ts @@ -1,6 +1,6 @@ export { AnticaptureClient } from './anticapture-client'; export type { VoteWithDaoId, OffchainVoteWithDaoId } from './anticapture-client'; export type { GetDaOsQuery, GetProposalByIdQuery, GetProposalByIdQueryVariables, ListProposalsQuery, ListProposalsQueryVariables, ListVotesQuery, ListVotesQueryVariables, ListHistoricalVotingPowerQuery, ListHistoricalVotingPowerQueryVariables } from './gql/graphql'; -export { QueryInput_Proposals_OrderDirection, QueryInput_HistoricalVotingPower_OrderBy, QueryInput_HistoricalVotingPower_OrderDirection, QueryInput_Votes_OrderBy, QueryInput_Votes_OrderDirection, QueryInput_VotesOffchain_OrderBy, QueryInput_VotesOffchain_OrderDirection } from './gql/graphql'; +export { OrderDirection, QueryInput_HistoricalVotingPower_OrderBy, QueryInput_Votes_OrderBy, QueryInput_VotesOffchain_OrderBy, QueryInput_Proposals_Status_Items, } from './gql/graphql'; export { FeedEventType, FeedRelevance } from './schemas'; export type { ProcessedVotingPowerHistory, OffchainProposalItem, OffchainVoteItem } from './schemas'; diff --git a/packages/anticapture-client/dist/index.js b/packages/anticapture-client/dist/index.js index c4edba74..8f3ba7fa 100644 --- a/packages/anticapture-client/dist/index.js +++ b/packages/anticapture-client/dist/index.js @@ -1,17 +1,15 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.FeedRelevance = exports.FeedEventType = exports.QueryInput_VotesOffchain_OrderDirection = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_Votes_OrderDirection = exports.QueryInput_Votes_OrderBy = exports.QueryInput_HistoricalVotingPower_OrderDirection = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.QueryInput_Proposals_OrderDirection = exports.AnticaptureClient = void 0; +exports.FeedRelevance = exports.FeedEventType = exports.QueryInput_Proposals_Status_Items = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_Votes_OrderBy = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.OrderDirection = exports.AnticaptureClient = void 0; var anticapture_client_1 = require("./anticapture-client"); Object.defineProperty(exports, "AnticaptureClient", { enumerable: true, get: function () { return anticapture_client_1.AnticaptureClient; } }); // Export GraphQL enums var graphql_1 = require("./gql/graphql"); -Object.defineProperty(exports, "QueryInput_Proposals_OrderDirection", { enumerable: true, get: function () { return graphql_1.QueryInput_Proposals_OrderDirection; } }); +Object.defineProperty(exports, "OrderDirection", { enumerable: true, get: function () { return graphql_1.OrderDirection; } }); Object.defineProperty(exports, "QueryInput_HistoricalVotingPower_OrderBy", { enumerable: true, get: function () { return graphql_1.QueryInput_HistoricalVotingPower_OrderBy; } }); -Object.defineProperty(exports, "QueryInput_HistoricalVotingPower_OrderDirection", { enumerable: true, get: function () { return graphql_1.QueryInput_HistoricalVotingPower_OrderDirection; } }); Object.defineProperty(exports, "QueryInput_Votes_OrderBy", { enumerable: true, get: function () { return graphql_1.QueryInput_Votes_OrderBy; } }); -Object.defineProperty(exports, "QueryInput_Votes_OrderDirection", { enumerable: true, get: function () { return graphql_1.QueryInput_Votes_OrderDirection; } }); Object.defineProperty(exports, "QueryInput_VotesOffchain_OrderBy", { enumerable: true, get: function () { return graphql_1.QueryInput_VotesOffchain_OrderBy; } }); -Object.defineProperty(exports, "QueryInput_VotesOffchain_OrderDirection", { enumerable: true, get: function () { return graphql_1.QueryInput_VotesOffchain_OrderDirection; } }); +Object.defineProperty(exports, "QueryInput_Proposals_Status_Items", { enumerable: true, get: function () { return graphql_1.QueryInput_Proposals_Status_Items; } }); var schemas_1 = require("./schemas"); Object.defineProperty(exports, "FeedEventType", { enumerable: true, get: function () { return schemas_1.FeedEventType; } }); Object.defineProperty(exports, "FeedRelevance", { enumerable: true, get: function () { return schemas_1.FeedRelevance; } }); diff --git a/packages/anticapture-client/dist/schemas.d.ts b/packages/anticapture-client/dist/schemas.d.ts index d165bb82..9c055074 100644 --- a/packages/anticapture-client/dist/schemas.d.ts +++ b/packages/anticapture-client/dist/schemas.d.ts @@ -1,5 +1,5 @@ import { z } from 'zod'; -export { QueryInput_GetEventRelevanceThreshold_Type as FeedEventType, QueryInput_GetEventRelevanceThreshold_Relevance as FeedRelevance, } from './gql/graphql'; +export { FeedEventType, FeedRelevance, } from './gql/graphql'; export declare const SafeDaosResponseSchema: z.ZodEffects; +export declare const SafeOffchainProposalNonVotersResponseSchema: z.ZodEffects; + }, "strip", z.ZodTypeAny, { + voter: string; + votingPower?: string | undefined; + }, { + voter: string; + votingPower?: string | undefined; + }>>, "many">; + totalCount: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + items: ({ + voter: string; + votingPower?: string | undefined; + } | null)[]; + totalCount?: number | undefined; + }, { + items: ({ + voter: string; + votingPower?: string | undefined; + } | null)[]; + totalCount?: number | undefined; + }>>; +}, "strip", z.ZodTypeAny, { + offchainProposalNonVoters: { + items: ({ + voter: string; + votingPower?: string | undefined; + } | null)[]; + totalCount?: number | undefined; + } | null; +}, { + offchainProposalNonVoters: { + items: ({ + voter: string; + votingPower?: string | undefined; + } | null)[]; + totalCount?: number | undefined; + } | null; +}>, { + offchainProposalNonVoters: { + items: { + voter: string; + votingPower?: string; + }[]; + totalCount?: number | undefined; + }; +}, { + offchainProposalNonVoters: { + items: ({ + voter: string; + votingPower?: string | undefined; + } | null)[]; + totalCount?: number | undefined; + } | null; +}>; export declare const EventThresholdResponseSchema: z.ZodObject<{ getEventRelevanceThreshold: z.ZodObject<{ threshold: z.ZodString; @@ -603,6 +662,7 @@ export declare const OffchainProposalItemSchema: z.ZodObject<{ state: z.ZodString; created: z.ZodNumber; end: z.ZodNumber; + start: z.ZodOptional; }, "strip", z.ZodTypeAny, { link: string; id: string; @@ -611,6 +671,7 @@ export declare const OffchainProposalItemSchema: z.ZodObject<{ state: string; created: number; end: number; + start?: number | undefined; }, { link: string; id: string; @@ -619,6 +680,7 @@ export declare const OffchainProposalItemSchema: z.ZodObject<{ state: string; created: number; end: number; + start?: number | undefined; }>; export type OffchainProposalItem = z.infer; export declare const SafeOffchainProposalsResponseSchema: z.ZodEffects; }, "strip", z.ZodTypeAny, { link: string; id: string; @@ -639,6 +702,7 @@ export declare const SafeOffchainProposalsResponseSchema: z.ZodEffects>, "many">; totalCount: z.ZodNumber; }, "strip", z.ZodTypeAny, { @@ -658,6 +723,7 @@ export declare const SafeOffchainProposalsResponseSchema: z.ZodEffects>; @@ -682,6 +749,7 @@ export declare const SafeOffchainProposalsResponseSchema: z.ZodEffects { + if (!data.offchainProposalNonVoters) { + console.warn('OffchainProposalNonVotersResponse has null offchainProposalNonVoters:', data); + return { offchainProposalNonVoters: { items: [], totalCount: 0 } }; + } + return { + offchainProposalNonVoters: { + ...data.offchainProposalNonVoters, + items: data.offchainProposalNonVoters.items.filter((item) => item !== null) + } + }; +}); exports.EventThresholdResponseSchema = zod_1.z.object({ getEventRelevanceThreshold: zod_1.z.object({ threshold: zod_1.z.string() @@ -134,6 +154,7 @@ exports.OffchainProposalItemSchema = zod_1.z.object({ state: zod_1.z.string(), created: zod_1.z.number(), end: zod_1.z.number(), + start: zod_1.z.number().optional(), }); exports.SafeOffchainProposalsResponseSchema = zod_1.z.object({ offchainProposals: zod_1.z.object({ diff --git a/packages/anticapture-client/src/anticapture-client.ts b/packages/anticapture-client/src/anticapture-client.ts index 187c5d43..34a4a22c 100644 --- a/packages/anticapture-client/src/anticapture-client.ts +++ b/packages/anticapture-client/src/anticapture-client.ts @@ -16,7 +16,7 @@ import type { ListOffchainProposalsQueryVariables, ListOffchainVotesQueryVariables, } from './gql/graphql'; -import { GetDaOsDocument, GetProposalByIdDocument, ListProposalsDocument, ListHistoricalVotingPowerDocument, ListVotesDocument, ProposalNonVotersDocument, GetEventRelevanceThresholdDocument, QueryInput_Votes_OrderBy, QueryInput_Votes_OrderDirection, QueryInput_VotesOffchain_OrderBy, QueryInput_VotesOffchain_OrderDirection, ListOffchainProposalsDocument, ListOffchainVotesDocument } from './gql/graphql'; +import { GetDaOsDocument, GetProposalByIdDocument, ListProposalsDocument, ListHistoricalVotingPowerDocument, ListVotesDocument, ProposalNonVotersDocument, GetEventRelevanceThresholdDocument, QueryInput_Votes_OrderBy, OrderDirection, QueryInput_VotesOffchain_OrderBy, ListOffchainProposalsDocument, ListOffchainVotesDocument } from './gql/graphql'; import { SafeDaosResponseSchema, SafeProposalByIdResponseSchema, @@ -26,6 +26,7 @@ import { SafeProposalNonVotersResponseSchema, SafeOffchainProposalsResponseSchema, SafeOffchainVotesResponseSchema, + SafeOffchainProposalNonVotersResponseSchema, processProposals, processVotingPowerHistory, ProcessedVotingPowerHistory, @@ -205,9 +206,9 @@ export class AnticaptureClient { // Sort globally by timestamp desc (most recent first) if (variables?.fromEndDate) { - allProposals.sort((a, b) => parseInt(b?.endTimestamp || '0') - parseInt(a?.endTimestamp || '0')); + allProposals.sort((a, b) => (b?.endTimestamp ?? 0) - (a?.endTimestamp ?? 0)); } else { - allProposals.sort((a, b) => parseInt(b?.timestamp || '0') - parseInt(a?.timestamp || '0') || 0); + allProposals.sort((a, b) => (b?.timestamp ?? 0) - (a?.timestamp ?? 0)); } return allProposals; @@ -270,7 +271,7 @@ export class AnticaptureClient { variables, daoId ); - return validated.votes.items.filter(item => item !== null) as VoteItem[]; + return validated.votes.items.filter(item => item !== null) as unknown as VoteItem[]; } catch (error) { console.warn(`Error fetching votes for DAO ${daoId}:`, error); return []; @@ -310,6 +311,48 @@ export class AnticaptureClient { } } + /** + * Fetches addresses that haven't voted on a specific offchain (Snapshot) proposal + * @param proposalId The Snapshot proposal ID to check + * @param addresses Optional array of addresses to filter by + * @returns List of non-voters + */ + async getOffchainProposalNonVoters( + proposalId: string, + addresses?: string[], + ): Promise<{ voter: string; votingPower?: string }[]> { + try { + const response = await this.httpClient.post('', { + query: `query OffchainProposalNonVoters($id: String!, $addresses: String, $orderDirection: String) { + offchainProposalNonVoters(id: $id, addresses: $addresses, orderDirection: $orderDirection) { + items { + voter + votingPower + } + } + }`, + variables: { + id: proposalId, + ...(addresses && { addresses: addresses.join(',') }), + orderDirection: 'desc' + } + }, { headers: this.buildHeaders() }); + + if (response.data.errors) { + throw new Error(JSON.stringify(response.data.errors)); + } + + const validated = SafeOffchainProposalNonVotersResponseSchema.parse( + this.toLowercase(response.data.data) + ); + + return validated.offchainProposalNonVoters.items; + } catch (error) { + console.warn(`Error fetching offchain non-voters for proposal ${proposalId}:`, error); + return []; + } + } + /** * List recent votes from all DAOs since a given timestamp * @param timestampGt Fetch votes with timestamp greater than this value (unix timestamp as string) @@ -327,7 +370,7 @@ export class AnticaptureClient { fromDate: parseInt(timestampGt), limit, orderBy: QueryInput_Votes_OrderBy.Timestamp, - orderDirection: QueryInput_Votes_OrderDirection.Asc + orderDirection: OrderDirection.Asc }); // Add daoId to each vote return votes.map(vote => ({ @@ -460,7 +503,7 @@ export class AnticaptureClient { fromDate, limit, orderBy: QueryInput_VotesOffchain_OrderBy.Timestamp, - orderDirection: QueryInput_VotesOffchain_OrderDirection.Asc + orderDirection: OrderDirection.Asc }); return votes.map(vote => ({ ...vote, diff --git a/packages/anticapture-client/src/index.ts b/packages/anticapture-client/src/index.ts index b0a36723..ed3c606e 100644 --- a/packages/anticapture-client/src/index.ts +++ b/packages/anticapture-client/src/index.ts @@ -18,13 +18,11 @@ export type { // Export GraphQL enums export { - QueryInput_Proposals_OrderDirection, + OrderDirection, QueryInput_HistoricalVotingPower_OrderBy, - QueryInput_HistoricalVotingPower_OrderDirection, QueryInput_Votes_OrderBy, - QueryInput_Votes_OrderDirection, QueryInput_VotesOffchain_OrderBy, - QueryInput_VotesOffchain_OrderDirection + QueryInput_Proposals_Status_Items, } from './gql/graphql'; export { FeedEventType, FeedRelevance } from './schemas'; diff --git a/packages/anticapture-client/src/schemas.ts b/packages/anticapture-client/src/schemas.ts index 59f5dd4a..6a8fe702 100644 --- a/packages/anticapture-client/src/schemas.ts +++ b/packages/anticapture-client/src/schemas.ts @@ -1,8 +1,8 @@ import { z } from 'zod'; export { - QueryInput_GetEventRelevanceThreshold_Type as FeedEventType, - QueryInput_GetEventRelevanceThreshold_Relevance as FeedRelevance, + FeedEventType, + FeedRelevance, } from './gql/graphql'; // Schema with built-in transformation and fallbacks @@ -127,6 +127,27 @@ export const SafeProposalNonVotersResponseSchema = z.object({ }; }); +export const SafeOffchainProposalNonVotersResponseSchema = z.object({ + offchainProposalNonVoters: z.object({ + items: z.array(z.object({ + voter: z.string(), + votingPower: z.string().optional() + }).nullable()), + totalCount: z.number().optional() + }).nullable() +}).transform((data) => { + if (!data.offchainProposalNonVoters) { + console.warn('OffchainProposalNonVotersResponse has null offchainProposalNonVoters:', data); + return { offchainProposalNonVoters: { items: [], totalCount: 0 } }; + } + return { + offchainProposalNonVoters: { + ...data.offchainProposalNonVoters, + items: data.offchainProposalNonVoters.items.filter((item): item is { voter: string; votingPower?: string } => item !== null) + } + }; +}); + export const EventThresholdResponseSchema = z.object({ getEventRelevanceThreshold: z.object({ threshold: z.string() @@ -141,6 +162,7 @@ export const OffchainProposalItemSchema = z.object({ state: z.string(), created: z.number(), end: z.number(), + start: z.number().optional(), }); export type OffchainProposalItem = z.infer; From 9597066503ee0006f90cfcdf1a205a7d528eb1ac Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 15:33:20 -0300 Subject: [PATCH 05/30] feat: add VotingReminderProposal interface and mapper functions Co-Authored-By: Claude Sonnet 4.6 --- .../interfaces/voting-reminder.interface.ts | 22 +++++++++++++ .../src/mappers/proposal-reminder.mapper.ts | 33 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 apps/logic-system/src/interfaces/voting-reminder.interface.ts create mode 100644 apps/logic-system/src/mappers/proposal-reminder.mapper.ts diff --git a/apps/logic-system/src/interfaces/voting-reminder.interface.ts b/apps/logic-system/src/interfaces/voting-reminder.interface.ts new file mode 100644 index 00000000..6ee11805 --- /dev/null +++ b/apps/logic-system/src/interfaces/voting-reminder.interface.ts @@ -0,0 +1,22 @@ +/** + * Normalized proposal data for voting reminders. + * Both on-chain and off-chain proposals are mapped to this shape. + */ +export interface VotingReminderProposal { + id: string; + daoId: string; + title?: string; + description?: string; + startTime: number; + endTime: number; + link?: string; + discussion?: string; +} + +/** + * Data source interface for fetching proposals ready for voting reminders. + * Implemented by both ProposalRepository and OffchainProposalRepository. + */ +export interface VotingReminderDataSource { + listActiveForReminder(): Promise; +} diff --git a/apps/logic-system/src/mappers/proposal-reminder.mapper.ts b/apps/logic-system/src/mappers/proposal-reminder.mapper.ts new file mode 100644 index 00000000..815ed6f8 --- /dev/null +++ b/apps/logic-system/src/mappers/proposal-reminder.mapper.ts @@ -0,0 +1,33 @@ +import { ProposalOnChain } from '../interfaces/proposal.interface'; +import { OffchainProposal } from '../interfaces/offchain-proposal.interface'; +import { VotingReminderProposal } from '../interfaces/voting-reminder.interface'; + +/** + * Maps an on-chain proposal to the normalized VotingReminderProposal shape. + */ +export function mapOnchainToReminderProposal(p: ProposalOnChain): VotingReminderProposal { + return { + id: p.id, + daoId: p.daoId, + title: p.title || undefined, + description: p.description, + startTime: p.timestamp, + endTime: p.endTimestamp, + }; +} + +/** + * Maps an off-chain (Snapshot) proposal to the normalized VotingReminderProposal shape. + * Uses `start` (actual voting start) when available, falls back to `created`. + */ +export function mapOffchainToReminderProposal(p: OffchainProposal): VotingReminderProposal { + return { + id: p.id, + daoId: p.daoId, + title: p.title || undefined, + startTime: p.start ?? p.created, + endTime: p.end, + link: p.link, + discussion: p.discussion, + }; +} From fa960e07c2d0d7d52d7987ba744d7dd713477248 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 15:51:42 -0300 Subject: [PATCH 06/30] refactor: generalize VotingReminderTrigger to use normalized VotingReminderProposal interface - Replace ProposalOnChain/ProposalDataSource with VotingReminderProposal/VotingReminderDataSource - Add triggerIdPrefix constructor param (enables offchain-voting-reminder-75 IDs) - Rename TRIGGER_ID_PREFIX -> DEFAULT_TRIGGER_ID_PREFIX constant - Update field access: proposal.timestamp/endTimestamp -> proposal.startTime/endTime - Add link and discussion fields to VotingReminderEvent; make description optional - Update fetchData to call dataSource.listActiveForReminder() - Add listActiveForReminder() to ProposalRepository implementing VotingReminderDataSource - Update dispatcher VotingReminderEvent interface (description optional, add link/discussion) - Fix createReminderMessage to handle optional description with ?? '' fallback - Add address to replacePlaceholders call in dispatcher service - Update tests to use VotingReminderProposal with startTime/endTime numbers Co-Authored-By: Claude Sonnet 4.6 --- .../voting-reminder-trigger.service.ts | 9 +- .../src/repositories/proposal.repository.ts | 21 ++- .../src/triggers/voting-reminder-trigger.ts | 81 ++++++----- .../tests/voting-reminder-trigger.test.ts | 128 +++++++++--------- 4 files changed, 132 insertions(+), 107 deletions(-) diff --git a/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts b/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts index 5849ea67..7cee6017 100644 --- a/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts +++ b/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts @@ -15,11 +15,13 @@ interface VotingReminderEvent { id: string; daoId: string; title?: string; - description: string; + description?: string; startTimestamp: number; endTimestamp: number; timeElapsedPercentage: number; thresholdPercentage: number; + link?: string; + discussion?: string; } /** @@ -152,7 +154,7 @@ export class VotingReminderTriggerHandler extends BaseTriggerHandler proposal !== null) as ProposalOnChain[]; } + async listActiveForReminder(): Promise { + const proposals = await this.listAll({ + status: 'ACTIVE', + includeOptimisticProposals: false, + }); + + return proposals + .filter(p => p.timestamp != null && p.endTimestamp != null) + .map(p => ({ + id: p.id, + daoId: p.daoId, + title: p.title ?? undefined, + description: p.description ?? undefined, + startTime: p.timestamp, + endTime: p.endTimestamp, + })); + } + } diff --git a/apps/logic-system/src/triggers/voting-reminder-trigger.ts b/apps/logic-system/src/triggers/voting-reminder-trigger.ts index f2b30696..10d0081f 100644 --- a/apps/logic-system/src/triggers/voting-reminder-trigger.ts +++ b/apps/logic-system/src/triggers/voting-reminder-trigger.ts @@ -5,7 +5,7 @@ */ import { Trigger } from './base-trigger'; -import { ProposalOnChain, ProposalDataSource } from '../interfaces/proposal.interface'; +import { VotingReminderProposal, VotingReminderDataSource } from '../interfaces/voting-reminder.interface'; import { DispatcherService, DispatcherMessage } from '../interfaces/dispatcher.interface'; /** @@ -15,29 +15,32 @@ export interface VotingReminderEvent { id: string; daoId: string; title?: string; - description: string; + description?: string; startTimestamp: number; endTimestamp: number; timeElapsedPercentage: number; thresholdPercentage: number; + link?: string; + discussion?: string; } -const TRIGGER_ID_PREFIX = 'voting-reminder'; +const DEFAULT_TRIGGER_ID_PREFIX = 'voting-reminder'; // 5% window the event will be triggered between thresholdPercentage and thresholdPercentage + window -const DEFAULT_WINDOW_SIZE = 5; +const DEFAULT_WINDOW_SIZE = 5; -export class VotingReminderTrigger extends Trigger { +export class VotingReminderTrigger extends Trigger { private thresholdPercentage: number; private windowSize: number; constructor( private readonly dispatcherService: DispatcherService, - private readonly proposalRepository: ProposalDataSource, + private readonly dataSource: VotingReminderDataSource, interval: number, thresholdPercentage: number = 75, - windowSize: number = DEFAULT_WINDOW_SIZE + windowSize: number = DEFAULT_WINDOW_SIZE, + triggerIdPrefix: string = DEFAULT_TRIGGER_ID_PREFIX ) { - super(`${TRIGGER_ID_PREFIX}-${thresholdPercentage}`, interval); + super(`${triggerIdPrefix}-${thresholdPercentage}`, interval); this.thresholdPercentage = thresholdPercentage; this.windowSize = windowSize; } @@ -45,18 +48,18 @@ export class VotingReminderTrigger extends Trigger { /** * Processes proposals and sends voting reminders for eligible ones */ - async process(proposals: ProposalOnChain[]): Promise { + async process(proposals: VotingReminderProposal[]): Promise { if (proposals.length === 0) { return; } const eligibleProposals = this.filterEligibleProposals(proposals); - + if (eligibleProposals.length === 0) { return; } - const reminderEvents = eligibleProposals.map(proposal => + const reminderEvents = eligibleProposals.map(proposal => this.createReminderEvent(proposal) ); @@ -71,9 +74,9 @@ export class VotingReminderTrigger extends Trigger { /** * Filters proposals that are eligible for reminders */ - private filterEligibleProposals(proposals: ProposalOnChain[]): ProposalOnChain[] { + private filterEligibleProposals(proposals: VotingReminderProposal[]): VotingReminderProposal[] { const now = Math.floor(Date.now() / 1000); - + return proposals.filter(proposal => { // Skip null proposals if (!proposal) { @@ -81,28 +84,28 @@ export class VotingReminderTrigger extends Trigger { } // Skip if proposal doesn't have required timestamps - if (!proposal.timestamp || !proposal.endTimestamp) { + if (!proposal.startTime || !proposal.endTime) { return false; } - const startTime = proposal.timestamp; - const endTime = proposal.endTimestamp; - + const startTime = proposal.startTime; + const endTime = proposal.endTime; + // Skip if proposal is not active if (now <= startTime || now >= endTime) { return false; } const timeElapsedPercentage = this.calculateTimeElapsedPercentage( - startTime, - endTime, + startTime, + endTime, now ); // Check if proposal is within the notification window (threshold to threshold + windowSize) const threshold = this.thresholdPercentage; const windowEnd = Math.min(threshold + this.windowSize, 100); - + return timeElapsedPercentage >= threshold && timeElapsedPercentage <= windowEnd; }); } @@ -112,49 +115,45 @@ export class VotingReminderTrigger extends Trigger { * Calculates the percentage of time elapsed for a proposal */ private calculateTimeElapsedPercentage( - startTime: number, - endTime: number, + startTime: number, + endTime: number, currentTime: number ): number { if (currentTime <= startTime) return 0; if (currentTime >= endTime) return 100; - + return ((currentTime - startTime) / (endTime - startTime)) * 100; } /** * Creates a reminder event from a proposal */ - private createReminderEvent(proposal: ProposalOnChain): VotingReminderEvent { - if (!proposal || !proposal.timestamp || !proposal.endTimestamp) { + private createReminderEvent(proposal: VotingReminderProposal): VotingReminderEvent { + if (!proposal || !proposal.startTime || !proposal.endTime) { throw new Error('Invalid proposal data for reminder event'); } - + const now = Math.floor(Date.now() / 1000); - const startTime = proposal.timestamp; - const endTime = proposal.endTimestamp; - const timeElapsedPercentage = this.calculateTimeElapsedPercentage(startTime, endTime, now); + const timeElapsedPercentage = this.calculateTimeElapsedPercentage(proposal.startTime, proposal.endTime, now); return { id: proposal.id, daoId: proposal.daoId, - title: proposal.title || undefined, + title: proposal.title, description: proposal.description, - startTimestamp: startTime, - endTimestamp: endTime, + startTimestamp: proposal.startTime, + endTimestamp: proposal.endTime, timeElapsedPercentage: Math.round(timeElapsedPercentage * 100) / 100, // Round to 2 decimal places - thresholdPercentage: this.thresholdPercentage + thresholdPercentage: this.thresholdPercentage, + link: proposal.link, + discussion: proposal.discussion, }; } /** - * Fetches active proposals from the repository - * Excludes optimistic proposals (includeOptimisticProposals: false) + * Fetches active proposals from the data source */ - protected async fetchData(): Promise { - return await this.proposalRepository.listAll({ - status: 'ACTIVE', - includeOptimisticProposals: false - }); + protected async fetchData(): Promise { + return await this.dataSource.listActiveForReminder(); } -} \ No newline at end of file +} diff --git a/apps/logic-system/tests/voting-reminder-trigger.test.ts b/apps/logic-system/tests/voting-reminder-trigger.test.ts index d0db9c68..899bb2d9 100644 --- a/apps/logic-system/tests/voting-reminder-trigger.test.ts +++ b/apps/logic-system/tests/voting-reminder-trigger.test.ts @@ -4,7 +4,7 @@ import { describe, it, expect, jest, beforeEach, afterEach } from '@jest/globals'; import { VotingReminderTrigger } from '../src/triggers/voting-reminder-trigger'; -import { ProposalOnChain } from '../src/interfaces/proposal.interface'; +import { VotingReminderProposal } from '../src/interfaces/voting-reminder.interface'; import { DispatcherService } from '../src/interfaces/dispatcher.interface'; import { MockedFunction } from 'jest-mock'; import { NotificationTypeId } from '@notification-system/messages'; @@ -12,25 +12,25 @@ import { NotificationTypeId } from '@notification-system/messages'; describe('VotingReminderTrigger', () => { let trigger: VotingReminderTrigger; let mockDispatcherService: jest.Mocked; - let mockProposalRepository: any; + let mockDataSource: any; const baseTime = Math.floor(Date.now() / 1000); - + beforeEach(() => { mockDispatcherService = { sendMessage: jest.fn().mockResolvedValue(undefined as never) as MockedFunction, }; - mockProposalRepository = { - listAll: jest.fn().mockResolvedValue([] as never), + mockDataSource = { + listActiveForReminder: jest.fn().mockResolvedValue([] as never), }; // Mock Date.now for consistent testing jest.spyOn(Date, 'now').mockReturnValue(baseTime * 1000); - + trigger = new VotingReminderTrigger( mockDispatcherService, - mockProposalRepository, + mockDataSource, 30000, // 30 second interval for testing 90 // 90% threshold ); @@ -42,22 +42,34 @@ describe('VotingReminderTrigger', () => { describe('constructor', () => { it('should create trigger with unique IDs including threshold', () => { - const trigger30 = new VotingReminderTrigger(mockDispatcherService, mockProposalRepository, 30000, 30); - const trigger60 = new VotingReminderTrigger(mockDispatcherService, mockProposalRepository, 30000, 60); - const trigger90 = new VotingReminderTrigger(mockDispatcherService, mockProposalRepository, 30000, 90); - const trigger75 = new VotingReminderTrigger(mockDispatcherService, mockProposalRepository, 30000, 75); + const trigger30 = new VotingReminderTrigger(mockDispatcherService, mockDataSource, 30000, 30); + const trigger60 = new VotingReminderTrigger(mockDispatcherService, mockDataSource, 30000, 60); + const trigger90 = new VotingReminderTrigger(mockDispatcherService, mockDataSource, 30000, 90); + const trigger75 = new VotingReminderTrigger(mockDispatcherService, mockDataSource, 30000, 75); expect(trigger30.id).toBe(NotificationTypeId.VotingReminder30); expect(trigger60.id).toBe(NotificationTypeId.VotingReminder60); expect(trigger90.id).toBe(NotificationTypeId.VotingReminder90); expect(trigger75.id).toBe('voting-reminder-75'); }); + + it('should create trigger with custom prefix', () => { + const offchainTrigger = new VotingReminderTrigger( + mockDispatcherService, + mockDataSource, + 30000, + 75, + 5, + 'offchain-voting-reminder' + ); + expect(offchainTrigger.id).toBe('offchain-voting-reminder-75'); + }); }); describe('process', () => { it('should not send messages for empty proposals array', async () => { await trigger.process([]); - + expect(mockDispatcherService.sendMessage).not.toHaveBeenCalled(); }); @@ -65,16 +77,15 @@ describe('VotingReminderTrigger', () => { const proposalStart = baseTime - 3600; // Started 1 hour ago const proposalEnd = baseTime + 300; // Ends in 5 minutes // Total duration: 65 minutes, elapsed: 60 minutes = 92.3% elapsed (within 90-95% window) - - const proposal: ProposalOnChain = { + + const proposal: VotingReminderProposal = { id: 'proposal-123', daoId: 'test-dao', title: 'Test Proposal', description: 'A test proposal for voting reminder', - timestamp: proposalStart.toString(), - endTimestamp: proposalEnd.toString(), - status: 'ACTIVE' - } as ProposalOnChain; + startTime: proposalStart, + endTime: proposalEnd, + }; await trigger.process([proposal]); @@ -88,7 +99,9 @@ describe('VotingReminderTrigger', () => { startTimestamp: proposalStart, endTimestamp: proposalEnd, timeElapsedPercentage: 92.31, - thresholdPercentage: 90 + thresholdPercentage: 90, + link: undefined, + discussion: undefined, }] }); }); @@ -97,15 +110,14 @@ describe('VotingReminderTrigger', () => { const proposalStart = baseTime - 9600; // Started 160 minutes ago const proposalEnd = baseTime + 400; // Ends in ~6.7 minutes // Total duration: 166.7 minutes, elapsed: 160 minutes = 96% elapsed (> 95% window) - - const proposal: ProposalOnChain = { + + const proposal: VotingReminderProposal = { id: 'proposal-123', daoId: 'test-dao', description: 'A test proposal for voting reminder', - timestamp: proposalStart.toString(), - endTimestamp: proposalEnd.toString(), - status: 'ACTIVE' - } as ProposalOnChain; + startTime: proposalStart, + endTime: proposalEnd, + }; await trigger.process([proposal]); @@ -113,13 +125,14 @@ describe('VotingReminderTrigger', () => { }); it('should skip proposals without required timestamps', async () => { - const proposal: ProposalOnChain = { + const proposal: VotingReminderProposal = { id: 'proposal-123', daoId: 'test-dao', description: 'Test proposal without timestamps', - status: 'ACTIVE' - // Missing startTimestamp and endTimestamp - } as ProposalOnChain; + startTime: 0, + endTime: 0, + // Missing valid startTime and endTime (0 is falsy) + }; await trigger.process([proposal]); @@ -129,15 +142,14 @@ describe('VotingReminderTrigger', () => { it('should skip proposals that have already ended', async () => { const proposalStart = baseTime - 7200; // Started 2 hours ago const proposalEnd = baseTime - 1800; // Ended 30 minutes ago - - const proposal: ProposalOnChain = { + + const proposal: VotingReminderProposal = { id: 'proposal-123', daoId: 'test-dao', description: 'Test proposal that ended', - timestamp: proposalStart.toString(), - endTimestamp: proposalEnd.toString(), - status: 'ACTIVE' - } as ProposalOnChain; + startTime: proposalStart, + endTime: proposalEnd, + }; await trigger.process([proposal]); @@ -147,15 +159,14 @@ describe('VotingReminderTrigger', () => { it('should skip proposals that have not started yet', async () => { const proposalStart = baseTime + 3600; // Starts in 1 hour const proposalEnd = baseTime + 7200; // Ends in 2 hours - - const proposal: ProposalOnChain = { + + const proposal: VotingReminderProposal = { id: 'proposal-123', daoId: 'test-dao', description: 'Test proposal that has not started', - timestamp: proposalStart.toString(), - endTimestamp: proposalEnd.toString(), - status: 'ACTIVE' - } as ProposalOnChain; + startTime: proposalStart, + endTime: proposalEnd, + }; await trigger.process([proposal]); @@ -164,21 +175,14 @@ describe('VotingReminderTrigger', () => { }); describe('fetchData', () => { - it('should fetch active proposals without timestamp filter', async () => { - const proposals = [ - { id: 'prop-1', status: 'ACTIVE' }, - { id: 'prop-2', status: 'ACTIVE' } - ] as ProposalOnChain[]; - - mockProposalRepository.listAll.mockResolvedValue(proposals); - + it('should fetch active proposals from data source', async () => { + const proposals: VotingReminderProposal[] = [ + { id: 'prop-1', daoId: 'dao-1', startTime: 1000, endTime: 2000 }, + { id: 'prop-2', daoId: 'dao-1', startTime: 1000, endTime: 2000 } + ]; + mockDataSource.listActiveForReminder.mockResolvedValue(proposals); const result = await trigger['fetchData'](); - - // Should only filter by status ACTIVE, no fromDate - expect(mockProposalRepository.listAll).toHaveBeenCalledWith({ - status: 'ACTIVE', - includeOptimisticProposals: false - }); + expect(mockDataSource.listActiveForReminder).toHaveBeenCalled(); expect(result).toEqual(proposals); }); }); @@ -188,11 +192,11 @@ describe('VotingReminderTrigger', () => { const startTime = 1000; const endTime = 2000; const currentTime = 1500; - + // Use reflection to access private method for testing const calculateTime = (trigger as any).calculateTimeElapsedPercentage; const percentage = calculateTime(startTime, endTime, currentTime); - + expect(percentage).toBe(50); // 50% elapsed }); @@ -200,10 +204,10 @@ describe('VotingReminderTrigger', () => { const startTime = 2000; const endTime = 3000; const currentTime = 1000; - + const calculateTime = (trigger as any).calculateTimeElapsedPercentage; const percentage = calculateTime(startTime, endTime, currentTime); - + expect(percentage).toBe(0); }); @@ -211,11 +215,11 @@ describe('VotingReminderTrigger', () => { const startTime = 1000; const endTime = 2000; const currentTime = 3000; - + const calculateTime = (trigger as any).calculateTimeElapsedPercentage; const percentage = calculateTime(startTime, endTime, currentTime); - + expect(percentage).toBe(100); }); }); -}); \ No newline at end of file +}); From b48a36ec8f474e25d279d9cc9b47385f57685c63 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 16:22:35 -0300 Subject: [PATCH 07/30] feat: add listActiveForReminder to repositories and wire offchain voting reminder trigger - OffchainProposalRepository now implements VotingReminderDataSource with listActiveForReminder() - Added offchainVotingReminderTrigger75 (75% threshold) to App wiring in initializeRabbitMQ, start(), stop(), and resetTriggers() - Added missing stop() calls for all voting reminder triggers in resetTriggers() Co-Authored-By: Claude Sonnet 4.6 --- apps/logic-system/src/app.ts | 24 +++++++++++++++++++ .../offchain-proposal.repository.ts | 9 ++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/apps/logic-system/src/app.ts b/apps/logic-system/src/app.ts index 8da39bee..5c3bf314 100644 --- a/apps/logic-system/src/app.ts +++ b/apps/logic-system/src/app.ts @@ -29,6 +29,7 @@ export class App { private votingReminderTrigger30!: VotingReminderTrigger; private votingReminderTrigger60!: VotingReminderTrigger; private votingReminderTrigger90!: VotingReminderTrigger; + private offchainVotingReminderTrigger75!: VotingReminderTrigger; private proposalStatus: ProposalStatus; private rabbitMQConnection!: RabbitMQConnection; private rabbitMQPublisher!: RabbitMQPublisher; @@ -139,6 +140,15 @@ export class App { triggerInterval, 90, // 90% threshold ); + + this.offchainVotingReminderTrigger75 = new VotingReminderTrigger( + dispatcherService, + offchainProposalRepository, + triggerInterval, + 75, // 75% threshold + 5, // default window size + 'offchain-voting-reminder' // prefix → produces ID 'offchain-voting-reminder-75' + ); } async start(): Promise { @@ -155,6 +165,7 @@ export class App { this.votingReminderTrigger30.start(); this.votingReminderTrigger60.start(); this.votingReminderTrigger90.start(); + this.offchainVotingReminderTrigger75.start(); console.log('Logic system is running. Press Ctrl+C to stop.'); } @@ -187,6 +198,18 @@ export class App { if (this.offchainProposalFinishedTrigger) { this.offchainProposalFinishedTrigger.reset(initialTimestamp); } + if (this.votingReminderTrigger30) { + this.votingReminderTrigger30.stop(); + } + if (this.votingReminderTrigger60) { + this.votingReminderTrigger60.stop(); + } + if (this.votingReminderTrigger90) { + this.votingReminderTrigger90.stop(); + } + if (this.offchainVotingReminderTrigger75) { + this.offchainVotingReminderTrigger75.stop(); + } } async stop(): Promise { @@ -200,6 +223,7 @@ export class App { await this.votingReminderTrigger30.stop(); await this.votingReminderTrigger60.stop(); await this.votingReminderTrigger90.stop(); + await this.offchainVotingReminderTrigger75.stop(); if (this.rabbitMQPublisher) { await this.rabbitMQPublisher.close(); } diff --git a/apps/logic-system/src/repositories/offchain-proposal.repository.ts b/apps/logic-system/src/repositories/offchain-proposal.repository.ts index af11cd4d..d06d62ee 100644 --- a/apps/logic-system/src/repositories/offchain-proposal.repository.ts +++ b/apps/logic-system/src/repositories/offchain-proposal.repository.ts @@ -1,7 +1,9 @@ import { AnticaptureClient } from '@notification-system/anticapture-client'; import { OffchainProposalDataSource, OffchainProposal, ListOffchainProposalsOptions } from '../interfaces/offchain-proposal.interface'; +import { VotingReminderProposal, VotingReminderDataSource } from '../interfaces/voting-reminder.interface'; +import { mapOffchainToReminderProposal } from '../mappers/proposal-reminder.mapper'; -export class OffchainProposalRepository implements OffchainProposalDataSource { +export class OffchainProposalRepository implements OffchainProposalDataSource, VotingReminderDataSource { private anticaptureClient: AnticaptureClient; constructor(anticaptureClient: AnticaptureClient) { @@ -33,4 +35,9 @@ export class OffchainProposalRepository implements OffchainProposalDataSource { return await this.anticaptureClient.listOffchainProposals(variables); } + + async listActiveForReminder(): Promise { + const proposals = await this.listAll({ status: 'active' }); + return proposals.map(mapOffchainToReminderProposal); + } } From 257320782b6acb02f59dacad8f5aea9c6b06a2eb Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 16:24:42 -0300 Subject: [PATCH 08/30] feat: add OffchainVotingReminderTriggerHandler and register in dispatcher Co-Authored-By: Claude Sonnet 4.6 --- apps/dispatcher/src/app.ts | 6 + ...ffchain-voting-reminder-trigger.service.ts | 161 ++++++++++++++++++ 2 files changed, 167 insertions(+) create mode 100644 apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts diff --git a/apps/dispatcher/src/app.ts b/apps/dispatcher/src/app.ts index 25bee677..827a8854 100644 --- a/apps/dispatcher/src/app.ts +++ b/apps/dispatcher/src/app.ts @@ -13,6 +13,7 @@ import { NonVotingHandler } from './services/triggers/non-voting-handler.service import { VoteConfirmationTriggerHandler } from './services/triggers/vote-confirmation-trigger.service'; import { OffchainVoteCastTriggerHandler } from './services/triggers/offchain-vote-cast-trigger.service'; import { VotingReminderTriggerHandler } from './services/triggers/voting-reminder-trigger.service'; +import { OffchainVotingReminderTriggerHandler } from './services/triggers/offchain-voting-reminder-trigger.service'; import { RabbitMQConnection, RabbitMQPublisher } from '@notification-system/rabbitmq-client'; import { AnticaptureClient } from '@notification-system/anticapture-client'; import { NotificationTypeId } from '@notification-system/messages'; @@ -117,6 +118,11 @@ export class App { new VotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient) ); + triggerProcessorService.addHandler( + NotificationTypeId.OffchainVotingReminder75, + new OffchainVotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient) + ); + this.rabbitMQConsumerService = new RabbitMQConsumerService(this.rabbitmqUrl, triggerProcessorService); this.isCreated = true; } diff --git a/apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts b/apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts new file mode 100644 index 00000000..a531c949 --- /dev/null +++ b/apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts @@ -0,0 +1,161 @@ +import type { NotificationTypeId } from '@notification-system/messages'; +import { BaseTriggerHandler } from './base-trigger.service'; +import { DispatcherMessage, MessageProcessingResult } from '../../interfaces/dispatcher-message.interface'; +import { NotificationClientFactory } from '../notification/notification-factory.service'; +import { ISubscriptionClient } from '../../interfaces/subscription-client.interface'; +import { AnticaptureClient } from '@notification-system/anticapture-client'; +import { FormattingService } from '../formatting.service'; +import { offchainVotingReminderMessages, replacePlaceholders, buildButtons } from '@notification-system/messages'; +import { BatchNotificationService } from '../batch-notification.service'; + +/** + * Event data received from logic system for off-chain voting reminders + */ +interface VotingReminderEvent { + id: string; + daoId: string; + title?: string; + description?: string; + startTimestamp: number; + endTimestamp: number; + timeElapsedPercentage: number; + thresholdPercentage: number; + link?: string; + discussion?: string; +} + +/** + * Processing statistics for monitoring + */ +interface ProcessingResult { + sent: number; + skipped: number; + failed: number; +} + +/** + * Handler for off-chain (Snapshot) voting reminder trigger events. + * Processes proposals and sends reminders to subscribed users who haven't voted yet. + * Differs from on-chain handler: uses getOffchainProposalNonVoters (no daoId), + * single message template, and Snapshot-specific buttons. + */ +export class OffchainVotingReminderTriggerHandler extends BaseTriggerHandler { + private readonly batchNotificationService: BatchNotificationService; + + constructor( + protected readonly subscriptionClient: ISubscriptionClient, + protected readonly notificationFactory: NotificationClientFactory, + anticaptureClient: AnticaptureClient + ) { + super(subscriptionClient, notificationFactory, anticaptureClient); + this.batchNotificationService = new BatchNotificationService(subscriptionClient, notificationFactory); + } + + async handleMessage(message: DispatcherMessage): Promise { + const events = message.events; + + if (!events || events.length === 0) { + return { + messageId: `offchain-voting-reminder-empty-${Date.now()}`, + timestamp: new Date().toISOString() + }; + } + + const processedCount: ProcessingResult = { sent: 0, skipped: 0, failed: 0 }; + + for (const event of events) { + try { + const result = await this.processReminderEvent(event, message.triggerId); + processedCount.sent += result.sent; + processedCount.skipped += result.skipped; + processedCount.failed += result.failed; + } catch (error) { + processedCount.failed++; + } + } + + console.log(`[OffchainVotingReminderHandler] Processing complete - Sent: ${processedCount.sent}, Skipped: ${processedCount.skipped}, Failed: ${processedCount.failed}`); + + return { + messageId: `offchain-voting-reminder-${Date.now()}`, + timestamp: new Date().toISOString() + }; + } + + /** + * Processes a single off-chain voting reminder event + */ + private async processReminderEvent(event: VotingReminderEvent, triggerType: NotificationTypeId): Promise { + // Get all subscribed addresses for this DAO + const subscribedAddresses = await this.subscriptionClient.getFollowedAddresses(event.daoId); + + if (subscribedAddresses.length === 0) { + return { sent: 0, skipped: 1, failed: 0 }; + } + + // Check which addresses haven't voted yet on the off-chain proposal + const nonVotingAddresses = await this.getNonVotingAddresses(event.id, subscribedAddresses); + + if (nonVotingAddresses.length === 0) { + return { sent: 0, skipped: 1, failed: 0 }; + } + + // Build buttons: Snapshot proposal link + optional discussion link + const buttons = buildButtons({ + triggerType: 'offchainVotingReminder', + proposalUrl: event.link, + discussionUrl: event.discussion, + }); + + // Send reminders using batch notification service + const sentCount = await this.batchNotificationService.sendBatchNotifications( + nonVotingAddresses, + event.daoId, + triggerType, + () => `${event.id}-${event.thresholdPercentage}-offchain-reminder`, + (address) => this.createReminderMessage(event, address), + (address) => ({ + triggerType: 'offchainVotingReminder', + proposalId: event.id, + thresholdPercentage: event.thresholdPercentage, + timeElapsedPercentage: event.timeElapsedPercentage, + timeRemaining: FormattingService.calculateTimeRemaining(event.endTimestamp), + addresses: { address: address } + }), + () => buttons + ); + + return { sent: sentCount, skipped: 0, failed: 0 }; + } + + /** + * Gets addresses that haven't voted on the specific off-chain proposal. + * Note: unlike on-chain, no daoId is needed for the Snapshot query. + */ + private async getNonVotingAddresses( + proposalId: string, + subscribedAddresses: string[] + ): Promise { + const nonVoters = await this.anticaptureClient!.getOffchainProposalNonVoters( + proposalId, + subscribedAddresses + ); + return nonVoters.map(nv => nv.voter); + } + + /** + * Creates the reminder message using the single off-chain template + */ + private createReminderMessage(event: VotingReminderEvent, address?: string): string { + const timeRemaining = FormattingService.calculateTimeRemaining(event.endTimestamp); + const title = event.title || 'Untitled Proposal'; + + return replacePlaceholders(offchainVotingReminderMessages.default, { + daoId: event.daoId, + title, + timeRemaining, + thresholdPercentage: event.thresholdPercentage.toString(), + address: address || '' + }); + } +} From 4989c7e39e6912afb432de7a0cef4c8bd8a6477b Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 16:27:43 -0300 Subject: [PATCH 09/30] test: add listActiveForReminder tests for proposal repositories Co-Authored-By: Claude Sonnet 4.6 --- .../offchain-proposal.repository.test.ts | 155 +++++++++++++++ .../tests/proposal.repository.test.ts | 182 ++++++++++++++++++ 2 files changed, 337 insertions(+) create mode 100644 apps/logic-system/tests/offchain-proposal.repository.test.ts create mode 100644 apps/logic-system/tests/proposal.repository.test.ts diff --git a/apps/logic-system/tests/offchain-proposal.repository.test.ts b/apps/logic-system/tests/offchain-proposal.repository.test.ts new file mode 100644 index 00000000..a21055da --- /dev/null +++ b/apps/logic-system/tests/offchain-proposal.repository.test.ts @@ -0,0 +1,155 @@ +/** + * @fileoverview Unit tests for OffchainProposalRepository.listActiveForReminder() + */ + +import { describe, it, expect, jest, beforeEach } from '@jest/globals'; +import { OffchainProposalRepository } from '../src/repositories/offchain-proposal.repository'; +import { VotingReminderProposal } from '../src/interfaces/voting-reminder.interface'; + +const createMockAnticaptureClient = () => ({ + listOffchainProposals: jest.fn<() => Promise>(), +}); + +describe('OffchainProposalRepository', () => { + let repository: OffchainProposalRepository; + let mockClient: ReturnType; + + beforeEach(() => { + jest.clearAllMocks(); + mockClient = createMockAnticaptureClient(); + repository = new OffchainProposalRepository(mockClient as any); + }); + + describe('listActiveForReminder', () => { + it('should call listAll with status: active', async () => { + mockClient.listOffchainProposals.mockResolvedValue([]); + + await repository.listActiveForReminder(); + + expect(mockClient.listOffchainProposals).toHaveBeenCalledWith({ status: 'active' }); + }); + + it('should map proposals correctly — uses start when available', async () => { + const mockProposals = [ + { + id: 'snap-1', + title: 'Snapshot Proposal 1', + discussion: 'https://forum.example.com/1', + link: 'https://snapshot.org/#/dao/proposal/1', + state: 'active', + created: 1000000, + end: 2000000, + start: 1000100, // has start field — should be used as startTime + daoId: 'test-dao', + }, + ]; + + mockClient.listOffchainProposals.mockResolvedValue(mockProposals); + + const result = await repository.listActiveForReminder(); + + expect(result).toEqual([ + { + id: 'snap-1', + daoId: 'test-dao', + title: 'Snapshot Proposal 1', + startTime: 1000100, // uses start + endTime: 2000000, + link: 'https://snapshot.org/#/dao/proposal/1', + discussion: 'https://forum.example.com/1', + }, + ]); + }); + + it('should fall back to created when start field is absent', async () => { + const mockProposals = [ + { + id: 'snap-2', + title: 'Snapshot Proposal 2', + discussion: '', + link: 'https://snapshot.org/#/dao/proposal/2', + state: 'active', + created: 1100000, + end: 2100000, + // no start field — should fall back to created + daoId: 'test-dao', + }, + ]; + + mockClient.listOffchainProposals.mockResolvedValue(mockProposals); + + const result = await repository.listActiveForReminder(); + + expect(result).toEqual([ + { + id: 'snap-2', + daoId: 'test-dao', + title: 'Snapshot Proposal 2', + startTime: 1100000, // falls back to created + endTime: 2100000, + link: 'https://snapshot.org/#/dao/proposal/2', + discussion: '', + }, + ]); + }); + + it('should map multiple proposals correctly — mix of start present and absent', async () => { + const mockProposals = [ + { + id: 'snap-1', + title: 'Snapshot Proposal 1', + discussion: 'https://forum.example.com/1', + link: 'https://snapshot.org/#/dao/proposal/1', + state: 'active', + created: 1000000, + end: 2000000, + start: 1000100, + daoId: 'test-dao', + }, + { + id: 'snap-2', + title: 'Snapshot Proposal 2', + discussion: '', + link: 'https://snapshot.org/#/dao/proposal/2', + state: 'active', + created: 1100000, + end: 2100000, + daoId: 'test-dao', + }, + ]; + + mockClient.listOffchainProposals.mockResolvedValue(mockProposals); + + const result = await repository.listActiveForReminder(); + + expect(result).toEqual([ + { + id: 'snap-1', + daoId: 'test-dao', + title: 'Snapshot Proposal 1', + startTime: 1000100, + endTime: 2000000, + link: 'https://snapshot.org/#/dao/proposal/1', + discussion: 'https://forum.example.com/1', + }, + { + id: 'snap-2', + daoId: 'test-dao', + title: 'Snapshot Proposal 2', + startTime: 1100000, + endTime: 2100000, + link: 'https://snapshot.org/#/dao/proposal/2', + discussion: '', + }, + ]); + }); + + it('should return empty array when there are no active proposals', async () => { + mockClient.listOffchainProposals.mockResolvedValue([]); + + const result = await repository.listActiveForReminder(); + + expect(result).toEqual([]); + }); + }); +}); diff --git a/apps/logic-system/tests/proposal.repository.test.ts b/apps/logic-system/tests/proposal.repository.test.ts new file mode 100644 index 00000000..39e5f8db --- /dev/null +++ b/apps/logic-system/tests/proposal.repository.test.ts @@ -0,0 +1,182 @@ +/** + * @fileoverview Unit tests for ProposalRepository.listActiveForReminder() + */ + +import { describe, it, expect, jest, beforeEach } from '@jest/globals'; +import { ProposalRepository } from '../src/repositories/proposal.repository'; +import { VotingReminderProposal } from '../src/interfaces/voting-reminder.interface'; + +const createMockAnticaptureClient = () => ({ + listProposals: jest.fn<() => Promise>(), + getProposalById: jest.fn<() => Promise>(), +}); + +describe('ProposalRepository', () => { + let repository: ProposalRepository; + let mockClient: ReturnType; + + beforeEach(() => { + jest.clearAllMocks(); + mockClient = createMockAnticaptureClient(); + repository = new ProposalRepository(mockClient as any); + }); + + describe('listActiveForReminder', () => { + it('should call listAll with status ACTIVE and includeOptimisticProposals false', async () => { + mockClient.listProposals.mockResolvedValue([]); + + await repository.listActiveForReminder(); + + expect(mockClient.listProposals).toHaveBeenCalledWith( + { status: 'ACTIVE', includeOptimisticProposals: false }, + undefined + ); + }); + + it('should map proposals correctly — timestamp to startTime, endTimestamp to endTime', async () => { + const mockProposals = [ + { + id: 'prop-1', + daoId: 'test-dao', + title: 'On-chain Proposal', + description: 'A governance proposal', + timestamp: 1000000, + endTimestamp: 2000000, + status: 'ACTIVE', + __typename: 'OnchainProposal', + proposerAccountId: 'user1', + targets: [], + values: [], + signatures: [], + calldatas: [], + startBlock: 100, + endBlock: 200, + forVotes: '0', + againstVotes: '0', + abstainVotes: '0', + txHash: '0xabc', + }, + ]; + + mockClient.listProposals.mockResolvedValue(mockProposals); + + const result = await repository.listActiveForReminder(); + + expect(result).toEqual([ + { + id: 'prop-1', + daoId: 'test-dao', + title: 'On-chain Proposal', + description: 'A governance proposal', + startTime: 1000000, + endTime: 2000000, + }, + ]); + }); + + it('should carry through title and description', async () => { + const mockProposals = [ + { + id: 'prop-2', + daoId: 'dao-abc', + title: 'Proposal with Title', + description: 'Detailed description here', + timestamp: 500000, + endTimestamp: 600000, + status: 'ACTIVE', + __typename: 'OnchainProposal', + proposerAccountId: 'user2', + targets: [], + values: [], + signatures: [], + calldatas: [], + startBlock: 50, + endBlock: 100, + forVotes: '1000', + againstVotes: '500', + abstainVotes: '0', + txHash: '0xdef', + }, + ]; + + mockClient.listProposals.mockResolvedValue(mockProposals); + + const result = await repository.listActiveForReminder(); + + expect(result[0].title).toBe('Proposal with Title'); + expect(result[0].description).toBe('Detailed description here'); + }); + + it('should filter out proposals with null timestamp', async () => { + const mockProposals = [ + { + id: 'prop-no-ts', + daoId: 'test-dao', + title: 'Proposal without timestamp', + description: 'Missing timestamps', + timestamp: null, + endTimestamp: 2000000, + status: 'ACTIVE', + __typename: 'OnchainProposal', + proposerAccountId: 'user1', + targets: [], + values: [], + signatures: [], + calldatas: [], + startBlock: 100, + endBlock: 200, + forVotes: '0', + againstVotes: '0', + abstainVotes: '0', + txHash: '0xabc', + }, + ]; + + mockClient.listProposals.mockResolvedValue(mockProposals); + + const result = await repository.listActiveForReminder(); + + expect(result).toEqual([]); + }); + + it('should filter out proposals with null endTimestamp', async () => { + const mockProposals = [ + { + id: 'prop-no-end', + daoId: 'test-dao', + title: 'Proposal without end timestamp', + description: 'Missing end timestamp', + timestamp: 1000000, + endTimestamp: null, + status: 'ACTIVE', + __typename: 'OnchainProposal', + proposerAccountId: 'user1', + targets: [], + values: [], + signatures: [], + calldatas: [], + startBlock: 100, + endBlock: 200, + forVotes: '0', + againstVotes: '0', + abstainVotes: '0', + txHash: '0xabc', + }, + ]; + + mockClient.listProposals.mockResolvedValue(mockProposals); + + const result = await repository.listActiveForReminder(); + + expect(result).toEqual([]); + }); + + it('should return empty array when there are no active proposals', async () => { + mockClient.listProposals.mockResolvedValue([]); + + const result = await repository.listActiveForReminder(); + + expect(result).toEqual([]); + }); + }); +}); From a88711b14eb385b4c7110006175ddc225d02298b Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 16:27:48 -0300 Subject: [PATCH 10/30] test: add unit tests for OffchainVotingReminderTriggerHandler Co-Authored-By: Claude Sonnet 4.6 --- ...in-voting-reminder-trigger.service.test.ts | 220 ++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts diff --git a/apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts b/apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts new file mode 100644 index 00000000..6e099c3d --- /dev/null +++ b/apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts @@ -0,0 +1,220 @@ +/** + * @fileoverview Tests for OffchainVotingReminderTriggerHandler + */ + +import { OffchainVotingReminderTriggerHandler } from './offchain-voting-reminder-trigger.service'; +import { DispatcherMessage } from '../../interfaces/dispatcher-message.interface'; +import { ISubscriptionClient } from '../../interfaces/subscription-client.interface'; +import { NotificationClientFactory } from '../notification/notification-factory.service'; +import { AnticaptureClient } from '@notification-system/anticapture-client'; +import { NotificationTypeId } from '@notification-system/messages'; + +describe('OffchainVotingReminderTriggerHandler', () => { + let handler: OffchainVotingReminderTriggerHandler; + let mockSubscriptionClient: jest.Mocked; + let mockNotificationFactory: jest.Mocked; + let mockAnticaptureClient: jest.Mocked; + + const mockUser = { + id: 'user-123', + channel: 'telegram', + channel_user_id: 'tg-123', + created_at: new Date('2024-01-01T00:00:00Z') + }; + + const mockVotingReminderEvent = { + id: 'snapshot-proposal-123', + daoId: 'test-dao', + title: 'Test Snapshot Proposal', + description: undefined, + startTimestamp: 1000000, + endTimestamp: 2000000, + timeElapsedPercentage: 76.5, + thresholdPercentage: 75, + link: 'https://snapshot.org/#/test-dao/proposal/123', + discussion: 'https://forum.test-dao.org/t/123' + }; + + beforeEach(() => { + mockSubscriptionClient = { + getFollowedAddresses: jest.fn(), + getWalletOwnersBatch: jest.fn(), + shouldSend: jest.fn(), + shouldSendBatch: jest.fn(), + getDaoSubscribers: jest.fn(), + markAsSent: jest.fn() + } as any; + + mockNotificationFactory = { + supportsChannel: jest.fn().mockReturnValue(true), + getClient: jest.fn().mockReturnValue({ + sendNotification: jest.fn().mockResolvedValue(undefined) + }) + } as any; + + mockAnticaptureClient = { + getOffchainProposalNonVoters: jest.fn() + } as any; + + handler = new OffchainVotingReminderTriggerHandler( + mockSubscriptionClient, + mockNotificationFactory, + mockAnticaptureClient + ); + + // Mock Date.now for consistent time calculations + jest.spyOn(Date, 'now').mockReturnValue(1500000 * 1000); + }); + + afterEach(() => { + jest.restoreAllMocks(); + }); + + describe('handleMessage', () => { + it('should handle empty events array', async () => { + const message: DispatcherMessage = { + triggerId: NotificationTypeId.OffchainVotingReminder75, + events: [] + }; + + const result = await handler.handleMessage(message); + + expect(result.messageId).toMatch(/offchain-voting-reminder-empty-/); + expect(mockSubscriptionClient.getFollowedAddresses).not.toHaveBeenCalled(); + }); + + it('should skip when no subscribed addresses found', async () => { + const message: DispatcherMessage = { + triggerId: NotificationTypeId.OffchainVotingReminder75, + events: [mockVotingReminderEvent] + }; + + mockSubscriptionClient.getFollowedAddresses.mockResolvedValue([]); + + const result = await handler.handleMessage(message); + + expect(result.messageId).toMatch(/offchain-voting-reminder-/); + expect(mockAnticaptureClient.getOffchainProposalNonVoters).not.toHaveBeenCalled(); + }); + + it('should skip when all users have already voted', async () => { + const message: DispatcherMessage = { + triggerId: NotificationTypeId.OffchainVotingReminder75, + events: [mockVotingReminderEvent] + }; + + mockSubscriptionClient.getFollowedAddresses.mockResolvedValue(['0x123']); + mockAnticaptureClient.getOffchainProposalNonVoters.mockResolvedValue([]); // Empty array - all have voted + + const result = await handler.handleMessage(message); + + expect(result.messageId).toMatch(/offchain-voting-reminder-/); + expect(mockSubscriptionClient.getWalletOwnersBatch).not.toHaveBeenCalled(); + }); + + it('should process voting reminder events successfully', async () => { + const message: DispatcherMessage = { + triggerId: NotificationTypeId.OffchainVotingReminder75, + events: [mockVotingReminderEvent] + }; + + // Setup mocks + mockSubscriptionClient.getFollowedAddresses.mockResolvedValue(['0x123', '0x456']); + mockAnticaptureClient.getOffchainProposalNonVoters.mockResolvedValue([ + { voter: '0x456' } // Only 0x456 hasn't voted + ]); + mockSubscriptionClient.getWalletOwnersBatch.mockResolvedValue({ + '0x456': [mockUser] // Only 0x456 (non-voter) has users + }); + mockSubscriptionClient.getDaoSubscribers.mockResolvedValue([mockUser]); + mockSubscriptionClient.shouldSendBatch.mockResolvedValue([[{ + user_id: mockUser.id, + event_id: 'snapshot-proposal-123-75-offchain-reminder', + dao_id: 'test-dao' + }]]); + mockSubscriptionClient.markAsSent.mockResolvedValue(undefined); + + const result = await handler.handleMessage(message); + + expect(result.messageId).toMatch(/offchain-voting-reminder-/); + expect(mockSubscriptionClient.getFollowedAddresses).toHaveBeenCalledWith('test-dao'); + // NOTE: called with (proposalId, addresses) — NO daoId parameter + expect(mockAnticaptureClient.getOffchainProposalNonVoters).toHaveBeenCalledWith( + 'snapshot-proposal-123', + ['0x123', '0x456'] + ); + expect(mockSubscriptionClient.getWalletOwnersBatch).toHaveBeenCalledWith( + ['0x456'], + NotificationTypeId.OffchainVotingReminder75 + ); + }); + + it('should use single offchain message template (Snapshot Voting Reminder)', async () => { + const message: DispatcherMessage = { + triggerId: NotificationTypeId.OffchainVotingReminder75, + events: [mockVotingReminderEvent] + }; + + const mockSendNotification = jest.fn().mockResolvedValue(undefined); + mockNotificationFactory.getClient.mockReturnValue({ sendNotification: mockSendNotification } as any); + + mockSubscriptionClient.getFollowedAddresses.mockResolvedValue(['0x456']); + mockAnticaptureClient.getOffchainProposalNonVoters.mockResolvedValue([ + { voter: '0x456' } + ]); + mockSubscriptionClient.getWalletOwnersBatch.mockResolvedValue({ + '0x456': [mockUser] + }); + mockSubscriptionClient.getDaoSubscribers.mockResolvedValue([mockUser]); + mockSubscriptionClient.shouldSendBatch.mockResolvedValue([[{ + user_id: mockUser.id, + event_id: 'snapshot-proposal-123-75-offchain-reminder', + dao_id: 'test-dao' + }]]); + mockSubscriptionClient.markAsSent.mockResolvedValue(undefined); + + await handler.handleMessage(message); + + // Verify the notification client was called and message uses "Snapshot Voting Reminder" (single offchain template) + expect(mockSendNotification).toHaveBeenCalled(); + const callArgs = mockSendNotification.mock.calls[0]; + const notificationMessage: string = callArgs[0].message; + expect(notificationMessage).toContain('Snapshot Voting Reminder'); + }); + + it('should continue processing other events when one fails', async () => { + const failingEvent = { ...mockVotingReminderEvent, id: 'failing-proposal' }; + const successfulEvent = { ...mockVotingReminderEvent, id: 'successful-proposal' }; + + const message: DispatcherMessage = { + triggerId: NotificationTypeId.OffchainVotingReminder75, + events: [failingEvent, successfulEvent] + }; + + // Make first call fail, second succeed + mockSubscriptionClient.getFollowedAddresses + .mockRejectedValueOnce(new Error('Network error')) + .mockResolvedValueOnce(['0x456']); + + mockAnticaptureClient.getOffchainProposalNonVoters.mockResolvedValue([ + { voter: '0x456' } + ]); + mockSubscriptionClient.getWalletOwnersBatch.mockResolvedValue({ + '0x456': [mockUser] + }); + mockSubscriptionClient.getDaoSubscribers.mockResolvedValue([mockUser]); + mockSubscriptionClient.shouldSendBatch.mockResolvedValue([[{ + user_id: mockUser.id, + event_id: 'successful-proposal-75-offchain-reminder', + dao_id: 'test-dao' + }]]); + mockSubscriptionClient.markAsSent.mockResolvedValue(undefined); + + const result = await handler.handleMessage(message); + + expect(result.messageId).toMatch(/offchain-voting-reminder-/); + // Should have attempted both events + expect(mockSubscriptionClient.getFollowedAddresses).toHaveBeenCalledTimes(2); + }); + }); +}); From 94966e0f655b899ac431432f7afb47857b2fbb93 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 16:33:51 -0300 Subject: [PATCH 11/30] feat: update queries --- .../factories/offchain-proposal-factory.ts | 1 + .../src/mocks/graphql-mock-setup.ts | 27 +- .../queries/offchain-proposals.graphql | 2 +- .../queries/offchain-votes.graphql | 12 +- .../queries/proposalNonVoters.graphql | 2 +- .../queries/proposals.graphql | 34 +- .../queries/threshold.graphql | 4 +- .../anticapture-client/queries/votes.graphql | 16 +- .../queries/voting-power.graphql | 4 +- packages/anticapture-client/src/gql/gql.ts | 42 +- .../anticapture-client/src/gql/graphql.ts | 2520 ++++++++--------- 11 files changed, 1214 insertions(+), 1450 deletions(-) diff --git a/apps/integrated-tests/src/fixtures/factories/offchain-proposal-factory.ts b/apps/integrated-tests/src/fixtures/factories/offchain-proposal-factory.ts index 61acf82d..85fe0a63 100644 --- a/apps/integrated-tests/src/fixtures/factories/offchain-proposal-factory.ts +++ b/apps/integrated-tests/src/fixtures/factories/offchain-proposal-factory.ts @@ -11,6 +11,7 @@ export interface OffchainProposalData { state: string; created: number; end: number; + start?: number; // actual voting start time (falls back to created if absent) } /** diff --git a/apps/integrated-tests/src/mocks/graphql-mock-setup.ts b/apps/integrated-tests/src/mocks/graphql-mock-setup.ts index 3ad67787..a0865f0f 100644 --- a/apps/integrated-tests/src/mocks/graphql-mock-setup.ts +++ b/apps/integrated-tests/src/mocks/graphql-mock-setup.ts @@ -88,7 +88,7 @@ export class GraphQLMockSetup { filtered = filtered.filter(p => p.daoId === config.headers['anticapture-dao-id']); } return Promise.resolve({ - data: { data: { offchainProposals: { items: filtered.map(p => ({ id: p.id, title: p.title, discussion: p.discussion, link: p.link, state: p.state, created: p.created, end: p.end })), totalCount: filtered.length } } } + data: { data: { offchainProposals: { items: filtered.map(p => ({ id: p.id, title: p.title, discussion: p.discussion, link: p.link, state: p.state, created: p.created, end: p.end, start: p.start })), totalCount: filtered.length } } } }); } @@ -198,6 +198,31 @@ export class GraphQLMockSetup { }); } + // Handle offchain proposal non-voters (MUST come before ProposalNonVoters check) + if (data.query?.includes('OffchainProposalNonVoters')) { + const proposalId = data.variables?.id; + const addressesStr = data.variables?.addresses || ''; + const addressesFilter = addressesStr ? addressesStr.split(',') : []; + + // Get addresses that voted on this offchain proposal + const votersSet = new Set( + offchainVotesData + .filter((v: any) => v.proposalId === proposalId) + .map((v: any) => v.voter.toLowerCase()) + ); + + // Filter to find non-voters from the provided address list + const nonVoterItems = addressesFilter + .filter((addr: string) => !votersSet.has(addr.toLowerCase())) + .map((addr: string) => ({ + voter: addr + })); + + return Promise.resolve({ + data: { data: { offchainProposalNonVoters: { items: nonVoterItems, totalCount: nonVoterItems.length } } } + }); + } + // Handle proposal non-voters if (data.query?.includes('ProposalNonVoters')) { const proposalId = data.variables?.id; diff --git a/packages/anticapture-client/queries/offchain-proposals.graphql b/packages/anticapture-client/queries/offchain-proposals.graphql index 0dff285f..f169fe9d 100644 --- a/packages/anticapture-client/queries/offchain-proposals.graphql +++ b/packages/anticapture-client/queries/offchain-proposals.graphql @@ -1,4 +1,4 @@ -query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) { +query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) { offchainProposals(skip: $skip, limit: $limit, orderDirection: $orderDirection, status: $status, fromDate: $fromDate, endDate: $endDate) { items { id diff --git a/packages/anticapture-client/queries/offchain-votes.graphql b/packages/anticapture-client/queries/offchain-votes.graphql index f58e1ebb..0a29721d 100644 --- a/packages/anticapture-client/queries/offchain-votes.graphql +++ b/packages/anticapture-client/queries/offchain-votes.graphql @@ -1,11 +1,11 @@ query ListOffchainVotes( - $fromDate: Float - $toDate: Float - $limit: Float - $skip: NonNegativeInt + $fromDate: Int + $toDate: Int + $limit: Int + $skip: Int $orderBy: queryInput_votesOffchain_orderBy - $orderDirection: queryInput_votesOffchain_orderDirection - $voterAddresses: JSON + $orderDirection: OrderDirection + $voterAddresses: [String] ) { votesOffchain( fromDate: $fromDate diff --git a/packages/anticapture-client/queries/proposalNonVoters.graphql b/packages/anticapture-client/queries/proposalNonVoters.graphql index 05cf0f57..b451fa30 100644 --- a/packages/anticapture-client/queries/proposalNonVoters.graphql +++ b/packages/anticapture-client/queries/proposalNonVoters.graphql @@ -1,6 +1,6 @@ query ProposalNonVoters( $id: String! - $addresses: JSON + $addresses: [String] ) { proposalNonVoters( id: $id diff --git a/packages/anticapture-client/queries/proposals.graphql b/packages/anticapture-client/queries/proposals.graphql index cd5c2b40..9e75d501 100644 --- a/packages/anticapture-client/queries/proposals.graphql +++ b/packages/anticapture-client/queries/proposals.graphql @@ -1,23 +1,25 @@ query GetProposalById($id: String!) { proposal(id: $id) { - id - daoId - proposerAccountId - title - description - startBlock - endBlock - endTimestamp - timestamp - status - forVotes - againstVotes - abstainVotes - txHash + ... on OnchainProposal { + id + daoId + proposerAccountId + title + description + startBlock + endBlock + endTimestamp + timestamp + status + forVotes + againstVotes + abstainVotes + txHash + } } } -query ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) { +query ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) { proposals(skip: $skip, limit: $limit, orderDirection: $orderDirection, status: $status, fromDate: $fromDate, fromEndDate: $fromEndDate, includeOptimisticProposals: $includeOptimisticProposals) { items { id @@ -37,4 +39,4 @@ query ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: } totalCount } -} \ No newline at end of file +} diff --git a/packages/anticapture-client/queries/threshold.graphql b/packages/anticapture-client/queries/threshold.graphql index 8ea5facb..ed5ccddd 100644 --- a/packages/anticapture-client/queries/threshold.graphql +++ b/packages/anticapture-client/queries/threshold.graphql @@ -1,5 +1,5 @@ -query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) { +query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) { getEventRelevanceThreshold(relevance: $relevance, type: $type) { threshold } -} \ No newline at end of file +} diff --git a/packages/anticapture-client/queries/votes.graphql b/packages/anticapture-client/queries/votes.graphql index a1fd32da..797bcc09 100644 --- a/packages/anticapture-client/queries/votes.graphql +++ b/packages/anticapture-client/queries/votes.graphql @@ -1,12 +1,12 @@ query ListVotes( - $voterAddressIn: JSON - $fromDate: Float - $toDate: Float - $limit: Float - $skip: NonNegativeInt + $voterAddressIn: [String] + $fromDate: Int + $toDate: Int + $limit: Int + $skip: Int $orderBy: queryInput_votes_orderBy - $orderDirection: queryInput_votes_orderDirection - $support: Float + $orderDirection: OrderDirection + $support: String ) { votes( voterAddressIn: $voterAddressIn @@ -30,4 +30,4 @@ query ListVotes( } totalCount } -} \ No newline at end of file +} diff --git a/packages/anticapture-client/queries/voting-power.graphql b/packages/anticapture-client/queries/voting-power.graphql index be4d40ed..257cefaf 100644 --- a/packages/anticapture-client/queries/voting-power.graphql +++ b/packages/anticapture-client/queries/voting-power.graphql @@ -1,4 +1,4 @@ -query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) { +query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) { historicalVotingPower(limit: $limit, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, fromDate: $fromDate, address: $address) { items { accountId @@ -22,4 +22,4 @@ query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $ord } totalCount } -} \ No newline at end of file +} diff --git a/packages/anticapture-client/src/gql/gql.ts b/packages/anticapture-client/src/gql/gql.ts index d00f912d..5043eb3a 100644 --- a/packages/anticapture-client/src/gql/gql.ts +++ b/packages/anticapture-client/src/gql/gql.ts @@ -15,23 +15,23 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document- */ type Documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": typeof types.GetDaOsDocument, - "query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": typeof types.ListOffchainProposalsDocument, - "query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": typeof types.ListOffchainVotesDocument, - "query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": typeof types.ProposalNonVotersDocument, - "query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": typeof types.GetProposalByIdDocument, - "query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": typeof types.GetEventRelevanceThresholdDocument, - "query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": typeof types.ListVotesDocument, - "query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": typeof types.ListHistoricalVotingPowerDocument, + "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": typeof types.ListOffchainProposalsDocument, + "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": typeof types.ListOffchainVotesDocument, + "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": typeof types.ProposalNonVotersDocument, + "query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": typeof types.GetProposalByIdDocument, + "query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": typeof types.GetEventRelevanceThresholdDocument, + "query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": typeof types.ListVotesDocument, + "query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": typeof types.ListHistoricalVotingPowerDocument, }; const documents: Documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": types.GetDaOsDocument, - "query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": types.ListOffchainProposalsDocument, - "query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": types.ListOffchainVotesDocument, - "query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": types.ProposalNonVotersDocument, - "query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": types.GetProposalByIdDocument, - "query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": types.GetEventRelevanceThresholdDocument, - "query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": types.ListVotesDocument, - "query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": types.ListHistoricalVotingPowerDocument, + "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": types.ListOffchainProposalsDocument, + "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": types.ListOffchainVotesDocument, + "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": types.ProposalNonVotersDocument, + "query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": types.GetProposalByIdDocument, + "query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": types.GetEventRelevanceThresholdDocument, + "query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": types.ListVotesDocument, + "query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": types.ListHistoricalVotingPowerDocument, }; /** @@ -55,31 +55,31 @@ export function graphql(source: "query GetDAOs {\n daos {\n items {\n i /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"]; +export function graphql(source: "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"]; +export function graphql(source: "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"): (typeof documents)["query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"]; +export function graphql(source: "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"): (typeof documents)["query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"): (typeof documents)["query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"]; +export function graphql(source: "query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"): (typeof documents)["query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"): (typeof documents)["query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"]; +export function graphql(source: "query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"): (typeof documents)["query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"): (typeof documents)["query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"]; +export function graphql(source: "query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"): (typeof documents)["query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"): (typeof documents)["query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"]; +export function graphql(source: "query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"): (typeof documents)["query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; diff --git a/packages/anticapture-client/src/gql/graphql.ts b/packages/anticapture-client/src/gql/graphql.ts index 0a98d117..bb3583c7 100644 --- a/packages/anticapture-client/src/gql/graphql.ts +++ b/packages/anticapture-client/src/gql/graphql.ts @@ -14,13 +14,92 @@ export type Scalars = { Boolean: { input: boolean; output: boolean; } Int: { input: number; output: number; } Float: { input: number; output: number; } + /** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */ + DateTime: { input: any; output: any; } /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ JSON: { input: any; output: any; } - /** Integers that will have a value of 0 or more. */ - NonNegativeInt: { input: any; output: any; } ObjMap: { input: any; output: any; } - /** Integers that will have a value greater than 0. */ - PositiveInt: { input: any; output: any; } + /** A field whose value conforms to the standard URL format as specified in RFC3986: https://www.ietf.org/rfc/rfc3986.txt. */ + URL: { input: any; output: any; } +}; + +/** Balance delta for a single account across two timestamps. */ +export type AccountBalanceVariation = { + __typename?: 'AccountBalanceVariation'; + /** Absolute balance change encoded as a decimal string. */ + absoluteChange: Scalars['String']['output']; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Balance at the end of the comparison window. */ + currentBalance: Scalars['String']['output']; + /** Relative balance change encoded as a decimal string. */ + percentageChange: Scalars['String']['output']; + /** Balance at the start of the comparison window. */ + previousBalance: Scalars['String']['output']; +}; + +/** Balance variation response for a single account. */ +export type AccountBalanceVariationsByAccountIdResponse = { + __typename?: 'AccountBalanceVariationsByAccountIdResponse'; + data: AccountBalanceVariation; + period: PeriodResponse; +}; + +/** List of balance variations for multiple accounts in the selected period. */ +export type AccountBalanceVariationsResponse = { + __typename?: 'AccountBalanceVariationsResponse'; + items: Array>; + period: PeriodResponse; +}; + +export type AccountBalanceWithVariation = { + __typename?: 'AccountBalanceWithVariation'; + address: Scalars['String']['output']; + balance: Scalars['String']['output']; + delegate: Scalars['String']['output']; + tokenId: Scalars['String']['output']; + variation: AccountBalanceVariation; +}; + +export type AccountBalanceWithVariationResponse = { + __typename?: 'AccountBalanceWithVariationResponse'; + data: AccountBalanceWithVariation; + period: PeriodResponse; +}; + +export type AccountBalancesWithVariationResponse = { + __typename?: 'AccountBalancesWithVariationResponse'; + items: Array>; + period: PeriodResponse; + totalCount: Scalars['Int']['output']; +}; + +/** Aggregated interaction metrics between the requested account and another account. */ +export type AccountInteraction = { + __typename?: 'AccountInteraction'; + /** Counterparty account ID. */ + accountId: Scalars['String']['output']; + /** Net amount transferred between the requested account and the counterparty. */ + amountTransferred: Scalars['String']['output']; + /** Gross transfer volume between the requested account and the counterparty. */ + totalVolume: Scalars['String']['output']; + /** Number of transfers observed for the interaction pair. */ + transferCount: Scalars['String']['output']; +}; + +/** Paginated list of account interaction aggregates. */ +export type AccountInteractionsResponse = { + __typename?: 'AccountInteractionsResponse'; + items: Array>; + period: PeriodResponse; + totalCount: Scalars['Int']['output']; +}; + +/** Active token supply for the selected comparison window. */ +export type ActiveSupplyResponse = { + __typename?: 'ActiveSupplyResponse'; + /** Active token supply encoded as a decimal string. */ + activeSupply: Scalars['String']['output']; }; export type AverageDelegationPercentageItem = { @@ -40,9 +119,147 @@ export type AverageDelegationPercentagePage = { totalCount: Scalars['Int']['output']; }; +/** Average turnout comparison between two adjacent time windows. */ +export type AverageTurnoutComparisonResponse = { + __typename?: 'AverageTurnoutComparisonResponse'; + /** Relative change between current and previous periods. */ + changeRate: Scalars['Float']['output']; + /** Average turnout for the current period encoded as a string. */ + currentAverageTurnout: Scalars['String']['output']; + /** Average turnout for the previous period encoded as a string. */ + oldAverageTurnout: Scalars['String']['output']; +}; + export type DaoList = { __typename?: 'DAOList'; - items: Array; + items: Array; + totalCount: Scalars['Int']['output']; +}; + +/** Current governance parameters and feature flags for the active DAO. */ +export type DaoResponse = { + __typename?: 'DaoResponse'; + alreadySupportCalldataReview: Scalars['Boolean']['output']; + chainId: Scalars['Int']['output']; + id: Scalars['String']['output']; + proposalThreshold: Scalars['String']['output']; + quorum: Scalars['String']['output']; + supportOffchainData: Scalars['Boolean']['output']; + timelockDelay: Scalars['String']['output']; + votingDelay: Scalars['String']['output']; + votingPeriod: Scalars['String']['output']; +}; + +export enum DaysWindow { + '7d' = '_7d', + '30d' = '_30d', + '90d' = '_90d', + '180d' = '_180d', + '365d' = '_365d' +} + +/** Single delegation transfer event in the historical delegation feed. */ +export type DelegationItem = { + __typename?: 'DelegationItem'; + amount: Scalars['String']['output']; + delegateAddress: Scalars['String']['output']; + delegatorAddress: Scalars['String']['output']; + timestamp: Scalars['String']['output']; + transactionHash: Scalars['String']['output']; +}; + +export type DelegationPercentageItem = { + __typename?: 'DelegationPercentageItem'; + /** Unix day bucket represented as a timestamp string. */ + date: Scalars['String']['output']; + /** Delegation percentage value for the day bucket. */ + high: Scalars['String']['output']; +}; + +export type DelegationPercentageResponse = { + __typename?: 'DelegationPercentageResponse'; + items: Array>; + pageInfo: PageInfo; + /** Total number of matching day buckets. */ + totalCount: Scalars['Int']['output']; +}; + +/** Paginated historical delegations response. */ +export type DelegationsResponse = { + __typename?: 'DelegationsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + +/** Aggregated delegation amount and latest timestamp for one delegator. */ +export type DelegatorItem = { + __typename?: 'DelegatorItem'; + amount: Scalars['String']['output']; + delegatorAddress: Scalars['String']['output']; + timestamp: Scalars['String']['output']; +}; + +/** Paginated delegators for a delegate address. */ +export type DelegatorsResponse = { + __typename?: 'DelegatorsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + +/** Generic error payload returned by the API. */ +export type ErrorResponse = { + __typename?: 'ErrorResponse'; + /** Human-readable error message */ + error: Scalars['String']['output']; + /** Optional implementation detail or validation context for the error. */ + message?: Maybe; +}; + +/** Resolved threshold for a feed event type and relevance level. */ +export type EventRelevanceThresholdResponse = { + __typename?: 'EventRelevanceThresholdResponse'; + /** Threshold value encoded as a decimal string. */ + threshold: Scalars['String']['output']; +}; + +/** Filter events by governance activity type. */ +export enum FeedEventType { + Delegation = 'DELEGATION', + Proposal = 'PROPOSAL', + ProposalExtended = 'PROPOSAL_EXTENDED', + Transfer = 'TRANSFER', + Vote = 'VOTE' +} + +/** Single event in the governance activity feed. */ +export type FeedItem = { + __typename?: 'FeedItem'; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Type-specific metadata for the feed event. */ + metadata?: Maybe; + relevance: FeedRelevance; + /** Event timestamp in Unix seconds. */ + timestamp: Scalars['Int']['output']; + /** Transaction hash. */ + txHash: Scalars['String']['output']; + type: FeedEventType; + /** Optional event value encoded as a decimal string when applicable. */ + value?: Maybe; +}; + +/** Filter events by relevance tier. */ +export enum FeedRelevance { + High = 'HIGH', + Low = 'LOW', + Medium = 'MEDIUM' +} + +/** Paginated governance activity feed response. */ +export type FeedResponse = { + __typename?: 'FeedResponse'; + items: Array>; + /** Total number of matching feed events. */ totalCount: Scalars['Int']['output']; }; @@ -58,6 +275,235 @@ export enum HttpMethod { Trace = 'TRACE' } +/** Single historical balance record enriched with transfer context. */ +export type HistoricalBalance = { + __typename?: 'HistoricalBalance'; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Account balance after the historical event. */ + balance: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Balance change introduced by the historical event. */ + delta: Scalars['String']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Event timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; + transfer: HistoricalBalanceTransfer; +}; + +/** Transfer event associated with a historical balance row. */ +export type HistoricalBalanceTransfer = { + __typename?: 'HistoricalBalanceTransfer'; + /** Sender address. */ + from: Scalars['String']['output']; + /** Recipient address. */ + to: Scalars['String']['output']; + /** Transferred amount encoded as a decimal string. */ + value: Scalars['String']['output']; +}; + +/** Paginated historical balance records for one account. */ +export type HistoricalBalancesResponse = { + __typename?: 'HistoricalBalancesResponse'; + items: Array>; + /** Total number of matching historical balance rows. */ + totalCount: Scalars['Int']['output']; +}; + +/** Single historical voting power record enriched with delegation and transfer context. */ +export type HistoricalVotingPower = { + __typename?: 'HistoricalVotingPower'; + /** Account address. */ + accountId: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + delegation?: Maybe; + /** Voting power change introduced by the event. */ + delta: Scalars['String']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Event timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; + transfer?: Maybe; + /** Voting power after the event, encoded as a decimal string. */ + votingPower: Scalars['String']['output']; +}; + +/** Delegation event associated with a historical voting power row. */ +export type HistoricalVotingPowerDelegation = { + __typename?: 'HistoricalVotingPowerDelegation'; + from: Scalars['String']['output']; + previousDelegate?: Maybe; + to: Scalars['String']['output']; + value: Scalars['String']['output']; +}; + +/** Transfer event associated with a historical voting power row. */ +export type HistoricalVotingPowerTransfer = { + __typename?: 'HistoricalVotingPowerTransfer'; + from: Scalars['String']['output']; + to: Scalars['String']['output']; + value: Scalars['String']['output']; +}; + +/** Paginated historical voting power records. */ +export type HistoricalVotingPowersResponse = { + __typename?: 'HistoricalVotingPowersResponse'; + items: Array>; + /** Total number of matching historical voting power rows. */ + totalCount: Scalars['Int']['output']; +}; + +/** Response payload describing the latest update time for a chart. */ +export type LastUpdateResponse = { + __typename?: 'LastUpdateResponse'; + /** Latest refresh time in ISO-8601 format. */ + lastUpdate: Scalars['DateTime']['output']; +}; + +export type OffchainProposal = { + __typename?: 'OffchainProposal'; + /** Address or ENS of the author. */ + author: Scalars['String']['output']; + /** Proposal body. */ + body: Scalars['String']['output']; + choices: Array>; + /** Creation timestamp in Unix seconds. */ + created: Scalars['Int']['output']; + /** Discussion URL or thread reference. */ + discussion: Scalars['String']['output']; + /** Voting end timestamp in Unix seconds. */ + end: Scalars['Int']['output']; + /** Whether the proposal was flagged by Snapshot. */ + flagged: Scalars['Boolean']['output']; + /** Snapshot proposal identifier. */ + id: Scalars['String']['output']; + /** Canonical Snapshot proposal URL. */ + link: Scalars['String']['output']; + network: Scalars['String']['output']; + scores: Array>; + snapshot?: Maybe; + /** Snapshot space identifier. */ + spaceId: Scalars['String']['output']; + /** Voting start timestamp in Unix seconds. */ + start: Scalars['Int']['output']; + /** Current Snapshot proposal state. */ + state: Scalars['String']['output']; + strategies: Array>; + /** Proposal title. */ + title: Scalars['String']['output']; + /** Snapshot proposal type. */ + type: Scalars['String']['output']; + /** Last update timestamp in Unix seconds. */ + updated: Scalars['Int']['output']; +}; + +export type OffchainProposalsResponse = { + __typename?: 'OffchainProposalsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + +export type OffchainVote = { + __typename?: 'OffchainVote'; + choice: Scalars['JSON']['output']; + created: Scalars['Int']['output']; + proposalId: Scalars['String']['output']; + proposalTitle?: Maybe; + reason: Scalars['String']['output']; + voter: Scalars['String']['output']; + vp?: Maybe; +}; + +export type OffchainVotesResponse = { + __typename?: 'OffchainVotesResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + +export type OnchainProposal = { + __typename?: 'OnchainProposal'; + /** Abstain votes, encoded as a decimal string. */ + abstainVotes: Scalars['String']['output']; + /** Votes cast against, encoded as a decimal string. */ + againstVotes: Scalars['String']['output']; + /** Encoded calldata payloads executed by the proposal. */ + calldatas: Array>; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Proposal body. */ + description: Scalars['String']['output']; + /** End block number. */ + endBlock: Scalars['Int']['output']; + /** Proposal end timestamp in Unix seconds. */ + endTimestamp: Scalars['Int']['output']; + /** Votes cast in favor, encoded as a decimal string. */ + forVotes: Scalars['String']['output']; + /** Onchain proposal identifier. */ + id: Scalars['String']['output']; + /** Optional proposal type discriminator. */ + proposalType?: Maybe; + /** Address that created the proposal. */ + proposerAccountId: Scalars['String']['output']; + /** Required quorum encoded as a decimal string. */ + quorum: Scalars['String']['output']; + /** Start block number. */ + startBlock: Scalars['Int']['output']; + /** Proposal start timestamp in Unix seconds. */ + startTimestamp: Scalars['Int']['output']; + /** Current proposal status. */ + status: Scalars['String']['output']; + /** Contract targets invoked by the proposal. */ + targets: Array>; + /** Proposal creation timestamp in Unix seconds. */ + timestamp: Scalars['Int']['output']; + /** Proposal title. */ + title: Scalars['String']['output']; + /** Proposal creation transaction hash. */ + txHash: Scalars['String']['output']; + /** ETH values attached to each call, encoded as strings. */ + values: Array>; +}; + +export type OnchainProposalsResponse = { + __typename?: 'OnchainProposalsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + +export type OnchainVote = { + __typename?: 'OnchainVote'; + proposalId: Scalars['String']['output']; + proposalTitle?: Maybe; + reason?: Maybe; + /** Governance vote direction. */ + support?: Maybe; + /** Vote timestamp in Unix seconds. */ + timestamp: Scalars['Int']['output']; + transactionHash: Scalars['String']['output']; + voterAddress: Scalars['String']['output']; + /** Voting power encoded as a decimal string. */ + votingPower: Scalars['String']['output']; +}; + +export type OnchainVotesResponse = { + __typename?: 'OnchainVotesResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + +/** Sort direction for ordered query results. */ +export enum OrderDirection { + Asc = 'asc', + Desc = 'desc' +} + export type PageInfo = { __typename?: 'PageInfo'; endDate?: Maybe; @@ -66,21 +512,114 @@ export type PageInfo = { startDate?: Maybe; }; +/** Inclusive time period represented as ISO-8601 timestamps. */ +export type PeriodResponse = { + __typename?: 'PeriodResponse'; + endTimestamp: Scalars['String']['output']; + startTimestamp: Scalars['String']['output']; +}; + +/** Combined proposal and delegate vote context for one activity row. */ +export type ProposalActivityItem = { + __typename?: 'ProposalActivityItem'; + proposal: ProposalActivityProposal; + userVote?: Maybe; +}; + +/** Proposal snapshot included in the delegate activity response. */ +export type ProposalActivityProposal = { + __typename?: 'ProposalActivityProposal'; + /** Abstain votes, encoded as a decimal string. */ + abstainVotes: Scalars['String']['output']; + /** Votes cast against, encoded as a decimal string. */ + againstVotes: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Proposal body. */ + description: Scalars['String']['output']; + /** End block number. */ + endBlock: Scalars['Float']['output']; + /** Votes cast in favor, encoded as a decimal string. */ + forVotes: Scalars['String']['output']; + /** Onchain proposal identifier. */ + id: Scalars['String']['output']; + /** Address that created the proposal. */ + proposerAccountId: Scalars['String']['output']; + /** Start block number. */ + startBlock: Scalars['Float']['output']; + /** Current proposal status. */ + status: Scalars['String']['output']; + /** Proposal creation timestamp in Unix seconds as a string. */ + timestamp?: Maybe; + /** Proposal title. */ + title: Scalars['String']['output']; +}; + +/** Delegate proposal activity metrics and proposal-by-proposal history. */ +export type ProposalActivityResponse = { + __typename?: 'ProposalActivityResponse'; + /** Delegate address. */ + address: Scalars['String']['output']; + /** Average seconds between the delegate vote and proposal end time. */ + avgTimeBeforeEnd: Scalars['Float']['output']; + /** Whether the delegate never cast a vote. */ + neverVoted: Scalars['Boolean']['output']; + proposals: Array>; + /** Total proposals reviewed in the dataset. */ + totalProposals: Scalars['Int']['output']; + /** Number of proposals the delegate voted on. */ + votedProposals: Scalars['Int']['output']; + /** Share of proposals where the delegate sided with outcome. */ + winRate: Scalars['Float']['output']; + /** Share of delegate votes cast in support. */ + yesRate: Scalars['Float']['output']; +}; + +/** Vote cast by the requested delegate for a given proposal. */ +export type ProposalActivityUserVote = { + __typename?: 'ProposalActivityUserVote'; + /** Vote identifier. */ + id: Scalars['String']['output']; + /** Related proposal ID. */ + proposalId: Scalars['String']['output']; + /** Optional vote rationale. */ + reason?: Maybe; + /** Governance vote direction. */ + support: Scalars['String']['output']; + /** Vote timestamp in Unix seconds as a string. */ + timestamp?: Maybe; + /** Address that cast the vote. */ + voterAccountId: Scalars['String']['output']; + /** Voting power used by the delegate, encoded as a string. */ + votingPower?: Maybe; +}; + +/** Proposal launch comparison between two adjacent time windows. */ +export type ProposalsComparisonResponse = { + __typename?: 'ProposalsComparisonResponse'; + /** Relative change between current and previous periods. */ + changeRate: Scalars['Float']['output']; + /** Number of proposals launched in the current period. */ + currentProposalsLaunched: Scalars['Int']['output']; + /** Number of proposals launched in the comparison period. */ + oldProposalsLaunched: Scalars['Int']['output']; +}; + export type Query = { __typename?: 'Query'; /** Returns account balance information for a specific address */ - accountBalanceByAccountId?: Maybe; + accountBalanceByAccountId?: Maybe; /** Returns a mapping of the biggest variations to account balances associated by account address */ - accountBalanceVariations?: Maybe; + accountBalanceVariations?: Maybe; /** Returns a the changes to balance by period and accountId */ - accountBalanceVariationsByAccountId?: Maybe; + accountBalanceVariationsByAccountId?: Maybe; /** Returns sorted and paginated account balance records */ - accountBalances?: Maybe; + accountBalances?: Maybe; /** * Returns a mapping of the largest interactions between accounts. * Positive amounts signify net token transfers FROM
, whilst negative amounts refer to net transfers TO
*/ - accountInteractions?: Maybe; + accountInteractions?: Maybe; /** * Average delegation percentage across all supported DAOs by day. * Returns the mean delegation percentage for each day in the specified range. @@ -88,137 +627,137 @@ export type Query = { */ averageDelegationPercentageByDay: AverageDelegationPercentagePage; /** Get active token supply for DAO */ - compareActiveSupply?: Maybe; + compareActiveSupply?: Maybe; /** Compare average turnout between time periods */ - compareAverageTurnout?: Maybe; + compareAverageTurnout?: Maybe; /** Compare cex supply between periods */ - compareCexSupply?: Maybe; + compareCexSupply?: Maybe; /** Compare circulating supply between periods */ - compareCirculatingSupply?: Maybe; + compareCirculatingSupply?: Maybe; /** Compare delegated supply between periods */ - compareDelegatedSupply?: Maybe; + compareDelegatedSupply?: Maybe; /** Compare dex supply between periods */ - compareDexSupply?: Maybe; + compareDexSupply?: Maybe; /** Compare lending supply between periods */ - compareLendingSupply?: Maybe; + compareLendingSupply?: Maybe; /** Compare number of proposals between time periods */ - compareProposals?: Maybe; + compareProposals?: Maybe; /** Compare total supply between periods */ - compareTotalSupply?: Maybe; + compareTotalSupply?: Maybe; /** Compare treasury between periods */ - compareTreasury?: Maybe; + compareTreasury?: Maybe; /** Compare number of votes between time periods */ - compareVotes?: Maybe; + compareVotes?: Maybe; /** Returns current governance parameters for this DAO */ - dao?: Maybe; + dao?: Maybe; /** Get all DAOs */ daos: DaoList; /** Get delegation percentage day buckets with forward-fill */ - delegationPercentageByDay?: Maybe; + delegationPercentageByDay?: Maybe; /** Get current delegations for an account */ - delegations?: Maybe; + delegations?: Maybe; /** Get current delegators of an account with voting power */ - delegators?: Maybe; + delegators?: Maybe; /** Get feed events */ - feedEvents?: Maybe; + feedEvents?: Maybe; /** Returns label information from Arkham, ENS data, and whether the address is an EOA or contract. Arkham data is stored permanently. ENS data is cached with a configurable TTL. */ getAddress?: Maybe; /** Returns label information from Arkham, ENS data, and address type for multiple addresses. Maximum 100 addresses per request. Arkham data is stored permanently. ENS data is cached with a configurable TTL. */ getAddresses?: Maybe; /** Get historical DAO Token Treasury value (governance token quantity × token price) */ - getDaoTokenTreasury?: Maybe; + getDaoTokenTreasury?: Maybe; /** Get event relevance threshold */ - getEventRelevanceThreshold?: Maybe; + getEventRelevanceThreshold?: Maybe; /** Get historical Liquid Treasury (treasury without DAO tokens) from external providers (DefiLlama/Dune) */ - getLiquidTreasury?: Maybe; + getLiquidTreasury?: Maybe; /** Get historical Total Treasury (liquid treasury + DAO token treasury) */ - getTotalTreasury?: Maybe; - /** TODO */ - historicalBalances?: Maybe; + getTotalTreasury?: Maybe; + /** Returns historical balance deltas for one account, enriched with the transfer that caused each change. */ + historicalBalances?: Maybe; /** Get historical delegations for an account, with optional filtering and sorting */ - historicalDelegations?: Maybe; + historicalDelegations?: Maybe; /** Get historical market data for a specific token */ - historicalTokenData?: Maybe>>; + historicalTokenData?: Maybe>>; /** Returns a list of voting power changes. */ - historicalVotingPower?: Maybe; + historicalVotingPower?: Maybe; /** Returns a list of voting power changes for a specific account */ - historicalVotingPowerByAccountId?: Maybe; + historicalVotingPowerByAccountId?: Maybe; /** Get the last update time */ - lastUpdate?: Maybe; + lastUpdate?: Maybe; /** Returns a single offchain (Snapshot) proposal by its ID */ - offchainProposalById?: Maybe; + offchainProposalById?: Maybe; /** Returns a list of offchain (Snapshot) proposals */ - offchainProposals?: Maybe; + offchainProposals?: Maybe; /** Returns a single proposal by its ID */ - proposal?: Maybe; + proposal?: Maybe; /** Returns the active delegates that did not vote on a given proposal */ - proposalNonVoters?: Maybe; + proposalNonVoters?: Maybe; /** Returns a list of proposal */ - proposals?: Maybe; + proposals?: Maybe; /** Returns proposal activity data including voting history, win rates, and detailed proposal information for the specified delegate within the given time window */ - proposalsActivity?: Maybe; + proposalsActivity?: Maybe; /** Get property data for a specific token */ - token?: Maybe; + token?: Maybe; /** Returns token related metrics for a single metric type. */ - tokenMetrics?: Maybe; + tokenMetrics?: Maybe; /** Get transactions with their associated transfers and delegations, with optional filtering and sorting */ - transactions?: Maybe; + transactions?: Maybe; /** Get transfers of a given address */ - transfers?: Maybe; + transfers?: Maybe; /** Get all votes ordered by timestamp or voting power */ - votes?: Maybe; + votes?: Maybe; /** Returns a paginated list of votes cast on a specific proposal */ - votesByProposalId?: Maybe; + votesByProposalId?: Maybe; /** Returns a list of offchain (Snapshot) votes */ - votesOffchain?: Maybe; + votesOffchain?: Maybe; /** Returns a paginated list of offchain (Snapshot) votes for a specific proposal */ - votesOffchainByProposalId?: Maybe; + votesOffchainByProposalId?: Maybe; /** Returns voting power information for a specific address (account) */ - votingPowerByAccountId?: Maybe; + votingPowerByAccountId?: Maybe; /** Returns a mapping of the voting power changes within a time frame for the given addresses */ - votingPowerVariations?: Maybe; + votingPowerVariations?: Maybe; /** Returns a the changes to voting power by period and accountId */ - votingPowerVariationsByAccountId?: Maybe; + votingPowerVariationsByAccountId?: Maybe; /** Returns sorted and paginated account voting power records */ - votingPowers?: Maybe; + votingPowers?: Maybe; }; export type QueryAccountBalanceByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAccountBalanceVariationsArgs = { - addresses?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + addresses?: InputMaybe>>; + fromDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAccountBalanceVariationsByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAccountBalancesArgs = { - addresses?: InputMaybe; - delegates?: InputMaybe; + addresses?: InputMaybe>>; + delegates?: InputMaybe>>; excludeDaoAddresses?: InputMaybe; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; @@ -226,14 +765,14 @@ export type QueryAccountBalancesArgs = { export type QueryAccountInteractionsArgs = { address: Scalars['String']['input']; filterAddress?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; maxAmount?: InputMaybe; minAmount?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; }; @@ -248,67 +787,67 @@ export type QueryAverageDelegationPercentageByDayArgs = { export type QueryCompareActiveSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareAverageTurnoutArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareCexSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareCirculatingSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareDelegatedSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareDexSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareLendingSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareProposalsArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareTotalSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareTreasuryArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareVotesArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryDelegationPercentageByDayArgs = { - after?: InputMaybe; - before?: InputMaybe; - endDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - startDate?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + endDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + startDate?: InputMaybe; }; @@ -319,21 +858,21 @@ export type QueryDelegationsArgs = { export type QueryDelegatorsArgs = { address: Scalars['String']['input']; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; }; export type QueryFeedEventsArgs = { - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; + orderDirection?: InputMaybe; relevance?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; type?: InputMaybe; }; @@ -344,86 +883,86 @@ export type QueryGetAddressArgs = { export type QueryGetAddressesArgs = { - addresses: Scalars['JSON']['input']; + addresses: Array>; }; export type QueryGetDaoTokenTreasuryArgs = { - days?: InputMaybe; - order?: InputMaybe; + days?: InputMaybe; + orderDirection?: InputMaybe; }; export type QueryGetEventRelevanceThresholdArgs = { - relevance: QueryInput_GetEventRelevanceThreshold_Relevance; - type: QueryInput_GetEventRelevanceThreshold_Type; + relevance: FeedRelevance; + type: FeedEventType; }; export type QueryGetLiquidTreasuryArgs = { - days?: InputMaybe; - order?: InputMaybe; + days?: InputMaybe; + orderDirection?: InputMaybe; }; export type QueryGetTotalTreasuryArgs = { - days?: InputMaybe; - order?: InputMaybe; + days?: InputMaybe; + orderDirection?: InputMaybe; }; export type QueryHistoricalBalancesArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryHistoricalDelegationsArgs = { address: Scalars['String']['input']; - delegateAddressIn?: InputMaybe; + delegateAddressIn?: InputMaybe>>; fromValue?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; toValue?: InputMaybe; }; export type QueryHistoricalTokenDataArgs = { - limit?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; }; export type QueryHistoricalVotingPowerArgs = { address?: InputMaybe; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryHistoricalVotingPowerByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; @@ -439,12 +978,12 @@ export type QueryOffchainProposalByIdArgs = { export type QueryOffchainProposalsArgs = { - endDate?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - status?: InputMaybe; + endDate?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + status?: InputMaybe>>; }; @@ -454,32 +993,32 @@ export type QueryProposalArgs = { export type QueryProposalNonVotersArgs = { - addresses?: InputMaybe; + addresses?: InputMaybe>>; id: Scalars['String']['input']; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; }; export type QueryProposalsArgs = { - fromDate?: InputMaybe; - fromEndDate?: InputMaybe; - includeOptimisticProposals?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - status?: InputMaybe; + fromDate?: InputMaybe; + fromEndDate?: InputMaybe; + includeOptimisticProposals?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + status?: InputMaybe>>; }; export type QueryProposalsActivityArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; userVoteFilter?: InputMaybe; }; @@ -490,26 +1029,25 @@ export type QueryTokenArgs = { export type QueryTokenMetricsArgs = { - endDate?: InputMaybe; - limit?: InputMaybe; + endDate?: InputMaybe; + limit?: InputMaybe; metricType: QueryInput_TokenMetrics_MetricType; - orderDirection?: InputMaybe; - skip?: InputMaybe; - startDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + startDate?: InputMaybe; }; export type QueryTransactionsArgs = { - affectedSupply?: InputMaybe; + affectedSupply?: InputMaybe>>; from?: InputMaybe; fromDate?: InputMaybe; - includes?: InputMaybe; - limit?: InputMaybe; + includes?: InputMaybe>>; + limit?: InputMaybe; maxAmount?: InputMaybe; minAmount?: InputMaybe; - offset?: InputMaybe; - sortBy?: InputMaybe; - sortOrder?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; to?: InputMaybe; toDate?: InputMaybe; }; @@ -518,391 +1056,372 @@ export type QueryTransactionsArgs = { export type QueryTransfersArgs = { address: Scalars['String']['input']; from?: InputMaybe; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; - offset?: InputMaybe; - sortBy?: InputMaybe; - sortOrder?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; to?: InputMaybe; - toDate?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryVotesArgs = { - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - support?: InputMaybe; - toDate?: InputMaybe; - voterAddressIn?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + support?: InputMaybe; + toDate?: InputMaybe; + voterAddressIn?: InputMaybe>>; }; export type QueryVotesByProposalIdArgs = { - fromDate?: InputMaybe; + fromDate?: InputMaybe; id: Scalars['String']['input']; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - support?: InputMaybe; - toDate?: InputMaybe; - voterAddressIn?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + support?: InputMaybe; + toDate?: InputMaybe; + voterAddressIn?: InputMaybe>>; }; export type QueryVotesOffchainArgs = { - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; - voterAddresses?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; + voterAddresses?: InputMaybe>>; }; export type QueryVotesOffchainByProposalIdArgs = { - fromDate?: InputMaybe; + fromDate?: InputMaybe; id: Scalars['String']['input']; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; - voterAddresses?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; + voterAddresses?: InputMaybe>>; }; export type QueryVotingPowerByAccountIdArgs = { accountId: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryVotingPowerVariationsArgs = { - addresses?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + addresses?: InputMaybe>>; + fromDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; }; export type QueryVotingPowerVariationsByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryVotingPowersArgs = { - addresses?: InputMaybe; - fromDate?: InputMaybe; + addresses?: InputMaybe>>; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; -export type AccountBalanceByAccountId_200_Response = { - __typename?: 'accountBalanceByAccountId_200_response'; - data: Query_AccountBalanceByAccountId_Data; - period: Query_AccountBalanceByAccountId_Period; +/** Supply metric comparison between current and previous periods. */ +export type SupplyComparisonResponse = { + __typename?: 'SupplyComparisonResponse'; + changeRate: Scalars['Float']['output']; + currentValue: Scalars['String']['output']; + previousValue: Scalars['String']['output']; }; -export type AccountBalanceVariationsByAccountId_200_Response = { - __typename?: 'accountBalanceVariationsByAccountId_200_response'; - data: Query_AccountBalanceVariationsByAccountId_Data; - period: Query_AccountBalanceVariationsByAccountId_Period; +export type TokenHistoricalPriceItem = { + __typename?: 'TokenHistoricalPriceItem'; + /** Historical price value as a decimal string. */ + price: Scalars['String']['output']; + /** Unix timestamp in seconds. */ + timestamp: Scalars['Int']['output']; }; -export type AccountBalanceVariations_200_Response = { - __typename?: 'accountBalanceVariations_200_response'; - items: Array>; - period: Query_AccountBalanceVariations_Period; +export type TokenMetricItem = { + __typename?: 'TokenMetricItem'; + /** Unix day bucket represented as a timestamp string. */ + date: Scalars['String']['output']; + /** Highest observed value for the period. */ + high: Scalars['String']['output']; + /** Total volume observed for the period. */ + volume: Scalars['String']['output']; }; -export type AccountBalances_200_Response = { - __typename?: 'accountBalances_200_response'; - items: Array>; - period: Query_AccountBalances_Period; - totalCount: Scalars['Float']['output']; +export type TokenMetricsResponse = { + __typename?: 'TokenMetricsResponse'; + items: Array>; + pageInfo: PageInfo; }; -export type AccountInteractions_200_Response = { - __typename?: 'accountInteractions_200_response'; - items: Array>; - period: Query_AccountInteractions_Period; - totalCount: Scalars['Float']['output']; +/** Token properties enriched with the current token price. */ +export type TokenPropertiesResponse = { + __typename?: 'TokenPropertiesResponse'; + cexSupply: Scalars['String']['output']; + circulatingSupply: Scalars['String']['output']; + /** Token decimals. */ + decimals: Scalars['Int']['output']; + delegatedSupply: Scalars['String']['output']; + dexSupply: Scalars['String']['output']; + id: Scalars['String']['output']; + lendingSupply: Scalars['String']['output']; + name?: Maybe; + nonCirculatingSupply: Scalars['String']['output']; + price: Scalars['String']['output']; + totalSupply: Scalars['String']['output']; + treasury: Scalars['String']['output']; }; -export type CompareActiveSupply_200_Response = { - __typename?: 'compareActiveSupply_200_response'; - activeSupply: Scalars['String']['output']; +/** Transaction response enriched with transfer and delegation events. */ +export type Transaction = { + __typename?: 'Transaction'; + delegations: Array>; + /** Resolved sender address, if known. */ + from?: Maybe; + /** Whether the transaction touched a centralized exchange. */ + isCex: Scalars['Boolean']['output']; + /** Whether the transaction touched a decentralized exchange. */ + isDex: Scalars['Boolean']['output']; + /** Whether the transaction touched a lending protocol. */ + isLending: Scalars['Boolean']['output']; + /** Whether the transaction counts toward total tracked supply. */ + isTotal: Scalars['Boolean']['output']; + /** Transaction timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Resolved recipient address, if known. */ + to?: Maybe; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; + transfers: Array>; }; -export type CompareAverageTurnout_200_Response = { - __typename?: 'compareAverageTurnout_200_response'; - changeRate: Scalars['Float']['output']; - currentAverageTurnout: Scalars['String']['output']; - oldAverageTurnout: Scalars['String']['output']; +/** Delegation event embedded within a transaction response. */ +export type TransactionDelegation = { + __typename?: 'TransactionDelegation'; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Delegate address. */ + delegateAccountId: Scalars['String']['output']; + /** Delegated amount encoded as a decimal string. */ + delegatedValue: Scalars['String']['output']; + /** Delegator address. */ + delegatorAccountId: Scalars['String']['output']; + /** Whether the delegation touched a centralized exchange. */ + isCex: Scalars['Boolean']['output']; + /** Whether the delegation touched a decentralized exchange. */ + isDex: Scalars['Boolean']['output']; + /** Whether the delegation touched a lending protocol. */ + isLending: Scalars['Boolean']['output']; + /** Whether the delegation counts toward total tracked supply. */ + isTotal: Scalars['Boolean']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Previous delegate address, if one existed. */ + previousDelegate?: Maybe; + /** Delegation timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; }; -export type CompareCexSupply_200_Response = { - __typename?: 'compareCexSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentCexSupply: Scalars['String']['output']; - oldCexSupply: Scalars['String']['output']; +/** Paginated transactions with embedded transfer and delegation data. */ +export type TransactionsResponse = { + __typename?: 'TransactionsResponse'; + items: Array>; + /** Total number of matching transactions. */ + totalCount: Scalars['Int']['output']; }; -export type CompareCirculatingSupply_200_Response = { - __typename?: 'compareCirculatingSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentCirculatingSupply: Scalars['String']['output']; - oldCirculatingSupply: Scalars['String']['output']; +export type Transfer = { + __typename?: 'Transfer'; + /** Transferred amount encoded as a decimal string. */ + amount: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Sender address. */ + fromAccountId: Scalars['String']['output']; + /** Whether the transfer touched a centralized exchange. */ + isCex: Scalars['Boolean']['output']; + /** Whether the transfer touched a decentralized exchange. */ + isDex: Scalars['Boolean']['output']; + /** Whether the transfer touched a lending protocol. */ + isLending: Scalars['Boolean']['output']; + /** Whether the transfer counts toward total tracked supply. */ + isTotal: Scalars['Boolean']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Transfer timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Recipient address. */ + toAccountId: Scalars['String']['output']; + /** Token contract address. */ + tokenId: Scalars['String']['output']; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; }; -export type CompareDelegatedSupply_200_Response = { - __typename?: 'compareDelegatedSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentDelegatedSupply: Scalars['String']['output']; - oldDelegatedSupply: Scalars['String']['output']; +export type TransfersResponse = { + __typename?: 'TransfersResponse'; + items: Array>; + /** Total number of matching transfers. */ + totalCount: Scalars['Int']['output']; }; -export type CompareDexSupply_200_Response = { - __typename?: 'compareDexSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentDexSupply: Scalars['String']['output']; - oldDexSupply: Scalars['String']['output']; +/** Single treasury time-series datapoint. */ +export type TreasuryItem = { + __typename?: 'TreasuryItem'; + /** Unix timestamp in milliseconds */ + date: Scalars['Float']['output']; + /** Treasury value in USD */ + value: Scalars['Float']['output']; }; -export type CompareLendingSupply_200_Response = { - __typename?: 'compareLendingSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentLendingSupply: Scalars['String']['output']; - oldLendingSupply: Scalars['String']['output']; +/** Paginated treasury time-series response. */ +export type TreasuryResponse = { + __typename?: 'TreasuryResponse'; + items: Array>; + /** Total number of items */ + totalCount: Scalars['Int']['output']; }; -export type CompareProposals_200_Response = { - __typename?: 'compareProposals_200_response'; - changeRate: Scalars['Float']['output']; - currentProposalsLaunched: Scalars['Float']['output']; - oldProposalsLaunched: Scalars['Float']['output']; +/** Voter or non-voter record associated with a proposal. */ +export type Voter = { + __typename?: 'Voter'; + lastVoteTimestamp: Scalars['Float']['output']; + voter: Scalars['String']['output']; + votingPower: Scalars['String']['output']; + votingPowerVariation: Scalars['String']['output']; }; -export type CompareTotalSupply_200_Response = { - __typename?: 'compareTotalSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentTotalSupply: Scalars['String']['output']; - oldTotalSupply: Scalars['String']['output']; +/** Paginated voter or non-voter records for a proposal. */ +export type VotersResponse = { + __typename?: 'VotersResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; }; -export type CompareTreasury_200_Response = { - __typename?: 'compareTreasury_200_response'; +/** Vote-count comparison between two adjacent time windows. */ +export type VotesComparisonResponse = { + __typename?: 'VotesComparisonResponse'; + /** Relative change between current and previous periods. */ changeRate: Scalars['Float']['output']; - currentTreasury: Scalars['String']['output']; - oldTreasury: Scalars['String']['output']; + /** Number of votes cast in the current period. */ + currentVotes: Scalars['Int']['output']; + /** Number of votes cast in the comparison period. */ + oldVotes: Scalars['Int']['output']; }; -export type CompareVotes_200_Response = { - __typename?: 'compareVotes_200_response'; - changeRate: Scalars['Float']['output']; - currentVotes: Scalars['Float']['output']; - oldVotes: Scalars['Float']['output']; +/** Current voting power snapshot for one account. */ +export type VotingPower = { + __typename?: 'VotingPower'; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Current token balance encoded as a decimal string. */ + balance?: Maybe; + /** Total delegations associated with the account. */ + delegationsCount: Scalars['Int']['output']; + /** Total proposals created by the account. */ + proposalsCount: Scalars['Int']['output']; + variation: VotingPowerVariationField; + /** Total votes cast by the account. */ + votesCount: Scalars['Int']['output']; + /** Current voting power encoded as a decimal string. */ + votingPower: Scalars['String']['output']; }; -export type Dao_200_Response = { - __typename?: 'dao_200_response'; - alreadySupportCalldataReview: Scalars['Boolean']['output']; - chainId: Scalars['Float']['output']; - id: Scalars['String']['output']; - proposalThreshold: Scalars['String']['output']; - quorum: Scalars['String']['output']; - supportOffchainData: Scalars['Boolean']['output']; - timelockDelay: Scalars['String']['output']; - votingDelay: Scalars['String']['output']; - votingPeriod: Scalars['String']['output']; +/** Voting power delta for a single account across two timestamps. */ +export type VotingPowerVariation = { + __typename?: 'VotingPowerVariation'; + /** Absolute voting power change encoded as a decimal string. */ + absoluteChange: Scalars['String']['output']; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Voting power at the end of the comparison window. */ + currentVotingPower: Scalars['String']['output']; + /** Relative voting power change encoded as a decimal string. */ + percentageChange: Scalars['String']['output']; + /** Voting power at the start of the comparison window. */ + previousVotingPower: Scalars['String']['output']; }; -export type DelegationPercentageByDay_200_Response = { - __typename?: 'delegationPercentageByDay_200_response'; - items: Array>; - pageInfo: Query_DelegationPercentageByDay_PageInfo; - totalCount: Scalars['Float']['output']; +/** Embedded voting power delta metadata for a current voting power row. */ +export type VotingPowerVariationField = { + __typename?: 'VotingPowerVariationField'; + absoluteChange: Scalars['String']['output']; + percentageChange: Scalars['String']['output']; }; -export type Delegations_200_Response = { - __typename?: 'delegations_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; +/** Voting power variation response for a single account. */ +export type VotingPowerVariationsByAccountIdResponse = { + __typename?: 'VotingPowerVariationsByAccountIdResponse'; + data: VotingPowerVariation; + period: PeriodResponse; }; -export type Delegators_200_Response = { - __typename?: 'delegators_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; +/** List of voting power variations for multiple accounts in the selected period. */ +export type VotingPowerVariationsResponse = { + __typename?: 'VotingPowerVariationsResponse'; + items: Array>; + period: PeriodResponse; }; -export type FeedEvents_200_Response = { - __typename?: 'feedEvents_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; +/** Paginated current voting power records. */ +export type VotingPowersResponse = { + __typename?: 'VotingPowersResponse'; + items: Array>; + /** Total number of matching voting power rows. */ + totalCount: Scalars['Int']['output']; }; export type GetAddress_200_Response = { __typename?: 'getAddress_200_response'; + /** EIP-55 checksummed Ethereum address */ address: Scalars['String']['output']; arkham?: Maybe; ens?: Maybe; + /** Whether the address is a smart contract (true) or an externally-owned account (false) */ isContract: Scalars['Boolean']['output']; }; export type GetAddresses_200_Response = { __typename?: 'getAddresses_200_response'; + /** Enrichment results for each successfully resolved address. Addresses that failed to resolve are omitted. */ results: Array>; }; -export type GetDaoTokenTreasury_200_Response = { - __typename?: 'getDaoTokenTreasury_200_response'; - items: Array>; - /** Total number of items */ - totalCount: Scalars['Float']['output']; -}; - -export type GetEventRelevanceThreshold_200_Response = { - __typename?: 'getEventRelevanceThreshold_200_response'; - threshold: Scalars['String']['output']; -}; - -export type GetLiquidTreasury_200_Response = { - __typename?: 'getLiquidTreasury_200_response'; - items: Array>; - /** Total number of items */ - totalCount: Scalars['Float']['output']; -}; - -export type GetTotalTreasury_200_Response = { - __typename?: 'getTotalTreasury_200_response'; - items: Array>; - /** Total number of items */ - totalCount: Scalars['Float']['output']; -}; - -export type HistoricalBalances_200_Response = { - __typename?: 'historicalBalances_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type HistoricalDelegations_200_Response = { - __typename?: 'historicalDelegations_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type HistoricalVotingPowerByAccountId_200_Response = { - __typename?: 'historicalVotingPowerByAccountId_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type HistoricalVotingPower_200_Response = { - __typename?: 'historicalVotingPower_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type LastUpdate_200_Response = { - __typename?: 'lastUpdate_200_response'; - lastUpdate: Scalars['String']['output']; -}; - -export type OffchainProposalById_200_Response = { - __typename?: 'offchainProposalById_200_response'; - author: Scalars['String']['output']; - body: Scalars['String']['output']; - created: Scalars['Float']['output']; - discussion: Scalars['String']['output']; - end: Scalars['Float']['output']; - flagged: Scalars['Boolean']['output']; - id: Scalars['String']['output']; - link: Scalars['String']['output']; - spaceId: Scalars['String']['output']; - start: Scalars['Float']['output']; - state: Scalars['String']['output']; - title: Scalars['String']['output']; - type: Scalars['String']['output']; - updated: Scalars['Float']['output']; -}; - -export type OffchainProposals_200_Response = { - __typename?: 'offchainProposals_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type ProposalNonVoters_200_Response = { - __typename?: 'proposalNonVoters_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type Proposal_200_Response = { - __typename?: 'proposal_200_response'; - abstainVotes: Scalars['String']['output']; - againstVotes: Scalars['String']['output']; - calldatas: Array>; - daoId: Scalars['String']['output']; - description: Scalars['String']['output']; - endBlock: Scalars['Float']['output']; - endTimestamp: Scalars['String']['output']; - forVotes: Scalars['String']['output']; - id: Scalars['String']['output']; - proposalType?: Maybe; - proposerAccountId: Scalars['String']['output']; - quorum: Scalars['String']['output']; - startBlock: Scalars['Float']['output']; - startTimestamp: Scalars['String']['output']; - status: Scalars['String']['output']; - targets: Array>; - timestamp: Scalars['String']['output']; - title: Scalars['String']['output']; - txHash: Scalars['String']['output']; - values: Array>; -}; - -export type ProposalsActivity_200_Response = { - __typename?: 'proposalsActivity_200_response'; - address: Scalars['String']['output']; - avgTimeBeforeEnd: Scalars['Float']['output']; - neverVoted: Scalars['Boolean']['output']; - proposals: Array>; - totalProposals: Scalars['Float']['output']; - votedProposals: Scalars['Float']['output']; - winRate: Scalars['Float']['output']; - yesRate: Scalars['Float']['output']; -}; - -export type Proposals_200_Response = { - __typename?: 'proposals_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; +export type OffchainProposalById_Response = ErrorResponse | OffchainProposal; -export enum QueryInput_AccountBalanceVariations_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} +export type Proposal_Response = ErrorResponse | OnchainProposal; export enum QueryInput_AccountBalances_OrderBy { Balance = 'balance', @@ -910,264 +1429,78 @@ export enum QueryInput_AccountBalances_OrderBy { Variation = 'variation' } -export enum QueryInput_AccountBalances_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Field used to sort interaction rows. */ export enum QueryInput_AccountInteractions_OrderBy { Count = 'count', Volume = 'volume' } -export enum QueryInput_AccountInteractions_OrderDirection { - Asc = 'asc', - Desc = 'desc' +export enum QueryInput_Delegators_OrderBy { + Amount = 'amount', + Timestamp = 'timestamp' } -export enum QueryInput_CompareActiveSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' +/** Field used to sort feed events. */ +export enum QueryInput_FeedEvents_OrderBy { + Timestamp = 'timestamp', + Value = 'value' } -export enum QueryInput_CompareAverageTurnout_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' +/** Filter events by relevance tier. */ +export enum QueryInput_FeedEvents_Relevance { + High = 'HIGH', + Low = 'LOW', + Medium = 'MEDIUM' } -export enum QueryInput_CompareCexSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareCirculatingSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareDelegatedSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareDexSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareLendingSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareProposals_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareTotalSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareTreasury_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareVotes_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_DelegationPercentageByDay_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_Delegators_OrderBy { - Amount = 'amount', - Timestamp = 'timestamp' -} - -export enum QueryInput_Delegators_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_FeedEvents_OrderBy { - Timestamp = 'timestamp', - Value = 'value' -} - -export enum QueryInput_FeedEvents_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_FeedEvents_Relevance { - High = 'HIGH', - Low = 'LOW', - Medium = 'MEDIUM' -} - -export enum QueryInput_FeedEvents_Type { - Delegation = 'DELEGATION', - Proposal = 'PROPOSAL', - ProposalExtended = 'PROPOSAL_EXTENDED', - Transfer = 'TRANSFER', - Vote = 'VOTE' -} - -export enum QueryInput_GetDaoTokenTreasury_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_GetDaoTokenTreasury_Order { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_GetEventRelevanceThreshold_Relevance { - High = 'HIGH', - Low = 'LOW', - Medium = 'MEDIUM' -} - -export enum QueryInput_GetEventRelevanceThreshold_Type { - Delegation = 'DELEGATION', - Proposal = 'PROPOSAL', - ProposalExtended = 'PROPOSAL_EXTENDED', - Transfer = 'TRANSFER', - Vote = 'VOTE' -} - -export enum QueryInput_GetLiquidTreasury_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_GetLiquidTreasury_Order { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_GetTotalTreasury_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_GetTotalTreasury_Order { - Asc = 'asc', - Desc = 'desc' +/** Filter events by governance activity type. */ +export enum QueryInput_FeedEvents_Type { + Delegation = 'DELEGATION', + Proposal = 'PROPOSAL', + ProposalExtended = 'PROPOSAL_EXTENDED', + Transfer = 'TRANSFER', + Vote = 'VOTE' } +/** Field used to sort historical balance rows. */ export enum QueryInput_HistoricalBalances_OrderBy { Delta = 'delta', Timestamp = 'timestamp' } -export enum QueryInput_HistoricalBalances_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_HistoricalDelegations_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Field used to sort historical voting power rows. */ export enum QueryInput_HistoricalVotingPowerByAccountId_OrderBy { Delta = 'delta', Timestamp = 'timestamp' } -export enum QueryInput_HistoricalVotingPowerByAccountId_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Field used to sort historical voting power rows. */ export enum QueryInput_HistoricalVotingPower_OrderBy { Delta = 'delta', Timestamp = 'timestamp' } -export enum QueryInput_HistoricalVotingPower_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Chart identifier whose freshness timestamp should be returned. */ export enum QueryInput_LastUpdate_Chart { AttackProfitability = 'attack_profitability', CostComparison = 'cost_comparison', TokenDistribution = 'token_distribution' } -export enum QueryInput_OffchainProposals_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_ProposalNonVoters_OrderDirection { - Asc = 'asc', - Desc = 'desc' +export enum QueryInput_OffchainProposals_Status_Items { + Active = 'active', + Closed = 'closed', + Pending = 'pending' } +/** Field used to sort proposal activity results. */ export enum QueryInput_ProposalsActivity_OrderBy { Timestamp = 'timestamp', VoteTiming = 'voteTiming', VotingPower = 'votingPower' } -export enum QueryInput_ProposalsActivity_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -/** Filter proposals by vote type. Can be: 'yes' (For votes), 'no' (Against votes), 'abstain' (Abstain votes), 'no-vote' (Didn't vote) */ +/** Optional vote filter. Use yes, no, abstain, or no-vote to narrow the result set. */ export enum QueryInput_ProposalsActivity_UserVoteFilter { Abstain = 'abstain', No = 'no', @@ -1175,16 +1508,21 @@ export enum QueryInput_ProposalsActivity_UserVoteFilter { Yes = 'yes' } -export enum QueryInput_Proposals_IncludeOptimisticProposals { - False = 'FALSE', - True = 'TRUE' -} - -export enum QueryInput_Proposals_OrderDirection { - Asc = 'asc', - Desc = 'desc' +export enum QueryInput_Proposals_Status_Items { + Active = 'ACTIVE', + Canceled = 'CANCELED', + Defeated = 'DEFEATED', + Executed = 'EXECUTED', + Expired = 'EXPIRED', + NoQuorum = 'NO_QUORUM', + Pending = 'PENDING', + PendingExecution = 'PENDING_EXECUTION', + Queued = 'QUEUED', + Succeeded = 'SUCCEEDED', + Vetoed = 'VETOED' } +/** Metric family to query. */ export enum QueryInput_TokenMetrics_MetricType { CexSupply = 'CEX_SUPPLY', CirculatingSupply = 'CIRCULATING_SUPPLY', @@ -1195,76 +1533,55 @@ export enum QueryInput_TokenMetrics_MetricType { Treasury = 'TREASURY' } -export enum QueryInput_TokenMetrics_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Currency to use when fetching token price data. */ export enum QueryInput_Token_Currency { Eth = 'eth', Usd = 'usd' } -export enum QueryInput_Transactions_SortOrder { - Asc = 'asc', - Desc = 'desc' +export enum QueryInput_Transactions_AffectedSupply_Items { + Cex = 'CEX', + Dex = 'DEX', + Lending = 'LENDING', + Total = 'TOTAL', + Unassigned = 'UNASSIGNED' } -export enum QueryInput_Transfers_SortBy { - Amount = 'amount', - Timestamp = 'timestamp' +export enum QueryInput_Transactions_Includes_Items { + Delegation = 'DELEGATION', + Transfer = 'TRANSFER' } -export enum QueryInput_Transfers_SortOrder { - Asc = 'asc', - Desc = 'desc' +/** Field used to sort transfers. */ +export enum QueryInput_Transfers_OrderBy { + Amount = 'amount', + Timestamp = 'timestamp' } +/** Sort votes by timestamp or voting power. */ export enum QueryInput_VotesByProposalId_OrderBy { Timestamp = 'timestamp', VotingPower = 'votingPower' } -export enum QueryInput_VotesByProposalId_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Sort votes by timestamp or voting power. */ export enum QueryInput_VotesOffchainByProposalId_OrderBy { Timestamp = 'timestamp', VotingPower = 'votingPower' } -export enum QueryInput_VotesOffchainByProposalId_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Sort votes by timestamp or voting power. */ export enum QueryInput_VotesOffchain_OrderBy { Timestamp = 'timestamp', VotingPower = 'votingPower' } -export enum QueryInput_VotesOffchain_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Sort votes by timestamp or voting power. */ export enum QueryInput_Votes_OrderBy { Timestamp = 'timestamp', VotingPower = 'votingPower' } -export enum QueryInput_Votes_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_VotingPowerVariations_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - export enum QueryInput_VotingPowers_OrderBy { Balance = 'balance', DelegationsCount = 'delegationsCount', @@ -1274,753 +1591,172 @@ export enum QueryInput_VotingPowers_OrderBy { VotingPower = 'votingPower' } -export enum QueryInput_VotingPowers_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export type Query_AccountBalanceByAccountId_Data = { - __typename?: 'query_accountBalanceByAccountId_data'; - address: Scalars['String']['output']; - balance: Scalars['String']['output']; - delegate: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - variation: Query_AccountBalanceByAccountId_Data_Variation; +/** Arkham Intelligence label data. null when no data is available for the address. */ +export type Query_GetAddress_Arkham = { + __typename?: 'query_getAddress_arkham'; + /** Human-readable name of the entity that owns the address according to Arkham Intelligence */ + entity?: Maybe; + /** Category of the entity (e.g. 'individual', 'exchange', 'protocol', 'fund') */ + entityType?: Maybe; + /** Fine-grained label for the specific address within the entity */ + label?: Maybe; + /** Twitter/X handle associated with the entity, without '@' */ + twitter?: Maybe; }; -export type Query_AccountBalanceByAccountId_Data_Variation = { - __typename?: 'query_accountBalanceByAccountId_data_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; +/** ENS (Ethereum Name Service) data. null when no ENS name is registered for the address. Cached with a configurable TTL. */ +export type Query_GetAddress_Ens = { + __typename?: 'query_getAddress_ens'; + /** URL of the ENS avatar image */ + avatar?: Maybe; + /** URL of the ENS profile banner image */ + banner?: Maybe; + /** Primary ENS name reverse-resolved for this address */ + name?: Maybe; }; -export type Query_AccountBalanceByAccountId_Period = { - __typename?: 'query_accountBalanceByAccountId_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; +export type Query_GetAddresses_Results_Items = { + __typename?: 'query_getAddresses_results_items'; + /** EIP-55 checksummed Ethereum address */ + address: Scalars['String']['output']; + arkham?: Maybe; + ens?: Maybe; + /** Whether the address is a smart contract (true) or an externally-owned account (false) */ + isContract: Scalars['Boolean']['output']; }; -export type Query_AccountBalanceVariationsByAccountId_Data = { - __typename?: 'query_accountBalanceVariationsByAccountId_data'; - absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentBalance: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; +/** Arkham Intelligence label data. null when no data is available for the address. */ +export type Query_GetAddresses_Results_Items_Arkham = { + __typename?: 'query_getAddresses_results_items_arkham'; + /** Human-readable name of the entity that owns the address according to Arkham Intelligence */ + entity?: Maybe; + /** Category of the entity (e.g. 'individual', 'exchange', 'protocol', 'fund') */ + entityType?: Maybe; + /** Fine-grained label for the specific address within the entity */ + label?: Maybe; + /** Twitter/X handle associated with the entity, without '@' */ + twitter?: Maybe; }; -export type Query_AccountBalanceVariationsByAccountId_Period = { - __typename?: 'query_accountBalanceVariationsByAccountId_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; +/** ENS (Ethereum Name Service) data. null when no ENS name is registered for the address. Cached with a configurable TTL. */ +export type Query_GetAddresses_Results_Items_Ens = { + __typename?: 'query_getAddresses_results_items_ens'; + /** URL of the ENS avatar image */ + avatar?: Maybe; + /** URL of the ENS profile banner image */ + banner?: Maybe; + /** Primary ENS name reverse-resolved for this address */ + name?: Maybe; }; -export type Query_AccountBalanceVariations_Items_Items = { - __typename?: 'query_accountBalanceVariations_items_items'; - absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentBalance: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; +export type Query_OffchainProposals_Items_Items_Strategies_Items = { + __typename?: 'query_offchainProposals_items_items_strategies_items'; + name: Scalars['String']['output']; + network: Scalars['String']['output']; + params: Scalars['JSON']['output']; }; -export type Query_AccountBalanceVariations_Period = { - __typename?: 'query_accountBalanceVariations_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; - -export type Query_AccountBalances_Items_Items = { - __typename?: 'query_accountBalances_items_items'; - address: Scalars['String']['output']; - balance: Scalars['String']['output']; - delegate: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - variation: Query_AccountBalances_Items_Items_Variation; -}; - -export type Query_AccountBalances_Items_Items_Variation = { - __typename?: 'query_accountBalances_items_items_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; -}; - -export type Query_AccountBalances_Period = { - __typename?: 'query_accountBalances_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; - -export type Query_AccountInteractions_Items_Items = { - __typename?: 'query_accountInteractions_items_items'; - accountId: Scalars['String']['output']; - amountTransferred: Scalars['String']['output']; - totalVolume: Scalars['String']['output']; - transferCount: Scalars['String']['output']; -}; - -export type Query_AccountInteractions_Period = { - __typename?: 'query_accountInteractions_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; - -export type Query_DelegationPercentageByDay_Items_Items = { - __typename?: 'query_delegationPercentageByDay_items_items'; - date: Scalars['String']['output']; - high: Scalars['String']['output']; -}; - -export type Query_DelegationPercentageByDay_PageInfo = { - __typename?: 'query_delegationPercentageByDay_pageInfo'; - endDate?: Maybe; - hasNextPage: Scalars['Boolean']['output']; - startDate?: Maybe; -}; - -export type Query_Delegations_Items_Items = { - __typename?: 'query_delegations_items_items'; - amount: Scalars['String']['output']; - delegateAddress: Scalars['String']['output']; - delegatorAddress: Scalars['String']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; - -export type Query_Delegators_Items_Items = { - __typename?: 'query_delegators_items_items'; - amount: Scalars['String']['output']; - delegatorAddress: Scalars['String']['output']; - timestamp: Scalars['String']['output']; -}; - -export type Query_FeedEvents_Items_Items = { - __typename?: 'query_feedEvents_items_items'; - logIndex: Scalars['Float']['output']; - metadata?: Maybe; - relevance: Query_FeedEvents_Items_Items_Relevance; - timestamp: Scalars['Float']['output']; - txHash: Scalars['String']['output']; - type: Query_FeedEvents_Items_Items_Type; - value?: Maybe; -}; - -export enum Query_FeedEvents_Items_Items_Relevance { - High = 'HIGH', - Low = 'LOW', - Medium = 'MEDIUM' -} - -export enum Query_FeedEvents_Items_Items_Type { - Delegation = 'DELEGATION', - Proposal = 'PROPOSAL', - ProposalExtended = 'PROPOSAL_EXTENDED', - Transfer = 'TRANSFER', - Vote = 'VOTE' -} - -export type Query_GetAddress_Arkham = { - __typename?: 'query_getAddress_arkham'; - entity?: Maybe; - entityType?: Maybe; - label?: Maybe; - twitter?: Maybe; -}; - -export type Query_GetAddress_Ens = { - __typename?: 'query_getAddress_ens'; - avatar?: Maybe; - banner?: Maybe; - name?: Maybe; -}; - -export type Query_GetAddresses_Results_Items = { - __typename?: 'query_getAddresses_results_items'; - address: Scalars['String']['output']; - arkham?: Maybe; - ens?: Maybe; - isContract: Scalars['Boolean']['output']; -}; - -export type Query_GetAddresses_Results_Items_Arkham = { - __typename?: 'query_getAddresses_results_items_arkham'; - entity?: Maybe; - entityType?: Maybe; - label?: Maybe; - twitter?: Maybe; -}; - -export type Query_GetAddresses_Results_Items_Ens = { - __typename?: 'query_getAddresses_results_items_ens'; - avatar?: Maybe; - banner?: Maybe; - name?: Maybe; -}; - -export type Query_GetDaoTokenTreasury_Items_Items = { - __typename?: 'query_getDaoTokenTreasury_items_items'; - /** Unix timestamp in milliseconds */ - date: Scalars['Float']['output']; - /** Treasury value in USD */ - value: Scalars['Float']['output']; -}; - -export type Query_GetLiquidTreasury_Items_Items = { - __typename?: 'query_getLiquidTreasury_items_items'; - /** Unix timestamp in milliseconds */ - date: Scalars['Float']['output']; - /** Treasury value in USD */ - value: Scalars['Float']['output']; -}; - -export type Query_GetTotalTreasury_Items_Items = { - __typename?: 'query_getTotalTreasury_items_items'; - /** Unix timestamp in milliseconds */ - date: Scalars['Float']['output']; - /** Treasury value in USD */ - value: Scalars['Float']['output']; -}; - -export type Query_HistoricalBalances_Items_Items = { - __typename?: 'query_historicalBalances_items_items'; - accountId: Scalars['String']['output']; - balance: Scalars['String']['output']; - daoId: Scalars['String']['output']; - delta: Scalars['String']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; - transfer: Query_HistoricalBalances_Items_Items_Transfer; -}; - -export type Query_HistoricalBalances_Items_Items_Transfer = { - __typename?: 'query_historicalBalances_items_items_transfer'; - from: Scalars['String']['output']; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; - -export type Query_HistoricalDelegations_Items_Items = { - __typename?: 'query_historicalDelegations_items_items'; - amount: Scalars['String']['output']; - delegateAddress: Scalars['String']['output']; - delegatorAddress: Scalars['String']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; - -export type Query_HistoricalTokenData_Items = { - __typename?: 'query_historicalTokenData_items'; - price: Scalars['String']['output']; - timestamp: Scalars['Float']['output']; -}; - -export type Query_HistoricalVotingPowerByAccountId_Items_Items = { - __typename?: 'query_historicalVotingPowerByAccountId_items_items'; - accountId: Scalars['String']['output']; - daoId: Scalars['String']['output']; - delegation?: Maybe; - delta: Scalars['String']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; - transfer?: Maybe; - votingPower: Scalars['String']['output']; -}; - -export type Query_HistoricalVotingPowerByAccountId_Items_Items_Delegation = { - __typename?: 'query_historicalVotingPowerByAccountId_items_items_delegation'; - from: Scalars['String']['output']; - previousDelegate?: Maybe; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; - -export type Query_HistoricalVotingPowerByAccountId_Items_Items_Transfer = { - __typename?: 'query_historicalVotingPowerByAccountId_items_items_transfer'; - from: Scalars['String']['output']; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; - -export type Query_HistoricalVotingPower_Items_Items = { - __typename?: 'query_historicalVotingPower_items_items'; - accountId: Scalars['String']['output']; - daoId: Scalars['String']['output']; - delegation?: Maybe; - delta: Scalars['String']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; - transfer?: Maybe; - votingPower: Scalars['String']['output']; -}; - -export type Query_HistoricalVotingPower_Items_Items_Delegation = { - __typename?: 'query_historicalVotingPower_items_items_delegation'; - from: Scalars['String']['output']; - previousDelegate?: Maybe; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; - -export type Query_HistoricalVotingPower_Items_Items_Transfer = { - __typename?: 'query_historicalVotingPower_items_items_transfer'; - from: Scalars['String']['output']; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; - -export type Query_OffchainProposals_Items_Items = { - __typename?: 'query_offchainProposals_items_items'; - author: Scalars['String']['output']; - body: Scalars['String']['output']; - created: Scalars['Float']['output']; - discussion: Scalars['String']['output']; - end: Scalars['Float']['output']; - flagged: Scalars['Boolean']['output']; - id: Scalars['String']['output']; - link: Scalars['String']['output']; - spaceId: Scalars['String']['output']; - start: Scalars['Float']['output']; - state: Scalars['String']['output']; - title: Scalars['String']['output']; - type: Scalars['String']['output']; - updated: Scalars['Float']['output']; -}; - -export type Query_ProposalNonVoters_Items_Items = { - __typename?: 'query_proposalNonVoters_items_items'; - lastVoteTimestamp: Scalars['Float']['output']; - voter: Scalars['String']['output']; - votingPower: Scalars['String']['output']; - votingPowerVariation: Scalars['String']['output']; -}; - -export type Query_ProposalsActivity_Proposals_Items = { - __typename?: 'query_proposalsActivity_proposals_items'; - proposal: Query_ProposalsActivity_Proposals_Items_Proposal; - userVote?: Maybe; -}; - -export type Query_ProposalsActivity_Proposals_Items_Proposal = { - __typename?: 'query_proposalsActivity_proposals_items_proposal'; - abstainVotes: Scalars['String']['output']; - againstVotes: Scalars['String']['output']; - daoId: Scalars['String']['output']; - description: Scalars['String']['output']; - endBlock: Scalars['Float']['output']; - forVotes: Scalars['String']['output']; - id: Scalars['String']['output']; - proposerAccountId: Scalars['String']['output']; - startBlock: Scalars['Float']['output']; - status: Scalars['String']['output']; - timestamp?: Maybe; - title: Scalars['String']['output']; -}; - -export type Query_ProposalsActivity_Proposals_Items_UserVote = { - __typename?: 'query_proposalsActivity_proposals_items_userVote'; - id: Scalars['String']['output']; - proposalId: Scalars['String']['output']; - reason?: Maybe; - support?: Maybe; - timestamp?: Maybe; - voterAccountId: Scalars['String']['output']; - votingPower: Scalars['String']['output']; -}; - -export type Query_Proposals_Items_Items = { - __typename?: 'query_proposals_items_items'; - abstainVotes: Scalars['String']['output']; - againstVotes: Scalars['String']['output']; - calldatas: Array>; - daoId: Scalars['String']['output']; - description: Scalars['String']['output']; - endBlock: Scalars['Float']['output']; - endTimestamp: Scalars['String']['output']; - forVotes: Scalars['String']['output']; - id: Scalars['String']['output']; - proposalType?: Maybe; - proposerAccountId: Scalars['String']['output']; - quorum: Scalars['String']['output']; - startBlock: Scalars['Float']['output']; - startTimestamp: Scalars['String']['output']; - status: Scalars['String']['output']; - targets: Array>; - timestamp: Scalars['String']['output']; - title: Scalars['String']['output']; - txHash: Scalars['String']['output']; - values: Array>; -}; - -export type Query_TokenMetrics_Items_Items = { - __typename?: 'query_tokenMetrics_items_items'; - date: Scalars['String']['output']; - high: Scalars['String']['output']; - volume: Scalars['String']['output']; -}; - -export type Query_TokenMetrics_PageInfo = { - __typename?: 'query_tokenMetrics_pageInfo'; - endDate?: Maybe; - hasNextPage: Scalars['Boolean']['output']; - startDate?: Maybe; -}; - -export type Query_Transactions_Items_Items = { - __typename?: 'query_transactions_items_items'; - delegations: Array>; - from?: Maybe; - isCex: Scalars['Boolean']['output']; - isDex: Scalars['Boolean']['output']; - isLending: Scalars['Boolean']['output']; - isTotal: Scalars['Boolean']['output']; - timestamp: Scalars['String']['output']; - to?: Maybe; - transactionHash: Scalars['String']['output']; - transfers: Array>; -}; - -export type Query_Transactions_Items_Items_Delegations_Items = { - __typename?: 'query_transactions_items_items_delegations_items'; - daoId: Scalars['String']['output']; - delegateAccountId: Scalars['String']['output']; - delegatedValue: Scalars['String']['output']; - delegatorAccountId: Scalars['String']['output']; - isCex: Scalars['Boolean']['output']; - isDex: Scalars['Boolean']['output']; - isLending: Scalars['Boolean']['output']; - isTotal: Scalars['Boolean']['output']; - logIndex: Scalars['Float']['output']; - previousDelegate?: Maybe; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; - -export type Query_Transactions_Items_Items_Transfers_Items = { - __typename?: 'query_transactions_items_items_transfers_items'; - amount: Scalars['String']['output']; - daoId: Scalars['String']['output']; - fromAccountId: Scalars['String']['output']; - isCex: Scalars['Boolean']['output']; - isDex: Scalars['Boolean']['output']; - isLending: Scalars['Boolean']['output']; - isTotal: Scalars['Boolean']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - toAccountId: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; - -export type Query_Transfers_Items_Items = { - __typename?: 'query_transfers_items_items'; - amount: Scalars['String']['output']; - daoId: Scalars['String']['output']; - fromAccountId: Scalars['String']['output']; - isCex: Scalars['Boolean']['output']; - isDex: Scalars['Boolean']['output']; - isLending: Scalars['Boolean']['output']; - isTotal: Scalars['Boolean']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - toAccountId: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; - -export type Query_VotesByProposalId_Items_Items = { - __typename?: 'query_votesByProposalId_items_items'; - proposalId: Scalars['String']['output']; - proposalTitle?: Maybe; - reason?: Maybe; - support?: Maybe; - timestamp: Scalars['Int']['output']; - transactionHash: Scalars['String']['output']; - voterAddress: Scalars['String']['output']; - votingPower: Scalars['String']['output']; -}; - -export type Query_VotesOffchainByProposalId_Items_Items = { - __typename?: 'query_votesOffchainByProposalId_items_items'; - choice?: Maybe; - created: Scalars['Float']['output']; - proposalId: Scalars['String']['output']; - proposalTitle: Scalars['String']['output']; - reason: Scalars['String']['output']; - voter: Scalars['String']['output']; - vp?: Maybe; -}; - -export type Query_VotesOffchain_Items_Items = { - __typename?: 'query_votesOffchain_items_items'; - choice?: Maybe; - created: Scalars['Float']['output']; - proposalId: Scalars['String']['output']; - proposalTitle: Scalars['String']['output']; - reason: Scalars['String']['output']; - voter: Scalars['String']['output']; - vp?: Maybe; -}; - -export type Query_Votes_Items_Items = { - __typename?: 'query_votes_items_items'; - proposalId: Scalars['String']['output']; - proposalTitle?: Maybe; - reason?: Maybe; - support?: Maybe; - timestamp: Scalars['Int']['output']; - transactionHash: Scalars['String']['output']; - voterAddress: Scalars['String']['output']; - votingPower: Scalars['String']['output']; -}; - -export type Query_VotingPowerByAccountId_Variation = { - __typename?: 'query_votingPowerByAccountId_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; -}; - -export type Query_VotingPowerVariationsByAccountId_Data = { - __typename?: 'query_votingPowerVariationsByAccountId_data'; - absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentVotingPower: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousVotingPower: Scalars['String']['output']; -}; - -export type Query_VotingPowerVariationsByAccountId_Period = { - __typename?: 'query_votingPowerVariationsByAccountId_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; - -export type Query_VotingPowerVariations_Items_Items = { - __typename?: 'query_votingPowerVariations_items_items'; - absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentVotingPower: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousVotingPower: Scalars['String']['output']; -}; - -export type Query_VotingPowerVariations_Period = { - __typename?: 'query_votingPowerVariations_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; - -export type Query_VotingPowers_Items_Items = { - __typename?: 'query_votingPowers_items_items'; - accountId: Scalars['String']['output']; - balance?: Maybe; - delegationsCount: Scalars['Float']['output']; - proposalsCount: Scalars['Float']['output']; - variation: Query_VotingPowers_Items_Items_Variation; - votesCount: Scalars['Float']['output']; - votingPower: Scalars['String']['output']; -}; - -export type Query_VotingPowers_Items_Items_Variation = { - __typename?: 'query_votingPowers_items_items_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; -}; - -export enum Timestamp_Const { - Timestamp = 'timestamp' -} - -export type TokenMetrics_200_Response = { - __typename?: 'tokenMetrics_200_response'; - items: Array>; - pageInfo: Query_TokenMetrics_PageInfo; -}; - -export type Token_200_Response = { - __typename?: 'token_200_response'; - cexSupply: Scalars['String']['output']; - circulatingSupply: Scalars['String']['output']; - decimals: Scalars['Float']['output']; - delegatedSupply: Scalars['String']['output']; - dexSupply: Scalars['String']['output']; - id: Scalars['String']['output']; - lendingSupply: Scalars['String']['output']; - name?: Maybe; - nonCirculatingSupply: Scalars['String']['output']; - price: Scalars['String']['output']; - totalSupply: Scalars['String']['output']; - treasury: Scalars['String']['output']; -}; - -export type Transactions_200_Response = { - __typename?: 'transactions_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type Transfers_200_Response = { - __typename?: 'transfers_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type VotesByProposalId_200_Response = { - __typename?: 'votesByProposalId_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type VotesOffchainByProposalId_200_Response = { - __typename?: 'votesOffchainByProposalId_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type VotesOffchain_200_Response = { - __typename?: 'votesOffchain_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type Votes_200_Response = { - __typename?: 'votes_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type VotingPowerByAccountId_200_Response = { - __typename?: 'votingPowerByAccountId_200_response'; - accountId: Scalars['String']['output']; - balance?: Maybe; - delegationsCount: Scalars['Float']['output']; - proposalsCount: Scalars['Float']['output']; - variation: Query_VotingPowerByAccountId_Variation; - votesCount: Scalars['Float']['output']; - votingPower: Scalars['String']['output']; -}; - -export type VotingPowerVariationsByAccountId_200_Response = { - __typename?: 'votingPowerVariationsByAccountId_200_response'; - data: Query_VotingPowerVariationsByAccountId_Data; - period: Query_VotingPowerVariationsByAccountId_Period; -}; - -export type VotingPowerVariations_200_Response = { - __typename?: 'votingPowerVariations_200_response'; - items: Array>; - period: Query_VotingPowerVariations_Period; -}; - -export type VotingPowers_200_Response = { - __typename?: 'votingPowers_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; +export type Token_Response = ErrorResponse | TokenPropertiesResponse; export type GetDaOsQueryVariables = Exact<{ [key: string]: never; }>; -export type GetDaOsQuery = { __typename?: 'Query', daos: { __typename?: 'DAOList', items: Array<{ __typename?: 'dao_200_response', id: string, votingDelay: string, chainId: number, alreadySupportCalldataReview: boolean, supportOffchainData: boolean }> } }; +export type GetDaOsQuery = { __typename?: 'Query', daos: { __typename?: 'DAOList', items: Array<{ __typename?: 'DaoResponse', id: string, votingDelay: string, chainId: number, alreadySupportCalldataReview: boolean, supportOffchainData: boolean }> } }; export type ListOffchainProposalsQueryVariables = Exact<{ - skip?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - status?: InputMaybe; - fromDate?: InputMaybe; - endDate?: InputMaybe; + skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + status?: InputMaybe> | InputMaybe>; + fromDate?: InputMaybe; + endDate?: InputMaybe; }>; -export type ListOffchainProposalsQuery = { __typename?: 'Query', offchainProposals?: { __typename?: 'offchainProposals_200_response', totalCount: number, items: Array<{ __typename?: 'query_offchainProposals_items_items', id: string, title: string, discussion: string, link: string, state: string, created: number, end: number } | null> } | null }; +export type ListOffchainProposalsQuery = { __typename?: 'Query', offchainProposals?: { __typename?: 'OffchainProposalsResponse', totalCount: number, items: Array<{ __typename?: 'OffchainProposal', id: string, title: string, discussion: string, link: string, state: string, created: number, end: number } | null> } | null }; export type ListOffchainVotesQueryVariables = Exact<{ - fromDate?: InputMaybe; - toDate?: InputMaybe; - limit?: InputMaybe; - skip?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - voterAddresses?: InputMaybe; + orderDirection?: InputMaybe; + voterAddresses?: InputMaybe> | InputMaybe>; }>; -export type ListOffchainVotesQuery = { __typename?: 'Query', votesOffchain?: { __typename?: 'votesOffchain_200_response', totalCount: number, items: Array<{ __typename?: 'query_votesOffchain_items_items', voter: string, created: number, proposalId: string, proposalTitle: string, reason: string, vp?: number | null } | null> } | null }; +export type ListOffchainVotesQuery = { __typename?: 'Query', votesOffchain?: { __typename?: 'OffchainVotesResponse', totalCount: number, items: Array<{ __typename?: 'OffchainVote', voter: string, created: number, proposalId: string, proposalTitle?: string | null, reason: string, vp?: number | null } | null> } | null }; export type ProposalNonVotersQueryVariables = Exact<{ id: Scalars['String']['input']; - addresses?: InputMaybe; + addresses?: InputMaybe> | InputMaybe>; }>; -export type ProposalNonVotersQuery = { __typename?: 'Query', proposalNonVoters?: { __typename?: 'proposalNonVoters_200_response', items: Array<{ __typename?: 'query_proposalNonVoters_items_items', voter: string } | null> } | null }; +export type ProposalNonVotersQuery = { __typename?: 'Query', proposalNonVoters?: { __typename?: 'VotersResponse', items: Array<{ __typename?: 'Voter', voter: string } | null> } | null }; export type GetProposalByIdQueryVariables = Exact<{ id: Scalars['String']['input']; }>; -export type GetProposalByIdQuery = { __typename?: 'Query', proposal?: { __typename?: 'proposal_200_response', id: string, daoId: string, proposerAccountId: string, title: string, description: string, startBlock: number, endBlock: number, endTimestamp: string, timestamp: string, status: string, forVotes: string, againstVotes: string, abstainVotes: string, txHash: string } | null }; +export type GetProposalByIdQuery = { __typename?: 'Query', proposal?: { __typename?: 'ErrorResponse' } | { __typename?: 'OnchainProposal', id: string, daoId: string, proposerAccountId: string, title: string, description: string, startBlock: number, endBlock: number, endTimestamp: number, timestamp: number, status: string, forVotes: string, againstVotes: string, abstainVotes: string, txHash: string } | null }; export type ListProposalsQueryVariables = Exact<{ - skip?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - status?: InputMaybe; - fromDate?: InputMaybe; - fromEndDate?: InputMaybe; - includeOptimisticProposals?: InputMaybe; + skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + status?: InputMaybe> | InputMaybe>; + fromDate?: InputMaybe; + fromEndDate?: InputMaybe; + includeOptimisticProposals?: InputMaybe; }>; -export type ListProposalsQuery = { __typename?: 'Query', proposals?: { __typename?: 'proposals_200_response', totalCount: number, items: Array<{ __typename?: 'query_proposals_items_items', id: string, daoId: string, proposerAccountId: string, title: string, description: string, startBlock: number, endBlock: number, endTimestamp: string, timestamp: string, status: string, forVotes: string, againstVotes: string, abstainVotes: string, txHash: string } | null> } | null }; +export type ListProposalsQuery = { __typename?: 'Query', proposals?: { __typename?: 'OnchainProposalsResponse', totalCount: number, items: Array<{ __typename?: 'OnchainProposal', id: string, daoId: string, proposerAccountId: string, title: string, description: string, startBlock: number, endBlock: number, endTimestamp: number, timestamp: number, status: string, forVotes: string, againstVotes: string, abstainVotes: string, txHash: string } | null> } | null }; export type GetEventRelevanceThresholdQueryVariables = Exact<{ - relevance: QueryInput_GetEventRelevanceThreshold_Relevance; - type: QueryInput_GetEventRelevanceThreshold_Type; + relevance: FeedRelevance; + type: FeedEventType; }>; -export type GetEventRelevanceThresholdQuery = { __typename?: 'Query', getEventRelevanceThreshold?: { __typename?: 'getEventRelevanceThreshold_200_response', threshold: string } | null }; +export type GetEventRelevanceThresholdQuery = { __typename?: 'Query', getEventRelevanceThreshold?: { __typename?: 'EventRelevanceThresholdResponse', threshold: string } | null }; export type ListVotesQueryVariables = Exact<{ - voterAddressIn?: InputMaybe; - fromDate?: InputMaybe; - toDate?: InputMaybe; - limit?: InputMaybe; - skip?: InputMaybe; + voterAddressIn?: InputMaybe> | InputMaybe>; + fromDate?: InputMaybe; + toDate?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - support?: InputMaybe; + orderDirection?: InputMaybe; + support?: InputMaybe; }>; -export type ListVotesQuery = { __typename?: 'Query', votes?: { __typename?: 'votes_200_response', totalCount: number, items: Array<{ __typename?: 'query_votes_items_items', transactionHash: string, proposalId: string, voterAddress: string, support?: number | null, votingPower: string, timestamp: number, reason?: string | null, proposalTitle?: string | null } | null> } | null }; +export type ListVotesQuery = { __typename?: 'Query', votes?: { __typename?: 'OnchainVotesResponse', totalCount: number, items: Array<{ __typename?: 'OnchainVote', transactionHash: string, proposalId: string, voterAddress: string, support?: string | null, votingPower: string, timestamp: number, reason?: string | null, proposalTitle?: string | null } | null> } | null }; export type ListHistoricalVotingPowerQueryVariables = Exact<{ - limit?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - fromDate?: InputMaybe; + orderDirection?: InputMaybe; + fromDate?: InputMaybe; address?: InputMaybe; }>; -export type ListHistoricalVotingPowerQuery = { __typename?: 'Query', historicalVotingPower?: { __typename?: 'historicalVotingPower_200_response', totalCount: number, items: Array<{ __typename?: 'query_historicalVotingPower_items_items', accountId: string, timestamp: string, votingPower: string, delta: string, daoId: string, transactionHash: string, logIndex: number, delegation?: { __typename?: 'query_historicalVotingPower_items_items_delegation', from: string, to: string, value: string, previousDelegate?: string | null } | null, transfer?: { __typename?: 'query_historicalVotingPower_items_items_transfer', from: string, to: string, value: string } | null } | null> } | null }; +export type ListHistoricalVotingPowerQuery = { __typename?: 'Query', historicalVotingPower?: { __typename?: 'HistoricalVotingPowersResponse', totalCount: number, items: Array<{ __typename?: 'HistoricalVotingPower', accountId: string, timestamp: string, votingPower: string, delta: string, daoId: string, transactionHash: string, logIndex: number, delegation?: { __typename?: 'HistoricalVotingPowerDelegation', from: string, to: string, value: string, previousDelegate?: string | null } | null, transfer?: { __typename?: 'HistoricalVotingPowerTransfer', from: string, to: string, value: string } | null } | null> } | null }; export const GetDaOsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDAOs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"daos"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"votingDelay"}},{"kind":"Field","name":{"kind":"Name","value":"chainId"}},{"kind":"Field","name":{"kind":"Name","value":"alreadySupportCalldataReview"}},{"kind":"Field","name":{"kind":"Name","value":"supportOffchainData"}}]}}]}}]}}]} as unknown as DocumentNode; -export const ListOffchainProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"NonNegativeInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositiveInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_offchainProposals_orderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"status"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offchainProposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"status"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"endDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"discussion"}},{"kind":"Field","name":{"kind":"Name","value":"link"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"end"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; -export const ListOffchainVotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainVotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"NonNegativeInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votesOffchain_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votesOffchain_orderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"votesOffchain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"toDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"voterAddresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"proposalTitle"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"vp"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; -export const ProposalNonVotersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProposalNonVoters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposalNonVoters"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"addresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetProposalByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProposalById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"daoId"}},{"kind":"Field","name":{"kind":"Name","value":"proposerAccountId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"startBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"forVotes"}},{"kind":"Field","name":{"kind":"Name","value":"againstVotes"}},{"kind":"Field","name":{"kind":"Name","value":"abstainVotes"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}}]}}]}}]} as unknown as DocumentNode; -export const ListProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"NonNegativeInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositiveInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_proposals_orderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"status"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromEndDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"includeOptimisticProposals"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_proposals_includeOptimisticProposals"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"status"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromEndDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromEndDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"includeOptimisticProposals"},"value":{"kind":"Variable","name":{"kind":"Name","value":"includeOptimisticProposals"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"daoId"}},{"kind":"Field","name":{"kind":"Name","value":"proposerAccountId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"startBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"forVotes"}},{"kind":"Field","name":{"kind":"Name","value":"againstVotes"}},{"kind":"Field","name":{"kind":"Name","value":"abstainVotes"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; -export const GetEventRelevanceThresholdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetEventRelevanceThreshold"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"relevance"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_getEventRelevanceThreshold_relevance"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"type"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_getEventRelevanceThreshold_type"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getEventRelevanceThreshold"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"relevance"},"value":{"kind":"Variable","name":{"kind":"Name","value":"relevance"}}},{"kind":"Argument","name":{"kind":"Name","value":"type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"type"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"threshold"}}]}}]}}]} as unknown as DocumentNode; -export const ListVotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListVotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"voterAddressIn"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"NonNegativeInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votes_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votes_orderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"support"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"votes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"voterAddressIn"},"value":{"kind":"Variable","name":{"kind":"Name","value":"voterAddressIn"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"toDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"support"},"value":{"kind":"Variable","name":{"kind":"Name","value":"support"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactionHash"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"voterAddress"}},{"kind":"Field","name":{"kind":"Name","value":"support"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"proposalTitle"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; -export const ListHistoricalVotingPowerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListHistoricalVotingPower"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositiveInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"NonNegativeInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_historicalVotingPower_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_historicalVotingPower_orderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"historicalVotingPower"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountId"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}},{"kind":"Field","name":{"kind":"Name","value":"delta"}},{"kind":"Field","name":{"kind":"Name","value":"daoId"}},{"kind":"Field","name":{"kind":"Name","value":"transactionHash"}},{"kind":"Field","name":{"kind":"Name","value":"logIndex"}},{"kind":"Field","name":{"kind":"Name","value":"delegation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"previousDelegate"}}]}},{"kind":"Field","name":{"kind":"Name","value":"transfer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const ListOffchainProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"status"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_offchainProposals_status_items"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offchainProposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"status"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"endDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"discussion"}},{"kind":"Field","name":{"kind":"Name","value":"link"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"end"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; +export const ListOffchainVotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainVotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votesOffchain_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"votesOffchain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"toDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"voterAddresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"proposalTitle"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"vp"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; +export const ProposalNonVotersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProposalNonVoters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposalNonVoters"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"addresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetProposalByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProposalById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"OnchainProposal"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"daoId"}},{"kind":"Field","name":{"kind":"Name","value":"proposerAccountId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"startBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"forVotes"}},{"kind":"Field","name":{"kind":"Name","value":"againstVotes"}},{"kind":"Field","name":{"kind":"Name","value":"abstainVotes"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}}]}}]}}]}}]} as unknown as DocumentNode; +export const ListProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"status"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_proposals_status_items"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromEndDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"includeOptimisticProposals"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"status"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromEndDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromEndDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"includeOptimisticProposals"},"value":{"kind":"Variable","name":{"kind":"Name","value":"includeOptimisticProposals"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"daoId"}},{"kind":"Field","name":{"kind":"Name","value":"proposerAccountId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"startBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"forVotes"}},{"kind":"Field","name":{"kind":"Name","value":"againstVotes"}},{"kind":"Field","name":{"kind":"Name","value":"abstainVotes"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; +export const GetEventRelevanceThresholdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetEventRelevanceThreshold"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"relevance"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"FeedRelevance"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"type"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"FeedEventType"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getEventRelevanceThreshold"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"relevance"},"value":{"kind":"Variable","name":{"kind":"Name","value":"relevance"}}},{"kind":"Argument","name":{"kind":"Name","value":"type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"type"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"threshold"}}]}}]}}]} as unknown as DocumentNode; +export const ListVotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListVotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"voterAddressIn"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votes_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"support"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"votes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"voterAddressIn"},"value":{"kind":"Variable","name":{"kind":"Name","value":"voterAddressIn"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"toDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"support"},"value":{"kind":"Variable","name":{"kind":"Name","value":"support"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactionHash"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"voterAddress"}},{"kind":"Field","name":{"kind":"Name","value":"support"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"proposalTitle"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; +export const ListHistoricalVotingPowerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListHistoricalVotingPower"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_historicalVotingPower_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"historicalVotingPower"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountId"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}},{"kind":"Field","name":{"kind":"Name","value":"delta"}},{"kind":"Field","name":{"kind":"Name","value":"daoId"}},{"kind":"Field","name":{"kind":"Name","value":"transactionHash"}},{"kind":"Field","name":{"kind":"Name","value":"logIndex"}},{"kind":"Field","name":{"kind":"Name","value":"delegation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"previousDelegate"}}]}},{"kind":"Field","name":{"kind":"Name","value":"transfer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file From 4b8b06b0796765d531bce30efd84cf0bf15bc083 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 16:37:04 -0300 Subject: [PATCH 12/30] delete: unnecessary docs --- .../2026-04-01-snapshot-voting-reminder.md | 889 ------------------ ...6-04-01-snapshot-voting-reminder-design.md | 142 --- 2 files changed, 1031 deletions(-) delete mode 100644 docs/superpowers/plans/2026-04-01-snapshot-voting-reminder.md delete mode 100644 docs/superpowers/specs/2026-04-01-snapshot-voting-reminder-design.md diff --git a/docs/superpowers/plans/2026-04-01-snapshot-voting-reminder.md b/docs/superpowers/plans/2026-04-01-snapshot-voting-reminder.md deleted file mode 100644 index 18f62893..00000000 --- a/docs/superpowers/plans/2026-04-01-snapshot-voting-reminder.md +++ /dev/null @@ -1,889 +0,0 @@ -# Snapshot Voting Reminder Implementation Plan - -> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. - -**Goal:** Add voting reminders for off-chain (Snapshot) proposals at the 75% threshold, reusing the generalized `VotingReminderTrigger`. - -**Architecture:** Generalize the existing `VotingReminderTrigger` to work with a normalized `VotingReminderProposal` interface. Mapper functions translate on-chain and off-chain proposal shapes. A new dispatcher handler processes off-chain reminders with its own message template and Snapshot-specific buttons. - -**Tech Stack:** TypeScript, RabbitMQ, Zod, Jest, Fastify, GraphQL - -**Spec:** `docs/superpowers/specs/2026-04-01-snapshot-voting-reminder-design.md` - ---- - -## File Map - -### New Files -| File | Responsibility | -|------|---------------| -| `apps/logic-system/src/mappers/proposal-reminder.mapper.ts` | Pure mapper functions: on-chain → `VotingReminderProposal`, off-chain → `VotingReminderProposal` | -| `apps/logic-system/src/interfaces/voting-reminder.interface.ts` | `VotingReminderProposal` and `VotingReminderDataSource` interfaces | -| `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts` | Dispatcher handler for off-chain voting reminders | -| `packages/messages/src/triggers/offchain-voting-reminder.ts` | Message template for Snapshot voting reminders | -| `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts` | Unit tests for the off-chain handler | - -### Modified Files -| File | Change | -|------|--------| -| `packages/anticapture-client/src/schemas.ts` | Add `start` to `OffchainProposalItemSchema`, add `SafeOffchainProposalNonVotersResponseSchema` | -| `packages/anticapture-client/src/anticapture-client.ts` | Add `getOffchainProposalNonVoters()` method | -| `packages/anticapture-client/src/index.ts` | Export new types if needed | -| `packages/messages/src/notification-types.ts` | Add `OffchainVotingReminder75` to enum and `NOTIFICATION_TYPES` | -| `packages/messages/src/triggers/buttons.ts` | Add `offchainVotingReminder` button config | -| `packages/messages/src/index.ts` | Export new offchain voting reminder messages | -| `apps/logic-system/src/triggers/voting-reminder-trigger.ts` | Refactor to use `VotingReminderProposal` and `VotingReminderDataSource` | -| `apps/logic-system/src/repositories/proposal.repository.ts` | Add `listActiveForReminder()` | -| `apps/logic-system/src/repositories/offchain-proposal.repository.ts` | Add `listActiveForReminder()` | -| `apps/logic-system/src/app.ts` | Register off-chain trigger, update existing triggers, add to `stop()`/`resetTriggers()` | -| `apps/dispatcher/src/app.ts` | Register `OffchainVotingReminderTriggerHandler` | - ---- - -## Task 1: Messages Package — NotificationTypeId + Template + Buttons - -**Files:** -- Modify: `packages/messages/src/notification-types.ts` -- Create: `packages/messages/src/triggers/offchain-voting-reminder.ts` -- Modify: `packages/messages/src/triggers/buttons.ts` -- Modify: `packages/messages/src/index.ts` - -- [ ] **Step 1: Add enum entry** - -In `packages/messages/src/notification-types.ts`, add to the enum: - -```typescript -OffchainVotingReminder75 = 'offchain-voting-reminder-75', -``` - -And to the `NOTIFICATION_TYPES` record: - -```typescript -[NotificationTypeId.OffchainVotingReminder75]: 'Offchain Vote Reminder 75%', -``` - -- [ ] **Step 2: Create message template** - -Create `packages/messages/src/triggers/offchain-voting-reminder.ts`: - -```typescript -export const offchainVotingReminderMessages = { - default: `⏰ Snapshot Voting Reminder - {{daoId}} - -Proposal: "{{title}}" - -⏱️ Time remaining: {{timeRemaining}} -📊 {{thresholdPercentage}}% of voting period has passed -🗳️ {{address}}'s vote hasn't been recorded yet - -Don't miss your chance to participate!`, -}; -``` - -- [ ] **Step 3: Add button config** - -In `packages/messages/src/triggers/buttons.ts`, add to `ctaButtonConfigs`: - -```typescript -offchainVotingReminder: { - text: 'Cast your vote', - buildUrl: ({ proposalUrl }) => - proposalUrl || BASE_URL -}, -``` - -- [ ] **Step 4: Update exports** - -In `packages/messages/src/index.ts`, add: - -```typescript -export * from './triggers/offchain-voting-reminder'; -``` - -- [ ] **Step 5: Build messages package to verify** - -Run: `cd packages/messages && pnpm build` -Expected: Build succeeds with no errors - -- [ ] **Step 6: Commit** - -```bash -git add packages/messages/ -git commit -m "feat: add offchain voting reminder message template, enum, and button config" -``` - ---- - -## Task 2: AntiCapture Client — Schema + `getOffchainProposalNonVoters()` - -**Files:** -- Modify: `packages/anticapture-client/src/schemas.ts` -- Modify: `packages/anticapture-client/src/anticapture-client.ts` -- Modify: `packages/anticapture-client/src/index.ts` - -- [ ] **Step 1: Add `start` to `OffchainProposalItemSchema`** - -In `packages/anticapture-client/src/schemas.ts`, update `OffchainProposalItemSchema`: - -```typescript -export const OffchainProposalItemSchema = z.object({ - id: z.string(), - title: z.string(), - discussion: z.string(), - link: z.string(), - state: z.string(), - start: z.number().optional(), - created: z.number(), - end: z.number(), -}); -``` - -Note: `start` is optional for backwards compatibility with responses that may not include it. - -- [ ] **Step 2: Add Zod schema for offchain non-voters response** - -In `packages/anticapture-client/src/schemas.ts`, add after `SafeProposalNonVotersResponseSchema`: - -```typescript -export const SafeOffchainProposalNonVotersResponseSchema = z.object({ - offchainProposalNonVoters: z.object({ - items: z.array(z.object({ - voter: z.string(), - votingPower: z.string().optional() - }).nullable()), - totalCount: z.number().optional() - }).nullable() -}).transform((data) => { - if (!data.offchainProposalNonVoters) { - console.warn('OffchainProposalNonVotersResponse has null offchainProposalNonVoters:', data); - return { offchainProposalNonVoters: { items: [], totalCount: 0 } }; - } - return { - offchainProposalNonVoters: { - ...data.offchainProposalNonVoters, - items: data.offchainProposalNonVoters.items.filter((item): item is { voter: string; votingPower?: string } => item !== null) - } - }; -}); -``` - -- [ ] **Step 3: Add `getOffchainProposalNonVoters` method** - -In `packages/anticapture-client/src/anticapture-client.ts`, add the import for the new schema and add the method. - -First, add the import: -```typescript -import { SafeOffchainProposalNonVotersResponseSchema } from './schemas'; -``` - -Then add the method to the `AnticaptureClient` class (after `getProposalNonVoters`): - -```typescript -/** - * Fetches addresses that haven't voted on a specific offchain (Snapshot) proposal - * @param proposalId The Snapshot proposal ID to check - * @param addresses Optional array of addresses to filter by - * @returns List of non-voters - */ -async getOffchainProposalNonVoters( - proposalId: string, - addresses?: string[], -): Promise<{ voter: string; votingPower?: string }[]> { - try { - const response = await this.httpClient.post('', { - query: `query OffchainProposalNonVoters($id: String!, $addresses: String, $orderDirection: String) { - offchainProposalNonVoters(id: $id, addresses: $addresses, orderDirection: $orderDirection) { - items { - voter - votingPower - } - } - }`, - variables: { - id: proposalId, - ...(addresses && { addresses: addresses.join(',') }), - orderDirection: 'desc' - } - }, { headers: this.buildHeaders() }); - - if (response.data.errors) { - throw new Error(JSON.stringify(response.data.errors)); - } - - const validated = SafeOffchainProposalNonVotersResponseSchema.parse( - this.toLowercase(response.data.data) - ); - - return validated.offchainProposalNonVoters.items; - } catch (error) { - console.warn(`Error fetching offchain non-voters for proposal ${proposalId}:`, error); - return []; - } -} -``` - -**Important:** Check how the `addresses` parameter is passed in the actual GraphQL query by testing against the local API Gateway endpoint. The query from the user used `addresses: "0x89EdE..."` as a single string. Adjust accordingly — it might be a comma-separated string rather than an array. - -- [ ] **Step 4: Build anticapture-client package to verify** - -Run: `cd packages/anticapture-client && pnpm build` -Expected: Build succeeds - -- [ ] **Step 5: Commit** - -```bash -git add packages/anticapture-client/ -git commit -m "feat: add getOffchainProposalNonVoters method and start field to OffchainProposalItemSchema" -``` - ---- - -## Task 3: Logic System — Interfaces + Mappers - -**Files:** -- Create: `apps/logic-system/src/interfaces/voting-reminder.interface.ts` -- Create: `apps/logic-system/src/mappers/proposal-reminder.mapper.ts` - -- [ ] **Step 1: Create normalized interfaces** - -Create `apps/logic-system/src/interfaces/voting-reminder.interface.ts`: - -```typescript -/** - * Normalized proposal data for voting reminders. - * Both on-chain and off-chain proposals are mapped to this shape. - */ -export interface VotingReminderProposal { - id: string; - daoId: string; - title?: string; - description?: string; - startTime: number; - endTime: number; - link?: string; - discussion?: string; -} - -/** - * Data source interface for fetching proposals ready for voting reminders. - * Implemented by both ProposalRepository and OffchainProposalRepository. - */ -export interface VotingReminderDataSource { - listActiveForReminder(): Promise; -} -``` - -- [ ] **Step 2: Create mapper functions** - -Create `apps/logic-system/src/mappers/proposal-reminder.mapper.ts`: - -```typescript -import { ProposalOnChain } from '../interfaces/proposal.interface'; -import { OffchainProposal } from '../interfaces/offchain-proposal.interface'; -import { VotingReminderProposal } from '../interfaces/voting-reminder.interface'; - -/** - * Maps an on-chain proposal to the normalized VotingReminderProposal shape. - */ -export function mapOnchainToReminderProposal(p: ProposalOnChain): VotingReminderProposal { - return { - id: p.id, - daoId: p.daoId, - title: p.title || undefined, - description: p.description, - startTime: Number(p.timestamp), - endTime: Number(p.endTimestamp), - }; -} - -/** - * Maps an off-chain (Snapshot) proposal to the normalized VotingReminderProposal shape. - * Uses `start` (actual voting start) when available, falls back to `created`. - */ -export function mapOffchainToReminderProposal(p: OffchainProposal): VotingReminderProposal { - return { - id: p.id, - daoId: p.daoId, - title: p.title || undefined, - startTime: p.start ?? p.created, - endTime: p.end, - link: p.link, - discussion: p.discussion, - }; -} -``` - -Note: Check whether `OffchainProposal` type has a `start` field after the schema update in Task 2. The `OffchainProposal` is defined as `OffchainProposalItem & { daoId: string }` in `apps/logic-system/src/interfaces/offchain-proposal.interface.ts`, so it inherits the `start` field from the schema update. - -- [ ] **Step 3: Commit** - -```bash -git add apps/logic-system/src/interfaces/voting-reminder.interface.ts apps/logic-system/src/mappers/ -git commit -m "feat: add VotingReminderProposal interface and mapper functions" -``` - ---- - -## Task 4: Logic System — Generalize `VotingReminderTrigger` - -**Files:** -- Modify: `apps/logic-system/src/triggers/voting-reminder-trigger.ts` - -- [ ] **Step 1: Refactor trigger to use normalized interface** - -Replace the current `VotingReminderTrigger` implementation. Key changes: - -1. Change `extends Trigger` to `extends Trigger` -2. Replace `ProposalDataSource` with `VotingReminderDataSource` in constructor -3. Replace all direct field access (`proposal.timestamp`, `proposal.endTimestamp`) with `proposal.startTime`, `proposal.endTime` -4. Remove `parseInt` calls (data is already normalized as numbers) -5. Add `link` and `discussion` to the `VotingReminderEvent` interface -6. Pass `link` and `discussion` through in `createReminderEvent()` -7. `fetchData()` calls `this.dataSource.listActiveForReminder()` instead of `this.proposalRepository.listAll()` - -Updated `VotingReminderEvent`: - -```typescript -export interface VotingReminderEvent { - id: string; - daoId: string; - title?: string; - description?: string; - startTimestamp: number; - endTimestamp: number; - timeElapsedPercentage: number; - thresholdPercentage: number; - link?: string; - discussion?: string; -} -``` - -Updated constants and constructor — add a `triggerIdPrefix` parameter to allow different prefixes for on-chain vs off-chain: - -```typescript -const DEFAULT_TRIGGER_ID_PREFIX = 'voting-reminder'; -const DEFAULT_WINDOW_SIZE = 5; - -constructor( - private readonly dispatcherService: DispatcherService, - private readonly dataSource: VotingReminderDataSource, - interval: number, - thresholdPercentage: number = 75, - windowSize: number = DEFAULT_WINDOW_SIZE, - triggerIdPrefix: string = DEFAULT_TRIGGER_ID_PREFIX -) { - super(`${triggerIdPrefix}-${thresholdPercentage}`, interval); - ... -} -``` - -This way, on-chain triggers keep using `'voting-reminder'` (default) and the off-chain trigger passes `'offchain-voting-reminder'` to produce `offchain-voting-reminder-75` — matching `NotificationTypeId.OffchainVotingReminder75`. - -Updated `filterEligibleProposals`: - -```typescript -private filterEligibleProposals(proposals: VotingReminderProposal[]): VotingReminderProposal[] { - const now = Math.floor(Date.now() / 1000); - - return proposals.filter(proposal => { - if (!proposal) return false; - - const startTime = proposal.startTime; - const endTime = proposal.endTime; - - if (now <= startTime || now >= endTime) return false; - - const timeElapsedPercentage = this.calculateTimeElapsedPercentage(startTime, endTime, now); - const threshold = this.thresholdPercentage; - const windowEnd = Math.min(threshold + this.windowSize, 100); - - return timeElapsedPercentage >= threshold && timeElapsedPercentage <= windowEnd; - }); -} -``` - -Updated `createReminderEvent`: - -```typescript -private createReminderEvent(proposal: VotingReminderProposal): VotingReminderEvent { - const now = Math.floor(Date.now() / 1000); - const timeElapsedPercentage = this.calculateTimeElapsedPercentage( - proposal.startTime, proposal.endTime, now - ); - - return { - id: proposal.id, - daoId: proposal.daoId, - title: proposal.title, - description: proposal.description, - startTimestamp: proposal.startTime, - endTimestamp: proposal.endTime, - timeElapsedPercentage: Math.round(timeElapsedPercentage * 100) / 100, - thresholdPercentage: this.thresholdPercentage, - link: proposal.link, - discussion: proposal.discussion, - }; -} -``` - -Updated `fetchData`: - -```typescript -protected async fetchData(): Promise { - return await this.dataSource.listActiveForReminder(); -} -``` - -- [ ] **Step 2: Update the on-chain VotingReminderTriggerHandler** - -In `apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts`, update `createReminderMessage`: - -1. Handle optional `description`: -```typescript -const title = event.title || FormattingService.extractTitle(event.description ?? ''); -``` - -2. Fix existing `address` placeholder bug — add `address` to replacePlaceholders call: -```typescript -return replacePlaceholders(messageTemplate, { - daoId: event.daoId, - title, - timeRemaining, - thresholdPercentage: event.thresholdPercentage.toString(), - address: address || '' -}); -``` - -- [ ] **Step 3: Update existing `voting-reminder-trigger.test.ts`** - -The existing test at `apps/logic-system/tests/voting-reminder-trigger.test.ts` creates `ProposalOnChain` objects with string fields (`timestamp`, `endTimestamp`). After refactoring, the trigger expects `VotingReminderProposal` with numeric `startTime`/`endTime`. - -Update the test to: -1. Use `VotingReminderProposal` objects instead of `ProposalOnChain` -2. Mock `dataSource.listActiveForReminder()` instead of `proposalRepository.listAll()` -3. Use numeric timestamp fields (`startTime`, `endTime`) instead of string fields - -- [ ] **Step 4: Build logic-system to verify compilation** - -Run: `cd apps/logic-system && pnpm build` -Expected: May fail because `app.ts` still passes old repository type. That's fine — we'll fix it in Task 5. - -- [ ] **Step 5: Commit** - -```bash -git add apps/logic-system/src/triggers/ apps/logic-system/tests/ apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts -git commit -m "refactor: generalize VotingReminderTrigger to use normalized VotingReminderProposal interface" -``` - ---- - -## Task 5: Logic System — Update Repositories + App Wiring - -**Files:** -- Modify: `apps/logic-system/src/repositories/proposal.repository.ts` -- Modify: `apps/logic-system/src/repositories/offchain-proposal.repository.ts` -- Modify: `apps/logic-system/src/app.ts` - -- [ ] **Step 1: Add `listActiveForReminder()` to `ProposalRepository`** - -In `apps/logic-system/src/repositories/proposal.repository.ts`: - -Import the mapper and interface: -```typescript -import { VotingReminderProposal, VotingReminderDataSource } from '../interfaces/voting-reminder.interface'; -import { mapOnchainToReminderProposal } from '../mappers/proposal-reminder.mapper'; -``` - -Add `implements VotingReminderDataSource` to the class and add the method: - -```typescript -async listActiveForReminder(): Promise { - const proposals = await this.listAll({ status: 'ACTIVE', includeOptimisticProposals: false }); - return proposals.map(mapOnchainToReminderProposal); -} -``` - -- [ ] **Step 2: Add `listActiveForReminder()` to `OffchainProposalRepository`** - -In `apps/logic-system/src/repositories/offchain-proposal.repository.ts`: - -Import the mapper and interface: -```typescript -import { VotingReminderProposal, VotingReminderDataSource } from '../interfaces/voting-reminder.interface'; -import { mapOffchainToReminderProposal } from '../mappers/proposal-reminder.mapper'; -``` - -Add `implements VotingReminderDataSource` to the class and add the method: - -```typescript -async listActiveForReminder(): Promise { - const proposals = await this.listAll({ status: 'active' }); - return proposals.map(mapOffchainToReminderProposal); -} -``` - -- [ ] **Step 3: Wire up in `app.ts`** - -In `apps/logic-system/src/app.ts`: - -Add the new trigger field: -```typescript -private offchainVotingReminderTrigger75!: VotingReminderTrigger; -``` - -In `initializeRabbitMQ`, add the new trigger instance (note the `triggerIdPrefix` to produce `offchain-voting-reminder-75`): -```typescript -this.offchainVotingReminderTrigger75 = new VotingReminderTrigger( - dispatcherService, - offchainProposalRepository, - triggerInterval, - 75, // 75% threshold - 5, // default window size - 'offchain-voting-reminder' // prefix → produces ID 'offchain-voting-reminder-75' -); -``` - -Update the existing on-chain voting reminder triggers to pass the `proposalRepository` (which now implements `VotingReminderDataSource`). The constructor signature changed from `ProposalDataSource` to `VotingReminderDataSource`, but since `ProposalRepository` now implements both, this should just work. - -In `start()`, add: -```typescript -this.offchainVotingReminderTrigger75.start(); -``` - -In `stop()`, add: -```typescript -await this.offchainVotingReminderTrigger75.stop(); -``` - -In `resetTriggers()`, add stop calls for all voting reminder triggers (currently missing for on-chain too). Since `stop()` only calls `clearInterval` (no real async I/O), use fire-and-forget to avoid making `resetTriggers` async (which would be a breaking change for callers in integration tests): -```typescript -if (this.votingReminderTrigger30) { - this.votingReminderTrigger30.stop(); -} -if (this.votingReminderTrigger60) { - this.votingReminderTrigger60.stop(); -} -if (this.votingReminderTrigger90) { - this.votingReminderTrigger90.stop(); -} -if (this.offchainVotingReminderTrigger75) { - this.offchainVotingReminderTrigger75.stop(); -} -``` - -- [ ] **Step 4: Build logic-system to verify** - -Run: `cd apps/logic-system && pnpm build` -Expected: Build succeeds - -- [ ] **Step 5: Run existing tests** - -Run: `cd apps/logic-system && pnpm test` -Expected: All existing tests pass (the generalization should not break them) - -- [ ] **Step 6: Commit** - -```bash -git add apps/logic-system/ -git commit -m "feat: add listActiveForReminder to repositories and wire offchain voting reminder trigger" -``` - ---- - -## Task 6: Dispatcher — Off-chain Voting Reminder Handler - -**Files:** -- Create: `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts` -- Modify: `apps/dispatcher/src/app.ts` - -- [ ] **Step 1: Create the handler** - -Create `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts`. - -This handler is based on `voting-reminder-trigger.service.ts` with these differences: -- Uses `getOffchainProposalNonVoters(proposalId, addresses)` — no `daoId` param -- Uses `offchainVotingReminderMessages.default` template (single template) -- Uses `offchainVotingReminder` button type with `proposalUrl` from event's `link` field -- Adds discussion button if event has `discussion` field - -```typescript -import type { NotificationTypeId } from '@notification-system/messages'; -import { BaseTriggerHandler } from './base-trigger.service'; -import { DispatcherMessage, MessageProcessingResult } from '../../interfaces/dispatcher-message.interface'; -import { NotificationClientFactory } from '../notification/notification-factory.service'; -import { ISubscriptionClient } from '../../interfaces/subscription-client.interface'; -import { AnticaptureClient } from '@notification-system/anticapture-client'; -import { FormattingService } from '../formatting.service'; -import { offchainVotingReminderMessages, replacePlaceholders, buildButtons } from '@notification-system/messages'; -import { BatchNotificationService } from '../batch-notification.service'; - -interface VotingReminderEvent { - id: string; - daoId: string; - title?: string; - description?: string; - startTimestamp: number; - endTimestamp: number; - timeElapsedPercentage: number; - thresholdPercentage: number; - link?: string; - discussion?: string; -} - -interface ProcessingResult { - sent: number; - skipped: number; - failed: number; -} - -export class OffchainVotingReminderTriggerHandler extends BaseTriggerHandler { - private readonly batchNotificationService: BatchNotificationService; - - constructor( - protected readonly subscriptionClient: ISubscriptionClient, - protected readonly notificationFactory: NotificationClientFactory, - anticaptureClient: AnticaptureClient - ) { - super(subscriptionClient, notificationFactory, anticaptureClient); - this.batchNotificationService = new BatchNotificationService(subscriptionClient, notificationFactory); - } - - async handleMessage(message: DispatcherMessage): Promise { - const events = message.events; - - if (!events || events.length === 0) { - return { - messageId: `offchain-voting-reminder-empty-${Date.now()}`, - timestamp: new Date().toISOString() - }; - } - - const processedCount: ProcessingResult = { sent: 0, skipped: 0, failed: 0 }; - - for (const event of events) { - try { - const result = await this.processReminderEvent(event, message.triggerId); - processedCount.sent += result.sent; - processedCount.skipped += result.skipped; - processedCount.failed += result.failed; - } catch (error) { - processedCount.failed++; - } - } - - console.log(`[OffchainVotingReminderHandler] Processing complete - Sent: ${processedCount.sent}, Skipped: ${processedCount.skipped}, Failed: ${processedCount.failed}`); - - return { - messageId: `offchain-voting-reminder-${Date.now()}`, - timestamp: new Date().toISOString() - }; - } - - private async processReminderEvent(event: VotingReminderEvent, triggerType: NotificationTypeId): Promise { - const subscribedAddresses = await this.subscriptionClient.getFollowedAddresses(event.daoId); - - if (subscribedAddresses.length === 0) { - return { sent: 0, skipped: 1, failed: 0 }; - } - - const nonVotingAddresses = await this.getNonVotingAddresses(event.id, subscribedAddresses); - - if (nonVotingAddresses.length === 0) { - return { sent: 0, skipped: 1, failed: 0 }; - } - - const buttons = buildButtons({ - triggerType: 'offchainVotingReminder', - proposalUrl: event.link, - discussionUrl: event.discussion, - }); - - const sentCount = await this.batchNotificationService.sendBatchNotifications( - nonVotingAddresses, - event.daoId, - triggerType, - () => `${event.id}-${event.thresholdPercentage}-offchain-reminder`, - (address) => this.createReminderMessage(event, address), - (address) => ({ - triggerType: 'offchainVotingReminder', - proposalId: event.id, - thresholdPercentage: event.thresholdPercentage, - timeElapsedPercentage: event.timeElapsedPercentage, - timeRemaining: FormattingService.calculateTimeRemaining(event.endTimestamp), - addresses: { address: address } - }), - () => buttons - ); - - return { sent: sentCount, skipped: 0, failed: 0 }; - } - - private async getNonVotingAddresses( - proposalId: string, - subscribedAddresses: string[] - ): Promise { - const nonVoters = await this.anticaptureClient!.getOffchainProposalNonVoters( - proposalId, - subscribedAddresses - ); - return nonVoters.map(nv => nv.voter); - } - - private createReminderMessage(event: VotingReminderEvent, address?: string): string { - const timeRemaining = FormattingService.calculateTimeRemaining(event.endTimestamp); - const title = event.title || 'Untitled Proposal'; - - return replacePlaceholders(offchainVotingReminderMessages.default, { - daoId: event.daoId, - title, - timeRemaining, - thresholdPercentage: event.thresholdPercentage.toString(), - address: address || '' - }); - } -} -``` - -- [ ] **Step 2: Register handler in dispatcher `app.ts`** - -In `apps/dispatcher/src/app.ts`: - -Add import: -```typescript -import { OffchainVotingReminderTriggerHandler } from './services/triggers/offchain-voting-reminder-trigger.service'; -``` - -Add handler registration (after the existing voting reminder handlers): -```typescript -triggerProcessorService.addHandler( - NotificationTypeId.OffchainVotingReminder75, - new OffchainVotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient) -); -``` - -- [ ] **Step 3: Build dispatcher to verify** - -Run: `cd apps/dispatcher && pnpm build` -Expected: Build succeeds - -- [ ] **Step 4: Commit** - -```bash -git add apps/dispatcher/ -git commit -m "feat: add OffchainVotingReminderTriggerHandler and register in dispatcher" -``` - ---- - -## Task 7: Tests — Service Layer (Dispatcher Handler) - -**Files:** -- Create: `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts` - -Use `/testing` skill before writing tests. - -- [ ] **Step 1: Write tests for the handler** - -Follow the same pattern as `voting-reminder-trigger.service.test.ts`. Key test cases: - -1. **Empty events** — returns early with empty message result -2. **No subscribed addresses** — skips processing, returns skipped count -3. **No non-voting addresses** — all users already voted, skips -4. **Successful send** — processes event, calls `getOffchainProposalNonVoters` (without daoId), sends via batch, verifies message template used is `offchainVotingReminderMessages.default` -5. **Buttons include Snapshot link** — verifies `buildButtons` called with `triggerType: 'offchainVotingReminder'` and `proposalUrl` -6. **Discussion link** — verifies discussion button is included when event has `discussion` field - -Mock setup: same pattern as existing test — mock `subscriptionClient`, `notificationFactory`, `anticaptureClient` with `getOffchainProposalNonVoters` instead of `getProposalNonVoters`. - -- [ ] **Step 2: Run tests** - -Run: `cd apps/dispatcher && pnpm test` -Expected: All tests pass (new + existing) - -- [ ] **Step 3: Commit** - -```bash -git add apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts -git commit -m "test: add unit tests for OffchainVotingReminderTriggerHandler" -``` - ---- - -## Task 8: Tests — Repository Layer - -Use `/testing` skill before writing tests. - -- [ ] **Step 1: Create repository test files and add `listActiveForReminder` tests** - -No existing repository test files exist, so create: -- `apps/logic-system/src/repositories/offchain-proposal.repository.test.ts` -- `apps/logic-system/src/repositories/proposal.repository.test.ts` - -For `OffchainProposalRepository`, test that: -1. `listActiveForReminder()` calls `listAll({ status: 'active' })` -2. Results are mapped correctly (fields renamed: `created/start -> startTime`, `end -> endTime`, `link` and `discussion` carried through) -3. `start` field used when available, falls back to `created` - -For `ProposalRepository`, test that: -1. `listActiveForReminder()` calls `listAll({ status: 'ACTIVE', includeOptimisticProposals: false })` -2. Results are mapped correctly (`timestamp -> startTime`, `endTimestamp -> endTime`) - -- [ ] **Step 2: Run tests** - -Run: `cd apps/logic-system && pnpm test` -Expected: All tests pass - -- [ ] **Step 3: Commit** - -```bash -git add apps/logic-system/ -git commit -m "test: add listActiveForReminder tests for proposal repositories" -``` - ---- - -## Task 9: Integration Test - -Use `/testing` skill before writing tests. - -**Files:** -- Create: `apps/integrated-tests/tests/telegram/offchain-voting-reminder-trigger.test.ts` - -- [ ] **Step 1: Write integration test** - -Follow the pattern from `apps/integrated-tests/tests/telegram/voting-reminder-trigger.test.ts`. Key differences: - -1. Use off-chain proposal factory (Snapshot proposal shape with `created`/`end` timestamps) -2. Set up GraphQL mock to return active Snapshot proposals at ~77% elapsed time (within 75-80% window) -3. Mock `offchainProposalNonVoters` GraphQL endpoint to return test addresses -4. Verify Telegram notification received with correct template (Snapshot Voting Reminder) -5. Test that proposals outside the window (e.g., 50% elapsed) do NOT trigger reminders -6. Test that users who already voted do NOT receive reminders - -- [ ] **Step 2: Run integration test** - -Run: `cd apps/integrated-tests && pnpm test -- --testPathPattern=offchain-voting-reminder` -Expected: Test passes - -- [ ] **Step 3: Commit** - -```bash -git add apps/integrated-tests/ -git commit -m "test: add integration test for offchain voting reminder flow" -``` - ---- - -## Task 10: Final Verification - -- [ ] **Step 1: Full build** - -Run: `pnpm build` (from root) -Expected: All packages and apps build successfully - -- [ ] **Step 2: Full test suite** - -Run: `pnpm test` (from root) -Expected: All tests pass - -- [ ] **Step 3: Final commit if any cleanup needed** diff --git a/docs/superpowers/specs/2026-04-01-snapshot-voting-reminder-design.md b/docs/superpowers/specs/2026-04-01-snapshot-voting-reminder-design.md deleted file mode 100644 index d2a84002..00000000 --- a/docs/superpowers/specs/2026-04-01-snapshot-voting-reminder-design.md +++ /dev/null @@ -1,142 +0,0 @@ -# Snapshot Voting Reminder — Design Spec - -## Overview - -Add voting reminders for off-chain (Snapshot) proposals. When 75% of a Snapshot proposal's voting period has elapsed, users who haven't voted receive a reminder via Telegram/Slack. - -## Key Decisions - -- **Single threshold:** 75% (with 5% window: 75-80%) -- **Single message template:** moderate urgency tone -- **NotificationTypeId:** `offchain-voting-reminder-75` -- **Approach:** Generalize existing `VotingReminderTrigger` with a normalized `VotingReminderProposal` interface. Mapper functions handle field differences between on-chain and off-chain. Separate dispatcher handler for off-chain. - -## Architecture - -### Data Flow - -``` -OffchainProposalRepository.listActiveForReminder() - -> mapOffchainToReminderProposal() (mapper) - -> VotingReminderTrigger (filters by 75-80% window) - -> VotingReminderEvent via RabbitMQ (dispatcher-queue) - -> OffchainVotingReminderTriggerHandler (dispatcher) - -> getFollowedAddresses(daoId) - -> getOffchainProposalNonVoters(proposalId, addresses) - -> offchainVotingReminderMessages template - -> RabbitMQ -> Telegram/Slack consumers -``` - -### Normalized Interface - -```typescript -interface VotingReminderProposal { - id: string; - daoId: string; - title?: string; - description?: string; - startTime: number; - endTime: number; - link?: string; // proposal URL (Snapshot link for off-chain) - discussion?: string; // forum discussion URL (off-chain only) -} -``` - -Note: `description` is optional because off-chain proposals don't have a description field. `link` and `discussion` are optional — only populated for off-chain proposals and used by the dispatcher handler to build Snapshot/discussion buttons. - -Both `ProposalRepository` and `OffchainProposalRepository` implement: - -```typescript -interface VotingReminderDataSource { - listActiveForReminder(): Promise; -} -``` - -### Mapper Functions - -Located in `apps/logic-system/src/mappers/proposal-reminder.mapper.ts`: - -- `mapOnchainToReminderProposal(p: ProposalOnChain): VotingReminderProposal` — maps `timestamp -> startTime`, `endTimestamp -> endTime`, `description -> description` -- `mapOffchainToReminderProposal(p: OffchainProposal): VotingReminderProposal` — maps `(start ?? created) -> startTime`, `end -> endTime`, `link -> link`, `discussion -> discussion`. Uses `start` (actual voting start) when available, falls back to `created`. - -### Trigger Generalization - -`VotingReminderTrigger` becomes generic, accepting `VotingReminderDataSource` instead of `ProposalDataSource`. The trigger works exclusively with `VotingReminderProposal` — no knowledge of on-chain vs off-chain. - -Existing on-chain triggers (30%, 60%, 90%) continue working with the same logic, just with `ProposalRepository.listActiveForReminder()` as data source. - -## New Files - -| File | Purpose | -|------|---------| -| `apps/logic-system/src/mappers/proposal-reminder.mapper.ts` | Mapper functions for on-chain and off-chain proposals | -| `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts` | Dispatcher handler for off-chain voting reminders | -| `packages/messages/src/triggers/offchain-voting-reminder.ts` | Message template | - -## Modified Files - -| File | Change | -|------|--------| -| `packages/anticapture-client/src/anticapture-client.ts` | Add `getOffchainProposalNonVoters(proposalId, addresses)` method | -| `packages/messages/src/notification-types.ts` | Add `OffchainVotingReminder75 = 'offchain-voting-reminder-75'` to enum and `NOTIFICATION_TYPES` record | -| `apps/logic-system/src/triggers/voting-reminder-trigger.ts` | Generalize to work with `VotingReminderProposal` and `VotingReminderDataSource` | -| `apps/logic-system/src/repositories/proposal.repository.ts` | Add `listActiveForReminder()` using `mapOnchainToReminderProposal` | -| `apps/logic-system/src/repositories/offchain-proposal.repository.ts` | Add `listActiveForReminder()` using `mapOffchainToReminderProposal` | -| `apps/logic-system/src/app.ts` | Register new off-chain trigger (threshold 75) + pass updated repos to existing triggers + add to `stop()` and `resetTriggers()` | -| `apps/dispatcher/src/app.ts` | Register `OffchainVotingReminderTriggerHandler` for `OffchainVotingReminder75` | -| `packages/messages/src/triggers/buttons.ts` | Add button config for off-chain voting reminder (Snapshot link + discussion link) | -| Relevant `index.ts` files | Update exports | - -## AntiCapture Client - -New method: - -```typescript -async getOffchainProposalNonVoters( - proposalId: string, - addresses?: string[] -): Promise -``` - -Calls GraphQL `offchainProposalNonVoters(id, addresses, orderDirection)`. Returns same `ProposalNonVoter` interface (`{ voter, votingPower }`) as the on-chain equivalent. Does not require `daoId` — the Snapshot proposal ID already identifies the DAO. - -## Dispatcher Handler - -`OffchainVotingReminderTriggerHandler` — separate handler from on-chain. Differences: - -| Aspect | On-chain | Off-chain | -|--------|----------|-----------| -| Non-voters query | `getProposalNonVoters(proposalId, daoId, addresses)` | `getOffchainProposalNonVoters(proposalId, addresses)` | -| Message template | `votingReminderMessages` (4 urgency levels) | `offchainVotingReminderMessages` (single template) | -| Buttons | On-chain proposal link | Snapshot link + discussion link | - -Receives the same normalized `VotingReminderEvent` from the Logic System. The event includes `link` and `discussion` fields (carried from the normalized proposal) so the handler can build Snapshot/discussion buttons without extra API calls. - -## Message Template - -Single template with moderate urgency: - -``` -⏰ Snapshot Voting Reminder - {{daoId}} - -Proposal: "{{title}}" - -⏱️ Time remaining: {{timeRemaining}} -📊 {{thresholdPercentage}}% of voting period has passed -🗳️ {{address}}'s vote hasn't been recorded yet - -Don't miss your chance to participate! -``` - -## Prerequisites - -- **API Gateway:** The `offchainProposalNonVoters` GraphQL query must be deployed and available. The anticapture-client must be regenerated to include the new query types. -- **Start time:** The off-chain mapper uses `start` (actual voting start) when available in `OffchainProposalItem`, falling back to `created`. If `start` is not in the current schema, it should be added to `OffchainProposalItemSchema` in `packages/anticapture-client/src/schemas.ts`. - -## Testing - -- **Service layer:** `offchain-voting-reminder-trigger.service.test.ts` (dispatcher handler) -- **Repository layer:** Tests for `listActiveForReminder()` in both repositories -- **Integration test:** End-to-end flow in `apps/integrated-tests/` -- **No mapper tests** -- Use `/testing` skill during implementation From 70e5187726dd14149587f81968d97bed3654201b Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 16:46:07 -0300 Subject: [PATCH 13/30] remove: unnecessary proposal.time declaration --- .../logic-system/src/triggers/voting-reminder-trigger.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/logic-system/src/triggers/voting-reminder-trigger.ts b/apps/logic-system/src/triggers/voting-reminder-trigger.ts index 10d0081f..fd05ab46 100644 --- a/apps/logic-system/src/triggers/voting-reminder-trigger.ts +++ b/apps/logic-system/src/triggers/voting-reminder-trigger.ts @@ -88,17 +88,14 @@ export class VotingReminderTrigger extends Trigger { return false; } - const startTime = proposal.startTime; - const endTime = proposal.endTime; - // Skip if proposal is not active - if (now <= startTime || now >= endTime) { + if (now <= proposal.startTime || now >= proposal.endTime) { return false; } const timeElapsedPercentage = this.calculateTimeElapsedPercentage( - startTime, - endTime, + proposal.startTime, + proposal.endTime, now ); From fcc4a9787d65138e7738d27dc883ca38f61abb06 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 16:47:33 -0300 Subject: [PATCH 14/30] refactor: const name TRIGGER_ID_PREFIX --- apps/logic-system/src/triggers/voting-reminder-trigger.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/logic-system/src/triggers/voting-reminder-trigger.ts b/apps/logic-system/src/triggers/voting-reminder-trigger.ts index fd05ab46..e1cb2fc7 100644 --- a/apps/logic-system/src/triggers/voting-reminder-trigger.ts +++ b/apps/logic-system/src/triggers/voting-reminder-trigger.ts @@ -24,7 +24,7 @@ export interface VotingReminderEvent { discussion?: string; } -const DEFAULT_TRIGGER_ID_PREFIX = 'voting-reminder'; +const TRIGGER_ID_PREFIX = 'voting-reminder'; // 5% window the event will be triggered between thresholdPercentage and thresholdPercentage + window const DEFAULT_WINDOW_SIZE = 5; @@ -38,9 +38,8 @@ export class VotingReminderTrigger extends Trigger { interval: number, thresholdPercentage: number = 75, windowSize: number = DEFAULT_WINDOW_SIZE, - triggerIdPrefix: string = DEFAULT_TRIGGER_ID_PREFIX ) { - super(`${triggerIdPrefix}-${thresholdPercentage}`, interval); + super(`${TRIGGER_ID_PREFIX}-${thresholdPercentage}`, interval); this.thresholdPercentage = thresholdPercentage; this.windowSize = windowSize; } From 39ca57e5480ac5cf1b3293bb6ab4ea8eb218f1e2 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 16:48:55 -0300 Subject: [PATCH 15/30] add: triggerIdPrefix to be passad as a const --- apps/logic-system/src/triggers/voting-reminder-trigger.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/logic-system/src/triggers/voting-reminder-trigger.ts b/apps/logic-system/src/triggers/voting-reminder-trigger.ts index e1cb2fc7..fd05ab46 100644 --- a/apps/logic-system/src/triggers/voting-reminder-trigger.ts +++ b/apps/logic-system/src/triggers/voting-reminder-trigger.ts @@ -24,7 +24,7 @@ export interface VotingReminderEvent { discussion?: string; } -const TRIGGER_ID_PREFIX = 'voting-reminder'; +const DEFAULT_TRIGGER_ID_PREFIX = 'voting-reminder'; // 5% window the event will be triggered between thresholdPercentage and thresholdPercentage + window const DEFAULT_WINDOW_SIZE = 5; @@ -38,8 +38,9 @@ export class VotingReminderTrigger extends Trigger { interval: number, thresholdPercentage: number = 75, windowSize: number = DEFAULT_WINDOW_SIZE, + triggerIdPrefix: string = DEFAULT_TRIGGER_ID_PREFIX ) { - super(`${TRIGGER_ID_PREFIX}-${thresholdPercentage}`, interval); + super(`${triggerIdPrefix}-${thresholdPercentage}`, interval); this.thresholdPercentage = thresholdPercentage; this.windowSize = windowSize; } From 54f7beb0abd6c9b8d30ae67e210a640007323250 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 16:51:03 -0300 Subject: [PATCH 16/30] remove: unnecessary comment --- apps/logic-system/src/interfaces/proposal.interface.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/logic-system/src/interfaces/proposal.interface.ts b/apps/logic-system/src/interfaces/proposal.interface.ts index 1a01e14f..82232bfd 100644 --- a/apps/logic-system/src/interfaces/proposal.interface.ts +++ b/apps/logic-system/src/interfaces/proposal.interface.ts @@ -1,6 +1,5 @@ import type { GetProposalByIdQuery } from '@notification-system/anticapture-client'; -// Extract only the OnchainProposal variant (not ErrorResponse) from the union type RawProposal = NonNullable; export type ProposalOnChain = Extract; export type ProposalOrNull = ProposalOnChain | null; From d268c41e7f65c1d7a4f703349661ca0334f18969 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 17:37:01 -0300 Subject: [PATCH 17/30] remove: repo tests --- .../offchain-proposal.repository.test.ts | 155 --------------- .../tests/proposal.repository.test.ts | 182 ------------------ 2 files changed, 337 deletions(-) delete mode 100644 apps/logic-system/tests/offchain-proposal.repository.test.ts delete mode 100644 apps/logic-system/tests/proposal.repository.test.ts diff --git a/apps/logic-system/tests/offchain-proposal.repository.test.ts b/apps/logic-system/tests/offchain-proposal.repository.test.ts deleted file mode 100644 index a21055da..00000000 --- a/apps/logic-system/tests/offchain-proposal.repository.test.ts +++ /dev/null @@ -1,155 +0,0 @@ -/** - * @fileoverview Unit tests for OffchainProposalRepository.listActiveForReminder() - */ - -import { describe, it, expect, jest, beforeEach } from '@jest/globals'; -import { OffchainProposalRepository } from '../src/repositories/offchain-proposal.repository'; -import { VotingReminderProposal } from '../src/interfaces/voting-reminder.interface'; - -const createMockAnticaptureClient = () => ({ - listOffchainProposals: jest.fn<() => Promise>(), -}); - -describe('OffchainProposalRepository', () => { - let repository: OffchainProposalRepository; - let mockClient: ReturnType; - - beforeEach(() => { - jest.clearAllMocks(); - mockClient = createMockAnticaptureClient(); - repository = new OffchainProposalRepository(mockClient as any); - }); - - describe('listActiveForReminder', () => { - it('should call listAll with status: active', async () => { - mockClient.listOffchainProposals.mockResolvedValue([]); - - await repository.listActiveForReminder(); - - expect(mockClient.listOffchainProposals).toHaveBeenCalledWith({ status: 'active' }); - }); - - it('should map proposals correctly — uses start when available', async () => { - const mockProposals = [ - { - id: 'snap-1', - title: 'Snapshot Proposal 1', - discussion: 'https://forum.example.com/1', - link: 'https://snapshot.org/#/dao/proposal/1', - state: 'active', - created: 1000000, - end: 2000000, - start: 1000100, // has start field — should be used as startTime - daoId: 'test-dao', - }, - ]; - - mockClient.listOffchainProposals.mockResolvedValue(mockProposals); - - const result = await repository.listActiveForReminder(); - - expect(result).toEqual([ - { - id: 'snap-1', - daoId: 'test-dao', - title: 'Snapshot Proposal 1', - startTime: 1000100, // uses start - endTime: 2000000, - link: 'https://snapshot.org/#/dao/proposal/1', - discussion: 'https://forum.example.com/1', - }, - ]); - }); - - it('should fall back to created when start field is absent', async () => { - const mockProposals = [ - { - id: 'snap-2', - title: 'Snapshot Proposal 2', - discussion: '', - link: 'https://snapshot.org/#/dao/proposal/2', - state: 'active', - created: 1100000, - end: 2100000, - // no start field — should fall back to created - daoId: 'test-dao', - }, - ]; - - mockClient.listOffchainProposals.mockResolvedValue(mockProposals); - - const result = await repository.listActiveForReminder(); - - expect(result).toEqual([ - { - id: 'snap-2', - daoId: 'test-dao', - title: 'Snapshot Proposal 2', - startTime: 1100000, // falls back to created - endTime: 2100000, - link: 'https://snapshot.org/#/dao/proposal/2', - discussion: '', - }, - ]); - }); - - it('should map multiple proposals correctly — mix of start present and absent', async () => { - const mockProposals = [ - { - id: 'snap-1', - title: 'Snapshot Proposal 1', - discussion: 'https://forum.example.com/1', - link: 'https://snapshot.org/#/dao/proposal/1', - state: 'active', - created: 1000000, - end: 2000000, - start: 1000100, - daoId: 'test-dao', - }, - { - id: 'snap-2', - title: 'Snapshot Proposal 2', - discussion: '', - link: 'https://snapshot.org/#/dao/proposal/2', - state: 'active', - created: 1100000, - end: 2100000, - daoId: 'test-dao', - }, - ]; - - mockClient.listOffchainProposals.mockResolvedValue(mockProposals); - - const result = await repository.listActiveForReminder(); - - expect(result).toEqual([ - { - id: 'snap-1', - daoId: 'test-dao', - title: 'Snapshot Proposal 1', - startTime: 1000100, - endTime: 2000000, - link: 'https://snapshot.org/#/dao/proposal/1', - discussion: 'https://forum.example.com/1', - }, - { - id: 'snap-2', - daoId: 'test-dao', - title: 'Snapshot Proposal 2', - startTime: 1100000, - endTime: 2100000, - link: 'https://snapshot.org/#/dao/proposal/2', - discussion: '', - }, - ]); - }); - - it('should return empty array when there are no active proposals', async () => { - mockClient.listOffchainProposals.mockResolvedValue([]); - - const result = await repository.listActiveForReminder(); - - expect(result).toEqual([]); - }); - }); -}); diff --git a/apps/logic-system/tests/proposal.repository.test.ts b/apps/logic-system/tests/proposal.repository.test.ts deleted file mode 100644 index 39e5f8db..00000000 --- a/apps/logic-system/tests/proposal.repository.test.ts +++ /dev/null @@ -1,182 +0,0 @@ -/** - * @fileoverview Unit tests for ProposalRepository.listActiveForReminder() - */ - -import { describe, it, expect, jest, beforeEach } from '@jest/globals'; -import { ProposalRepository } from '../src/repositories/proposal.repository'; -import { VotingReminderProposal } from '../src/interfaces/voting-reminder.interface'; - -const createMockAnticaptureClient = () => ({ - listProposals: jest.fn<() => Promise>(), - getProposalById: jest.fn<() => Promise>(), -}); - -describe('ProposalRepository', () => { - let repository: ProposalRepository; - let mockClient: ReturnType; - - beforeEach(() => { - jest.clearAllMocks(); - mockClient = createMockAnticaptureClient(); - repository = new ProposalRepository(mockClient as any); - }); - - describe('listActiveForReminder', () => { - it('should call listAll with status ACTIVE and includeOptimisticProposals false', async () => { - mockClient.listProposals.mockResolvedValue([]); - - await repository.listActiveForReminder(); - - expect(mockClient.listProposals).toHaveBeenCalledWith( - { status: 'ACTIVE', includeOptimisticProposals: false }, - undefined - ); - }); - - it('should map proposals correctly — timestamp to startTime, endTimestamp to endTime', async () => { - const mockProposals = [ - { - id: 'prop-1', - daoId: 'test-dao', - title: 'On-chain Proposal', - description: 'A governance proposal', - timestamp: 1000000, - endTimestamp: 2000000, - status: 'ACTIVE', - __typename: 'OnchainProposal', - proposerAccountId: 'user1', - targets: [], - values: [], - signatures: [], - calldatas: [], - startBlock: 100, - endBlock: 200, - forVotes: '0', - againstVotes: '0', - abstainVotes: '0', - txHash: '0xabc', - }, - ]; - - mockClient.listProposals.mockResolvedValue(mockProposals); - - const result = await repository.listActiveForReminder(); - - expect(result).toEqual([ - { - id: 'prop-1', - daoId: 'test-dao', - title: 'On-chain Proposal', - description: 'A governance proposal', - startTime: 1000000, - endTime: 2000000, - }, - ]); - }); - - it('should carry through title and description', async () => { - const mockProposals = [ - { - id: 'prop-2', - daoId: 'dao-abc', - title: 'Proposal with Title', - description: 'Detailed description here', - timestamp: 500000, - endTimestamp: 600000, - status: 'ACTIVE', - __typename: 'OnchainProposal', - proposerAccountId: 'user2', - targets: [], - values: [], - signatures: [], - calldatas: [], - startBlock: 50, - endBlock: 100, - forVotes: '1000', - againstVotes: '500', - abstainVotes: '0', - txHash: '0xdef', - }, - ]; - - mockClient.listProposals.mockResolvedValue(mockProposals); - - const result = await repository.listActiveForReminder(); - - expect(result[0].title).toBe('Proposal with Title'); - expect(result[0].description).toBe('Detailed description here'); - }); - - it('should filter out proposals with null timestamp', async () => { - const mockProposals = [ - { - id: 'prop-no-ts', - daoId: 'test-dao', - title: 'Proposal without timestamp', - description: 'Missing timestamps', - timestamp: null, - endTimestamp: 2000000, - status: 'ACTIVE', - __typename: 'OnchainProposal', - proposerAccountId: 'user1', - targets: [], - values: [], - signatures: [], - calldatas: [], - startBlock: 100, - endBlock: 200, - forVotes: '0', - againstVotes: '0', - abstainVotes: '0', - txHash: '0xabc', - }, - ]; - - mockClient.listProposals.mockResolvedValue(mockProposals); - - const result = await repository.listActiveForReminder(); - - expect(result).toEqual([]); - }); - - it('should filter out proposals with null endTimestamp', async () => { - const mockProposals = [ - { - id: 'prop-no-end', - daoId: 'test-dao', - title: 'Proposal without end timestamp', - description: 'Missing end timestamp', - timestamp: 1000000, - endTimestamp: null, - status: 'ACTIVE', - __typename: 'OnchainProposal', - proposerAccountId: 'user1', - targets: [], - values: [], - signatures: [], - calldatas: [], - startBlock: 100, - endBlock: 200, - forVotes: '0', - againstVotes: '0', - abstainVotes: '0', - txHash: '0xabc', - }, - ]; - - mockClient.listProposals.mockResolvedValue(mockProposals); - - const result = await repository.listActiveForReminder(); - - expect(result).toEqual([]); - }); - - it('should return empty array when there are no active proposals', async () => { - mockClient.listProposals.mockResolvedValue([]); - - const result = await repository.listActiveForReminder(); - - expect(result).toEqual([]); - }); - }); -}); From 862353c8003e93a6827b3bcf3b6ed8558709da02 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Wed, 1 Apr 2026 17:48:13 -0300 Subject: [PATCH 18/30] remove: duplicated test --- ...in-voting-reminder-trigger.service.test.ts | 220 ------------------ 1 file changed, 220 deletions(-) delete mode 100644 apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts diff --git a/apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts b/apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts deleted file mode 100644 index 6e099c3d..00000000 --- a/apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.test.ts +++ /dev/null @@ -1,220 +0,0 @@ -/** - * @fileoverview Tests for OffchainVotingReminderTriggerHandler - */ - -import { OffchainVotingReminderTriggerHandler } from './offchain-voting-reminder-trigger.service'; -import { DispatcherMessage } from '../../interfaces/dispatcher-message.interface'; -import { ISubscriptionClient } from '../../interfaces/subscription-client.interface'; -import { NotificationClientFactory } from '../notification/notification-factory.service'; -import { AnticaptureClient } from '@notification-system/anticapture-client'; -import { NotificationTypeId } from '@notification-system/messages'; - -describe('OffchainVotingReminderTriggerHandler', () => { - let handler: OffchainVotingReminderTriggerHandler; - let mockSubscriptionClient: jest.Mocked; - let mockNotificationFactory: jest.Mocked; - let mockAnticaptureClient: jest.Mocked; - - const mockUser = { - id: 'user-123', - channel: 'telegram', - channel_user_id: 'tg-123', - created_at: new Date('2024-01-01T00:00:00Z') - }; - - const mockVotingReminderEvent = { - id: 'snapshot-proposal-123', - daoId: 'test-dao', - title: 'Test Snapshot Proposal', - description: undefined, - startTimestamp: 1000000, - endTimestamp: 2000000, - timeElapsedPercentage: 76.5, - thresholdPercentage: 75, - link: 'https://snapshot.org/#/test-dao/proposal/123', - discussion: 'https://forum.test-dao.org/t/123' - }; - - beforeEach(() => { - mockSubscriptionClient = { - getFollowedAddresses: jest.fn(), - getWalletOwnersBatch: jest.fn(), - shouldSend: jest.fn(), - shouldSendBatch: jest.fn(), - getDaoSubscribers: jest.fn(), - markAsSent: jest.fn() - } as any; - - mockNotificationFactory = { - supportsChannel: jest.fn().mockReturnValue(true), - getClient: jest.fn().mockReturnValue({ - sendNotification: jest.fn().mockResolvedValue(undefined) - }) - } as any; - - mockAnticaptureClient = { - getOffchainProposalNonVoters: jest.fn() - } as any; - - handler = new OffchainVotingReminderTriggerHandler( - mockSubscriptionClient, - mockNotificationFactory, - mockAnticaptureClient - ); - - // Mock Date.now for consistent time calculations - jest.spyOn(Date, 'now').mockReturnValue(1500000 * 1000); - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - describe('handleMessage', () => { - it('should handle empty events array', async () => { - const message: DispatcherMessage = { - triggerId: NotificationTypeId.OffchainVotingReminder75, - events: [] - }; - - const result = await handler.handleMessage(message); - - expect(result.messageId).toMatch(/offchain-voting-reminder-empty-/); - expect(mockSubscriptionClient.getFollowedAddresses).not.toHaveBeenCalled(); - }); - - it('should skip when no subscribed addresses found', async () => { - const message: DispatcherMessage = { - triggerId: NotificationTypeId.OffchainVotingReminder75, - events: [mockVotingReminderEvent] - }; - - mockSubscriptionClient.getFollowedAddresses.mockResolvedValue([]); - - const result = await handler.handleMessage(message); - - expect(result.messageId).toMatch(/offchain-voting-reminder-/); - expect(mockAnticaptureClient.getOffchainProposalNonVoters).not.toHaveBeenCalled(); - }); - - it('should skip when all users have already voted', async () => { - const message: DispatcherMessage = { - triggerId: NotificationTypeId.OffchainVotingReminder75, - events: [mockVotingReminderEvent] - }; - - mockSubscriptionClient.getFollowedAddresses.mockResolvedValue(['0x123']); - mockAnticaptureClient.getOffchainProposalNonVoters.mockResolvedValue([]); // Empty array - all have voted - - const result = await handler.handleMessage(message); - - expect(result.messageId).toMatch(/offchain-voting-reminder-/); - expect(mockSubscriptionClient.getWalletOwnersBatch).not.toHaveBeenCalled(); - }); - - it('should process voting reminder events successfully', async () => { - const message: DispatcherMessage = { - triggerId: NotificationTypeId.OffchainVotingReminder75, - events: [mockVotingReminderEvent] - }; - - // Setup mocks - mockSubscriptionClient.getFollowedAddresses.mockResolvedValue(['0x123', '0x456']); - mockAnticaptureClient.getOffchainProposalNonVoters.mockResolvedValue([ - { voter: '0x456' } // Only 0x456 hasn't voted - ]); - mockSubscriptionClient.getWalletOwnersBatch.mockResolvedValue({ - '0x456': [mockUser] // Only 0x456 (non-voter) has users - }); - mockSubscriptionClient.getDaoSubscribers.mockResolvedValue([mockUser]); - mockSubscriptionClient.shouldSendBatch.mockResolvedValue([[{ - user_id: mockUser.id, - event_id: 'snapshot-proposal-123-75-offchain-reminder', - dao_id: 'test-dao' - }]]); - mockSubscriptionClient.markAsSent.mockResolvedValue(undefined); - - const result = await handler.handleMessage(message); - - expect(result.messageId).toMatch(/offchain-voting-reminder-/); - expect(mockSubscriptionClient.getFollowedAddresses).toHaveBeenCalledWith('test-dao'); - // NOTE: called with (proposalId, addresses) — NO daoId parameter - expect(mockAnticaptureClient.getOffchainProposalNonVoters).toHaveBeenCalledWith( - 'snapshot-proposal-123', - ['0x123', '0x456'] - ); - expect(mockSubscriptionClient.getWalletOwnersBatch).toHaveBeenCalledWith( - ['0x456'], - NotificationTypeId.OffchainVotingReminder75 - ); - }); - - it('should use single offchain message template (Snapshot Voting Reminder)', async () => { - const message: DispatcherMessage = { - triggerId: NotificationTypeId.OffchainVotingReminder75, - events: [mockVotingReminderEvent] - }; - - const mockSendNotification = jest.fn().mockResolvedValue(undefined); - mockNotificationFactory.getClient.mockReturnValue({ sendNotification: mockSendNotification } as any); - - mockSubscriptionClient.getFollowedAddresses.mockResolvedValue(['0x456']); - mockAnticaptureClient.getOffchainProposalNonVoters.mockResolvedValue([ - { voter: '0x456' } - ]); - mockSubscriptionClient.getWalletOwnersBatch.mockResolvedValue({ - '0x456': [mockUser] - }); - mockSubscriptionClient.getDaoSubscribers.mockResolvedValue([mockUser]); - mockSubscriptionClient.shouldSendBatch.mockResolvedValue([[{ - user_id: mockUser.id, - event_id: 'snapshot-proposal-123-75-offchain-reminder', - dao_id: 'test-dao' - }]]); - mockSubscriptionClient.markAsSent.mockResolvedValue(undefined); - - await handler.handleMessage(message); - - // Verify the notification client was called and message uses "Snapshot Voting Reminder" (single offchain template) - expect(mockSendNotification).toHaveBeenCalled(); - const callArgs = mockSendNotification.mock.calls[0]; - const notificationMessage: string = callArgs[0].message; - expect(notificationMessage).toContain('Snapshot Voting Reminder'); - }); - - it('should continue processing other events when one fails', async () => { - const failingEvent = { ...mockVotingReminderEvent, id: 'failing-proposal' }; - const successfulEvent = { ...mockVotingReminderEvent, id: 'successful-proposal' }; - - const message: DispatcherMessage = { - triggerId: NotificationTypeId.OffchainVotingReminder75, - events: [failingEvent, successfulEvent] - }; - - // Make first call fail, second succeed - mockSubscriptionClient.getFollowedAddresses - .mockRejectedValueOnce(new Error('Network error')) - .mockResolvedValueOnce(['0x456']); - - mockAnticaptureClient.getOffchainProposalNonVoters.mockResolvedValue([ - { voter: '0x456' } - ]); - mockSubscriptionClient.getWalletOwnersBatch.mockResolvedValue({ - '0x456': [mockUser] - }); - mockSubscriptionClient.getDaoSubscribers.mockResolvedValue([mockUser]); - mockSubscriptionClient.shouldSendBatch.mockResolvedValue([[{ - user_id: mockUser.id, - event_id: 'successful-proposal-75-offchain-reminder', - dao_id: 'test-dao' - }]]); - mockSubscriptionClient.markAsSent.mockResolvedValue(undefined); - - const result = await handler.handleMessage(message); - - expect(result.messageId).toMatch(/offchain-voting-reminder-/); - // Should have attempted both events - expect(mockSubscriptionClient.getFollowedAddresses).toHaveBeenCalledTimes(2); - }); - }); -}); From 089cb24013dd4474f1695d4d69e5521165581518 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Thu, 2 Apr 2026 09:27:55 -0300 Subject: [PATCH 19/30] add: integration tests for voting reminder --- .../offchain-voting-reminder-trigger.test.ts | 210 ++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 apps/integrated-tests/tests/telegram/offchain-voting-reminder-trigger.test.ts diff --git a/apps/integrated-tests/tests/telegram/offchain-voting-reminder-trigger.test.ts b/apps/integrated-tests/tests/telegram/offchain-voting-reminder-trigger.test.ts new file mode 100644 index 00000000..715fab2f --- /dev/null +++ b/apps/integrated-tests/tests/telegram/offchain-voting-reminder-trigger.test.ts @@ -0,0 +1,210 @@ +/** + * @fileoverview Integration tests for the Snapshot (off-chain) voting reminder feature + * Tests the complete flow for the offchainVotingReminderTrigger75 trigger + * which fires at 75% elapsed time (within 75-80% window) + */ + +import { describe, test, expect, beforeEach, beforeAll } from '@jest/globals'; +import { db, TestApps } from '../../src/setup'; +import { HttpClientMockSetup, GraphQLMockSetup } from '../../src/mocks'; +import { UserFactory, OffchainProposalFactory } from '../../src/fixtures'; +import { TelegramTestHelper, DatabaseTestHelper, TestCleanup } from '../../src/helpers'; +import { testConstants, timeouts } from '../../src/config'; +import { waitForCondition } from '../../src/helpers/utilities/wait-for'; + +describe('Offchain Voting Reminder Integration Tests', () => { + let apps: TestApps; + let httpMockSetup: HttpClientMockSetup; + let telegramHelper: TelegramTestHelper; + let dbHelper: DatabaseTestHelper; + + const testDaoId = 'test-dao-offchain-reminder'; + const testUser = { + chatId: testConstants.profiles.p1.chatId, + address: '0x1234567890abcdef1234567890abcdef12345678' + }; + + /** + * Creates an offchain proposal with a specific elapsed time percentage + * @param proposalId - Unique identifier for the proposal + * @param elapsedPercentage - Percentage of voting period that has elapsed (0-100) + */ + const createOffchainProposalWithElapsedTime = (proposalId: string, elapsedPercentage: number) => { + const now = Math.floor(Date.now() / 1000); + const duration = 100000; // seconds + const elapsed = Math.floor(duration * (elapsedPercentage / 100)); + const start = now - elapsed; + const end = start + duration; + + return OffchainProposalFactory.createProposal(testDaoId, proposalId, { + state: 'active', + start, + end, + created: start, + title: `Snapshot Proposal ${elapsedPercentage}% Test` + }); + }; + + beforeAll(async () => { + apps = TestCleanup.getGlobalApps(); + httpMockSetup = TestCleanup.getGlobalHttpMockSetup(); + telegramHelper = new TelegramTestHelper(global.mockTelegramSendMessage); + dbHelper = new DatabaseTestHelper(db); + }); + + beforeEach(async () => { + await TestCleanup.cleanupBetweenTests(); + + // Create test user with subscription to the DAO and wallet address + const pastTimestamp = new Date(Date.now() - timeouts.wait.long).toISOString(); + await UserFactory.createUserWithFollowedAddresses( + testUser.chatId, + 'offchain-voting-reminder-user', + testDaoId, + [testUser.address], + true, + pastTimestamp + ); + }); + + describe('75% Reminder Threshold', () => { + test('should send Snapshot voting reminder when 77% of voting period has elapsed and user has not voted', async () => { + // Create proposal where 77% of time has elapsed (within 75-80% window) + const proposal = createOffchainProposalWithElapsedTime('offchain-proposal-75-reminder', 77); + + // Setup mock with no offchain votes — user has NOT voted + GraphQLMockSetup.setupMock( + httpMockSetup.getMockClient(), + [], // no on-chain proposals + [], // no voting power data + { [testDaoId]: 1 }, + [], // no on-chain votes + [proposal], + [] // no offchain votes + ); + + // Wait for the notification to be sent + const message = await telegramHelper.waitForMessage( + msg => + msg.text.includes('Snapshot Voting Reminder') || + msg.text.includes('75% of voting period has passed'), + { timeout: timeouts.notification.delivery } + ); + + // Verify message content matches the expected template + expect(message.chatId).toBe(testUser.chatId); + expect(message.text).toContain('⏰ Snapshot Voting Reminder'); + expect(message.text).toContain('75% of voting period has passed'); + expect(message.text).toContain(testDaoId); + + // Verify database record exists for deduplication + const notifications = await dbHelper.getNotifications(); + const relevantNotifs = notifications.filter(n => + n.event_id?.includes('75-reminder') || n.event_id?.includes('offchain-proposal-75-reminder') + ); + expect(relevantNotifs).toHaveLength(1); + }); + + test('should NOT send reminder when user has already voted on the Snapshot proposal', async () => { + // Create proposal where 77% of time has elapsed + const proposal = createOffchainProposalWithElapsedTime('offchain-proposal-75-voted', 77); + + // Setup mock with user's offchain vote already recorded + const offchainVotes = [{ + voter: testUser.address, + proposalId: proposal.id, + daoId: testDaoId, + created: Math.floor(Date.now() / 1000), + vp: 1000 + }]; + + GraphQLMockSetup.setupMock( + httpMockSetup.getMockClient(), + [], + [], + { [testDaoId]: 1 }, + [], + [proposal], + offchainVotes // User HAS voted + ); + + // Wait for processing to complete and verify no messages were sent + await waitForCondition( + () => { + const messages = telegramHelper.getAllMessages(); + return messages.length === 0; + }, + 'Expected no offchain voting reminder when user has already voted', + { timeout: 500, interval: 50 } + ); + + const messages = telegramHelper.getAllMessages(); + const snapshotReminderMessages = messages.filter(m => + m.text.includes('Snapshot Voting Reminder') + ); + expect(snapshotReminderMessages).toHaveLength(0); + }); + + test('should NOT send reminder when proposal is at 60% elapsed (below 75% threshold)', async () => { + // Create proposal where only 60% of time has elapsed — below the 75% trigger + const proposal = createOffchainProposalWithElapsedTime('offchain-proposal-below-threshold', 60); + + GraphQLMockSetup.setupMock( + httpMockSetup.getMockClient(), + [], + [], + { [testDaoId]: 1 }, + [], + [proposal], + [] + ); + + // Wait for processing and verify no messages were sent + await waitForCondition( + () => { + const messages = telegramHelper.getAllMessages(); + return messages.length === 0; + }, + 'Expected no offchain voting reminder for proposal below 75% threshold', + { timeout: 500, interval: 50 } + ); + + const messages = telegramHelper.getAllMessages(); + const snapshotReminderMessages = messages.filter(m => + m.text.includes('Snapshot Voting Reminder') + ); + expect(snapshotReminderMessages).toHaveLength(0); + }); + + test('should NOT send reminder when proposal is at 83% elapsed (above 80% window)', async () => { + // Create proposal where 83% of time has elapsed — above the 75-80% window + const proposal = createOffchainProposalWithElapsedTime('offchain-proposal-above-window', 83); + + GraphQLMockSetup.setupMock( + httpMockSetup.getMockClient(), + [], + [], + { [testDaoId]: 1 }, + [], + [proposal], + [] + ); + + // Wait for processing and verify no messages were sent + await waitForCondition( + () => { + const messages = telegramHelper.getAllMessages(); + return messages.length === 0; + }, + 'Expected no offchain voting reminder for proposal above 80% window', + { timeout: 500, interval: 50 } + ); + + const messages = telegramHelper.getAllMessages(); + const snapshotReminderMessages = messages.filter(m => + m.text.includes('Snapshot Voting Reminder') + ); + expect(snapshotReminderMessages).toHaveLength(0); + }); + }); +}); From b353c84527af21073eb195a8094b0cdc68890924 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Thu, 2 Apr 2026 09:28:49 -0300 Subject: [PATCH 20/30] refactor: notification to use the new generated api files --- apps/logic-system/src/app.ts | 9 ++--- apps/logic-system/src/config/env.ts | 9 +---- .../src/interfaces/proposal.interface.ts | 23 +++-------- .../src/repositories/proposal.repository.ts | 24 ++++-------- .../src/triggers/proposal-finished-trigger.ts | 13 +++++-- .../dist/anticapture-client.js | 25 +++--------- .../anticapture-client/dist/gql/graphql.d.ts | 17 +++++++++ .../anticapture-client/dist/gql/graphql.js | 3 +- packages/anticapture-client/dist/schemas.d.ts | 20 +++++----- .../offchain-proposal-non-voters.graphql | 8 ++++ .../src/anticapture-client.ts | 38 +++++++------------ .../anticapture-client/src/gql/graphql.ts | 10 +++++ 12 files changed, 96 insertions(+), 103 deletions(-) create mode 100644 packages/anticapture-client/queries/offchain-proposal-non-voters.graphql diff --git a/apps/logic-system/src/app.ts b/apps/logic-system/src/app.ts index 5c3bf314..0a5d1b1d 100644 --- a/apps/logic-system/src/app.ts +++ b/apps/logic-system/src/app.ts @@ -13,9 +13,8 @@ import { ThresholdRepository } from './repositories/threshold.repository'; import { VotesRepository } from './repositories/votes.repository'; import { OffchainVotesRepository } from './repositories/offchain-votes.repository'; import { RabbitMQDispatcherService } from './api-clients/rabbitmq-dispatcher.service'; -import { AnticaptureClient } from '@notification-system/anticapture-client'; +import { AnticaptureClient, QueryInput_Proposals_Status_Items } from '@notification-system/anticapture-client'; import { RabbitMQConnection, RabbitMQPublisher } from '@notification-system/rabbitmq-client'; -import { ProposalStatus } from './interfaces/proposal.interface'; import { AxiosInstance } from 'axios'; export class App { @@ -30,14 +29,14 @@ export class App { private votingReminderTrigger60!: VotingReminderTrigger; private votingReminderTrigger90!: VotingReminderTrigger; private offchainVotingReminderTrigger75!: VotingReminderTrigger; - private proposalStatus: ProposalStatus; + private proposalStatus: QueryInput_Proposals_Status_Items; private rabbitMQConnection!: RabbitMQConnection; private rabbitMQPublisher!: RabbitMQPublisher; private initPromise: Promise; constructor( - triggerInterval: number, - proposalStatus: ProposalStatus, + triggerInterval: number, + proposalStatus: QueryInput_Proposals_Status_Items, anticaptureHttpClient: AxiosInstance, rabbitmqUrl: string, initialTimestamp?: string diff --git a/apps/logic-system/src/config/env.ts b/apps/logic-system/src/config/env.ts index 76ffa70e..73e43d66 100644 --- a/apps/logic-system/src/config/env.ts +++ b/apps/logic-system/src/config/env.ts @@ -1,22 +1,17 @@ import dotenv from 'dotenv'; import { z } from 'zod'; +import { QueryInput_Proposals_Status_Items } from '@notification-system/anticapture-client'; // Load environment variables dotenv.config(); -// Define valid proposal statuses -const validProposalStatuses = [ - 'PENDING', 'ACTIVE', 'SUCCEEDED', 'DEFEATED', - 'EXECUTED', 'CANCELED', 'QUEUED', 'EXPIRED' -] as const; - // Define environment variables schema with validation const envSchema = z.object({ ANTICAPTURE_GRAPHQL_ENDPOINT: z.string().url('ANTICAPTURE_GRAPHQL_ENDPOINT must be a valid URL'), BLOCKFUL_API_TOKEN: z.string().optional(), RABBITMQ_URL: z.string().url(), TRIGGER_INTERVAL: z.coerce.number().optional().default(60000), - PROPOSAL_STATUS: z.enum(validProposalStatuses), + PROPOSAL_STATUS: z.nativeEnum(QueryInput_Proposals_Status_Items), }); const _env = envSchema.safeParse(process.env); diff --git a/apps/logic-system/src/interfaces/proposal.interface.ts b/apps/logic-system/src/interfaces/proposal.interface.ts index 82232bfd..eb183e56 100644 --- a/apps/logic-system/src/interfaces/proposal.interface.ts +++ b/apps/logic-system/src/interfaces/proposal.interface.ts @@ -1,21 +1,10 @@ -import type { GetProposalByIdQuery } from '@notification-system/anticapture-client'; +import type { GetProposalByIdQuery, QueryInput_Proposals_Status_Items, OrderDirection } from '@notification-system/anticapture-client'; type RawProposal = NonNullable; export type ProposalOnChain = Extract; export type ProposalOrNull = ProposalOnChain | null; -/** - * Valid status values for a proposal - */ -export type ProposalStatus = - | 'PENDING' - | 'ACTIVE' - | 'SUCCEEDED' - | 'DEFEATED' - | 'EXECUTED' - | 'CANCELED' - | 'QUEUED' - | 'EXPIRED'; +export type { QueryInput_Proposals_Status_Items as ProposalStatus }; /** * Options for listing proposals (matches new API parameters) @@ -25,16 +14,16 @@ export interface ListProposalsOptions { skip?: number; /** Maximum number of proposals to return */ limit?: number; - /** Filter by status - can be string or array */ - status?: string | string[]; + /** Filter by proposal status */ + status?: QueryInput_Proposals_Status_Items | QueryInput_Proposals_Status_Items[]; /** Filter by DAO (passed as header, not query param) */ daoId?: string; /** Filter proposals after this date (timestamp in seconds) */ fromDate?: number; /** Filter proposals by end timestamp (timestamp in seconds) */ fromEndDate?: number; - /** Order direction - asc or desc */ - orderDirection?: string; + /** Order direction */ + orderDirection?: OrderDirection; /** Whether to include optimistic proposals (true=include, false=exclude, undefined=both) */ includeOptimisticProposals?: boolean; } diff --git a/apps/logic-system/src/repositories/proposal.repository.ts b/apps/logic-system/src/repositories/proposal.repository.ts index e56c8e55..c4cdf21e 100644 --- a/apps/logic-system/src/repositories/proposal.repository.ts +++ b/apps/logic-system/src/repositories/proposal.repository.ts @@ -1,6 +1,7 @@ import { ProposalDataSource, ProposalOnChain, ProposalOrNull, ListProposalsOptions } from '../interfaces/proposal.interface'; import { VotingReminderDataSource, VotingReminderProposal } from '../interfaces/voting-reminder.interface'; -import { AnticaptureClient, ListProposalsQueryVariables } from '@notification-system/anticapture-client'; +import { AnticaptureClient, ListProposalsQueryVariables, OrderDirection, QueryInput_Proposals_Status_Items } from '@notification-system/anticapture-client'; +import { mapOnchainToReminderProposal } from '../mappers/proposal-reminder.mapper'; export class ProposalRepository implements ProposalDataSource, VotingReminderDataSource { private anticaptureClient: AnticaptureClient; @@ -20,7 +21,7 @@ export class ProposalRepository implements ProposalDataSource, VotingReminderDat // Status filtering if (options?.status) { - variables.status = options.status as any; + variables.status = options.status; } // Date filtering @@ -46,11 +47,9 @@ export class ProposalRepository implements ProposalDataSource, VotingReminderDat variables.skip = options.skip; } - // Ordering - enum requires cast - if (options?.orderDirection === 'asc') { - variables.orderDirection = 'asc' as any; - } else if (options?.orderDirection === 'desc') { - variables.orderDirection = 'desc' as any; + // Ordering + if (options?.orderDirection) { + variables.orderDirection = options.orderDirection; } const daoId = options?.daoId; @@ -62,20 +61,13 @@ export class ProposalRepository implements ProposalDataSource, VotingReminderDat async listActiveForReminder(): Promise { const proposals = await this.listAll({ - status: 'ACTIVE', + status: QueryInput_Proposals_Status_Items.Active, includeOptimisticProposals: false, }); return proposals .filter(p => p.timestamp != null && p.endTimestamp != null) - .map(p => ({ - id: p.id, - daoId: p.daoId, - title: p.title ?? undefined, - description: p.description ?? undefined, - startTime: p.timestamp, - endTime: p.endTimestamp, - })); + .map(mapOnchainToReminderProposal); } } diff --git a/apps/logic-system/src/triggers/proposal-finished-trigger.ts b/apps/logic-system/src/triggers/proposal-finished-trigger.ts index 059d16fd..c59a73ca 100644 --- a/apps/logic-system/src/triggers/proposal-finished-trigger.ts +++ b/apps/logic-system/src/triggers/proposal-finished-trigger.ts @@ -4,12 +4,19 @@ import { RabbitMQDispatcherService } from '../api-clients/rabbitmq-dispatcher.se import { DispatcherMessage } from '../interfaces/dispatcher.interface'; import { ProposalOnChain, ProposalFinishedNotification } from '../interfaces/proposal.interface'; import { NotificationTypeId } from '@notification-system/messages'; +import { OrderDirection, QueryInput_Proposals_Status_Items } from '@notification-system/anticapture-client'; /** * Trigger for detecting finished proposals */ export class ProposalFinishedTrigger extends Trigger { - private readonly finishedStatuses = ['EXECUTED', 'DEFEATED', 'SUCCEEDED', 'EXPIRED', 'CANCELED']; + private readonly finishedStatuses: QueryInput_Proposals_Status_Items[] = [ + QueryInput_Proposals_Status_Items.Executed, + QueryInput_Proposals_Status_Items.Defeated, + QueryInput_Proposals_Status_Items.Succeeded, + QueryInput_Proposals_Status_Items.Expired, + QueryInput_Proposals_Status_Items.Canceled, + ]; private endTimestampCursor: number; constructor( @@ -43,9 +50,9 @@ export class ProposalFinishedTrigger extends Trigger { protected async fetchData(): Promise { return await this.proposalRepository.listAll({ - status: this.finishedStatuses, // API accepts array + status: this.finishedStatuses, fromEndDate: this.endTimestampCursor, - orderDirection: 'desc', // API orders by endTimestamp when using fromEndDate + orderDirection: OrderDirection.Desc, limit: 100 }); } diff --git a/packages/anticapture-client/dist/anticapture-client.js b/packages/anticapture-client/dist/anticapture-client.js index 3e448b93..6c8c49d8 100644 --- a/packages/anticapture-client/dist/anticapture-client.js +++ b/packages/anticapture-client/dist/anticapture-client.js @@ -265,25 +265,12 @@ class AnticaptureClient { */ async getOffchainProposalNonVoters(proposalId, addresses) { try { - const response = await this.httpClient.post('', { - query: `query OffchainProposalNonVoters($id: String!, $addresses: String, $orderDirection: String) { - offchainProposalNonVoters(id: $id, addresses: $addresses, orderDirection: $orderDirection) { - items { - voter - votingPower - } - } - }`, - variables: { - id: proposalId, - ...(addresses && { addresses: addresses.join(',') }), - orderDirection: 'desc' - } - }, { headers: this.buildHeaders() }); - if (response.data.errors) { - throw new Error(JSON.stringify(response.data.errors)); - } - const validated = schemas_1.SafeOffchainProposalNonVotersResponseSchema.parse(this.toLowercase(response.data.data)); + const variables = { + id: proposalId, + ...(addresses && { addresses: addresses.join(',') }), + orderDirection: 'desc', + }; + const validated = await this.query(graphql_2.OffchainProposalNonVotersDocument, schemas_1.SafeOffchainProposalNonVotersResponseSchema, variables); return validated.offchainProposalNonVoters.items; } catch (error) { diff --git a/packages/anticapture-client/dist/gql/graphql.d.ts b/packages/anticapture-client/dist/gql/graphql.d.ts index 76bc59cd..5982450b 100644 --- a/packages/anticapture-client/dist/gql/graphql.d.ts +++ b/packages/anticapture-client/dist/gql/graphql.d.ts @@ -1702,6 +1702,23 @@ export type ListHistoricalVotingPowerQuery = { } | null>; } | null; }; +export type OffchainProposalNonVotersQueryVariables = Exact<{ + id: Scalars['String']['input']; + addresses?: InputMaybe; + orderDirection?: InputMaybe; +}>; +export type OffchainProposalNonVotersQuery = { + __typename?: 'Query'; + offchainProposalNonVoters?: { + __typename?: 'OffchainVotersResponse'; + items: Array<{ + __typename?: 'OffchainVoter'; + voter: string; + votingPower?: string | null; + } | null>; + } | null; +}; +export declare const OffchainProposalNonVotersDocument: DocumentNode; export declare const GetDaOsDocument: DocumentNode; export declare const ListOffchainProposalsDocument: DocumentNode; export declare const ListOffchainVotesDocument: DocumentNode; diff --git a/packages/anticapture-client/dist/gql/graphql.js b/packages/anticapture-client/dist/gql/graphql.js index bb4fdeb2..1819abd6 100644 --- a/packages/anticapture-client/dist/gql/graphql.js +++ b/packages/anticapture-client/dist/gql/graphql.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.ListHistoricalVotingPowerDocument = exports.ListVotesDocument = exports.GetEventRelevanceThresholdDocument = exports.ListProposalsDocument = exports.GetProposalByIdDocument = exports.ProposalNonVotersDocument = exports.ListOffchainVotesDocument = exports.ListOffchainProposalsDocument = exports.GetDaOsDocument = exports.QueryInput_VotingPowers_OrderBy = exports.QueryInput_Votes_OrderBy = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_VotesOffchainByProposalId_OrderBy = exports.QueryInput_VotesByProposalId_OrderBy = exports.QueryInput_Transfers_OrderBy = exports.QueryInput_Transactions_Includes_Items = exports.QueryInput_Transactions_AffectedSupply_Items = exports.QueryInput_Token_Currency = exports.QueryInput_TokenMetrics_MetricType = exports.QueryInput_Proposals_Status_Items = exports.QueryInput_ProposalsActivity_UserVoteFilter = exports.QueryInput_ProposalsActivity_OrderBy = exports.QueryInput_OffchainProposals_Status_Items = exports.QueryInput_LastUpdate_Chart = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.QueryInput_HistoricalVotingPowerByAccountId_OrderBy = exports.QueryInput_HistoricalBalances_OrderBy = exports.QueryInput_FeedEvents_Type = exports.QueryInput_FeedEvents_Relevance = exports.QueryInput_FeedEvents_OrderBy = exports.QueryInput_Delegators_OrderBy = exports.QueryInput_AccountInteractions_OrderBy = exports.QueryInput_AccountBalances_OrderBy = exports.OrderDirection = exports.HttpMethod = exports.FeedRelevance = exports.FeedEventType = exports.DaysWindow = void 0; +exports.ListHistoricalVotingPowerDocument = exports.ListVotesDocument = exports.GetEventRelevanceThresholdDocument = exports.ListProposalsDocument = exports.GetProposalByIdDocument = exports.ProposalNonVotersDocument = exports.ListOffchainVotesDocument = exports.ListOffchainProposalsDocument = exports.GetDaOsDocument = exports.OffchainProposalNonVotersDocument = exports.QueryInput_VotingPowers_OrderBy = exports.QueryInput_Votes_OrderBy = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_VotesOffchainByProposalId_OrderBy = exports.QueryInput_VotesByProposalId_OrderBy = exports.QueryInput_Transfers_OrderBy = exports.QueryInput_Transactions_Includes_Items = exports.QueryInput_Transactions_AffectedSupply_Items = exports.QueryInput_Token_Currency = exports.QueryInput_TokenMetrics_MetricType = exports.QueryInput_Proposals_Status_Items = exports.QueryInput_ProposalsActivity_UserVoteFilter = exports.QueryInput_ProposalsActivity_OrderBy = exports.QueryInput_OffchainProposals_Status_Items = exports.QueryInput_LastUpdate_Chart = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.QueryInput_HistoricalVotingPowerByAccountId_OrderBy = exports.QueryInput_HistoricalBalances_OrderBy = exports.QueryInput_FeedEvents_Type = exports.QueryInput_FeedEvents_Relevance = exports.QueryInput_FeedEvents_OrderBy = exports.QueryInput_Delegators_OrderBy = exports.QueryInput_AccountInteractions_OrderBy = exports.QueryInput_AccountBalances_OrderBy = exports.OrderDirection = exports.HttpMethod = exports.FeedRelevance = exports.FeedEventType = exports.DaysWindow = void 0; var DaysWindow; (function (DaysWindow) { DaysWindow["7d"] = "_7d"; @@ -211,6 +211,7 @@ var QueryInput_VotingPowers_OrderBy; QueryInput_VotingPowers_OrderBy["Variation"] = "variation"; QueryInput_VotingPowers_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_VotingPowers_OrderBy || (exports.QueryInput_VotingPowers_OrderBy = QueryInput_VotingPowers_OrderBy = {})); +exports.OffchainProposalNonVotersDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "OffchainProposalNonVoters" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "offchainProposalNonVoters" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "addresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }] } }] } }] } }] }; exports.GetDaOsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetDAOs" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "daos" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingDelay" } }, { "kind": "Field", "name": { "kind": "Name", "value": "chainId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "alreadySupportCalldataReview" } }, { "kind": "Field", "name": { "kind": "Name", "value": "supportOffchainData" } }] } }] } }] } }] }; exports.ListOffchainProposalsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainProposals" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_offchainProposals_status_items" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "offchainProposals" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "status" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "endDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "discussion" } }, { "kind": "Field", "name": { "kind": "Name", "value": "link" } }, { "kind": "Field", "name": { "kind": "Name", "value": "state" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "end" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; exports.ListOffchainVotesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainVotes" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votesOffchain_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "votesOffchain" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "toDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "voterAddresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalTitle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "vp" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; diff --git a/packages/anticapture-client/dist/schemas.d.ts b/packages/anticapture-client/dist/schemas.d.ts index 9c055074..08e04a53 100644 --- a/packages/anticapture-client/dist/schemas.d.ts +++ b/packages/anticapture-client/dist/schemas.d.ts @@ -804,15 +804,15 @@ export declare const OffchainVoteItemSchema: z.ZodObject<{ reason: z.ZodOptional>; vp: z.ZodOptional>; }, "strip", z.ZodTypeAny, { - created: number; voter: string; + created: number; proposalId: string; proposalTitle: string; reason?: string | null | undefined; vp?: number | null | undefined; }, { - created: number; voter: string; + created: number; proposalId: string; proposalTitle: string; reason?: string | null | undefined; @@ -829,15 +829,15 @@ export declare const SafeOffchainVotesResponseSchema: z.ZodEffects>; vp: z.ZodOptional>; }, "strip", z.ZodTypeAny, { - created: number; voter: string; + created: number; proposalId: string; proposalTitle: string; reason?: string | null | undefined; vp?: number | null | undefined; }, { - created: number; voter: string; + created: number; proposalId: string; proposalTitle: string; reason?: string | null | undefined; @@ -846,8 +846,8 @@ export declare const SafeOffchainVotesResponseSchema: z.ZodEffects, { votesOffchain: { items: { - created: number; voter: string; + created: number; proposalId: string; proposalTitle: string; reason?: string | null | undefined; @@ -904,8 +904,8 @@ export declare const SafeOffchainVotesResponseSchema: z.ZodEffects['items']; type VotingPowerHistoryItems = ProcessedVotingPowerHistory[]; type ProposalNonVoter = z.infer['proposalNonVoters']['items'][0]; -type VoteItem = NonNullable['items'][0]>; +type VoteItem = z.infer['votes']['items'][0]; export type VoteWithDaoId = VoteItem & { daoId: string }; export type OffchainVoteWithDaoId = OffchainVoteItem & { daoId: string }; @@ -271,7 +271,7 @@ export class AnticaptureClient { variables, daoId ); - return validated.votes.items.filter(item => item !== null) as unknown as VoteItem[]; + return validated.votes.items; } catch (error) { console.warn(`Error fetching votes for DAO ${daoId}:`, error); return []; @@ -322,28 +322,16 @@ export class AnticaptureClient { addresses?: string[], ): Promise<{ voter: string; votingPower?: string }[]> { try { - const response = await this.httpClient.post('', { - query: `query OffchainProposalNonVoters($id: String!, $addresses: String, $orderDirection: String) { - offchainProposalNonVoters(id: $id, addresses: $addresses, orderDirection: $orderDirection) { - items { - voter - votingPower - } - } - }`, - variables: { - id: proposalId, - ...(addresses && { addresses: addresses.join(',') }), - orderDirection: 'desc' - } - }, { headers: this.buildHeaders() }); - - if (response.data.errors) { - throw new Error(JSON.stringify(response.data.errors)); - } + const variables: OffchainProposalNonVotersQueryVariables = { + id: proposalId, + ...(addresses && { addresses: addresses.join(',') }), + orderDirection: 'desc', + }; - const validated = SafeOffchainProposalNonVotersResponseSchema.parse( - this.toLowercase(response.data.data) + const validated = await this.query( + OffchainProposalNonVotersDocument, + SafeOffchainProposalNonVotersResponseSchema, + variables, ); return validated.offchainProposalNonVoters.items; diff --git a/packages/anticapture-client/src/gql/graphql.ts b/packages/anticapture-client/src/gql/graphql.ts index bb3583c7..6f17d047 100644 --- a/packages/anticapture-client/src/gql/graphql.ts +++ b/packages/anticapture-client/src/gql/graphql.ts @@ -1751,6 +1751,16 @@ export type ListHistoricalVotingPowerQueryVariables = Exact<{ export type ListHistoricalVotingPowerQuery = { __typename?: 'Query', historicalVotingPower?: { __typename?: 'HistoricalVotingPowersResponse', totalCount: number, items: Array<{ __typename?: 'HistoricalVotingPower', accountId: string, timestamp: string, votingPower: string, delta: string, daoId: string, transactionHash: string, logIndex: number, delegation?: { __typename?: 'HistoricalVotingPowerDelegation', from: string, to: string, value: string, previousDelegate?: string | null } | null, transfer?: { __typename?: 'HistoricalVotingPowerTransfer', from: string, to: string, value: string } | null } | null> } | null }; +export type OffchainProposalNonVotersQueryVariables = Exact<{ + id: Scalars['String']['input']; + addresses?: InputMaybe; + orderDirection?: InputMaybe; +}>; + +export type OffchainProposalNonVotersQuery = { __typename?: 'Query', offchainProposalNonVoters?: { __typename?: 'OffchainVotersResponse', items: Array<{ __typename?: 'OffchainVoter', voter: string, votingPower?: string | null } | null> } | null }; + +export const OffchainProposalNonVotersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"OffchainProposalNonVoters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offchainProposalNonVoters"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"addresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}}]}}]}}]}}]} as unknown as DocumentNode; + export const GetDaOsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDAOs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"daos"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"votingDelay"}},{"kind":"Field","name":{"kind":"Name","value":"chainId"}},{"kind":"Field","name":{"kind":"Name","value":"alreadySupportCalldataReview"}},{"kind":"Field","name":{"kind":"Name","value":"supportOffchainData"}}]}}]}}]}}]} as unknown as DocumentNode; export const ListOffchainProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"status"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_offchainProposals_status_items"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offchainProposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"status"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"endDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"discussion"}},{"kind":"Field","name":{"kind":"Name","value":"link"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"end"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; export const ListOffchainVotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainVotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votesOffchain_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"votesOffchain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"toDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"voterAddresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"proposalTitle"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"vp"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; From edd9a8c1c621a457923e2bc7d7e59b973dfa5998 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Thu, 2 Apr 2026 13:30:50 -0300 Subject: [PATCH 21/30] feat: modular voting reminder handler --- apps/dispatcher/src/app.ts | 20 +- .../interfaces/voting-reminder.interface.ts | 21 ++ ...ffchain-voting-reminder-trigger.service.ts | 161 --------------- .../vote-confirmation-trigger.service.test.ts | 6 +- .../voting-reminder-trigger.service.test.ts | 51 ++--- .../voting-reminder-trigger.service.ts | 102 ++++------ .../src/setup/services/apps.ts | 6 +- .../tests/new-proposal-trigger.test.ts | 13 +- .../tests/proposal-finished-trigger.test.ts | 17 +- ...cher-voting-reminder-unification-design.md | 185 ++++++++++++++++++ .../dist/anticapture-client.d.ts | 6 +- .../dist/anticapture-client.js | 2 +- packages/messages/src/triggers/buttons.ts | 14 +- .../src/triggers/offchain-voting-reminder.ts | 7 + .../messages/src/triggers/voting-reminder.ts | 10 + 15 files changed, 344 insertions(+), 277 deletions(-) create mode 100644 apps/dispatcher/src/interfaces/voting-reminder.interface.ts delete mode 100644 apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts create mode 100644 docs/superpowers/specs/2026-04-02-dispatcher-voting-reminder-unification-design.md diff --git a/apps/dispatcher/src/app.ts b/apps/dispatcher/src/app.ts index 827a8854..8afcd8a5 100644 --- a/apps/dispatcher/src/app.ts +++ b/apps/dispatcher/src/app.ts @@ -13,10 +13,10 @@ import { NonVotingHandler } from './services/triggers/non-voting-handler.service import { VoteConfirmationTriggerHandler } from './services/triggers/vote-confirmation-trigger.service'; import { OffchainVoteCastTriggerHandler } from './services/triggers/offchain-vote-cast-trigger.service'; import { VotingReminderTriggerHandler } from './services/triggers/voting-reminder-trigger.service'; -import { OffchainVotingReminderTriggerHandler } from './services/triggers/offchain-voting-reminder-trigger.service'; +import { NonVotersSource } from './interfaces/voting-reminder.interface'; import { RabbitMQConnection, RabbitMQPublisher } from '@notification-system/rabbitmq-client'; import { AnticaptureClient } from '@notification-system/anticapture-client'; -import { NotificationTypeId } from '@notification-system/messages'; +import { NotificationTypeId, votingReminderMessages, offchainVotingReminderMessages } from '@notification-system/messages'; export class App { private rabbitMQConsumerService!: RabbitMQConsumerService; @@ -105,22 +105,30 @@ export class App { new OffchainVoteCastTriggerHandler(subscriptionClient, notificationFactory) ); + const onchainNonVotersSource: NonVotersSource = { + getNonVoters: (id, daoId, addrs) => anticaptureClient.getProposalNonVoters(id, daoId, addrs) + }; + + const offchainNonVotersSource: NonVotersSource = { + getNonVoters: (id, _daoId, addrs) => anticaptureClient.getOffchainProposalNonVoters(id, addrs) + }; + triggerProcessorService.addHandler( NotificationTypeId.VotingReminder30, - new VotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient) + new VotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient, onchainNonVotersSource, votingReminderMessages, 'voting-reminder') ); triggerProcessorService.addHandler( NotificationTypeId.VotingReminder60, - new VotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient) + new VotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient, onchainNonVotersSource, votingReminderMessages, 'voting-reminder') ); triggerProcessorService.addHandler( NotificationTypeId.VotingReminder90, - new VotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient) + new VotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient, onchainNonVotersSource, votingReminderMessages, 'voting-reminder') ); triggerProcessorService.addHandler( NotificationTypeId.OffchainVotingReminder75, - new OffchainVotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient) + new VotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient, offchainNonVotersSource, offchainVotingReminderMessages, 'offchain-voting-reminder') ); this.rabbitMQConsumerService = new RabbitMQConsumerService(this.rabbitmqUrl, triggerProcessorService); diff --git a/apps/dispatcher/src/interfaces/voting-reminder.interface.ts b/apps/dispatcher/src/interfaces/voting-reminder.interface.ts new file mode 100644 index 00000000..e07961cd --- /dev/null +++ b/apps/dispatcher/src/interfaces/voting-reminder.interface.ts @@ -0,0 +1,21 @@ +export interface VotingReminderEvent { + id: string; + daoId: string; + title?: string; + description?: string; + startTimestamp: number; + endTimestamp: number; + timeElapsedPercentage: number; + thresholdPercentage: number; + link?: string; + discussion?: string; +} + +export interface NonVotersSource { + getNonVoters(proposalId: string, daoId: string, addresses: string[]): Promise<{ voter: string }[]>; +} + +export interface VotingReminderMessageSet { + getMessageKey(thresholdPercentage: number): string; + getTemplate(key: string): string; +} diff --git a/apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts b/apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts deleted file mode 100644 index a531c949..00000000 --- a/apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts +++ /dev/null @@ -1,161 +0,0 @@ -import type { NotificationTypeId } from '@notification-system/messages'; -import { BaseTriggerHandler } from './base-trigger.service'; -import { DispatcherMessage, MessageProcessingResult } from '../../interfaces/dispatcher-message.interface'; -import { NotificationClientFactory } from '../notification/notification-factory.service'; -import { ISubscriptionClient } from '../../interfaces/subscription-client.interface'; -import { AnticaptureClient } from '@notification-system/anticapture-client'; -import { FormattingService } from '../formatting.service'; -import { offchainVotingReminderMessages, replacePlaceholders, buildButtons } from '@notification-system/messages'; -import { BatchNotificationService } from '../batch-notification.service'; - -/** - * Event data received from logic system for off-chain voting reminders - */ -interface VotingReminderEvent { - id: string; - daoId: string; - title?: string; - description?: string; - startTimestamp: number; - endTimestamp: number; - timeElapsedPercentage: number; - thresholdPercentage: number; - link?: string; - discussion?: string; -} - -/** - * Processing statistics for monitoring - */ -interface ProcessingResult { - sent: number; - skipped: number; - failed: number; -} - -/** - * Handler for off-chain (Snapshot) voting reminder trigger events. - * Processes proposals and sends reminders to subscribed users who haven't voted yet. - * Differs from on-chain handler: uses getOffchainProposalNonVoters (no daoId), - * single message template, and Snapshot-specific buttons. - */ -export class OffchainVotingReminderTriggerHandler extends BaseTriggerHandler { - private readonly batchNotificationService: BatchNotificationService; - - constructor( - protected readonly subscriptionClient: ISubscriptionClient, - protected readonly notificationFactory: NotificationClientFactory, - anticaptureClient: AnticaptureClient - ) { - super(subscriptionClient, notificationFactory, anticaptureClient); - this.batchNotificationService = new BatchNotificationService(subscriptionClient, notificationFactory); - } - - async handleMessage(message: DispatcherMessage): Promise { - const events = message.events; - - if (!events || events.length === 0) { - return { - messageId: `offchain-voting-reminder-empty-${Date.now()}`, - timestamp: new Date().toISOString() - }; - } - - const processedCount: ProcessingResult = { sent: 0, skipped: 0, failed: 0 }; - - for (const event of events) { - try { - const result = await this.processReminderEvent(event, message.triggerId); - processedCount.sent += result.sent; - processedCount.skipped += result.skipped; - processedCount.failed += result.failed; - } catch (error) { - processedCount.failed++; - } - } - - console.log(`[OffchainVotingReminderHandler] Processing complete - Sent: ${processedCount.sent}, Skipped: ${processedCount.skipped}, Failed: ${processedCount.failed}`); - - return { - messageId: `offchain-voting-reminder-${Date.now()}`, - timestamp: new Date().toISOString() - }; - } - - /** - * Processes a single off-chain voting reminder event - */ - private async processReminderEvent(event: VotingReminderEvent, triggerType: NotificationTypeId): Promise { - // Get all subscribed addresses for this DAO - const subscribedAddresses = await this.subscriptionClient.getFollowedAddresses(event.daoId); - - if (subscribedAddresses.length === 0) { - return { sent: 0, skipped: 1, failed: 0 }; - } - - // Check which addresses haven't voted yet on the off-chain proposal - const nonVotingAddresses = await this.getNonVotingAddresses(event.id, subscribedAddresses); - - if (nonVotingAddresses.length === 0) { - return { sent: 0, skipped: 1, failed: 0 }; - } - - // Build buttons: Snapshot proposal link + optional discussion link - const buttons = buildButtons({ - triggerType: 'offchainVotingReminder', - proposalUrl: event.link, - discussionUrl: event.discussion, - }); - - // Send reminders using batch notification service - const sentCount = await this.batchNotificationService.sendBatchNotifications( - nonVotingAddresses, - event.daoId, - triggerType, - () => `${event.id}-${event.thresholdPercentage}-offchain-reminder`, - (address) => this.createReminderMessage(event, address), - (address) => ({ - triggerType: 'offchainVotingReminder', - proposalId: event.id, - thresholdPercentage: event.thresholdPercentage, - timeElapsedPercentage: event.timeElapsedPercentage, - timeRemaining: FormattingService.calculateTimeRemaining(event.endTimestamp), - addresses: { address: address } - }), - () => buttons - ); - - return { sent: sentCount, skipped: 0, failed: 0 }; - } - - /** - * Gets addresses that haven't voted on the specific off-chain proposal. - * Note: unlike on-chain, no daoId is needed for the Snapshot query. - */ - private async getNonVotingAddresses( - proposalId: string, - subscribedAddresses: string[] - ): Promise { - const nonVoters = await this.anticaptureClient!.getOffchainProposalNonVoters( - proposalId, - subscribedAddresses - ); - return nonVoters.map(nv => nv.voter); - } - - /** - * Creates the reminder message using the single off-chain template - */ - private createReminderMessage(event: VotingReminderEvent, address?: string): string { - const timeRemaining = FormattingService.calculateTimeRemaining(event.endTimestamp); - const title = event.title || 'Untitled Proposal'; - - return replacePlaceholders(offchainVotingReminderMessages.default, { - daoId: event.daoId, - title, - timeRemaining, - thresholdPercentage: event.thresholdPercentage.toString(), - address: address || '' - }); - } -} diff --git a/apps/dispatcher/src/services/triggers/vote-confirmation-trigger.service.test.ts b/apps/dispatcher/src/services/triggers/vote-confirmation-trigger.service.test.ts index b5829559..2e512660 100644 --- a/apps/dispatcher/src/services/triggers/vote-confirmation-trigger.service.test.ts +++ b/apps/dispatcher/src/services/triggers/vote-confirmation-trigger.service.test.ts @@ -44,9 +44,9 @@ describe('VoteConfirmationTriggerHandler', () => { await handler.handleMessage({ triggerId: NotificationTypeId.VoteConfirmation, events: [ - { daoId: 'test-dao', proposalId: 'proposal-1', voterAddress: '0xVoter123', support: '1', votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 1' }, - { daoId: 'test-dao', proposalId: 'proposal-2', voterAddress: '0xVoter123', support: '0', votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 2' }, - { daoId: 'test-dao', proposalId: 'proposal-3', voterAddress: '0xVoter123', support: '2', votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 3' }, + { daoId: 'test-dao', proposalId: 'proposal-1', voterAddress: '0xVoter123', support: 1, votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 1' }, + { daoId: 'test-dao', proposalId: 'proposal-2', voterAddress: '0xVoter123', support: 0, votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 2' }, + { daoId: 'test-dao', proposalId: 'proposal-3', voterAddress: '0xVoter123', support: 2, votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 3' }, ] }); diff --git a/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.test.ts b/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.test.ts index e3190c7c..d71f1c13 100644 --- a/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.test.ts +++ b/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.test.ts @@ -8,13 +8,15 @@ import { ISubscriptionClient } from '../../interfaces/subscription-client.interf import { NotificationClientFactory } from '../notification/notification-factory.service'; import { AnticaptureClient } from '@notification-system/anticapture-client'; import { FormattingService } from '../formatting.service'; -import { NotificationTypeId } from '@notification-system/messages'; +import { NotificationTypeId, votingReminderMessages } from '@notification-system/messages'; +import { NonVotersSource, VotingReminderMessageSet } from '../../interfaces/voting-reminder.interface'; describe('VotingReminderTriggerHandler', () => { let handler: VotingReminderTriggerHandler; let mockSubscriptionClient: jest.Mocked; let mockNotificationFactory: jest.Mocked; let mockAnticaptureClient: jest.Mocked; + let mockNonVotersSource: jest.Mocked; const mockUser = { id: 'user-123', @@ -50,14 +52,19 @@ describe('VotingReminderTriggerHandler', () => { }) } as any; - mockAnticaptureClient = { - getProposalNonVoters: jest.fn() - } as any; + mockAnticaptureClient = {} as any; + + mockNonVotersSource = { + getNonVoters: jest.fn() + } as jest.Mocked; handler = new VotingReminderTriggerHandler( mockSubscriptionClient, mockNotificationFactory, - mockAnticaptureClient + mockAnticaptureClient, + mockNonVotersSource, + votingReminderMessages, + 'voting-reminder' ); // Mock Date.now for consistent time calculations @@ -89,8 +96,8 @@ describe('VotingReminderTriggerHandler', () => { // Setup mocks mockSubscriptionClient.getFollowedAddresses.mockResolvedValue(['0x123', '0x456']); - mockAnticaptureClient.getProposalNonVoters.mockResolvedValue([ - {voter: '0x456'} // Only 0x456 hasn't voted + mockNonVotersSource.getNonVoters.mockResolvedValue([ + { voter: '0x456' } // Only 0x456 hasn't voted ]); mockSubscriptionClient.getWalletOwnersBatch.mockResolvedValue({ '0x456': [mockUser] // Only 0x456 (non-voter) has users @@ -105,7 +112,7 @@ describe('VotingReminderTriggerHandler', () => { expect(result.messageId).toMatch(/voting-reminder-/); expect(mockSubscriptionClient.getFollowedAddresses).toHaveBeenCalledWith('test-dao'); - expect(mockAnticaptureClient.getProposalNonVoters).toHaveBeenCalledWith( + expect(mockNonVotersSource.getNonVoters).toHaveBeenCalledWith( 'proposal-123', 'test-dao', ['0x123', '0x456'] @@ -124,7 +131,7 @@ describe('VotingReminderTriggerHandler', () => { const result = await handler.handleMessage(message); expect(result.messageId).toMatch(/voting-reminder-/); - expect(mockAnticaptureClient.getProposalNonVoters).not.toHaveBeenCalled(); + expect(mockNonVotersSource.getNonVoters).not.toHaveBeenCalled(); }); it('should skip when all users have already voted', async () => { @@ -134,7 +141,7 @@ describe('VotingReminderTriggerHandler', () => { }; mockSubscriptionClient.getFollowedAddresses.mockResolvedValue(['0x123']); - mockAnticaptureClient.getProposalNonVoters.mockResolvedValue([]); // Empty array - all have voted + mockNonVotersSource.getNonVoters.mockResolvedValue([]); // Empty array - all have voted const result = await handler.handleMessage(message); @@ -149,8 +156,8 @@ describe('VotingReminderTriggerHandler', () => { }; mockSubscriptionClient.getFollowedAddresses.mockResolvedValue(['0x456']); - mockAnticaptureClient.getProposalNonVoters.mockResolvedValue([ - {voter: '0x456'} + mockNonVotersSource.getNonVoters.mockResolvedValue([ + { voter: '0x456' } ]); mockSubscriptionClient.getWalletOwnersBatch.mockResolvedValue({ '0x456': [mockUser] @@ -195,7 +202,7 @@ describe('VotingReminderTriggerHandler', () => { }; const message = (handler as any).createReminderMessage(eventWithoutTitle); - + expect(message).toContain('Proposal: "Update governance parameters. This proposal aims to improve the system."'); }); @@ -207,7 +214,7 @@ describe('VotingReminderTriggerHandler', () => { }; const message = (handler as any).createReminderMessage(eventWithLongDescription); - + expect(message).toContain('Proposal: "This is a very long description that exceeds the maximum length for a title and..."'); }); }); @@ -217,14 +224,14 @@ describe('VotingReminderTriggerHandler', () => { // Mock current time to be 1500000 (middle of proposal period) const endTimestamp = 2000000; const remaining = FormattingService.calculateTimeRemaining(endTimestamp); - + expect(remaining).toContain('day'); // Should show days remaining }); it('should handle proposals that have ended', () => { const endTimestamp = 1000000; // Before current time (1500000) const remaining = FormattingService.calculateTimeRemaining(endTimestamp); - + expect(remaining).toBe('Proposal has ended'); }); @@ -232,7 +239,7 @@ describe('VotingReminderTriggerHandler', () => { jest.spyOn(Date, 'now').mockReturnValue(1990000 * 1000); // Close to end const endTimestamp = 2000000; const remaining = FormattingService.calculateTimeRemaining(endTimestamp); - + expect(remaining).toMatch(/hour/); }); @@ -240,7 +247,7 @@ describe('VotingReminderTriggerHandler', () => { jest.spyOn(Date, 'now').mockReturnValue(1999000 * 1000); // Very close to end const endTimestamp = 2000000; const remaining = FormattingService.calculateTimeRemaining(endTimestamp); - + expect(remaining).toMatch(/minute/); }); }); @@ -249,7 +256,7 @@ describe('VotingReminderTriggerHandler', () => { it('should continue processing other events when one fails', async () => { const failingEvent = { ...mockVotingReminderEvent, id: 'failing-proposal' }; const successfulEvent = { ...mockVotingReminderEvent, id: 'successful-proposal' }; - + const message: DispatcherMessage = { triggerId: NotificationTypeId.VotingReminder90, events: [failingEvent, successfulEvent] @@ -260,8 +267,8 @@ describe('VotingReminderTriggerHandler', () => { .mockRejectedValueOnce(new Error('Network error')) .mockResolvedValueOnce(['0x456']); - mockAnticaptureClient.getProposalNonVoters.mockResolvedValue([ - {voter: '0x456'} + mockNonVotersSource.getNonVoters.mockResolvedValue([ + { voter: '0x456' } ]); mockSubscriptionClient.getWalletOwnersBatch.mockResolvedValue({ '0x456': [mockUser] @@ -279,4 +286,4 @@ describe('VotingReminderTriggerHandler', () => { expect(mockSubscriptionClient.getFollowedAddresses).toHaveBeenCalledTimes(2); }); }); -}); \ No newline at end of file +}); diff --git a/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts b/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts index 7cee6017..829b5b84 100644 --- a/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts +++ b/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts @@ -1,28 +1,18 @@ import type { NotificationTypeId } from '@notification-system/messages'; + import { BaseTriggerHandler } from './base-trigger.service'; import { DispatcherMessage, MessageProcessingResult } from '../../interfaces/dispatcher-message.interface'; import { NotificationClientFactory } from '../notification/notification-factory.service'; import { ISubscriptionClient } from '../../interfaces/subscription-client.interface'; import { AnticaptureClient } from '@notification-system/anticapture-client'; import { FormattingService } from '../formatting.service'; -import { votingReminderMessages, replacePlaceholders, buildButtons } from '@notification-system/messages'; +import { replacePlaceholders, buildButtons } from '@notification-system/messages'; import { BatchNotificationService } from '../batch-notification.service'; - -/** - * Event data received from logic system for voting reminders - */ -interface VotingReminderEvent { - id: string; - daoId: string; - title?: string; - description?: string; - startTimestamp: number; - endTimestamp: number; - timeElapsedPercentage: number; - thresholdPercentage: number; - link?: string; - discussion?: string; -} +import { + VotingReminderEvent, + NonVotersSource, + VotingReminderMessageSet, +} from '../../interfaces/voting-reminder.interface'; /** * Processing statistics for monitoring @@ -43,7 +33,10 @@ export class VotingReminderTriggerHandler extends BaseTriggerHandler): Promise { const events = message.events; - + if (!events || events.length === 0) { - return { - messageId: `voting-reminder-empty-${Date.now()}`, - timestamp: new Date().toISOString() + return { + messageId: `${this.triggerType}-empty-${Date.now()}`, + timestamp: new Date().toISOString(), }; } @@ -72,11 +65,13 @@ export class VotingReminderTriggerHandler extends BaseTriggerHandler nv.voter); if (nonVotingAddresses.length === 0) { return { sent: 0, skipped: 1, failed: 0 }; @@ -104,9 +96,11 @@ export class VotingReminderTriggerHandler extends BaseTriggerHandler `${event.id}-${event.thresholdPercentage}-reminder`, + () => `${event.id}-${event.thresholdPercentage}-${this.triggerType}`, (address) => this.createReminderMessage(event, address), (address) => ({ - triggerType: 'votingReminder', + triggerType: this.triggerType, proposalId: event.id, thresholdPercentage: event.thresholdPercentage, timeElapsedPercentage: event.timeElapsedPercentage, timeRemaining: FormattingService.calculateTimeRemaining(event.endTimestamp), - addresses: { address: address } + addresses: { address: address }, }), - () => buttons + () => buttons, ); - return { - sent: sentCount, - skipped: 0, - failed: 0 - }; - } - /** - * Gets addresses that haven't voted on the specific proposal - */ - private async getNonVotingAddresses( - proposalId: string, - daoId: string, - subscribedAddresses: string[] - ): Promise { - const nonVoters = await this.anticaptureClient!.getProposalNonVoters( - proposalId, - daoId, - subscribedAddresses - ); - return nonVoters.map(nv => nv.voter); + return { sent: sentCount, skipped: 0, failed: 0 }; } /** @@ -154,13 +129,14 @@ export class VotingReminderTriggerHandler extends BaseTriggerHandler { let mockDispatcherService: ReturnType; @@ -33,8 +34,8 @@ describe('NewProposalTrigger', () => { it('should send proposals and update timestampCursor', async () => { const proposals: ProposalOnChain[] = [ - createProposal({ status: 'ACTIVE', timestamp: '1000' }), - createProposal({ id: '2', status: 'ACTIVE', description: 'Second proposal\nWith details', timestamp: '900' }) + createProposal({ status: 'ACTIVE', timestamp: 1000 }), + createProposal({ id: '2', status: 'ACTIVE', description: 'Second proposal\nWith details', timestamp: 900 }) ]; await trigger.process(proposals); @@ -88,7 +89,7 @@ describe('NewProposalTrigger', () => { it('should start the interval and fetch proposals with status and timestamp filter', () => { const initialTimestamp = trigger['timestampCursor']; - trigger.start({ status: 'ACTIVE' }); + trigger.start({ status: QueryInput_Proposals_Status_Items.Active }); jest.advanceTimersByTime(60000); expect(mockProposalDataSource.listAll).toHaveBeenCalledTimes(1); @@ -101,8 +102,8 @@ describe('NewProposalTrigger', () => { it('should stop and restart the interval if start is called twice', () => { const stopSpy = jest.spyOn(trigger, 'stop'); const initialTimestamp = trigger['timestampCursor']; - trigger.start({ status: 'ACTIVE' }); - trigger.start({ status: 'ACTIVE' }); + trigger.start({ status: QueryInput_Proposals_Status_Items.Active }); + trigger.start({ status: QueryInput_Proposals_Status_Items.Active }); expect(stopSpy).toHaveBeenCalledTimes(1); jest.advanceTimersByTime(60000); @@ -114,7 +115,7 @@ describe('NewProposalTrigger', () => { it('should stop the interval when stop is called', () => { const initialTimestamp = trigger['timestampCursor']; - trigger.start({ status: 'ACTIVE' }); + trigger.start({ status: QueryInput_Proposals_Status_Items.Active }); jest.advanceTimersByTime(60000); expect(mockProposalDataSource.listAll).toHaveBeenCalledTimes(1); diff --git a/apps/logic-system/tests/proposal-finished-trigger.test.ts b/apps/logic-system/tests/proposal-finished-trigger.test.ts index 116f5664..d7ccf601 100644 --- a/apps/logic-system/tests/proposal-finished-trigger.test.ts +++ b/apps/logic-system/tests/proposal-finished-trigger.test.ts @@ -76,15 +76,15 @@ describe('ProposalFinishedTrigger', () => { id: 'prop1', daoId: 'dao1', description: 'Test proposal 1 description', - timestamp: '1625097600', - endTimestamp: '1625097600' + timestamp: 1625097600, + endTimestamp: 1625097600 }), createFinishedProposal('DEFEATED', { id: 'prop2', daoId: 'dao2', description: 'Test proposal 2 description', - timestamp: '1625184000', - endTimestamp: '1625184000', + timestamp: 1625184000, + endTimestamp: 1625184000, forVotes: '200000000000000000000', againstVotes: '800000000000000000000', abstainVotes: '50000000000000000000' @@ -125,7 +125,6 @@ describe('ProposalFinishedTrigger', () => { it('should handle proposals with missing optional fields', async () => { const proposal = createProposalWithMissingFields(); - // @ts-expect-error - we want to test the case where the proposal is missing some fields proposal.id = 'prop1'; await trigger.process([proposal]); @@ -175,15 +174,15 @@ describe('ProposalFinishedTrigger', () => { const proposalA = createFinishedProposal('EXECUTED', { id: 'proposal-a', daoId: 'dao1', - timestamp: '1000', - endTimestamp: '2000' + timestamp: 1000, + endTimestamp: 2000 }); const proposalB = createFinishedProposal('DEFEATED', { id: 'proposal-b', daoId: 'dao1', - timestamp: '1100', - endTimestamp: '2100' + timestamp: 1100, + endTimestamp: 2100 }); // First execution: process proposal A diff --git a/docs/superpowers/specs/2026-04-02-dispatcher-voting-reminder-unification-design.md b/docs/superpowers/specs/2026-04-02-dispatcher-voting-reminder-unification-design.md new file mode 100644 index 00000000..c94e09d2 --- /dev/null +++ b/docs/superpowers/specs/2026-04-02-dispatcher-voting-reminder-unification-design.md @@ -0,0 +1,185 @@ +# Dispatcher Voting Reminder Handler Unification + +## Problem + +The dispatcher has two nearly-identical handler files for voting reminders: +- `voting-reminder-trigger.service.ts` (on-chain, ~174 lines) +- `offchain-voting-reminder-trigger.service.ts` (off-chain, ~162 lines) + +These share ~90% of their logic. The logic-system already solved the same problem for triggers using a single `VotingReminderTrigger` class with dependency injection. The dispatcher should follow the same pattern. + +## Design + +### Pattern: Mirror the Logic-System Abstraction + +In the logic-system: +- `VotingReminderDataSource` interface (1 method: `listActiveForReminder()`) +- `ProposalRepository` and `OffchainProposalRepository` both implement it +- `VotingReminderTrigger` is a single class, instantiated with different params + +The dispatcher equivalent: +- `NonVotersSource` interface (1 method: `getNonVoters()`) +- Inline adapter objects in `app.ts` wrapping `anticaptureClient` +- `VotingReminderTriggerHandler` is a single class, instantiated with different params + +### Three Differences to Resolve + +#### 1. Non-Voters Fetching → `NonVotersSource` Interface + +On-chain calls `anticaptureClient.getProposalNonVoters(id, daoId, addresses)`. +Off-chain calls `anticaptureClient.getOffchainProposalNonVoters(id, addresses)`. + +Define a minimal interface that intentionally narrows to the common subset `{ voter: string }`. The offchain response also includes `votingPower`, but it is not used by the handler: + +```typescript +// interfaces/voting-reminder.interface.ts +export interface NonVotersSource { + getNonVoters(proposalId: string, daoId: string, addresses: string[]): Promise<{ voter: string }[]>; +} +``` + +Both on-chain and off-chain receive `daoId` in the signature. Off-chain simply ignores it. Adapter objects are created inline in `app.ts`: + +```typescript +const onchainNonVotersSource: NonVotersSource = { + getNonVoters: (id, daoId, addrs) => anticaptureClient.getProposalNonVoters(id, daoId, addrs) +}; + +const offchainNonVotersSource: NonVotersSource = { + getNonVoters: (id, _daoId, addrs) => anticaptureClient.getOffchainProposalNonVoters(id, addrs) +}; +``` + +#### 2. Message Templates → Normalize Shape + +On-chain uses `votingReminderMessages.getMessageKey(threshold)` to select urgency-based templates. +Off-chain uses `offchainVotingReminderMessages.default` (single template). + +Normalize by adding `getMessageKey()` to `offchainVotingReminderMessages`: + +```typescript +// packages/messages/src/triggers/offchain-voting-reminder.ts +export const offchainVotingReminderMessages = { + default: `...existing template...`, + getMessageKey(thresholdPercentage: number): string { + return 'default'; + } +}; +``` + +Define the shared type that both message objects conform to: + +```typescript +// interfaces/voting-reminder.interface.ts +export interface VotingReminderMessageSet { + getMessageKey(thresholdPercentage: number): string; + [key: string]: string | ((...args: any[]) => any) | Record; +} +``` + +Now both message objects share the same access pattern: +```typescript +const key = messages.getMessageKey(threshold); +const template = messages[key]; +``` + +#### 3. Buttons → Already Polymorphic + +`buildButtons` already handles both trigger types via the `triggerType` discriminator. The `VotingReminderEvent` already carries all fields (`id`, `daoId`, `link`, `discussion`). The unified handler passes all available fields as a superset — `buildButtons` has all params optional and each trigger type config only reads the ones it needs, ignoring `undefined` values for irrelevant params. + +```typescript +const buttons = buildButtons({ + triggerType: this.triggerType, + daoId: event.daoId, + proposalId: event.id, + proposalUrl: event.link, + discussionUrl: event.discussion, +}); +``` + +### Additional Differences Handled by `triggerType` + +#### Notification Dedup Key + +On-chain uses `` `${event.id}-${threshold}-reminder` ``, off-chain uses `` `${event.id}-${threshold}-offchain-reminder` ``. +The unified handler derives the suffix from `triggerType`: + +```typescript +const suffix = this.triggerType.includes('offchain') ? '-offchain-reminder' : '-reminder'; +() => `${event.id}-${event.thresholdPercentage}${suffix}` +``` + +#### Title Fallback + +On-chain uses `event.title || FormattingService.extractTitle(event.description ?? '')`. +Off-chain uses `event.title || 'Untitled Proposal'`. +The unified handler chains both fallbacks: + +```typescript +const title = event.title || FormattingService.extractTitle(event.description ?? '') || 'Untitled Proposal'; +``` + +#### Log Prefix and MessageId + +Derived from `triggerType`: `[VotingReminderHandler]` vs `[OffchainVotingReminderHandler]`. +The handler uses `this.triggerType` to construct log messages and messageId prefixes. + +### Unified Handler Constructor + +```typescript +export class VotingReminderTriggerHandler extends BaseTriggerHandler { + constructor( + subscriptionClient: ISubscriptionClient, + notificationFactory: NotificationClientFactory, + anticaptureClient: AnticaptureClient, + private readonly nonVotersSource: NonVotersSource, + private readonly messages: VotingReminderMessageSet, + private readonly triggerType: string, // 'votingReminder' | 'offchainVotingReminder' + ) +} +``` + +### Wiring in `app.ts` + +```typescript +// On-chain (reuse same source + messages for all thresholds) +const onchainSource: NonVotersSource = { + getNonVoters: (id, daoId, addrs) => anticaptureClient.getProposalNonVoters(id, daoId, addrs) +}; + +triggerProcessorService.addHandler( + NotificationTypeId.VotingReminder30, + new VotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient, onchainSource, votingReminderMessages, 'votingReminder') +); +// Same for VotingReminder60, VotingReminder90 + +// Off-chain +const offchainSource: NonVotersSource = { + getNonVoters: (id, _daoId, addrs) => anticaptureClient.getOffchainProposalNonVoters(id, addrs) +}; + +triggerProcessorService.addHandler( + NotificationTypeId.OffchainVotingReminder75, + new VotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient, offchainSource, offchainVotingReminderMessages, 'offchainVotingReminder') +); +``` + +## File Changes + +| File | Action | +|------|--------| +| `apps/dispatcher/src/interfaces/voting-reminder.interface.ts` | **NEW** — `VotingReminderEvent`, `NonVotersSource`, `VotingReminderMessageSet` | +| `apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts` | **REWRITE** — single unified handler | +| `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts` | **DELETE** | +| `apps/dispatcher/src/app.ts` | **MODIFY** — update wiring with inline adapters | +| `packages/messages/src/triggers/offchain-voting-reminder.ts` | **MODIFY** — add `getMessageKey()` | +| Integration tests | **VERIFY** — ensure existing tests still pass | + +## What This Does NOT Change + +- Logic-system triggers (already unified) +- `BaseTriggerHandler` base class +- `@notification-system/messages` `buildButtons` function +- `BatchNotificationService` +- `AnticaptureClient` API methods +- Notification dedup key format (preserved exactly for both on-chain and off-chain to avoid duplicate/missed notifications in production) diff --git a/packages/anticapture-client/dist/anticapture-client.d.ts b/packages/anticapture-client/dist/anticapture-client.d.ts index ce17e6ee..17068316 100644 --- a/packages/anticapture-client/dist/anticapture-client.d.ts +++ b/packages/anticapture-client/dist/anticapture-client.d.ts @@ -1,11 +1,11 @@ import { AxiosInstance } from 'axios'; import { z } from 'zod'; -import type { GetProposalByIdQuery, ListProposalsQuery, ListProposalsQueryVariables, ListHistoricalVotingPowerQueryVariables, ListVotesQuery, ListVotesQueryVariables, ListOffchainProposalsQueryVariables, ListOffchainVotesQueryVariables } from './gql/graphql'; -import { SafeProposalNonVotersResponseSchema, ProcessedVotingPowerHistory, FeedEventType, FeedRelevance, OffchainProposalItem, OffchainVoteItem } from './schemas'; +import type { GetProposalByIdQuery, ListProposalsQuery, ListProposalsQueryVariables, ListHistoricalVotingPowerQueryVariables, ListVotesQueryVariables, ListOffchainProposalsQueryVariables, ListOffchainVotesQueryVariables } from './gql/graphql'; +import { SafeVotesResponseSchema, SafeProposalNonVotersResponseSchema, ProcessedVotingPowerHistory, FeedEventType, FeedRelevance, OffchainProposalItem, OffchainVoteItem } from './schemas'; type ProposalItems = NonNullable['items']; type VotingPowerHistoryItems = ProcessedVotingPowerHistory[]; type ProposalNonVoter = z.infer['proposalNonVoters']['items'][0]; -type VoteItem = NonNullable['items'][0]>; +type VoteItem = z.infer['votes']['items'][0]; export type VoteWithDaoId = VoteItem & { daoId: string; }; diff --git a/packages/anticapture-client/dist/anticapture-client.js b/packages/anticapture-client/dist/anticapture-client.js index 6c8c49d8..76a36e0e 100644 --- a/packages/anticapture-client/dist/anticapture-client.js +++ b/packages/anticapture-client/dist/anticapture-client.js @@ -228,7 +228,7 @@ class AnticaptureClient { async listVotes(daoId, variables) { try { const validated = await this.query(graphql_2.ListVotesDocument, schemas_1.SafeVotesResponseSchema, variables, daoId); - return validated.votes.items.filter(item => item !== null); + return validated.votes.items; } catch (error) { console.warn(`Error fetching votes for DAO ${daoId}:`, error); diff --git a/packages/messages/src/triggers/buttons.ts b/packages/messages/src/triggers/buttons.ts index 645baea4..19425904 100644 --- a/packages/messages/src/triggers/buttons.ts +++ b/packages/messages/src/triggers/buttons.ts @@ -64,6 +64,13 @@ const ctaButtonConfigs: Record = { ? `${BASE_URL}/${daoId}/governance/proposal/${proposalId}` : BASE_URL }, + 'voting-reminder': { + text: 'Cast your vote', + buildUrl: ({ daoId, proposalId }) => + daoId && proposalId + ? `${BASE_URL}/${daoId}/governance/proposal/${proposalId}` + : BASE_URL + }, newOffchainProposal: { text: 'Cast your vote', buildUrl: ({ proposalUrl }) => @@ -78,7 +85,12 @@ const ctaButtonConfigs: Record = { text: 'Cast your vote', buildUrl: ({ proposalUrl }) => proposalUrl || BASE_URL - } + }, + 'offchain-voting-reminder': { + text: 'Cast your vote', + buildUrl: ({ proposalUrl }) => + proposalUrl || BASE_URL + }, }; /** diff --git a/packages/messages/src/triggers/offchain-voting-reminder.ts b/packages/messages/src/triggers/offchain-voting-reminder.ts index 61d9cd18..846509d1 100644 --- a/packages/messages/src/triggers/offchain-voting-reminder.ts +++ b/packages/messages/src/triggers/offchain-voting-reminder.ts @@ -8,4 +8,11 @@ Proposal: "{{title}}" 🗳️ {{address}}'s vote hasn't been recorded yet Don't miss your chance to participate!`, + getMessageKey(_thresholdPercentage: number): string { + return 'default'; + }, + + getTemplate(_key: string): string { + return this.default; + }, }; diff --git a/packages/messages/src/triggers/voting-reminder.ts b/packages/messages/src/triggers/voting-reminder.ts index 759d16a8..53fc3124 100644 --- a/packages/messages/src/triggers/voting-reminder.ts +++ b/packages/messages/src/triggers/voting-reminder.ts @@ -54,6 +54,16 @@ Participate in governance!`, return 'default'; }, + getTemplate(key: string): string { + const templates: Record = { + urgent: this.urgent, + midPeriod: this.midPeriod, + early: this.early, + default: this.default, + }; + return templates[key] ?? this.default; + }, + headers: { urgent: '🚨 URGENT Voting Reminder - {{daoId}}', midPeriod: '⏰ Mid-Period Voting Reminder - {{daoId}}', From 4952592871f2186b9c3d63772b3cec52c888d7a7 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Thu, 2 Apr 2026 16:40:25 -0300 Subject: [PATCH 22/30] fix: tests --- .../tests/slack/voting-reminder-trigger.test.ts | 4 ++-- .../tests/telegram/voting-reminder-trigger.test.ts | 4 ++-- apps/logic-system/src/app.ts | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/integrated-tests/tests/slack/voting-reminder-trigger.test.ts b/apps/integrated-tests/tests/slack/voting-reminder-trigger.test.ts index 53c0f132..892c1ebb 100644 --- a/apps/integrated-tests/tests/slack/voting-reminder-trigger.test.ts +++ b/apps/integrated-tests/tests/slack/voting-reminder-trigger.test.ts @@ -438,8 +438,8 @@ describe('Slack Voting Reminder Trigger - Integration Test', () => { const eventIds = relevantNotifs.map(n => n.event_id); expect(eventIds).toEqual( expect.arrayContaining([ - expect.stringContaining('30-reminder'), - expect.stringContaining('60-reminder') + expect.stringContaining('30-voting-reminder'), + expect.stringContaining('60-voting-reminder') ]) ); }); diff --git a/apps/integrated-tests/tests/telegram/voting-reminder-trigger.test.ts b/apps/integrated-tests/tests/telegram/voting-reminder-trigger.test.ts index e6b707e4..bc65a1d9 100644 --- a/apps/integrated-tests/tests/telegram/voting-reminder-trigger.test.ts +++ b/apps/integrated-tests/tests/telegram/voting-reminder-trigger.test.ts @@ -330,8 +330,8 @@ describe('Voting Reminder Integration Tests', () => { const eventIds = relevantNotifs.map(n => n.event_id); expect(eventIds).toEqual( expect.arrayContaining([ - expect.stringContaining('30-reminder'), - expect.stringContaining('60-reminder') + expect.stringContaining('30-voting-reminder'), + expect.stringContaining('60-voting-reminder') ]) ); }); diff --git a/apps/logic-system/src/app.ts b/apps/logic-system/src/app.ts index 0a5d1b1d..f6b56a12 100644 --- a/apps/logic-system/src/app.ts +++ b/apps/logic-system/src/app.ts @@ -199,15 +199,19 @@ export class App { } if (this.votingReminderTrigger30) { this.votingReminderTrigger30.stop(); + this.votingReminderTrigger30.start(); } if (this.votingReminderTrigger60) { this.votingReminderTrigger60.stop(); + this.votingReminderTrigger60.start(); } if (this.votingReminderTrigger90) { this.votingReminderTrigger90.stop(); + this.votingReminderTrigger90.start(); } if (this.offchainVotingReminderTrigger75) { this.offchainVotingReminderTrigger75.stop(); + this.offchainVotingReminderTrigger75.start(); } } From c22d704d96689e9e69a6b35e623209c1cc2843f1 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Thu, 2 Apr 2026 17:39:43 -0300 Subject: [PATCH 23/30] refactor: re-generated client --- .../voting-reminder-trigger.service.ts | 5 +- .../dist/anticapture-client.js | 4 +- packages/anticapture-client/dist/gql/gql.d.ts | 5 ++ packages/anticapture-client/dist/gql/gql.js | 1 + .../anticapture-client/dist/gql/graphql.d.ts | 53 +++++++++++++------ .../anticapture-client/dist/gql/graphql.js | 4 +- .../offchain-proposal-non-voters.graphql | 2 +- .../src/anticapture-client.ts | 4 +- packages/anticapture-client/src/gql/gql.ts | 6 +++ .../anticapture-client/src/gql/graphql.ts | 43 +++++++++++---- 10 files changed, 90 insertions(+), 37 deletions(-) diff --git a/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts b/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts index 829b5b84..6b5aaa3e 100644 --- a/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts +++ b/apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts @@ -109,7 +109,7 @@ export class VotingReminderTriggerHandler extends BaseTriggerHandler `${event.id}-${event.thresholdPercentage}-${this.triggerType}`, - (address) => this.createReminderMessage(event, address), + (_address) => this.createReminderMessage(event), (address) => ({ triggerType: this.triggerType, proposalId: event.id, @@ -127,7 +127,7 @@ export class VotingReminderTriggerHandler extends BaseTriggerHandler; /** Returns a single offchain (Snapshot) proposal by its ID */ offchainProposalById?: Maybe; + /** Returns the active delegates that did not vote on a given offchain proposal */ + offchainProposalNonVoters?: Maybe; /** Returns a list of offchain (Snapshot) proposals */ offchainProposals?: Maybe; /** Returns a single proposal by its ID */ @@ -894,6 +896,13 @@ export type QueryLastUpdateArgs = { export type QueryOffchainProposalByIdArgs = { id: Scalars['String']['input']; }; +export type QueryOffchainProposalNonVotersArgs = { + addresses?: InputMaybe>>; + id: Scalars['String']['input']; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; +}; export type QueryOffchainProposalsArgs = { endDate?: InputMaybe; fromDate?: InputMaybe; @@ -1281,6 +1290,11 @@ export type GetAddresses_200_Response = { results: Array>; }; export type OffchainProposalById_Response = ErrorResponse | OffchainProposal; +export type OffchainProposalNonVoters_200_Response = { + __typename?: 'offchainProposalNonVoters_200_response'; + items: Array>; + totalCount: Scalars['Float']['output']; +}; export type Proposal_Response = ErrorResponse | OnchainProposal; export declare enum QueryInput_AccountBalances_OrderBy { Balance = "balance", @@ -1479,6 +1493,11 @@ export type Query_GetAddresses_Results_Items_Ens = { /** Primary ENS name reverse-resolved for this address */ name?: Maybe; }; +export type Query_OffchainProposalNonVoters_Items_Items = { + __typename?: 'query_offchainProposalNonVoters_items_items'; + voter: Scalars['String']['output']; + votingPower: Scalars['String']['output']; +}; export type Query_OffchainProposals_Items_Items_Strategies_Items = { __typename?: 'query_offchainProposals_items_items_strategies_items'; name: Scalars['String']['output']; @@ -1503,6 +1522,22 @@ export type GetDaOsQuery = { }>; }; }; +export type OffchainProposalNonVotersQueryVariables = Exact<{ + id: Scalars['String']['input']; + addresses?: InputMaybe> | InputMaybe>; + orderDirection?: InputMaybe; +}>; +export type OffchainProposalNonVotersQuery = { + __typename?: 'Query'; + offchainProposalNonVoters?: { + __typename?: 'offchainProposalNonVoters_200_response'; + items: Array<{ + __typename?: 'query_offchainProposalNonVoters_items_items'; + voter: string; + votingPower: string; + } | null>; + } | null; +}; export type ListOffchainProposalsQueryVariables = Exact<{ skip?: InputMaybe; limit?: InputMaybe; @@ -1702,24 +1737,8 @@ export type ListHistoricalVotingPowerQuery = { } | null>; } | null; }; -export type OffchainProposalNonVotersQueryVariables = Exact<{ - id: Scalars['String']['input']; - addresses?: InputMaybe; - orderDirection?: InputMaybe; -}>; -export type OffchainProposalNonVotersQuery = { - __typename?: 'Query'; - offchainProposalNonVoters?: { - __typename?: 'OffchainVotersResponse'; - items: Array<{ - __typename?: 'OffchainVoter'; - voter: string; - votingPower?: string | null; - } | null>; - } | null; -}; -export declare const OffchainProposalNonVotersDocument: DocumentNode; export declare const GetDaOsDocument: DocumentNode; +export declare const OffchainProposalNonVotersDocument: DocumentNode; export declare const ListOffchainProposalsDocument: DocumentNode; export declare const ListOffchainVotesDocument: DocumentNode; export declare const ProposalNonVotersDocument: DocumentNode; diff --git a/packages/anticapture-client/dist/gql/graphql.js b/packages/anticapture-client/dist/gql/graphql.js index 1819abd6..aadcf593 100644 --- a/packages/anticapture-client/dist/gql/graphql.js +++ b/packages/anticapture-client/dist/gql/graphql.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.ListHistoricalVotingPowerDocument = exports.ListVotesDocument = exports.GetEventRelevanceThresholdDocument = exports.ListProposalsDocument = exports.GetProposalByIdDocument = exports.ProposalNonVotersDocument = exports.ListOffchainVotesDocument = exports.ListOffchainProposalsDocument = exports.GetDaOsDocument = exports.OffchainProposalNonVotersDocument = exports.QueryInput_VotingPowers_OrderBy = exports.QueryInput_Votes_OrderBy = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_VotesOffchainByProposalId_OrderBy = exports.QueryInput_VotesByProposalId_OrderBy = exports.QueryInput_Transfers_OrderBy = exports.QueryInput_Transactions_Includes_Items = exports.QueryInput_Transactions_AffectedSupply_Items = exports.QueryInput_Token_Currency = exports.QueryInput_TokenMetrics_MetricType = exports.QueryInput_Proposals_Status_Items = exports.QueryInput_ProposalsActivity_UserVoteFilter = exports.QueryInput_ProposalsActivity_OrderBy = exports.QueryInput_OffchainProposals_Status_Items = exports.QueryInput_LastUpdate_Chart = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.QueryInput_HistoricalVotingPowerByAccountId_OrderBy = exports.QueryInput_HistoricalBalances_OrderBy = exports.QueryInput_FeedEvents_Type = exports.QueryInput_FeedEvents_Relevance = exports.QueryInput_FeedEvents_OrderBy = exports.QueryInput_Delegators_OrderBy = exports.QueryInput_AccountInteractions_OrderBy = exports.QueryInput_AccountBalances_OrderBy = exports.OrderDirection = exports.HttpMethod = exports.FeedRelevance = exports.FeedEventType = exports.DaysWindow = void 0; +exports.ListHistoricalVotingPowerDocument = exports.ListVotesDocument = exports.GetEventRelevanceThresholdDocument = exports.ListProposalsDocument = exports.GetProposalByIdDocument = exports.ProposalNonVotersDocument = exports.ListOffchainVotesDocument = exports.ListOffchainProposalsDocument = exports.OffchainProposalNonVotersDocument = exports.GetDaOsDocument = exports.QueryInput_VotingPowers_OrderBy = exports.QueryInput_Votes_OrderBy = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_VotesOffchainByProposalId_OrderBy = exports.QueryInput_VotesByProposalId_OrderBy = exports.QueryInput_Transfers_OrderBy = exports.QueryInput_Transactions_Includes_Items = exports.QueryInput_Transactions_AffectedSupply_Items = exports.QueryInput_Token_Currency = exports.QueryInput_TokenMetrics_MetricType = exports.QueryInput_Proposals_Status_Items = exports.QueryInput_ProposalsActivity_UserVoteFilter = exports.QueryInput_ProposalsActivity_OrderBy = exports.QueryInput_OffchainProposals_Status_Items = exports.QueryInput_LastUpdate_Chart = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.QueryInput_HistoricalVotingPowerByAccountId_OrderBy = exports.QueryInput_HistoricalBalances_OrderBy = exports.QueryInput_FeedEvents_Type = exports.QueryInput_FeedEvents_Relevance = exports.QueryInput_FeedEvents_OrderBy = exports.QueryInput_Delegators_OrderBy = exports.QueryInput_AccountInteractions_OrderBy = exports.QueryInput_AccountBalances_OrderBy = exports.OrderDirection = exports.HttpMethod = exports.FeedRelevance = exports.FeedEventType = exports.DaysWindow = void 0; var DaysWindow; (function (DaysWindow) { DaysWindow["7d"] = "_7d"; @@ -211,8 +211,8 @@ var QueryInput_VotingPowers_OrderBy; QueryInput_VotingPowers_OrderBy["Variation"] = "variation"; QueryInput_VotingPowers_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_VotingPowers_OrderBy || (exports.QueryInput_VotingPowers_OrderBy = QueryInput_VotingPowers_OrderBy = {})); -exports.OffchainProposalNonVotersDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "OffchainProposalNonVoters" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "offchainProposalNonVoters" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "addresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }] } }] } }] } }] }; exports.GetDaOsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetDAOs" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "daos" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingDelay" } }, { "kind": "Field", "name": { "kind": "Name", "value": "chainId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "alreadySupportCalldataReview" } }, { "kind": "Field", "name": { "kind": "Name", "value": "supportOffchainData" } }] } }] } }] } }] }; +exports.OffchainProposalNonVotersDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "OffchainProposalNonVoters" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "offchainProposalNonVoters" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "addresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }] } }] } }] } }] }; exports.ListOffchainProposalsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainProposals" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_offchainProposals_status_items" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "offchainProposals" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "status" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "endDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "discussion" } }, { "kind": "Field", "name": { "kind": "Name", "value": "link" } }, { "kind": "Field", "name": { "kind": "Name", "value": "state" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "end" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; exports.ListOffchainVotesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainVotes" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votesOffchain_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "votesOffchain" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "toDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "voterAddresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalTitle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "vp" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; exports.ProposalNonVotersDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ProposalNonVoters" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposalNonVoters" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "addresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }] } }] } }] } }] }; diff --git a/packages/anticapture-client/queries/offchain-proposal-non-voters.graphql b/packages/anticapture-client/queries/offchain-proposal-non-voters.graphql index 975cd8ae..e6932774 100644 --- a/packages/anticapture-client/queries/offchain-proposal-non-voters.graphql +++ b/packages/anticapture-client/queries/offchain-proposal-non-voters.graphql @@ -1,4 +1,4 @@ -query OffchainProposalNonVoters($id: String!, $addresses: String, $orderDirection: String) { +query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) { offchainProposalNonVoters(id: $id, addresses: $addresses, orderDirection: $orderDirection) { items { voter diff --git a/packages/anticapture-client/src/anticapture-client.ts b/packages/anticapture-client/src/anticapture-client.ts index c8d68ec1..ebe197fd 100644 --- a/packages/anticapture-client/src/anticapture-client.ts +++ b/packages/anticapture-client/src/anticapture-client.ts @@ -324,8 +324,8 @@ export class AnticaptureClient { try { const variables: OffchainProposalNonVotersQueryVariables = { id: proposalId, - ...(addresses && { addresses: addresses.join(',') }), - orderDirection: 'desc', + ...(addresses && { addresses }), + orderDirection: OrderDirection.Desc, }; const validated = await this.query( diff --git a/packages/anticapture-client/src/gql/gql.ts b/packages/anticapture-client/src/gql/gql.ts index 5043eb3a..dd0f9b59 100644 --- a/packages/anticapture-client/src/gql/gql.ts +++ b/packages/anticapture-client/src/gql/gql.ts @@ -15,6 +15,7 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document- */ type Documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": typeof types.GetDaOsDocument, + "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n items {\n voter\n votingPower\n }\n }\n}": typeof types.OffchainProposalNonVotersDocument, "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": typeof types.ListOffchainProposalsDocument, "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": typeof types.ListOffchainVotesDocument, "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": typeof types.ProposalNonVotersDocument, @@ -25,6 +26,7 @@ type Documents = { }; const documents: Documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": types.GetDaOsDocument, + "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n items {\n voter\n votingPower\n }\n }\n}": types.OffchainProposalNonVotersDocument, "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": types.ListOffchainProposalsDocument, "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": types.ListOffchainVotesDocument, "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": types.ProposalNonVotersDocument, @@ -52,6 +54,10 @@ export function graphql(source: string): unknown; * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql(source: "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}"): (typeof documents)["query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n items {\n voter\n votingPower\n }\n }\n}"): (typeof documents)["query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n items {\n voter\n votingPower\n }\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/anticapture-client/src/gql/graphql.ts b/packages/anticapture-client/src/gql/graphql.ts index 6f17d047..aaf13f2d 100644 --- a/packages/anticapture-client/src/gql/graphql.ts +++ b/packages/anticapture-client/src/gql/graphql.ts @@ -686,6 +686,8 @@ export type Query = { lastUpdate?: Maybe; /** Returns a single offchain (Snapshot) proposal by its ID */ offchainProposalById?: Maybe; + /** Returns the active delegates that did not vote on a given offchain proposal */ + offchainProposalNonVoters?: Maybe; /** Returns a list of offchain (Snapshot) proposals */ offchainProposals?: Maybe; /** Returns a single proposal by its ID */ @@ -977,6 +979,15 @@ export type QueryOffchainProposalByIdArgs = { }; +export type QueryOffchainProposalNonVotersArgs = { + addresses?: InputMaybe>>; + id: Scalars['String']['input']; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; +}; + + export type QueryOffchainProposalsArgs = { endDate?: InputMaybe; fromDate?: InputMaybe; @@ -1421,6 +1432,12 @@ export type GetAddresses_200_Response = { export type OffchainProposalById_Response = ErrorResponse | OffchainProposal; +export type OffchainProposalNonVoters_200_Response = { + __typename?: 'offchainProposalNonVoters_200_response'; + items: Array>; + totalCount: Scalars['Float']['output']; +}; + export type Proposal_Response = ErrorResponse | OnchainProposal; export enum QueryInput_AccountBalances_OrderBy { @@ -1649,6 +1666,12 @@ export type Query_GetAddresses_Results_Items_Ens = { name?: Maybe; }; +export type Query_OffchainProposalNonVoters_Items_Items = { + __typename?: 'query_offchainProposalNonVoters_items_items'; + voter: Scalars['String']['output']; + votingPower: Scalars['String']['output']; +}; + export type Query_OffchainProposals_Items_Items_Strategies_Items = { __typename?: 'query_offchainProposals_items_items_strategies_items'; name: Scalars['String']['output']; @@ -1663,6 +1686,15 @@ export type GetDaOsQueryVariables = Exact<{ [key: string]: never; }>; export type GetDaOsQuery = { __typename?: 'Query', daos: { __typename?: 'DAOList', items: Array<{ __typename?: 'DaoResponse', id: string, votingDelay: string, chainId: number, alreadySupportCalldataReview: boolean, supportOffchainData: boolean }> } }; +export type OffchainProposalNonVotersQueryVariables = Exact<{ + id: Scalars['String']['input']; + addresses?: InputMaybe> | InputMaybe>; + orderDirection?: InputMaybe; +}>; + + +export type OffchainProposalNonVotersQuery = { __typename?: 'Query', offchainProposalNonVoters?: { __typename?: 'offchainProposalNonVoters_200_response', items: Array<{ __typename?: 'query_offchainProposalNonVoters_items_items', voter: string, votingPower: string } | null> } | null }; + export type ListOffchainProposalsQueryVariables = Exact<{ skip?: InputMaybe; limit?: InputMaybe; @@ -1751,17 +1783,8 @@ export type ListHistoricalVotingPowerQueryVariables = Exact<{ export type ListHistoricalVotingPowerQuery = { __typename?: 'Query', historicalVotingPower?: { __typename?: 'HistoricalVotingPowersResponse', totalCount: number, items: Array<{ __typename?: 'HistoricalVotingPower', accountId: string, timestamp: string, votingPower: string, delta: string, daoId: string, transactionHash: string, logIndex: number, delegation?: { __typename?: 'HistoricalVotingPowerDelegation', from: string, to: string, value: string, previousDelegate?: string | null } | null, transfer?: { __typename?: 'HistoricalVotingPowerTransfer', from: string, to: string, value: string } | null } | null> } | null }; -export type OffchainProposalNonVotersQueryVariables = Exact<{ - id: Scalars['String']['input']; - addresses?: InputMaybe; - orderDirection?: InputMaybe; -}>; - -export type OffchainProposalNonVotersQuery = { __typename?: 'Query', offchainProposalNonVoters?: { __typename?: 'OffchainVotersResponse', items: Array<{ __typename?: 'OffchainVoter', voter: string, votingPower?: string | null } | null> } | null }; - -export const OffchainProposalNonVotersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"OffchainProposalNonVoters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offchainProposalNonVoters"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"addresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}}]}}]}}]}}]} as unknown as DocumentNode; - export const GetDaOsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDAOs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"daos"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"votingDelay"}},{"kind":"Field","name":{"kind":"Name","value":"chainId"}},{"kind":"Field","name":{"kind":"Name","value":"alreadySupportCalldataReview"}},{"kind":"Field","name":{"kind":"Name","value":"supportOffchainData"}}]}}]}}]}}]} as unknown as DocumentNode; +export const OffchainProposalNonVotersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"OffchainProposalNonVoters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offchainProposalNonVoters"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"addresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}}]}}]}}]}}]} as unknown as DocumentNode; export const ListOffchainProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"status"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_offchainProposals_status_items"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offchainProposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"status"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"endDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"discussion"}},{"kind":"Field","name":{"kind":"Name","value":"link"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"end"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; export const ListOffchainVotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainVotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votesOffchain_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"votesOffchain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"toDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"voterAddresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"proposalTitle"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"vp"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; export const ProposalNonVotersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProposalNonVoters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposalNonVoters"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"addresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}}]}}]}}]}}]} as unknown as DocumentNode; From 3d7a8ffc2fd197d8b12db7139b5a60eb6f48bea7 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Tue, 7 Apr 2026 16:22:40 -0300 Subject: [PATCH 24/30] refactor: update anticapture-client queries and regenerate types Migrates all GraphQL queries from legacy custom scalar types (Float, JSON, per-query direction enums) to shared types (Int, [String], OrderDirection). Regenerates all dist and type declaration files accordingly. Co-Authored-By: Claude Sonnet 4.6 --- .../dist/anticapture-client.js | 8 +- packages/anticapture-client/dist/gql/gql.d.ts | 28 +- packages/anticapture-client/dist/gql/gql.js | 14 +- .../anticapture-client/dist/gql/graphql.d.ts | 2511 ++++++++-------- .../anticapture-client/dist/gql/graphql.js | 397 +-- packages/anticapture-client/dist/index.d.ts | 2 +- packages/anticapture-client/dist/index.js | 8 +- packages/anticapture-client/dist/schemas.d.ts | 38 +- packages/anticapture-client/dist/schemas.js | 8 +- .../queries/offchain-proposals.graphql | 2 +- .../queries/offchain-votes.graphql | 12 +- .../queries/proposalNonVoters.graphql | 2 +- .../queries/proposals.graphql | 34 +- .../queries/threshold.graphql | 4 +- .../anticapture-client/queries/votes.graphql | 16 +- .../queries/voting-power.graphql | 4 +- .../src/anticapture-client.ts | 10 +- packages/anticapture-client/src/gql/gql.ts | 42 +- .../anticapture-client/src/gql/graphql.ts | 2533 ++++++++--------- packages/anticapture-client/src/index.ts | 6 +- packages/anticapture-client/src/schemas.ts | 8 +- 21 files changed, 2541 insertions(+), 3146 deletions(-) diff --git a/packages/anticapture-client/dist/anticapture-client.js b/packages/anticapture-client/dist/anticapture-client.js index 3950edd5..f174dcee 100644 --- a/packages/anticapture-client/dist/anticapture-client.js +++ b/packages/anticapture-client/dist/anticapture-client.js @@ -172,10 +172,10 @@ class AnticaptureClient { } // Sort globally by timestamp desc (most recent first) if (variables?.fromEndDate) { - allProposals.sort((a, b) => parseInt(b?.endTimestamp || '0') - parseInt(a?.endTimestamp || '0')); + allProposals.sort((a, b) => (b?.endTimestamp ?? 0) - (a?.endTimestamp ?? 0)); } else { - allProposals.sort((a, b) => parseInt(b?.timestamp || '0') - parseInt(a?.timestamp || '0') || 0); + allProposals.sort((a, b) => (b?.timestamp ?? 0) - (a?.timestamp ?? 0)); } return allProposals; } @@ -273,7 +273,7 @@ class AnticaptureClient { fromDate: parseInt(timestampGt), limit, orderBy: graphql_2.QueryInput_Votes_OrderBy.Timestamp, - orderDirection: graphql_2.QueryInput_Votes_OrderDirection.Asc + orderDirection: graphql_2.OrderDirection.Asc }); // Add daoId to each vote return votes.map(vote => ({ @@ -380,7 +380,7 @@ class AnticaptureClient { fromDate, limit, orderBy: graphql_2.QueryInput_VotesOffchain_OrderBy.Timestamp, - orderDirection: graphql_2.QueryInput_VotesOffchain_OrderDirection.Asc + orderDirection: graphql_2.OrderDirection.Asc }); return votes.map(vote => ({ ...vote, diff --git a/packages/anticapture-client/dist/gql/gql.d.ts b/packages/anticapture-client/dist/gql/gql.d.ts index 84696ea7..c50823f1 100644 --- a/packages/anticapture-client/dist/gql/gql.d.ts +++ b/packages/anticapture-client/dist/gql/gql.d.ts @@ -13,13 +13,13 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document- */ type Documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": typeof types.GetDaOsDocument; - "query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": typeof types.ListOffchainProposalsDocument; - "query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": typeof types.ListOffchainVotesDocument; - "query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": typeof types.ProposalNonVotersDocument; - "query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": typeof types.GetProposalByIdDocument; - "query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": typeof types.GetEventRelevanceThresholdDocument; - "query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": typeof types.ListVotesDocument; - "query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": typeof types.ListHistoricalVotingPowerDocument; + "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": typeof types.ListOffchainProposalsDocument; + "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": typeof types.ListOffchainVotesDocument; + "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": typeof types.ProposalNonVotersDocument; + "query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": typeof types.GetProposalByIdDocument; + "query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": typeof types.GetEventRelevanceThresholdDocument; + "query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": typeof types.ListVotesDocument; + "query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": typeof types.ListHistoricalVotingPowerDocument; }; declare const documents: Documents; /** @@ -42,30 +42,30 @@ export declare function graphql(source: "query GetDAOs {\n daos {\n items {\ /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"]; +export declare function graphql(source: "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"]; +export declare function graphql(source: "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"): (typeof documents)["query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"]; +export declare function graphql(source: "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"): (typeof documents)["query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"): (typeof documents)["query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"]; +export declare function graphql(source: "query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"): (typeof documents)["query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"): (typeof documents)["query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"]; +export declare function graphql(source: "query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"): (typeof documents)["query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"): (typeof documents)["query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"]; +export declare function graphql(source: "query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"): (typeof documents)["query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"): (typeof documents)["query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"]; +export declare function graphql(source: "query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"): (typeof documents)["query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"]; export type DocumentType> = TDocumentNode extends DocumentNode ? TType : never; export {}; diff --git a/packages/anticapture-client/dist/gql/gql.js b/packages/anticapture-client/dist/gql/gql.js index 06200e73..1e50e3e1 100644 --- a/packages/anticapture-client/dist/gql/gql.js +++ b/packages/anticapture-client/dist/gql/gql.js @@ -38,13 +38,13 @@ exports.graphql = graphql; const types = __importStar(require("./graphql")); const documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": types.GetDaOsDocument, - "query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": types.ListOffchainProposalsDocument, - "query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": types.ListOffchainVotesDocument, - "query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": types.ProposalNonVotersDocument, - "query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": types.GetProposalByIdDocument, - "query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": types.GetEventRelevanceThresholdDocument, - "query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": types.ListVotesDocument, - "query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": types.ListHistoricalVotingPowerDocument, + "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": types.ListOffchainProposalsDocument, + "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": types.ListOffchainVotesDocument, + "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": types.ProposalNonVotersDocument, + "query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": types.GetProposalByIdDocument, + "query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": types.GetEventRelevanceThresholdDocument, + "query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": types.ListVotesDocument, + "query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": types.ListHistoricalVotingPowerDocument, }; function graphql(source) { return documents[source] ?? {}; diff --git a/packages/anticapture-client/dist/gql/graphql.d.ts b/packages/anticapture-client/dist/gql/graphql.d.ts index 2c0a56ec..0f16454d 100644 --- a/packages/anticapture-client/dist/gql/graphql.d.ts +++ b/packages/anticapture-client/dist/gql/graphql.d.ts @@ -42,13 +42,13 @@ export type Scalars = { input: number; output: number; }; - /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ - JSON: { + /** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */ + DateTime: { input: any; output: any; }; - /** Integers that will have a value of 0 or more. */ - NonNegativeInt: { + /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ + JSON: { input: any; output: any; }; @@ -56,12 +56,82 @@ export type Scalars = { input: any; output: any; }; - /** Integers that will have a value greater than 0. */ - PositiveInt: { + /** A field whose value conforms to the standard URL format as specified in RFC3986: https://www.ietf.org/rfc/rfc3986.txt. */ + URL: { input: any; output: any; }; }; +/** Balance delta for a single account across two timestamps. */ +export type AccountBalanceVariation = { + __typename?: 'AccountBalanceVariation'; + /** Absolute balance change encoded as a decimal string. */ + absoluteChange: Scalars['String']['output']; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Balance at the end of the comparison window. */ + currentBalance: Scalars['String']['output']; + /** Relative balance change encoded as a decimal string. */ + percentageChange: Scalars['String']['output']; + /** Balance at the start of the comparison window. */ + previousBalance: Scalars['String']['output']; +}; +/** Balance variation response for a single account. */ +export type AccountBalanceVariationsByAccountIdResponse = { + __typename?: 'AccountBalanceVariationsByAccountIdResponse'; + data: AccountBalanceVariation; + period: PeriodResponse; +}; +/** List of balance variations for multiple accounts in the selected period. */ +export type AccountBalanceVariationsResponse = { + __typename?: 'AccountBalanceVariationsResponse'; + items: Array>; + period: PeriodResponse; +}; +export type AccountBalanceWithVariation = { + __typename?: 'AccountBalanceWithVariation'; + address: Scalars['String']['output']; + balance: Scalars['String']['output']; + delegate: Scalars['String']['output']; + tokenId: Scalars['String']['output']; + variation: AccountBalanceVariation; +}; +export type AccountBalanceWithVariationResponse = { + __typename?: 'AccountBalanceWithVariationResponse'; + data: AccountBalanceWithVariation; + period: PeriodResponse; +}; +export type AccountBalancesWithVariationResponse = { + __typename?: 'AccountBalancesWithVariationResponse'; + items: Array>; + period: PeriodResponse; + totalCount: Scalars['Int']['output']; +}; +/** Aggregated interaction metrics between the requested account and another account. */ +export type AccountInteraction = { + __typename?: 'AccountInteraction'; + /** Counterparty account ID. */ + accountId: Scalars['String']['output']; + /** Net amount transferred between the requested account and the counterparty. */ + amountTransferred: Scalars['String']['output']; + /** Gross transfer volume between the requested account and the counterparty. */ + totalVolume: Scalars['String']['output']; + /** Number of transfers observed for the interaction pair. */ + transferCount: Scalars['String']['output']; +}; +/** Paginated list of account interaction aggregates. */ +export type AccountInteractionsResponse = { + __typename?: 'AccountInteractionsResponse'; + items: Array>; + period: PeriodResponse; + totalCount: Scalars['Int']['output']; +}; +/** Active token supply for the selected comparison window. */ +export type ActiveSupplyResponse = { + __typename?: 'ActiveSupplyResponse'; + /** Active token supply encoded as a decimal string. */ + activeSupply: Scalars['String']['output']; +}; export type AverageDelegationPercentageItem = { __typename?: 'AverageDelegationPercentageItem'; date: Scalars['String']['output']; @@ -77,9 +147,132 @@ export type AverageDelegationPercentagePage = { */ totalCount: Scalars['Int']['output']; }; +/** Average turnout comparison between two adjacent time windows. */ +export type AverageTurnoutComparisonResponse = { + __typename?: 'AverageTurnoutComparisonResponse'; + /** Relative change between current and previous periods. */ + changeRate: Scalars['Float']['output']; + /** Average turnout for the current period encoded as a string. */ + currentAverageTurnout: Scalars['String']['output']; + /** Average turnout for the previous period encoded as a string. */ + oldAverageTurnout: Scalars['String']['output']; +}; export type DaoList = { __typename?: 'DAOList'; - items: Array; + items: Array; + totalCount: Scalars['Int']['output']; +}; +/** Current governance parameters and feature flags for the active DAO. */ +export type DaoResponse = { + __typename?: 'DaoResponse'; + alreadySupportCalldataReview: Scalars['Boolean']['output']; + chainId: Scalars['Int']['output']; + id: Scalars['String']['output']; + proposalThreshold: Scalars['String']['output']; + quorum: Scalars['String']['output']; + supportOffchainData: Scalars['Boolean']['output']; + timelockDelay: Scalars['String']['output']; + votingDelay: Scalars['String']['output']; + votingPeriod: Scalars['String']['output']; +}; +export declare enum DaysWindow { + '7d' = "_7d", + '30d' = "_30d", + '90d' = "_90d", + '180d' = "_180d", + '365d' = "_365d" +} +/** Single delegation transfer event in the historical delegation feed. */ +export type DelegationItem = { + __typename?: 'DelegationItem'; + amount: Scalars['String']['output']; + delegateAddress: Scalars['String']['output']; + delegatorAddress: Scalars['String']['output']; + timestamp: Scalars['String']['output']; + transactionHash: Scalars['String']['output']; +}; +export type DelegationPercentageItem = { + __typename?: 'DelegationPercentageItem'; + /** Unix day bucket represented as a timestamp string. */ + date: Scalars['String']['output']; + /** Delegation percentage value for the day bucket. */ + high: Scalars['String']['output']; +}; +export type DelegationPercentageResponse = { + __typename?: 'DelegationPercentageResponse'; + items: Array>; + pageInfo: PageInfo; + /** Total number of matching day buckets. */ + totalCount: Scalars['Int']['output']; +}; +/** Paginated historical delegations response. */ +export type DelegationsResponse = { + __typename?: 'DelegationsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +/** Aggregated delegation amount and latest timestamp for one delegator. */ +export type DelegatorItem = { + __typename?: 'DelegatorItem'; + amount: Scalars['String']['output']; + delegatorAddress: Scalars['String']['output']; + timestamp: Scalars['String']['output']; +}; +/** Paginated delegators for a delegate address. */ +export type DelegatorsResponse = { + __typename?: 'DelegatorsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +/** Generic error payload returned by the API. */ +export type ErrorResponse = { + __typename?: 'ErrorResponse'; + /** Human-readable error message */ + error: Scalars['String']['output']; + /** Optional implementation detail or validation context for the error. */ + message?: Maybe; +}; +/** Resolved threshold for a feed event type and relevance level. */ +export type EventRelevanceThresholdResponse = { + __typename?: 'EventRelevanceThresholdResponse'; + /** Threshold value encoded as a decimal string. */ + threshold: Scalars['String']['output']; +}; +/** Filter events by governance activity type. */ +export declare enum FeedEventType { + Delegation = "DELEGATION", + Proposal = "PROPOSAL", + ProposalExtended = "PROPOSAL_EXTENDED", + Transfer = "TRANSFER", + Vote = "VOTE" +} +/** Single event in the governance activity feed. */ +export type FeedItem = { + __typename?: 'FeedItem'; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Type-specific metadata for the feed event. */ + metadata?: Maybe; + relevance: FeedRelevance; + /** Event timestamp in Unix seconds. */ + timestamp: Scalars['Int']['output']; + /** Transaction hash. */ + txHash: Scalars['String']['output']; + type: FeedEventType; + /** Optional event value encoded as a decimal string when applicable. */ + value?: Maybe; +}; +/** Filter events by relevance tier. */ +export declare enum FeedRelevance { + High = "HIGH", + Low = "LOW", + Medium = "MEDIUM" +} +/** Paginated governance activity feed response. */ +export type FeedResponse = { + __typename?: 'FeedResponse'; + items: Array>; + /** Total number of matching feed events. */ totalCount: Scalars['Int']['output']; }; export declare enum HttpMethod { @@ -93,6 +286,218 @@ export declare enum HttpMethod { Put = "PUT", Trace = "TRACE" } +/** Single historical balance record enriched with transfer context. */ +export type HistoricalBalance = { + __typename?: 'HistoricalBalance'; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Account balance after the historical event. */ + balance: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Balance change introduced by the historical event. */ + delta: Scalars['String']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Event timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; + transfer: HistoricalBalanceTransfer; +}; +/** Transfer event associated with a historical balance row. */ +export type HistoricalBalanceTransfer = { + __typename?: 'HistoricalBalanceTransfer'; + /** Sender address. */ + from: Scalars['String']['output']; + /** Recipient address. */ + to: Scalars['String']['output']; + /** Transferred amount encoded as a decimal string. */ + value: Scalars['String']['output']; +}; +/** Paginated historical balance records for one account. */ +export type HistoricalBalancesResponse = { + __typename?: 'HistoricalBalancesResponse'; + items: Array>; + /** Total number of matching historical balance rows. */ + totalCount: Scalars['Int']['output']; +}; +/** Single historical voting power record enriched with delegation and transfer context. */ +export type HistoricalVotingPower = { + __typename?: 'HistoricalVotingPower'; + /** Account address. */ + accountId: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + delegation?: Maybe; + /** Voting power change introduced by the event. */ + delta: Scalars['String']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Event timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; + transfer?: Maybe; + /** Voting power after the event, encoded as a decimal string. */ + votingPower: Scalars['String']['output']; +}; +/** Delegation event associated with a historical voting power row. */ +export type HistoricalVotingPowerDelegation = { + __typename?: 'HistoricalVotingPowerDelegation'; + from: Scalars['String']['output']; + previousDelegate?: Maybe; + to: Scalars['String']['output']; + value: Scalars['String']['output']; +}; +/** Transfer event associated with a historical voting power row. */ +export type HistoricalVotingPowerTransfer = { + __typename?: 'HistoricalVotingPowerTransfer'; + from: Scalars['String']['output']; + to: Scalars['String']['output']; + value: Scalars['String']['output']; +}; +/** Paginated historical voting power records. */ +export type HistoricalVotingPowersResponse = { + __typename?: 'HistoricalVotingPowersResponse'; + items: Array>; + /** Total number of matching historical voting power rows. */ + totalCount: Scalars['Int']['output']; +}; +/** Response payload describing the latest update time for a chart. */ +export type LastUpdateResponse = { + __typename?: 'LastUpdateResponse'; + /** Latest refresh time in ISO-8601 format. */ + lastUpdate: Scalars['DateTime']['output']; +}; +export type OffchainProposal = { + __typename?: 'OffchainProposal'; + /** Address or ENS of the author. */ + author: Scalars['String']['output']; + /** Proposal body. */ + body: Scalars['String']['output']; + choices: Array>; + /** Creation timestamp in Unix seconds. */ + created: Scalars['Int']['output']; + /** Discussion URL or thread reference. */ + discussion: Scalars['String']['output']; + /** Voting end timestamp in Unix seconds. */ + end: Scalars['Int']['output']; + /** Whether the proposal was flagged by Snapshot. */ + flagged: Scalars['Boolean']['output']; + /** Snapshot proposal identifier. */ + id: Scalars['String']['output']; + /** Canonical Snapshot proposal URL. */ + link: Scalars['String']['output']; + network: Scalars['String']['output']; + scores: Array>; + snapshot?: Maybe; + /** Snapshot space identifier. */ + spaceId: Scalars['String']['output']; + /** Voting start timestamp in Unix seconds. */ + start: Scalars['Int']['output']; + /** Current Snapshot proposal state. */ + state: Scalars['String']['output']; + strategies: Array>; + /** Proposal title. */ + title: Scalars['String']['output']; + /** Snapshot proposal type. */ + type: Scalars['String']['output']; + /** Last update timestamp in Unix seconds. */ + updated: Scalars['Int']['output']; +}; +export type OffchainProposalsResponse = { + __typename?: 'OffchainProposalsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +export type OffchainVote = { + __typename?: 'OffchainVote'; + choice: Array>; + created: Scalars['Int']['output']; + proposalId: Scalars['String']['output']; + proposalTitle?: Maybe; + reason: Scalars['String']['output']; + voter: Scalars['String']['output']; + vp?: Maybe; +}; +export type OffchainVotesResponse = { + __typename?: 'OffchainVotesResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +export type OnchainProposal = { + __typename?: 'OnchainProposal'; + /** Abstain votes, encoded as a decimal string. */ + abstainVotes: Scalars['String']['output']; + /** Votes cast against, encoded as a decimal string. */ + againstVotes: Scalars['String']['output']; + /** Encoded calldata payloads executed by the proposal. */ + calldatas: Array>; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Proposal body. */ + description: Scalars['String']['output']; + /** End block number. */ + endBlock: Scalars['Int']['output']; + /** Proposal end timestamp in Unix seconds. */ + endTimestamp: Scalars['Int']['output']; + /** Votes cast in favor, encoded as a decimal string. */ + forVotes: Scalars['String']['output']; + /** Onchain proposal identifier. */ + id: Scalars['String']['output']; + /** Optional proposal type discriminator. */ + proposalType?: Maybe; + /** Address that created the proposal. */ + proposerAccountId: Scalars['String']['output']; + /** Required quorum encoded as a decimal string. */ + quorum: Scalars['String']['output']; + /** Start block number. */ + startBlock: Scalars['Int']['output']; + /** Proposal start timestamp in Unix seconds. */ + startTimestamp: Scalars['Int']['output']; + /** Current proposal status. */ + status: Scalars['String']['output']; + /** Contract targets invoked by the proposal. */ + targets: Array>; + /** Proposal creation timestamp in Unix seconds. */ + timestamp: Scalars['Int']['output']; + /** Proposal title. */ + title: Scalars['String']['output']; + /** Proposal creation transaction hash. */ + txHash: Scalars['String']['output']; + /** ETH values attached to each call, encoded as strings. */ + values: Array>; +}; +export type OnchainProposalsResponse = { + __typename?: 'OnchainProposalsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +export type OnchainVote = { + __typename?: 'OnchainVote'; + proposalId: Scalars['String']['output']; + proposalTitle?: Maybe; + reason?: Maybe; + /** Governance vote direction. */ + support?: Maybe; + /** Vote timestamp in Unix seconds. */ + timestamp: Scalars['Int']['output']; + transactionHash: Scalars['String']['output']; + voterAddress: Scalars['String']['output']; + /** Voting power encoded as a decimal string. */ + votingPower: Scalars['String']['output']; +}; +export type OnchainVotesResponse = { + __typename?: 'OnchainVotesResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; +/** Sort direction for ordered query results. */ +export declare enum OrderDirection { + Asc = "asc", + Desc = "desc" +} export type PageInfo = { __typename?: 'PageInfo'; endDate?: Maybe; @@ -100,21 +505,108 @@ export type PageInfo = { hasPreviousPage: Scalars['Boolean']['output']; startDate?: Maybe; }; +/** Inclusive time period represented as ISO-8601 timestamps. */ +export type PeriodResponse = { + __typename?: 'PeriodResponse'; + endTimestamp: Scalars['String']['output']; + startTimestamp: Scalars['String']['output']; +}; +/** Combined proposal and delegate vote context for one activity row. */ +export type ProposalActivityItem = { + __typename?: 'ProposalActivityItem'; + proposal: ProposalActivityProposal; + userVote?: Maybe; +}; +/** Proposal snapshot included in the delegate activity response. */ +export type ProposalActivityProposal = { + __typename?: 'ProposalActivityProposal'; + /** Abstain votes, encoded as a decimal string. */ + abstainVotes: Scalars['String']['output']; + /** Votes cast against, encoded as a decimal string. */ + againstVotes: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Proposal body. */ + description: Scalars['String']['output']; + /** End block number. */ + endBlock: Scalars['Float']['output']; + /** Votes cast in favor, encoded as a decimal string. */ + forVotes: Scalars['String']['output']; + /** Onchain proposal identifier. */ + id: Scalars['String']['output']; + /** Address that created the proposal. */ + proposerAccountId: Scalars['String']['output']; + /** Start block number. */ + startBlock: Scalars['Float']['output']; + /** Current proposal status. */ + status: Scalars['String']['output']; + /** Proposal creation timestamp in Unix seconds as a string. */ + timestamp?: Maybe; + /** Proposal title. */ + title: Scalars['String']['output']; +}; +/** Delegate proposal activity metrics and proposal-by-proposal history. */ +export type ProposalActivityResponse = { + __typename?: 'ProposalActivityResponse'; + /** Delegate address. */ + address: Scalars['String']['output']; + /** Average seconds between the delegate vote and proposal end time. */ + avgTimeBeforeEnd: Scalars['Float']['output']; + /** Whether the delegate never cast a vote. */ + neverVoted: Scalars['Boolean']['output']; + proposals: Array>; + /** Total proposals reviewed in the dataset. */ + totalProposals: Scalars['Int']['output']; + /** Number of proposals the delegate voted on. */ + votedProposals: Scalars['Int']['output']; + /** Share of proposals where the delegate sided with outcome. */ + winRate: Scalars['Float']['output']; + /** Share of delegate votes cast in support. */ + yesRate: Scalars['Float']['output']; +}; +/** Vote cast by the requested delegate for a given proposal. */ +export type ProposalActivityUserVote = { + __typename?: 'ProposalActivityUserVote'; + /** Vote identifier. */ + id: Scalars['String']['output']; + /** Related proposal ID. */ + proposalId: Scalars['String']['output']; + /** Optional vote rationale. */ + reason?: Maybe; + /** Governance vote direction. */ + support: Scalars['String']['output']; + /** Vote timestamp in Unix seconds as a string. */ + timestamp?: Maybe; + /** Address that cast the vote. */ + voterAccountId: Scalars['String']['output']; + /** Voting power used by the delegate, encoded as a string. */ + votingPower?: Maybe; +}; +/** Proposal launch comparison between two adjacent time windows. */ +export type ProposalsComparisonResponse = { + __typename?: 'ProposalsComparisonResponse'; + /** Relative change between current and previous periods. */ + changeRate: Scalars['Float']['output']; + /** Number of proposals launched in the current period. */ + currentProposalsLaunched: Scalars['Int']['output']; + /** Number of proposals launched in the comparison period. */ + oldProposalsLaunched: Scalars['Int']['output']; +}; export type Query = { __typename?: 'Query'; /** Returns account balance information for a specific address */ - accountBalanceByAccountId?: Maybe; + accountBalanceByAccountId?: Maybe; /** Returns a mapping of the biggest variations to account balances associated by account address */ - accountBalanceVariations?: Maybe; + accountBalanceVariations?: Maybe; /** Returns a the changes to balance by period and accountId */ - accountBalanceVariationsByAccountId?: Maybe; + accountBalanceVariationsByAccountId?: Maybe; /** Returns sorted and paginated account balance records */ - accountBalances?: Maybe; + accountBalances?: Maybe; /** * Returns a mapping of the largest interactions between accounts. * Positive amounts signify net token transfers FROM
, whilst negative amounts refer to net transfers TO
*/ - accountInteractions?: Maybe; + accountInteractions?: Maybe; /** * Average delegation percentage across all supported DAOs by day. * Returns the mean delegation percentage for each day in the specified range. @@ -122,142 +614,144 @@ export type Query = { */ averageDelegationPercentageByDay: AverageDelegationPercentagePage; /** Get active token supply for DAO */ - compareActiveSupply?: Maybe; + compareActiveSupply?: Maybe; /** Compare average turnout between time periods */ - compareAverageTurnout?: Maybe; + compareAverageTurnout?: Maybe; /** Compare cex supply between periods */ - compareCexSupply?: Maybe; + compareCexSupply?: Maybe; /** Compare circulating supply between periods */ - compareCirculatingSupply?: Maybe; + compareCirculatingSupply?: Maybe; /** Compare delegated supply between periods */ - compareDelegatedSupply?: Maybe; + compareDelegatedSupply?: Maybe; /** Compare dex supply between periods */ - compareDexSupply?: Maybe; + compareDexSupply?: Maybe; /** Compare lending supply between periods */ - compareLendingSupply?: Maybe; + compareLendingSupply?: Maybe; /** Compare number of proposals between time periods */ - compareProposals?: Maybe; + compareProposals?: Maybe; /** Compare total supply between periods */ - compareTotalSupply?: Maybe; + compareTotalSupply?: Maybe; /** Compare treasury between periods */ - compareTreasury?: Maybe; + compareTreasury?: Maybe; /** Compare number of votes between time periods */ - compareVotes?: Maybe; + compareVotes?: Maybe; /** Returns current governance parameters for this DAO */ - dao?: Maybe; + dao?: Maybe; /** Get all DAOs */ daos: DaoList; /** Get delegation percentage day buckets with forward-fill */ - delegationPercentageByDay?: Maybe; + delegationPercentageByDay?: Maybe; /** Get current delegations for an account */ - delegations?: Maybe; + delegations?: Maybe; /** Get current delegators of an account with voting power */ - delegators?: Maybe; + delegators?: Maybe; /** Get feed events */ - feedEvents?: Maybe; + feedEvents?: Maybe; /** Returns label information from Arkham, ENS data, and whether the address is an EOA or contract. Arkham data is stored permanently. ENS data is cached with a configurable TTL. */ getAddress?: Maybe; /** Returns label information from Arkham, ENS data, and address type for multiple addresses. Maximum 100 addresses per request. Arkham data is stored permanently. ENS data is cached with a configurable TTL. */ getAddresses?: Maybe; /** Get historical DAO Token Treasury value (governance token quantity × token price) */ - getDaoTokenTreasury?: Maybe; + getDaoTokenTreasury?: Maybe; /** Get event relevance threshold */ - getEventRelevanceThreshold?: Maybe; + getEventRelevanceThreshold?: Maybe; /** Get historical Liquid Treasury (treasury without DAO tokens) from external providers (DefiLlama/Dune) */ - getLiquidTreasury?: Maybe; + getLiquidTreasury?: Maybe; /** Get historical Total Treasury (liquid treasury + DAO token treasury) */ - getTotalTreasury?: Maybe; - /** TODO */ - historicalBalances?: Maybe; + getTotalTreasury?: Maybe; + /** Check API and database health */ + health?: Maybe; + /** Returns historical balance deltas for one account, enriched with the transfer that caused each change. */ + historicalBalances?: Maybe; /** Get historical delegations for an account, with optional filtering and sorting */ - historicalDelegations?: Maybe; + historicalDelegations?: Maybe; /** Get historical market data for a specific token */ - historicalTokenData?: Maybe>>; + historicalTokenData?: Maybe>>; /** Returns a list of voting power changes. */ - historicalVotingPower?: Maybe; + historicalVotingPower?: Maybe; /** Returns a list of voting power changes for a specific account */ - historicalVotingPowerByAccountId?: Maybe; + historicalVotingPowerByAccountId?: Maybe; /** Get the last update time */ - lastUpdate?: Maybe; + lastUpdate?: Maybe; /** Returns a single offchain (Snapshot) proposal by its ID */ - offchainProposalById?: Maybe; + offchainProposalById?: Maybe; /** Returns a list of offchain (Snapshot) proposals */ - offchainProposals?: Maybe; + offchainProposals?: Maybe; /** Returns a single proposal by its ID */ - proposal?: Maybe; + proposal?: Maybe; /** Returns the active delegates that did not vote on a given proposal */ - proposalNonVoters?: Maybe; + proposalNonVoters?: Maybe; /** Returns a list of proposal */ - proposals?: Maybe; + proposals?: Maybe; /** Returns proposal activity data including voting history, win rates, and detailed proposal information for the specified delegate within the given time window */ - proposalsActivity?: Maybe; + proposalsActivity?: Maybe; /** Get property data for a specific token */ - token?: Maybe; + token?: Maybe; /** Returns token related metrics for a single metric type. */ - tokenMetrics?: Maybe; + tokenMetrics?: Maybe; /** Get transactions with their associated transfers and delegations, with optional filtering and sorting */ - transactions?: Maybe; + transactions?: Maybe; /** Get transfers of a given address */ - transfers?: Maybe; + transfers?: Maybe; /** Get all votes ordered by timestamp or voting power */ - votes?: Maybe; + votes?: Maybe; /** Returns a paginated list of votes cast on a specific proposal */ - votesByProposalId?: Maybe; + votesByProposalId?: Maybe; /** Returns a list of offchain (Snapshot) votes */ - votesOffchain?: Maybe; + votesOffchain?: Maybe; /** Returns a paginated list of offchain (Snapshot) votes for a specific proposal */ - votesOffchainByProposalId?: Maybe; + votesOffchainByProposalId?: Maybe; /** Returns voting power information for a specific address (account) */ - votingPowerByAccountId?: Maybe; + votingPowerByAccountId?: Maybe; /** Returns a mapping of the voting power changes within a time frame for the given addresses */ - votingPowerVariations?: Maybe; + votingPowerVariations?: Maybe; /** Returns a the changes to voting power by period and accountId */ - votingPowerVariationsByAccountId?: Maybe; + votingPowerVariationsByAccountId?: Maybe; /** Returns sorted and paginated account voting power records */ - votingPowers?: Maybe; + votingPowers?: Maybe; }; export type QueryAccountBalanceByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAccountBalanceVariationsArgs = { - addresses?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + addresses?: InputMaybe>>; + fromDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAccountBalanceVariationsByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAccountBalancesArgs = { - addresses?: InputMaybe; - delegates?: InputMaybe; + addresses?: InputMaybe>>; + delegates?: InputMaybe>>; excludeDaoAddresses?: InputMaybe; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryAccountInteractionsArgs = { address: Scalars['String']['input']; filterAddress?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; maxAmount?: InputMaybe; minAmount?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAverageDelegationPercentageByDayArgs = { after?: InputMaybe; @@ -268,132 +762,132 @@ export type QueryAverageDelegationPercentageByDayArgs = { startDate: Scalars['String']['input']; }; export type QueryCompareActiveSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareAverageTurnoutArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareCexSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareCirculatingSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareDelegatedSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareDexSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareLendingSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareProposalsArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareTotalSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareTreasuryArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareVotesArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryDelegationPercentageByDayArgs = { - after?: InputMaybe; - before?: InputMaybe; - endDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - startDate?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + endDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + startDate?: InputMaybe; }; export type QueryDelegationsArgs = { address: Scalars['String']['input']; }; export type QueryDelegatorsArgs = { address: Scalars['String']['input']; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; }; export type QueryFeedEventsArgs = { - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; + orderDirection?: InputMaybe; relevance?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; type?: InputMaybe; }; export type QueryGetAddressArgs = { address: Scalars['String']['input']; }; export type QueryGetAddressesArgs = { - addresses: Scalars['JSON']['input']; + addresses: Array>; }; export type QueryGetDaoTokenTreasuryArgs = { - days?: InputMaybe; - order?: InputMaybe; + days?: InputMaybe; + orderDirection?: InputMaybe; }; export type QueryGetEventRelevanceThresholdArgs = { - relevance: QueryInput_GetEventRelevanceThreshold_Relevance; - type: QueryInput_GetEventRelevanceThreshold_Type; + relevance: FeedRelevance; + type: FeedEventType; }; export type QueryGetLiquidTreasuryArgs = { - days?: InputMaybe; - order?: InputMaybe; + days?: InputMaybe; + orderDirection?: InputMaybe; }; export type QueryGetTotalTreasuryArgs = { - days?: InputMaybe; - order?: InputMaybe; + days?: InputMaybe; + orderDirection?: InputMaybe; }; export type QueryHistoricalBalancesArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryHistoricalDelegationsArgs = { address: Scalars['String']['input']; - delegateAddressIn?: InputMaybe; + delegateAddressIn?: InputMaybe>>; fromValue?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; toValue?: InputMaybe; }; export type QueryHistoricalTokenDataArgs = { - limit?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; }; export type QueryHistoricalVotingPowerArgs = { address?: InputMaybe; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryHistoricalVotingPowerByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryLastUpdateArgs = { @@ -403,1282 +897,615 @@ export type QueryOffchainProposalByIdArgs = { id: Scalars['String']['input']; }; export type QueryOffchainProposalsArgs = { - endDate?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - status?: InputMaybe; + endDate?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + status?: InputMaybe>>; }; export type QueryProposalArgs = { id: Scalars['String']['input']; }; export type QueryProposalNonVotersArgs = { - addresses?: InputMaybe; + addresses?: InputMaybe>>; id: Scalars['String']['input']; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; }; export type QueryProposalsArgs = { - fromDate?: InputMaybe; - fromEndDate?: InputMaybe; - includeOptimisticProposals?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - status?: InputMaybe; + fromDate?: InputMaybe; + fromEndDate?: InputMaybe; + includeOptimisticProposals?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + status?: InputMaybe>>; }; export type QueryProposalsActivityArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; userVoteFilter?: InputMaybe; }; export type QueryTokenArgs = { currency?: InputMaybe; }; export type QueryTokenMetricsArgs = { - endDate?: InputMaybe; - limit?: InputMaybe; + endDate?: InputMaybe; + limit?: InputMaybe; metricType: QueryInput_TokenMetrics_MetricType; - orderDirection?: InputMaybe; - skip?: InputMaybe; - startDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + startDate?: InputMaybe; }; export type QueryTransactionsArgs = { - affectedSupply?: InputMaybe; + affectedSupply?: InputMaybe>>; from?: InputMaybe; fromDate?: InputMaybe; - includes?: InputMaybe; - limit?: InputMaybe; + includes?: InputMaybe>>; + limit?: InputMaybe; maxAmount?: InputMaybe; minAmount?: InputMaybe; - offset?: InputMaybe; - sortBy?: InputMaybe; - sortOrder?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; to?: InputMaybe; toDate?: InputMaybe; }; export type QueryTransfersArgs = { address: Scalars['String']['input']; from?: InputMaybe; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; - offset?: InputMaybe; - sortBy?: InputMaybe; - sortOrder?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; to?: InputMaybe; - toDate?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryVotesArgs = { - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - support?: InputMaybe; - toDate?: InputMaybe; - voterAddressIn?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + support?: InputMaybe; + toDate?: InputMaybe; + voterAddressIn?: InputMaybe>>; }; export type QueryVotesByProposalIdArgs = { - fromDate?: InputMaybe; + fromDate?: InputMaybe; id: Scalars['String']['input']; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - support?: InputMaybe; - toDate?: InputMaybe; - voterAddressIn?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + support?: InputMaybe; + toDate?: InputMaybe; + voterAddressIn?: InputMaybe>>; }; export type QueryVotesOffchainArgs = { - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; - voterAddresses?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; + voterAddresses?: InputMaybe>>; }; export type QueryVotesOffchainByProposalIdArgs = { - fromDate?: InputMaybe; + fromDate?: InputMaybe; id: Scalars['String']['input']; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; - voterAddresses?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; + voterAddresses?: InputMaybe>>; }; export type QueryVotingPowerByAccountIdArgs = { accountId: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryVotingPowerVariationsArgs = { - addresses?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + addresses?: InputMaybe>>; + fromDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; }; export type QueryVotingPowerVariationsByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryVotingPowersArgs = { - addresses?: InputMaybe; - fromDate?: InputMaybe; - fromValue?: InputMaybe; - limit?: InputMaybe; - orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; - toValue?: InputMaybe; -}; -export type AccountBalanceByAccountId_200_Response = { - __typename?: 'accountBalanceByAccountId_200_response'; - data: Query_AccountBalanceByAccountId_Data; - period: Query_AccountBalanceByAccountId_Period; -}; -export type AccountBalanceVariationsByAccountId_200_Response = { - __typename?: 'accountBalanceVariationsByAccountId_200_response'; - data: Query_AccountBalanceVariationsByAccountId_Data; - period: Query_AccountBalanceVariationsByAccountId_Period; -}; -export type AccountBalanceVariations_200_Response = { - __typename?: 'accountBalanceVariations_200_response'; - items: Array>; - period: Query_AccountBalanceVariations_Period; -}; -export type AccountBalances_200_Response = { - __typename?: 'accountBalances_200_response'; - items: Array>; - period: Query_AccountBalances_Period; - totalCount: Scalars['Float']['output']; -}; -export type AccountInteractions_200_Response = { - __typename?: 'accountInteractions_200_response'; - items: Array>; - period: Query_AccountInteractions_Period; - totalCount: Scalars['Float']['output']; -}; -export type CompareActiveSupply_200_Response = { - __typename?: 'compareActiveSupply_200_response'; - activeSupply: Scalars['String']['output']; -}; -export type CompareAverageTurnout_200_Response = { - __typename?: 'compareAverageTurnout_200_response'; - changeRate: Scalars['Float']['output']; - currentAverageTurnout: Scalars['String']['output']; - oldAverageTurnout: Scalars['String']['output']; -}; -export type CompareCexSupply_200_Response = { - __typename?: 'compareCexSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentCexSupply: Scalars['String']['output']; - oldCexSupply: Scalars['String']['output']; -}; -export type CompareCirculatingSupply_200_Response = { - __typename?: 'compareCirculatingSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentCirculatingSupply: Scalars['String']['output']; - oldCirculatingSupply: Scalars['String']['output']; -}; -export type CompareDelegatedSupply_200_Response = { - __typename?: 'compareDelegatedSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentDelegatedSupply: Scalars['String']['output']; - oldDelegatedSupply: Scalars['String']['output']; -}; -export type CompareDexSupply_200_Response = { - __typename?: 'compareDexSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentDexSupply: Scalars['String']['output']; - oldDexSupply: Scalars['String']['output']; -}; -export type CompareLendingSupply_200_Response = { - __typename?: 'compareLendingSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentLendingSupply: Scalars['String']['output']; - oldLendingSupply: Scalars['String']['output']; -}; -export type CompareProposals_200_Response = { - __typename?: 'compareProposals_200_response'; - changeRate: Scalars['Float']['output']; - currentProposalsLaunched: Scalars['Float']['output']; - oldProposalsLaunched: Scalars['Float']['output']; -}; -export type CompareTotalSupply_200_Response = { - __typename?: 'compareTotalSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentTotalSupply: Scalars['String']['output']; - oldTotalSupply: Scalars['String']['output']; -}; -export type CompareTreasury_200_Response = { - __typename?: 'compareTreasury_200_response'; - changeRate: Scalars['Float']['output']; - currentTreasury: Scalars['String']['output']; - oldTreasury: Scalars['String']['output']; -}; -export type CompareVotes_200_Response = { - __typename?: 'compareVotes_200_response'; - changeRate: Scalars['Float']['output']; - currentVotes: Scalars['Float']['output']; - oldVotes: Scalars['Float']['output']; -}; -export type Dao_200_Response = { - __typename?: 'dao_200_response'; - alreadySupportCalldataReview: Scalars['Boolean']['output']; - chainId: Scalars['Float']['output']; - id: Scalars['String']['output']; - proposalThreshold: Scalars['String']['output']; - quorum: Scalars['String']['output']; - supportOffchainData: Scalars['Boolean']['output']; - timelockDelay: Scalars['String']['output']; - votingDelay: Scalars['String']['output']; - votingPeriod: Scalars['String']['output']; -}; -export type DelegationPercentageByDay_200_Response = { - __typename?: 'delegationPercentageByDay_200_response'; - items: Array>; - pageInfo: Query_DelegationPercentageByDay_PageInfo; - totalCount: Scalars['Float']['output']; -}; -export type Delegations_200_Response = { - __typename?: 'delegations_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type Delegators_200_Response = { - __typename?: 'delegators_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type FeedEvents_200_Response = { - __typename?: 'feedEvents_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type GetAddress_200_Response = { - __typename?: 'getAddress_200_response'; - address: Scalars['String']['output']; - arkham?: Maybe; - ens?: Maybe; - isContract: Scalars['Boolean']['output']; -}; -export type GetAddresses_200_Response = { - __typename?: 'getAddresses_200_response'; - results: Array>; -}; -export type GetDaoTokenTreasury_200_Response = { - __typename?: 'getDaoTokenTreasury_200_response'; - items: Array>; - /** Total number of items */ - totalCount: Scalars['Float']['output']; -}; -export type GetEventRelevanceThreshold_200_Response = { - __typename?: 'getEventRelevanceThreshold_200_response'; - threshold: Scalars['String']['output']; -}; -export type GetLiquidTreasury_200_Response = { - __typename?: 'getLiquidTreasury_200_response'; - items: Array>; - /** Total number of items */ - totalCount: Scalars['Float']['output']; -}; -export type GetTotalTreasury_200_Response = { - __typename?: 'getTotalTreasury_200_response'; - items: Array>; - /** Total number of items */ - totalCount: Scalars['Float']['output']; -}; -export type HistoricalBalances_200_Response = { - __typename?: 'historicalBalances_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type HistoricalDelegations_200_Response = { - __typename?: 'historicalDelegations_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type HistoricalVotingPowerByAccountId_200_Response = { - __typename?: 'historicalVotingPowerByAccountId_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type HistoricalVotingPower_200_Response = { - __typename?: 'historicalVotingPower_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type LastUpdate_200_Response = { - __typename?: 'lastUpdate_200_response'; - lastUpdate: Scalars['String']['output']; -}; -export type OffchainProposalById_200_Response = { - __typename?: 'offchainProposalById_200_response'; - author: Scalars['String']['output']; - body: Scalars['String']['output']; - created: Scalars['Float']['output']; - discussion: Scalars['String']['output']; - end: Scalars['Float']['output']; - flagged: Scalars['Boolean']['output']; - id: Scalars['String']['output']; - link: Scalars['String']['output']; - spaceId: Scalars['String']['output']; - start: Scalars['Float']['output']; - state: Scalars['String']['output']; - title: Scalars['String']['output']; - type: Scalars['String']['output']; - updated: Scalars['Float']['output']; -}; -export type OffchainProposals_200_Response = { - __typename?: 'offchainProposals_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type ProposalNonVoters_200_Response = { - __typename?: 'proposalNonVoters_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type Proposal_200_Response = { - __typename?: 'proposal_200_response'; - abstainVotes: Scalars['String']['output']; - againstVotes: Scalars['String']['output']; - calldatas: Array>; - daoId: Scalars['String']['output']; - description: Scalars['String']['output']; - endBlock: Scalars['Float']['output']; - endTimestamp: Scalars['String']['output']; - forVotes: Scalars['String']['output']; - id: Scalars['String']['output']; - proposalType?: Maybe; - proposerAccountId: Scalars['String']['output']; - quorum: Scalars['String']['output']; - startBlock: Scalars['Float']['output']; - startTimestamp: Scalars['String']['output']; - status: Scalars['String']['output']; - targets: Array>; - timestamp: Scalars['String']['output']; - title: Scalars['String']['output']; - txHash: Scalars['String']['output']; - values: Array>; -}; -export type ProposalsActivity_200_Response = { - __typename?: 'proposalsActivity_200_response'; - address: Scalars['String']['output']; - avgTimeBeforeEnd: Scalars['Float']['output']; - neverVoted: Scalars['Boolean']['output']; - proposals: Array>; - totalProposals: Scalars['Float']['output']; - votedProposals: Scalars['Float']['output']; - winRate: Scalars['Float']['output']; - yesRate: Scalars['Float']['output']; -}; -export type Proposals_200_Response = { - __typename?: 'proposals_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export declare enum QueryInput_AccountBalanceVariations_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_AccountBalances_OrderBy { - Balance = "balance", - SignedVariation = "signedVariation", - Variation = "variation" -} -export declare enum QueryInput_AccountBalances_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_AccountInteractions_OrderBy { - Count = "count", - Volume = "volume" -} -export declare enum QueryInput_AccountInteractions_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_CompareActiveSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareAverageTurnout_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareCexSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareCirculatingSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareDelegatedSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareDexSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareLendingSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareProposals_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareTotalSupply_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareTreasury_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_CompareVotes_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_DelegationPercentageByDay_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_Delegators_OrderBy { - Amount = "amount", - Timestamp = "timestamp" -} -export declare enum QueryInput_Delegators_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_FeedEvents_OrderBy { - Timestamp = "timestamp", - Value = "value" -} -export declare enum QueryInput_FeedEvents_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_FeedEvents_Relevance { - High = "HIGH", - Low = "LOW", - Medium = "MEDIUM" -} -export declare enum QueryInput_FeedEvents_Type { - Delegation = "DELEGATION", - Proposal = "PROPOSAL", - ProposalExtended = "PROPOSAL_EXTENDED", - Transfer = "TRANSFER", - Vote = "VOTE" -} -export declare enum QueryInput_GetDaoTokenTreasury_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_GetDaoTokenTreasury_Order { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_GetEventRelevanceThreshold_Relevance { - High = "HIGH", - Low = "LOW", - Medium = "MEDIUM" -} -export declare enum QueryInput_GetEventRelevanceThreshold_Type { - Delegation = "DELEGATION", - Proposal = "PROPOSAL", - ProposalExtended = "PROPOSAL_EXTENDED", - Transfer = "TRANSFER", - Vote = "VOTE" -} -export declare enum QueryInput_GetLiquidTreasury_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_GetLiquidTreasury_Order { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_GetTotalTreasury_Days { - '7d' = "_7d", - '30d' = "_30d", - '90d' = "_90d", - '180d' = "_180d", - '365d' = "_365d" -} -export declare enum QueryInput_GetTotalTreasury_Order { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_HistoricalBalances_OrderBy { - Delta = "delta", - Timestamp = "timestamp" -} -export declare enum QueryInput_HistoricalBalances_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_HistoricalDelegations_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_HistoricalVotingPowerByAccountId_OrderBy { - Delta = "delta", - Timestamp = "timestamp" -} -export declare enum QueryInput_HistoricalVotingPowerByAccountId_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_HistoricalVotingPower_OrderBy { - Delta = "delta", - Timestamp = "timestamp" -} -export declare enum QueryInput_HistoricalVotingPower_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_LastUpdate_Chart { - AttackProfitability = "attack_profitability", - CostComparison = "cost_comparison", - TokenDistribution = "token_distribution" -} -export declare enum QueryInput_OffchainProposals_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_ProposalNonVoters_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_ProposalsActivity_OrderBy { - Timestamp = "timestamp", - VoteTiming = "voteTiming", - VotingPower = "votingPower" -} -export declare enum QueryInput_ProposalsActivity_OrderDirection { - Asc = "asc", - Desc = "desc" -} -/** Filter proposals by vote type. Can be: 'yes' (For votes), 'no' (Against votes), 'abstain' (Abstain votes), 'no-vote' (Didn't vote) */ -export declare enum QueryInput_ProposalsActivity_UserVoteFilter { - Abstain = "abstain", - No = "no", - NoVote = "no_vote", - Yes = "yes" -} -export declare enum QueryInput_Proposals_IncludeOptimisticProposals { - False = "FALSE", - True = "TRUE" -} -export declare enum QueryInput_Proposals_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_TokenMetrics_MetricType { - CexSupply = "CEX_SUPPLY", - CirculatingSupply = "CIRCULATING_SUPPLY", - DelegatedSupply = "DELEGATED_SUPPLY", - DexSupply = "DEX_SUPPLY", - LendingSupply = "LENDING_SUPPLY", - TotalSupply = "TOTAL_SUPPLY", - Treasury = "TREASURY" -} -export declare enum QueryInput_TokenMetrics_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_Token_Currency { - Eth = "eth", - Usd = "usd" -} -export declare enum QueryInput_Transactions_SortOrder { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_Transfers_SortBy { - Amount = "amount", - Timestamp = "timestamp" -} -export declare enum QueryInput_Transfers_SortOrder { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_VotesByProposalId_OrderBy { - Timestamp = "timestamp", - VotingPower = "votingPower" -} -export declare enum QueryInput_VotesByProposalId_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_VotesOffchainByProposalId_OrderBy { - Timestamp = "timestamp", - VotingPower = "votingPower" -} -export declare enum QueryInput_VotesOffchainByProposalId_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_VotesOffchain_OrderBy { - Timestamp = "timestamp", - VotingPower = "votingPower" -} -export declare enum QueryInput_VotesOffchain_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_Votes_OrderBy { - Timestamp = "timestamp", - VotingPower = "votingPower" -} -export declare enum QueryInput_Votes_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_VotingPowerVariations_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export declare enum QueryInput_VotingPowers_OrderBy { - Balance = "balance", - DelegationsCount = "delegationsCount", - SignedVariation = "signedVariation", - Total = "total", - Variation = "variation", - VotingPower = "votingPower" -} -export declare enum QueryInput_VotingPowers_OrderDirection { - Asc = "asc", - Desc = "desc" -} -export type Query_AccountBalanceByAccountId_Data = { - __typename?: 'query_accountBalanceByAccountId_data'; - address: Scalars['String']['output']; - balance: Scalars['String']['output']; - delegate: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - variation: Query_AccountBalanceByAccountId_Data_Variation; -}; -export type Query_AccountBalanceByAccountId_Data_Variation = { - __typename?: 'query_accountBalanceByAccountId_data_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; -}; -export type Query_AccountBalanceByAccountId_Period = { - __typename?: 'query_accountBalanceByAccountId_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; -export type Query_AccountBalanceVariationsByAccountId_Data = { - __typename?: 'query_accountBalanceVariationsByAccountId_data'; - absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentBalance: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; -}; -export type Query_AccountBalanceVariationsByAccountId_Period = { - __typename?: 'query_accountBalanceVariationsByAccountId_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; -export type Query_AccountBalanceVariations_Items_Items = { - __typename?: 'query_accountBalanceVariations_items_items'; - absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentBalance: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; -}; -export type Query_AccountBalanceVariations_Period = { - __typename?: 'query_accountBalanceVariations_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; -export type Query_AccountBalances_Items_Items = { - __typename?: 'query_accountBalances_items_items'; - address: Scalars['String']['output']; - balance: Scalars['String']['output']; - delegate: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - variation: Query_AccountBalances_Items_Items_Variation; -}; -export type Query_AccountBalances_Items_Items_Variation = { - __typename?: 'query_accountBalances_items_items_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; -}; -export type Query_AccountBalances_Period = { - __typename?: 'query_accountBalances_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; -export type Query_AccountInteractions_Items_Items = { - __typename?: 'query_accountInteractions_items_items'; - accountId: Scalars['String']['output']; - amountTransferred: Scalars['String']['output']; - totalVolume: Scalars['String']['output']; - transferCount: Scalars['String']['output']; -}; -export type Query_AccountInteractions_Period = { - __typename?: 'query_accountInteractions_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; -export type Query_DelegationPercentageByDay_Items_Items = { - __typename?: 'query_delegationPercentageByDay_items_items'; - date: Scalars['String']['output']; - high: Scalars['String']['output']; -}; -export type Query_DelegationPercentageByDay_PageInfo = { - __typename?: 'query_delegationPercentageByDay_pageInfo'; - endDate?: Maybe; - hasNextPage: Scalars['Boolean']['output']; - startDate?: Maybe; -}; -export type Query_Delegations_Items_Items = { - __typename?: 'query_delegations_items_items'; - amount: Scalars['String']['output']; - delegateAddress: Scalars['String']['output']; - delegatorAddress: Scalars['String']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; -export type Query_Delegators_Items_Items = { - __typename?: 'query_delegators_items_items'; - amount: Scalars['String']['output']; - delegatorAddress: Scalars['String']['output']; - timestamp: Scalars['String']['output']; -}; -export type Query_FeedEvents_Items_Items = { - __typename?: 'query_feedEvents_items_items'; - logIndex: Scalars['Float']['output']; - metadata?: Maybe; - relevance: Query_FeedEvents_Items_Items_Relevance; - timestamp: Scalars['Float']['output']; - txHash: Scalars['String']['output']; - type: Query_FeedEvents_Items_Items_Type; - value?: Maybe; -}; -export declare enum Query_FeedEvents_Items_Items_Relevance { - High = "HIGH", - Low = "LOW", - Medium = "MEDIUM" -} -export declare enum Query_FeedEvents_Items_Items_Type { - Delegation = "DELEGATION", - Proposal = "PROPOSAL", - ProposalExtended = "PROPOSAL_EXTENDED", - Transfer = "TRANSFER", - Vote = "VOTE" -} -export type Query_GetAddress_Arkham = { - __typename?: 'query_getAddress_arkham'; - entity?: Maybe; - entityType?: Maybe; - label?: Maybe; - twitter?: Maybe; -}; -export type Query_GetAddress_Ens = { - __typename?: 'query_getAddress_ens'; - avatar?: Maybe; - banner?: Maybe; - name?: Maybe; -}; -export type Query_GetAddresses_Results_Items = { - __typename?: 'query_getAddresses_results_items'; - address: Scalars['String']['output']; - arkham?: Maybe; - ens?: Maybe; - isContract: Scalars['Boolean']['output']; -}; -export type Query_GetAddresses_Results_Items_Arkham = { - __typename?: 'query_getAddresses_results_items_arkham'; - entity?: Maybe; - entityType?: Maybe; - label?: Maybe; - twitter?: Maybe; -}; -export type Query_GetAddresses_Results_Items_Ens = { - __typename?: 'query_getAddresses_results_items_ens'; - avatar?: Maybe; - banner?: Maybe; - name?: Maybe; -}; -export type Query_GetDaoTokenTreasury_Items_Items = { - __typename?: 'query_getDaoTokenTreasury_items_items'; - /** Unix timestamp in milliseconds */ - date: Scalars['Float']['output']; - /** Treasury value in USD */ - value: Scalars['Float']['output']; -}; -export type Query_GetLiquidTreasury_Items_Items = { - __typename?: 'query_getLiquidTreasury_items_items'; - /** Unix timestamp in milliseconds */ - date: Scalars['Float']['output']; - /** Treasury value in USD */ - value: Scalars['Float']['output']; -}; -export type Query_GetTotalTreasury_Items_Items = { - __typename?: 'query_getTotalTreasury_items_items'; - /** Unix timestamp in milliseconds */ - date: Scalars['Float']['output']; - /** Treasury value in USD */ - value: Scalars['Float']['output']; -}; -export type Query_HistoricalBalances_Items_Items = { - __typename?: 'query_historicalBalances_items_items'; - accountId: Scalars['String']['output']; - balance: Scalars['String']['output']; - daoId: Scalars['String']['output']; - delta: Scalars['String']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; - transfer: Query_HistoricalBalances_Items_Items_Transfer; -}; -export type Query_HistoricalBalances_Items_Items_Transfer = { - __typename?: 'query_historicalBalances_items_items_transfer'; - from: Scalars['String']['output']; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; -export type Query_HistoricalDelegations_Items_Items = { - __typename?: 'query_historicalDelegations_items_items'; - amount: Scalars['String']['output']; - delegateAddress: Scalars['String']['output']; - delegatorAddress: Scalars['String']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; -export type Query_HistoricalTokenData_Items = { - __typename?: 'query_historicalTokenData_items'; - price: Scalars['String']['output']; - timestamp: Scalars['Float']['output']; -}; -export type Query_HistoricalVotingPowerByAccountId_Items_Items = { - __typename?: 'query_historicalVotingPowerByAccountId_items_items'; - accountId: Scalars['String']['output']; - daoId: Scalars['String']['output']; - delegation?: Maybe; - delta: Scalars['String']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; - transfer?: Maybe; - votingPower: Scalars['String']['output']; -}; -export type Query_HistoricalVotingPowerByAccountId_Items_Items_Delegation = { - __typename?: 'query_historicalVotingPowerByAccountId_items_items_delegation'; - from: Scalars['String']['output']; - previousDelegate?: Maybe; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; -export type Query_HistoricalVotingPowerByAccountId_Items_Items_Transfer = { - __typename?: 'query_historicalVotingPowerByAccountId_items_items_transfer'; - from: Scalars['String']['output']; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; -export type Query_HistoricalVotingPower_Items_Items = { - __typename?: 'query_historicalVotingPower_items_items'; - accountId: Scalars['String']['output']; - daoId: Scalars['String']['output']; - delegation?: Maybe; - delta: Scalars['String']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; - transfer?: Maybe; - votingPower: Scalars['String']['output']; -}; -export type Query_HistoricalVotingPower_Items_Items_Delegation = { - __typename?: 'query_historicalVotingPower_items_items_delegation'; - from: Scalars['String']['output']; - previousDelegate?: Maybe; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; -export type Query_HistoricalVotingPower_Items_Items_Transfer = { - __typename?: 'query_historicalVotingPower_items_items_transfer'; - from: Scalars['String']['output']; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; -export type Query_OffchainProposals_Items_Items = { - __typename?: 'query_offchainProposals_items_items'; - author: Scalars['String']['output']; - body: Scalars['String']['output']; - created: Scalars['Float']['output']; - discussion: Scalars['String']['output']; - end: Scalars['Float']['output']; - flagged: Scalars['Boolean']['output']; - id: Scalars['String']['output']; - link: Scalars['String']['output']; - spaceId: Scalars['String']['output']; - start: Scalars['Float']['output']; - state: Scalars['String']['output']; - title: Scalars['String']['output']; - type: Scalars['String']['output']; - updated: Scalars['Float']['output']; -}; -export type Query_ProposalNonVoters_Items_Items = { - __typename?: 'query_proposalNonVoters_items_items'; - lastVoteTimestamp: Scalars['Float']['output']; - voter: Scalars['String']['output']; - votingPower: Scalars['String']['output']; - votingPowerVariation: Scalars['String']['output']; -}; -export type Query_ProposalsActivity_Proposals_Items = { - __typename?: 'query_proposalsActivity_proposals_items'; - proposal: Query_ProposalsActivity_Proposals_Items_Proposal; - userVote?: Maybe; -}; -export type Query_ProposalsActivity_Proposals_Items_Proposal = { - __typename?: 'query_proposalsActivity_proposals_items_proposal'; - abstainVotes: Scalars['String']['output']; - againstVotes: Scalars['String']['output']; - daoId: Scalars['String']['output']; - description: Scalars['String']['output']; - endBlock: Scalars['Float']['output']; - forVotes: Scalars['String']['output']; - id: Scalars['String']['output']; - proposerAccountId: Scalars['String']['output']; - startBlock: Scalars['Float']['output']; - status: Scalars['String']['output']; - timestamp?: Maybe; - title: Scalars['String']['output']; -}; -export type Query_ProposalsActivity_Proposals_Items_UserVote = { - __typename?: 'query_proposalsActivity_proposals_items_userVote'; - id: Scalars['String']['output']; - proposalId: Scalars['String']['output']; - reason?: Maybe; - support?: Maybe; - timestamp?: Maybe; - voterAccountId: Scalars['String']['output']; - votingPower: Scalars['String']['output']; -}; -export type Query_Proposals_Items_Items = { - __typename?: 'query_proposals_items_items'; - abstainVotes: Scalars['String']['output']; - againstVotes: Scalars['String']['output']; - calldatas: Array>; - daoId: Scalars['String']['output']; - description: Scalars['String']['output']; - endBlock: Scalars['Float']['output']; - endTimestamp: Scalars['String']['output']; - forVotes: Scalars['String']['output']; - id: Scalars['String']['output']; - proposalType?: Maybe; - proposerAccountId: Scalars['String']['output']; - quorum: Scalars['String']['output']; - startBlock: Scalars['Float']['output']; - startTimestamp: Scalars['String']['output']; - status: Scalars['String']['output']; - targets: Array>; - timestamp: Scalars['String']['output']; - title: Scalars['String']['output']; - txHash: Scalars['String']['output']; - values: Array>; + addresses?: InputMaybe>>; + fromDate?: InputMaybe; + fromValue?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; + toValue?: InputMaybe; +}; +/** Supply metric comparison between current and previous periods. */ +export type SupplyComparisonResponse = { + __typename?: 'SupplyComparisonResponse'; + changeRate: Scalars['Float']['output']; + currentValue: Scalars['String']['output']; + previousValue: Scalars['String']['output']; +}; +export type TokenHistoricalPriceItem = { + __typename?: 'TokenHistoricalPriceItem'; + /** Historical price value as a decimal string. */ + price: Scalars['String']['output']; + /** Unix timestamp in seconds. */ + timestamp: Scalars['Int']['output']; }; -export type Query_TokenMetrics_Items_Items = { - __typename?: 'query_tokenMetrics_items_items'; +export type TokenMetricItem = { + __typename?: 'TokenMetricItem'; + /** Unix day bucket represented as a timestamp string. */ date: Scalars['String']['output']; + /** Highest observed value for the period. */ high: Scalars['String']['output']; + /** Total volume observed for the period. */ volume: Scalars['String']['output']; }; -export type Query_TokenMetrics_PageInfo = { - __typename?: 'query_tokenMetrics_pageInfo'; - endDate?: Maybe; - hasNextPage: Scalars['Boolean']['output']; - startDate?: Maybe; +export type TokenMetricsResponse = { + __typename?: 'TokenMetricsResponse'; + items: Array>; + pageInfo: PageInfo; +}; +/** Token properties enriched with the current token price. */ +export type TokenPropertiesResponse = { + __typename?: 'TokenPropertiesResponse'; + cexSupply: Scalars['String']['output']; + circulatingSupply: Scalars['String']['output']; + /** Token decimals. */ + decimals: Scalars['Int']['output']; + delegatedSupply: Scalars['String']['output']; + dexSupply: Scalars['String']['output']; + id: Scalars['String']['output']; + lendingSupply: Scalars['String']['output']; + name?: Maybe; + nonCirculatingSupply: Scalars['String']['output']; + price: Scalars['String']['output']; + totalSupply: Scalars['String']['output']; + treasury: Scalars['String']['output']; }; -export type Query_Transactions_Items_Items = { - __typename?: 'query_transactions_items_items'; - delegations: Array>; +/** Transaction response enriched with transfer and delegation events. */ +export type Transaction = { + __typename?: 'Transaction'; + delegations: Array>; + /** Resolved sender address, if known. */ from?: Maybe; + /** Whether the transaction touched a centralized exchange. */ isCex: Scalars['Boolean']['output']; + /** Whether the transaction touched a decentralized exchange. */ isDex: Scalars['Boolean']['output']; + /** Whether the transaction touched a lending protocol. */ isLending: Scalars['Boolean']['output']; + /** Whether the transaction counts toward total tracked supply. */ isTotal: Scalars['Boolean']['output']; + /** Transaction timestamp in Unix seconds as a string. */ timestamp: Scalars['String']['output']; + /** Resolved recipient address, if known. */ to?: Maybe; + /** Transaction hash. */ transactionHash: Scalars['String']['output']; - transfers: Array>; + transfers: Array>; }; -export type Query_Transactions_Items_Items_Delegations_Items = { - __typename?: 'query_transactions_items_items_delegations_items'; +/** Delegation event embedded within a transaction response. */ +export type TransactionDelegation = { + __typename?: 'TransactionDelegation'; + /** DAO identifier. */ daoId: Scalars['String']['output']; + /** Delegate address. */ delegateAccountId: Scalars['String']['output']; + /** Delegated amount encoded as a decimal string. */ delegatedValue: Scalars['String']['output']; + /** Delegator address. */ delegatorAccountId: Scalars['String']['output']; + /** Whether the delegation touched a centralized exchange. */ isCex: Scalars['Boolean']['output']; + /** Whether the delegation touched a decentralized exchange. */ isDex: Scalars['Boolean']['output']; + /** Whether the delegation touched a lending protocol. */ isLending: Scalars['Boolean']['output']; + /** Whether the delegation counts toward total tracked supply. */ isTotal: Scalars['Boolean']['output']; - logIndex: Scalars['Float']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Previous delegate address, if one existed. */ previousDelegate?: Maybe; + /** Delegation timestamp in Unix seconds as a string. */ timestamp: Scalars['String']['output']; + /** Transaction hash. */ transactionHash: Scalars['String']['output']; }; -export type Query_Transactions_Items_Items_Transfers_Items = { - __typename?: 'query_transactions_items_items_transfers_items'; - amount: Scalars['String']['output']; - daoId: Scalars['String']['output']; - fromAccountId: Scalars['String']['output']; - isCex: Scalars['Boolean']['output']; - isDex: Scalars['Boolean']['output']; - isLending: Scalars['Boolean']['output']; - isTotal: Scalars['Boolean']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - toAccountId: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; +/** Paginated transactions with embedded transfer and delegation data. */ +export type TransactionsResponse = { + __typename?: 'TransactionsResponse'; + items: Array>; + /** Total number of matching transactions. */ + totalCount: Scalars['Int']['output']; }; -export type Query_Transfers_Items_Items = { - __typename?: 'query_transfers_items_items'; +export type Transfer = { + __typename?: 'Transfer'; + /** Transferred amount encoded as a decimal string. */ amount: Scalars['String']['output']; + /** DAO identifier. */ daoId: Scalars['String']['output']; + /** Sender address. */ fromAccountId: Scalars['String']['output']; + /** Whether the transfer touched a centralized exchange. */ isCex: Scalars['Boolean']['output']; + /** Whether the transfer touched a decentralized exchange. */ isDex: Scalars['Boolean']['output']; + /** Whether the transfer touched a lending protocol. */ isLending: Scalars['Boolean']['output']; + /** Whether the transfer counts toward total tracked supply. */ isTotal: Scalars['Boolean']['output']; - logIndex: Scalars['Float']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Transfer timestamp in Unix seconds as a string. */ timestamp: Scalars['String']['output']; + /** Recipient address. */ toAccountId: Scalars['String']['output']; + /** Token contract address. */ tokenId: Scalars['String']['output']; + /** Transaction hash. */ transactionHash: Scalars['String']['output']; }; -export type Query_VotesByProposalId_Items_Items = { - __typename?: 'query_votesByProposalId_items_items'; - proposalId: Scalars['String']['output']; - proposalTitle?: Maybe; - reason?: Maybe; - support?: Maybe; - timestamp: Scalars['Int']['output']; - transactionHash: Scalars['String']['output']; - voterAddress: Scalars['String']['output']; - votingPower: Scalars['String']['output']; +export type TransfersResponse = { + __typename?: 'TransfersResponse'; + items: Array>; + /** Total number of matching transfers. */ + totalCount: Scalars['Int']['output']; }; -export type Query_VotesOffchainByProposalId_Items_Items = { - __typename?: 'query_votesOffchainByProposalId_items_items'; - choice?: Maybe; - created: Scalars['Float']['output']; - proposalId: Scalars['String']['output']; - proposalTitle: Scalars['String']['output']; - reason: Scalars['String']['output']; - voter: Scalars['String']['output']; - vp?: Maybe; +/** Single treasury time-series datapoint. */ +export type TreasuryItem = { + __typename?: 'TreasuryItem'; + /** Unix timestamp in milliseconds */ + date: Scalars['Float']['output']; + /** Treasury value in USD */ + value: Scalars['Float']['output']; }; -export type Query_VotesOffchain_Items_Items = { - __typename?: 'query_votesOffchain_items_items'; - choice?: Maybe; - created: Scalars['Float']['output']; - proposalId: Scalars['String']['output']; - proposalTitle: Scalars['String']['output']; - reason: Scalars['String']['output']; - voter: Scalars['String']['output']; - vp?: Maybe; +/** Paginated treasury time-series response. */ +export type TreasuryResponse = { + __typename?: 'TreasuryResponse'; + items: Array>; + /** Total number of items */ + totalCount: Scalars['Int']['output']; }; -export type Query_Votes_Items_Items = { - __typename?: 'query_votes_items_items'; - proposalId: Scalars['String']['output']; - proposalTitle?: Maybe; - reason?: Maybe; - support?: Maybe; - timestamp: Scalars['Int']['output']; - transactionHash: Scalars['String']['output']; - voterAddress: Scalars['String']['output']; +/** Voter or non-voter record associated with a proposal. */ +export type Voter = { + __typename?: 'Voter'; + lastVoteTimestamp: Scalars['Float']['output']; + voter: Scalars['String']['output']; votingPower: Scalars['String']['output']; + votingPowerVariation: Scalars['String']['output']; }; -export type Query_VotingPowerByAccountId_Variation = { - __typename?: 'query_votingPowerByAccountId_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; +/** Paginated voter or non-voter records for a proposal. */ +export type VotersResponse = { + __typename?: 'VotersResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; }; -export type Query_VotingPowerVariationsByAccountId_Data = { - __typename?: 'query_votingPowerVariationsByAccountId_data'; +/** Vote-count comparison between two adjacent time windows. */ +export type VotesComparisonResponse = { + __typename?: 'VotesComparisonResponse'; + /** Relative change between current and previous periods. */ + changeRate: Scalars['Float']['output']; + /** Number of votes cast in the current period. */ + currentVotes: Scalars['Int']['output']; + /** Number of votes cast in the comparison period. */ + oldVotes: Scalars['Int']['output']; +}; +/** Current voting power snapshot for one account. */ +export type VotingPower = { + __typename?: 'VotingPower'; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Current token balance encoded as a decimal string. */ + balance?: Maybe; + /** Total delegations associated with the account. */ + delegationsCount: Scalars['Int']['output']; + /** Total proposals created by the account. */ + proposalsCount: Scalars['Int']['output']; + variation: VotingPowerVariationField; + /** Total votes cast by the account. */ + votesCount: Scalars['Int']['output']; + /** Current voting power encoded as a decimal string. */ + votingPower: Scalars['String']['output']; +}; +/** Voting power delta for a single account across two timestamps. */ +export type VotingPowerVariation = { + __typename?: 'VotingPowerVariation'; + /** Absolute voting power change encoded as a decimal string. */ absoluteChange: Scalars['String']['output']; + /** Account address. */ accountId: Scalars['String']['output']; + /** Voting power at the end of the comparison window. */ currentVotingPower: Scalars['String']['output']; + /** Relative voting power change encoded as a decimal string. */ percentageChange: Scalars['String']['output']; + /** Voting power at the start of the comparison window. */ previousVotingPower: Scalars['String']['output']; }; -export type Query_VotingPowerVariationsByAccountId_Period = { - __typename?: 'query_votingPowerVariationsByAccountId_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; -export type Query_VotingPowerVariations_Items_Items = { - __typename?: 'query_votingPowerVariations_items_items'; +/** Embedded voting power delta metadata for a current voting power row. */ +export type VotingPowerVariationField = { + __typename?: 'VotingPowerVariationField'; absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentVotingPower: Scalars['String']['output']; percentageChange: Scalars['String']['output']; - previousVotingPower: Scalars['String']['output']; }; -export type Query_VotingPowerVariations_Period = { - __typename?: 'query_votingPowerVariations_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; +/** Voting power variation response for a single account. */ +export type VotingPowerVariationsByAccountIdResponse = { + __typename?: 'VotingPowerVariationsByAccountIdResponse'; + data: VotingPowerVariation; + period: PeriodResponse; +}; +/** List of voting power variations for multiple accounts in the selected period. */ +export type VotingPowerVariationsResponse = { + __typename?: 'VotingPowerVariationsResponse'; + items: Array>; + period: PeriodResponse; +}; +/** Paginated current voting power records. */ +export type VotingPowersResponse = { + __typename?: 'VotingPowersResponse'; + items: Array>; + /** Total number of matching voting power rows. */ + totalCount: Scalars['Int']['output']; }; -export type Query_VotingPowers_Items_Items = { - __typename?: 'query_votingPowers_items_items'; - accountId: Scalars['String']['output']; - balance?: Maybe; - delegationsCount: Scalars['Float']['output']; - proposalsCount: Scalars['Float']['output']; - variation: Query_VotingPowers_Items_Items_Variation; - votesCount: Scalars['Float']['output']; - votingPower: Scalars['String']['output']; +export declare enum Error_Const { + Error = "error" +} +export type GetAddress_200_Response = { + __typename?: 'getAddress_200_response'; + /** EIP-55 checksummed Ethereum address */ + address: Scalars['String']['output']; + arkham?: Maybe; + ens?: Maybe; + /** Whether the address is a smart contract (true) or an externally-owned account (false) */ + isContract: Scalars['Boolean']['output']; }; -export type Query_VotingPowers_Items_Items_Variation = { - __typename?: 'query_votingPowers_items_items_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; +export type GetAddresses_200_Response = { + __typename?: 'getAddresses_200_response'; + /** Enrichment results for each successfully resolved address. Addresses that failed to resolve are omitted. */ + results: Array>; +}; +export type Health_200_Response = { + __typename?: 'health_200_response'; + database: Ok_Const; + status: Ok_Const; }; -export declare enum Timestamp_Const { +export type Health_503_Response = { + __typename?: 'health_503_response'; + database: Error_Const; + message: Scalars['String']['output']; + status: Error_Const; +}; +export type Health_Response = Health_200_Response | Health_503_Response; +export type OffchainProposalById_Response = ErrorResponse | OffchainProposal; +export declare enum Ok_Const { + Ok = "ok" +} +export type Proposal_Response = ErrorResponse | OnchainProposal; +export declare enum QueryInput_AccountBalances_OrderBy { + Balance = "balance", + SignedVariation = "signedVariation", + Variation = "variation" +} +/** Field used to sort interaction rows. */ +export declare enum QueryInput_AccountInteractions_OrderBy { + Count = "count", + Volume = "volume" +} +export declare enum QueryInput_Delegators_OrderBy { + Amount = "amount", + Timestamp = "timestamp" +} +/** Field used to sort feed events. */ +export declare enum QueryInput_FeedEvents_OrderBy { + Timestamp = "timestamp", + Value = "value" +} +/** Filter events by relevance tier. */ +export declare enum QueryInput_FeedEvents_Relevance { + High = "HIGH", + Low = "LOW", + Medium = "MEDIUM" +} +/** Filter events by governance activity type. */ +export declare enum QueryInput_FeedEvents_Type { + Delegation = "DELEGATION", + Proposal = "PROPOSAL", + ProposalExtended = "PROPOSAL_EXTENDED", + Transfer = "TRANSFER", + Vote = "VOTE" +} +/** Field used to sort historical balance rows. */ +export declare enum QueryInput_HistoricalBalances_OrderBy { + Delta = "delta", + Timestamp = "timestamp" +} +/** Field used to sort historical voting power rows. */ +export declare enum QueryInput_HistoricalVotingPowerByAccountId_OrderBy { + Delta = "delta", + Timestamp = "timestamp" +} +/** Field used to sort historical voting power rows. */ +export declare enum QueryInput_HistoricalVotingPower_OrderBy { + Delta = "delta", + Timestamp = "timestamp" +} +/** Chart identifier whose freshness timestamp should be returned. */ +export declare enum QueryInput_LastUpdate_Chart { + AttackProfitability = "attack_profitability", + CostComparison = "cost_comparison", + TokenDistribution = "token_distribution" +} +export declare enum QueryInput_OffchainProposals_Status_Items { + Active = "active", + Closed = "closed", + Pending = "pending" +} +/** Field used to sort proposal activity results. */ +export declare enum QueryInput_ProposalsActivity_OrderBy { + Timestamp = "timestamp", + VoteTiming = "voteTiming", + VotingPower = "votingPower" +} +/** Optional vote filter. Use yes, no, abstain, or no-vote to narrow the result set. */ +export declare enum QueryInput_ProposalsActivity_UserVoteFilter { + Abstain = "abstain", + No = "no", + NoVote = "no_vote", + Yes = "yes" +} +export declare enum QueryInput_Proposals_Status_Items { + Active = "ACTIVE", + Canceled = "CANCELED", + Defeated = "DEFEATED", + Executed = "EXECUTED", + Expired = "EXPIRED", + NoQuorum = "NO_QUORUM", + Pending = "PENDING", + PendingExecution = "PENDING_EXECUTION", + Queued = "QUEUED", + Succeeded = "SUCCEEDED", + Vetoed = "VETOED" +} +/** Metric family to query. */ +export declare enum QueryInput_TokenMetrics_MetricType { + CexSupply = "CEX_SUPPLY", + CirculatingSupply = "CIRCULATING_SUPPLY", + DelegatedSupply = "DELEGATED_SUPPLY", + DexSupply = "DEX_SUPPLY", + LendingSupply = "LENDING_SUPPLY", + TotalSupply = "TOTAL_SUPPLY", + Treasury = "TREASURY" +} +/** Currency to use when fetching token price data. */ +export declare enum QueryInput_Token_Currency { + Eth = "eth", + Usd = "usd" +} +export declare enum QueryInput_Transactions_AffectedSupply_Items { + Cex = "CEX", + Dex = "DEX", + Lending = "LENDING", + Total = "TOTAL", + Unassigned = "UNASSIGNED" +} +export declare enum QueryInput_Transactions_Includes_Items { + Delegation = "DELEGATION", + Transfer = "TRANSFER" +} +/** Field used to sort transfers. */ +export declare enum QueryInput_Transfers_OrderBy { + Amount = "amount", Timestamp = "timestamp" } -export type TokenMetrics_200_Response = { - __typename?: 'tokenMetrics_200_response'; - items: Array>; - pageInfo: Query_TokenMetrics_PageInfo; +/** Sort votes by timestamp or voting power. */ +export declare enum QueryInput_VotesByProposalId_OrderBy { + Timestamp = "timestamp", + VotingPower = "votingPower" +} +/** Sort votes by timestamp or voting power. */ +export declare enum QueryInput_VotesOffchainByProposalId_OrderBy { + Timestamp = "timestamp", + VotingPower = "votingPower" +} +/** Sort votes by timestamp or voting power. */ +export declare enum QueryInput_VotesOffchain_OrderBy { + Timestamp = "timestamp", + VotingPower = "votingPower" +} +/** Sort votes by timestamp or voting power. */ +export declare enum QueryInput_Votes_OrderBy { + Timestamp = "timestamp", + VotingPower = "votingPower" +} +export declare enum QueryInput_VotingPowers_OrderBy { + Balance = "balance", + DelegationsCount = "delegationsCount", + SignedVariation = "signedVariation", + Total = "total", + Variation = "variation", + VotingPower = "votingPower" +} +/** Arkham Intelligence label data. null when no data is available for the address. */ +export type Query_GetAddress_Arkham = { + __typename?: 'query_getAddress_arkham'; + /** Human-readable name of the entity that owns the address according to Arkham Intelligence */ + entity?: Maybe; + /** Category of the entity (e.g. 'individual', 'exchange', 'protocol', 'fund') */ + entityType?: Maybe; + /** Fine-grained label for the specific address within the entity */ + label?: Maybe; + /** Twitter/X handle associated with the entity, without '@' */ + twitter?: Maybe; }; -export type Token_200_Response = { - __typename?: 'token_200_response'; - cexSupply: Scalars['String']['output']; - circulatingSupply: Scalars['String']['output']; - decimals: Scalars['Float']['output']; - delegatedSupply: Scalars['String']['output']; - dexSupply: Scalars['String']['output']; - id: Scalars['String']['output']; - lendingSupply: Scalars['String']['output']; +/** ENS (Ethereum Name Service) data. null when no ENS name is registered for the address. Cached with a configurable TTL. */ +export type Query_GetAddress_Ens = { + __typename?: 'query_getAddress_ens'; + /** URL of the ENS avatar image */ + avatar?: Maybe; + /** URL of the ENS profile banner image */ + banner?: Maybe; + /** Primary ENS name reverse-resolved for this address */ name?: Maybe; - nonCirculatingSupply: Scalars['String']['output']; - price: Scalars['String']['output']; - totalSupply: Scalars['String']['output']; - treasury: Scalars['String']['output']; }; -export type Transactions_200_Response = { - __typename?: 'transactions_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type Transfers_200_Response = { - __typename?: 'transfers_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type VotesByProposalId_200_Response = { - __typename?: 'votesByProposalId_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type VotesOffchainByProposalId_200_Response = { - __typename?: 'votesOffchainByProposalId_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type VotesOffchain_200_Response = { - __typename?: 'votesOffchain_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type Votes_200_Response = { - __typename?: 'votes_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; -export type VotingPowerByAccountId_200_Response = { - __typename?: 'votingPowerByAccountId_200_response'; - accountId: Scalars['String']['output']; - balance?: Maybe; - delegationsCount: Scalars['Float']['output']; - proposalsCount: Scalars['Float']['output']; - variation: Query_VotingPowerByAccountId_Variation; - votesCount: Scalars['Float']['output']; - votingPower: Scalars['String']['output']; +export type Query_GetAddresses_Results_Items = { + __typename?: 'query_getAddresses_results_items'; + /** EIP-55 checksummed Ethereum address */ + address: Scalars['String']['output']; + arkham?: Maybe; + ens?: Maybe; + /** Whether the address is a smart contract (true) or an externally-owned account (false) */ + isContract: Scalars['Boolean']['output']; }; -export type VotingPowerVariationsByAccountId_200_Response = { - __typename?: 'votingPowerVariationsByAccountId_200_response'; - data: Query_VotingPowerVariationsByAccountId_Data; - period: Query_VotingPowerVariationsByAccountId_Period; +/** Arkham Intelligence label data. null when no data is available for the address. */ +export type Query_GetAddresses_Results_Items_Arkham = { + __typename?: 'query_getAddresses_results_items_arkham'; + /** Human-readable name of the entity that owns the address according to Arkham Intelligence */ + entity?: Maybe; + /** Category of the entity (e.g. 'individual', 'exchange', 'protocol', 'fund') */ + entityType?: Maybe; + /** Fine-grained label for the specific address within the entity */ + label?: Maybe; + /** Twitter/X handle associated with the entity, without '@' */ + twitter?: Maybe; }; -export type VotingPowerVariations_200_Response = { - __typename?: 'votingPowerVariations_200_response'; - items: Array>; - period: Query_VotingPowerVariations_Period; +/** ENS (Ethereum Name Service) data. null when no ENS name is registered for the address. Cached with a configurable TTL. */ +export type Query_GetAddresses_Results_Items_Ens = { + __typename?: 'query_getAddresses_results_items_ens'; + /** URL of the ENS avatar image */ + avatar?: Maybe; + /** URL of the ENS profile banner image */ + banner?: Maybe; + /** Primary ENS name reverse-resolved for this address */ + name?: Maybe; }; -export type VotingPowers_200_Response = { - __typename?: 'votingPowers_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; +export type Query_OffchainProposals_Items_Items_Strategies_Items = { + __typename?: 'query_offchainProposals_items_items_strategies_items'; + name: Scalars['String']['output']; + network: Scalars['String']['output']; + params: Scalars['JSON']['output']; }; +export type Token_Response = ErrorResponse | TokenPropertiesResponse; export type GetDaOsQueryVariables = Exact<{ [key: string]: never; }>; @@ -1687,7 +1514,7 @@ export type GetDaOsQuery = { daos: { __typename?: 'DAOList'; items: Array<{ - __typename?: 'dao_200_response'; + __typename?: 'DaoResponse'; id: string; votingDelay: string; chainId: number; @@ -1697,20 +1524,20 @@ export type GetDaOsQuery = { }; }; export type ListOffchainProposalsQueryVariables = Exact<{ - skip?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - status?: InputMaybe; - fromDate?: InputMaybe; - endDate?: InputMaybe; + skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + status?: InputMaybe> | InputMaybe>; + fromDate?: InputMaybe; + endDate?: InputMaybe; }>; export type ListOffchainProposalsQuery = { __typename?: 'Query'; offchainProposals?: { - __typename?: 'offchainProposals_200_response'; + __typename?: 'OffchainProposalsResponse'; totalCount: number; items: Array<{ - __typename?: 'query_offchainProposals_items_items'; + __typename?: 'OffchainProposal'; id: string; title: string; discussion: string; @@ -1722,25 +1549,25 @@ export type ListOffchainProposalsQuery = { } | null; }; export type ListOffchainVotesQueryVariables = Exact<{ - fromDate?: InputMaybe; - toDate?: InputMaybe; - limit?: InputMaybe; - skip?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - voterAddresses?: InputMaybe; + orderDirection?: InputMaybe; + voterAddresses?: InputMaybe> | InputMaybe>; }>; export type ListOffchainVotesQuery = { __typename?: 'Query'; votesOffchain?: { - __typename?: 'votesOffchain_200_response'; + __typename?: 'OffchainVotesResponse'; totalCount: number; items: Array<{ - __typename?: 'query_votesOffchain_items_items'; + __typename?: 'OffchainVote'; voter: string; created: number; proposalId: string; - proposalTitle: string; + proposalTitle?: string | null; reason: string; vp?: number | null; } | null>; @@ -1748,14 +1575,14 @@ export type ListOffchainVotesQuery = { }; export type ProposalNonVotersQueryVariables = Exact<{ id: Scalars['String']['input']; - addresses?: InputMaybe; + addresses?: InputMaybe> | InputMaybe>; }>; export type ProposalNonVotersQuery = { __typename?: 'Query'; proposalNonVoters?: { - __typename?: 'proposalNonVoters_200_response'; + __typename?: 'VotersResponse'; items: Array<{ - __typename?: 'query_proposalNonVoters_items_items'; + __typename?: 'Voter'; voter: string; } | null>; } | null; @@ -1766,7 +1593,9 @@ export type GetProposalByIdQueryVariables = Exact<{ export type GetProposalByIdQuery = { __typename?: 'Query'; proposal?: { - __typename?: 'proposal_200_response'; + __typename?: 'ErrorResponse'; + } | { + __typename?: 'OnchainProposal'; id: string; daoId: string; proposerAccountId: string; @@ -1774,8 +1603,8 @@ export type GetProposalByIdQuery = { description: string; startBlock: number; endBlock: number; - endTimestamp: string; - timestamp: string; + endTimestamp: number; + timestamp: number; status: string; forVotes: string; againstVotes: string; @@ -1784,21 +1613,21 @@ export type GetProposalByIdQuery = { } | null; }; export type ListProposalsQueryVariables = Exact<{ - skip?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - status?: InputMaybe; - fromDate?: InputMaybe; - fromEndDate?: InputMaybe; - includeOptimisticProposals?: InputMaybe; + skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + status?: InputMaybe> | InputMaybe>; + fromDate?: InputMaybe; + fromEndDate?: InputMaybe; + includeOptimisticProposals?: InputMaybe; }>; export type ListProposalsQuery = { __typename?: 'Query'; proposals?: { - __typename?: 'proposals_200_response'; + __typename?: 'OnchainProposalsResponse'; totalCount: number; items: Array<{ - __typename?: 'query_proposals_items_items'; + __typename?: 'OnchainProposal'; id: string; daoId: string; proposerAccountId: string; @@ -1806,8 +1635,8 @@ export type ListProposalsQuery = { description: string; startBlock: number; endBlock: number; - endTimestamp: string; - timestamp: string; + endTimestamp: number; + timestamp: number; status: string; forVotes: string; againstVotes: string; @@ -1817,37 +1646,37 @@ export type ListProposalsQuery = { } | null; }; export type GetEventRelevanceThresholdQueryVariables = Exact<{ - relevance: QueryInput_GetEventRelevanceThreshold_Relevance; - type: QueryInput_GetEventRelevanceThreshold_Type; + relevance: FeedRelevance; + type: FeedEventType; }>; export type GetEventRelevanceThresholdQuery = { __typename?: 'Query'; getEventRelevanceThreshold?: { - __typename?: 'getEventRelevanceThreshold_200_response'; + __typename?: 'EventRelevanceThresholdResponse'; threshold: string; } | null; }; export type ListVotesQueryVariables = Exact<{ - voterAddressIn?: InputMaybe; - fromDate?: InputMaybe; - toDate?: InputMaybe; - limit?: InputMaybe; - skip?: InputMaybe; + voterAddressIn?: InputMaybe> | InputMaybe>; + fromDate?: InputMaybe; + toDate?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - support?: InputMaybe; + orderDirection?: InputMaybe; + support?: InputMaybe; }>; export type ListVotesQuery = { __typename?: 'Query'; votes?: { - __typename?: 'votes_200_response'; + __typename?: 'OnchainVotesResponse'; totalCount: number; items: Array<{ - __typename?: 'query_votes_items_items'; + __typename?: 'OnchainVote'; transactionHash: string; proposalId: string; voterAddress: string; - support?: number | null; + support?: string | null; votingPower: string; timestamp: number; reason?: string | null; @@ -1856,20 +1685,20 @@ export type ListVotesQuery = { } | null; }; export type ListHistoricalVotingPowerQueryVariables = Exact<{ - limit?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - fromDate?: InputMaybe; + orderDirection?: InputMaybe; + fromDate?: InputMaybe; address?: InputMaybe; }>; export type ListHistoricalVotingPowerQuery = { __typename?: 'Query'; historicalVotingPower?: { - __typename?: 'historicalVotingPower_200_response'; + __typename?: 'HistoricalVotingPowersResponse'; totalCount: number; items: Array<{ - __typename?: 'query_historicalVotingPower_items_items'; + __typename?: 'HistoricalVotingPower'; accountId: string; timestamp: string; votingPower: string; @@ -1878,14 +1707,14 @@ export type ListHistoricalVotingPowerQuery = { transactionHash: string; logIndex: number; delegation?: { - __typename?: 'query_historicalVotingPower_items_items_delegation'; + __typename?: 'HistoricalVotingPowerDelegation'; from: string; to: string; value: string; previousDelegate?: string | null; } | null; transfer?: { - __typename?: 'query_historicalVotingPower_items_items_transfer'; + __typename?: 'HistoricalVotingPowerTransfer'; from: string; to: string; value: string; diff --git a/packages/anticapture-client/dist/gql/graphql.js b/packages/anticapture-client/dist/gql/graphql.js index 71c30fdb..5e2406a5 100644 --- a/packages/anticapture-client/dist/gql/graphql.js +++ b/packages/anticapture-client/dist/gql/graphql.js @@ -1,7 +1,30 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.QueryInput_Token_Currency = exports.QueryInput_TokenMetrics_OrderDirection = exports.QueryInput_TokenMetrics_MetricType = exports.QueryInput_Proposals_OrderDirection = exports.QueryInput_Proposals_IncludeOptimisticProposals = exports.QueryInput_ProposalsActivity_UserVoteFilter = exports.QueryInput_ProposalsActivity_OrderDirection = exports.QueryInput_ProposalsActivity_OrderBy = exports.QueryInput_ProposalNonVoters_OrderDirection = exports.QueryInput_OffchainProposals_OrderDirection = exports.QueryInput_LastUpdate_Chart = exports.QueryInput_HistoricalVotingPower_OrderDirection = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.QueryInput_HistoricalVotingPowerByAccountId_OrderDirection = exports.QueryInput_HistoricalVotingPowerByAccountId_OrderBy = exports.QueryInput_HistoricalDelegations_OrderDirection = exports.QueryInput_HistoricalBalances_OrderDirection = exports.QueryInput_HistoricalBalances_OrderBy = exports.QueryInput_GetTotalTreasury_Order = exports.QueryInput_GetTotalTreasury_Days = exports.QueryInput_GetLiquidTreasury_Order = exports.QueryInput_GetLiquidTreasury_Days = exports.QueryInput_GetEventRelevanceThreshold_Type = exports.QueryInput_GetEventRelevanceThreshold_Relevance = exports.QueryInput_GetDaoTokenTreasury_Order = exports.QueryInput_GetDaoTokenTreasury_Days = exports.QueryInput_FeedEvents_Type = exports.QueryInput_FeedEvents_Relevance = exports.QueryInput_FeedEvents_OrderDirection = exports.QueryInput_FeedEvents_OrderBy = exports.QueryInput_Delegators_OrderDirection = exports.QueryInput_Delegators_OrderBy = exports.QueryInput_DelegationPercentageByDay_OrderDirection = exports.QueryInput_CompareVotes_Days = exports.QueryInput_CompareTreasury_Days = exports.QueryInput_CompareTotalSupply_Days = exports.QueryInput_CompareProposals_Days = exports.QueryInput_CompareLendingSupply_Days = exports.QueryInput_CompareDexSupply_Days = exports.QueryInput_CompareDelegatedSupply_Days = exports.QueryInput_CompareCirculatingSupply_Days = exports.QueryInput_CompareCexSupply_Days = exports.QueryInput_CompareAverageTurnout_Days = exports.QueryInput_CompareActiveSupply_Days = exports.QueryInput_AccountInteractions_OrderDirection = exports.QueryInput_AccountInteractions_OrderBy = exports.QueryInput_AccountBalances_OrderDirection = exports.QueryInput_AccountBalances_OrderBy = exports.QueryInput_AccountBalanceVariations_OrderDirection = exports.HttpMethod = void 0; -exports.ListHistoricalVotingPowerDocument = exports.ListVotesDocument = exports.GetEventRelevanceThresholdDocument = exports.ListProposalsDocument = exports.GetProposalByIdDocument = exports.ProposalNonVotersDocument = exports.ListOffchainVotesDocument = exports.ListOffchainProposalsDocument = exports.GetDaOsDocument = exports.Timestamp_Const = exports.Query_FeedEvents_Items_Items_Type = exports.Query_FeedEvents_Items_Items_Relevance = exports.QueryInput_VotingPowers_OrderDirection = exports.QueryInput_VotingPowers_OrderBy = exports.QueryInput_VotingPowerVariations_OrderDirection = exports.QueryInput_Votes_OrderDirection = exports.QueryInput_Votes_OrderBy = exports.QueryInput_VotesOffchain_OrderDirection = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_VotesOffchainByProposalId_OrderDirection = exports.QueryInput_VotesOffchainByProposalId_OrderBy = exports.QueryInput_VotesByProposalId_OrderDirection = exports.QueryInput_VotesByProposalId_OrderBy = exports.QueryInput_Transfers_SortOrder = exports.QueryInput_Transfers_SortBy = exports.QueryInput_Transactions_SortOrder = void 0; +exports.ListHistoricalVotingPowerDocument = exports.ListVotesDocument = exports.GetEventRelevanceThresholdDocument = exports.ListProposalsDocument = exports.GetProposalByIdDocument = exports.ProposalNonVotersDocument = exports.ListOffchainVotesDocument = exports.ListOffchainProposalsDocument = exports.GetDaOsDocument = exports.QueryInput_VotingPowers_OrderBy = exports.QueryInput_Votes_OrderBy = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_VotesOffchainByProposalId_OrderBy = exports.QueryInput_VotesByProposalId_OrderBy = exports.QueryInput_Transfers_OrderBy = exports.QueryInput_Transactions_Includes_Items = exports.QueryInput_Transactions_AffectedSupply_Items = exports.QueryInput_Token_Currency = exports.QueryInput_TokenMetrics_MetricType = exports.QueryInput_Proposals_Status_Items = exports.QueryInput_ProposalsActivity_UserVoteFilter = exports.QueryInput_ProposalsActivity_OrderBy = exports.QueryInput_OffchainProposals_Status_Items = exports.QueryInput_LastUpdate_Chart = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.QueryInput_HistoricalVotingPowerByAccountId_OrderBy = exports.QueryInput_HistoricalBalances_OrderBy = exports.QueryInput_FeedEvents_Type = exports.QueryInput_FeedEvents_Relevance = exports.QueryInput_FeedEvents_OrderBy = exports.QueryInput_Delegators_OrderBy = exports.QueryInput_AccountInteractions_OrderBy = exports.QueryInput_AccountBalances_OrderBy = exports.Ok_Const = exports.Error_Const = exports.OrderDirection = exports.HttpMethod = exports.FeedRelevance = exports.FeedEventType = exports.DaysWindow = void 0; +var DaysWindow; +(function (DaysWindow) { + DaysWindow["7d"] = "_7d"; + DaysWindow["30d"] = "_30d"; + DaysWindow["90d"] = "_90d"; + DaysWindow["180d"] = "_180d"; + DaysWindow["365d"] = "_365d"; +})(DaysWindow || (exports.DaysWindow = DaysWindow = {})); +/** Filter events by governance activity type. */ +var FeedEventType; +(function (FeedEventType) { + FeedEventType["Delegation"] = "DELEGATION"; + FeedEventType["Proposal"] = "PROPOSAL"; + FeedEventType["ProposalExtended"] = "PROPOSAL_EXTENDED"; + FeedEventType["Transfer"] = "TRANSFER"; + FeedEventType["Vote"] = "VOTE"; +})(FeedEventType || (exports.FeedEventType = FeedEventType = {})); +/** Filter events by relevance tier. */ +var FeedRelevance; +(function (FeedRelevance) { + FeedRelevance["High"] = "HIGH"; + FeedRelevance["Low"] = "LOW"; + FeedRelevance["Medium"] = "MEDIUM"; +})(FeedRelevance || (exports.FeedRelevance = FeedRelevance = {})); var HttpMethod; (function (HttpMethod) { HttpMethod["Connect"] = "CONNECT"; @@ -14,151 +37,51 @@ var HttpMethod; HttpMethod["Put"] = "PUT"; HttpMethod["Trace"] = "TRACE"; })(HttpMethod || (exports.HttpMethod = HttpMethod = {})); -var QueryInput_AccountBalanceVariations_OrderDirection; -(function (QueryInput_AccountBalanceVariations_OrderDirection) { - QueryInput_AccountBalanceVariations_OrderDirection["Asc"] = "asc"; - QueryInput_AccountBalanceVariations_OrderDirection["Desc"] = "desc"; -})(QueryInput_AccountBalanceVariations_OrderDirection || (exports.QueryInput_AccountBalanceVariations_OrderDirection = QueryInput_AccountBalanceVariations_OrderDirection = {})); +/** Sort direction for ordered query results. */ +var OrderDirection; +(function (OrderDirection) { + OrderDirection["Asc"] = "asc"; + OrderDirection["Desc"] = "desc"; +})(OrderDirection || (exports.OrderDirection = OrderDirection = {})); +var Error_Const; +(function (Error_Const) { + Error_Const["Error"] = "error"; +})(Error_Const || (exports.Error_Const = Error_Const = {})); +var Ok_Const; +(function (Ok_Const) { + Ok_Const["Ok"] = "ok"; +})(Ok_Const || (exports.Ok_Const = Ok_Const = {})); var QueryInput_AccountBalances_OrderBy; (function (QueryInput_AccountBalances_OrderBy) { QueryInput_AccountBalances_OrderBy["Balance"] = "balance"; QueryInput_AccountBalances_OrderBy["SignedVariation"] = "signedVariation"; QueryInput_AccountBalances_OrderBy["Variation"] = "variation"; })(QueryInput_AccountBalances_OrderBy || (exports.QueryInput_AccountBalances_OrderBy = QueryInput_AccountBalances_OrderBy = {})); -var QueryInput_AccountBalances_OrderDirection; -(function (QueryInput_AccountBalances_OrderDirection) { - QueryInput_AccountBalances_OrderDirection["Asc"] = "asc"; - QueryInput_AccountBalances_OrderDirection["Desc"] = "desc"; -})(QueryInput_AccountBalances_OrderDirection || (exports.QueryInput_AccountBalances_OrderDirection = QueryInput_AccountBalances_OrderDirection = {})); +/** Field used to sort interaction rows. */ var QueryInput_AccountInteractions_OrderBy; (function (QueryInput_AccountInteractions_OrderBy) { QueryInput_AccountInteractions_OrderBy["Count"] = "count"; QueryInput_AccountInteractions_OrderBy["Volume"] = "volume"; })(QueryInput_AccountInteractions_OrderBy || (exports.QueryInput_AccountInteractions_OrderBy = QueryInput_AccountInteractions_OrderBy = {})); -var QueryInput_AccountInteractions_OrderDirection; -(function (QueryInput_AccountInteractions_OrderDirection) { - QueryInput_AccountInteractions_OrderDirection["Asc"] = "asc"; - QueryInput_AccountInteractions_OrderDirection["Desc"] = "desc"; -})(QueryInput_AccountInteractions_OrderDirection || (exports.QueryInput_AccountInteractions_OrderDirection = QueryInput_AccountInteractions_OrderDirection = {})); -var QueryInput_CompareActiveSupply_Days; -(function (QueryInput_CompareActiveSupply_Days) { - QueryInput_CompareActiveSupply_Days["7d"] = "_7d"; - QueryInput_CompareActiveSupply_Days["30d"] = "_30d"; - QueryInput_CompareActiveSupply_Days["90d"] = "_90d"; - QueryInput_CompareActiveSupply_Days["180d"] = "_180d"; - QueryInput_CompareActiveSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareActiveSupply_Days || (exports.QueryInput_CompareActiveSupply_Days = QueryInput_CompareActiveSupply_Days = {})); -var QueryInput_CompareAverageTurnout_Days; -(function (QueryInput_CompareAverageTurnout_Days) { - QueryInput_CompareAverageTurnout_Days["7d"] = "_7d"; - QueryInput_CompareAverageTurnout_Days["30d"] = "_30d"; - QueryInput_CompareAverageTurnout_Days["90d"] = "_90d"; - QueryInput_CompareAverageTurnout_Days["180d"] = "_180d"; - QueryInput_CompareAverageTurnout_Days["365d"] = "_365d"; -})(QueryInput_CompareAverageTurnout_Days || (exports.QueryInput_CompareAverageTurnout_Days = QueryInput_CompareAverageTurnout_Days = {})); -var QueryInput_CompareCexSupply_Days; -(function (QueryInput_CompareCexSupply_Days) { - QueryInput_CompareCexSupply_Days["7d"] = "_7d"; - QueryInput_CompareCexSupply_Days["30d"] = "_30d"; - QueryInput_CompareCexSupply_Days["90d"] = "_90d"; - QueryInput_CompareCexSupply_Days["180d"] = "_180d"; - QueryInput_CompareCexSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareCexSupply_Days || (exports.QueryInput_CompareCexSupply_Days = QueryInput_CompareCexSupply_Days = {})); -var QueryInput_CompareCirculatingSupply_Days; -(function (QueryInput_CompareCirculatingSupply_Days) { - QueryInput_CompareCirculatingSupply_Days["7d"] = "_7d"; - QueryInput_CompareCirculatingSupply_Days["30d"] = "_30d"; - QueryInput_CompareCirculatingSupply_Days["90d"] = "_90d"; - QueryInput_CompareCirculatingSupply_Days["180d"] = "_180d"; - QueryInput_CompareCirculatingSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareCirculatingSupply_Days || (exports.QueryInput_CompareCirculatingSupply_Days = QueryInput_CompareCirculatingSupply_Days = {})); -var QueryInput_CompareDelegatedSupply_Days; -(function (QueryInput_CompareDelegatedSupply_Days) { - QueryInput_CompareDelegatedSupply_Days["7d"] = "_7d"; - QueryInput_CompareDelegatedSupply_Days["30d"] = "_30d"; - QueryInput_CompareDelegatedSupply_Days["90d"] = "_90d"; - QueryInput_CompareDelegatedSupply_Days["180d"] = "_180d"; - QueryInput_CompareDelegatedSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareDelegatedSupply_Days || (exports.QueryInput_CompareDelegatedSupply_Days = QueryInput_CompareDelegatedSupply_Days = {})); -var QueryInput_CompareDexSupply_Days; -(function (QueryInput_CompareDexSupply_Days) { - QueryInput_CompareDexSupply_Days["7d"] = "_7d"; - QueryInput_CompareDexSupply_Days["30d"] = "_30d"; - QueryInput_CompareDexSupply_Days["90d"] = "_90d"; - QueryInput_CompareDexSupply_Days["180d"] = "_180d"; - QueryInput_CompareDexSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareDexSupply_Days || (exports.QueryInput_CompareDexSupply_Days = QueryInput_CompareDexSupply_Days = {})); -var QueryInput_CompareLendingSupply_Days; -(function (QueryInput_CompareLendingSupply_Days) { - QueryInput_CompareLendingSupply_Days["7d"] = "_7d"; - QueryInput_CompareLendingSupply_Days["30d"] = "_30d"; - QueryInput_CompareLendingSupply_Days["90d"] = "_90d"; - QueryInput_CompareLendingSupply_Days["180d"] = "_180d"; - QueryInput_CompareLendingSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareLendingSupply_Days || (exports.QueryInput_CompareLendingSupply_Days = QueryInput_CompareLendingSupply_Days = {})); -var QueryInput_CompareProposals_Days; -(function (QueryInput_CompareProposals_Days) { - QueryInput_CompareProposals_Days["7d"] = "_7d"; - QueryInput_CompareProposals_Days["30d"] = "_30d"; - QueryInput_CompareProposals_Days["90d"] = "_90d"; - QueryInput_CompareProposals_Days["180d"] = "_180d"; - QueryInput_CompareProposals_Days["365d"] = "_365d"; -})(QueryInput_CompareProposals_Days || (exports.QueryInput_CompareProposals_Days = QueryInput_CompareProposals_Days = {})); -var QueryInput_CompareTotalSupply_Days; -(function (QueryInput_CompareTotalSupply_Days) { - QueryInput_CompareTotalSupply_Days["7d"] = "_7d"; - QueryInput_CompareTotalSupply_Days["30d"] = "_30d"; - QueryInput_CompareTotalSupply_Days["90d"] = "_90d"; - QueryInput_CompareTotalSupply_Days["180d"] = "_180d"; - QueryInput_CompareTotalSupply_Days["365d"] = "_365d"; -})(QueryInput_CompareTotalSupply_Days || (exports.QueryInput_CompareTotalSupply_Days = QueryInput_CompareTotalSupply_Days = {})); -var QueryInput_CompareTreasury_Days; -(function (QueryInput_CompareTreasury_Days) { - QueryInput_CompareTreasury_Days["7d"] = "_7d"; - QueryInput_CompareTreasury_Days["30d"] = "_30d"; - QueryInput_CompareTreasury_Days["90d"] = "_90d"; - QueryInput_CompareTreasury_Days["180d"] = "_180d"; - QueryInput_CompareTreasury_Days["365d"] = "_365d"; -})(QueryInput_CompareTreasury_Days || (exports.QueryInput_CompareTreasury_Days = QueryInput_CompareTreasury_Days = {})); -var QueryInput_CompareVotes_Days; -(function (QueryInput_CompareVotes_Days) { - QueryInput_CompareVotes_Days["7d"] = "_7d"; - QueryInput_CompareVotes_Days["30d"] = "_30d"; - QueryInput_CompareVotes_Days["90d"] = "_90d"; - QueryInput_CompareVotes_Days["180d"] = "_180d"; - QueryInput_CompareVotes_Days["365d"] = "_365d"; -})(QueryInput_CompareVotes_Days || (exports.QueryInput_CompareVotes_Days = QueryInput_CompareVotes_Days = {})); -var QueryInput_DelegationPercentageByDay_OrderDirection; -(function (QueryInput_DelegationPercentageByDay_OrderDirection) { - QueryInput_DelegationPercentageByDay_OrderDirection["Asc"] = "asc"; - QueryInput_DelegationPercentageByDay_OrderDirection["Desc"] = "desc"; -})(QueryInput_DelegationPercentageByDay_OrderDirection || (exports.QueryInput_DelegationPercentageByDay_OrderDirection = QueryInput_DelegationPercentageByDay_OrderDirection = {})); var QueryInput_Delegators_OrderBy; (function (QueryInput_Delegators_OrderBy) { QueryInput_Delegators_OrderBy["Amount"] = "amount"; QueryInput_Delegators_OrderBy["Timestamp"] = "timestamp"; })(QueryInput_Delegators_OrderBy || (exports.QueryInput_Delegators_OrderBy = QueryInput_Delegators_OrderBy = {})); -var QueryInput_Delegators_OrderDirection; -(function (QueryInput_Delegators_OrderDirection) { - QueryInput_Delegators_OrderDirection["Asc"] = "asc"; - QueryInput_Delegators_OrderDirection["Desc"] = "desc"; -})(QueryInput_Delegators_OrderDirection || (exports.QueryInput_Delegators_OrderDirection = QueryInput_Delegators_OrderDirection = {})); +/** Field used to sort feed events. */ var QueryInput_FeedEvents_OrderBy; (function (QueryInput_FeedEvents_OrderBy) { QueryInput_FeedEvents_OrderBy["Timestamp"] = "timestamp"; QueryInput_FeedEvents_OrderBy["Value"] = "value"; })(QueryInput_FeedEvents_OrderBy || (exports.QueryInput_FeedEvents_OrderBy = QueryInput_FeedEvents_OrderBy = {})); -var QueryInput_FeedEvents_OrderDirection; -(function (QueryInput_FeedEvents_OrderDirection) { - QueryInput_FeedEvents_OrderDirection["Asc"] = "asc"; - QueryInput_FeedEvents_OrderDirection["Desc"] = "desc"; -})(QueryInput_FeedEvents_OrderDirection || (exports.QueryInput_FeedEvents_OrderDirection = QueryInput_FeedEvents_OrderDirection = {})); +/** Filter events by relevance tier. */ var QueryInput_FeedEvents_Relevance; (function (QueryInput_FeedEvents_Relevance) { QueryInput_FeedEvents_Relevance["High"] = "HIGH"; QueryInput_FeedEvents_Relevance["Low"] = "LOW"; QueryInput_FeedEvents_Relevance["Medium"] = "MEDIUM"; })(QueryInput_FeedEvents_Relevance || (exports.QueryInput_FeedEvents_Relevance = QueryInput_FeedEvents_Relevance = {})); +/** Filter events by governance activity type. */ var QueryInput_FeedEvents_Type; (function (QueryInput_FeedEvents_Type) { QueryInput_FeedEvents_Type["Delegation"] = "DELEGATION"; @@ -167,122 +90,45 @@ var QueryInput_FeedEvents_Type; QueryInput_FeedEvents_Type["Transfer"] = "TRANSFER"; QueryInput_FeedEvents_Type["Vote"] = "VOTE"; })(QueryInput_FeedEvents_Type || (exports.QueryInput_FeedEvents_Type = QueryInput_FeedEvents_Type = {})); -var QueryInput_GetDaoTokenTreasury_Days; -(function (QueryInput_GetDaoTokenTreasury_Days) { - QueryInput_GetDaoTokenTreasury_Days["7d"] = "_7d"; - QueryInput_GetDaoTokenTreasury_Days["30d"] = "_30d"; - QueryInput_GetDaoTokenTreasury_Days["90d"] = "_90d"; - QueryInput_GetDaoTokenTreasury_Days["180d"] = "_180d"; - QueryInput_GetDaoTokenTreasury_Days["365d"] = "_365d"; -})(QueryInput_GetDaoTokenTreasury_Days || (exports.QueryInput_GetDaoTokenTreasury_Days = QueryInput_GetDaoTokenTreasury_Days = {})); -var QueryInput_GetDaoTokenTreasury_Order; -(function (QueryInput_GetDaoTokenTreasury_Order) { - QueryInput_GetDaoTokenTreasury_Order["Asc"] = "asc"; - QueryInput_GetDaoTokenTreasury_Order["Desc"] = "desc"; -})(QueryInput_GetDaoTokenTreasury_Order || (exports.QueryInput_GetDaoTokenTreasury_Order = QueryInput_GetDaoTokenTreasury_Order = {})); -var QueryInput_GetEventRelevanceThreshold_Relevance; -(function (QueryInput_GetEventRelevanceThreshold_Relevance) { - QueryInput_GetEventRelevanceThreshold_Relevance["High"] = "HIGH"; - QueryInput_GetEventRelevanceThreshold_Relevance["Low"] = "LOW"; - QueryInput_GetEventRelevanceThreshold_Relevance["Medium"] = "MEDIUM"; -})(QueryInput_GetEventRelevanceThreshold_Relevance || (exports.QueryInput_GetEventRelevanceThreshold_Relevance = QueryInput_GetEventRelevanceThreshold_Relevance = {})); -var QueryInput_GetEventRelevanceThreshold_Type; -(function (QueryInput_GetEventRelevanceThreshold_Type) { - QueryInput_GetEventRelevanceThreshold_Type["Delegation"] = "DELEGATION"; - QueryInput_GetEventRelevanceThreshold_Type["Proposal"] = "PROPOSAL"; - QueryInput_GetEventRelevanceThreshold_Type["ProposalExtended"] = "PROPOSAL_EXTENDED"; - QueryInput_GetEventRelevanceThreshold_Type["Transfer"] = "TRANSFER"; - QueryInput_GetEventRelevanceThreshold_Type["Vote"] = "VOTE"; -})(QueryInput_GetEventRelevanceThreshold_Type || (exports.QueryInput_GetEventRelevanceThreshold_Type = QueryInput_GetEventRelevanceThreshold_Type = {})); -var QueryInput_GetLiquidTreasury_Days; -(function (QueryInput_GetLiquidTreasury_Days) { - QueryInput_GetLiquidTreasury_Days["7d"] = "_7d"; - QueryInput_GetLiquidTreasury_Days["30d"] = "_30d"; - QueryInput_GetLiquidTreasury_Days["90d"] = "_90d"; - QueryInput_GetLiquidTreasury_Days["180d"] = "_180d"; - QueryInput_GetLiquidTreasury_Days["365d"] = "_365d"; -})(QueryInput_GetLiquidTreasury_Days || (exports.QueryInput_GetLiquidTreasury_Days = QueryInput_GetLiquidTreasury_Days = {})); -var QueryInput_GetLiquidTreasury_Order; -(function (QueryInput_GetLiquidTreasury_Order) { - QueryInput_GetLiquidTreasury_Order["Asc"] = "asc"; - QueryInput_GetLiquidTreasury_Order["Desc"] = "desc"; -})(QueryInput_GetLiquidTreasury_Order || (exports.QueryInput_GetLiquidTreasury_Order = QueryInput_GetLiquidTreasury_Order = {})); -var QueryInput_GetTotalTreasury_Days; -(function (QueryInput_GetTotalTreasury_Days) { - QueryInput_GetTotalTreasury_Days["7d"] = "_7d"; - QueryInput_GetTotalTreasury_Days["30d"] = "_30d"; - QueryInput_GetTotalTreasury_Days["90d"] = "_90d"; - QueryInput_GetTotalTreasury_Days["180d"] = "_180d"; - QueryInput_GetTotalTreasury_Days["365d"] = "_365d"; -})(QueryInput_GetTotalTreasury_Days || (exports.QueryInput_GetTotalTreasury_Days = QueryInput_GetTotalTreasury_Days = {})); -var QueryInput_GetTotalTreasury_Order; -(function (QueryInput_GetTotalTreasury_Order) { - QueryInput_GetTotalTreasury_Order["Asc"] = "asc"; - QueryInput_GetTotalTreasury_Order["Desc"] = "desc"; -})(QueryInput_GetTotalTreasury_Order || (exports.QueryInput_GetTotalTreasury_Order = QueryInput_GetTotalTreasury_Order = {})); +/** Field used to sort historical balance rows. */ var QueryInput_HistoricalBalances_OrderBy; (function (QueryInput_HistoricalBalances_OrderBy) { QueryInput_HistoricalBalances_OrderBy["Delta"] = "delta"; QueryInput_HistoricalBalances_OrderBy["Timestamp"] = "timestamp"; })(QueryInput_HistoricalBalances_OrderBy || (exports.QueryInput_HistoricalBalances_OrderBy = QueryInput_HistoricalBalances_OrderBy = {})); -var QueryInput_HistoricalBalances_OrderDirection; -(function (QueryInput_HistoricalBalances_OrderDirection) { - QueryInput_HistoricalBalances_OrderDirection["Asc"] = "asc"; - QueryInput_HistoricalBalances_OrderDirection["Desc"] = "desc"; -})(QueryInput_HistoricalBalances_OrderDirection || (exports.QueryInput_HistoricalBalances_OrderDirection = QueryInput_HistoricalBalances_OrderDirection = {})); -var QueryInput_HistoricalDelegations_OrderDirection; -(function (QueryInput_HistoricalDelegations_OrderDirection) { - QueryInput_HistoricalDelegations_OrderDirection["Asc"] = "asc"; - QueryInput_HistoricalDelegations_OrderDirection["Desc"] = "desc"; -})(QueryInput_HistoricalDelegations_OrderDirection || (exports.QueryInput_HistoricalDelegations_OrderDirection = QueryInput_HistoricalDelegations_OrderDirection = {})); +/** Field used to sort historical voting power rows. */ var QueryInput_HistoricalVotingPowerByAccountId_OrderBy; (function (QueryInput_HistoricalVotingPowerByAccountId_OrderBy) { QueryInput_HistoricalVotingPowerByAccountId_OrderBy["Delta"] = "delta"; QueryInput_HistoricalVotingPowerByAccountId_OrderBy["Timestamp"] = "timestamp"; })(QueryInput_HistoricalVotingPowerByAccountId_OrderBy || (exports.QueryInput_HistoricalVotingPowerByAccountId_OrderBy = QueryInput_HistoricalVotingPowerByAccountId_OrderBy = {})); -var QueryInput_HistoricalVotingPowerByAccountId_OrderDirection; -(function (QueryInput_HistoricalVotingPowerByAccountId_OrderDirection) { - QueryInput_HistoricalVotingPowerByAccountId_OrderDirection["Asc"] = "asc"; - QueryInput_HistoricalVotingPowerByAccountId_OrderDirection["Desc"] = "desc"; -})(QueryInput_HistoricalVotingPowerByAccountId_OrderDirection || (exports.QueryInput_HistoricalVotingPowerByAccountId_OrderDirection = QueryInput_HistoricalVotingPowerByAccountId_OrderDirection = {})); +/** Field used to sort historical voting power rows. */ var QueryInput_HistoricalVotingPower_OrderBy; (function (QueryInput_HistoricalVotingPower_OrderBy) { QueryInput_HistoricalVotingPower_OrderBy["Delta"] = "delta"; QueryInput_HistoricalVotingPower_OrderBy["Timestamp"] = "timestamp"; })(QueryInput_HistoricalVotingPower_OrderBy || (exports.QueryInput_HistoricalVotingPower_OrderBy = QueryInput_HistoricalVotingPower_OrderBy = {})); -var QueryInput_HistoricalVotingPower_OrderDirection; -(function (QueryInput_HistoricalVotingPower_OrderDirection) { - QueryInput_HistoricalVotingPower_OrderDirection["Asc"] = "asc"; - QueryInput_HistoricalVotingPower_OrderDirection["Desc"] = "desc"; -})(QueryInput_HistoricalVotingPower_OrderDirection || (exports.QueryInput_HistoricalVotingPower_OrderDirection = QueryInput_HistoricalVotingPower_OrderDirection = {})); +/** Chart identifier whose freshness timestamp should be returned. */ var QueryInput_LastUpdate_Chart; (function (QueryInput_LastUpdate_Chart) { QueryInput_LastUpdate_Chart["AttackProfitability"] = "attack_profitability"; QueryInput_LastUpdate_Chart["CostComparison"] = "cost_comparison"; QueryInput_LastUpdate_Chart["TokenDistribution"] = "token_distribution"; })(QueryInput_LastUpdate_Chart || (exports.QueryInput_LastUpdate_Chart = QueryInput_LastUpdate_Chart = {})); -var QueryInput_OffchainProposals_OrderDirection; -(function (QueryInput_OffchainProposals_OrderDirection) { - QueryInput_OffchainProposals_OrderDirection["Asc"] = "asc"; - QueryInput_OffchainProposals_OrderDirection["Desc"] = "desc"; -})(QueryInput_OffchainProposals_OrderDirection || (exports.QueryInput_OffchainProposals_OrderDirection = QueryInput_OffchainProposals_OrderDirection = {})); -var QueryInput_ProposalNonVoters_OrderDirection; -(function (QueryInput_ProposalNonVoters_OrderDirection) { - QueryInput_ProposalNonVoters_OrderDirection["Asc"] = "asc"; - QueryInput_ProposalNonVoters_OrderDirection["Desc"] = "desc"; -})(QueryInput_ProposalNonVoters_OrderDirection || (exports.QueryInput_ProposalNonVoters_OrderDirection = QueryInput_ProposalNonVoters_OrderDirection = {})); +var QueryInput_OffchainProposals_Status_Items; +(function (QueryInput_OffchainProposals_Status_Items) { + QueryInput_OffchainProposals_Status_Items["Active"] = "active"; + QueryInput_OffchainProposals_Status_Items["Closed"] = "closed"; + QueryInput_OffchainProposals_Status_Items["Pending"] = "pending"; +})(QueryInput_OffchainProposals_Status_Items || (exports.QueryInput_OffchainProposals_Status_Items = QueryInput_OffchainProposals_Status_Items = {})); +/** Field used to sort proposal activity results. */ var QueryInput_ProposalsActivity_OrderBy; (function (QueryInput_ProposalsActivity_OrderBy) { QueryInput_ProposalsActivity_OrderBy["Timestamp"] = "timestamp"; QueryInput_ProposalsActivity_OrderBy["VoteTiming"] = "voteTiming"; QueryInput_ProposalsActivity_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_ProposalsActivity_OrderBy || (exports.QueryInput_ProposalsActivity_OrderBy = QueryInput_ProposalsActivity_OrderBy = {})); -var QueryInput_ProposalsActivity_OrderDirection; -(function (QueryInput_ProposalsActivity_OrderDirection) { - QueryInput_ProposalsActivity_OrderDirection["Asc"] = "asc"; - QueryInput_ProposalsActivity_OrderDirection["Desc"] = "desc"; -})(QueryInput_ProposalsActivity_OrderDirection || (exports.QueryInput_ProposalsActivity_OrderDirection = QueryInput_ProposalsActivity_OrderDirection = {})); -/** Filter proposals by vote type. Can be: 'yes' (For votes), 'no' (Against votes), 'abstain' (Abstain votes), 'no-vote' (Didn't vote) */ +/** Optional vote filter. Use yes, no, abstain, or no-vote to narrow the result set. */ var QueryInput_ProposalsActivity_UserVoteFilter; (function (QueryInput_ProposalsActivity_UserVoteFilter) { QueryInput_ProposalsActivity_UserVoteFilter["Abstain"] = "abstain"; @@ -290,16 +136,21 @@ var QueryInput_ProposalsActivity_UserVoteFilter; QueryInput_ProposalsActivity_UserVoteFilter["NoVote"] = "no_vote"; QueryInput_ProposalsActivity_UserVoteFilter["Yes"] = "yes"; })(QueryInput_ProposalsActivity_UserVoteFilter || (exports.QueryInput_ProposalsActivity_UserVoteFilter = QueryInput_ProposalsActivity_UserVoteFilter = {})); -var QueryInput_Proposals_IncludeOptimisticProposals; -(function (QueryInput_Proposals_IncludeOptimisticProposals) { - QueryInput_Proposals_IncludeOptimisticProposals["False"] = "FALSE"; - QueryInput_Proposals_IncludeOptimisticProposals["True"] = "TRUE"; -})(QueryInput_Proposals_IncludeOptimisticProposals || (exports.QueryInput_Proposals_IncludeOptimisticProposals = QueryInput_Proposals_IncludeOptimisticProposals = {})); -var QueryInput_Proposals_OrderDirection; -(function (QueryInput_Proposals_OrderDirection) { - QueryInput_Proposals_OrderDirection["Asc"] = "asc"; - QueryInput_Proposals_OrderDirection["Desc"] = "desc"; -})(QueryInput_Proposals_OrderDirection || (exports.QueryInput_Proposals_OrderDirection = QueryInput_Proposals_OrderDirection = {})); +var QueryInput_Proposals_Status_Items; +(function (QueryInput_Proposals_Status_Items) { + QueryInput_Proposals_Status_Items["Active"] = "ACTIVE"; + QueryInput_Proposals_Status_Items["Canceled"] = "CANCELED"; + QueryInput_Proposals_Status_Items["Defeated"] = "DEFEATED"; + QueryInput_Proposals_Status_Items["Executed"] = "EXECUTED"; + QueryInput_Proposals_Status_Items["Expired"] = "EXPIRED"; + QueryInput_Proposals_Status_Items["NoQuorum"] = "NO_QUORUM"; + QueryInput_Proposals_Status_Items["Pending"] = "PENDING"; + QueryInput_Proposals_Status_Items["PendingExecution"] = "PENDING_EXECUTION"; + QueryInput_Proposals_Status_Items["Queued"] = "QUEUED"; + QueryInput_Proposals_Status_Items["Succeeded"] = "SUCCEEDED"; + QueryInput_Proposals_Status_Items["Vetoed"] = "VETOED"; +})(QueryInput_Proposals_Status_Items || (exports.QueryInput_Proposals_Status_Items = QueryInput_Proposals_Status_Items = {})); +/** Metric family to query. */ var QueryInput_TokenMetrics_MetricType; (function (QueryInput_TokenMetrics_MetricType) { QueryInput_TokenMetrics_MetricType["CexSupply"] = "CEX_SUPPLY"; @@ -310,76 +161,55 @@ var QueryInput_TokenMetrics_MetricType; QueryInput_TokenMetrics_MetricType["TotalSupply"] = "TOTAL_SUPPLY"; QueryInput_TokenMetrics_MetricType["Treasury"] = "TREASURY"; })(QueryInput_TokenMetrics_MetricType || (exports.QueryInput_TokenMetrics_MetricType = QueryInput_TokenMetrics_MetricType = {})); -var QueryInput_TokenMetrics_OrderDirection; -(function (QueryInput_TokenMetrics_OrderDirection) { - QueryInput_TokenMetrics_OrderDirection["Asc"] = "asc"; - QueryInput_TokenMetrics_OrderDirection["Desc"] = "desc"; -})(QueryInput_TokenMetrics_OrderDirection || (exports.QueryInput_TokenMetrics_OrderDirection = QueryInput_TokenMetrics_OrderDirection = {})); +/** Currency to use when fetching token price data. */ var QueryInput_Token_Currency; (function (QueryInput_Token_Currency) { QueryInput_Token_Currency["Eth"] = "eth"; QueryInput_Token_Currency["Usd"] = "usd"; })(QueryInput_Token_Currency || (exports.QueryInput_Token_Currency = QueryInput_Token_Currency = {})); -var QueryInput_Transactions_SortOrder; -(function (QueryInput_Transactions_SortOrder) { - QueryInput_Transactions_SortOrder["Asc"] = "asc"; - QueryInput_Transactions_SortOrder["Desc"] = "desc"; -})(QueryInput_Transactions_SortOrder || (exports.QueryInput_Transactions_SortOrder = QueryInput_Transactions_SortOrder = {})); -var QueryInput_Transfers_SortBy; -(function (QueryInput_Transfers_SortBy) { - QueryInput_Transfers_SortBy["Amount"] = "amount"; - QueryInput_Transfers_SortBy["Timestamp"] = "timestamp"; -})(QueryInput_Transfers_SortBy || (exports.QueryInput_Transfers_SortBy = QueryInput_Transfers_SortBy = {})); -var QueryInput_Transfers_SortOrder; -(function (QueryInput_Transfers_SortOrder) { - QueryInput_Transfers_SortOrder["Asc"] = "asc"; - QueryInput_Transfers_SortOrder["Desc"] = "desc"; -})(QueryInput_Transfers_SortOrder || (exports.QueryInput_Transfers_SortOrder = QueryInput_Transfers_SortOrder = {})); +var QueryInput_Transactions_AffectedSupply_Items; +(function (QueryInput_Transactions_AffectedSupply_Items) { + QueryInput_Transactions_AffectedSupply_Items["Cex"] = "CEX"; + QueryInput_Transactions_AffectedSupply_Items["Dex"] = "DEX"; + QueryInput_Transactions_AffectedSupply_Items["Lending"] = "LENDING"; + QueryInput_Transactions_AffectedSupply_Items["Total"] = "TOTAL"; + QueryInput_Transactions_AffectedSupply_Items["Unassigned"] = "UNASSIGNED"; +})(QueryInput_Transactions_AffectedSupply_Items || (exports.QueryInput_Transactions_AffectedSupply_Items = QueryInput_Transactions_AffectedSupply_Items = {})); +var QueryInput_Transactions_Includes_Items; +(function (QueryInput_Transactions_Includes_Items) { + QueryInput_Transactions_Includes_Items["Delegation"] = "DELEGATION"; + QueryInput_Transactions_Includes_Items["Transfer"] = "TRANSFER"; +})(QueryInput_Transactions_Includes_Items || (exports.QueryInput_Transactions_Includes_Items = QueryInput_Transactions_Includes_Items = {})); +/** Field used to sort transfers. */ +var QueryInput_Transfers_OrderBy; +(function (QueryInput_Transfers_OrderBy) { + QueryInput_Transfers_OrderBy["Amount"] = "amount"; + QueryInput_Transfers_OrderBy["Timestamp"] = "timestamp"; +})(QueryInput_Transfers_OrderBy || (exports.QueryInput_Transfers_OrderBy = QueryInput_Transfers_OrderBy = {})); +/** Sort votes by timestamp or voting power. */ var QueryInput_VotesByProposalId_OrderBy; (function (QueryInput_VotesByProposalId_OrderBy) { QueryInput_VotesByProposalId_OrderBy["Timestamp"] = "timestamp"; QueryInput_VotesByProposalId_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_VotesByProposalId_OrderBy || (exports.QueryInput_VotesByProposalId_OrderBy = QueryInput_VotesByProposalId_OrderBy = {})); -var QueryInput_VotesByProposalId_OrderDirection; -(function (QueryInput_VotesByProposalId_OrderDirection) { - QueryInput_VotesByProposalId_OrderDirection["Asc"] = "asc"; - QueryInput_VotesByProposalId_OrderDirection["Desc"] = "desc"; -})(QueryInput_VotesByProposalId_OrderDirection || (exports.QueryInput_VotesByProposalId_OrderDirection = QueryInput_VotesByProposalId_OrderDirection = {})); +/** Sort votes by timestamp or voting power. */ var QueryInput_VotesOffchainByProposalId_OrderBy; (function (QueryInput_VotesOffchainByProposalId_OrderBy) { QueryInput_VotesOffchainByProposalId_OrderBy["Timestamp"] = "timestamp"; QueryInput_VotesOffchainByProposalId_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_VotesOffchainByProposalId_OrderBy || (exports.QueryInput_VotesOffchainByProposalId_OrderBy = QueryInput_VotesOffchainByProposalId_OrderBy = {})); -var QueryInput_VotesOffchainByProposalId_OrderDirection; -(function (QueryInput_VotesOffchainByProposalId_OrderDirection) { - QueryInput_VotesOffchainByProposalId_OrderDirection["Asc"] = "asc"; - QueryInput_VotesOffchainByProposalId_OrderDirection["Desc"] = "desc"; -})(QueryInput_VotesOffchainByProposalId_OrderDirection || (exports.QueryInput_VotesOffchainByProposalId_OrderDirection = QueryInput_VotesOffchainByProposalId_OrderDirection = {})); +/** Sort votes by timestamp or voting power. */ var QueryInput_VotesOffchain_OrderBy; (function (QueryInput_VotesOffchain_OrderBy) { QueryInput_VotesOffchain_OrderBy["Timestamp"] = "timestamp"; QueryInput_VotesOffchain_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_VotesOffchain_OrderBy || (exports.QueryInput_VotesOffchain_OrderBy = QueryInput_VotesOffchain_OrderBy = {})); -var QueryInput_VotesOffchain_OrderDirection; -(function (QueryInput_VotesOffchain_OrderDirection) { - QueryInput_VotesOffchain_OrderDirection["Asc"] = "asc"; - QueryInput_VotesOffchain_OrderDirection["Desc"] = "desc"; -})(QueryInput_VotesOffchain_OrderDirection || (exports.QueryInput_VotesOffchain_OrderDirection = QueryInput_VotesOffchain_OrderDirection = {})); +/** Sort votes by timestamp or voting power. */ var QueryInput_Votes_OrderBy; (function (QueryInput_Votes_OrderBy) { QueryInput_Votes_OrderBy["Timestamp"] = "timestamp"; QueryInput_Votes_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_Votes_OrderBy || (exports.QueryInput_Votes_OrderBy = QueryInput_Votes_OrderBy = {})); -var QueryInput_Votes_OrderDirection; -(function (QueryInput_Votes_OrderDirection) { - QueryInput_Votes_OrderDirection["Asc"] = "asc"; - QueryInput_Votes_OrderDirection["Desc"] = "desc"; -})(QueryInput_Votes_OrderDirection || (exports.QueryInput_Votes_OrderDirection = QueryInput_Votes_OrderDirection = {})); -var QueryInput_VotingPowerVariations_OrderDirection; -(function (QueryInput_VotingPowerVariations_OrderDirection) { - QueryInput_VotingPowerVariations_OrderDirection["Asc"] = "asc"; - QueryInput_VotingPowerVariations_OrderDirection["Desc"] = "desc"; -})(QueryInput_VotingPowerVariations_OrderDirection || (exports.QueryInput_VotingPowerVariations_OrderDirection = QueryInput_VotingPowerVariations_OrderDirection = {})); var QueryInput_VotingPowers_OrderBy; (function (QueryInput_VotingPowers_OrderBy) { QueryInput_VotingPowers_OrderBy["Balance"] = "balance"; @@ -389,35 +219,12 @@ var QueryInput_VotingPowers_OrderBy; QueryInput_VotingPowers_OrderBy["Variation"] = "variation"; QueryInput_VotingPowers_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_VotingPowers_OrderBy || (exports.QueryInput_VotingPowers_OrderBy = QueryInput_VotingPowers_OrderBy = {})); -var QueryInput_VotingPowers_OrderDirection; -(function (QueryInput_VotingPowers_OrderDirection) { - QueryInput_VotingPowers_OrderDirection["Asc"] = "asc"; - QueryInput_VotingPowers_OrderDirection["Desc"] = "desc"; -})(QueryInput_VotingPowers_OrderDirection || (exports.QueryInput_VotingPowers_OrderDirection = QueryInput_VotingPowers_OrderDirection = {})); -var Query_FeedEvents_Items_Items_Relevance; -(function (Query_FeedEvents_Items_Items_Relevance) { - Query_FeedEvents_Items_Items_Relevance["High"] = "HIGH"; - Query_FeedEvents_Items_Items_Relevance["Low"] = "LOW"; - Query_FeedEvents_Items_Items_Relevance["Medium"] = "MEDIUM"; -})(Query_FeedEvents_Items_Items_Relevance || (exports.Query_FeedEvents_Items_Items_Relevance = Query_FeedEvents_Items_Items_Relevance = {})); -var Query_FeedEvents_Items_Items_Type; -(function (Query_FeedEvents_Items_Items_Type) { - Query_FeedEvents_Items_Items_Type["Delegation"] = "DELEGATION"; - Query_FeedEvents_Items_Items_Type["Proposal"] = "PROPOSAL"; - Query_FeedEvents_Items_Items_Type["ProposalExtended"] = "PROPOSAL_EXTENDED"; - Query_FeedEvents_Items_Items_Type["Transfer"] = "TRANSFER"; - Query_FeedEvents_Items_Items_Type["Vote"] = "VOTE"; -})(Query_FeedEvents_Items_Items_Type || (exports.Query_FeedEvents_Items_Items_Type = Query_FeedEvents_Items_Items_Type = {})); -var Timestamp_Const; -(function (Timestamp_Const) { - Timestamp_Const["Timestamp"] = "timestamp"; -})(Timestamp_Const || (exports.Timestamp_Const = Timestamp_Const = {})); exports.GetDaOsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetDAOs" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "daos" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingDelay" } }, { "kind": "Field", "name": { "kind": "Name", "value": "chainId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "alreadySupportCalldataReview" } }, { "kind": "Field", "name": { "kind": "Name", "value": "supportOffchainData" } }] } }] } }] } }] }; -exports.ListOffchainProposalsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainProposals" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "NonNegativeInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "PositiveInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_offchainProposals_orderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "offchainProposals" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "status" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "endDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "discussion" } }, { "kind": "Field", "name": { "kind": "Name", "value": "link" } }, { "kind": "Field", "name": { "kind": "Name", "value": "state" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "end" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; -exports.ListOffchainVotesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainVotes" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "NonNegativeInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votesOffchain_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votesOffchain_orderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "votesOffchain" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "toDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "voterAddresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalTitle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "vp" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; -exports.ProposalNonVotersDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ProposalNonVoters" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposalNonVoters" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "addresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }] } }] } }] } }] }; -exports.GetProposalByIdDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetProposalById" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposal" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "daoId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposerAccountId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endTimestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "forVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "againstVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "abstainVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "txHash" } }] } }] } }] }; -exports.ListProposalsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListProposals" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "NonNegativeInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "PositiveInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_proposals_orderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromEndDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "includeOptimisticProposals" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_proposals_includeOptimisticProposals" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposals" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "status" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromEndDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromEndDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "includeOptimisticProposals" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "includeOptimisticProposals" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "daoId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposerAccountId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endTimestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "forVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "againstVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "abstainVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "txHash" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; -exports.GetEventRelevanceThresholdDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetEventRelevanceThreshold" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "relevance" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_getEventRelevanceThreshold_relevance" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "type" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_getEventRelevanceThreshold_type" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "getEventRelevanceThreshold" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "relevance" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "relevance" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "type" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "type" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "threshold" } }] } }] } }] }; -exports.ListVotesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListVotes" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddressIn" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "NonNegativeInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votes_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votes_orderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "support" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "votes" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "voterAddressIn" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddressIn" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "toDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "support" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "support" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "transactionHash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "voterAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "support" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalTitle" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; -exports.ListHistoricalVotingPowerDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListHistoricalVotingPower" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "PositiveInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "NonNegativeInt" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_historicalVotingPower_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_historicalVotingPower_orderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "historicalVotingPower" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "address" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }, { "kind": "Field", "name": { "kind": "Name", "value": "delta" } }, { "kind": "Field", "name": { "kind": "Name", "value": "daoId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactionHash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "logIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "delegation" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "from" } }, { "kind": "Field", "name": { "kind": "Name", "value": "to" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }, { "kind": "Field", "name": { "kind": "Name", "value": "previousDelegate" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "transfer" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "from" } }, { "kind": "Field", "name": { "kind": "Name", "value": "to" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; +exports.ListOffchainProposalsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainProposals" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_offchainProposals_status_items" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "offchainProposals" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "status" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "endDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "discussion" } }, { "kind": "Field", "name": { "kind": "Name", "value": "link" } }, { "kind": "Field", "name": { "kind": "Name", "value": "state" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "end" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; +exports.ListOffchainVotesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainVotes" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votesOffchain_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "votesOffchain" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "toDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "voterAddresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalTitle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "vp" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; +exports.ProposalNonVotersDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ProposalNonVoters" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposalNonVoters" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "addresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }] } }] } }] } }] }; +exports.GetProposalByIdDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetProposalById" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposal" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "OnchainProposal" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "daoId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposerAccountId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endTimestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "forVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "againstVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "abstainVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "txHash" } }] } }] } }] } }] }; +exports.ListProposalsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListProposals" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_proposals_status_items" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromEndDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "includeOptimisticProposals" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Boolean" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposals" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "status" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromEndDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromEndDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "includeOptimisticProposals" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "includeOptimisticProposals" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "daoId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposerAccountId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endBlock" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endTimestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "forVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "againstVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "abstainVotes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "txHash" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; +exports.GetEventRelevanceThresholdDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetEventRelevanceThreshold" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "relevance" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "FeedRelevance" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "type" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "FeedEventType" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "getEventRelevanceThreshold" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "relevance" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "relevance" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "type" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "type" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "threshold" } }] } }] } }] }; +exports.ListVotesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListVotes" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddressIn" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votes_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "support" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "votes" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "voterAddressIn" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddressIn" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "toDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "support" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "support" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "transactionHash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "voterAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "support" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalTitle" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; +exports.ListHistoricalVotingPowerDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListHistoricalVotingPower" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_historicalVotingPower_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "historicalVotingPower" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "address" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accountId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }, { "kind": "Field", "name": { "kind": "Name", "value": "delta" } }, { "kind": "Field", "name": { "kind": "Name", "value": "daoId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactionHash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "logIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "delegation" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "from" } }, { "kind": "Field", "name": { "kind": "Name", "value": "to" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }, { "kind": "Field", "name": { "kind": "Name", "value": "previousDelegate" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "transfer" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "from" } }, { "kind": "Field", "name": { "kind": "Name", "value": "to" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; diff --git a/packages/anticapture-client/dist/index.d.ts b/packages/anticapture-client/dist/index.d.ts index 83cbf673..3a75d58c 100644 --- a/packages/anticapture-client/dist/index.d.ts +++ b/packages/anticapture-client/dist/index.d.ts @@ -1,6 +1,6 @@ export { AnticaptureClient } from './anticapture-client'; export type { VoteWithDaoId, OffchainVoteWithDaoId } from './anticapture-client'; export type { GetDaOsQuery, GetProposalByIdQuery, GetProposalByIdQueryVariables, ListProposalsQuery, ListProposalsQueryVariables, ListVotesQuery, ListVotesQueryVariables, ListHistoricalVotingPowerQuery, ListHistoricalVotingPowerQueryVariables } from './gql/graphql'; -export { QueryInput_Proposals_OrderDirection, QueryInput_HistoricalVotingPower_OrderBy, QueryInput_HistoricalVotingPower_OrderDirection, QueryInput_Votes_OrderBy, QueryInput_Votes_OrderDirection, QueryInput_VotesOffchain_OrderBy, QueryInput_VotesOffchain_OrderDirection } from './gql/graphql'; +export { OrderDirection, QueryInput_HistoricalVotingPower_OrderBy, QueryInput_Proposals_Status_Items, QueryInput_Votes_OrderBy, QueryInput_VotesOffchain_OrderBy, } from './gql/graphql'; export { FeedEventType, FeedRelevance } from './schemas'; export type { ProcessedVotingPowerHistory, OffchainProposalItem, OffchainVoteItem } from './schemas'; diff --git a/packages/anticapture-client/dist/index.js b/packages/anticapture-client/dist/index.js index c4edba74..6e1a9d84 100644 --- a/packages/anticapture-client/dist/index.js +++ b/packages/anticapture-client/dist/index.js @@ -1,17 +1,15 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.FeedRelevance = exports.FeedEventType = exports.QueryInput_VotesOffchain_OrderDirection = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_Votes_OrderDirection = exports.QueryInput_Votes_OrderBy = exports.QueryInput_HistoricalVotingPower_OrderDirection = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.QueryInput_Proposals_OrderDirection = exports.AnticaptureClient = void 0; +exports.FeedRelevance = exports.FeedEventType = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_Votes_OrderBy = exports.QueryInput_Proposals_Status_Items = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.OrderDirection = exports.AnticaptureClient = void 0; var anticapture_client_1 = require("./anticapture-client"); Object.defineProperty(exports, "AnticaptureClient", { enumerable: true, get: function () { return anticapture_client_1.AnticaptureClient; } }); // Export GraphQL enums var graphql_1 = require("./gql/graphql"); -Object.defineProperty(exports, "QueryInput_Proposals_OrderDirection", { enumerable: true, get: function () { return graphql_1.QueryInput_Proposals_OrderDirection; } }); +Object.defineProperty(exports, "OrderDirection", { enumerable: true, get: function () { return graphql_1.OrderDirection; } }); Object.defineProperty(exports, "QueryInput_HistoricalVotingPower_OrderBy", { enumerable: true, get: function () { return graphql_1.QueryInput_HistoricalVotingPower_OrderBy; } }); -Object.defineProperty(exports, "QueryInput_HistoricalVotingPower_OrderDirection", { enumerable: true, get: function () { return graphql_1.QueryInput_HistoricalVotingPower_OrderDirection; } }); +Object.defineProperty(exports, "QueryInput_Proposals_Status_Items", { enumerable: true, get: function () { return graphql_1.QueryInput_Proposals_Status_Items; } }); Object.defineProperty(exports, "QueryInput_Votes_OrderBy", { enumerable: true, get: function () { return graphql_1.QueryInput_Votes_OrderBy; } }); -Object.defineProperty(exports, "QueryInput_Votes_OrderDirection", { enumerable: true, get: function () { return graphql_1.QueryInput_Votes_OrderDirection; } }); Object.defineProperty(exports, "QueryInput_VotesOffchain_OrderBy", { enumerable: true, get: function () { return graphql_1.QueryInput_VotesOffchain_OrderBy; } }); -Object.defineProperty(exports, "QueryInput_VotesOffchain_OrderDirection", { enumerable: true, get: function () { return graphql_1.QueryInput_VotesOffchain_OrderDirection; } }); var schemas_1 = require("./schemas"); Object.defineProperty(exports, "FeedEventType", { enumerable: true, get: function () { return schemas_1.FeedEventType; } }); Object.defineProperty(exports, "FeedRelevance", { enumerable: true, get: function () { return schemas_1.FeedRelevance; } }); diff --git a/packages/anticapture-client/dist/schemas.d.ts b/packages/anticapture-client/dist/schemas.d.ts index d165bb82..bccf7d85 100644 --- a/packages/anticapture-client/dist/schemas.d.ts +++ b/packages/anticapture-client/dist/schemas.d.ts @@ -1,5 +1,5 @@ import { z } from 'zod'; -export { QueryInput_GetEventRelevanceThreshold_Type as FeedEventType, QueryInput_GetEventRelevanceThreshold_Relevance as FeedRelevance, } from './gql/graphql'; +export { FeedEventType, FeedRelevance, } from './gql/graphql'; export declare const SafeDaosResponseSchema: z.ZodEffects>; votingPower: z.ZodString; timestamp: z.ZodNumber; reason: z.ZodOptional>; - proposalTitle: z.ZodString; + proposalTitle: z.ZodOptional>; }, "strip", z.ZodTypeAny, { timestamp: number; votingPower: string; - support: number; proposalId: string; - proposalTitle: string; transactionHash: string; voterAddress: string; + support?: string | null | undefined; + proposalTitle?: string | null | undefined; reason?: string | null | undefined; }, { timestamp: number; votingPower: string; - support: number; proposalId: string; - proposalTitle: string; transactionHash: string; voterAddress: string; + support?: string | null | undefined; + proposalTitle?: string | null | undefined; reason?: string | null | undefined; }>>, "many">; totalCount: z.ZodNumber; @@ -450,11 +450,11 @@ export declare const SafeVotesResponseSchema: z.ZodEffects parseInt(b?.endTimestamp || '0') - parseInt(a?.endTimestamp || '0')); + allProposals.sort((a, b) => (b?.endTimestamp ?? 0) - (a?.endTimestamp ?? 0)); } else { - allProposals.sort((a, b) => parseInt(b?.timestamp || '0') - parseInt(a?.timestamp || '0') || 0); + allProposals.sort((a, b) => (b?.timestamp ?? 0) - (a?.timestamp ?? 0)); } return allProposals; @@ -327,7 +327,7 @@ export class AnticaptureClient { fromDate: parseInt(timestampGt), limit, orderBy: QueryInput_Votes_OrderBy.Timestamp, - orderDirection: QueryInput_Votes_OrderDirection.Asc + orderDirection: OrderDirection.Asc }); // Add daoId to each vote return votes.map(vote => ({ @@ -460,7 +460,7 @@ export class AnticaptureClient { fromDate, limit, orderBy: QueryInput_VotesOffchain_OrderBy.Timestamp, - orderDirection: QueryInput_VotesOffchain_OrderDirection.Asc + orderDirection: OrderDirection.Asc }); return votes.map(vote => ({ ...vote, diff --git a/packages/anticapture-client/src/gql/gql.ts b/packages/anticapture-client/src/gql/gql.ts index d00f912d..5043eb3a 100644 --- a/packages/anticapture-client/src/gql/gql.ts +++ b/packages/anticapture-client/src/gql/gql.ts @@ -15,23 +15,23 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document- */ type Documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": typeof types.GetDaOsDocument, - "query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": typeof types.ListOffchainProposalsDocument, - "query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": typeof types.ListOffchainVotesDocument, - "query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": typeof types.ProposalNonVotersDocument, - "query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": typeof types.GetProposalByIdDocument, - "query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": typeof types.GetEventRelevanceThresholdDocument, - "query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": typeof types.ListVotesDocument, - "query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": typeof types.ListHistoricalVotingPowerDocument, + "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": typeof types.ListOffchainProposalsDocument, + "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": typeof types.ListOffchainVotesDocument, + "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": typeof types.ProposalNonVotersDocument, + "query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": typeof types.GetProposalByIdDocument, + "query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": typeof types.GetEventRelevanceThresholdDocument, + "query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": typeof types.ListVotesDocument, + "query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": typeof types.ListHistoricalVotingPowerDocument, }; const documents: Documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": types.GetDaOsDocument, - "query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": types.ListOffchainProposalsDocument, - "query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": types.ListOffchainVotesDocument, - "query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": types.ProposalNonVotersDocument, - "query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": types.GetProposalByIdDocument, - "query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": types.GetEventRelevanceThresholdDocument, - "query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": types.ListVotesDocument, - "query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": types.ListHistoricalVotingPowerDocument, + "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": types.ListOffchainProposalsDocument, + "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": types.ListOffchainVotesDocument, + "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": types.ProposalNonVotersDocument, + "query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}": types.GetProposalByIdDocument, + "query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}": types.GetEventRelevanceThresholdDocument, + "query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}": types.ListVotesDocument, + "query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}": types.ListHistoricalVotingPowerDocument, }; /** @@ -55,31 +55,31 @@ export function graphql(source: "query GetDAOs {\n daos {\n items {\n i /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_offchainProposals_orderDirection, $status: JSON, $fromDate: Float, $endDate: Float) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"]; +export function graphql(source: "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainVotes($fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: queryInput_votesOffchain_orderDirection, $voterAddresses: JSON) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"]; +export function graphql(source: "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"): (typeof documents)["query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"): (typeof documents)["query ProposalNonVoters($id: String!, $addresses: JSON) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"]; +export function graphql(source: "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"): (typeof documents)["query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"): (typeof documents)["query GetProposalById($id: String!) {\n proposal(id: $id) {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n}\n\nquery ListProposals($skip: NonNegativeInt, $limit: PositiveInt, $orderDirection: queryInput_proposals_orderDirection, $status: JSON, $fromDate: Float, $fromEndDate: Float, $includeOptimisticProposals: queryInput_proposals_includeOptimisticProposals) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"]; +export function graphql(source: "query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"): (typeof documents)["query GetProposalById($id: String!) {\n proposal(id: $id) {\n ... on OnchainProposal {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n }\n}\n\nquery ListProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_proposals_status_items], $fromDate: Int, $fromEndDate: Int, $includeOptimisticProposals: Boolean) {\n proposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n fromEndDate: $fromEndDate\n includeOptimisticProposals: $includeOptimisticProposals\n ) {\n items {\n id\n daoId\n proposerAccountId\n title\n description\n startBlock\n endBlock\n endTimestamp\n timestamp\n status\n forVotes\n againstVotes\n abstainVotes\n txHash\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"): (typeof documents)["query GetEventRelevanceThreshold($relevance: queryInput_getEventRelevanceThreshold_relevance!, $type: queryInput_getEventRelevanceThreshold_type!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"]; +export function graphql(source: "query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"): (typeof documents)["query GetEventRelevanceThreshold($relevance: FeedRelevance!, $type: FeedEventType!) {\n getEventRelevanceThreshold(relevance: $relevance, type: $type) {\n threshold\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"): (typeof documents)["query ListVotes($voterAddressIn: JSON, $fromDate: Float, $toDate: Float, $limit: Float, $skip: NonNegativeInt, $orderBy: queryInput_votes_orderBy, $orderDirection: queryInput_votes_orderDirection, $support: Float) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"]; +export function graphql(source: "query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"): (typeof documents)["query ListVotes($voterAddressIn: [String], $fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votes_orderBy, $orderDirection: OrderDirection, $support: String) {\n votes(\n voterAddressIn: $voterAddressIn\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n support: $support\n ) {\n items {\n transactionHash\n proposalId\n voterAddress\n support\n votingPower\n timestamp\n reason\n proposalTitle\n }\n totalCount\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"): (typeof documents)["query ListHistoricalVotingPower($limit: PositiveInt, $skip: NonNegativeInt, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: queryInput_historicalVotingPower_orderDirection, $fromDate: String, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"]; +export function graphql(source: "query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"): (typeof documents)["query ListHistoricalVotingPower($limit: Int, $skip: Int, $orderBy: queryInput_historicalVotingPower_orderBy, $orderDirection: OrderDirection, $fromDate: Int, $address: String) {\n historicalVotingPower(\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n fromDate: $fromDate\n address: $address\n ) {\n items {\n accountId\n timestamp\n votingPower\n delta\n daoId\n transactionHash\n logIndex\n delegation {\n from\n to\n value\n previousDelegate\n }\n transfer {\n from\n to\n value\n }\n }\n totalCount\n }\n}"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; diff --git a/packages/anticapture-client/src/gql/graphql.ts b/packages/anticapture-client/src/gql/graphql.ts index 0a98d117..089eeb96 100644 --- a/packages/anticapture-client/src/gql/graphql.ts +++ b/packages/anticapture-client/src/gql/graphql.ts @@ -14,13 +14,92 @@ export type Scalars = { Boolean: { input: boolean; output: boolean; } Int: { input: number; output: number; } Float: { input: number; output: number; } + /** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */ + DateTime: { input: any; output: any; } /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ JSON: { input: any; output: any; } - /** Integers that will have a value of 0 or more. */ - NonNegativeInt: { input: any; output: any; } ObjMap: { input: any; output: any; } - /** Integers that will have a value greater than 0. */ - PositiveInt: { input: any; output: any; } + /** A field whose value conforms to the standard URL format as specified in RFC3986: https://www.ietf.org/rfc/rfc3986.txt. */ + URL: { input: any; output: any; } +}; + +/** Balance delta for a single account across two timestamps. */ +export type AccountBalanceVariation = { + __typename?: 'AccountBalanceVariation'; + /** Absolute balance change encoded as a decimal string. */ + absoluteChange: Scalars['String']['output']; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Balance at the end of the comparison window. */ + currentBalance: Scalars['String']['output']; + /** Relative balance change encoded as a decimal string. */ + percentageChange: Scalars['String']['output']; + /** Balance at the start of the comparison window. */ + previousBalance: Scalars['String']['output']; +}; + +/** Balance variation response for a single account. */ +export type AccountBalanceVariationsByAccountIdResponse = { + __typename?: 'AccountBalanceVariationsByAccountIdResponse'; + data: AccountBalanceVariation; + period: PeriodResponse; +}; + +/** List of balance variations for multiple accounts in the selected period. */ +export type AccountBalanceVariationsResponse = { + __typename?: 'AccountBalanceVariationsResponse'; + items: Array>; + period: PeriodResponse; +}; + +export type AccountBalanceWithVariation = { + __typename?: 'AccountBalanceWithVariation'; + address: Scalars['String']['output']; + balance: Scalars['String']['output']; + delegate: Scalars['String']['output']; + tokenId: Scalars['String']['output']; + variation: AccountBalanceVariation; +}; + +export type AccountBalanceWithVariationResponse = { + __typename?: 'AccountBalanceWithVariationResponse'; + data: AccountBalanceWithVariation; + period: PeriodResponse; +}; + +export type AccountBalancesWithVariationResponse = { + __typename?: 'AccountBalancesWithVariationResponse'; + items: Array>; + period: PeriodResponse; + totalCount: Scalars['Int']['output']; +}; + +/** Aggregated interaction metrics between the requested account and another account. */ +export type AccountInteraction = { + __typename?: 'AccountInteraction'; + /** Counterparty account ID. */ + accountId: Scalars['String']['output']; + /** Net amount transferred between the requested account and the counterparty. */ + amountTransferred: Scalars['String']['output']; + /** Gross transfer volume between the requested account and the counterparty. */ + totalVolume: Scalars['String']['output']; + /** Number of transfers observed for the interaction pair. */ + transferCount: Scalars['String']['output']; +}; + +/** Paginated list of account interaction aggregates. */ +export type AccountInteractionsResponse = { + __typename?: 'AccountInteractionsResponse'; + items: Array>; + period: PeriodResponse; + totalCount: Scalars['Int']['output']; +}; + +/** Active token supply for the selected comparison window. */ +export type ActiveSupplyResponse = { + __typename?: 'ActiveSupplyResponse'; + /** Active token supply encoded as a decimal string. */ + activeSupply: Scalars['String']['output']; }; export type AverageDelegationPercentageItem = { @@ -40,9 +119,147 @@ export type AverageDelegationPercentagePage = { totalCount: Scalars['Int']['output']; }; +/** Average turnout comparison between two adjacent time windows. */ +export type AverageTurnoutComparisonResponse = { + __typename?: 'AverageTurnoutComparisonResponse'; + /** Relative change between current and previous periods. */ + changeRate: Scalars['Float']['output']; + /** Average turnout for the current period encoded as a string. */ + currentAverageTurnout: Scalars['String']['output']; + /** Average turnout for the previous period encoded as a string. */ + oldAverageTurnout: Scalars['String']['output']; +}; + export type DaoList = { __typename?: 'DAOList'; - items: Array; + items: Array; + totalCount: Scalars['Int']['output']; +}; + +/** Current governance parameters and feature flags for the active DAO. */ +export type DaoResponse = { + __typename?: 'DaoResponse'; + alreadySupportCalldataReview: Scalars['Boolean']['output']; + chainId: Scalars['Int']['output']; + id: Scalars['String']['output']; + proposalThreshold: Scalars['String']['output']; + quorum: Scalars['String']['output']; + supportOffchainData: Scalars['Boolean']['output']; + timelockDelay: Scalars['String']['output']; + votingDelay: Scalars['String']['output']; + votingPeriod: Scalars['String']['output']; +}; + +export enum DaysWindow { + '7d' = '_7d', + '30d' = '_30d', + '90d' = '_90d', + '180d' = '_180d', + '365d' = '_365d' +} + +/** Single delegation transfer event in the historical delegation feed. */ +export type DelegationItem = { + __typename?: 'DelegationItem'; + amount: Scalars['String']['output']; + delegateAddress: Scalars['String']['output']; + delegatorAddress: Scalars['String']['output']; + timestamp: Scalars['String']['output']; + transactionHash: Scalars['String']['output']; +}; + +export type DelegationPercentageItem = { + __typename?: 'DelegationPercentageItem'; + /** Unix day bucket represented as a timestamp string. */ + date: Scalars['String']['output']; + /** Delegation percentage value for the day bucket. */ + high: Scalars['String']['output']; +}; + +export type DelegationPercentageResponse = { + __typename?: 'DelegationPercentageResponse'; + items: Array>; + pageInfo: PageInfo; + /** Total number of matching day buckets. */ + totalCount: Scalars['Int']['output']; +}; + +/** Paginated historical delegations response. */ +export type DelegationsResponse = { + __typename?: 'DelegationsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + +/** Aggregated delegation amount and latest timestamp for one delegator. */ +export type DelegatorItem = { + __typename?: 'DelegatorItem'; + amount: Scalars['String']['output']; + delegatorAddress: Scalars['String']['output']; + timestamp: Scalars['String']['output']; +}; + +/** Paginated delegators for a delegate address. */ +export type DelegatorsResponse = { + __typename?: 'DelegatorsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + +/** Generic error payload returned by the API. */ +export type ErrorResponse = { + __typename?: 'ErrorResponse'; + /** Human-readable error message */ + error: Scalars['String']['output']; + /** Optional implementation detail or validation context for the error. */ + message?: Maybe; +}; + +/** Resolved threshold for a feed event type and relevance level. */ +export type EventRelevanceThresholdResponse = { + __typename?: 'EventRelevanceThresholdResponse'; + /** Threshold value encoded as a decimal string. */ + threshold: Scalars['String']['output']; +}; + +/** Filter events by governance activity type. */ +export enum FeedEventType { + Delegation = 'DELEGATION', + Proposal = 'PROPOSAL', + ProposalExtended = 'PROPOSAL_EXTENDED', + Transfer = 'TRANSFER', + Vote = 'VOTE' +} + +/** Single event in the governance activity feed. */ +export type FeedItem = { + __typename?: 'FeedItem'; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Type-specific metadata for the feed event. */ + metadata?: Maybe; + relevance: FeedRelevance; + /** Event timestamp in Unix seconds. */ + timestamp: Scalars['Int']['output']; + /** Transaction hash. */ + txHash: Scalars['String']['output']; + type: FeedEventType; + /** Optional event value encoded as a decimal string when applicable. */ + value?: Maybe; +}; + +/** Filter events by relevance tier. */ +export enum FeedRelevance { + High = 'HIGH', + Low = 'LOW', + Medium = 'MEDIUM' +} + +/** Paginated governance activity feed response. */ +export type FeedResponse = { + __typename?: 'FeedResponse'; + items: Array>; + /** Total number of matching feed events. */ totalCount: Scalars['Int']['output']; }; @@ -58,6 +275,235 @@ export enum HttpMethod { Trace = 'TRACE' } +/** Single historical balance record enriched with transfer context. */ +export type HistoricalBalance = { + __typename?: 'HistoricalBalance'; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Account balance after the historical event. */ + balance: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Balance change introduced by the historical event. */ + delta: Scalars['String']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Event timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; + transfer: HistoricalBalanceTransfer; +}; + +/** Transfer event associated with a historical balance row. */ +export type HistoricalBalanceTransfer = { + __typename?: 'HistoricalBalanceTransfer'; + /** Sender address. */ + from: Scalars['String']['output']; + /** Recipient address. */ + to: Scalars['String']['output']; + /** Transferred amount encoded as a decimal string. */ + value: Scalars['String']['output']; +}; + +/** Paginated historical balance records for one account. */ +export type HistoricalBalancesResponse = { + __typename?: 'HistoricalBalancesResponse'; + items: Array>; + /** Total number of matching historical balance rows. */ + totalCount: Scalars['Int']['output']; +}; + +/** Single historical voting power record enriched with delegation and transfer context. */ +export type HistoricalVotingPower = { + __typename?: 'HistoricalVotingPower'; + /** Account address. */ + accountId: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + delegation?: Maybe; + /** Voting power change introduced by the event. */ + delta: Scalars['String']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Event timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; + transfer?: Maybe; + /** Voting power after the event, encoded as a decimal string. */ + votingPower: Scalars['String']['output']; +}; + +/** Delegation event associated with a historical voting power row. */ +export type HistoricalVotingPowerDelegation = { + __typename?: 'HistoricalVotingPowerDelegation'; + from: Scalars['String']['output']; + previousDelegate?: Maybe; + to: Scalars['String']['output']; + value: Scalars['String']['output']; +}; + +/** Transfer event associated with a historical voting power row. */ +export type HistoricalVotingPowerTransfer = { + __typename?: 'HistoricalVotingPowerTransfer'; + from: Scalars['String']['output']; + to: Scalars['String']['output']; + value: Scalars['String']['output']; +}; + +/** Paginated historical voting power records. */ +export type HistoricalVotingPowersResponse = { + __typename?: 'HistoricalVotingPowersResponse'; + items: Array>; + /** Total number of matching historical voting power rows. */ + totalCount: Scalars['Int']['output']; +}; + +/** Response payload describing the latest update time for a chart. */ +export type LastUpdateResponse = { + __typename?: 'LastUpdateResponse'; + /** Latest refresh time in ISO-8601 format. */ + lastUpdate: Scalars['DateTime']['output']; +}; + +export type OffchainProposal = { + __typename?: 'OffchainProposal'; + /** Address or ENS of the author. */ + author: Scalars['String']['output']; + /** Proposal body. */ + body: Scalars['String']['output']; + choices: Array>; + /** Creation timestamp in Unix seconds. */ + created: Scalars['Int']['output']; + /** Discussion URL or thread reference. */ + discussion: Scalars['String']['output']; + /** Voting end timestamp in Unix seconds. */ + end: Scalars['Int']['output']; + /** Whether the proposal was flagged by Snapshot. */ + flagged: Scalars['Boolean']['output']; + /** Snapshot proposal identifier. */ + id: Scalars['String']['output']; + /** Canonical Snapshot proposal URL. */ + link: Scalars['String']['output']; + network: Scalars['String']['output']; + scores: Array>; + snapshot?: Maybe; + /** Snapshot space identifier. */ + spaceId: Scalars['String']['output']; + /** Voting start timestamp in Unix seconds. */ + start: Scalars['Int']['output']; + /** Current Snapshot proposal state. */ + state: Scalars['String']['output']; + strategies: Array>; + /** Proposal title. */ + title: Scalars['String']['output']; + /** Snapshot proposal type. */ + type: Scalars['String']['output']; + /** Last update timestamp in Unix seconds. */ + updated: Scalars['Int']['output']; +}; + +export type OffchainProposalsResponse = { + __typename?: 'OffchainProposalsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + +export type OffchainVote = { + __typename?: 'OffchainVote'; + choice: Array>; + created: Scalars['Int']['output']; + proposalId: Scalars['String']['output']; + proposalTitle?: Maybe; + reason: Scalars['String']['output']; + voter: Scalars['String']['output']; + vp?: Maybe; +}; + +export type OffchainVotesResponse = { + __typename?: 'OffchainVotesResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + +export type OnchainProposal = { + __typename?: 'OnchainProposal'; + /** Abstain votes, encoded as a decimal string. */ + abstainVotes: Scalars['String']['output']; + /** Votes cast against, encoded as a decimal string. */ + againstVotes: Scalars['String']['output']; + /** Encoded calldata payloads executed by the proposal. */ + calldatas: Array>; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Proposal body. */ + description: Scalars['String']['output']; + /** End block number. */ + endBlock: Scalars['Int']['output']; + /** Proposal end timestamp in Unix seconds. */ + endTimestamp: Scalars['Int']['output']; + /** Votes cast in favor, encoded as a decimal string. */ + forVotes: Scalars['String']['output']; + /** Onchain proposal identifier. */ + id: Scalars['String']['output']; + /** Optional proposal type discriminator. */ + proposalType?: Maybe; + /** Address that created the proposal. */ + proposerAccountId: Scalars['String']['output']; + /** Required quorum encoded as a decimal string. */ + quorum: Scalars['String']['output']; + /** Start block number. */ + startBlock: Scalars['Int']['output']; + /** Proposal start timestamp in Unix seconds. */ + startTimestamp: Scalars['Int']['output']; + /** Current proposal status. */ + status: Scalars['String']['output']; + /** Contract targets invoked by the proposal. */ + targets: Array>; + /** Proposal creation timestamp in Unix seconds. */ + timestamp: Scalars['Int']['output']; + /** Proposal title. */ + title: Scalars['String']['output']; + /** Proposal creation transaction hash. */ + txHash: Scalars['String']['output']; + /** ETH values attached to each call, encoded as strings. */ + values: Array>; +}; + +export type OnchainProposalsResponse = { + __typename?: 'OnchainProposalsResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + +export type OnchainVote = { + __typename?: 'OnchainVote'; + proposalId: Scalars['String']['output']; + proposalTitle?: Maybe; + reason?: Maybe; + /** Governance vote direction. */ + support?: Maybe; + /** Vote timestamp in Unix seconds. */ + timestamp: Scalars['Int']['output']; + transactionHash: Scalars['String']['output']; + voterAddress: Scalars['String']['output']; + /** Voting power encoded as a decimal string. */ + votingPower: Scalars['String']['output']; +}; + +export type OnchainVotesResponse = { + __typename?: 'OnchainVotesResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + +/** Sort direction for ordered query results. */ +export enum OrderDirection { + Asc = 'asc', + Desc = 'desc' +} + export type PageInfo = { __typename?: 'PageInfo'; endDate?: Maybe; @@ -66,21 +512,114 @@ export type PageInfo = { startDate?: Maybe; }; +/** Inclusive time period represented as ISO-8601 timestamps. */ +export type PeriodResponse = { + __typename?: 'PeriodResponse'; + endTimestamp: Scalars['String']['output']; + startTimestamp: Scalars['String']['output']; +}; + +/** Combined proposal and delegate vote context for one activity row. */ +export type ProposalActivityItem = { + __typename?: 'ProposalActivityItem'; + proposal: ProposalActivityProposal; + userVote?: Maybe; +}; + +/** Proposal snapshot included in the delegate activity response. */ +export type ProposalActivityProposal = { + __typename?: 'ProposalActivityProposal'; + /** Abstain votes, encoded as a decimal string. */ + abstainVotes: Scalars['String']['output']; + /** Votes cast against, encoded as a decimal string. */ + againstVotes: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Proposal body. */ + description: Scalars['String']['output']; + /** End block number. */ + endBlock: Scalars['Float']['output']; + /** Votes cast in favor, encoded as a decimal string. */ + forVotes: Scalars['String']['output']; + /** Onchain proposal identifier. */ + id: Scalars['String']['output']; + /** Address that created the proposal. */ + proposerAccountId: Scalars['String']['output']; + /** Start block number. */ + startBlock: Scalars['Float']['output']; + /** Current proposal status. */ + status: Scalars['String']['output']; + /** Proposal creation timestamp in Unix seconds as a string. */ + timestamp?: Maybe; + /** Proposal title. */ + title: Scalars['String']['output']; +}; + +/** Delegate proposal activity metrics and proposal-by-proposal history. */ +export type ProposalActivityResponse = { + __typename?: 'ProposalActivityResponse'; + /** Delegate address. */ + address: Scalars['String']['output']; + /** Average seconds between the delegate vote and proposal end time. */ + avgTimeBeforeEnd: Scalars['Float']['output']; + /** Whether the delegate never cast a vote. */ + neverVoted: Scalars['Boolean']['output']; + proposals: Array>; + /** Total proposals reviewed in the dataset. */ + totalProposals: Scalars['Int']['output']; + /** Number of proposals the delegate voted on. */ + votedProposals: Scalars['Int']['output']; + /** Share of proposals where the delegate sided with outcome. */ + winRate: Scalars['Float']['output']; + /** Share of delegate votes cast in support. */ + yesRate: Scalars['Float']['output']; +}; + +/** Vote cast by the requested delegate for a given proposal. */ +export type ProposalActivityUserVote = { + __typename?: 'ProposalActivityUserVote'; + /** Vote identifier. */ + id: Scalars['String']['output']; + /** Related proposal ID. */ + proposalId: Scalars['String']['output']; + /** Optional vote rationale. */ + reason?: Maybe; + /** Governance vote direction. */ + support: Scalars['String']['output']; + /** Vote timestamp in Unix seconds as a string. */ + timestamp?: Maybe; + /** Address that cast the vote. */ + voterAccountId: Scalars['String']['output']; + /** Voting power used by the delegate, encoded as a string. */ + votingPower?: Maybe; +}; + +/** Proposal launch comparison between two adjacent time windows. */ +export type ProposalsComparisonResponse = { + __typename?: 'ProposalsComparisonResponse'; + /** Relative change between current and previous periods. */ + changeRate: Scalars['Float']['output']; + /** Number of proposals launched in the current period. */ + currentProposalsLaunched: Scalars['Int']['output']; + /** Number of proposals launched in the comparison period. */ + oldProposalsLaunched: Scalars['Int']['output']; +}; + export type Query = { __typename?: 'Query'; /** Returns account balance information for a specific address */ - accountBalanceByAccountId?: Maybe; + accountBalanceByAccountId?: Maybe; /** Returns a mapping of the biggest variations to account balances associated by account address */ - accountBalanceVariations?: Maybe; + accountBalanceVariations?: Maybe; /** Returns a the changes to balance by period and accountId */ - accountBalanceVariationsByAccountId?: Maybe; + accountBalanceVariationsByAccountId?: Maybe; /** Returns sorted and paginated account balance records */ - accountBalances?: Maybe; + accountBalances?: Maybe; /** * Returns a mapping of the largest interactions between accounts. * Positive amounts signify net token transfers FROM
, whilst negative amounts refer to net transfers TO
*/ - accountInteractions?: Maybe; + accountInteractions?: Maybe; /** * Average delegation percentage across all supported DAOs by day. * Returns the mean delegation percentage for each day in the specified range. @@ -88,137 +627,139 @@ export type Query = { */ averageDelegationPercentageByDay: AverageDelegationPercentagePage; /** Get active token supply for DAO */ - compareActiveSupply?: Maybe; + compareActiveSupply?: Maybe; /** Compare average turnout between time periods */ - compareAverageTurnout?: Maybe; + compareAverageTurnout?: Maybe; /** Compare cex supply between periods */ - compareCexSupply?: Maybe; + compareCexSupply?: Maybe; /** Compare circulating supply between periods */ - compareCirculatingSupply?: Maybe; + compareCirculatingSupply?: Maybe; /** Compare delegated supply between periods */ - compareDelegatedSupply?: Maybe; + compareDelegatedSupply?: Maybe; /** Compare dex supply between periods */ - compareDexSupply?: Maybe; + compareDexSupply?: Maybe; /** Compare lending supply between periods */ - compareLendingSupply?: Maybe; + compareLendingSupply?: Maybe; /** Compare number of proposals between time periods */ - compareProposals?: Maybe; + compareProposals?: Maybe; /** Compare total supply between periods */ - compareTotalSupply?: Maybe; + compareTotalSupply?: Maybe; /** Compare treasury between periods */ - compareTreasury?: Maybe; + compareTreasury?: Maybe; /** Compare number of votes between time periods */ - compareVotes?: Maybe; + compareVotes?: Maybe; /** Returns current governance parameters for this DAO */ - dao?: Maybe; + dao?: Maybe; /** Get all DAOs */ daos: DaoList; /** Get delegation percentage day buckets with forward-fill */ - delegationPercentageByDay?: Maybe; + delegationPercentageByDay?: Maybe; /** Get current delegations for an account */ - delegations?: Maybe; + delegations?: Maybe; /** Get current delegators of an account with voting power */ - delegators?: Maybe; + delegators?: Maybe; /** Get feed events */ - feedEvents?: Maybe; + feedEvents?: Maybe; /** Returns label information from Arkham, ENS data, and whether the address is an EOA or contract. Arkham data is stored permanently. ENS data is cached with a configurable TTL. */ getAddress?: Maybe; /** Returns label information from Arkham, ENS data, and address type for multiple addresses. Maximum 100 addresses per request. Arkham data is stored permanently. ENS data is cached with a configurable TTL. */ getAddresses?: Maybe; /** Get historical DAO Token Treasury value (governance token quantity × token price) */ - getDaoTokenTreasury?: Maybe; + getDaoTokenTreasury?: Maybe; /** Get event relevance threshold */ - getEventRelevanceThreshold?: Maybe; + getEventRelevanceThreshold?: Maybe; /** Get historical Liquid Treasury (treasury without DAO tokens) from external providers (DefiLlama/Dune) */ - getLiquidTreasury?: Maybe; + getLiquidTreasury?: Maybe; /** Get historical Total Treasury (liquid treasury + DAO token treasury) */ - getTotalTreasury?: Maybe; - /** TODO */ - historicalBalances?: Maybe; + getTotalTreasury?: Maybe; + /** Check API and database health */ + health?: Maybe; + /** Returns historical balance deltas for one account, enriched with the transfer that caused each change. */ + historicalBalances?: Maybe; /** Get historical delegations for an account, with optional filtering and sorting */ - historicalDelegations?: Maybe; + historicalDelegations?: Maybe; /** Get historical market data for a specific token */ - historicalTokenData?: Maybe>>; + historicalTokenData?: Maybe>>; /** Returns a list of voting power changes. */ - historicalVotingPower?: Maybe; + historicalVotingPower?: Maybe; /** Returns a list of voting power changes for a specific account */ - historicalVotingPowerByAccountId?: Maybe; + historicalVotingPowerByAccountId?: Maybe; /** Get the last update time */ - lastUpdate?: Maybe; + lastUpdate?: Maybe; /** Returns a single offchain (Snapshot) proposal by its ID */ - offchainProposalById?: Maybe; + offchainProposalById?: Maybe; /** Returns a list of offchain (Snapshot) proposals */ - offchainProposals?: Maybe; + offchainProposals?: Maybe; /** Returns a single proposal by its ID */ - proposal?: Maybe; + proposal?: Maybe; /** Returns the active delegates that did not vote on a given proposal */ - proposalNonVoters?: Maybe; + proposalNonVoters?: Maybe; /** Returns a list of proposal */ - proposals?: Maybe; + proposals?: Maybe; /** Returns proposal activity data including voting history, win rates, and detailed proposal information for the specified delegate within the given time window */ - proposalsActivity?: Maybe; + proposalsActivity?: Maybe; /** Get property data for a specific token */ - token?: Maybe; + token?: Maybe; /** Returns token related metrics for a single metric type. */ - tokenMetrics?: Maybe; + tokenMetrics?: Maybe; /** Get transactions with their associated transfers and delegations, with optional filtering and sorting */ - transactions?: Maybe; + transactions?: Maybe; /** Get transfers of a given address */ - transfers?: Maybe; + transfers?: Maybe; /** Get all votes ordered by timestamp or voting power */ - votes?: Maybe; + votes?: Maybe; /** Returns a paginated list of votes cast on a specific proposal */ - votesByProposalId?: Maybe; + votesByProposalId?: Maybe; /** Returns a list of offchain (Snapshot) votes */ - votesOffchain?: Maybe; + votesOffchain?: Maybe; /** Returns a paginated list of offchain (Snapshot) votes for a specific proposal */ - votesOffchainByProposalId?: Maybe; + votesOffchainByProposalId?: Maybe; /** Returns voting power information for a specific address (account) */ - votingPowerByAccountId?: Maybe; + votingPowerByAccountId?: Maybe; /** Returns a mapping of the voting power changes within a time frame for the given addresses */ - votingPowerVariations?: Maybe; + votingPowerVariations?: Maybe; /** Returns a the changes to voting power by period and accountId */ - votingPowerVariationsByAccountId?: Maybe; + votingPowerVariationsByAccountId?: Maybe; /** Returns sorted and paginated account voting power records */ - votingPowers?: Maybe; + votingPowers?: Maybe; }; export type QueryAccountBalanceByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAccountBalanceVariationsArgs = { - addresses?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + addresses?: InputMaybe>>; + fromDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAccountBalanceVariationsByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryAccountBalancesArgs = { - addresses?: InputMaybe; - delegates?: InputMaybe; + addresses?: InputMaybe>>; + delegates?: InputMaybe>>; excludeDaoAddresses?: InputMaybe; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; @@ -226,14 +767,14 @@ export type QueryAccountBalancesArgs = { export type QueryAccountInteractionsArgs = { address: Scalars['String']['input']; filterAddress?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; maxAmount?: InputMaybe; minAmount?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; }; @@ -248,67 +789,67 @@ export type QueryAverageDelegationPercentageByDayArgs = { export type QueryCompareActiveSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareAverageTurnoutArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareCexSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareCirculatingSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareDelegatedSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareDexSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareLendingSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareProposalsArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareTotalSupplyArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareTreasuryArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryCompareVotesArgs = { - days?: InputMaybe; + days?: InputMaybe; }; export type QueryDelegationPercentageByDayArgs = { - after?: InputMaybe; - before?: InputMaybe; - endDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - startDate?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + endDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + startDate?: InputMaybe; }; @@ -319,21 +860,21 @@ export type QueryDelegationsArgs = { export type QueryDelegatorsArgs = { address: Scalars['String']['input']; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; }; export type QueryFeedEventsArgs = { - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; + orderDirection?: InputMaybe; relevance?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; type?: InputMaybe; }; @@ -344,86 +885,86 @@ export type QueryGetAddressArgs = { export type QueryGetAddressesArgs = { - addresses: Scalars['JSON']['input']; + addresses: Array>; }; export type QueryGetDaoTokenTreasuryArgs = { - days?: InputMaybe; - order?: InputMaybe; + days?: InputMaybe; + orderDirection?: InputMaybe; }; export type QueryGetEventRelevanceThresholdArgs = { - relevance: QueryInput_GetEventRelevanceThreshold_Relevance; - type: QueryInput_GetEventRelevanceThreshold_Type; + relevance: FeedRelevance; + type: FeedEventType; }; export type QueryGetLiquidTreasuryArgs = { - days?: InputMaybe; - order?: InputMaybe; + days?: InputMaybe; + orderDirection?: InputMaybe; }; export type QueryGetTotalTreasuryArgs = { - days?: InputMaybe; - order?: InputMaybe; + days?: InputMaybe; + orderDirection?: InputMaybe; }; export type QueryHistoricalBalancesArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryHistoricalDelegationsArgs = { address: Scalars['String']['input']; - delegateAddressIn?: InputMaybe; + delegateAddressIn?: InputMaybe>>; fromValue?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; toValue?: InputMaybe; }; export type QueryHistoricalTokenDataArgs = { - limit?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; }; export type QueryHistoricalVotingPowerArgs = { address?: InputMaybe; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryHistoricalVotingPowerByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; @@ -439,12 +980,12 @@ export type QueryOffchainProposalByIdArgs = { export type QueryOffchainProposalsArgs = { - endDate?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - status?: InputMaybe; + endDate?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + status?: InputMaybe>>; }; @@ -454,32 +995,32 @@ export type QueryProposalArgs = { export type QueryProposalNonVotersArgs = { - addresses?: InputMaybe; + addresses?: InputMaybe>>; id: Scalars['String']['input']; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; }; export type QueryProposalsArgs = { - fromDate?: InputMaybe; - fromEndDate?: InputMaybe; - includeOptimisticProposals?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - status?: InputMaybe; + fromDate?: InputMaybe; + fromEndDate?: InputMaybe; + includeOptimisticProposals?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + status?: InputMaybe>>; }; export type QueryProposalsActivityArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; userVoteFilter?: InputMaybe; }; @@ -490,26 +1031,25 @@ export type QueryTokenArgs = { export type QueryTokenMetricsArgs = { - endDate?: InputMaybe; - limit?: InputMaybe; + endDate?: InputMaybe; + limit?: InputMaybe; metricType: QueryInput_TokenMetrics_MetricType; - orderDirection?: InputMaybe; - skip?: InputMaybe; - startDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + startDate?: InputMaybe; }; export type QueryTransactionsArgs = { - affectedSupply?: InputMaybe; + affectedSupply?: InputMaybe>>; from?: InputMaybe; fromDate?: InputMaybe; - includes?: InputMaybe; - limit?: InputMaybe; + includes?: InputMaybe>>; + limit?: InputMaybe; maxAmount?: InputMaybe; minAmount?: InputMaybe; - offset?: InputMaybe; - sortBy?: InputMaybe; - sortOrder?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; to?: InputMaybe; toDate?: InputMaybe; }; @@ -518,656 +1058,474 @@ export type QueryTransactionsArgs = { export type QueryTransfersArgs = { address: Scalars['String']['input']; from?: InputMaybe; - fromDate?: InputMaybe; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; - offset?: InputMaybe; - sortBy?: InputMaybe; - sortOrder?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; to?: InputMaybe; - toDate?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; export type QueryVotesArgs = { - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - support?: InputMaybe; - toDate?: InputMaybe; - voterAddressIn?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + support?: InputMaybe; + toDate?: InputMaybe; + voterAddressIn?: InputMaybe>>; }; export type QueryVotesByProposalIdArgs = { - fromDate?: InputMaybe; + fromDate?: InputMaybe; id: Scalars['String']['input']; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - support?: InputMaybe; - toDate?: InputMaybe; - voterAddressIn?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + support?: InputMaybe; + toDate?: InputMaybe; + voterAddressIn?: InputMaybe>>; }; export type QueryVotesOffchainArgs = { - fromDate?: InputMaybe; - limit?: InputMaybe; + fromDate?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; - voterAddresses?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; + voterAddresses?: InputMaybe>>; }; export type QueryVotesOffchainByProposalIdArgs = { - fromDate?: InputMaybe; + fromDate?: InputMaybe; id: Scalars['String']['input']; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; - voterAddresses?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; + voterAddresses?: InputMaybe>>; }; export type QueryVotingPowerByAccountIdArgs = { accountId: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryVotingPowerVariationsArgs = { - addresses?: InputMaybe; - fromDate?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + addresses?: InputMaybe>>; + fromDate?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; }; export type QueryVotingPowerVariationsByAccountIdArgs = { address: Scalars['String']['input']; - fromDate?: InputMaybe; - toDate?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; }; export type QueryVotingPowersArgs = { - addresses?: InputMaybe; - fromDate?: InputMaybe; + addresses?: InputMaybe>>; + fromDate?: InputMaybe; fromValue?: InputMaybe; - limit?: InputMaybe; + limit?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - skip?: InputMaybe; - toDate?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + toDate?: InputMaybe; toValue?: InputMaybe; }; -export type AccountBalanceByAccountId_200_Response = { - __typename?: 'accountBalanceByAccountId_200_response'; - data: Query_AccountBalanceByAccountId_Data; - period: Query_AccountBalanceByAccountId_Period; +/** Supply metric comparison between current and previous periods. */ +export type SupplyComparisonResponse = { + __typename?: 'SupplyComparisonResponse'; + changeRate: Scalars['Float']['output']; + currentValue: Scalars['String']['output']; + previousValue: Scalars['String']['output']; }; -export type AccountBalanceVariationsByAccountId_200_Response = { - __typename?: 'accountBalanceVariationsByAccountId_200_response'; - data: Query_AccountBalanceVariationsByAccountId_Data; - period: Query_AccountBalanceVariationsByAccountId_Period; +export type TokenHistoricalPriceItem = { + __typename?: 'TokenHistoricalPriceItem'; + /** Historical price value as a decimal string. */ + price: Scalars['String']['output']; + /** Unix timestamp in seconds. */ + timestamp: Scalars['Int']['output']; }; -export type AccountBalanceVariations_200_Response = { - __typename?: 'accountBalanceVariations_200_response'; - items: Array>; - period: Query_AccountBalanceVariations_Period; +export type TokenMetricItem = { + __typename?: 'TokenMetricItem'; + /** Unix day bucket represented as a timestamp string. */ + date: Scalars['String']['output']; + /** Highest observed value for the period. */ + high: Scalars['String']['output']; + /** Total volume observed for the period. */ + volume: Scalars['String']['output']; }; -export type AccountBalances_200_Response = { - __typename?: 'accountBalances_200_response'; - items: Array>; - period: Query_AccountBalances_Period; - totalCount: Scalars['Float']['output']; +export type TokenMetricsResponse = { + __typename?: 'TokenMetricsResponse'; + items: Array>; + pageInfo: PageInfo; }; -export type AccountInteractions_200_Response = { - __typename?: 'accountInteractions_200_response'; - items: Array>; - period: Query_AccountInteractions_Period; - totalCount: Scalars['Float']['output']; +/** Token properties enriched with the current token price. */ +export type TokenPropertiesResponse = { + __typename?: 'TokenPropertiesResponse'; + cexSupply: Scalars['String']['output']; + circulatingSupply: Scalars['String']['output']; + /** Token decimals. */ + decimals: Scalars['Int']['output']; + delegatedSupply: Scalars['String']['output']; + dexSupply: Scalars['String']['output']; + id: Scalars['String']['output']; + lendingSupply: Scalars['String']['output']; + name?: Maybe; + nonCirculatingSupply: Scalars['String']['output']; + price: Scalars['String']['output']; + totalSupply: Scalars['String']['output']; + treasury: Scalars['String']['output']; }; -export type CompareActiveSupply_200_Response = { - __typename?: 'compareActiveSupply_200_response'; - activeSupply: Scalars['String']['output']; +/** Transaction response enriched with transfer and delegation events. */ +export type Transaction = { + __typename?: 'Transaction'; + delegations: Array>; + /** Resolved sender address, if known. */ + from?: Maybe; + /** Whether the transaction touched a centralized exchange. */ + isCex: Scalars['Boolean']['output']; + /** Whether the transaction touched a decentralized exchange. */ + isDex: Scalars['Boolean']['output']; + /** Whether the transaction touched a lending protocol. */ + isLending: Scalars['Boolean']['output']; + /** Whether the transaction counts toward total tracked supply. */ + isTotal: Scalars['Boolean']['output']; + /** Transaction timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Resolved recipient address, if known. */ + to?: Maybe; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; + transfers: Array>; }; -export type CompareAverageTurnout_200_Response = { - __typename?: 'compareAverageTurnout_200_response'; - changeRate: Scalars['Float']['output']; - currentAverageTurnout: Scalars['String']['output']; - oldAverageTurnout: Scalars['String']['output']; +/** Delegation event embedded within a transaction response. */ +export type TransactionDelegation = { + __typename?: 'TransactionDelegation'; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Delegate address. */ + delegateAccountId: Scalars['String']['output']; + /** Delegated amount encoded as a decimal string. */ + delegatedValue: Scalars['String']['output']; + /** Delegator address. */ + delegatorAccountId: Scalars['String']['output']; + /** Whether the delegation touched a centralized exchange. */ + isCex: Scalars['Boolean']['output']; + /** Whether the delegation touched a decentralized exchange. */ + isDex: Scalars['Boolean']['output']; + /** Whether the delegation touched a lending protocol. */ + isLending: Scalars['Boolean']['output']; + /** Whether the delegation counts toward total tracked supply. */ + isTotal: Scalars['Boolean']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Previous delegate address, if one existed. */ + previousDelegate?: Maybe; + /** Delegation timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; }; -export type CompareCexSupply_200_Response = { - __typename?: 'compareCexSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentCexSupply: Scalars['String']['output']; - oldCexSupply: Scalars['String']['output']; +/** Paginated transactions with embedded transfer and delegation data. */ +export type TransactionsResponse = { + __typename?: 'TransactionsResponse'; + items: Array>; + /** Total number of matching transactions. */ + totalCount: Scalars['Int']['output']; }; -export type CompareCirculatingSupply_200_Response = { - __typename?: 'compareCirculatingSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentCirculatingSupply: Scalars['String']['output']; - oldCirculatingSupply: Scalars['String']['output']; +export type Transfer = { + __typename?: 'Transfer'; + /** Transferred amount encoded as a decimal string. */ + amount: Scalars['String']['output']; + /** DAO identifier. */ + daoId: Scalars['String']['output']; + /** Sender address. */ + fromAccountId: Scalars['String']['output']; + /** Whether the transfer touched a centralized exchange. */ + isCex: Scalars['Boolean']['output']; + /** Whether the transfer touched a decentralized exchange. */ + isDex: Scalars['Boolean']['output']; + /** Whether the transfer touched a lending protocol. */ + isLending: Scalars['Boolean']['output']; + /** Whether the transfer counts toward total tracked supply. */ + isTotal: Scalars['Boolean']['output']; + /** Log index within the transaction receipt. */ + logIndex: Scalars['Int']['output']; + /** Transfer timestamp in Unix seconds as a string. */ + timestamp: Scalars['String']['output']; + /** Recipient address. */ + toAccountId: Scalars['String']['output']; + /** Token contract address. */ + tokenId: Scalars['String']['output']; + /** Transaction hash. */ + transactionHash: Scalars['String']['output']; }; -export type CompareDelegatedSupply_200_Response = { - __typename?: 'compareDelegatedSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentDelegatedSupply: Scalars['String']['output']; - oldDelegatedSupply: Scalars['String']['output']; +export type TransfersResponse = { + __typename?: 'TransfersResponse'; + items: Array>; + /** Total number of matching transfers. */ + totalCount: Scalars['Int']['output']; }; -export type CompareDexSupply_200_Response = { - __typename?: 'compareDexSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentDexSupply: Scalars['String']['output']; - oldDexSupply: Scalars['String']['output']; +/** Single treasury time-series datapoint. */ +export type TreasuryItem = { + __typename?: 'TreasuryItem'; + /** Unix timestamp in milliseconds */ + date: Scalars['Float']['output']; + /** Treasury value in USD */ + value: Scalars['Float']['output']; }; -export type CompareLendingSupply_200_Response = { - __typename?: 'compareLendingSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentLendingSupply: Scalars['String']['output']; - oldLendingSupply: Scalars['String']['output']; +/** Paginated treasury time-series response. */ +export type TreasuryResponse = { + __typename?: 'TreasuryResponse'; + items: Array>; + /** Total number of items */ + totalCount: Scalars['Int']['output']; }; -export type CompareProposals_200_Response = { - __typename?: 'compareProposals_200_response'; - changeRate: Scalars['Float']['output']; - currentProposalsLaunched: Scalars['Float']['output']; - oldProposalsLaunched: Scalars['Float']['output']; +/** Voter or non-voter record associated with a proposal. */ +export type Voter = { + __typename?: 'Voter'; + lastVoteTimestamp: Scalars['Float']['output']; + voter: Scalars['String']['output']; + votingPower: Scalars['String']['output']; + votingPowerVariation: Scalars['String']['output']; }; -export type CompareTotalSupply_200_Response = { - __typename?: 'compareTotalSupply_200_response'; - changeRate: Scalars['Float']['output']; - currentTotalSupply: Scalars['String']['output']; - oldTotalSupply: Scalars['String']['output']; +/** Paginated voter or non-voter records for a proposal. */ +export type VotersResponse = { + __typename?: 'VotersResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; }; -export type CompareTreasury_200_Response = { - __typename?: 'compareTreasury_200_response'; +/** Vote-count comparison between two adjacent time windows. */ +export type VotesComparisonResponse = { + __typename?: 'VotesComparisonResponse'; + /** Relative change between current and previous periods. */ changeRate: Scalars['Float']['output']; - currentTreasury: Scalars['String']['output']; - oldTreasury: Scalars['String']['output']; + /** Number of votes cast in the current period. */ + currentVotes: Scalars['Int']['output']; + /** Number of votes cast in the comparison period. */ + oldVotes: Scalars['Int']['output']; }; -export type CompareVotes_200_Response = { - __typename?: 'compareVotes_200_response'; - changeRate: Scalars['Float']['output']; - currentVotes: Scalars['Float']['output']; - oldVotes: Scalars['Float']['output']; +/** Current voting power snapshot for one account. */ +export type VotingPower = { + __typename?: 'VotingPower'; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Current token balance encoded as a decimal string. */ + balance?: Maybe; + /** Total delegations associated with the account. */ + delegationsCount: Scalars['Int']['output']; + /** Total proposals created by the account. */ + proposalsCount: Scalars['Int']['output']; + variation: VotingPowerVariationField; + /** Total votes cast by the account. */ + votesCount: Scalars['Int']['output']; + /** Current voting power encoded as a decimal string. */ + votingPower: Scalars['String']['output']; }; -export type Dao_200_Response = { - __typename?: 'dao_200_response'; - alreadySupportCalldataReview: Scalars['Boolean']['output']; - chainId: Scalars['Float']['output']; - id: Scalars['String']['output']; - proposalThreshold: Scalars['String']['output']; - quorum: Scalars['String']['output']; - supportOffchainData: Scalars['Boolean']['output']; - timelockDelay: Scalars['String']['output']; - votingDelay: Scalars['String']['output']; - votingPeriod: Scalars['String']['output']; +/** Voting power delta for a single account across two timestamps. */ +export type VotingPowerVariation = { + __typename?: 'VotingPowerVariation'; + /** Absolute voting power change encoded as a decimal string. */ + absoluteChange: Scalars['String']['output']; + /** Account address. */ + accountId: Scalars['String']['output']; + /** Voting power at the end of the comparison window. */ + currentVotingPower: Scalars['String']['output']; + /** Relative voting power change encoded as a decimal string. */ + percentageChange: Scalars['String']['output']; + /** Voting power at the start of the comparison window. */ + previousVotingPower: Scalars['String']['output']; }; -export type DelegationPercentageByDay_200_Response = { - __typename?: 'delegationPercentageByDay_200_response'; - items: Array>; - pageInfo: Query_DelegationPercentageByDay_PageInfo; - totalCount: Scalars['Float']['output']; +/** Embedded voting power delta metadata for a current voting power row. */ +export type VotingPowerVariationField = { + __typename?: 'VotingPowerVariationField'; + absoluteChange: Scalars['String']['output']; + percentageChange: Scalars['String']['output']; }; -export type Delegations_200_Response = { - __typename?: 'delegations_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; +/** Voting power variation response for a single account. */ +export type VotingPowerVariationsByAccountIdResponse = { + __typename?: 'VotingPowerVariationsByAccountIdResponse'; + data: VotingPowerVariation; + period: PeriodResponse; }; -export type Delegators_200_Response = { - __typename?: 'delegators_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; +/** List of voting power variations for multiple accounts in the selected period. */ +export type VotingPowerVariationsResponse = { + __typename?: 'VotingPowerVariationsResponse'; + items: Array>; + period: PeriodResponse; }; -export type FeedEvents_200_Response = { - __typename?: 'feedEvents_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; +/** Paginated current voting power records. */ +export type VotingPowersResponse = { + __typename?: 'VotingPowersResponse'; + items: Array>; + /** Total number of matching voting power rows. */ + totalCount: Scalars['Int']['output']; }; +export enum Error_Const { + Error = 'error' +} + export type GetAddress_200_Response = { __typename?: 'getAddress_200_response'; + /** EIP-55 checksummed Ethereum address */ address: Scalars['String']['output']; arkham?: Maybe; ens?: Maybe; + /** Whether the address is a smart contract (true) or an externally-owned account (false) */ isContract: Scalars['Boolean']['output']; }; export type GetAddresses_200_Response = { __typename?: 'getAddresses_200_response'; + /** Enrichment results for each successfully resolved address. Addresses that failed to resolve are omitted. */ results: Array>; }; -export type GetDaoTokenTreasury_200_Response = { - __typename?: 'getDaoTokenTreasury_200_response'; - items: Array>; - /** Total number of items */ - totalCount: Scalars['Float']['output']; -}; - -export type GetEventRelevanceThreshold_200_Response = { - __typename?: 'getEventRelevanceThreshold_200_response'; - threshold: Scalars['String']['output']; -}; - -export type GetLiquidTreasury_200_Response = { - __typename?: 'getLiquidTreasury_200_response'; - items: Array>; - /** Total number of items */ - totalCount: Scalars['Float']['output']; -}; - -export type GetTotalTreasury_200_Response = { - __typename?: 'getTotalTreasury_200_response'; - items: Array>; - /** Total number of items */ - totalCount: Scalars['Float']['output']; -}; - -export type HistoricalBalances_200_Response = { - __typename?: 'historicalBalances_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type HistoricalDelegations_200_Response = { - __typename?: 'historicalDelegations_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type HistoricalVotingPowerByAccountId_200_Response = { - __typename?: 'historicalVotingPowerByAccountId_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type HistoricalVotingPower_200_Response = { - __typename?: 'historicalVotingPower_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type LastUpdate_200_Response = { - __typename?: 'lastUpdate_200_response'; - lastUpdate: Scalars['String']['output']; -}; - -export type OffchainProposalById_200_Response = { - __typename?: 'offchainProposalById_200_response'; - author: Scalars['String']['output']; - body: Scalars['String']['output']; - created: Scalars['Float']['output']; - discussion: Scalars['String']['output']; - end: Scalars['Float']['output']; - flagged: Scalars['Boolean']['output']; - id: Scalars['String']['output']; - link: Scalars['String']['output']; - spaceId: Scalars['String']['output']; - start: Scalars['Float']['output']; - state: Scalars['String']['output']; - title: Scalars['String']['output']; - type: Scalars['String']['output']; - updated: Scalars['Float']['output']; -}; - -export type OffchainProposals_200_Response = { - __typename?: 'offchainProposals_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type ProposalNonVoters_200_Response = { - __typename?: 'proposalNonVoters_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; +export type Health_200_Response = { + __typename?: 'health_200_response'; + database: Ok_Const; + status: Ok_Const; }; -export type Proposal_200_Response = { - __typename?: 'proposal_200_response'; - abstainVotes: Scalars['String']['output']; - againstVotes: Scalars['String']['output']; - calldatas: Array>; - daoId: Scalars['String']['output']; - description: Scalars['String']['output']; - endBlock: Scalars['Float']['output']; - endTimestamp: Scalars['String']['output']; - forVotes: Scalars['String']['output']; - id: Scalars['String']['output']; - proposalType?: Maybe; - proposerAccountId: Scalars['String']['output']; - quorum: Scalars['String']['output']; - startBlock: Scalars['Float']['output']; - startTimestamp: Scalars['String']['output']; - status: Scalars['String']['output']; - targets: Array>; - timestamp: Scalars['String']['output']; - title: Scalars['String']['output']; - txHash: Scalars['String']['output']; - values: Array>; +export type Health_503_Response = { + __typename?: 'health_503_response'; + database: Error_Const; + message: Scalars['String']['output']; + status: Error_Const; }; -export type ProposalsActivity_200_Response = { - __typename?: 'proposalsActivity_200_response'; - address: Scalars['String']['output']; - avgTimeBeforeEnd: Scalars['Float']['output']; - neverVoted: Scalars['Boolean']['output']; - proposals: Array>; - totalProposals: Scalars['Float']['output']; - votedProposals: Scalars['Float']['output']; - winRate: Scalars['Float']['output']; - yesRate: Scalars['Float']['output']; -}; +export type Health_Response = Health_200_Response | Health_503_Response; -export type Proposals_200_Response = { - __typename?: 'proposals_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; +export type OffchainProposalById_Response = ErrorResponse | OffchainProposal; -export enum QueryInput_AccountBalanceVariations_OrderDirection { - Asc = 'asc', - Desc = 'desc' +export enum Ok_Const { + Ok = 'ok' } +export type Proposal_Response = ErrorResponse | OnchainProposal; + export enum QueryInput_AccountBalances_OrderBy { Balance = 'balance', SignedVariation = 'signedVariation', Variation = 'variation' } -export enum QueryInput_AccountBalances_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Field used to sort interaction rows. */ export enum QueryInput_AccountInteractions_OrderBy { Count = 'count', Volume = 'volume' } -export enum QueryInput_AccountInteractions_OrderDirection { - Asc = 'asc', - Desc = 'desc' +export enum QueryInput_Delegators_OrderBy { + Amount = 'amount', + Timestamp = 'timestamp' } -export enum QueryInput_CompareActiveSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' +/** Field used to sort feed events. */ +export enum QueryInput_FeedEvents_OrderBy { + Timestamp = 'timestamp', + Value = 'value' } -export enum QueryInput_CompareAverageTurnout_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' +/** Filter events by relevance tier. */ +export enum QueryInput_FeedEvents_Relevance { + High = 'HIGH', + Low = 'LOW', + Medium = 'MEDIUM' } -export enum QueryInput_CompareCexSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareCirculatingSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareDelegatedSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareDexSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareLendingSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareProposals_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareTotalSupply_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareTreasury_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_CompareVotes_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_DelegationPercentageByDay_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_Delegators_OrderBy { - Amount = 'amount', - Timestamp = 'timestamp' -} - -export enum QueryInput_Delegators_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_FeedEvents_OrderBy { - Timestamp = 'timestamp', - Value = 'value' -} - -export enum QueryInput_FeedEvents_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_FeedEvents_Relevance { - High = 'HIGH', - Low = 'LOW', - Medium = 'MEDIUM' -} - -export enum QueryInput_FeedEvents_Type { - Delegation = 'DELEGATION', - Proposal = 'PROPOSAL', - ProposalExtended = 'PROPOSAL_EXTENDED', - Transfer = 'TRANSFER', - Vote = 'VOTE' -} - -export enum QueryInput_GetDaoTokenTreasury_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_GetDaoTokenTreasury_Order { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_GetEventRelevanceThreshold_Relevance { - High = 'HIGH', - Low = 'LOW', - Medium = 'MEDIUM' -} - -export enum QueryInput_GetEventRelevanceThreshold_Type { - Delegation = 'DELEGATION', - Proposal = 'PROPOSAL', - ProposalExtended = 'PROPOSAL_EXTENDED', - Transfer = 'TRANSFER', - Vote = 'VOTE' -} - -export enum QueryInput_GetLiquidTreasury_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_GetLiquidTreasury_Order { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_GetTotalTreasury_Days { - '7d' = '_7d', - '30d' = '_30d', - '90d' = '_90d', - '180d' = '_180d', - '365d' = '_365d' -} - -export enum QueryInput_GetTotalTreasury_Order { - Asc = 'asc', - Desc = 'desc' +/** Filter events by governance activity type. */ +export enum QueryInput_FeedEvents_Type { + Delegation = 'DELEGATION', + Proposal = 'PROPOSAL', + ProposalExtended = 'PROPOSAL_EXTENDED', + Transfer = 'TRANSFER', + Vote = 'VOTE' } +/** Field used to sort historical balance rows. */ export enum QueryInput_HistoricalBalances_OrderBy { Delta = 'delta', Timestamp = 'timestamp' } -export enum QueryInput_HistoricalBalances_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_HistoricalDelegations_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Field used to sort historical voting power rows. */ export enum QueryInput_HistoricalVotingPowerByAccountId_OrderBy { Delta = 'delta', Timestamp = 'timestamp' } -export enum QueryInput_HistoricalVotingPowerByAccountId_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Field used to sort historical voting power rows. */ export enum QueryInput_HistoricalVotingPower_OrderBy { Delta = 'delta', Timestamp = 'timestamp' } -export enum QueryInput_HistoricalVotingPower_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Chart identifier whose freshness timestamp should be returned. */ export enum QueryInput_LastUpdate_Chart { AttackProfitability = 'attack_profitability', CostComparison = 'cost_comparison', TokenDistribution = 'token_distribution' } -export enum QueryInput_OffchainProposals_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_ProposalNonVoters_OrderDirection { - Asc = 'asc', - Desc = 'desc' +export enum QueryInput_OffchainProposals_Status_Items { + Active = 'active', + Closed = 'closed', + Pending = 'pending' } +/** Field used to sort proposal activity results. */ export enum QueryInput_ProposalsActivity_OrderBy { Timestamp = 'timestamp', VoteTiming = 'voteTiming', VotingPower = 'votingPower' } -export enum QueryInput_ProposalsActivity_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -/** Filter proposals by vote type. Can be: 'yes' (For votes), 'no' (Against votes), 'abstain' (Abstain votes), 'no-vote' (Didn't vote) */ +/** Optional vote filter. Use yes, no, abstain, or no-vote to narrow the result set. */ export enum QueryInput_ProposalsActivity_UserVoteFilter { Abstain = 'abstain', No = 'no', @@ -1175,16 +1533,21 @@ export enum QueryInput_ProposalsActivity_UserVoteFilter { Yes = 'yes' } -export enum QueryInput_Proposals_IncludeOptimisticProposals { - False = 'FALSE', - True = 'TRUE' -} - -export enum QueryInput_Proposals_OrderDirection { - Asc = 'asc', - Desc = 'desc' +export enum QueryInput_Proposals_Status_Items { + Active = 'ACTIVE', + Canceled = 'CANCELED', + Defeated = 'DEFEATED', + Executed = 'EXECUTED', + Expired = 'EXPIRED', + NoQuorum = 'NO_QUORUM', + Pending = 'PENDING', + PendingExecution = 'PENDING_EXECUTION', + Queued = 'QUEUED', + Succeeded = 'SUCCEEDED', + Vetoed = 'VETOED' } +/** Metric family to query. */ export enum QueryInput_TokenMetrics_MetricType { CexSupply = 'CEX_SUPPLY', CirculatingSupply = 'CIRCULATING_SUPPLY', @@ -1195,76 +1558,55 @@ export enum QueryInput_TokenMetrics_MetricType { Treasury = 'TREASURY' } -export enum QueryInput_TokenMetrics_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Currency to use when fetching token price data. */ export enum QueryInput_Token_Currency { Eth = 'eth', Usd = 'usd' } -export enum QueryInput_Transactions_SortOrder { - Asc = 'asc', - Desc = 'desc' +export enum QueryInput_Transactions_AffectedSupply_Items { + Cex = 'CEX', + Dex = 'DEX', + Lending = 'LENDING', + Total = 'TOTAL', + Unassigned = 'UNASSIGNED' } -export enum QueryInput_Transfers_SortBy { - Amount = 'amount', - Timestamp = 'timestamp' +export enum QueryInput_Transactions_Includes_Items { + Delegation = 'DELEGATION', + Transfer = 'TRANSFER' } -export enum QueryInput_Transfers_SortOrder { - Asc = 'asc', - Desc = 'desc' +/** Field used to sort transfers. */ +export enum QueryInput_Transfers_OrderBy { + Amount = 'amount', + Timestamp = 'timestamp' } +/** Sort votes by timestamp or voting power. */ export enum QueryInput_VotesByProposalId_OrderBy { Timestamp = 'timestamp', VotingPower = 'votingPower' } -export enum QueryInput_VotesByProposalId_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Sort votes by timestamp or voting power. */ export enum QueryInput_VotesOffchainByProposalId_OrderBy { Timestamp = 'timestamp', VotingPower = 'votingPower' } -export enum QueryInput_VotesOffchainByProposalId_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Sort votes by timestamp or voting power. */ export enum QueryInput_VotesOffchain_OrderBy { Timestamp = 'timestamp', VotingPower = 'votingPower' } -export enum QueryInput_VotesOffchain_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - +/** Sort votes by timestamp or voting power. */ export enum QueryInput_Votes_OrderBy { Timestamp = 'timestamp', VotingPower = 'votingPower' } -export enum QueryInput_Votes_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export enum QueryInput_VotingPowerVariations_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - export enum QueryInput_VotingPowers_OrderBy { Balance = 'balance', DelegationsCount = 'delegationsCount', @@ -1274,753 +1616,172 @@ export enum QueryInput_VotingPowers_OrderBy { VotingPower = 'votingPower' } -export enum QueryInput_VotingPowers_OrderDirection { - Asc = 'asc', - Desc = 'desc' -} - -export type Query_AccountBalanceByAccountId_Data = { - __typename?: 'query_accountBalanceByAccountId_data'; - address: Scalars['String']['output']; - balance: Scalars['String']['output']; - delegate: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - variation: Query_AccountBalanceByAccountId_Data_Variation; +/** Arkham Intelligence label data. null when no data is available for the address. */ +export type Query_GetAddress_Arkham = { + __typename?: 'query_getAddress_arkham'; + /** Human-readable name of the entity that owns the address according to Arkham Intelligence */ + entity?: Maybe; + /** Category of the entity (e.g. 'individual', 'exchange', 'protocol', 'fund') */ + entityType?: Maybe; + /** Fine-grained label for the specific address within the entity */ + label?: Maybe; + /** Twitter/X handle associated with the entity, without '@' */ + twitter?: Maybe; }; -export type Query_AccountBalanceByAccountId_Data_Variation = { - __typename?: 'query_accountBalanceByAccountId_data_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; +/** ENS (Ethereum Name Service) data. null when no ENS name is registered for the address. Cached with a configurable TTL. */ +export type Query_GetAddress_Ens = { + __typename?: 'query_getAddress_ens'; + /** URL of the ENS avatar image */ + avatar?: Maybe; + /** URL of the ENS profile banner image */ + banner?: Maybe; + /** Primary ENS name reverse-resolved for this address */ + name?: Maybe; }; -export type Query_AccountBalanceByAccountId_Period = { - __typename?: 'query_accountBalanceByAccountId_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; +export type Query_GetAddresses_Results_Items = { + __typename?: 'query_getAddresses_results_items'; + /** EIP-55 checksummed Ethereum address */ + address: Scalars['String']['output']; + arkham?: Maybe; + ens?: Maybe; + /** Whether the address is a smart contract (true) or an externally-owned account (false) */ + isContract: Scalars['Boolean']['output']; }; -export type Query_AccountBalanceVariationsByAccountId_Data = { - __typename?: 'query_accountBalanceVariationsByAccountId_data'; - absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentBalance: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; +/** Arkham Intelligence label data. null when no data is available for the address. */ +export type Query_GetAddresses_Results_Items_Arkham = { + __typename?: 'query_getAddresses_results_items_arkham'; + /** Human-readable name of the entity that owns the address according to Arkham Intelligence */ + entity?: Maybe; + /** Category of the entity (e.g. 'individual', 'exchange', 'protocol', 'fund') */ + entityType?: Maybe; + /** Fine-grained label for the specific address within the entity */ + label?: Maybe; + /** Twitter/X handle associated with the entity, without '@' */ + twitter?: Maybe; }; -export type Query_AccountBalanceVariationsByAccountId_Period = { - __typename?: 'query_accountBalanceVariationsByAccountId_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; +/** ENS (Ethereum Name Service) data. null when no ENS name is registered for the address. Cached with a configurable TTL. */ +export type Query_GetAddresses_Results_Items_Ens = { + __typename?: 'query_getAddresses_results_items_ens'; + /** URL of the ENS avatar image */ + avatar?: Maybe; + /** URL of the ENS profile banner image */ + banner?: Maybe; + /** Primary ENS name reverse-resolved for this address */ + name?: Maybe; }; -export type Query_AccountBalanceVariations_Items_Items = { - __typename?: 'query_accountBalanceVariations_items_items'; - absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentBalance: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; +export type Query_OffchainProposals_Items_Items_Strategies_Items = { + __typename?: 'query_offchainProposals_items_items_strategies_items'; + name: Scalars['String']['output']; + network: Scalars['String']['output']; + params: Scalars['JSON']['output']; }; -export type Query_AccountBalanceVariations_Period = { - __typename?: 'query_accountBalanceVariations_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; - -export type Query_AccountBalances_Items_Items = { - __typename?: 'query_accountBalances_items_items'; - address: Scalars['String']['output']; - balance: Scalars['String']['output']; - delegate: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - variation: Query_AccountBalances_Items_Items_Variation; -}; - -export type Query_AccountBalances_Items_Items_Variation = { - __typename?: 'query_accountBalances_items_items_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousBalance: Scalars['String']['output']; -}; - -export type Query_AccountBalances_Period = { - __typename?: 'query_accountBalances_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; - -export type Query_AccountInteractions_Items_Items = { - __typename?: 'query_accountInteractions_items_items'; - accountId: Scalars['String']['output']; - amountTransferred: Scalars['String']['output']; - totalVolume: Scalars['String']['output']; - transferCount: Scalars['String']['output']; -}; - -export type Query_AccountInteractions_Period = { - __typename?: 'query_accountInteractions_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; - -export type Query_DelegationPercentageByDay_Items_Items = { - __typename?: 'query_delegationPercentageByDay_items_items'; - date: Scalars['String']['output']; - high: Scalars['String']['output']; -}; - -export type Query_DelegationPercentageByDay_PageInfo = { - __typename?: 'query_delegationPercentageByDay_pageInfo'; - endDate?: Maybe; - hasNextPage: Scalars['Boolean']['output']; - startDate?: Maybe; -}; - -export type Query_Delegations_Items_Items = { - __typename?: 'query_delegations_items_items'; - amount: Scalars['String']['output']; - delegateAddress: Scalars['String']['output']; - delegatorAddress: Scalars['String']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; - -export type Query_Delegators_Items_Items = { - __typename?: 'query_delegators_items_items'; - amount: Scalars['String']['output']; - delegatorAddress: Scalars['String']['output']; - timestamp: Scalars['String']['output']; -}; - -export type Query_FeedEvents_Items_Items = { - __typename?: 'query_feedEvents_items_items'; - logIndex: Scalars['Float']['output']; - metadata?: Maybe; - relevance: Query_FeedEvents_Items_Items_Relevance; - timestamp: Scalars['Float']['output']; - txHash: Scalars['String']['output']; - type: Query_FeedEvents_Items_Items_Type; - value?: Maybe; -}; - -export enum Query_FeedEvents_Items_Items_Relevance { - High = 'HIGH', - Low = 'LOW', - Medium = 'MEDIUM' -} - -export enum Query_FeedEvents_Items_Items_Type { - Delegation = 'DELEGATION', - Proposal = 'PROPOSAL', - ProposalExtended = 'PROPOSAL_EXTENDED', - Transfer = 'TRANSFER', - Vote = 'VOTE' -} - -export type Query_GetAddress_Arkham = { - __typename?: 'query_getAddress_arkham'; - entity?: Maybe; - entityType?: Maybe; - label?: Maybe; - twitter?: Maybe; -}; - -export type Query_GetAddress_Ens = { - __typename?: 'query_getAddress_ens'; - avatar?: Maybe; - banner?: Maybe; - name?: Maybe; -}; - -export type Query_GetAddresses_Results_Items = { - __typename?: 'query_getAddresses_results_items'; - address: Scalars['String']['output']; - arkham?: Maybe; - ens?: Maybe; - isContract: Scalars['Boolean']['output']; -}; - -export type Query_GetAddresses_Results_Items_Arkham = { - __typename?: 'query_getAddresses_results_items_arkham'; - entity?: Maybe; - entityType?: Maybe; - label?: Maybe; - twitter?: Maybe; -}; - -export type Query_GetAddresses_Results_Items_Ens = { - __typename?: 'query_getAddresses_results_items_ens'; - avatar?: Maybe; - banner?: Maybe; - name?: Maybe; -}; - -export type Query_GetDaoTokenTreasury_Items_Items = { - __typename?: 'query_getDaoTokenTreasury_items_items'; - /** Unix timestamp in milliseconds */ - date: Scalars['Float']['output']; - /** Treasury value in USD */ - value: Scalars['Float']['output']; -}; - -export type Query_GetLiquidTreasury_Items_Items = { - __typename?: 'query_getLiquidTreasury_items_items'; - /** Unix timestamp in milliseconds */ - date: Scalars['Float']['output']; - /** Treasury value in USD */ - value: Scalars['Float']['output']; -}; - -export type Query_GetTotalTreasury_Items_Items = { - __typename?: 'query_getTotalTreasury_items_items'; - /** Unix timestamp in milliseconds */ - date: Scalars['Float']['output']; - /** Treasury value in USD */ - value: Scalars['Float']['output']; -}; - -export type Query_HistoricalBalances_Items_Items = { - __typename?: 'query_historicalBalances_items_items'; - accountId: Scalars['String']['output']; - balance: Scalars['String']['output']; - daoId: Scalars['String']['output']; - delta: Scalars['String']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; - transfer: Query_HistoricalBalances_Items_Items_Transfer; -}; - -export type Query_HistoricalBalances_Items_Items_Transfer = { - __typename?: 'query_historicalBalances_items_items_transfer'; - from: Scalars['String']['output']; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; - -export type Query_HistoricalDelegations_Items_Items = { - __typename?: 'query_historicalDelegations_items_items'; - amount: Scalars['String']['output']; - delegateAddress: Scalars['String']['output']; - delegatorAddress: Scalars['String']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; - -export type Query_HistoricalTokenData_Items = { - __typename?: 'query_historicalTokenData_items'; - price: Scalars['String']['output']; - timestamp: Scalars['Float']['output']; -}; - -export type Query_HistoricalVotingPowerByAccountId_Items_Items = { - __typename?: 'query_historicalVotingPowerByAccountId_items_items'; - accountId: Scalars['String']['output']; - daoId: Scalars['String']['output']; - delegation?: Maybe; - delta: Scalars['String']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; - transfer?: Maybe; - votingPower: Scalars['String']['output']; -}; - -export type Query_HistoricalVotingPowerByAccountId_Items_Items_Delegation = { - __typename?: 'query_historicalVotingPowerByAccountId_items_items_delegation'; - from: Scalars['String']['output']; - previousDelegate?: Maybe; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; - -export type Query_HistoricalVotingPowerByAccountId_Items_Items_Transfer = { - __typename?: 'query_historicalVotingPowerByAccountId_items_items_transfer'; - from: Scalars['String']['output']; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; - -export type Query_HistoricalVotingPower_Items_Items = { - __typename?: 'query_historicalVotingPower_items_items'; - accountId: Scalars['String']['output']; - daoId: Scalars['String']['output']; - delegation?: Maybe; - delta: Scalars['String']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; - transfer?: Maybe; - votingPower: Scalars['String']['output']; -}; - -export type Query_HistoricalVotingPower_Items_Items_Delegation = { - __typename?: 'query_historicalVotingPower_items_items_delegation'; - from: Scalars['String']['output']; - previousDelegate?: Maybe; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; - -export type Query_HistoricalVotingPower_Items_Items_Transfer = { - __typename?: 'query_historicalVotingPower_items_items_transfer'; - from: Scalars['String']['output']; - to: Scalars['String']['output']; - value: Scalars['String']['output']; -}; - -export type Query_OffchainProposals_Items_Items = { - __typename?: 'query_offchainProposals_items_items'; - author: Scalars['String']['output']; - body: Scalars['String']['output']; - created: Scalars['Float']['output']; - discussion: Scalars['String']['output']; - end: Scalars['Float']['output']; - flagged: Scalars['Boolean']['output']; - id: Scalars['String']['output']; - link: Scalars['String']['output']; - spaceId: Scalars['String']['output']; - start: Scalars['Float']['output']; - state: Scalars['String']['output']; - title: Scalars['String']['output']; - type: Scalars['String']['output']; - updated: Scalars['Float']['output']; -}; - -export type Query_ProposalNonVoters_Items_Items = { - __typename?: 'query_proposalNonVoters_items_items'; - lastVoteTimestamp: Scalars['Float']['output']; - voter: Scalars['String']['output']; - votingPower: Scalars['String']['output']; - votingPowerVariation: Scalars['String']['output']; -}; - -export type Query_ProposalsActivity_Proposals_Items = { - __typename?: 'query_proposalsActivity_proposals_items'; - proposal: Query_ProposalsActivity_Proposals_Items_Proposal; - userVote?: Maybe; -}; - -export type Query_ProposalsActivity_Proposals_Items_Proposal = { - __typename?: 'query_proposalsActivity_proposals_items_proposal'; - abstainVotes: Scalars['String']['output']; - againstVotes: Scalars['String']['output']; - daoId: Scalars['String']['output']; - description: Scalars['String']['output']; - endBlock: Scalars['Float']['output']; - forVotes: Scalars['String']['output']; - id: Scalars['String']['output']; - proposerAccountId: Scalars['String']['output']; - startBlock: Scalars['Float']['output']; - status: Scalars['String']['output']; - timestamp?: Maybe; - title: Scalars['String']['output']; -}; - -export type Query_ProposalsActivity_Proposals_Items_UserVote = { - __typename?: 'query_proposalsActivity_proposals_items_userVote'; - id: Scalars['String']['output']; - proposalId: Scalars['String']['output']; - reason?: Maybe; - support?: Maybe; - timestamp?: Maybe; - voterAccountId: Scalars['String']['output']; - votingPower: Scalars['String']['output']; -}; - -export type Query_Proposals_Items_Items = { - __typename?: 'query_proposals_items_items'; - abstainVotes: Scalars['String']['output']; - againstVotes: Scalars['String']['output']; - calldatas: Array>; - daoId: Scalars['String']['output']; - description: Scalars['String']['output']; - endBlock: Scalars['Float']['output']; - endTimestamp: Scalars['String']['output']; - forVotes: Scalars['String']['output']; - id: Scalars['String']['output']; - proposalType?: Maybe; - proposerAccountId: Scalars['String']['output']; - quorum: Scalars['String']['output']; - startBlock: Scalars['Float']['output']; - startTimestamp: Scalars['String']['output']; - status: Scalars['String']['output']; - targets: Array>; - timestamp: Scalars['String']['output']; - title: Scalars['String']['output']; - txHash: Scalars['String']['output']; - values: Array>; -}; - -export type Query_TokenMetrics_Items_Items = { - __typename?: 'query_tokenMetrics_items_items'; - date: Scalars['String']['output']; - high: Scalars['String']['output']; - volume: Scalars['String']['output']; -}; - -export type Query_TokenMetrics_PageInfo = { - __typename?: 'query_tokenMetrics_pageInfo'; - endDate?: Maybe; - hasNextPage: Scalars['Boolean']['output']; - startDate?: Maybe; -}; - -export type Query_Transactions_Items_Items = { - __typename?: 'query_transactions_items_items'; - delegations: Array>; - from?: Maybe; - isCex: Scalars['Boolean']['output']; - isDex: Scalars['Boolean']['output']; - isLending: Scalars['Boolean']['output']; - isTotal: Scalars['Boolean']['output']; - timestamp: Scalars['String']['output']; - to?: Maybe; - transactionHash: Scalars['String']['output']; - transfers: Array>; -}; - -export type Query_Transactions_Items_Items_Delegations_Items = { - __typename?: 'query_transactions_items_items_delegations_items'; - daoId: Scalars['String']['output']; - delegateAccountId: Scalars['String']['output']; - delegatedValue: Scalars['String']['output']; - delegatorAccountId: Scalars['String']['output']; - isCex: Scalars['Boolean']['output']; - isDex: Scalars['Boolean']['output']; - isLending: Scalars['Boolean']['output']; - isTotal: Scalars['Boolean']['output']; - logIndex: Scalars['Float']['output']; - previousDelegate?: Maybe; - timestamp: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; - -export type Query_Transactions_Items_Items_Transfers_Items = { - __typename?: 'query_transactions_items_items_transfers_items'; - amount: Scalars['String']['output']; - daoId: Scalars['String']['output']; - fromAccountId: Scalars['String']['output']; - isCex: Scalars['Boolean']['output']; - isDex: Scalars['Boolean']['output']; - isLending: Scalars['Boolean']['output']; - isTotal: Scalars['Boolean']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - toAccountId: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; - -export type Query_Transfers_Items_Items = { - __typename?: 'query_transfers_items_items'; - amount: Scalars['String']['output']; - daoId: Scalars['String']['output']; - fromAccountId: Scalars['String']['output']; - isCex: Scalars['Boolean']['output']; - isDex: Scalars['Boolean']['output']; - isLending: Scalars['Boolean']['output']; - isTotal: Scalars['Boolean']['output']; - logIndex: Scalars['Float']['output']; - timestamp: Scalars['String']['output']; - toAccountId: Scalars['String']['output']; - tokenId: Scalars['String']['output']; - transactionHash: Scalars['String']['output']; -}; - -export type Query_VotesByProposalId_Items_Items = { - __typename?: 'query_votesByProposalId_items_items'; - proposalId: Scalars['String']['output']; - proposalTitle?: Maybe; - reason?: Maybe; - support?: Maybe; - timestamp: Scalars['Int']['output']; - transactionHash: Scalars['String']['output']; - voterAddress: Scalars['String']['output']; - votingPower: Scalars['String']['output']; -}; - -export type Query_VotesOffchainByProposalId_Items_Items = { - __typename?: 'query_votesOffchainByProposalId_items_items'; - choice?: Maybe; - created: Scalars['Float']['output']; - proposalId: Scalars['String']['output']; - proposalTitle: Scalars['String']['output']; - reason: Scalars['String']['output']; - voter: Scalars['String']['output']; - vp?: Maybe; -}; - -export type Query_VotesOffchain_Items_Items = { - __typename?: 'query_votesOffchain_items_items'; - choice?: Maybe; - created: Scalars['Float']['output']; - proposalId: Scalars['String']['output']; - proposalTitle: Scalars['String']['output']; - reason: Scalars['String']['output']; - voter: Scalars['String']['output']; - vp?: Maybe; -}; - -export type Query_Votes_Items_Items = { - __typename?: 'query_votes_items_items'; - proposalId: Scalars['String']['output']; - proposalTitle?: Maybe; - reason?: Maybe; - support?: Maybe; - timestamp: Scalars['Int']['output']; - transactionHash: Scalars['String']['output']; - voterAddress: Scalars['String']['output']; - votingPower: Scalars['String']['output']; -}; - -export type Query_VotingPowerByAccountId_Variation = { - __typename?: 'query_votingPowerByAccountId_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; -}; - -export type Query_VotingPowerVariationsByAccountId_Data = { - __typename?: 'query_votingPowerVariationsByAccountId_data'; - absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentVotingPower: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousVotingPower: Scalars['String']['output']; -}; - -export type Query_VotingPowerVariationsByAccountId_Period = { - __typename?: 'query_votingPowerVariationsByAccountId_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; - -export type Query_VotingPowerVariations_Items_Items = { - __typename?: 'query_votingPowerVariations_items_items'; - absoluteChange: Scalars['String']['output']; - accountId: Scalars['String']['output']; - currentVotingPower: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; - previousVotingPower: Scalars['String']['output']; -}; - -export type Query_VotingPowerVariations_Period = { - __typename?: 'query_votingPowerVariations_period'; - endTimestamp: Scalars['String']['output']; - startTimestamp: Scalars['String']['output']; -}; - -export type Query_VotingPowers_Items_Items = { - __typename?: 'query_votingPowers_items_items'; - accountId: Scalars['String']['output']; - balance?: Maybe; - delegationsCount: Scalars['Float']['output']; - proposalsCount: Scalars['Float']['output']; - variation: Query_VotingPowers_Items_Items_Variation; - votesCount: Scalars['Float']['output']; - votingPower: Scalars['String']['output']; -}; - -export type Query_VotingPowers_Items_Items_Variation = { - __typename?: 'query_votingPowers_items_items_variation'; - absoluteChange: Scalars['String']['output']; - percentageChange: Scalars['String']['output']; -}; - -export enum Timestamp_Const { - Timestamp = 'timestamp' -} - -export type TokenMetrics_200_Response = { - __typename?: 'tokenMetrics_200_response'; - items: Array>; - pageInfo: Query_TokenMetrics_PageInfo; -}; - -export type Token_200_Response = { - __typename?: 'token_200_response'; - cexSupply: Scalars['String']['output']; - circulatingSupply: Scalars['String']['output']; - decimals: Scalars['Float']['output']; - delegatedSupply: Scalars['String']['output']; - dexSupply: Scalars['String']['output']; - id: Scalars['String']['output']; - lendingSupply: Scalars['String']['output']; - name?: Maybe; - nonCirculatingSupply: Scalars['String']['output']; - price: Scalars['String']['output']; - totalSupply: Scalars['String']['output']; - treasury: Scalars['String']['output']; -}; - -export type Transactions_200_Response = { - __typename?: 'transactions_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type Transfers_200_Response = { - __typename?: 'transfers_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type VotesByProposalId_200_Response = { - __typename?: 'votesByProposalId_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type VotesOffchainByProposalId_200_Response = { - __typename?: 'votesOffchainByProposalId_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type VotesOffchain_200_Response = { - __typename?: 'votesOffchain_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type Votes_200_Response = { - __typename?: 'votes_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; - -export type VotingPowerByAccountId_200_Response = { - __typename?: 'votingPowerByAccountId_200_response'; - accountId: Scalars['String']['output']; - balance?: Maybe; - delegationsCount: Scalars['Float']['output']; - proposalsCount: Scalars['Float']['output']; - variation: Query_VotingPowerByAccountId_Variation; - votesCount: Scalars['Float']['output']; - votingPower: Scalars['String']['output']; -}; - -export type VotingPowerVariationsByAccountId_200_Response = { - __typename?: 'votingPowerVariationsByAccountId_200_response'; - data: Query_VotingPowerVariationsByAccountId_Data; - period: Query_VotingPowerVariationsByAccountId_Period; -}; - -export type VotingPowerVariations_200_Response = { - __typename?: 'votingPowerVariations_200_response'; - items: Array>; - period: Query_VotingPowerVariations_Period; -}; - -export type VotingPowers_200_Response = { - __typename?: 'votingPowers_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; -}; +export type Token_Response = ErrorResponse | TokenPropertiesResponse; export type GetDaOsQueryVariables = Exact<{ [key: string]: never; }>; -export type GetDaOsQuery = { __typename?: 'Query', daos: { __typename?: 'DAOList', items: Array<{ __typename?: 'dao_200_response', id: string, votingDelay: string, chainId: number, alreadySupportCalldataReview: boolean, supportOffchainData: boolean }> } }; +export type GetDaOsQuery = { __typename?: 'Query', daos: { __typename?: 'DAOList', items: Array<{ __typename?: 'DaoResponse', id: string, votingDelay: string, chainId: number, alreadySupportCalldataReview: boolean, supportOffchainData: boolean }> } }; export type ListOffchainProposalsQueryVariables = Exact<{ - skip?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - status?: InputMaybe; - fromDate?: InputMaybe; - endDate?: InputMaybe; + skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + status?: InputMaybe> | InputMaybe>; + fromDate?: InputMaybe; + endDate?: InputMaybe; }>; -export type ListOffchainProposalsQuery = { __typename?: 'Query', offchainProposals?: { __typename?: 'offchainProposals_200_response', totalCount: number, items: Array<{ __typename?: 'query_offchainProposals_items_items', id: string, title: string, discussion: string, link: string, state: string, created: number, end: number } | null> } | null }; +export type ListOffchainProposalsQuery = { __typename?: 'Query', offchainProposals?: { __typename?: 'OffchainProposalsResponse', totalCount: number, items: Array<{ __typename?: 'OffchainProposal', id: string, title: string, discussion: string, link: string, state: string, created: number, end: number } | null> } | null }; export type ListOffchainVotesQueryVariables = Exact<{ - fromDate?: InputMaybe; - toDate?: InputMaybe; - limit?: InputMaybe; - skip?: InputMaybe; + fromDate?: InputMaybe; + toDate?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - voterAddresses?: InputMaybe; + orderDirection?: InputMaybe; + voterAddresses?: InputMaybe> | InputMaybe>; }>; -export type ListOffchainVotesQuery = { __typename?: 'Query', votesOffchain?: { __typename?: 'votesOffchain_200_response', totalCount: number, items: Array<{ __typename?: 'query_votesOffchain_items_items', voter: string, created: number, proposalId: string, proposalTitle: string, reason: string, vp?: number | null } | null> } | null }; +export type ListOffchainVotesQuery = { __typename?: 'Query', votesOffchain?: { __typename?: 'OffchainVotesResponse', totalCount: number, items: Array<{ __typename?: 'OffchainVote', voter: string, created: number, proposalId: string, proposalTitle?: string | null, reason: string, vp?: number | null } | null> } | null }; export type ProposalNonVotersQueryVariables = Exact<{ id: Scalars['String']['input']; - addresses?: InputMaybe; + addresses?: InputMaybe> | InputMaybe>; }>; -export type ProposalNonVotersQuery = { __typename?: 'Query', proposalNonVoters?: { __typename?: 'proposalNonVoters_200_response', items: Array<{ __typename?: 'query_proposalNonVoters_items_items', voter: string } | null> } | null }; +export type ProposalNonVotersQuery = { __typename?: 'Query', proposalNonVoters?: { __typename?: 'VotersResponse', items: Array<{ __typename?: 'Voter', voter: string } | null> } | null }; export type GetProposalByIdQueryVariables = Exact<{ id: Scalars['String']['input']; }>; -export type GetProposalByIdQuery = { __typename?: 'Query', proposal?: { __typename?: 'proposal_200_response', id: string, daoId: string, proposerAccountId: string, title: string, description: string, startBlock: number, endBlock: number, endTimestamp: string, timestamp: string, status: string, forVotes: string, againstVotes: string, abstainVotes: string, txHash: string } | null }; +export type GetProposalByIdQuery = { __typename?: 'Query', proposal?: { __typename?: 'ErrorResponse' } | { __typename?: 'OnchainProposal', id: string, daoId: string, proposerAccountId: string, title: string, description: string, startBlock: number, endBlock: number, endTimestamp: number, timestamp: number, status: string, forVotes: string, againstVotes: string, abstainVotes: string, txHash: string } | null }; export type ListProposalsQueryVariables = Exact<{ - skip?: InputMaybe; - limit?: InputMaybe; - orderDirection?: InputMaybe; - status?: InputMaybe; - fromDate?: InputMaybe; - fromEndDate?: InputMaybe; - includeOptimisticProposals?: InputMaybe; + skip?: InputMaybe; + limit?: InputMaybe; + orderDirection?: InputMaybe; + status?: InputMaybe> | InputMaybe>; + fromDate?: InputMaybe; + fromEndDate?: InputMaybe; + includeOptimisticProposals?: InputMaybe; }>; -export type ListProposalsQuery = { __typename?: 'Query', proposals?: { __typename?: 'proposals_200_response', totalCount: number, items: Array<{ __typename?: 'query_proposals_items_items', id: string, daoId: string, proposerAccountId: string, title: string, description: string, startBlock: number, endBlock: number, endTimestamp: string, timestamp: string, status: string, forVotes: string, againstVotes: string, abstainVotes: string, txHash: string } | null> } | null }; +export type ListProposalsQuery = { __typename?: 'Query', proposals?: { __typename?: 'OnchainProposalsResponse', totalCount: number, items: Array<{ __typename?: 'OnchainProposal', id: string, daoId: string, proposerAccountId: string, title: string, description: string, startBlock: number, endBlock: number, endTimestamp: number, timestamp: number, status: string, forVotes: string, againstVotes: string, abstainVotes: string, txHash: string } | null> } | null }; export type GetEventRelevanceThresholdQueryVariables = Exact<{ - relevance: QueryInput_GetEventRelevanceThreshold_Relevance; - type: QueryInput_GetEventRelevanceThreshold_Type; + relevance: FeedRelevance; + type: FeedEventType; }>; -export type GetEventRelevanceThresholdQuery = { __typename?: 'Query', getEventRelevanceThreshold?: { __typename?: 'getEventRelevanceThreshold_200_response', threshold: string } | null }; +export type GetEventRelevanceThresholdQuery = { __typename?: 'Query', getEventRelevanceThreshold?: { __typename?: 'EventRelevanceThresholdResponse', threshold: string } | null }; export type ListVotesQueryVariables = Exact<{ - voterAddressIn?: InputMaybe; - fromDate?: InputMaybe; - toDate?: InputMaybe; - limit?: InputMaybe; - skip?: InputMaybe; + voterAddressIn?: InputMaybe> | InputMaybe>; + fromDate?: InputMaybe; + toDate?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - support?: InputMaybe; + orderDirection?: InputMaybe; + support?: InputMaybe; }>; -export type ListVotesQuery = { __typename?: 'Query', votes?: { __typename?: 'votes_200_response', totalCount: number, items: Array<{ __typename?: 'query_votes_items_items', transactionHash: string, proposalId: string, voterAddress: string, support?: number | null, votingPower: string, timestamp: number, reason?: string | null, proposalTitle?: string | null } | null> } | null }; +export type ListVotesQuery = { __typename?: 'Query', votes?: { __typename?: 'OnchainVotesResponse', totalCount: number, items: Array<{ __typename?: 'OnchainVote', transactionHash: string, proposalId: string, voterAddress: string, support?: string | null, votingPower: string, timestamp: number, reason?: string | null, proposalTitle?: string | null } | null> } | null }; export type ListHistoricalVotingPowerQueryVariables = Exact<{ - limit?: InputMaybe; - skip?: InputMaybe; + limit?: InputMaybe; + skip?: InputMaybe; orderBy?: InputMaybe; - orderDirection?: InputMaybe; - fromDate?: InputMaybe; + orderDirection?: InputMaybe; + fromDate?: InputMaybe; address?: InputMaybe; }>; -export type ListHistoricalVotingPowerQuery = { __typename?: 'Query', historicalVotingPower?: { __typename?: 'historicalVotingPower_200_response', totalCount: number, items: Array<{ __typename?: 'query_historicalVotingPower_items_items', accountId: string, timestamp: string, votingPower: string, delta: string, daoId: string, transactionHash: string, logIndex: number, delegation?: { __typename?: 'query_historicalVotingPower_items_items_delegation', from: string, to: string, value: string, previousDelegate?: string | null } | null, transfer?: { __typename?: 'query_historicalVotingPower_items_items_transfer', from: string, to: string, value: string } | null } | null> } | null }; +export type ListHistoricalVotingPowerQuery = { __typename?: 'Query', historicalVotingPower?: { __typename?: 'HistoricalVotingPowersResponse', totalCount: number, items: Array<{ __typename?: 'HistoricalVotingPower', accountId: string, timestamp: string, votingPower: string, delta: string, daoId: string, transactionHash: string, logIndex: number, delegation?: { __typename?: 'HistoricalVotingPowerDelegation', from: string, to: string, value: string, previousDelegate?: string | null } | null, transfer?: { __typename?: 'HistoricalVotingPowerTransfer', from: string, to: string, value: string } | null } | null> } | null }; export const GetDaOsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDAOs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"daos"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"votingDelay"}},{"kind":"Field","name":{"kind":"Name","value":"chainId"}},{"kind":"Field","name":{"kind":"Name","value":"alreadySupportCalldataReview"}},{"kind":"Field","name":{"kind":"Name","value":"supportOffchainData"}}]}}]}}]}}]} as unknown as DocumentNode; -export const ListOffchainProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"NonNegativeInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositiveInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_offchainProposals_orderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"status"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offchainProposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"status"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"endDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"discussion"}},{"kind":"Field","name":{"kind":"Name","value":"link"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"end"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; -export const ListOffchainVotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainVotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"NonNegativeInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votesOffchain_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votesOffchain_orderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"votesOffchain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"toDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"voterAddresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"proposalTitle"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"vp"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; -export const ProposalNonVotersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProposalNonVoters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposalNonVoters"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"addresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetProposalByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProposalById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"daoId"}},{"kind":"Field","name":{"kind":"Name","value":"proposerAccountId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"startBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"forVotes"}},{"kind":"Field","name":{"kind":"Name","value":"againstVotes"}},{"kind":"Field","name":{"kind":"Name","value":"abstainVotes"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}}]}}]}}]} as unknown as DocumentNode; -export const ListProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"NonNegativeInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositiveInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_proposals_orderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"status"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromEndDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"includeOptimisticProposals"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_proposals_includeOptimisticProposals"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"status"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromEndDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromEndDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"includeOptimisticProposals"},"value":{"kind":"Variable","name":{"kind":"Name","value":"includeOptimisticProposals"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"daoId"}},{"kind":"Field","name":{"kind":"Name","value":"proposerAccountId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"startBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"forVotes"}},{"kind":"Field","name":{"kind":"Name","value":"againstVotes"}},{"kind":"Field","name":{"kind":"Name","value":"abstainVotes"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; -export const GetEventRelevanceThresholdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetEventRelevanceThreshold"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"relevance"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_getEventRelevanceThreshold_relevance"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"type"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_getEventRelevanceThreshold_type"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getEventRelevanceThreshold"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"relevance"},"value":{"kind":"Variable","name":{"kind":"Name","value":"relevance"}}},{"kind":"Argument","name":{"kind":"Name","value":"type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"type"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"threshold"}}]}}]}}]} as unknown as DocumentNode; -export const ListVotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListVotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"voterAddressIn"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"NonNegativeInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votes_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votes_orderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"support"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"votes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"voterAddressIn"},"value":{"kind":"Variable","name":{"kind":"Name","value":"voterAddressIn"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"toDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"support"},"value":{"kind":"Variable","name":{"kind":"Name","value":"support"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactionHash"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"voterAddress"}},{"kind":"Field","name":{"kind":"Name","value":"support"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"proposalTitle"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; -export const ListHistoricalVotingPowerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListHistoricalVotingPower"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositiveInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"NonNegativeInt"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_historicalVotingPower_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_historicalVotingPower_orderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"historicalVotingPower"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountId"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}},{"kind":"Field","name":{"kind":"Name","value":"delta"}},{"kind":"Field","name":{"kind":"Name","value":"daoId"}},{"kind":"Field","name":{"kind":"Name","value":"transactionHash"}},{"kind":"Field","name":{"kind":"Name","value":"logIndex"}},{"kind":"Field","name":{"kind":"Name","value":"delegation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"previousDelegate"}}]}},{"kind":"Field","name":{"kind":"Name","value":"transfer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const ListOffchainProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"status"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_offchainProposals_status_items"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offchainProposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"status"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"endDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"discussion"}},{"kind":"Field","name":{"kind":"Name","value":"link"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"end"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; +export const ListOffchainVotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainVotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votesOffchain_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"votesOffchain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"toDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"voterAddresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"proposalTitle"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"vp"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; +export const ProposalNonVotersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProposalNonVoters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposalNonVoters"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"addresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetProposalByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProposalById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"OnchainProposal"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"daoId"}},{"kind":"Field","name":{"kind":"Name","value":"proposerAccountId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"startBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"forVotes"}},{"kind":"Field","name":{"kind":"Name","value":"againstVotes"}},{"kind":"Field","name":{"kind":"Name","value":"abstainVotes"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}}]}}]}}]}}]} as unknown as DocumentNode; +export const ListProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"status"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_proposals_status_items"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromEndDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"includeOptimisticProposals"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"status"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromEndDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromEndDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"includeOptimisticProposals"},"value":{"kind":"Variable","name":{"kind":"Name","value":"includeOptimisticProposals"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"daoId"}},{"kind":"Field","name":{"kind":"Name","value":"proposerAccountId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"startBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endBlock"}},{"kind":"Field","name":{"kind":"Name","value":"endTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"forVotes"}},{"kind":"Field","name":{"kind":"Name","value":"againstVotes"}},{"kind":"Field","name":{"kind":"Name","value":"abstainVotes"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; +export const GetEventRelevanceThresholdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetEventRelevanceThreshold"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"relevance"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"FeedRelevance"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"type"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"FeedEventType"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getEventRelevanceThreshold"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"relevance"},"value":{"kind":"Variable","name":{"kind":"Name","value":"relevance"}}},{"kind":"Argument","name":{"kind":"Name","value":"type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"type"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"threshold"}}]}}]}}]} as unknown as DocumentNode; +export const ListVotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListVotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"voterAddressIn"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votes_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"support"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"votes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"voterAddressIn"},"value":{"kind":"Variable","name":{"kind":"Name","value":"voterAddressIn"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"toDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"support"},"value":{"kind":"Variable","name":{"kind":"Name","value":"support"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactionHash"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"voterAddress"}},{"kind":"Field","name":{"kind":"Name","value":"support"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"proposalTitle"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; +export const ListHistoricalVotingPowerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListHistoricalVotingPower"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_historicalVotingPower_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"historicalVotingPower"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountId"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}},{"kind":"Field","name":{"kind":"Name","value":"delta"}},{"kind":"Field","name":{"kind":"Name","value":"daoId"}},{"kind":"Field","name":{"kind":"Name","value":"transactionHash"}},{"kind":"Field","name":{"kind":"Name","value":"logIndex"}},{"kind":"Field","name":{"kind":"Name","value":"delegation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"previousDelegate"}}]}},{"kind":"Field","name":{"kind":"Name","value":"transfer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/packages/anticapture-client/src/index.ts b/packages/anticapture-client/src/index.ts index b0a36723..0c91943c 100644 --- a/packages/anticapture-client/src/index.ts +++ b/packages/anticapture-client/src/index.ts @@ -18,13 +18,11 @@ export type { // Export GraphQL enums export { - QueryInput_Proposals_OrderDirection, + OrderDirection, QueryInput_HistoricalVotingPower_OrderBy, - QueryInput_HistoricalVotingPower_OrderDirection, + QueryInput_Proposals_Status_Items, QueryInput_Votes_OrderBy, - QueryInput_Votes_OrderDirection, QueryInput_VotesOffchain_OrderBy, - QueryInput_VotesOffchain_OrderDirection } from './gql/graphql'; export { FeedEventType, FeedRelevance } from './schemas'; diff --git a/packages/anticapture-client/src/schemas.ts b/packages/anticapture-client/src/schemas.ts index 59f5dd4a..f7996cff 100644 --- a/packages/anticapture-client/src/schemas.ts +++ b/packages/anticapture-client/src/schemas.ts @@ -1,8 +1,8 @@ import { z } from 'zod'; export { - QueryInput_GetEventRelevanceThreshold_Type as FeedEventType, - QueryInput_GetEventRelevanceThreshold_Relevance as FeedRelevance, + FeedEventType, + FeedRelevance, } from './gql/graphql'; // Schema with built-in transformation and fallbacks @@ -86,11 +86,11 @@ export const SafeVotesResponseSchema = z.object({ transactionHash: z.string(), proposalId: z.string(), voterAddress: z.string(), - support: z.number(), + support: z.string().nullable().optional(), votingPower: z.string(), timestamp: z.number(), reason: z.string().nullable().optional(), - proposalTitle: z.string(), + proposalTitle: z.string().nullable().optional(), }).nullable()), totalCount: z.number(), }).nullable(), From ac4a10db3e29319bdc75b349a3ac0537141d56b8 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Tue, 7 Apr 2026 16:22:46 -0300 Subject: [PATCH 25/30] refactor: align logic-system and dispatcher with updated anticapture-client types Replaces string literal statuses and deprecated per-query direction enums with the new shared QueryInput_Proposals_Status_Items and OrderDirection enums. Cleans up parseInt() calls where timestamps are now typed as numbers. Co-Authored-By: Claude Sonnet 4.6 --- .../triggers/non-voting-handler.service.ts | 10 ++++---- apps/logic-system/src/config/env.ts | 3 ++- .../src/interfaces/proposal.interface.ts | 24 ++++++------------- .../src/repositories/proposal.repository.ts | 20 ++++++++-------- .../repositories/voting-power.repository.ts | 6 ++--- .../src/triggers/new-proposal-trigger.ts | 2 +- .../src/triggers/proposal-finished-trigger.ts | 13 +++++++--- .../src/triggers/voting-reminder-trigger.ts | 13 +++++----- 8 files changed, 45 insertions(+), 46 deletions(-) diff --git a/apps/dispatcher/src/services/triggers/non-voting-handler.service.ts b/apps/dispatcher/src/services/triggers/non-voting-handler.service.ts index 3ee6d440..f9e69d3c 100644 --- a/apps/dispatcher/src/services/triggers/non-voting-handler.service.ts +++ b/apps/dispatcher/src/services/triggers/non-voting-handler.service.ts @@ -3,7 +3,7 @@ import { DispatcherMessage, MessageProcessingResult } from '../../interfaces/dis import { ISubscriptionClient } from '../../interfaces/subscription-client.interface'; import { NotificationClientFactory } from '../notification/notification-factory.service'; import { ProposalFinishedNotification } from '../../interfaces/notification-client.interface'; -import { AnticaptureClient, QueryInput_Proposals_OrderDirection } from '@notification-system/anticapture-client'; +import { AnticaptureClient, OrderDirection } from '@notification-system/anticapture-client'; import { BatchNotificationService } from '../batch-notification.service'; import { FormattingService } from '../formatting.service'; import { ValidationService } from '../validation.service'; @@ -161,9 +161,9 @@ export class NonVotingHandler extends BaseTriggerHandler { const proposals = await this.anticaptureClient!.listProposals({ - status: ['EXECUTED', 'SUCCEEDED', 'DEFEATED', 'EXPIRED', 'CANCELED'], + status: ['EXECUTED', 'SUCCEEDED', 'DEFEATED', 'EXPIRED', 'CANCELED'] as any, limit: NonVotingHandler.PROPOSALS_TO_CHECK * NonVotingHandler.FETCH_MARGIN_MULTIPLIER, - orderDirection: QueryInput_Proposals_OrderDirection.Desc + orderDirection: OrderDirection.Desc }, daoId); // If proposals is undefined or empty, return empty array @@ -174,13 +174,13 @@ export class NonVotingHandler extends BaseTriggerHandler { if (!a || !b) return 0; - return parseInt(b.endTimestamp) - parseInt(a.endTimestamp); + return (b.endTimestamp ?? 0) - (a.endTimestamp ?? 0); }); // Filter proposals that ended up to the current moment (includes current) // and get the most recent PROPOSALS_TO_CHECK proposals return sortedByEndTime - .filter(p => p && parseInt(p.endTimestamp) <= currentEndTimestamp) + .filter(p => p && (p.endTimestamp ?? 0) <= currentEndTimestamp) .slice(0, NonVotingHandler.PROPOSALS_TO_CHECK); } } \ No newline at end of file diff --git a/apps/logic-system/src/config/env.ts b/apps/logic-system/src/config/env.ts index 76ffa70e..d3bedb29 100644 --- a/apps/logic-system/src/config/env.ts +++ b/apps/logic-system/src/config/env.ts @@ -1,5 +1,6 @@ import dotenv from 'dotenv'; import { z } from 'zod'; +import { QueryInput_Proposals_Status_Items } from '@notification-system/anticapture-client'; // Load environment variables dotenv.config(); @@ -16,7 +17,7 @@ const envSchema = z.object({ BLOCKFUL_API_TOKEN: z.string().optional(), RABBITMQ_URL: z.string().url(), TRIGGER_INTERVAL: z.coerce.number().optional().default(60000), - PROPOSAL_STATUS: z.enum(validProposalStatuses), + PROPOSAL_STATUS: z.enum(validProposalStatuses).transform(s => s as QueryInput_Proposals_Status_Items), }); const _env = envSchema.safeParse(process.env); diff --git a/apps/logic-system/src/interfaces/proposal.interface.ts b/apps/logic-system/src/interfaces/proposal.interface.ts index 48351e8d..4dff010c 100644 --- a/apps/logic-system/src/interfaces/proposal.interface.ts +++ b/apps/logic-system/src/interfaces/proposal.interface.ts @@ -1,20 +1,10 @@ -import type { GetProposalByIdQuery } from '@notification-system/anticapture-client'; +import type { ListProposalsQuery } from '@notification-system/anticapture-client'; +import { QueryInput_Proposals_Status_Items } from '@notification-system/anticapture-client'; -export type ProposalOnChain = GetProposalByIdQuery['proposal']; +export type ProposalOnChain = NonNullable['items'][number]>; export type ProposalOrNull = ProposalOnChain | null; -/** - * Valid status values for a proposal - */ -export type ProposalStatus = - | 'PENDING' - | 'ACTIVE' - | 'SUCCEEDED' - | 'DEFEATED' - | 'EXECUTED' - | 'CANCELED' - | 'QUEUED' - | 'EXPIRED'; +export type ProposalStatus = QueryInput_Proposals_Status_Items; /** * Options for listing proposals (matches new API parameters) @@ -24,8 +14,8 @@ export interface ListProposalsOptions { skip?: number; /** Maximum number of proposals to return */ limit?: number; - /** Filter by status - can be string or array */ - status?: string | string[]; + /** Filter by status */ + status?: QueryInput_Proposals_Status_Items | QueryInput_Proposals_Status_Items[]; /** Filter by DAO (passed as header, not query param) */ daoId?: string; /** Filter proposals after this date (timestamp in seconds) */ @@ -33,7 +23,7 @@ export interface ListProposalsOptions { /** Filter proposals by end timestamp (timestamp in seconds) */ fromEndDate?: number; /** Order direction - asc or desc */ - orderDirection?: string; + orderDirection?: 'asc' | 'desc'; /** Whether to include optimistic proposals (true=include, false=exclude, undefined=both) */ includeOptimisticProposals?: boolean; } diff --git a/apps/logic-system/src/repositories/proposal.repository.ts b/apps/logic-system/src/repositories/proposal.repository.ts index 181b6bbf..b3435ea5 100644 --- a/apps/logic-system/src/repositories/proposal.repository.ts +++ b/apps/logic-system/src/repositories/proposal.repository.ts @@ -1,6 +1,5 @@ -import { QueryInput_Proposals_IncludeOptimisticProposals as boolEnum } from '@notification-system/anticapture-client/dist/gql/graphql'; import { ProposalDataSource, ProposalOnChain, ProposalOrNull, ListProposalsOptions } from '../interfaces/proposal.interface'; -import { AnticaptureClient, ListProposalsQueryVariables } from '@notification-system/anticapture-client'; +import { AnticaptureClient, ListProposalsQueryVariables, OrderDirection } from '@notification-system/anticapture-client'; export class ProposalRepository implements ProposalDataSource { private anticaptureClient: AnticaptureClient; @@ -10,13 +9,15 @@ export class ProposalRepository implements ProposalDataSource { } async getById(id: string): Promise { - return await this.anticaptureClient.getProposalById(id); + const proposal = await this.anticaptureClient.getProposalById(id); + if (!proposal || proposal.__typename !== 'OnchainProposal') return null; + return proposal; } async listAll(options?: ListProposalsOptions, limit: number = 100): Promise { const variables: ListProposalsQueryVariables = {}; - // Status filtering + // Status filtering if (options?.status) { variables.status = options.status; } @@ -32,7 +33,7 @@ export class ProposalRepository implements ProposalDataSource { // Optimistic proposal filtering if (options?.includeOptimisticProposals !== undefined) { - variables.includeOptimisticProposals = options.includeOptimisticProposals ? boolEnum.True : boolEnum.False; + variables.includeOptimisticProposals = options.includeOptimisticProposals; } // Pagination @@ -44,11 +45,10 @@ export class ProposalRepository implements ProposalDataSource { variables.skip = options.skip; } - // Ordering - enum requires cast - if (options?.orderDirection === 'asc') { - variables.orderDirection = 'asc' as any; - } else if (options?.orderDirection === 'desc') { - variables.orderDirection = 'desc' as any; + // Ordering + if (options?.orderDirection) { + const directionMap: Record<'asc' | 'desc', OrderDirection> = { asc: OrderDirection.Asc, desc: OrderDirection.Desc }; + variables.orderDirection = directionMap[options.orderDirection]; } const daoId = options?.daoId; diff --git a/apps/logic-system/src/repositories/voting-power.repository.ts b/apps/logic-system/src/repositories/voting-power.repository.ts index 4c4fc1ee..163df423 100644 --- a/apps/logic-system/src/repositories/voting-power.repository.ts +++ b/apps/logic-system/src/repositories/voting-power.repository.ts @@ -3,7 +3,7 @@ import { ListHistoricalVotingPowerQueryVariables, ProcessedVotingPowerHistory, QueryInput_HistoricalVotingPower_OrderBy, - QueryInput_HistoricalVotingPower_OrderDirection + OrderDirection } from '@notification-system/anticapture-client'; export class VotingPowerRepository { @@ -17,9 +17,9 @@ export class VotingPowerRepository { const variables: ListHistoricalVotingPowerQueryVariables = { // Always order by timestamp ascending for chronological processing orderBy: QueryInput_HistoricalVotingPower_OrderBy.Timestamp, - orderDirection: QueryInput_HistoricalVotingPower_OrderDirection.Asc, + orderDirection: OrderDirection.Asc, limit: 100, - fromDate: timestampGt + fromDate: parseInt(timestampGt) }; return await this.anticaptureClient.listVotingPowerHistory(variables); diff --git a/apps/logic-system/src/triggers/new-proposal-trigger.ts b/apps/logic-system/src/triggers/new-proposal-trigger.ts index 4b3aff8f..1f592a2e 100644 --- a/apps/logic-system/src/triggers/new-proposal-trigger.ts +++ b/apps/logic-system/src/triggers/new-proposal-trigger.ts @@ -55,7 +55,7 @@ export class NewProposalTrigger extends Trigger { - private readonly finishedStatuses = ['EXECUTED', 'DEFEATED', 'SUCCEEDED', 'EXPIRED', 'CANCELED']; + private readonly finishedStatuses: QueryInput_Proposals_Status_Items[] = [ + QueryInput_Proposals_Status_Items.Executed, + QueryInput_Proposals_Status_Items.Defeated, + QueryInput_Proposals_Status_Items.Succeeded, + QueryInput_Proposals_Status_Items.Expired, + QueryInput_Proposals_Status_Items.Canceled, + ]; private endTimestampCursor: number; constructor( @@ -58,9 +65,9 @@ export class ProposalFinishedTrigger extends Trigger { const notifications: ProposalFinishedNotification[] = data.map(proposal => ({ id: proposal?.id || '', daoId: proposal?.daoId || '', - title: proposal?.title || undefined, + ...(proposal?.title ? { title: proposal.title } : {}), description: proposal?.description || '', - endTimestamp: proposal?.endTimestamp ? parseInt(proposal.endTimestamp) : 0, + endTimestamp: Number(proposal?.endTimestamp) || 0, status: proposal?.status || 'unknown', forVotes: proposal?.forVotes || '0', againstVotes: proposal?.againstVotes || '0', diff --git a/apps/logic-system/src/triggers/voting-reminder-trigger.ts b/apps/logic-system/src/triggers/voting-reminder-trigger.ts index cbb3785f..897df47b 100644 --- a/apps/logic-system/src/triggers/voting-reminder-trigger.ts +++ b/apps/logic-system/src/triggers/voting-reminder-trigger.ts @@ -6,6 +6,7 @@ import { Trigger } from './base-trigger'; import { ProposalOnChain, ProposalDataSource } from '../interfaces/proposal.interface'; +import { QueryInput_Proposals_Status_Items } from '@notification-system/anticapture-client'; import { DispatcherService, DispatcherMessage } from '../interfaces/dispatcher.interface'; /** @@ -85,9 +86,9 @@ export class VotingReminderTrigger extends Trigger { return false; } - const startTime = parseInt(proposal.timestamp); - const endTime = parseInt(proposal.endTimestamp); - + const startTime = Number(proposal.timestamp); + const endTime = Number(proposal.endTimestamp); + // Skip if proposal is not active if (now <= startTime || now >= endTime) { return false; @@ -131,8 +132,8 @@ export class VotingReminderTrigger extends Trigger { } const now = Math.floor(Date.now() / 1000); - const startTime = parseInt(proposal.timestamp); - const endTime = parseInt(proposal.endTimestamp); + const startTime = Number(proposal.timestamp); + const endTime = Number(proposal.endTimestamp); const timeElapsedPercentage = this.calculateTimeElapsedPercentage(startTime, endTime, now); return { @@ -153,7 +154,7 @@ export class VotingReminderTrigger extends Trigger { */ protected async fetchData(): Promise { return await this.proposalRepository.listAll({ - status: 'ACTIVE', + status: QueryInput_Proposals_Status_Items.Active, includeOptimisticProposals: false }); } From ff0ff4c9cce967b38041e58b24af8d990eb9ec65 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Tue, 7 Apr 2026 16:22:52 -0300 Subject: [PATCH 26/30] fix: change vote support field type from number to string Updates all vote event fixtures and test data to pass support as a string ('0', '1', '2') instead of a number, matching the updated API schema type. Co-Authored-By: Claude Sonnet 4.6 --- .../vote-confirmation-trigger.service.test.ts | 6 +++--- .../src/fixtures/factories/vote-factory.ts | 4 ++-- .../tests/core/address-normalization.test.ts | 2 +- .../slack/vote-confirmation-trigger.test.ts | 16 ++++++++-------- .../telegram/vote-confirmation-trigger.test.ts | 16 ++++++++-------- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/apps/dispatcher/src/services/triggers/vote-confirmation-trigger.service.test.ts b/apps/dispatcher/src/services/triggers/vote-confirmation-trigger.service.test.ts index 2e512660..b5829559 100644 --- a/apps/dispatcher/src/services/triggers/vote-confirmation-trigger.service.test.ts +++ b/apps/dispatcher/src/services/triggers/vote-confirmation-trigger.service.test.ts @@ -44,9 +44,9 @@ describe('VoteConfirmationTriggerHandler', () => { await handler.handleMessage({ triggerId: NotificationTypeId.VoteConfirmation, events: [ - { daoId: 'test-dao', proposalId: 'proposal-1', voterAddress: '0xVoter123', support: 1, votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 1' }, - { daoId: 'test-dao', proposalId: 'proposal-2', voterAddress: '0xVoter123', support: 0, votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 2' }, - { daoId: 'test-dao', proposalId: 'proposal-3', voterAddress: '0xVoter123', support: 2, votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 3' }, + { daoId: 'test-dao', proposalId: 'proposal-1', voterAddress: '0xVoter123', support: '1', votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 1' }, + { daoId: 'test-dao', proposalId: 'proposal-2', voterAddress: '0xVoter123', support: '0', votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 2' }, + { daoId: 'test-dao', proposalId: 'proposal-3', voterAddress: '0xVoter123', support: '2', votingPower: '1000000000000000000', timestamp: 1767225600, transactionHash: '0xSameTxHash', proposalTitle: 'Proposal 3' }, ] }); diff --git a/apps/integrated-tests/src/fixtures/factories/vote-factory.ts b/apps/integrated-tests/src/fixtures/factories/vote-factory.ts index ac9f2e58..61547a34 100644 --- a/apps/integrated-tests/src/fixtures/factories/vote-factory.ts +++ b/apps/integrated-tests/src/fixtures/factories/vote-factory.ts @@ -4,7 +4,7 @@ export interface VoteData { proposalId: string; voterAddress: string; daoId: string; - support: number; + support: string; reason?: string | null; timestamp: number; transactionHash: string; @@ -34,7 +34,7 @@ export class VoteFactory { proposalId, voterAddress, daoId, - support: 1, + support: '1', timestamp: Math.floor(Date.now() / 1000), transactionHash: `0x${uuidv4().replace(/-/g, '')}${uuidv4().replace(/-/g, '').substring(0, 8)}`, votingPower: '1000000000000000000', diff --git a/apps/integrated-tests/tests/core/address-normalization.test.ts b/apps/integrated-tests/tests/core/address-normalization.test.ts index 433b46e5..9b065ad7 100644 --- a/apps/integrated-tests/tests/core/address-normalization.test.ts +++ b/apps/integrated-tests/tests/core/address-normalization.test.ts @@ -51,7 +51,7 @@ describe('Address Normalization - Integration Test', () => { transactionHash: '0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890', proposalId: 'prop-checksum-test', voterAddress: voterAddressChecksum, - support: 1, // FOR + support: '1', // FOR votingPower: '1000000000000000000000', // 1000 tokens timestamp: eventTimestamp, reason: 'Testing checksum normalization!', diff --git a/apps/integrated-tests/tests/slack/vote-confirmation-trigger.test.ts b/apps/integrated-tests/tests/slack/vote-confirmation-trigger.test.ts index 2be3c382..74f49e5b 100644 --- a/apps/integrated-tests/tests/slack/vote-confirmation-trigger.test.ts +++ b/apps/integrated-tests/tests/slack/vote-confirmation-trigger.test.ts @@ -75,7 +75,7 @@ describe('Slack Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', proposalId: 'prop-for-123', voterAddress: voterAddress, - support: 1, // FOR + support: '1', // FOR votingPower: '1000000000000000000000', // 1000 tokens timestamp: eventTimestamp, reason: 'Great proposal!', @@ -141,7 +141,7 @@ describe('Slack Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x2345678901bcdef2345678901bcdef2345678901bcdef2345678901bcdef2345', proposalId: 'prop-against-456', voterAddress: voterAddress, - support: 0, // AGAINST + support: '0', // AGAINST votingPower: '5000000000000000000000', // 5000 tokens timestamp: eventTimestamp, reason: 'Needs more discussion', @@ -199,7 +199,7 @@ describe('Slack Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x3456789012cdef3456789012cdef3456789012cdef3456789012cdef34567890', proposalId: 'prop-abstain-789', voterAddress: voterAddress, - support: 2, // ABSTAIN + support: '2', // ABSTAIN votingPower: '2000000000000000000000', // 2000 tokens timestamp: eventTimestamp, // No reason provided for abstain @@ -257,7 +257,7 @@ describe('Slack Vote Confirmation Trigger - Integration Test', () => { transactionHash: sameTxHash, proposalId: 'prop-dup-123', voterAddress: voterAddress, - support: 1, + support: '1', votingPower: '1000000000000000000000', timestamp: eventTimestamp, proposalTitle: 'Duplicate Test Proposal' @@ -321,7 +321,7 @@ describe('Slack Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x5678901234ef5678901234ef5678901234ef5678901234ef5678901234ef5678', proposalId: 'prop-multi-1', voterAddress: voterAddress, - support: 1, // FOR + support: '1', // FOR votingPower: '1000000000000000000000', timestamp: baseTimestamp, proposalTitle: 'Multi Vote Proposal 1' @@ -331,7 +331,7 @@ describe('Slack Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x6789012345f6789012345f6789012345f6789012345f6789012345f6789012345', proposalId: 'prop-multi-2', voterAddress: voterAddress, - support: 0, // AGAINST + support: '0', // AGAINST votingPower: '1000000000000000000000', timestamp: baseTimestamp + 1, proposalTitle: 'Multi Vote Proposal 2' @@ -341,7 +341,7 @@ describe('Slack Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x78901234567890123456789012345678901234567890123456789012345678ab', proposalId: 'prop-multi-3', voterAddress: voterAddress, - support: 2, // ABSTAIN + support: '2', // ABSTAIN votingPower: '1000000000000000000000', timestamp: baseTimestamp + 2, proposalTitle: 'Multi Vote Proposal 3' @@ -408,7 +408,7 @@ describe('Slack Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x890123456789012345678901234567890123456789012345678901234567890cd', proposalId: 'prop-nosub', voterAddress: voterAddress, - support: 1, + support: '1', votingPower: '1000000000000000000000', timestamp: eventTimestamp, proposalTitle: 'No Subscription Proposal' diff --git a/apps/integrated-tests/tests/telegram/vote-confirmation-trigger.test.ts b/apps/integrated-tests/tests/telegram/vote-confirmation-trigger.test.ts index c6723e72..3077530c 100644 --- a/apps/integrated-tests/tests/telegram/vote-confirmation-trigger.test.ts +++ b/apps/integrated-tests/tests/telegram/vote-confirmation-trigger.test.ts @@ -52,7 +52,7 @@ describe('Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', proposalId: 'prop-for-123', voterAddress: voterAddress, - support: 1, // FOR + support: '1', // FOR votingPower: '1000000000000000000000', // 1000 tokens timestamp: eventTimestamp, reason: 'Great proposal!', @@ -110,7 +110,7 @@ describe('Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x2345678901bcdef2345678901bcdef2345678901bcdef2345678901bcdef2345', proposalId: 'prop-against-456', voterAddress: voterAddress, - support: 0, // AGAINST + support: '0', // AGAINST votingPower: '5000000000000000000000', // 5000 tokens timestamp: eventTimestamp, reason: 'Needs more discussion', @@ -165,7 +165,7 @@ describe('Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x3456789012cdef3456789012cdef3456789012cdef3456789012cdef34567890', proposalId: 'prop-abstain-789', voterAddress: voterAddress, - support: 2, // ABSTAIN + support: '2', // ABSTAIN votingPower: '2000000000000000000000', // 2000 tokens timestamp: eventTimestamp, // No reason provided for abstain @@ -220,7 +220,7 @@ describe('Vote Confirmation Trigger - Integration Test', () => { transactionHash: sameTxHash, proposalId: 'prop-dup-123', voterAddress: voterAddress, - support: 1, + support: '1', votingPower: '1000000000000000000000', timestamp: eventTimestamp, proposalTitle: 'Duplicate Test Proposal' @@ -285,7 +285,7 @@ describe('Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x5678901234ef5678901234ef5678901234ef5678901234ef5678901234ef5678', proposalId: 'prop-multi-1', voterAddress: voterAddress, - support: 1, // FOR + support: '1', // FOR votingPower: '1000000000000000000000', timestamp: baseTimestamp, proposalTitle: 'Multi Vote Proposal 1' @@ -295,7 +295,7 @@ describe('Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x6789012345f6789012345f6789012345f6789012345f6789012345f6789012345', proposalId: 'prop-multi-2', voterAddress: voterAddress, - support: 0, // AGAINST + support: '0', // AGAINST votingPower: '1000000000000000000000', timestamp: baseTimestamp + 1, proposalTitle: 'Multi Vote Proposal 2' @@ -305,7 +305,7 @@ describe('Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x78901234567890123456789012345678901234567890123456789012345678ab', proposalId: 'prop-multi-3', voterAddress: voterAddress, - support: 2, // ABSTAIN + support: '2', // ABSTAIN votingPower: '1000000000000000000000', timestamp: baseTimestamp + 2, proposalTitle: 'Multi Vote Proposal 3' @@ -367,7 +367,7 @@ describe('Vote Confirmation Trigger - Integration Test', () => { transactionHash: '0x890123456789012345678901234567890123456789012345678901234567890cd', proposalId: 'prop-nosub', voterAddress: voterAddress, - support: 1, + support: '1', votingPower: '1000000000000000000000', timestamp: eventTimestamp, proposalTitle: 'No Subscription Proposal' From 150b1e19eb7a26de4e357e337b6c59a9dd1fda86 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Thu, 9 Apr 2026 14:22:55 -0300 Subject: [PATCH 27/30] refactor: generated files --- packages/anticapture-client/dist/gql/gql.d.ts | 4 +- packages/anticapture-client/dist/gql/gql.js | 2 +- .../anticapture-client/dist/gql/graphql.d.ts | 51 +++++++++++++----- .../anticapture-client/dist/gql/graphql.js | 12 ++++- .../offchain-proposal-non-voters.graphql | 8 +-- packages/anticapture-client/src/gql/gql.ts | 6 +-- .../anticapture-client/src/gql/graphql.ts | 53 +++++++++++++------ 7 files changed, 95 insertions(+), 41 deletions(-) diff --git a/packages/anticapture-client/dist/gql/gql.d.ts b/packages/anticapture-client/dist/gql/gql.d.ts index d08c99c1..a7504e37 100644 --- a/packages/anticapture-client/dist/gql/gql.d.ts +++ b/packages/anticapture-client/dist/gql/gql.d.ts @@ -13,7 +13,7 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document- */ type Documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": typeof types.GetDaOsDocument; - "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n items {\n voter\n votingPower\n }\n }\n}": typeof types.OffchainProposalNonVotersDocument; + "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n ... on OffchainVotersResponse {\n items {\n voter\n votingPower\n }\n }\n }\n}": typeof types.OffchainProposalNonVotersDocument; "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": typeof types.ListOffchainProposalsDocument; "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": typeof types.ListOffchainVotesDocument; "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": typeof types.ProposalNonVotersDocument; @@ -43,7 +43,7 @@ export declare function graphql(source: "query GetDAOs {\n daos {\n items {\ /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export declare function graphql(source: "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n items {\n voter\n votingPower\n }\n }\n}"): (typeof documents)["query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n items {\n voter\n votingPower\n }\n }\n}"]; +export declare function graphql(source: "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n ... on OffchainVotersResponse {\n items {\n voter\n votingPower\n }\n }\n }\n}"): (typeof documents)["query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n ... on OffchainVotersResponse {\n items {\n voter\n votingPower\n }\n }\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/anticapture-client/dist/gql/gql.js b/packages/anticapture-client/dist/gql/gql.js index 7b377622..b0f4bfe2 100644 --- a/packages/anticapture-client/dist/gql/gql.js +++ b/packages/anticapture-client/dist/gql/gql.js @@ -38,7 +38,7 @@ exports.graphql = graphql; const types = __importStar(require("./graphql")); const documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": types.GetDaOsDocument, - "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n items {\n voter\n votingPower\n }\n }\n}": types.OffchainProposalNonVotersDocument, + "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n ... on OffchainVotersResponse {\n items {\n voter\n votingPower\n }\n }\n }\n}": types.OffchainProposalNonVotersDocument, "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": types.ListOffchainProposalsDocument, "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": types.ListOffchainVotesDocument, "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": types.ProposalNonVotersDocument, diff --git a/packages/anticapture-client/dist/gql/graphql.d.ts b/packages/anticapture-client/dist/gql/graphql.d.ts index 7f31537f..4ad53604 100644 --- a/packages/anticapture-client/dist/gql/graphql.d.ts +++ b/packages/anticapture-client/dist/gql/graphql.d.ts @@ -370,6 +370,11 @@ export type LastUpdateResponse = { /** Latest refresh time in ISO-8601 format. */ lastUpdate: Scalars['DateTime']['output']; }; +export type OffchainNonVoter = { + __typename?: 'OffchainNonVoter'; + voter: Scalars['String']['output']; + votingPower: Scalars['String']['output']; +}; export type OffchainProposal = { __typename?: 'OffchainProposal'; /** Address or ENS of the author. */ @@ -413,7 +418,7 @@ export type OffchainProposalsResponse = { }; export type OffchainVote = { __typename?: 'OffchainVote'; - choice: Scalars['JSON']['output']; + choice?: Maybe>>; created: Scalars['Int']['output']; proposalId: Scalars['String']['output']; proposalTitle?: Maybe; @@ -421,6 +426,11 @@ export type OffchainVote = { voter: Scalars['String']['output']; vp?: Maybe; }; +export type OffchainVotersResponse = { + __typename?: 'OffchainVotersResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; export type OffchainVotesResponse = { __typename?: 'OffchainVotesResponse'; items: Array>; @@ -659,6 +669,8 @@ export type Query = { getLiquidTreasury?: Maybe; /** Get historical Total Treasury (liquid treasury + DAO token treasury) */ getTotalTreasury?: Maybe; + /** Check API and database health */ + health?: Maybe; /** Returns historical balance deltas for one account, enriched with the transfer that caused each change. */ historicalBalances?: Maybe; /** Get historical delegations for an account, with optional filtering and sorting */ @@ -674,7 +686,7 @@ export type Query = { /** Returns a single offchain (Snapshot) proposal by its ID */ offchainProposalById?: Maybe; /** Returns the active delegates that did not vote on a given offchain proposal */ - offchainProposalNonVoters?: Maybe; + offchainProposalNonVoters?: Maybe; /** Returns a list of offchain (Snapshot) proposals */ offchainProposals?: Maybe; /** Returns a single proposal by its ID */ @@ -1275,6 +1287,9 @@ export type VotingPowersResponse = { /** Total number of matching voting power rows. */ totalCount: Scalars['Int']['output']; }; +export declare enum Error_Const { + Error = "error" +} export type GetAddress_200_Response = { __typename?: 'getAddress_200_response'; /** EIP-55 checksummed Ethereum address */ @@ -1289,12 +1304,23 @@ export type GetAddresses_200_Response = { /** Enrichment results for each successfully resolved address. Addresses that failed to resolve are omitted. */ results: Array>; }; -export type OffchainProposalById_Response = ErrorResponse | OffchainProposal; -export type OffchainProposalNonVoters_200_Response = { - __typename?: 'offchainProposalNonVoters_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; +export type Health_200_Response = { + __typename?: 'health_200_response'; + database: Ok_Const; + status: Ok_Const; +}; +export type Health_503_Response = { + __typename?: 'health_503_response'; + database: Error_Const; + message: Scalars['String']['output']; + status: Error_Const; }; +export type Health_Response = Health_200_Response | Health_503_Response; +export type OffchainProposalById_Response = ErrorResponse | OffchainProposal; +export type OffchainProposalNonVoters_Response = ErrorResponse | OffchainVotersResponse; +export declare enum Ok_Const { + Ok = "ok" +} export type Proposal_Response = ErrorResponse | OnchainProposal; export declare enum QueryInput_AccountBalances_OrderBy { Balance = "balance", @@ -1493,11 +1519,6 @@ export type Query_GetAddresses_Results_Items_Ens = { /** Primary ENS name reverse-resolved for this address */ name?: Maybe; }; -export type Query_OffchainProposalNonVoters_Items_Items = { - __typename?: 'query_offchainProposalNonVoters_items_items'; - voter: Scalars['String']['output']; - votingPower: Scalars['String']['output']; -}; export type Query_OffchainProposals_Items_Items_Strategies_Items = { __typename?: 'query_offchainProposals_items_items_strategies_items'; name: Scalars['String']['output']; @@ -1530,9 +1551,11 @@ export type OffchainProposalNonVotersQueryVariables = Exact<{ export type OffchainProposalNonVotersQuery = { __typename?: 'Query'; offchainProposalNonVoters?: { - __typename?: 'offchainProposalNonVoters_200_response'; + __typename?: 'ErrorResponse'; + } | { + __typename?: 'OffchainVotersResponse'; items: Array<{ - __typename?: 'query_offchainProposalNonVoters_items_items'; + __typename?: 'OffchainNonVoter'; voter: string; votingPower: string; } | null>; diff --git a/packages/anticapture-client/dist/gql/graphql.js b/packages/anticapture-client/dist/gql/graphql.js index aadcf593..3100cc35 100644 --- a/packages/anticapture-client/dist/gql/graphql.js +++ b/packages/anticapture-client/dist/gql/graphql.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.ListHistoricalVotingPowerDocument = exports.ListVotesDocument = exports.GetEventRelevanceThresholdDocument = exports.ListProposalsDocument = exports.GetProposalByIdDocument = exports.ProposalNonVotersDocument = exports.ListOffchainVotesDocument = exports.ListOffchainProposalsDocument = exports.OffchainProposalNonVotersDocument = exports.GetDaOsDocument = exports.QueryInput_VotingPowers_OrderBy = exports.QueryInput_Votes_OrderBy = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_VotesOffchainByProposalId_OrderBy = exports.QueryInput_VotesByProposalId_OrderBy = exports.QueryInput_Transfers_OrderBy = exports.QueryInput_Transactions_Includes_Items = exports.QueryInput_Transactions_AffectedSupply_Items = exports.QueryInput_Token_Currency = exports.QueryInput_TokenMetrics_MetricType = exports.QueryInput_Proposals_Status_Items = exports.QueryInput_ProposalsActivity_UserVoteFilter = exports.QueryInput_ProposalsActivity_OrderBy = exports.QueryInput_OffchainProposals_Status_Items = exports.QueryInput_LastUpdate_Chart = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.QueryInput_HistoricalVotingPowerByAccountId_OrderBy = exports.QueryInput_HistoricalBalances_OrderBy = exports.QueryInput_FeedEvents_Type = exports.QueryInput_FeedEvents_Relevance = exports.QueryInput_FeedEvents_OrderBy = exports.QueryInput_Delegators_OrderBy = exports.QueryInput_AccountInteractions_OrderBy = exports.QueryInput_AccountBalances_OrderBy = exports.OrderDirection = exports.HttpMethod = exports.FeedRelevance = exports.FeedEventType = exports.DaysWindow = void 0; +exports.ListHistoricalVotingPowerDocument = exports.ListVotesDocument = exports.GetEventRelevanceThresholdDocument = exports.ListProposalsDocument = exports.GetProposalByIdDocument = exports.ProposalNonVotersDocument = exports.ListOffchainVotesDocument = exports.ListOffchainProposalsDocument = exports.OffchainProposalNonVotersDocument = exports.GetDaOsDocument = exports.QueryInput_VotingPowers_OrderBy = exports.QueryInput_Votes_OrderBy = exports.QueryInput_VotesOffchain_OrderBy = exports.QueryInput_VotesOffchainByProposalId_OrderBy = exports.QueryInput_VotesByProposalId_OrderBy = exports.QueryInput_Transfers_OrderBy = exports.QueryInput_Transactions_Includes_Items = exports.QueryInput_Transactions_AffectedSupply_Items = exports.QueryInput_Token_Currency = exports.QueryInput_TokenMetrics_MetricType = exports.QueryInput_Proposals_Status_Items = exports.QueryInput_ProposalsActivity_UserVoteFilter = exports.QueryInput_ProposalsActivity_OrderBy = exports.QueryInput_OffchainProposals_Status_Items = exports.QueryInput_LastUpdate_Chart = exports.QueryInput_HistoricalVotingPower_OrderBy = exports.QueryInput_HistoricalVotingPowerByAccountId_OrderBy = exports.QueryInput_HistoricalBalances_OrderBy = exports.QueryInput_FeedEvents_Type = exports.QueryInput_FeedEvents_Relevance = exports.QueryInput_FeedEvents_OrderBy = exports.QueryInput_Delegators_OrderBy = exports.QueryInput_AccountInteractions_OrderBy = exports.QueryInput_AccountBalances_OrderBy = exports.Ok_Const = exports.Error_Const = exports.OrderDirection = exports.HttpMethod = exports.FeedRelevance = exports.FeedEventType = exports.DaysWindow = void 0; var DaysWindow; (function (DaysWindow) { DaysWindow["7d"] = "_7d"; @@ -43,6 +43,14 @@ var OrderDirection; OrderDirection["Asc"] = "asc"; OrderDirection["Desc"] = "desc"; })(OrderDirection || (exports.OrderDirection = OrderDirection = {})); +var Error_Const; +(function (Error_Const) { + Error_Const["Error"] = "error"; +})(Error_Const || (exports.Error_Const = Error_Const = {})); +var Ok_Const; +(function (Ok_Const) { + Ok_Const["Ok"] = "ok"; +})(Ok_Const || (exports.Ok_Const = Ok_Const = {})); var QueryInput_AccountBalances_OrderBy; (function (QueryInput_AccountBalances_OrderBy) { QueryInput_AccountBalances_OrderBy["Balance"] = "balance"; @@ -212,7 +220,7 @@ var QueryInput_VotingPowers_OrderBy; QueryInput_VotingPowers_OrderBy["VotingPower"] = "votingPower"; })(QueryInput_VotingPowers_OrderBy || (exports.QueryInput_VotingPowers_OrderBy = QueryInput_VotingPowers_OrderBy = {})); exports.GetDaOsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetDAOs" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "daos" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingDelay" } }, { "kind": "Field", "name": { "kind": "Name", "value": "chainId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "alreadySupportCalldataReview" } }, { "kind": "Field", "name": { "kind": "Name", "value": "supportOffchainData" } }] } }] } }] } }] }; -exports.OffchainProposalNonVotersDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "OffchainProposalNonVoters" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "offchainProposalNonVoters" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "addresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }] } }] } }] } }] }; +exports.OffchainProposalNonVotersDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "OffchainProposalNonVoters" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "offchainProposalNonVoters" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "addresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "OffchainVotersResponse" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }, { "kind": "Field", "name": { "kind": "Name", "value": "votingPower" } }] } }] } }] } }] } }] }; exports.ListOffchainProposalsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainProposals" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_offchainProposals_status_items" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "offchainProposals" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "status" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "status" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "endDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "endDate" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "discussion" } }, { "kind": "Field", "name": { "kind": "Name", "value": "link" } }, { "kind": "Field", "name": { "kind": "Name", "value": "state" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "end" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; exports.ListOffchainVotesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffchainVotes" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "queryInput_votesOffchain_orderBy" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "OrderDirection" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "votesOffchain" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "fromDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "fromDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "toDate" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "toDate" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "limit" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "skip" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "skip" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderBy" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderBy" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "orderDirection" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "orderDirection" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "voterAddresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "voterAddresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }, { "kind": "Field", "name": { "kind": "Name", "value": "created" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "proposalTitle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "vp" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalCount" } }] } }] } }] }; exports.ProposalNonVotersDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ProposalNonVoters" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } }, "type": { "kind": "ListType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "proposalNonVoters" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "addresses" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "addresses" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "voter" } }] } }] } }] } }] }; diff --git a/packages/anticapture-client/queries/offchain-proposal-non-voters.graphql b/packages/anticapture-client/queries/offchain-proposal-non-voters.graphql index e6932774..bef1565e 100644 --- a/packages/anticapture-client/queries/offchain-proposal-non-voters.graphql +++ b/packages/anticapture-client/queries/offchain-proposal-non-voters.graphql @@ -1,8 +1,10 @@ query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) { offchainProposalNonVoters(id: $id, addresses: $addresses, orderDirection: $orderDirection) { - items { - voter - votingPower + ... on OffchainVotersResponse { + items { + voter + votingPower + } } } } diff --git a/packages/anticapture-client/src/gql/gql.ts b/packages/anticapture-client/src/gql/gql.ts index dd0f9b59..cce93fea 100644 --- a/packages/anticapture-client/src/gql/gql.ts +++ b/packages/anticapture-client/src/gql/gql.ts @@ -15,7 +15,7 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document- */ type Documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": typeof types.GetDaOsDocument, - "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n items {\n voter\n votingPower\n }\n }\n}": typeof types.OffchainProposalNonVotersDocument, + "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n ... on OffchainVotersResponse {\n items {\n voter\n votingPower\n }\n }\n }\n}": typeof types.OffchainProposalNonVotersDocument, "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": typeof types.ListOffchainProposalsDocument, "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": typeof types.ListOffchainVotesDocument, "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": typeof types.ProposalNonVotersDocument, @@ -26,7 +26,7 @@ type Documents = { }; const documents: Documents = { "query GetDAOs {\n daos {\n items {\n id\n votingDelay\n chainId\n alreadySupportCalldataReview\n supportOffchainData\n }\n }\n}": types.GetDaOsDocument, - "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n items {\n voter\n votingPower\n }\n }\n}": types.OffchainProposalNonVotersDocument, + "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n ... on OffchainVotersResponse {\n items {\n voter\n votingPower\n }\n }\n }\n}": types.OffchainProposalNonVotersDocument, "query ListOffchainProposals($skip: Int, $limit: Int, $orderDirection: OrderDirection, $status: [queryInput_offchainProposals_status_items], $fromDate: Int, $endDate: Int) {\n offchainProposals(\n skip: $skip\n limit: $limit\n orderDirection: $orderDirection\n status: $status\n fromDate: $fromDate\n endDate: $endDate\n ) {\n items {\n id\n title\n discussion\n link\n state\n created\n end\n }\n totalCount\n }\n}": types.ListOffchainProposalsDocument, "query ListOffchainVotes($fromDate: Int, $toDate: Int, $limit: Int, $skip: Int, $orderBy: queryInput_votesOffchain_orderBy, $orderDirection: OrderDirection, $voterAddresses: [String]) {\n votesOffchain(\n fromDate: $fromDate\n toDate: $toDate\n limit: $limit\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n voterAddresses: $voterAddresses\n ) {\n items {\n voter\n created\n proposalId\n proposalTitle\n reason\n vp\n }\n totalCount\n }\n}": types.ListOffchainVotesDocument, "query ProposalNonVoters($id: String!, $addresses: [String]) {\n proposalNonVoters(id: $id, addresses: $addresses) {\n items {\n voter\n }\n }\n}": types.ProposalNonVotersDocument, @@ -57,7 +57,7 @@ export function graphql(source: "query GetDAOs {\n daos {\n items {\n i /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n items {\n voter\n votingPower\n }\n }\n}"): (typeof documents)["query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n items {\n voter\n votingPower\n }\n }\n}"]; +export function graphql(source: "query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n ... on OffchainVotersResponse {\n items {\n voter\n votingPower\n }\n }\n }\n}"): (typeof documents)["query OffchainProposalNonVoters($id: String!, $addresses: [String], $orderDirection: OrderDirection) {\n offchainProposalNonVoters(\n id: $id\n addresses: $addresses\n orderDirection: $orderDirection\n ) {\n ... on OffchainVotersResponse {\n items {\n voter\n votingPower\n }\n }\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/anticapture-client/src/gql/graphql.ts b/packages/anticapture-client/src/gql/graphql.ts index ba647382..49da3a25 100644 --- a/packages/anticapture-client/src/gql/graphql.ts +++ b/packages/anticapture-client/src/gql/graphql.ts @@ -367,6 +367,12 @@ export type LastUpdateResponse = { lastUpdate: Scalars['DateTime']['output']; }; +export type OffchainNonVoter = { + __typename?: 'OffchainNonVoter'; + voter: Scalars['String']['output']; + votingPower: Scalars['String']['output']; +}; + export type OffchainProposal = { __typename?: 'OffchainProposal'; /** Address or ENS of the author. */ @@ -412,7 +418,7 @@ export type OffchainProposalsResponse = { export type OffchainVote = { __typename?: 'OffchainVote'; - choice: Scalars['JSON']['output']; + choice?: Maybe>>; created: Scalars['Int']['output']; proposalId: Scalars['String']['output']; proposalTitle?: Maybe; @@ -421,6 +427,12 @@ export type OffchainVote = { vp?: Maybe; }; +export type OffchainVotersResponse = { + __typename?: 'OffchainVotersResponse'; + items: Array>; + totalCount: Scalars['Int']['output']; +}; + export type OffchainVotesResponse = { __typename?: 'OffchainVotesResponse'; items: Array>; @@ -672,6 +684,8 @@ export type Query = { getLiquidTreasury?: Maybe; /** Get historical Total Treasury (liquid treasury + DAO token treasury) */ getTotalTreasury?: Maybe; + /** Check API and database health */ + health?: Maybe; /** Returns historical balance deltas for one account, enriched with the transfer that caused each change. */ historicalBalances?: Maybe; /** Get historical delegations for an account, with optional filtering and sorting */ @@ -687,7 +701,7 @@ export type Query = { /** Returns a single offchain (Snapshot) proposal by its ID */ offchainProposalById?: Maybe; /** Returns the active delegates that did not vote on a given offchain proposal */ - offchainProposalNonVoters?: Maybe; + offchainProposalNonVoters?: Maybe; /** Returns a list of offchain (Snapshot) proposals */ offchainProposals?: Maybe; /** Returns a single proposal by its ID */ @@ -1434,15 +1448,28 @@ export type GetAddresses_200_Response = { results: Array>; }; -export type OffchainProposalById_Response = ErrorResponse | OffchainProposal; +export type Health_200_Response = { + __typename?: 'health_200_response'; + database: Ok_Const; + status: Ok_Const; +}; -export type OffchainProposalNonVoters_200_Response = { - __typename?: 'offchainProposalNonVoters_200_response'; - items: Array>; - totalCount: Scalars['Float']['output']; +export type Health_503_Response = { + __typename?: 'health_503_response'; + database: Error_Const; + message: Scalars['String']['output']; + status: Error_Const; }; -export type Proposal_Response = ErrorResponse | OnchainProposal; +export type Health_Response = Health_200_Response | Health_503_Response; + +export type OffchainProposalById_Response = ErrorResponse | OffchainProposal; + +export type OffchainProposalNonVoters_Response = ErrorResponse | OffchainVotersResponse; + +export enum Ok_Const { + Ok = 'ok' +} export type Proposal_Response = ErrorResponse | OnchainProposal; @@ -1672,12 +1699,6 @@ export type Query_GetAddresses_Results_Items_Ens = { name?: Maybe; }; -export type Query_OffchainProposalNonVoters_Items_Items = { - __typename?: 'query_offchainProposalNonVoters_items_items'; - voter: Scalars['String']['output']; - votingPower: Scalars['String']['output']; -}; - export type Query_OffchainProposals_Items_Items_Strategies_Items = { __typename?: 'query_offchainProposals_items_items_strategies_items'; name: Scalars['String']['output']; @@ -1699,7 +1720,7 @@ export type OffchainProposalNonVotersQueryVariables = Exact<{ }>; -export type OffchainProposalNonVotersQuery = { __typename?: 'Query', offchainProposalNonVoters?: { __typename?: 'offchainProposalNonVoters_200_response', items: Array<{ __typename?: 'query_offchainProposalNonVoters_items_items', voter: string, votingPower: string } | null> } | null }; +export type OffchainProposalNonVotersQuery = { __typename?: 'Query', offchainProposalNonVoters?: { __typename?: 'ErrorResponse' } | { __typename?: 'OffchainVotersResponse', items: Array<{ __typename?: 'OffchainNonVoter', voter: string, votingPower: string } | null> } | null }; export type ListOffchainProposalsQueryVariables = Exact<{ skip?: InputMaybe; @@ -1790,7 +1811,7 @@ export type ListHistoricalVotingPowerQuery = { __typename?: 'Query', historicalV export const GetDaOsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDAOs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"daos"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"votingDelay"}},{"kind":"Field","name":{"kind":"Name","value":"chainId"}},{"kind":"Field","name":{"kind":"Name","value":"alreadySupportCalldataReview"}},{"kind":"Field","name":{"kind":"Name","value":"supportOffchainData"}}]}}]}}]}}]} as unknown as DocumentNode; -export const OffchainProposalNonVotersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"OffchainProposalNonVoters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offchainProposalNonVoters"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"addresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}}]}}]}}]}}]} as unknown as DocumentNode; +export const OffchainProposalNonVotersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"OffchainProposalNonVoters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offchainProposalNonVoters"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"addresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"OffchainVotersResponse"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}},{"kind":"Field","name":{"kind":"Name","value":"votingPower"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const ListOffchainProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"status"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_offchainProposals_status_items"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offchainProposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"status"}}},{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"endDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"endDate"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"discussion"}},{"kind":"Field","name":{"kind":"Name","value":"link"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"end"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; export const ListOffchainVotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListOffchainVotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"queryInput_votesOffchain_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"votesOffchain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"fromDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fromDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"toDate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toDate"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"voterAddresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"voterAddresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"proposalTitle"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"vp"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; export const ProposalNonVotersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProposalNonVoters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposalNonVoters"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"addresses"},"value":{"kind":"Variable","name":{"kind":"Name","value":"addresses"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"voter"}}]}}]}}]}}]} as unknown as DocumentNode; From 1178b7a37bf6c0a956d2b47ad8ccb24f6fe39838 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Thu, 9 Apr 2026 14:24:20 -0300 Subject: [PATCH 28/30] refactor: delete unnecessary docs --- ...cher-voting-reminder-unification-design.md | 185 ------------------ 1 file changed, 185 deletions(-) delete mode 100644 docs/superpowers/specs/2026-04-02-dispatcher-voting-reminder-unification-design.md diff --git a/docs/superpowers/specs/2026-04-02-dispatcher-voting-reminder-unification-design.md b/docs/superpowers/specs/2026-04-02-dispatcher-voting-reminder-unification-design.md deleted file mode 100644 index c94e09d2..00000000 --- a/docs/superpowers/specs/2026-04-02-dispatcher-voting-reminder-unification-design.md +++ /dev/null @@ -1,185 +0,0 @@ -# Dispatcher Voting Reminder Handler Unification - -## Problem - -The dispatcher has two nearly-identical handler files for voting reminders: -- `voting-reminder-trigger.service.ts` (on-chain, ~174 lines) -- `offchain-voting-reminder-trigger.service.ts` (off-chain, ~162 lines) - -These share ~90% of their logic. The logic-system already solved the same problem for triggers using a single `VotingReminderTrigger` class with dependency injection. The dispatcher should follow the same pattern. - -## Design - -### Pattern: Mirror the Logic-System Abstraction - -In the logic-system: -- `VotingReminderDataSource` interface (1 method: `listActiveForReminder()`) -- `ProposalRepository` and `OffchainProposalRepository` both implement it -- `VotingReminderTrigger` is a single class, instantiated with different params - -The dispatcher equivalent: -- `NonVotersSource` interface (1 method: `getNonVoters()`) -- Inline adapter objects in `app.ts` wrapping `anticaptureClient` -- `VotingReminderTriggerHandler` is a single class, instantiated with different params - -### Three Differences to Resolve - -#### 1. Non-Voters Fetching → `NonVotersSource` Interface - -On-chain calls `anticaptureClient.getProposalNonVoters(id, daoId, addresses)`. -Off-chain calls `anticaptureClient.getOffchainProposalNonVoters(id, addresses)`. - -Define a minimal interface that intentionally narrows to the common subset `{ voter: string }`. The offchain response also includes `votingPower`, but it is not used by the handler: - -```typescript -// interfaces/voting-reminder.interface.ts -export interface NonVotersSource { - getNonVoters(proposalId: string, daoId: string, addresses: string[]): Promise<{ voter: string }[]>; -} -``` - -Both on-chain and off-chain receive `daoId` in the signature. Off-chain simply ignores it. Adapter objects are created inline in `app.ts`: - -```typescript -const onchainNonVotersSource: NonVotersSource = { - getNonVoters: (id, daoId, addrs) => anticaptureClient.getProposalNonVoters(id, daoId, addrs) -}; - -const offchainNonVotersSource: NonVotersSource = { - getNonVoters: (id, _daoId, addrs) => anticaptureClient.getOffchainProposalNonVoters(id, addrs) -}; -``` - -#### 2. Message Templates → Normalize Shape - -On-chain uses `votingReminderMessages.getMessageKey(threshold)` to select urgency-based templates. -Off-chain uses `offchainVotingReminderMessages.default` (single template). - -Normalize by adding `getMessageKey()` to `offchainVotingReminderMessages`: - -```typescript -// packages/messages/src/triggers/offchain-voting-reminder.ts -export const offchainVotingReminderMessages = { - default: `...existing template...`, - getMessageKey(thresholdPercentage: number): string { - return 'default'; - } -}; -``` - -Define the shared type that both message objects conform to: - -```typescript -// interfaces/voting-reminder.interface.ts -export interface VotingReminderMessageSet { - getMessageKey(thresholdPercentage: number): string; - [key: string]: string | ((...args: any[]) => any) | Record; -} -``` - -Now both message objects share the same access pattern: -```typescript -const key = messages.getMessageKey(threshold); -const template = messages[key]; -``` - -#### 3. Buttons → Already Polymorphic - -`buildButtons` already handles both trigger types via the `triggerType` discriminator. The `VotingReminderEvent` already carries all fields (`id`, `daoId`, `link`, `discussion`). The unified handler passes all available fields as a superset — `buildButtons` has all params optional and each trigger type config only reads the ones it needs, ignoring `undefined` values for irrelevant params. - -```typescript -const buttons = buildButtons({ - triggerType: this.triggerType, - daoId: event.daoId, - proposalId: event.id, - proposalUrl: event.link, - discussionUrl: event.discussion, -}); -``` - -### Additional Differences Handled by `triggerType` - -#### Notification Dedup Key - -On-chain uses `` `${event.id}-${threshold}-reminder` ``, off-chain uses `` `${event.id}-${threshold}-offchain-reminder` ``. -The unified handler derives the suffix from `triggerType`: - -```typescript -const suffix = this.triggerType.includes('offchain') ? '-offchain-reminder' : '-reminder'; -() => `${event.id}-${event.thresholdPercentage}${suffix}` -``` - -#### Title Fallback - -On-chain uses `event.title || FormattingService.extractTitle(event.description ?? '')`. -Off-chain uses `event.title || 'Untitled Proposal'`. -The unified handler chains both fallbacks: - -```typescript -const title = event.title || FormattingService.extractTitle(event.description ?? '') || 'Untitled Proposal'; -``` - -#### Log Prefix and MessageId - -Derived from `triggerType`: `[VotingReminderHandler]` vs `[OffchainVotingReminderHandler]`. -The handler uses `this.triggerType` to construct log messages and messageId prefixes. - -### Unified Handler Constructor - -```typescript -export class VotingReminderTriggerHandler extends BaseTriggerHandler { - constructor( - subscriptionClient: ISubscriptionClient, - notificationFactory: NotificationClientFactory, - anticaptureClient: AnticaptureClient, - private readonly nonVotersSource: NonVotersSource, - private readonly messages: VotingReminderMessageSet, - private readonly triggerType: string, // 'votingReminder' | 'offchainVotingReminder' - ) -} -``` - -### Wiring in `app.ts` - -```typescript -// On-chain (reuse same source + messages for all thresholds) -const onchainSource: NonVotersSource = { - getNonVoters: (id, daoId, addrs) => anticaptureClient.getProposalNonVoters(id, daoId, addrs) -}; - -triggerProcessorService.addHandler( - NotificationTypeId.VotingReminder30, - new VotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient, onchainSource, votingReminderMessages, 'votingReminder') -); -// Same for VotingReminder60, VotingReminder90 - -// Off-chain -const offchainSource: NonVotersSource = { - getNonVoters: (id, _daoId, addrs) => anticaptureClient.getOffchainProposalNonVoters(id, addrs) -}; - -triggerProcessorService.addHandler( - NotificationTypeId.OffchainVotingReminder75, - new VotingReminderTriggerHandler(subscriptionClient, notificationFactory, anticaptureClient, offchainSource, offchainVotingReminderMessages, 'offchainVotingReminder') -); -``` - -## File Changes - -| File | Action | -|------|--------| -| `apps/dispatcher/src/interfaces/voting-reminder.interface.ts` | **NEW** — `VotingReminderEvent`, `NonVotersSource`, `VotingReminderMessageSet` | -| `apps/dispatcher/src/services/triggers/voting-reminder-trigger.service.ts` | **REWRITE** — single unified handler | -| `apps/dispatcher/src/services/triggers/offchain-voting-reminder-trigger.service.ts` | **DELETE** | -| `apps/dispatcher/src/app.ts` | **MODIFY** — update wiring with inline adapters | -| `packages/messages/src/triggers/offchain-voting-reminder.ts` | **MODIFY** — add `getMessageKey()` | -| Integration tests | **VERIFY** — ensure existing tests still pass | - -## What This Does NOT Change - -- Logic-system triggers (already unified) -- `BaseTriggerHandler` base class -- `@notification-system/messages` `buildButtons` function -- `BatchNotificationService` -- `AnticaptureClient` API methods -- Notification dedup key format (preserved exactly for both on-chain and off-chain to avoid duplicate/missed notifications in production) From 5dc36ced25ae7c2046d9375d6ca15a4372091da8 Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Thu, 9 Apr 2026 14:29:20 -0300 Subject: [PATCH 29/30] refactor: test mock --- apps/integrated-tests/src/mocks/graphql-mock-setup.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/integrated-tests/src/mocks/graphql-mock-setup.ts b/apps/integrated-tests/src/mocks/graphql-mock-setup.ts index a0865f0f..0a156855 100644 --- a/apps/integrated-tests/src/mocks/graphql-mock-setup.ts +++ b/apps/integrated-tests/src/mocks/graphql-mock-setup.ts @@ -201,8 +201,7 @@ export class GraphQLMockSetup { // Handle offchain proposal non-voters (MUST come before ProposalNonVoters check) if (data.query?.includes('OffchainProposalNonVoters')) { const proposalId = data.variables?.id; - const addressesStr = data.variables?.addresses || ''; - const addressesFilter = addressesStr ? addressesStr.split(',') : []; + const addressesFilter = data.variables?.addresses || []; // Get addresses that voted on this offchain proposal const votersSet = new Set( From 51ee888e39c466316a2682c110147f5903d5affa Mon Sep 17 00:00:00 2001 From: Leonardo Vieira Date: Thu, 23 Apr 2026 13:09:40 -0300 Subject: [PATCH 30/30] refactor: remove depricated markdown parse --- apps/consumers/src/services/bot/telegram-bot.service.ts | 1 - apps/integrated-tests/src/config/constants.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/consumers/src/services/bot/telegram-bot.service.ts b/apps/consumers/src/services/bot/telegram-bot.service.ts index 59ac5740..a283d839 100644 --- a/apps/consumers/src/services/bot/telegram-bot.service.ts +++ b/apps/consumers/src/services/bot/telegram-bot.service.ts @@ -274,7 +274,6 @@ export class TelegramBotService implements BotServiceInterface { payload.channelUserId, processedMessage, { - parse_mode: 'Markdown', disable_web_page_preview: true, reply_markup: replyMarkup } diff --git a/apps/integrated-tests/src/config/constants.ts b/apps/integrated-tests/src/config/constants.ts index 51b29ca4..006090b7 100644 --- a/apps/integrated-tests/src/config/constants.ts +++ b/apps/integrated-tests/src/config/constants.ts @@ -47,7 +47,7 @@ export const testConstants = { daoIds: { uniswap: 'UNISWAP', ens: 'ENS', - votingPowerTest: 'test-dao-voting-power', + votingPowerTest: 'test_dao_voting_power', caseTest: 'TEST_DAO', temporalTest1: 'TEMPORAL_DAO_1', temporalTest2: 'TEMPORAL_DAO_2',