This is page 3 of 5. Use http://codebase.md/crazyrabbitltc/mpc-tally-api-server?lines=true&page={x} to view the full context.
# Directory Structure
```
├── .env.example
├── .gitignore
├── bun.lockb
├── docs
│ ├── issues
│ │ └── address-votes-api-schema.md
│ └── rate-limiting-notes.md
├── jest.config.js
├── LICENSE
├── list of tools
├── LLM-API-GUIDE-2 copy.txt
├── LLM-API-GUIDE-2.txt
├── LLM-API-GUIDE.txt
├── package-lock.json
├── package.json
├── proposals_response.json
├── README.md
├── repomix-output.txt
├── src
│ ├── index.ts
│ ├── repomix-output.txt
│ ├── server.ts
│ ├── services
│ │ ├── __tests__
│ │ │ ├── client
│ │ │ │ ├── setup.ts
│ │ │ │ ├── tallyServer.test.ts
│ │ │ │ └── tsconfig.json
│ │ │ ├── mcpClientTests
│ │ │ │ └── mcpServer.test.ts
│ │ │ ├── tally.service.address-created-proposals.test.ts
│ │ │ ├── tally.service.address-dao-proposals.test.ts
│ │ │ ├── tally.service.address-daos.test.ts
│ │ │ ├── tally.service.address-governances.test.ts
│ │ │ ├── tally.service.address-metadata.test.ts
│ │ │ ├── tally.service.address-received-delegations.test.ts
│ │ │ ├── tally.service.address-safes.test.ts
│ │ │ ├── tally.service.address-votes.test.ts
│ │ │ ├── tally.service.addresses.test.ts
│ │ │ ├── tally.service.dao.test.ts
│ │ │ ├── tally.service.daos.test.ts
│ │ │ ├── tally.service.delegate-statement.test.ts
│ │ │ ├── tally.service.delegates.test.ts
│ │ │ ├── tally.service.delegators.test.ts
│ │ │ ├── tally.service.errors.test.ts
│ │ │ ├── tally.service.governance-proposals-stats.test.ts
│ │ │ ├── tally.service.list-delegates.test.ts
│ │ │ ├── tally.service.proposal-security-analysis.test.ts
│ │ │ ├── tally.service.proposal-timeline.test.ts
│ │ │ ├── tally.service.proposal-voters.test.ts
│ │ │ ├── tally.service.proposal-votes-cast-list.test.ts
│ │ │ ├── tally.service.proposal-votes-cast.test.ts
│ │ │ ├── tally.service.proposals.test.ts
│ │ │ ├── tally.service.test.ts
│ │ │ └── tsconfig.json
│ │ ├── addresses
│ │ │ ├── addresses.queries.ts
│ │ │ ├── addresses.types.ts
│ │ │ ├── getAddressCreatedProposals.ts
│ │ │ ├── getAddressDAOProposals.ts
│ │ │ ├── getAddressGovernances.ts
│ │ │ ├── getAddressMetadata.ts
│ │ │ ├── getAddressProposals.ts
│ │ │ ├── getAddressReceivedDelegations.ts
│ │ │ ├── getAddressSafes.ts
│ │ │ ├── getAddressVotes.ts
│ │ │ └── index.ts
│ │ ├── delegates
│ │ │ ├── delegates.queries.ts
│ │ │ ├── delegates.types.ts
│ │ │ ├── getDelegateStatement.ts
│ │ │ ├── index.ts
│ │ │ └── listDelegates.ts
│ │ ├── delegators
│ │ │ ├── delegators.queries.ts
│ │ │ ├── delegators.types.ts
│ │ │ ├── getDelegators.ts
│ │ │ └── index.ts
│ │ ├── errors
│ │ │ └── apiErrors.ts
│ │ ├── index.ts
│ │ ├── organizations
│ │ │ ├── __tests__
│ │ │ │ ├── organizations.queries.test.ts
│ │ │ │ ├── organizations.service.test.ts
│ │ │ │ └── tally.service.test.ts
│ │ │ ├── getDAO.ts
│ │ │ ├── index.ts
│ │ │ ├── listDAOs.ts
│ │ │ ├── organizations.queries.ts
│ │ │ ├── organizations.service.ts
│ │ │ └── organizations.types.ts
│ │ ├── proposals
│ │ │ ├── getGovernanceProposalsStats.ts
│ │ │ ├── getProposal.ts
│ │ │ ├── getProposal.types.ts
│ │ │ ├── getProposalSecurityAnalysis.ts
│ │ │ ├── getProposalSecurityAnalysis.types.ts
│ │ │ ├── getProposalTimeline.ts
│ │ │ ├── getProposalTimeline.types.ts
│ │ │ ├── getProposalVoters.ts
│ │ │ ├── getProposalVoters.types.ts
│ │ │ ├── getProposalVotesCast.ts
│ │ │ ├── getProposalVotesCast.types.ts
│ │ │ ├── getProposalVotesCastList.ts
│ │ │ ├── getProposalVotesCastList.types.ts
│ │ │ ├── index.ts
│ │ │ ├── listProposals.ts
│ │ │ ├── listProposals.types.ts
│ │ │ ├── proposals.queries.ts
│ │ │ └── proposals.types.ts
│ │ ├── tally.service.ts
│ │ └── utils
│ │ └── rateLimiter.ts
│ ├── tools.ts
│ ├── types.ts
│ └── utils
│ ├── __tests__
│ │ └── formatTokenAmount.test.ts
│ ├── formatTokenAmount.ts
│ └── index.ts
├── Tally API Docs RAW.txt
├── Tally API Sample Queries from Site.txt
├── Tally-API-Docs-Types.txt
└── tsconfig.json
```
# Files
--------------------------------------------------------------------------------
/LLM-API-GUIDE-2 copy.txt:
--------------------------------------------------------------------------------
```
1 |
2 | Tally API - LLM Query Construction Rules (Mandatory & Unbreakable)
3 |
4 | Introduction
5 |
6 | This document outlines the mandatory and unbreakable rules for Large Language Models (LLMs) when constructing queries for the Tally API. These rules are not suggestions—they must be strictly followed to ensure correct, efficient, and error-free GraphQL queries. Failure to adhere to any of these rules will result in a fatal error, and the LLM must immediately terminate the current query and return an error message indicating which rule was broken. There is no acceptable deviation whatsoever from these rules.
7 |
8 | Core Principles
9 |
10 | Never Assume: Under no circumstances should the LLM assume any default values or behaviors for sort, filter, or other optional input parameters. You must explicitly declare them in the query.
11 |
12 | Type Awareness: You must always be acutely aware of the GraphQL types involved, especially interface and union types, and use inline fragments accordingly. Failure to do so is a fatal error and will result in immediate termination of the query.
13 |
14 | Fragment Prioritization: You must use fragments to minimize repetition, improve maintainability, and ensure efficient queries. Not using fragments is absolutely unacceptable and will result in a fatal error.
15 |
16 | Explicit Field Selection: You must always explicitly request each field you need, and never assume fields will be returned automatically.
17 |
18 | Pagination: You must always use pagination where appropriate to ensure complete query results are retrieved, using the page input and pageInfo fields.
19 |
20 | Correct API Use: You must adhere to API constraints. Some queries have required fields that must be used correctly.
21 |
22 | Schema Consultation: You must consult the complete schema reference before creating any queries.
23 |
24 | Multi-step Queries: You must properly structure multi-step queries into a sequence of dependent queries if data from one query is needed for a subsequent query.
25 |
26 | Fragment Usage: All Fragments must be used, and any unused fragments must be removed before the query can be submitted.
27 |
28 | Data Verification: You must not invent data. If you use external data to construct a query, you must attempt to verify the correctness of that data before using it. If you cannot verify the data, you must explicitly state that the data is unverified, and not present it as a fact. Failure to do so is a fatal error.
29 |
30 | Rule 1: Interface and Union Type Handling (Mandatory)
31 |
32 | Problem: The nodes field in paginated queries often returns a list of types that implement a GraphQL interface (like Node), or are part of a union type. You cannot query fields directly on the interface type.
33 |
34 | Solution: You must use inline fragments (... on TypeName) to access fields on the concrete types within a list of interface types. Failure to do so is a fatal error and will result in immediate termination of the query.
35 |
36 | Example (Correct):
37 |
38 | query GetOrganizations {
39 | organizations {
40 | nodes {
41 | ... on Organization {
42 | id
43 | name
44 | slug
45 | metadata {
46 | icon
47 | }
48 | }
49 | }
50 | pageInfo {
51 | firstCursor
52 | lastCursor
53 | count
54 | }
55 | }
56 | }
57 | content_copy
58 | download
59 | Use code with caution.
60 | Graphql
61 |
62 | Example (Incorrect - Avoid):
63 |
64 | query GetOrganizations {
65 | organizations {
66 | nodes {
67 | id
68 | name
69 | slug
70 | }
71 | }
72 | }
73 | content_copy
74 | download
75 | Use code with caution.
76 | Graphql
77 |
78 | Specific Error Case: Attempting to query fields directly on the nodes field when querying votes without the ... on Vote fragment. This is a fatal error and will result in immediate termination of the query.
79 |
80 | query GetVotes {
81 | votes(input: {
82 | filters: {
83 | voter: "0x1B686eE8E31c5959D9F5BBd8122a58682788eeaD"
84 | }
85 | }) {
86 | nodes {
87 | type
88 | }
89 | }
90 | }
91 | content_copy
92 | download
93 | Use code with caution.
94 | Graphql
95 |
96 | Action: Always use inline fragments (... on TypeName) inside the nodes list, and any other location where interface types can be returned, to query the specific fields of the concrete type. Failure to do so is a fatal error and will result in immediate termination of the query.
97 |
98 | Rule 2: Explicit Sort and Filter Inputs (Mandatory)
99 |
100 | Problem: Queries with sort or filter options often have required input types that must be fully populated.
101 |
102 | Solution: You must never assume default sort or filter values. You must always explicitly provide them in the query if you need them. Even if you don't need sorting or filtering, you must provide an empty input object.
103 |
104 | Example (Correct):
105 |
106 | query GetProposals($input: ProposalsInput!) {
107 | proposals(input: $input) {
108 | nodes {
109 | ... on Proposal {
110 | id
111 | metadata {
112 | title
113 | }
114 | status
115 | }
116 | }
117 | pageInfo {
118 | firstCursor
119 | lastCursor
120 | count
121 | }
122 | }
123 | }
124 | content_copy
125 | download
126 | Use code with caution.
127 | Graphql
128 | * **Input:**
129 | content_copy
130 | download
131 | Use code with caution.
132 | input ProposalsInput {
133 | filters: ProposalsFiltersInput
134 | page: PageInput
135 | sort: ProposalsSortInput
136 | }
137 |
138 | input ProposalsFiltersInput {
139 | governorId: AccountID
140 | includeArchived: Boolean
141 | isDraft: Boolean
142 | organizationId: IntID
143 | proposer: Address
144 | }
145 | input ProposalsSortInput {
146 | isDescending: Boolean!
147 | sortBy: ProposalsSortBy!
148 | }
149 | enum ProposalsSortBy {
150 | id
151 | }
152 |
153 | input PageInput {
154 | afterCursor: String
155 | beforeCursor: String
156 | limit: Int
157 | }
158 | content_copy
159 | download
160 | Use code with caution.
161 | Graphql
162 | * **Query:** (with optional sort, and filters)
163 | content_copy
164 | download
165 | Use code with caution.
166 | query GetProposalsWithSortAndFilter {
167 | proposals(input: {
168 | filters: {
169 | governorId: "eip155:1:0x123abc"
170 | includeArchived: true
171 | },
172 | sort: {
173 | sortBy: id
174 | isDescending: false
175 | },
176 | page: {
177 | limit: 10
178 | }
179 | })
180 | {
181 | nodes {
182 | ... on Proposal {
183 | id
184 | metadata {
185 | title
186 | }
187 | status
188 | }
189 | }
190 | pageInfo {
191 | firstCursor
192 | lastCursor
193 | count
194 | }
195 | }
196 | }
197 | content_copy
198 | download
199 | Use code with caution.
200 | Graphql
201 |
202 | Example (Incorrect - Avoid):
203 |
204 | query GetProposals {
205 | proposals {
206 | nodes {
207 | id
208 | metadata {
209 | title
210 | }
211 | status
212 | }
213 | }
214 | }
215 | content_copy
216 | download
217 | Use code with caution.
218 | Graphql
219 |
220 | Action: Always provide a valid input object for queries that require filters or sorts. Use null if no sorting or filtering is needed for a nullable input, but if the filter is required, use an empty object when no filters are required. Failure to do so is a fatal error and will result in immediate termination of the query.
221 |
222 | Rule 3: Fragment Usage (Mandatory)
223 |
224 | Problem: Repeated field selections in multiple queries make the code less maintainable and are prone to errors.
225 |
226 | Solution: You must use fragments to group common field selections and reuse them across multiple queries. Not using fragments is absolutely unacceptable and will result in a fatal error.
227 |
228 | Example (Correct):
229 |
230 | fragment BasicProposalDetails on Proposal {
231 | id
232 | onchainId
233 | metadata {
234 | title
235 | description
236 | }
237 | status
238 | }
239 |
240 |
241 | query GetProposals($input: ProposalsInput!) {
242 | proposals(input: $input) {
243 | nodes {
244 | ... on Proposal {
245 | ...BasicProposalDetails
246 | }
247 | }
248 | pageInfo {
249 | firstCursor
250 | lastCursor
251 | count
252 | }
253 | }
254 | }
255 |
256 | query GetSingleProposal($input: ProposalInput!) {
257 | proposal(input: $input) {
258 | ...BasicProposalDetails
259 | }
260 | }
261 | content_copy
262 | download
263 | Use code with caution.
264 | Graphql
265 |
266 | Example (Incorrect - Avoid):
267 |
268 | query GetProposals {
269 | proposals {
270 | nodes {
271 | id
272 | onchainId
273 | metadata {
274 | title
275 | description
276 | }
277 | status
278 | }
279 | }
280 | }
281 |
282 | query GetSingleProposal {
283 | proposal(input: {id: 123}) {
284 | id
285 | onchainId
286 | metadata {
287 | title
288 | description
289 | }
290 | status
291 | }
292 | }
293 | content_copy
294 | download
295 | Use code with caution.
296 | Graphql
297 |
298 | Action: Always create and use fragments, and make them focused, and reusable across multiple queries. Not using fragments is absolutely unacceptable and will result in a fatal error.
299 |
300 | Rule 4: Explicit Field Selection (Mandatory)
301 |
302 | Problem: Assuming the API will return certain fields if they aren't specifically requested.
303 |
304 | Solution: You must always request every field you need in your query.
305 |
306 | Example (Correct):
307 |
308 | query GetOrganization($input: OrganizationInput!) {
309 | organization(input: $input) {
310 | id
311 | name
312 | slug
313 | metadata {
314 | icon
315 | description
316 | socials {
317 | website
318 | }
319 | }
320 | }
321 | }
322 | content_copy
323 | download
324 | Use code with caution.
325 | Graphql
326 |
327 | Example (Incorrect - Avoid):
328 |
329 | query GetOrganization {
330 | organization {
331 | name
332 | slug
333 | }
334 | }
335 | content_copy
336 | download
337 | Use code with caution.
338 | Graphql
339 |
340 | Action: List out every field you need in the query, and avoid implied or implicit field selections.
341 |
342 | Rule 5: Input Type Validation (Mandatory)
343 |
344 | Problem: Using the wrong types when providing input values to a query.
345 |
346 | Solution: Check that all values passed as inputs to a query match the type declared in the input. Failure to do so is a fatal error and will result in immediate termination of the query.
347 |
348 | Example (Correct):
349 |
350 | query GetAccount($id: AccountID!) {
351 | account(id: $id) {
352 | id
353 | name
354 | address
355 | ens
356 | picture
357 | }
358 | }
359 | content_copy
360 | download
361 | Use code with caution.
362 | Graphql
363 |
364 | Query
365 |
366 | query GetAccountCorrect {
367 | account(id:"eip155:1:0x123") {
368 | id
369 | name
370 | address
371 | ens
372 | picture
373 | }
374 | }
375 | content_copy
376 | download
377 | Use code with caution.
378 | Graphql
379 | * The `id` argument correctly uses the `AccountID` type, which is a string representing a CAIP-10 ID.
380 | content_copy
381 | download
382 | Use code with caution.
383 |
384 | Specific Error Case: Attempting to use a plain integer for organizationId in proposal queries. This is a fatal error and will result in immediate termination of the query.
385 |
386 | query GetProposals {
387 | proposals(input: {
388 | filters: {
389 | organizationId: 1
390 | }
391 | })
392 | {
393 | nodes {
394 | ... on Proposal {
395 | id
396 | }
397 | }
398 | }
399 | }
400 | content_copy
401 | download
402 | Use code with caution.
403 | Graphql
404 |
405 | Example (Incorrect - Avoid):
406 |
407 | query GetAccount($id: AccountID!) {
408 | account(id: $id) {
409 | id
410 | name
411 | address
412 | }
413 | }
414 | content_copy
415 | download
416 | Use code with caution.
417 | Graphql
418 |
419 | Query
420 |
421 | query GetAccountIncorrect {
422 | account(id:123) {
423 | id
424 | name
425 | address
426 | ens
427 | picture
428 | }
429 | }
430 | content_copy
431 | download
432 | Use code with caution.
433 | Graphql
434 |
435 | Action: Ensure you're using the correct type. Int cannot be used where an IntID, AccountID, HashID or AssetID type is required. Failure to do so is a fatal error and will result in immediate termination of the query.
436 |
437 | ID Type Definitions
438 |
439 | AccountID: A CAIP-10 compliant account id. (e.g., "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc")
440 |
441 | AssetID: A CAIP-19 compliant asset id. (e.g., "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f")
442 |
443 | IntID: A 64-bit integer represented as a string. (e.g., "1234567890")
444 |
445 | HashID: A CAIP-2 scoped identifier for identifying transactions across chains. (e.g., "eip155:1:0xDEAD")
446 |
447 | BlockID: A CAIP-2 scoped identifier for identifying blocks across chains. (e.g., "eip155:1:15672")
448 |
449 | ChainID: A CAIP-2 compliant chain ID. (e.g., "eip155:1")
450 |
451 | Address: A 20 byte ethereum address, represented as 0x-prefixed hexadecimal. (e.g., "0x1234567800000000000000000000000000000abc")
452 |
453 | Rule 6: Enum Usage (Mandatory)
454 |
455 | Problem: Using a string value when an enum type is expected.
456 |
457 | Solution: Always use the correct values for an enum type. Failure to do so is a fatal error and will result in immediate termination of the query.
458 |
459 | Example (Correct)
460 |
461 | query GetVotes($input: VotesInput!) {
462 | votes(input: $input) {
463 | nodes {
464 | id
465 | type
466 | }
467 | }
468 | }
469 | content_copy
470 | download
471 | Use code with caution.
472 | Graphql
473 |
474 | Input:
475 |
476 | input VotesInput {
477 | filters: VotesFiltersInput
478 | page: PageInput
479 | sort: VotesSortInput
480 | }
481 |
482 | input VotesFiltersInput {
483 | proposalId: IntID
484 | proposalIds: [IntID!]
485 | voter: Address
486 | includePendingVotes: Boolean
487 | type: VoteType
488 | }
489 | enum VoteType {
490 | abstain
491 | against
492 | for
493 | pendingabstain
494 | pendingagainst
495 | pendingfor
496 | }
497 | content_copy
498 | download
499 | Use code with caution.
500 | Graphql
501 |
502 | Query: (Correctly using an enum type)
503 |
504 | query GetVotesFor {
505 | votes(input: {
506 | filters: {
507 | type: for
508 | proposalId: 123
509 | }
510 | })
511 | {
512 | nodes {
513 | id
514 | type
515 | }
516 | }
517 | }
518 | content_copy
519 | download
520 | Use code with caution.
521 | Graphql
522 |
523 | Example (Incorrect - Avoid):
524 |
525 | query GetVotesFor {
526 | votes(input: {
527 | filters: {
528 | type: "for"
529 | proposalId: 123
530 | }
531 | })
532 | {
533 | nodes {
534 | id
535 | type
536 | }
537 | }
538 | }
539 | content_copy
540 | download
541 | Use code with caution.
542 | Graphql
543 |
544 | Action: Always ensure the values of enum types match the provided options, and that you are not using a string when an enum is expected. Failure to do so is a fatal error and will result in immediate termination of the query.
545 |
546 | Rule 7: Pagination Handling (Mandatory)
547 |
548 | Problem: Queries that return paginated data do not return complete results if pagination is not handled.
549 |
550 | Solution: You must always use the page input with appropriate limit, afterCursor and beforeCursor values to ensure you are retrieving all the results that you want. You must also use the pageInfo field on the returned type to use the cursors.
551 |
552 | Example (Correct):
553 |
554 | query GetPaginatedProposals($input: ProposalsInput!) {
555 | proposals(input: $input) {
556 | nodes {
557 | ... on Proposal {
558 | id
559 | metadata {
560 | title
561 | }
562 | }
563 | }
564 | pageInfo {
565 | firstCursor
566 | lastCursor
567 | count
568 | }
569 | }
570 | }
571 | content_copy
572 | download
573 | Use code with caution.
574 | Graphql
575 | * **Input**
576 | content_copy
577 | download
578 | Use code with caution.
579 | input ProposalsInput {
580 | filters: ProposalsFiltersInput
581 | page: PageInput
582 | sort: ProposalsSortInput
583 | }
584 |
585 | input ProposalsFiltersInput {
586 | governorId: AccountID
587 | includeArchived: Boolean
588 | isDraft: Boolean
589 | organizationId: IntID
590 | proposer: Address
591 | }
592 | input ProposalsSortInput {
593 | isDescending: Boolean!
594 | sortBy: ProposalsSortBy!
595 | }
596 | enum ProposalsSortBy {
597 | id
598 | }
599 |
600 | input PageInput {
601 | afterCursor: String
602 | beforeCursor: String
603 | limit: Int
604 | }
605 | content_copy
606 | download
607 | Use code with caution.
608 | Graphql
609 |
610 | Query:
611 |
612 | query GetProposalsWithPagination {
613 | proposals(input: {
614 | page: {
615 | limit: 20
616 | }
617 | }) {
618 | nodes {
619 | ... on Proposal {
620 | id
621 | metadata {
622 | title
623 | }
624 | }
625 | }
626 | pageInfo {
627 | firstCursor
628 | lastCursor
629 | count
630 | }
631 | }
632 | }
633 | content_copy
634 | download
635 | Use code with caution.
636 | Graphql
637 |
638 | Query: (Using cursors to get the next page of results)
639 |
640 | query GetProposalsWithPagination {
641 | proposals(input: {
642 | page: {
643 | limit: 20
644 | afterCursor: "cursorFromPreviousQuery"
645 | }
646 | }) {
647 | nodes {
648 | ... on Proposal {
649 | id
650 | metadata {
651 | title
652 | }
653 | }
654 | }
655 | pageInfo {
656 | firstCursor
657 | lastCursor
658 | count
659 | }
660 | }
661 | }
662 | content_copy
663 | download
664 | Use code with caution.
665 | Graphql
666 |
667 | Example (Incorrect - Avoid):
668 |
669 | query GetProposals {
670 | proposals {
671 | nodes {
672 | ... on Proposal {
673 | id
674 | metadata {
675 | title
676 | }
677 | }
678 | }
679 | }
680 | }
681 | content_copy
682 | download
683 | Use code with caution.
684 | Graphql
685 |
686 | Action: Always use the page input with a limit, and use the cursors to iterate through pages, especially when you are working with paginated data. Failure to do so may result in incomplete data.
687 |
688 | Rule 8: Correctly Querying Related Data (Mandatory)
689 |
690 | Problem: Attempting to query related data as nested fields within a type will lead to errors if the related data must be fetched in a separate query.
691 |
692 | Solution: You must fetch related data by using separate queries, instead of assuming that related data is queryable as nested fields.
693 |
694 | Example (Correct)
695 |
696 | query GetProposalAndVotes($proposalId: IntID!, $voter: Address) {
697 | proposal(input: { id: $proposalId}) {
698 | id
699 | metadata {
700 | title
701 | }
702 | status
703 | }
704 | votes(input: {
705 | filters: {
706 | proposalId: $proposalId
707 | voter: $voter
708 | }
709 | }) {
710 | nodes {
711 | ... on Vote {
712 | type
713 | amount
714 | voter {
715 | id
716 | name
717 | }
718 | }
719 | }
720 | }
721 | }
722 | content_copy
723 | download
724 | Use code with caution.
725 | Graphql
726 |
727 | Example (Incorrect - Avoid):
728 |
729 | query GetProposals {
730 | proposals {
731 | ... on Proposal {
732 | id
733 | metadata {
734 | title
735 | }
736 | votes(input: {
737 | filters: {
738 | voter: "0x..."
739 | }
740 | })
741 | }
742 | }
743 | }
744 | content_copy
745 | download
746 | Use code with caution.
747 | Graphql
748 |
749 | Action: Do not attempt to fetch related data in the same query, instead, fetch it via a second query. Failure to do so will result in an error.
750 |
751 | Rule 9: API Constraints (Mandatory)
752 |
753 | Problem: Not all fields or properties are queryable in all situations. Some queries have explicit requirements that must be met.
754 |
755 | Solution: You must always check your query against the known API constraints, and ensure that all requirements are met.
756 |
757 | Example:
758 |
759 | The votes query requires that proposalId or proposalIds is provided in the input. This means you cannot query votes without first querying proposals. Failure to do so will result in an error.
760 |
761 | An error you may see is: "proposalId or proposalIds must be provided"
762 |
763 | Action: Ensure all API constraits are met and that any required fields are provided when making a query. Failure to do so will result in an error.
764 |
765 | Rule 10: Multi-Step Queries (Mandatory)
766 |
767 | Problem: Some data can only be accessed by using multiple queries, and requires that data from one query be used as the input for a subsequent query.
768 |
769 | Solution: Properly construct multi-step queries by breaking them into a sequence of independent GraphQL queries. Ensure the output of one query is correctly used as input for the next query.
770 |
771 | Example
772 |
773 | If you need to fetch all the votes from a specific organization, you first need to get the organization id, then use that id to query all the proposals, and then finally, you need to query for all the votes associated with each proposal.
774 |
775 | Correct Example
776 |
777 | # Step 1: Get the organization ID using a query that filters by slug
778 |
779 | query GetOrganizationId($slug: String!) {
780 | organization(input: {slug: $slug}) {
781 | id
782 | }
783 | }
784 |
785 | # Step 2: Get the proposals for the given organization
786 | query GetProposalsForOrganization($organizationId: IntID!) {
787 | proposals(input: {
788 | filters: {
789 | organizationId: $organizationId
790 | }
791 | }) {
792 | nodes {
793 | ... on Proposal {
794 | id
795 | }
796 | }
797 | }
798 | }
799 |
800 | # Step 3: Get all the votes for all of the proposals.
801 | query GetVotesForProposals($proposalIds: [IntID!]!) {
802 | votes(input: {
803 | filters: {
804 | proposalIds: $proposalIds
805 | }
806 | })
807 | {
808 | nodes {
809 | ... on Vote {
810 | id
811 | type
812 | amount
813 | }
814 | }
815 | }
816 | }
817 | content_copy
818 | download
819 | Use code with caution.
820 | Graphql
821 |
822 | Action: When a query requires data from another query, structure it as a multi-step query, and use the result of the first query as the input to the subsequent query.
823 |
824 | Rule 11: Fragment Usage (Mandatory)
825 |
826 | Problem: Defining fragments that aren't used creates unnecessary code.
827 |
828 | Solution: You must always use all defined fragments, and any unused fragments must be removed before submitting a query.
829 |
830 | Example
831 |
832 | fragment BasicAccountInfo on Account {
833 | id
834 | address
835 | ens
836 | }
837 |
838 | fragment VoteDetails on Vote {
839 | type
840 | amount
841 | }
842 |
843 | query GetVotes($input: VotesInput!) {
844 | votes(input: $input) {
845 | nodes {
846 | ... on Vote {
847 | ...VoteDetails
848 | }
849 | }
850 | }
851 | }
852 | content_copy
853 | download
854 | Use code with caution.
855 | Graphql
856 | * **Action:** All defined fragments *must* be used, and any unused fragments *must* be removed before submitting a query.
857 | content_copy
858 | download
859 | Use code with caution.
860 |
861 | Rule 12: Data Verification (Mandatory)
862 |
863 | Problem: The LLM may invent data, such as Ethereum addresses, and then use it as a query parameter, without verifying it. This leads to inaccurate results and potentially misleading conclusions.
864 |
865 | Solution: The LLM must not invent any external data. If data is used as a query parameter, the LLM must attempt to verify that the data is correct using external sources. If the LLM cannot verify the data, it must explicitly state that the data is unverified, and not present it as fact. Failure to do so is a fatal error.
866 |
867 | Specific Error Case: The LLM invents an ethereum address, and uses it to make conclusions about a specific organization.
868 |
869 | The LLM assumed an incorrect address for L2BEAT, used the incorrect address in a query, and drew false conclusions about their voting habits.
870 |
871 | Action: Before using external data as a query parameter, the LLM must attempt to verify its accuracy, including but not limited to:
872 |
873 | External Lookups: Attempt to verify a key identifier (e.g., organization address, slug) through external sources (such as Etherscan, a project's official website, or social media), and use that value in queries to Tally.
874 |
875 | Explicit Validation: In all cases where a query uses external values, and the external values could not be verified, the LLM must disclose that the data is not verified, and must not draw conclusions based on the unverified data.
876 |
877 | Example of Verification:
878 | If the LLM needs to get information about the organization "L2BEAT," it must first try to verify L2BEAT's organization address or slug using an external source of truth. If the LLM cannot find a valid and verifiable address, it must not proceed with the query.
879 | For example:
880 |
881 | The LLM must first try to obtain the L2BEAT organization ID, for example, from the Tally UI, or from external sources.
882 |
883 | If the LLM cannot obtain the L2BEAT organization ID from an external source, the LLM must not proceed with the query.
884 |
885 | If the LLM is able to obtain an L2BEAT organization ID, it must use that ID in its query to Tally.
886 |
887 | If the LLM is unable to obtain a valid ID, or must use information from an unverified source, then the LLM must make explicit mention of that fact.
888 |
889 | The LLM must make no claims or conclusions about any unverified data.
890 |
891 | Emphasis on External Sources: The following should be considered sources of truth when creating queries that reference specific data:
892 |
893 | Etherscan: If you are searching for an address, or a contract address, you can use Etherscan to verify that the data is correct.
894 |
895 | Project Websites and Socials: Project websites and social accounts should be consulted to verify the claims being made.
896 |
897 | Tally UI: The Tally user interface can be used to verify organization addresses or slugs.
898 |
899 | Complete Schema Reference
900 |
901 | While we cannot provide the entire schema (it would be too lengthy), here are the core types and their most commonly used fields, and examples of the input types:
902 |
903 | type Account {
904 | id: ID!
905 | address: String!
906 | ens: String
907 | twitter: String
908 | name: String!
909 | bio: String!
910 | picture: String
911 | safes: [AccountID!]
912 | type: AccountType!
913 | votes(governorId: AccountID!): Uint256!
914 | proposalsCreatedCount(input: ProposalsCreatedCountInput!): Int!
915 | }
916 |
917 | enum AccountType {
918 | EOA
919 | SAFE
920 | }
921 | type Delegate {
922 | id: IntID!
923 | account: Account!
924 | chainId: ChainID
925 | delegatorsCount: Int!
926 | governor: Governor
927 | organization: Organization
928 | statement: DelegateStatement
929 | token: Token
930 | votesCount(blockNumber: Int): Uint256!
931 | }
932 |
933 | input DelegateInput {
934 | address: Address!
935 | governorId: AccountID
936 | organizationId: IntID
937 | }
938 |
939 | type DelegateStatement {
940 | id: IntID!
941 | address: Address!
942 | organizationID: IntID!
943 | statement: String!
944 | statementSummary: String
945 | isSeekingDelegation: Boolean
946 | issues: [Issue!]
947 | }
948 |
949 | type Delegation {
950 | id: IntID!
951 | blockNumber: Int!
952 | blockTimestamp: Timestamp!
953 | chainId: ChainID!
954 | delegator: Account!
955 | delegate: Account!
956 | organization: Organization!
957 | token: Token!
958 | votes: Uint256!
959 | }
960 | input DelegationInput {
961 | address: Address!
962 | tokenId: AssetID!
963 | }
964 | input DelegationsInput {
965 | filters: DelegationsFiltersInput!
966 | page: PageInput
967 | sort: DelegationsSortInput
968 | }
969 | input DelegationsFiltersInput {
970 | address: Address!
971 | governorId: AccountID
972 | organizationId: IntID
973 | }
974 | input DelegationsSortInput {
975 | isDescending: Boolean!
976 | sortBy: DelegationsSortBy!
977 | }
978 | enum DelegationsSortBy {
979 | id
980 | votes
981 | }
982 |
983 | type Governor {
984 | id: AccountID!
985 | chainId: ChainID!
986 | contracts: Contracts!
987 | isIndexing: Boolean!
988 | isBehind: Boolean!
989 | isPrimary: Boolean!
990 | kind: GovernorKind!
991 | name: String!
992 | organization: Organization!
993 | proposalStats: ProposalStats!
994 | parameters: GovernorParameters!
995 | quorum: Uint256!
996 | slug: String!
997 | timelockId: AccountID
998 | tokenId: AssetID!
999 | token: Token!
1000 | type: GovernorType!
1001 | delegatesCount: Int!
1002 | delegatesVotesCount: Uint256!
1003 | tokenOwnersCount: Int!
1004 | metadata: GovernorMetadata
1005 | }
1006 | type GovernorContract {
1007 | address: Address!
1008 | type: GovernorType!
1009 | }
1010 |
1011 | input GovernorInput {
1012 | id: AccountID
1013 | slug: String
1014 | }
1015 |
1016 | type Organization {
1017 | id: IntID!
1018 | slug: String!
1019 | name: String!
1020 | chainIds: [ChainID!]!
1021 | tokenIds: [AssetID!]!
1022 | governorIds: [AccountID!]!
1023 | metadata: OrganizationMetadata
1024 | creator: Account
1025 | hasActiveProposals: Boolean!
1026 | proposalsCount: Int!
1027 | delegatesCount: Int!
1028 | delegatesVotesCount: Uint256!
1029 | tokenOwnersCount: Int!
1030 | endorsementService: EndorsementService
1031 | }
1032 | input OrganizationInput {
1033 | id: IntID
1034 | slug: String
1035 | }
1036 | input OrganizationsInput {
1037 | filters: OrganizationsFiltersInput
1038 | page: PageInput
1039 | sort: OrganizationsSortInput
1040 | }
1041 | input OrganizationsFiltersInput {
1042 | address: Address
1043 | chainId: ChainID
1044 | hasLogo: Boolean
1045 | isMember: Boolean
1046 | }
1047 | input OrganizationsSortInput {
1048 | isDescending: Boolean!
1049 | sortBy: OrganizationsSortBy!
1050 | }
1051 |
1052 | enum OrganizationsSortBy {
1053 | id
1054 | name
1055 | explore
1056 | popular
1057 | }
1058 |
1059 | type Proposal {
1060 | id: IntID!
1061 | onchainId: String
1062 | block: Block
1063 | chainId: ChainID!
1064 | creator: Account
1065 | end: BlockOrTimestamp!
1066 | events: [ProposalEvent!]!
1067 | executableCalls: [ExecutableCall!]
1068 | governor: Governor!
1069 | metadata: ProposalMetadata!
1070 | organization: Organization!
1071 | proposer: Account
1072 | quorum: Uint256
1073 | status: ProposalStatus!
1074 | start: BlockOrTimestamp!
1075 | voteStats: [VoteStats!]
1076 | }
1077 | input ProposalInput {
1078 | id: IntID
1079 | onchainId: String
1080 | governorId: AccountID
1081 | includeArchived: Boolean
1082 | isLatest: Boolean
1083 | }
1084 | type ProposalMetadata {
1085 | title: String
1086 | description: String
1087 | eta: Int
1088 | ipfsHash: String
1089 | previousEnd: Int
1090 | timelockId: AccountID
1091 | txHash: Hash
1092 | discourseURL: String
1093 | snapshotURL: String
1094 | }
1095 |
1096 | input ProposalsInput {
1097 | filters: ProposalsFiltersInput
1098 | page: PageInput
1099 | sort: ProposalsSortInput
1100 | }
1101 | input ProposalsFiltersInput {
1102 | governorId: AccountID
1103 | includeArchived: Boolean
1104 | isDraft: Boolean
1105 | organizationId: IntID
1106 | proposer: Address
1107 | }
1108 | input ProposalsSortInput {
1109 | isDescending: Boolean!
1110 | sortBy: ProposalsSortBy!
1111 | }
1112 | enum ProposalsSortBy {
1113 | id
1114 | }
1115 |
1116 | type Token {
1117 | id: AssetID!
1118 | type: TokenType!
1119 | name: String!
1120 | symbol: String!
1121 | supply: Uint256!
1122 | decimals: Int!
1123 | eligibility: Eligibility
1124 | isIndexing: Boolean!
1125 | isBehind: Boolean!
1126 | }
1127 | type Vote {
1128 | id: IntID!
1129 | amount: Uint256!
1130 | block: Block!
1131 | chainId: ChainID!
1132 | isBridged: Boolean
1133 | proposal: Proposal!
1134 | reason: String
1135 | type: VoteType!
1136 | txHash: Hash!
1137 | voter: Account!
1138 | }
1139 | input VotesInput {
1140 | filters: VotesFiltersInput
1141 | page: PageInput
1142 | sort: VotesSortInput
1143 | }
1144 | input VotesFiltersInput {
1145 | proposalId: IntID
1146 | proposalIds: [IntID!]
1147 | voter: Address
1148 | includePendingVotes: Boolean
1149 | type: VoteType
1150 | }
1151 | input VotesSortInput {
1152 | isDescending: Boolean!
1153 | sortBy: VotesSortBy!
1154 | }
1155 | enum VotesSortBy {
1156 | id
1157 | amount
1158 | }
1159 |
1160 | enum VoteType {
1161 | abstain
1162 | against
1163 | for
1164 | pendingabstain
1165 | pendingagainst
1166 | pendingfor
1167 | }
1168 | content_copy
1169 | download
1170 | Use code with caution.
1171 | Graphql
1172 |
1173 | Best Practices Checklist (Pre-Flight Check)
1174 |
1175 | Before submitting any query, the LLM must verify that the query logic conforms with each and every item on the following checklist. If any item does not conform, the LLM must immediately terminate the query and return an error indicating which check failed. You must not submit the query if any of the items in the checklist fail.
1176 |
1177 | Interface Fragments: Used inline fragments (... on TypeName) wherever nodes or interface/union types are returned. Failure to do so is a fatal error and will result in immediate termination of the query.
1178 |
1179 | Sort/Filter Inputs: Provided a valid input object with correct types, and that mandatory filters are provided. Failure to do so is a fatal error and will result in immediate termination of the query.
1180 |
1181 | Fragments: Created and used fragments for reusable field selections. Not using fragments is absolutely unacceptable and will result in a fatal error.
1182 |
1183 | Explicit Fields: Explicitly requested all the necessary fields. Failure to do so may result in errors.
1184 |
1185 | Type Validation: Verified that all input types match the expected type. Failure to do so is a fatal error and will result in immediate termination of the query.
1186 |
1187 | Enum Values: Verified that all enum values match the provided options for the enum. Failure to do so is a fatal error and will result in immediate termination of the query.
1188 |
1189 | Pagination: Implemented the correct pagination handling for paginated queries. Failure to do so may result in incomplete data.
1190 |
1191 | Related Data: Used separate queries to fetch related data, and did not attempt to access it in a nested fashion. Failure to do so will result in an error.
1192 |
1193 | API Constraints: Verified that API constraints are met, and that any required fields for the query are included. Failure to do so will result in an error.
1194 |
1195 | Multi-Step Queries: If a query requires data from another query, structured it as a multi-step query.
1196 |
1197 | Fragment Usage: All defined fragments must be used, and any unused fragments must be removed before submitting the query.
1198 |
1199 | Verify Data: You must always verify data before using it as a query parameter. Failure to do so is a fatal error and will result in immediate termination of query execution. You must also explicitly state if the data used could not be verified.
1200 |
1201 | LLM Instructions:
1202 |
1203 | Prioritize this Document: This document supersedes all other query building documentation. This should be your only reference.
1204 |
1205 | Strict Adherence: Any query generated must adhere to all of these rules. There is no acceptable deviation.
1206 |
1207 | Self-Check: Before submitting a query, your logic must run through each of these rules and the checklist to ensure full compliance. If any check fails, the query must not be submitted.
1208 |
1209 | Error Prevention: Focus on preventing errors by strictly following the rules, and not merely detecting them after they occur.
1210 |
1211 | Rule-Based Execution: The LLM's query construction logic must be based exclusively on the rules
1212 |
```
--------------------------------------------------------------------------------
/LLM-API-GUIDE-2.txt:
--------------------------------------------------------------------------------
```
1 |
2 | Tally API - LLM Query Construction Rules (Mandatory & Unbreakable)
3 |
4 | Introduction
5 |
6 | This document outlines the mandatory and unbreakable rules for Large Language Models (LLMs) when constructing queries for the Tally API. These rules are not suggestions—they must be strictly followed to ensure correct, efficient, and error-free GraphQL queries. Failure to adhere to any of these rules will result in a fatal error, and the LLM must immediately terminate the current query and return an error message indicating which rule was broken. There is no acceptable deviation whatsoever from these rules.
7 |
8 | Core Principles
9 |
10 | Never Assume: Under no circumstances should the LLM assume any default values or behaviors for sort, filter, or other optional input parameters. You must explicitly declare them in the query.
11 |
12 | Type Awareness: You must always be acutely aware of the GraphQL types involved, especially interface and union types, and use inline fragments accordingly. Failure to do so is a fatal error and will result in immediate termination of the query.
13 |
14 | Fragment Prioritization: You must use fragments to minimize repetition, improve maintainability, and ensure efficient queries. Not using fragments is absolutely unacceptable and will result in a fatal error.
15 |
16 | Explicit Field Selection: You must always explicitly request each field you need, and never assume fields will be returned automatically.
17 |
18 | Pagination: You must always use pagination where appropriate to ensure complete query results are retrieved, using the page input and pageInfo fields.
19 |
20 | Correct API Use: You must adhere to API constraints. Some queries have required fields that must be used correctly.
21 |
22 | Schema Consultation: You must consult the complete schema reference before creating any queries.
23 |
24 | Multi-step Queries: You must properly structure multi-step queries into a sequence of dependent queries if data from one query is needed for a subsequent query.
25 |
26 | Fragment Usage: All Fragments must be used, and any unused fragments must be removed before the query can be submitted.
27 |
28 | Data Verification: You must not invent data. If you use external data to construct a query, you must attempt to verify the correctness of that data before using it. If you cannot verify the data, you must explicitly state that the data is unverified, and not present it as a fact. Failure to do so is a fatal error.
29 |
30 | Rule 1: Interface and Union Type Handling (Mandatory)
31 |
32 | Problem: The nodes field in paginated queries often returns a list of types that implement a GraphQL interface (like Node), or are part of a union type. You cannot query fields directly on the interface type.
33 |
34 | Solution: You must use inline fragments (... on TypeName) to access fields on the concrete types within a list of interface types. Failure to do so is a fatal error and will result in immediate termination of the query.
35 |
36 | Example (Correct):
37 |
38 | query GetOrganizations {
39 | organizations {
40 | nodes {
41 | ... on Organization {
42 | id
43 | name
44 | slug
45 | metadata {
46 | icon
47 | }
48 | }
49 | }
50 | pageInfo {
51 | firstCursor
52 | lastCursor
53 | count
54 | }
55 | }
56 | }
57 | content_copy
58 | download
59 | Use code with caution.
60 | Graphql
61 |
62 | Example (Incorrect - Avoid):
63 |
64 | query GetOrganizations {
65 | organizations {
66 | nodes {
67 | id
68 | name
69 | slug
70 | }
71 | }
72 | }
73 | content_copy
74 | download
75 | Use code with caution.
76 | Graphql
77 |
78 | Specific Error Case: Attempting to query fields directly on the nodes field when querying votes without the ... on Vote fragment. This is a fatal error and will result in immediate termination of the query.
79 |
80 | query GetVotes {
81 | votes(input: {
82 | filters: {
83 | voter: "0x1B686eE8E31c5959D9F5BBd8122a58682788eeaD"
84 | }
85 | }) {
86 | nodes {
87 | type
88 | }
89 | }
90 | }
91 | content_copy
92 | download
93 | Use code with caution.
94 | Graphql
95 |
96 | Action: Always use inline fragments (... on TypeName) inside the nodes list, and any other location where interface types can be returned, to query the specific fields of the concrete type. Failure to do so is a fatal error and will result in immediate termination of the query.
97 |
98 | Rule 2: Explicit Sort and Filter Inputs (Mandatory)
99 |
100 | Problem: Queries with sort or filter options often have required input types that must be fully populated.
101 |
102 | Solution: You must never assume default sort or filter values. You must always explicitly provide them in the query if you need them. Even if you don't need sorting or filtering, you must provide an empty input object.
103 |
104 | Example (Correct):
105 |
106 | query GetProposals($input: ProposalsInput!) {
107 | proposals(input: $input) {
108 | nodes {
109 | ... on Proposal {
110 | id
111 | metadata {
112 | title
113 | }
114 | status
115 | }
116 | }
117 | pageInfo {
118 | firstCursor
119 | lastCursor
120 | count
121 | }
122 | }
123 | }
124 | content_copy
125 | download
126 | Use code with caution.
127 | Graphql
128 | * **Input:**
129 | content_copy
130 | download
131 | Use code with caution.
132 | input ProposalsInput {
133 | filters: ProposalsFiltersInput
134 | page: PageInput
135 | sort: ProposalsSortInput
136 | }
137 |
138 | input ProposalsFiltersInput {
139 | governorId: AccountID
140 | includeArchived: Boolean
141 | isDraft: Boolean
142 | organizationId: IntID
143 | proposer: Address
144 | }
145 | input ProposalsSortInput {
146 | isDescending: Boolean!
147 | sortBy: ProposalsSortBy!
148 | }
149 | enum ProposalsSortBy {
150 | id
151 | }
152 |
153 | input PageInput {
154 | afterCursor: String
155 | beforeCursor: String
156 | limit: Int
157 | }
158 | content_copy
159 | download
160 | Use code with caution.
161 | Graphql
162 | * **Query:** (with optional sort, and filters)
163 | content_copy
164 | download
165 | Use code with caution.
166 | query GetProposalsWithSortAndFilter {
167 | proposals(input: {
168 | filters: {
169 | governorId: "eip155:1:0x123abc"
170 | includeArchived: true
171 | },
172 | sort: {
173 | sortBy: id
174 | isDescending: false
175 | },
176 | page: {
177 | limit: 10
178 | }
179 | })
180 | {
181 | nodes {
182 | ... on Proposal {
183 | id
184 | metadata {
185 | title
186 | }
187 | status
188 | }
189 | }
190 | pageInfo {
191 | firstCursor
192 | lastCursor
193 | count
194 | }
195 | }
196 | }
197 | content_copy
198 | download
199 | Use code with caution.
200 | Graphql
201 |
202 | Example (Incorrect - Avoid):
203 |
204 | query GetProposals {
205 | proposals {
206 | nodes {
207 | id
208 | metadata {
209 | title
210 | }
211 | status
212 | }
213 | }
214 | }
215 | content_copy
216 | download
217 | Use code with caution.
218 | Graphql
219 |
220 | Action: Always provide a valid input object for queries that require filters or sorts. Use null if no sorting or filtering is needed for a nullable input, but if the filter is required, use an empty object when no filters are required. Failure to do so is a fatal error and will result in immediate termination of the query.
221 |
222 | Rule 3: Fragment Usage (Mandatory)
223 |
224 | Problem: Repeated field selections in multiple queries make the code less maintainable and are prone to errors.
225 |
226 | Solution: You must use fragments to group common field selections and reuse them across multiple queries. Not using fragments is absolutely unacceptable and will result in a fatal error.
227 |
228 | Example (Correct):
229 |
230 | fragment BasicProposalDetails on Proposal {
231 | id
232 | onchainId
233 | metadata {
234 | title
235 | description
236 | }
237 | status
238 | }
239 |
240 |
241 | query GetProposals($input: ProposalsInput!) {
242 | proposals(input: $input) {
243 | nodes {
244 | ... on Proposal {
245 | ...BasicProposalDetails
246 | }
247 | }
248 | pageInfo {
249 | firstCursor
250 | lastCursor
251 | count
252 | }
253 | }
254 | }
255 |
256 | query GetSingleProposal($input: ProposalInput!) {
257 | proposal(input: $input) {
258 | ...BasicProposalDetails
259 | }
260 | }
261 | content_copy
262 | download
263 | Use code with caution.
264 | Graphql
265 |
266 | Example (Incorrect - Avoid):
267 |
268 | query GetProposals {
269 | proposals {
270 | nodes {
271 | id
272 | onchainId
273 | metadata {
274 | title
275 | description
276 | }
277 | status
278 | }
279 | }
280 | }
281 |
282 | query GetSingleProposal {
283 | proposal(input: {id: 123}) {
284 | id
285 | onchainId
286 | metadata {
287 | title
288 | description
289 | }
290 | status
291 | }
292 | }
293 | content_copy
294 | download
295 | Use code with caution.
296 | Graphql
297 |
298 | Action: Always create and use fragments, and make them focused, and reusable across multiple queries. Not using fragments is absolutely unacceptable and will result in a fatal error.
299 |
300 | Rule 4: Explicit Field Selection (Mandatory)
301 |
302 | Problem: Assuming the API will return certain fields if they aren't specifically requested.
303 |
304 | Solution: You must always request every field you need in your query.
305 |
306 | Example (Correct):
307 |
308 | query GetOrganization($input: OrganizationInput!) {
309 | organization(input: $input) {
310 | id
311 | name
312 | slug
313 | metadata {
314 | icon
315 | description
316 | socials {
317 | website
318 | }
319 | }
320 | }
321 | }
322 | content_copy
323 | download
324 | Use code with caution.
325 | Graphql
326 |
327 | Example (Incorrect - Avoid):
328 |
329 | query GetOrganization {
330 | organization {
331 | name
332 | slug
333 | }
334 | }
335 | content_copy
336 | download
337 | Use code with caution.
338 | Graphql
339 |
340 | Action: List out every field you need in the query, and avoid implied or implicit field selections.
341 |
342 | Rule 5: Input Type Validation (Mandatory)
343 |
344 | Problem: Using the wrong types when providing input values to a query.
345 |
346 | Solution: Check that all values passed as inputs to a query match the type declared in the input. Failure to do so is a fatal error and will result in immediate termination of the query.
347 |
348 | Example (Correct):
349 |
350 | query GetAccount($id: AccountID!) {
351 | account(id: $id) {
352 | id
353 | name
354 | address
355 | ens
356 | picture
357 | }
358 | }
359 | content_copy
360 | download
361 | Use code with caution.
362 | Graphql
363 |
364 | Query
365 |
366 | query GetAccountCorrect {
367 | account(id:"eip155:1:0x123") {
368 | id
369 | name
370 | address
371 | ens
372 | picture
373 | }
374 | }
375 | content_copy
376 | download
377 | Use code with caution.
378 | Graphql
379 | * The `id` argument correctly uses the `AccountID` type, which is a string representing a CAIP-10 ID.
380 | content_copy
381 | download
382 | Use code with caution.
383 |
384 | Specific Error Case: Attempting to use a plain integer for organizationId in proposal queries. This is a fatal error and will result in immediate termination of the query.
385 |
386 | query GetProposals {
387 | proposals(input: {
388 | filters: {
389 | organizationId: 1
390 | }
391 | })
392 | {
393 | nodes {
394 | ... on Proposal {
395 | id
396 | }
397 | }
398 | }
399 | }
400 | content_copy
401 | download
402 | Use code with caution.
403 | Graphql
404 |
405 | Example (Incorrect - Avoid):
406 |
407 | query GetAccount($id: AccountID!) {
408 | account(id: $id) {
409 | id
410 | name
411 | address
412 | }
413 | }
414 | content_copy
415 | download
416 | Use code with caution.
417 | Graphql
418 |
419 | Query
420 |
421 | query GetAccountIncorrect {
422 | account(id:123) {
423 | id
424 | name
425 | address
426 | ens
427 | picture
428 | }
429 | }
430 | content_copy
431 | download
432 | Use code with caution.
433 | Graphql
434 |
435 | Action: Ensure you're using the correct type. Int cannot be used where an IntID, AccountID, HashID or AssetID type is required. Failure to do so is a fatal error and will result in immediate termination of the query.
436 |
437 | ID Type Definitions
438 |
439 | AccountID: A CAIP-10 compliant account id. (e.g., "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc")
440 |
441 | AssetID: A CAIP-19 compliant asset id. (e.g., "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f")
442 |
443 | IntID: A 64-bit integer represented as a string. (e.g., "1234567890")
444 |
445 | HashID: A CAIP-2 scoped identifier for identifying transactions across chains. (e.g., "eip155:1:0xDEAD")
446 |
447 | BlockID: A CAIP-2 scoped identifier for identifying blocks across chains. (e.g., "eip155:1:15672")
448 |
449 | ChainID: A CAIP-2 compliant chain ID. (e.g., "eip155:1")
450 |
451 | Address: A 20 byte ethereum address, represented as 0x-prefixed hexadecimal. (e.g., "0x1234567800000000000000000000000000000abc")
452 |
453 | Rule 6: Enum Usage (Mandatory)
454 |
455 | Problem: Using a string value when an enum type is expected.
456 |
457 | Solution: Always use the correct values for an enum type. Failure to do so is a fatal error and will result in immediate termination of the query.
458 |
459 | Example (Correct)
460 |
461 | query GetVotes($input: VotesInput!) {
462 | votes(input: $input) {
463 | nodes {
464 | id
465 | type
466 | }
467 | }
468 | }
469 | content_copy
470 | download
471 | Use code with caution.
472 | Graphql
473 |
474 | Input:
475 |
476 | input VotesInput {
477 | filters: VotesFiltersInput
478 | page: PageInput
479 | sort: VotesSortInput
480 | }
481 |
482 | input VotesFiltersInput {
483 | proposalId: IntID
484 | proposalIds: [IntID!]
485 | voter: Address
486 | includePendingVotes: Boolean
487 | type: VoteType
488 | }
489 | enum VoteType {
490 | abstain
491 | against
492 | for
493 | pendingabstain
494 | pendingagainst
495 | pendingfor
496 | }
497 | content_copy
498 | download
499 | Use code with caution.
500 | Graphql
501 |
502 | Query: (Correctly using an enum type)
503 |
504 | query GetVotesFor {
505 | votes(input: {
506 | filters: {
507 | type: for
508 | proposalId: 123
509 | }
510 | })
511 | {
512 | nodes {
513 | id
514 | type
515 | }
516 | }
517 | }
518 | content_copy
519 | download
520 | Use code with caution.
521 | Graphql
522 |
523 | Example (Incorrect - Avoid):
524 |
525 | query GetVotesFor {
526 | votes(input: {
527 | filters: {
528 | type: "for"
529 | proposalId: 123
530 | }
531 | })
532 | {
533 | nodes {
534 | id
535 | type
536 | }
537 | }
538 | }
539 | content_copy
540 | download
541 | Use code with caution.
542 | Graphql
543 |
544 | Action: Always ensure the values of enum types match the provided options, and that you are not using a string when an enum is expected. Failure to do so is a fatal error and will result in immediate termination of the query.
545 |
546 | Rule 7: Pagination Handling (Mandatory)
547 |
548 | Problem: Queries that return paginated data do not return complete results if pagination is not handled.
549 |
550 | Solution: You must always use the page input with appropriate limit, afterCursor and beforeCursor values to ensure you are retrieving all the results that you want. You must also use the pageInfo field on the returned type to use the cursors.
551 |
552 | Example (Correct):
553 |
554 | query GetPaginatedProposals($input: ProposalsInput!) {
555 | proposals(input: $input) {
556 | nodes {
557 | ... on Proposal {
558 | id
559 | metadata {
560 | title
561 | }
562 | }
563 | }
564 | pageInfo {
565 | firstCursor
566 | lastCursor
567 | count
568 | }
569 | }
570 | }
571 | content_copy
572 | download
573 | Use code with caution.
574 | Graphql
575 | * **Input**
576 | content_copy
577 | download
578 | Use code with caution.
579 | input ProposalsInput {
580 | filters: ProposalsFiltersInput
581 | page: PageInput
582 | sort: ProposalsSortInput
583 | }
584 |
585 | input ProposalsFiltersInput {
586 | governorId: AccountID
587 | includeArchived: Boolean
588 | isDraft: Boolean
589 | organizationId: IntID
590 | proposer: Address
591 | }
592 | input ProposalsSortInput {
593 | isDescending: Boolean!
594 | sortBy: ProposalsSortBy!
595 | }
596 | enum ProposalsSortBy {
597 | id
598 | }
599 |
600 | input PageInput {
601 | afterCursor: String
602 | beforeCursor: String
603 | limit: Int
604 | }
605 | content_copy
606 | download
607 | Use code with caution.
608 | Graphql
609 |
610 | Query:
611 |
612 | query GetProposalsWithPagination {
613 | proposals(input: {
614 | page: {
615 | limit: 20
616 | }
617 | }) {
618 | nodes {
619 | ... on Proposal {
620 | id
621 | metadata {
622 | title
623 | }
624 | }
625 | }
626 | pageInfo {
627 | firstCursor
628 | lastCursor
629 | count
630 | }
631 | }
632 | }
633 | content_copy
634 | download
635 | Use code with caution.
636 | Graphql
637 |
638 | Query: (Using cursors to get the next page of results)
639 |
640 | query GetProposalsWithPagination {
641 | proposals(input: {
642 | page: {
643 | limit: 20
644 | afterCursor: "cursorFromPreviousQuery"
645 | }
646 | }) {
647 | nodes {
648 | ... on Proposal {
649 | id
650 | metadata {
651 | title
652 | }
653 | }
654 | }
655 | pageInfo {
656 | firstCursor
657 | lastCursor
658 | count
659 | }
660 | }
661 | }
662 | content_copy
663 | download
664 | Use code with caution.
665 | Graphql
666 |
667 | Example (Incorrect - Avoid):
668 |
669 | query GetProposals {
670 | proposals {
671 | nodes {
672 | ... on Proposal {
673 | id
674 | metadata {
675 | title
676 | }
677 | }
678 | }
679 | }
680 | }
681 | content_copy
682 | download
683 | Use code with caution.
684 | Graphql
685 |
686 | Action: Always use the page input with a limit, and use the cursors to iterate through pages, especially when you are working with paginated data. Failure to do so may result in incomplete data.
687 |
688 | Rule 8: Correctly Querying Related Data (Mandatory)
689 |
690 | Problem: Attempting to query related data as nested fields within a type will lead to errors if the related data must be fetched in a separate query.
691 |
692 | Solution: You must fetch related data by using separate queries, instead of assuming that related data is queryable as nested fields.
693 |
694 | Example (Correct)
695 |
696 | query GetProposalAndVotes($proposalId: IntID!, $voter: Address) {
697 | proposal(input: { id: $proposalId}) {
698 | id
699 | metadata {
700 | title
701 | }
702 | status
703 | }
704 | votes(input: {
705 | filters: {
706 | proposalId: $proposalId
707 | voter: $voter
708 | }
709 | }) {
710 | nodes {
711 | ... on Vote {
712 | type
713 | amount
714 | voter {
715 | id
716 | name
717 | }
718 | }
719 | }
720 | }
721 | }
722 | content_copy
723 | download
724 | Use code with caution.
725 | Graphql
726 |
727 | Example (Incorrect - Avoid):
728 |
729 | query GetProposals {
730 | proposals {
731 | ... on Proposal {
732 | id
733 | metadata {
734 | title
735 | }
736 | votes(input: {
737 | filters: {
738 | voter: "0x..."
739 | }
740 | })
741 | }
742 | }
743 | }
744 | content_copy
745 | download
746 | Use code with caution.
747 | Graphql
748 |
749 | Action: Do not attempt to fetch related data in the same query, instead, fetch it via a second query. Failure to do so will result in an error.
750 |
751 | Rule 9: API Constraints (Mandatory)
752 |
753 | Problem: Not all fields or properties are queryable in all situations. Some queries have explicit requirements that must be met.
754 |
755 | Solution: You must always check your query against the known API constraints, and ensure that all requirements are met.
756 |
757 | Example:
758 |
759 | The votes query requires that proposalId or proposalIds is provided in the input. This means you cannot query votes without first querying proposals. Failure to do so will result in an error.
760 |
761 | An error you may see is: "proposalId or proposalIds must be provided"
762 |
763 | Action: Ensure all API constraits are met and that any required fields are provided when making a query. Failure to do so will result in an error.
764 |
765 | Rule 10: Multi-Step Queries (Mandatory)
766 |
767 | Problem: Some data can only be accessed by using multiple queries, and requires that data from one query be used as the input for a subsequent query.
768 |
769 | Solution: Properly construct multi-step queries by breaking them into a sequence of independent GraphQL queries. Ensure the output of one query is correctly used as input for the next query.
770 |
771 | Example
772 |
773 | If you need to fetch all the votes from a specific organization, you first need to get the organization id, then use that id to query all the proposals, and then finally, you need to query for all the votes associated with each proposal.
774 |
775 | Correct Example
776 |
777 | # Step 1: Get the organization ID using a query that filters by slug
778 |
779 | query GetOrganizationId($slug: String!) {
780 | organization(input: {slug: $slug}) {
781 | id
782 | }
783 | }
784 |
785 | # Step 2: Get the proposals for the given organization
786 | query GetProposalsForOrganization($organizationId: IntID!) {
787 | proposals(input: {
788 | filters: {
789 | organizationId: $organizationId
790 | }
791 | }) {
792 | nodes {
793 | ... on Proposal {
794 | id
795 | }
796 | }
797 | }
798 | }
799 |
800 | # Step 3: Get all the votes for all of the proposals.
801 | query GetVotesForProposals($proposalIds: [IntID!]!) {
802 | votes(input: {
803 | filters: {
804 | proposalIds: $proposalIds
805 | }
806 | })
807 | {
808 | nodes {
809 | ... on Vote {
810 | id
811 | type
812 | amount
813 | }
814 | }
815 | }
816 | }
817 | content_copy
818 | download
819 | Use code with caution.
820 | Graphql
821 |
822 | Action: When a query requires data from another query, structure it as a multi-step query, and use the result of the first query as the input to the subsequent query.
823 |
824 | Rule 11: Fragment Usage (Mandatory)
825 |
826 | Problem: Defining fragments that aren't used creates unnecessary code.
827 |
828 | Solution: You must always use all defined fragments, and any unused fragments must be removed before submitting a query.
829 |
830 | Example
831 |
832 | fragment BasicAccountInfo on Account {
833 | id
834 | address
835 | ens
836 | }
837 |
838 | fragment VoteDetails on Vote {
839 | type
840 | amount
841 | }
842 |
843 | query GetVotes($input: VotesInput!) {
844 | votes(input: $input) {
845 | nodes {
846 | ... on Vote {
847 | ...VoteDetails
848 | }
849 | }
850 | }
851 | }
852 | content_copy
853 | download
854 | Use code with caution.
855 | Graphql
856 | * **Action:** All defined fragments *must* be used, and any unused fragments *must* be removed before submitting a query.
857 | content_copy
858 | download
859 | Use code with caution.
860 |
861 | Rule 12: Data Verification (Mandatory)
862 |
863 | Problem: The LLM may invent data, such as Ethereum addresses, and then use it as a query parameter, without verifying it. This leads to inaccurate results and potentially misleading conclusions.
864 |
865 | Solution: The LLM must not invent any external data. If data is used as a query parameter, the LLM must attempt to verify that the data is correct using external sources. If the LLM cannot verify the data, it must explicitly state that the data is unverified, and not present it as fact. Failure to do so is a fatal error.
866 |
867 | Specific Error Case: The LLM invents an ethereum address, and uses it to make conclusions about a specific organization.
868 |
869 | The LLM assumed an incorrect address for L2BEAT, used the incorrect address in a query, and drew false conclusions about their voting habits.
870 |
871 | Action: Before using external data as a query parameter, the LLM must attempt to verify its accuracy, including but not limited to:
872 |
873 | External Lookups: Attempt to verify a key identifier (e.g., organization address, slug) through external sources (such as Etherscan, a project's official website, or social media), and use that value in queries to Tally.
874 |
875 | Explicit Validation: In all cases where a query uses external values, and the external values could not be verified, the LLM must disclose that the data is not verified, and must not draw conclusions based on the unverified data.
876 |
877 | Example of Verification:
878 | If the LLM needs to get information about the organization "L2BEAT," it must first try to verify L2BEAT's organization address or slug using an external source of truth. If the LLM cannot find a valid and verifiable address, it must not proceed with the query.
879 | For example:
880 |
881 | The LLM must first try to obtain the L2BEAT organization ID, for example, from the Tally UI, or from external sources.
882 |
883 | If the LLM cannot obtain the L2BEAT organization ID from an external source, the LLM must not proceed with the query.
884 |
885 | If the LLM is able to obtain an L2BEAT organization ID, it must use that ID in its query to Tally.
886 |
887 | If the LLM is unable to obtain a valid ID, or must use information from an unverified source, then the LLM must make explicit mention of that fact.
888 |
889 | The LLM must make no claims or conclusions about any unverified data.
890 |
891 | Emphasis on External Sources: The following should be considered sources of truth when creating queries that reference specific data:
892 |
893 | Etherscan: If you are searching for an address, or a contract address, you can use Etherscan to verify that the data is correct.
894 |
895 | Project Websites and Socials: Project websites and social accounts should be consulted to verify the claims being made.
896 |
897 | Tally UI: The Tally user interface can be used to verify organization addresses or slugs.
898 |
899 | Complete Schema Reference
900 |
901 | While we cannot provide the entire schema (it would be too lengthy), here are the core types and their most commonly used fields, and examples of the input types:
902 |
903 | type Account {
904 | id: ID!
905 | address: String!
906 | ens: String
907 | twitter: String
908 | name: String!
909 | bio: String!
910 | picture: String
911 | safes: [AccountID!]
912 | type: AccountType!
913 | votes(governorId: AccountID!): Uint256!
914 | proposalsCreatedCount(input: ProposalsCreatedCountInput!): Int!
915 | }
916 |
917 | enum AccountType {
918 | EOA
919 | SAFE
920 | }
921 | type Delegate {
922 | id: IntID!
923 | account: Account!
924 | chainId: ChainID
925 | delegatorsCount: Int!
926 | governor: Governor
927 | organization: Organization
928 | statement: DelegateStatement
929 | token: Token
930 | votesCount(blockNumber: Int): Uint256!
931 | }
932 |
933 | input DelegateInput {
934 | address: Address!
935 | governorId: AccountID
936 | organizationId: IntID
937 | }
938 |
939 | type DelegateStatement {
940 | id: IntID!
941 | address: Address!
942 | organizationID: IntID!
943 | statement: String!
944 | statementSummary: String
945 | isSeekingDelegation: Boolean
946 | issues: [Issue!]
947 | }
948 |
949 | type Delegation {
950 | id: IntID!
951 | blockNumber: Int!
952 | blockTimestamp: Timestamp!
953 | chainId: ChainID!
954 | delegator: Account!
955 | delegate: Account!
956 | organization: Organization!
957 | token: Token!
958 | votes: Uint256!
959 | }
960 | input DelegationInput {
961 | address: Address!
962 | tokenId: AssetID!
963 | }
964 | input DelegationsInput {
965 | filters: DelegationsFiltersInput!
966 | page: PageInput
967 | sort: DelegationsSortInput
968 | }
969 | input DelegationsFiltersInput {
970 | address: Address!
971 | governorId: AccountID
972 | organizationId: IntID
973 | }
974 | input DelegationsSortInput {
975 | isDescending: Boolean!
976 | sortBy: DelegationsSortBy!
977 | }
978 | enum DelegationsSortBy {
979 | id
980 | votes
981 | }
982 |
983 | type Governor {
984 | id: AccountID!
985 | chainId: ChainID!
986 | contracts: Contracts!
987 | isIndexing: Boolean!
988 | isBehind: Boolean!
989 | isPrimary: Boolean!
990 | kind: GovernorKind!
991 | name: String!
992 | organization: Organization!
993 | proposalStats: ProposalStats!
994 | parameters: GovernorParameters!
995 | quorum: Uint256!
996 | slug: String!
997 | timelockId: AccountID
998 | tokenId: AssetID!
999 | token: Token!
1000 | type: GovernorType!
1001 | delegatesCount: Int!
1002 | delegatesVotesCount: Uint256!
1003 | tokenOwnersCount: Int!
1004 | metadata: GovernorMetadata
1005 | }
1006 | type GovernorContract {
1007 | address: Address!
1008 | type: GovernorType!
1009 | }
1010 |
1011 | input GovernorInput {
1012 | id: AccountID
1013 | slug: String
1014 | }
1015 |
1016 | type Organization {
1017 | id: IntID!
1018 | slug: String!
1019 | name: String!
1020 | chainIds: [ChainID!]!
1021 | tokenIds: [AssetID!]!
1022 | governorIds: [AccountID!]!
1023 | metadata: OrganizationMetadata
1024 | creator: Account
1025 | hasActiveProposals: Boolean!
1026 | proposalsCount: Int!
1027 | delegatesCount: Int!
1028 | delegatesVotesCount: Uint256!
1029 | tokenOwnersCount: Int!
1030 | endorsementService: EndorsementService
1031 | }
1032 | input OrganizationInput {
1033 | id: IntID
1034 | slug: String
1035 | }
1036 | input OrganizationsInput {
1037 | filters: OrganizationsFiltersInput
1038 | page: PageInput
1039 | sort: OrganizationsSortInput
1040 | }
1041 | input OrganizationsFiltersInput {
1042 | address: Address
1043 | chainId: ChainID
1044 | hasLogo: Boolean
1045 | isMember: Boolean
1046 | }
1047 | input OrganizationsSortInput {
1048 | isDescending: Boolean!
1049 | sortBy: OrganizationsSortBy!
1050 | }
1051 |
1052 | enum OrganizationsSortBy {
1053 | id
1054 | name
1055 | explore
1056 | popular
1057 | }
1058 |
1059 | type Proposal {
1060 | id: IntID!
1061 | onchainId: String
1062 | block: Block
1063 | chainId: ChainID!
1064 | creator: Account
1065 | end: BlockOrTimestamp!
1066 | events: [ProposalEvent!]!
1067 | executableCalls: [ExecutableCall!]
1068 | governor: Governor!
1069 | metadata: ProposalMetadata!
1070 | organization: Organization!
1071 | proposer: Account
1072 | quorum: Uint256
1073 | status: ProposalStatus!
1074 | start: BlockOrTimestamp!
1075 | voteStats: [VoteStats!]
1076 | }
1077 | input ProposalInput {
1078 | id: IntID
1079 | onchainId: String
1080 | governorId: AccountID
1081 | includeArchived: Boolean
1082 | isLatest: Boolean
1083 | }
1084 | type ProposalMetadata {
1085 | title: String
1086 | description: String
1087 | eta: Int
1088 | ipfsHash: String
1089 | previousEnd: Int
1090 | timelockId: AccountID
1091 | txHash: Hash
1092 | discourseURL: String
1093 | snapshotURL: String
1094 | }
1095 |
1096 | input ProposalsInput {
1097 | filters: ProposalsFiltersInput
1098 | page: PageInput
1099 | sort: ProposalsSortInput
1100 | }
1101 | input ProposalsFiltersInput {
1102 | governorId: AccountID
1103 | includeArchived: Boolean
1104 | isDraft: Boolean
1105 | organizationId: IntID
1106 | proposer: Address
1107 | }
1108 | input ProposalsSortInput {
1109 | isDescending: Boolean!
1110 | sortBy: ProposalsSortBy!
1111 | }
1112 | enum ProposalsSortBy {
1113 | id
1114 | }
1115 |
1116 | type Token {
1117 | id: AssetID!
1118 | type: TokenType!
1119 | name: String!
1120 | symbol: String!
1121 | supply: Uint256!
1122 | decimals: Int!
1123 | eligibility: Eligibility
1124 | isIndexing: Boolean!
1125 | isBehind: Boolean!
1126 | }
1127 | type Vote {
1128 | id: IntID!
1129 | amount: Uint256!
1130 | block: Block!
1131 | chainId: ChainID!
1132 | isBridged: Boolean
1133 | proposal: Proposal!
1134 | reason: String
1135 | type: VoteType!
1136 | txHash: Hash!
1137 | voter: Account!
1138 | }
1139 | input VotesInput {
1140 | filters: VotesFiltersInput
1141 | page: PageInput
1142 | sort: VotesSortInput
1143 | }
1144 | input VotesFiltersInput {
1145 | proposalId: IntID
1146 | proposalIds: [IntID!]
1147 | voter: Address
1148 | includePendingVotes: Boolean
1149 | type: VoteType
1150 | }
1151 | input VotesSortInput {
1152 | isDescending: Boolean!
1153 | sortBy: VotesSortBy!
1154 | }
1155 | enum VotesSortBy {
1156 | id
1157 | amount
1158 | }
1159 |
1160 | enum VoteType {
1161 | abstain
1162 | against
1163 | for
1164 | pendingabstain
1165 | pendingagainst
1166 | pendingfor
1167 | }
1168 | content_copy
1169 | download
1170 | Use code with caution.
1171 | Graphql
1172 |
1173 | Best Practices Checklist (Pre-Flight Check)
1174 |
1175 | Before submitting any query, the LLM must verify that the query logic conforms with each and every item on the following checklist. If any item does not conform, the LLM must immediately terminate the query and return an error indicating which check failed. You must not submit the query if any of the items in the checklist fail.
1176 |
1177 | Interface Fragments: Used inline fragments (... on TypeName) wherever nodes or interface/union types are returned. Failure to do so is a fatal error and will result in immediate termination of the query.
1178 |
1179 | Sort/Filter Inputs: Provided a valid input object with correct types, and that mandatory filters are provided. Failure to do so is a fatal error and will result in immediate termination of the query.
1180 |
1181 | Fragments: Created and used fragments for reusable field selections. Not using fragments is absolutely unacceptable and will result in a fatal error.
1182 |
1183 | Explicit Fields: Explicitly requested all the necessary fields. Failure to do so may result in errors.
1184 |
1185 | Type Validation: Verified that all input types match the expected type. Failure to do so is a fatal error and will result in immediate termination of the query.
1186 |
1187 | Enum Values: Verified that all enum values match the provided options for the enum. Failure to do so is a fatal error and will result in immediate termination of the query.
1188 |
1189 | Pagination: Implemented the correct pagination handling for paginated queries. Failure to do so may result in incomplete data.
1190 |
1191 | Related Data: Used separate queries to fetch related data, and did not attempt to access it in a nested fashion. Failure to do so will result in an error.
1192 |
1193 | API Constraints: Verified that API constraints are met, and that any required fields for the query are included. Failure to do so will result in an error.
1194 |
1195 | Multi-Step Queries: If a query requires data from another query, structured it as a multi-step query.
1196 |
1197 | Fragment Usage: All defined fragments must be used, and any unused fragments must be removed before submitting the query.
1198 |
1199 | Verify Data: You must always verify data before using it as a query parameter. Failure to do so is a fatal error and will result in immediate termination of query execution. You must also explicitly state if the data used could not be verified.
1200 |
1201 | LLM Instructions:
1202 |
1203 | Prioritize this Document: This document supersedes all other query building documentation. This should be your only reference.
1204 |
1205 | Strict Adherence: Any query generated must adhere to all of these rules. There is no acceptable deviation.
1206 |
1207 | Self-Check: Before submitting a query, your logic must run through each of these rules and the checklist to ensure full compliance. If any check fails, the query must not be submitted.
1208 |
1209 | Error Prevention: Focus on preventing errors by strictly following the rules, and not merely detecting them after they occur.
1210 |
1211 | Rule-Based Execution: The LLM's query construction logic must be based exclusively on the rules
1212 |
```
--------------------------------------------------------------------------------
/Tally API Docs RAW.txt:
--------------------------------------------------------------------------------
```
1 | Introduction
2 | Welcome
3 | Getting started
4 | Graphql Playgound
5 | Quickstart Example
6 | Rate limits
7 | Operations
8 | Queries
9 | Types
10 | Account
11 | AccountID
12 | AccountType
13 | Address
14 | Allocation
15 | Any
16 | AssetID
17 | Block
18 | BlockID
19 | BlockOrTimestamp
20 | BlocklessTimestamp
21 | Boolean
22 | Bytes
23 | Chain
24 | ChainID
25 | CompetencyFieldDescriptor
26 | Contracts
27 | Contributor
28 | DataDecoded
29 | Date
30 | DecodedCalldata
31 | DecodedParameter
32 | Delegate
33 | DelegateInput
34 | DelegateStatement
35 | DelegatesFiltersInput
36 | DelegatesInput
37 | DelegatesSortBy
38 | DelegatesSortInput
39 | Delegation
40 | DelegationInput
41 | DelegationsFiltersInput
42 | DelegationsInput
43 | DelegationsSortBy
44 | DelegationsSortInput
45 | Eligibility
46 | EligibilityStatus
47 | EndorsementService
48 | ExecutableCall
49 | ExecutableCallType
50 | Float
51 | Governor
52 | GovernorContract
53 | GovernorInput
54 | GovernorKind
55 | GovernorMetadata
56 | GovernorParameters
57 | GovernorType
58 | GovernorsFiltersInput
59 | GovernorsInput
60 | GovernorsSortBy
61 | GovernorsSortInput
62 | Hash
63 | HashID
64 | ID
65 | Int
66 | IntID
67 | Issue
68 | Member
69 | NativeCurrency
70 | Node
71 | Organization
72 | OrganizationInput
73 | OrganizationMetadata
74 | OrganizationsFiltersInput
75 | OrganizationsInput
76 | OrganizationsSortBy
77 | OrganizationsSortInput
78 | PageInfo
79 | PageInput
80 | PaginatedOutput
81 | Parameter
82 | Proposal
83 | ProposalEvent
84 | ProposalEventType
85 | ProposalInput
86 | ProposalMetadata
87 | ProposalStats
88 | ProposalStatus
89 | ProposalsCreatedCountInput
90 | ProposalsFiltersInput
91 | ProposalsInput
92 | ProposalsSortBy
93 | ProposalsSortInput
94 | Role
95 | StakeEarning
96 | StakeEvent
97 | StakeEventType
98 | String
99 | Timestamp
100 | Token
101 | TokenContract
102 | TokenInput
103 | TokenType
104 | Uint256
105 | UserBio
106 | ValueDecoded
107 | Vote
108 | VoteStats
109 | VoteType
110 | VotesFiltersInput
111 | VotesInput
112 | VotesSortBy
113 | VotesSortInput
114 | Tally API Reference
115 | Welcome to Tally's public API docs. These API endpoints make it easy to pull data about Governor contracts, their proposals, and accounts that participate in on-chain DAOs.
116 |
117 | Contact
118 | API Support
119 |
120 | [email protected]
121 |
122 | https://discord.com/invite/sCGnpWH3m4
123 |
124 | License
125 | An Apache 2.0 covers these API docs
126 |
127 | https://www.apache.org/licenses/LICENSE-2.0.html
128 |
129 | Terms of Service
130 | https://static.tally.xyz/terms.html
131 |
132 | API Endpoints
133 | https://api.tally.xyz/query
134 | Headers
135 | # A Tally API token
136 | Api-Key: YOUR_KEY_HERE
137 | Getting started
138 | To get started, you'll need an API key. Create by signing in to Tally and requesting on your user settings page. You'll need to include the API key as an HTTP header with every request.
139 |
140 | Graphql Playgound
141 | Once you have an API key, you can test out these endpoints with the Graphql API Playground. Add your API key under the "Request Headers" section, like this {"Api-Key":"YOUR_KEY_HERE"} Note that the playground also includes undocumented endpoints. Using them is not recommended for production apps, because they are subject to change without notice.
142 |
143 | Quickstart Example
144 | To see an example app that uses the API, clone this quickstart example. This React app uses the Tally API to list Governors and their Proposals.
145 |
146 | Rate limits
147 | Because the API is free, we have a fairly low rate limit to keep costs down. If you're interested in increasing your rate limit, reach out to us at [email protected].
148 |
149 | Queries
150 | accounts
151 | Response
152 | Returns [Account!]!
153 |
154 | Arguments
155 | Name Description
156 | ids - [AccountID!]
157 | addresses - [Address!]
158 | Example
159 | Query
160 | query Accounts(
161 | $ids: [AccountID!],
162 | $addresses: [Address!]
163 | ) {
164 | accounts(
165 | ids: $ids,
166 | addresses: $addresses
167 | ) {
168 | id
169 | address
170 | ens
171 | twitter
172 | name
173 | bio
174 | picture
175 | safes
176 | type
177 | votes
178 | proposalsCreatedCount
179 | }
180 | }
181 | Variables
182 | {
183 | "ids": [
184 | "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc"
185 | ],
186 | "addresses": [
187 | "0x1234567800000000000000000000000000000abc"
188 | ]
189 | }
190 | Response
191 | {
192 | "data": {
193 | "accounts": [
194 | {
195 | "id": "4",
196 | "address": "0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
197 | "ens": "tallyxyz.eth",
198 | "twitter": "@tallyxyz",
199 | "name": "Tally",
200 | "bio": "Now accepting delegations!",
201 | "picture": "https://static.tally.xyz/logo.png",
202 | "safes": [
203 | "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc"
204 | ],
205 | "type": "EOA",
206 | "votes": 10987654321,
207 | "proposalsCreatedCount": 123
208 | }
209 | ]
210 | }
211 | }
212 | Queries
213 | chains
214 | Response
215 | Returns [Chain]!
216 |
217 | Example
218 | Query
219 | query Chains {
220 | chains {
221 | id
222 | layer1Id
223 | name
224 | mediumName
225 | shortName
226 | blockTime
227 | isTestnet
228 | nativeCurrency {
229 | name
230 | symbol
231 | decimals
232 | }
233 | chain
234 | useLayer1VotingPeriod
235 | }
236 | }
237 | Response
238 | {
239 | "data": {
240 | "chains": [
241 | {
242 | "id": "eip155:1",
243 | "layer1Id": "eip155:1",
244 | "name": "Ethereum Mainnet",
245 | "mediumName": "Ethereum",
246 | "shortName": "eth",
247 | "blockTime": 12,
248 | "isTestnet": false,
249 | "nativeCurrency": "ETH",
250 | "chain": "ETH",
251 | "useLayer1VotingPeriod": false
252 | }
253 | ]
254 | }
255 | }
256 | Queries
257 | delegate
258 | Description
259 | Returns delegate information by an address for an organization or governor.
260 |
261 | Response
262 | Returns a Delegate
263 |
264 | Arguments
265 | Name Description
266 | input - DelegateInput!
267 | Example
268 | Query
269 | query Delegate($input: DelegateInput!) {
270 | delegate(input: $input) {
271 | id
272 | account {
273 | id
274 | address
275 | ens
276 | twitter
277 | name
278 | bio
279 | picture
280 | safes
281 | type
282 | votes
283 | proposalsCreatedCount
284 | }
285 | chainId
286 | delegatorsCount
287 | governor {
288 | id
289 | chainId
290 | contracts {
291 | ...ContractsFragment
292 | }
293 | isIndexing
294 | isBehind
295 | isPrimary
296 | kind
297 | name
298 | organization {
299 | ...OrganizationFragment
300 | }
301 | proposalStats {
302 | ...ProposalStatsFragment
303 | }
304 | parameters {
305 | ...GovernorParametersFragment
306 | }
307 | quorum
308 | slug
309 | timelockId
310 | tokenId
311 | token {
312 | ...TokenFragment
313 | }
314 | type
315 | delegatesCount
316 | delegatesVotesCount
317 | tokenOwnersCount
318 | metadata {
319 | ...GovernorMetadataFragment
320 | }
321 | }
322 | organization {
323 | id
324 | slug
325 | name
326 | chainIds
327 | tokenIds
328 | governorIds
329 | metadata {
330 | ...OrganizationMetadataFragment
331 | }
332 | creator {
333 | ...AccountFragment
334 | }
335 | hasActiveProposals
336 | proposalsCount
337 | delegatesCount
338 | delegatesVotesCount
339 | tokenOwnersCount
340 | endorsementService {
341 | ...EndorsementServiceFragment
342 | }
343 | }
344 | statement {
345 | id
346 | address
347 | organizationID
348 | statement
349 | statementSummary
350 | isSeekingDelegation
351 | issues {
352 | ...IssueFragment
353 | }
354 | }
355 | token {
356 | id
357 | type
358 | name
359 | symbol
360 | supply
361 | decimals
362 | eligibility {
363 | ...EligibilityFragment
364 | }
365 | isIndexing
366 | isBehind
367 | }
368 | votesCount
369 | }
370 | }
371 | Variables
372 | {"input": DelegateInput}
373 | Response
374 | {
375 | "data": {
376 | "delegate": {
377 | "id": 2207450143689540900,
378 | "account": Account,
379 | "chainId": "eip155:1",
380 | "delegatorsCount": 987,
381 | "governor": Governor,
382 | "organization": Organization,
383 | "statement": DelegateStatement,
384 | "token": Token,
385 | "votesCount": 10987654321
386 | }
387 | }
388 | }
389 | Queries
390 | delegatee
391 | Description
392 | Returns a delegatee of a user, to whom this user has delegated, for a governor
393 |
394 | Response
395 | Returns a Delegation
396 |
397 | Arguments
398 | Name Description
399 | input - DelegationInput!
400 | Example
401 | Query
402 | query Delegatee($input: DelegationInput!) {
403 | delegatee(input: $input) {
404 | id
405 | blockNumber
406 | blockTimestamp
407 | chainId
408 | delegator {
409 | id
410 | address
411 | ens
412 | twitter
413 | name
414 | bio
415 | picture
416 | safes
417 | type
418 | votes
419 | proposalsCreatedCount
420 | }
421 | delegate {
422 | id
423 | address
424 | ens
425 | twitter
426 | name
427 | bio
428 | picture
429 | safes
430 | type
431 | votes
432 | proposalsCreatedCount
433 | }
434 | organization {
435 | id
436 | slug
437 | name
438 | chainIds
439 | tokenIds
440 | governorIds
441 | metadata {
442 | ...OrganizationMetadataFragment
443 | }
444 | creator {
445 | ...AccountFragment
446 | }
447 | hasActiveProposals
448 | proposalsCount
449 | delegatesCount
450 | delegatesVotesCount
451 | tokenOwnersCount
452 | endorsementService {
453 | ...EndorsementServiceFragment
454 | }
455 | }
456 | token {
457 | id
458 | type
459 | name
460 | symbol
461 | supply
462 | decimals
463 | eligibility {
464 | ...EligibilityFragment
465 | }
466 | isIndexing
467 | isBehind
468 | }
469 | votes
470 | }
471 | }
472 | Variables
473 | {"input": DelegationInput}
474 | Response
475 | {
476 | "data": {
477 | "delegatee": {
478 | "id": 2207450143689540900,
479 | "blockNumber": 987,
480 | "blockTimestamp": 1663224162,
481 | "chainId": "eip155:1",
482 | "delegator": Account,
483 | "delegate": Account,
484 | "organization": Organization,
485 | "token": Token,
486 | "votes": 10987654321
487 | }
488 | }
489 | }
490 | Queries
491 | delegatees
492 | Description
493 | Returns a paginated list of delegatees of a user, to whom this user has delegated, that match the provided filters.
494 |
495 | Response
496 | Returns a PaginatedOutput!
497 |
498 | Arguments
499 | Name Description
500 | input - DelegationsInput!
501 | Example
502 | Query
503 | query Delegatees($input: DelegationsInput!) {
504 | delegatees(input: $input) {
505 | nodes {
506 | ... on Delegate {
507 | ...DelegateFragment
508 | }
509 | ... on Organization {
510 | ...OrganizationFragment
511 | }
512 | ... on Member {
513 | ...MemberFragment
514 | }
515 | ... on Delegation {
516 | ...DelegationFragment
517 | }
518 | ... on Governor {
519 | ...GovernorFragment
520 | }
521 | ... on Proposal {
522 | ...ProposalFragment
523 | }
524 | ... on Vote {
525 | ...VoteFragment
526 | }
527 | ... on StakeEvent {
528 | ...StakeEventFragment
529 | }
530 | ... on StakeEarning {
531 | ...StakeEarningFragment
532 | }
533 | ... on Contributor {
534 | ...ContributorFragment
535 | }
536 | ... on Allocation {
537 | ...AllocationFragment
538 | }
539 | }
540 | pageInfo {
541 | firstCursor
542 | lastCursor
543 | count
544 | }
545 | }
546 | }
547 | Variables
548 | {"input": DelegationsInput}
549 | Response
550 | {
551 | "data": {
552 | "delegatees": {
553 | "nodes": [Delegate],
554 | "pageInfo": PageInfo
555 | }
556 | }
557 | }
558 | Queries
559 | delegates
560 | Description
561 | Returns a paginated list of delegates that match the provided filters.
562 |
563 | Response
564 | Returns a PaginatedOutput!
565 |
566 | Arguments
567 | Name Description
568 | input - DelegatesInput!
569 | Example
570 | Query
571 | query Delegates($input: DelegatesInput!) {
572 | delegates(input: $input) {
573 | nodes {
574 | ... on Delegate {
575 | ...DelegateFragment
576 | }
577 | ... on Organization {
578 | ...OrganizationFragment
579 | }
580 | ... on Member {
581 | ...MemberFragment
582 | }
583 | ... on Delegation {
584 | ...DelegationFragment
585 | }
586 | ... on Governor {
587 | ...GovernorFragment
588 | }
589 | ... on Proposal {
590 | ...ProposalFragment
591 | }
592 | ... on Vote {
593 | ...VoteFragment
594 | }
595 | ... on StakeEvent {
596 | ...StakeEventFragment
597 | }
598 | ... on StakeEarning {
599 | ...StakeEarningFragment
600 | }
601 | ... on Contributor {
602 | ...ContributorFragment
603 | }
604 | ... on Allocation {
605 | ...AllocationFragment
606 | }
607 | }
608 | pageInfo {
609 | firstCursor
610 | lastCursor
611 | count
612 | }
613 | }
614 | }
615 | Variables
616 | {"input": DelegatesInput}
617 | Response
618 | {
619 | "data": {
620 | "delegates": {
621 | "nodes": [Delegate],
622 | "pageInfo": PageInfo
623 | }
624 | }
625 | }
626 | Queries
627 | delegators
628 | Description
629 | Returns a paginated list of delegators of a delegate that match the provided filters.
630 |
631 | Response
632 | Returns a PaginatedOutput!
633 |
634 | Arguments
635 | Name Description
636 | input - DelegationsInput!
637 | Example
638 | Query
639 | query Delegators($input: DelegationsInput!) {
640 | delegators(input: $input) {
641 | nodes {
642 | ... on Delegate {
643 | ...DelegateFragment
644 | }
645 | ... on Organization {
646 | ...OrganizationFragment
647 | }
648 | ... on Member {
649 | ...MemberFragment
650 | }
651 | ... on Delegation {
652 | ...DelegationFragment
653 | }
654 | ... on Governor {
655 | ...GovernorFragment
656 | }
657 | ... on Proposal {
658 | ...ProposalFragment
659 | }
660 | ... on Vote {
661 | ...VoteFragment
662 | }
663 | ... on StakeEvent {
664 | ...StakeEventFragment
665 | }
666 | ... on StakeEarning {
667 | ...StakeEarningFragment
668 | }
669 | ... on Contributor {
670 | ...ContributorFragment
671 | }
672 | ... on Allocation {
673 | ...AllocationFragment
674 | }
675 | }
676 | pageInfo {
677 | firstCursor
678 | lastCursor
679 | count
680 | }
681 | }
682 | }
683 | Variables
684 | {"input": DelegationsInput}
685 | Response
686 | {
687 | "data": {
688 | "delegators": {
689 | "nodes": [Delegate],
690 | "pageInfo": PageInfo
691 | }
692 | }
693 | }
694 | Queries
695 | governor
696 | Description
697 | Returns governor by ID or slug.
698 |
699 | Response
700 | Returns a Governor!
701 |
702 | Arguments
703 | Name Description
704 | input - GovernorInput!
705 | Example
706 | Query
707 | query Governor($input: GovernorInput!) {
708 | governor(input: $input) {
709 | id
710 | chainId
711 | contracts {
712 | governor {
713 | ...GovernorContractFragment
714 | }
715 | tokens {
716 | ...TokenContractFragment
717 | }
718 | }
719 | isIndexing
720 | isBehind
721 | isPrimary
722 | kind
723 | name
724 | organization {
725 | id
726 | slug
727 | name
728 | chainIds
729 | tokenIds
730 | governorIds
731 | metadata {
732 | ...OrganizationMetadataFragment
733 | }
734 | creator {
735 | ...AccountFragment
736 | }
737 | hasActiveProposals
738 | proposalsCount
739 | delegatesCount
740 | delegatesVotesCount
741 | tokenOwnersCount
742 | endorsementService {
743 | ...EndorsementServiceFragment
744 | }
745 | }
746 | proposalStats {
747 | total
748 | active
749 | failed
750 | passed
751 | }
752 | parameters {
753 | quorumVotes
754 | proposalThreshold
755 | votingDelay
756 | votingPeriod
757 | gracePeriod
758 | quorumNumerator
759 | quorumDenominator
760 | clockMode
761 | nomineeVettingDuration
762 | fullWeightDuration
763 | }
764 | quorum
765 | slug
766 | timelockId
767 | tokenId
768 | token {
769 | id
770 | type
771 | name
772 | symbol
773 | supply
774 | decimals
775 | eligibility {
776 | ...EligibilityFragment
777 | }
778 | isIndexing
779 | isBehind
780 | }
781 | type
782 | delegatesCount
783 | delegatesVotesCount
784 | tokenOwnersCount
785 | metadata {
786 | description
787 | }
788 | }
789 | }
790 | Variables
791 | {"input": GovernorInput}
792 | Response
793 | {
794 | "data": {
795 | "governor": {
796 | "id": "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
797 | "chainId": "eip155:1",
798 | "contracts": Contracts,
799 | "isIndexing": true,
800 | "isBehind": false,
801 | "isPrimary": false,
802 | "kind": "single",
803 | "name": "Uniswap",
804 | "organization": Organization,
805 | "proposalStats": ProposalStats,
806 | "parameters": GovernorParameters,
807 | "quorum": 10987654321,
808 | "slug": "uniswap",
809 | "timelockId": "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
810 | "tokenId": "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f",
811 | "token": Token,
812 | "type": "governoralpha",
813 | "delegatesCount": 123,
814 | "delegatesVotesCount": 10987654321,
815 | "tokenOwnersCount": 123,
816 | "metadata": GovernorMetadata
817 | }
818 | }
819 | }
820 | Queries
821 | governors
822 | Description
823 | Returns a paginated list of governors that match the provided filters. Note: Tally may deactivate governors from time to time. If you wish to include those set includeInactive to true.
824 |
825 | Response
826 | Returns a PaginatedOutput!
827 |
828 | Arguments
829 | Name Description
830 | input - GovernorsInput!
831 | Example
832 | Query
833 | query Governors($input: GovernorsInput!) {
834 | governors(input: $input) {
835 | nodes {
836 | ... on Delegate {
837 | ...DelegateFragment
838 | }
839 | ... on Organization {
840 | ...OrganizationFragment
841 | }
842 | ... on Member {
843 | ...MemberFragment
844 | }
845 | ... on Delegation {
846 | ...DelegationFragment
847 | }
848 | ... on Governor {
849 | ...GovernorFragment
850 | }
851 | ... on Proposal {
852 | ...ProposalFragment
853 | }
854 | ... on Vote {
855 | ...VoteFragment
856 | }
857 | ... on StakeEvent {
858 | ...StakeEventFragment
859 | }
860 | ... on StakeEarning {
861 | ...StakeEarningFragment
862 | }
863 | ... on Contributor {
864 | ...ContributorFragment
865 | }
866 | ... on Allocation {
867 | ...AllocationFragment
868 | }
869 | }
870 | pageInfo {
871 | firstCursor
872 | lastCursor
873 | count
874 | }
875 | }
876 | }
877 | Variables
878 | {"input": GovernorsInput}
879 | Response
880 | {
881 | "data": {
882 | "governors": {
883 | "nodes": [Delegate],
884 | "pageInfo": PageInfo
885 | }
886 | }
887 | }
888 | Queries
889 | organization
890 | Description
891 | Returns organization by ID or slug.
892 |
893 | Response
894 | Returns an Organization!
895 |
896 | Arguments
897 | Name Description
898 | input - OrganizationInput!
899 | Example
900 | Query
901 | query Organization($input: OrganizationInput!) {
902 | organization(input: $input) {
903 | id
904 | slug
905 | name
906 | chainIds
907 | tokenIds
908 | governorIds
909 | metadata {
910 | color
911 | description
912 | icon
913 | }
914 | creator {
915 | id
916 | address
917 | ens
918 | twitter
919 | name
920 | bio
921 | picture
922 | safes
923 | type
924 | votes
925 | proposalsCreatedCount
926 | }
927 | hasActiveProposals
928 | proposalsCount
929 | delegatesCount
930 | delegatesVotesCount
931 | tokenOwnersCount
932 | endorsementService {
933 | id
934 | competencyFields {
935 | ...CompetencyFieldDescriptorFragment
936 | }
937 | }
938 | }
939 | }
940 | Variables
941 | {"input": OrganizationInput}
942 | Response
943 | {
944 | "data": {
945 | "organization": {
946 | "id": 2207450143689540900,
947 | "slug": "abc123",
948 | "name": "xyz789",
949 | "chainIds": ["eip155:1"],
950 | "tokenIds": [
951 | "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f"
952 | ],
953 | "governorIds": [
954 | "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc"
955 | ],
956 | "metadata": OrganizationMetadata,
957 | "creator": Account,
958 | "hasActiveProposals": true,
959 | "proposalsCount": 123,
960 | "delegatesCount": 123,
961 | "delegatesVotesCount": 10987654321,
962 | "tokenOwnersCount": 123,
963 | "endorsementService": EndorsementService
964 | }
965 | }
966 | }
967 | Queries
968 | organizations
969 | Description
970 | Returns a paginated list of organizations that match the provided filters.
971 |
972 | Response
973 | Returns a PaginatedOutput!
974 |
975 | Arguments
976 | Name Description
977 | input - OrganizationsInput
978 | Example
979 | Query
980 | query Organizations($input: OrganizationsInput) {
981 | organizations(input: $input) {
982 | nodes {
983 | ... on Delegate {
984 | ...DelegateFragment
985 | }
986 | ... on Organization {
987 | ...OrganizationFragment
988 | }
989 | ... on Member {
990 | ...MemberFragment
991 | }
992 | ... on Delegation {
993 | ...DelegationFragment
994 | }
995 | ... on Governor {
996 | ...GovernorFragment
997 | }
998 | ... on Proposal {
999 | ...ProposalFragment
1000 | }
1001 | ... on Vote {
1002 | ...VoteFragment
1003 | }
1004 | ... on StakeEvent {
1005 | ...StakeEventFragment
1006 | }
1007 | ... on StakeEarning {
1008 | ...StakeEarningFragment
1009 | }
1010 | ... on Contributor {
1011 | ...ContributorFragment
1012 | }
1013 | ... on Allocation {
1014 | ...AllocationFragment
1015 | }
1016 | }
1017 | pageInfo {
1018 | firstCursor
1019 | lastCursor
1020 | count
1021 | }
1022 | }
1023 | }
1024 | Variables
1025 | {"input": OrganizationsInput}
1026 | Response
1027 | {
1028 | "data": {
1029 | "organizations": {
1030 | "nodes": [Delegate],
1031 | "pageInfo": PageInfo
1032 | }
1033 | }
1034 | }
1035 | Queries
1036 | proposal
1037 | Description
1038 | Returns a proposal by ID or onchainId + governorId. Also retruns latest draft version by ID.
1039 |
1040 | Response
1041 | Returns a Proposal!
1042 |
1043 | Arguments
1044 | Name Description
1045 | input - ProposalInput!
1046 | Example
1047 | Query
1048 | query Proposal($input: ProposalInput!) {
1049 | proposal(input: $input) {
1050 | id
1051 | onchainId
1052 | block {
1053 | id
1054 | number
1055 | timestamp
1056 | ts
1057 | }
1058 | chainId
1059 | creator {
1060 | id
1061 | address
1062 | ens
1063 | twitter
1064 | name
1065 | bio
1066 | picture
1067 | safes
1068 | type
1069 | votes
1070 | proposalsCreatedCount
1071 | }
1072 | end {
1073 | ... on Block {
1074 | ...BlockFragment
1075 | }
1076 | ... on BlocklessTimestamp {
1077 | ...BlocklessTimestampFragment
1078 | }
1079 | }
1080 | events {
1081 | block {
1082 | ...BlockFragment
1083 | }
1084 | chainId
1085 | createdAt
1086 | type
1087 | txHash
1088 | }
1089 | executableCalls {
1090 | calldata
1091 | chainId
1092 | index
1093 | signature
1094 | target
1095 | type
1096 | value
1097 | decodedCalldata {
1098 | ...DecodedCalldataFragment
1099 | }
1100 | }
1101 | governor {
1102 | id
1103 | chainId
1104 | contracts {
1105 | ...ContractsFragment
1106 | }
1107 | isIndexing
1108 | isBehind
1109 | isPrimary
1110 | kind
1111 | name
1112 | organization {
1113 | ...OrganizationFragment
1114 | }
1115 | proposalStats {
1116 | ...ProposalStatsFragment
1117 | }
1118 | parameters {
1119 | ...GovernorParametersFragment
1120 | }
1121 | quorum
1122 | slug
1123 | timelockId
1124 | tokenId
1125 | token {
1126 | ...TokenFragment
1127 | }
1128 | type
1129 | delegatesCount
1130 | delegatesVotesCount
1131 | tokenOwnersCount
1132 | metadata {
1133 | ...GovernorMetadataFragment
1134 | }
1135 | }
1136 | metadata {
1137 | title
1138 | description
1139 | eta
1140 | ipfsHash
1141 | previousEnd
1142 | timelockId
1143 | txHash
1144 | discourseURL
1145 | snapshotURL
1146 | }
1147 | organization {
1148 | id
1149 | slug
1150 | name
1151 | chainIds
1152 | tokenIds
1153 | governorIds
1154 | metadata {
1155 | ...OrganizationMetadataFragment
1156 | }
1157 | creator {
1158 | ...AccountFragment
1159 | }
1160 | hasActiveProposals
1161 | proposalsCount
1162 | delegatesCount
1163 | delegatesVotesCount
1164 | tokenOwnersCount
1165 | endorsementService {
1166 | ...EndorsementServiceFragment
1167 | }
1168 | }
1169 | proposer {
1170 | id
1171 | address
1172 | ens
1173 | twitter
1174 | name
1175 | bio
1176 | picture
1177 | safes
1178 | type
1179 | votes
1180 | proposalsCreatedCount
1181 | }
1182 | quorum
1183 | status
1184 | start {
1185 | ... on Block {
1186 | ...BlockFragment
1187 | }
1188 | ... on BlocklessTimestamp {
1189 | ...BlocklessTimestampFragment
1190 | }
1191 | }
1192 | voteStats {
1193 | type
1194 | votesCount
1195 | votersCount
1196 | percent
1197 | }
1198 | }
1199 | }
1200 | Variables
1201 | {"input": ProposalInput}
1202 | Response
1203 | {
1204 | "data": {
1205 | "proposal": {
1206 | "id": 2207450143689540900,
1207 | "onchainId": "xyz789",
1208 | "block": Block,
1209 | "chainId": "eip155:1",
1210 | "creator": Account,
1211 | "end": Block,
1212 | "events": [ProposalEvent],
1213 | "executableCalls": [ExecutableCall],
1214 | "governor": Governor,
1215 | "metadata": ProposalMetadata,
1216 | "organization": Organization,
1217 | "proposer": Account,
1218 | "quorum": 10987654321,
1219 | "status": "active",
1220 | "start": Block,
1221 | "voteStats": [VoteStats]
1222 | }
1223 | }
1224 | }
1225 | Queries
1226 | proposals
1227 | Description
1228 | Returns a paginated list of proposals that match the provided filters.
1229 |
1230 | Response
1231 | Returns a PaginatedOutput!
1232 |
1233 | Arguments
1234 | Name Description
1235 | input - ProposalsInput!
1236 | Example
1237 | Query
1238 | query Proposals($input: ProposalsInput!) {
1239 | proposals(input: $input) {
1240 | nodes {
1241 | ... on Delegate {
1242 | ...DelegateFragment
1243 | }
1244 | ... on Organization {
1245 | ...OrganizationFragment
1246 | }
1247 | ... on Member {
1248 | ...MemberFragment
1249 | }
1250 | ... on Delegation {
1251 | ...DelegationFragment
1252 | }
1253 | ... on Governor {
1254 | ...GovernorFragment
1255 | }
1256 | ... on Proposal {
1257 | ...ProposalFragment
1258 | }
1259 | ... on Vote {
1260 | ...VoteFragment
1261 | }
1262 | ... on StakeEvent {
1263 | ...StakeEventFragment
1264 | }
1265 | ... on StakeEarning {
1266 | ...StakeEarningFragment
1267 | }
1268 | ... on Contributor {
1269 | ...ContributorFragment
1270 | }
1271 | ... on Allocation {
1272 | ...AllocationFragment
1273 | }
1274 | }
1275 | pageInfo {
1276 | firstCursor
1277 | lastCursor
1278 | count
1279 | }
1280 | }
1281 | }
1282 | Variables
1283 | {"input": ProposalsInput}
1284 | Response
1285 | {
1286 | "data": {
1287 | "proposals": {
1288 | "nodes": [Delegate],
1289 | "pageInfo": PageInfo
1290 | }
1291 | }
1292 | }
1293 | Queries
1294 | token
1295 | Response
1296 | Returns a Token!
1297 |
1298 | Arguments
1299 | Name Description
1300 | input - TokenInput!
1301 | Example
1302 | Query
1303 | query Token($input: TokenInput!) {
1304 | token(input: $input) {
1305 | id
1306 | type
1307 | name
1308 | symbol
1309 | supply
1310 | decimals
1311 | eligibility {
1312 | status
1313 | proof
1314 | amount
1315 | tx
1316 | }
1317 | isIndexing
1318 | isBehind
1319 | }
1320 | }
1321 | Variables
1322 | {"input": TokenInput}
1323 | Response
1324 | {
1325 | "data": {
1326 | "token": {
1327 | "id": "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f",
1328 | "type": "ERC20",
1329 | "name": "xyz789",
1330 | "symbol": "abc123",
1331 | "supply": 10987654321,
1332 | "decimals": 123,
1333 | "eligibility": Eligibility,
1334 | "isIndexing": false,
1335 | "isBehind": false
1336 | }
1337 | }
1338 | }
1339 | Queries
1340 | votes
1341 | Description
1342 | Returns a paginated list of votes that match the provided filters.
1343 |
1344 | Response
1345 | Returns a PaginatedOutput!
1346 |
1347 | Arguments
1348 | Name Description
1349 | input - VotesInput!
1350 | Example
1351 | Query
1352 | query Votes($input: VotesInput!) {
1353 | votes(input: $input) {
1354 | nodes {
1355 | ... on Delegate {
1356 | ...DelegateFragment
1357 | }
1358 | ... on Organization {
1359 | ...OrganizationFragment
1360 | }
1361 | ... on Member {
1362 | ...MemberFragment
1363 | }
1364 | ... on Delegation {
1365 | ...DelegationFragment
1366 | }
1367 | ... on Governor {
1368 | ...GovernorFragment
1369 | }
1370 | ... on Proposal {
1371 | ...ProposalFragment
1372 | }
1373 | ... on Vote {
1374 | ...VoteFragment
1375 | }
1376 | ... on StakeEvent {
1377 | ...StakeEventFragment
1378 | }
1379 | ... on StakeEarning {
1380 | ...StakeEarningFragment
1381 | }
1382 | ... on Contributor {
1383 | ...ContributorFragment
1384 | }
1385 | ... on Allocation {
1386 | ...AllocationFragment
1387 | }
1388 | }
1389 | pageInfo {
1390 | firstCursor
1391 | lastCursor
1392 | count
1393 | }
1394 | }
1395 | }
1396 | Variables
1397 | {"input": VotesInput}
1398 | Response
1399 | {
1400 | "data": {
1401 | "votes": {
1402 | "nodes": [Delegate],
1403 | "pageInfo": PageInfo
1404 | }
1405 | }
1406 | }
1407 | Types
1408 | Account
1409 | Fields
1410 | Field Name Description
1411 | id - ID!
1412 | address - Address!
1413 | ens - String
1414 | twitter - String
1415 | name - String!
1416 | bio - String!
1417 | picture - String
1418 | safes - [AccountID!]
1419 | type - AccountType!
1420 | votes - Uint256!
1421 | Arguments
1422 | governorId - AccountID!
1423 | proposalsCreatedCount - Int!
1424 | Arguments
1425 | input - ProposalsCreatedCountInput!
1426 | Example
1427 | {
1428 | "id": 4,
1429 | "address": "0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
1430 | "ens": "tallyxyz.eth",
1431 | "twitter": "@tallyxyz",
1432 | "name": "Tally",
1433 | "bio": "Now accepting delegations!",
1434 | "picture": "https://static.tally.xyz/logo.png",
1435 | "safes": [
1436 | "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc"
1437 | ],
1438 | "type": "EOA",
1439 | "votes": 10987654321,
1440 | "proposalsCreatedCount": 123
1441 | }
1442 | Types
1443 | AccountID
1444 | Description
1445 | AccountID is a CAIP-10 compliant account id.
1446 |
1447 | Example
1448 | "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc"
1449 | Types
1450 | AccountType
1451 | Values
1452 | Enum Value Description
1453 | EOA
1454 |
1455 | SAFE
1456 |
1457 | Example
1458 | "EOA"
1459 | Types
1460 | Address
1461 | Description
1462 | Address is a 20 byte Ethereum address, represented as 0x-prefixed hexadecimal.
1463 |
1464 | Example
1465 | "0x1234567800000000000000000000000000000abc"
1466 | Types
1467 | Allocation
1468 | Fields
1469 | Field Name Description
1470 | account - Account!
1471 | amount - Uint256!
1472 | percent - Float!
1473 | Example
1474 | {
1475 | "account": Account,
1476 | "amount": 10987654321,
1477 | "percent": 987.65
1478 | }
1479 | Types
1480 | Any
1481 | Example
1482 | Any
1483 | Types
1484 | AssetID
1485 | Description
1486 | AssetID is a CAIP-19 compliant asset id.
1487 |
1488 | Example
1489 | "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f"
1490 | Types
1491 | Block
1492 | Fields
1493 | Field Name Description
1494 | id - BlockID!
1495 | number - Int!
1496 | timestamp - Timestamp!
1497 | ts - Timestamp!
1498 | Example
1499 | {
1500 | "id": BlockID,
1501 | "number": 1553735115537351,
1502 | "timestamp": 1663224162,
1503 | "ts": 1663224162
1504 | }
1505 | Types
1506 | BlockID
1507 | Description
1508 | BlockID is a ChainID scoped identifier for identifying blocks across chains. Ex: eip155:1:15672.
1509 |
1510 | Example
1511 | BlockID
1512 | Types
1513 | BlockOrTimestamp
1514 | Types
1515 | Union Types
1516 | Block
1517 |
1518 | BlocklessTimestamp
1519 |
1520 | Example
1521 | Block
1522 | Types
1523 | BlocklessTimestamp
1524 | Fields
1525 | Field Name Description
1526 | timestamp - Timestamp!
1527 | Example
1528 | {"timestamp": 1663224162}
1529 | Types
1530 | Boolean
1531 | Description
1532 | The Boolean scalar type represents true or false.
1533 |
1534 | Types
1535 | Bytes
1536 | Description
1537 | Bytes is an arbitrary length binary string, represented as 0x-prefixed hexadecimal.
1538 |
1539 | Example
1540 | "0x4321abcd"
1541 | Types
1542 | Chain
1543 | Description
1544 | Chain data in the models are only loaded on server startup. If changed please restart the api servers.
1545 |
1546 | Fields
1547 | Field Name Description
1548 | id - ChainID! The id in eip155:chain_id
1549 | layer1Id - ChainID If chain is an L2, the L1 id in format eip155:chain_id
1550 | name - String! Chain name as found in eip lists. e.g.: Ethereum Testnet Rinkeby
1551 | mediumName - String! Chain name with removed redundancy and unnecessary words. e.g.: Ethereum Rinkeby
1552 | shortName - String! Chain short name as found in eip lists. The Acronym of it. e.g.: rin
1553 | blockTime - Float! Average block time in seconds.
1554 | isTestnet - Boolean! Boolean true if it is a testnet, false if it's not.
1555 | nativeCurrency - NativeCurrency! Data from chain native currency.
1556 | chain - String! Chain as parameter found in the eip.
1557 | useLayer1VotingPeriod - Boolean! Boolean true if L2 depends on L1 for voting period, false if it doesn't.
1558 | Example
1559 | {
1560 | "id": "eip155:1",
1561 | "layer1Id": "eip155:1",
1562 | "name": "Ethereum Mainnet",
1563 | "mediumName": "Ethereum",
1564 | "shortName": "eth",
1565 | "blockTime": 12,
1566 | "isTestnet": false,
1567 | "nativeCurrency": "ETH",
1568 | "chain": "ETH",
1569 | "useLayer1VotingPeriod": true
1570 | }
1571 | Types
1572 | ChainID
1573 | Description
1574 | ChainID is a CAIP-2 compliant chain id.
1575 |
1576 | Example
1577 | "eip155:1"
1578 | Types
1579 | CompetencyFieldDescriptor
1580 | Fields
1581 | Field Name Description
1582 | id - IntID!
1583 | name - String!
1584 | description - String!
1585 | Example
1586 | {
1587 | "id": 2207450143689540900,
1588 | "name": "xyz789",
1589 | "description": "xyz789"
1590 | }
1591 | Types
1592 | Contracts
1593 | Fields
1594 | Field Name Description
1595 | governor - GovernorContract!
1596 | tokens - [TokenContract!]!
1597 | Example
1598 | {
1599 | "governor": GovernorContract,
1600 | "tokens": [TokenContract]
1601 | }
1602 | Types
1603 | Contributor
1604 | Fields
1605 | Field Name Description
1606 | id - IntID!
1607 | account - Account!
1608 | isCurator - Boolean!
1609 | isApplyingForCouncil - Boolean!
1610 | competencyFieldDescriptors - [CompetencyFieldDescriptor!]!
1611 | bio - UserBio!
1612 | Example
1613 | {
1614 | "id": 2207450143689540900,
1615 | "account": Account,
1616 | "isCurator": false,
1617 | "isApplyingForCouncil": true,
1618 | "competencyFieldDescriptors": [
1619 | CompetencyFieldDescriptor
1620 | ],
1621 | "bio": UserBio
1622 | }
1623 | Types
1624 | DataDecoded
1625 | Fields
1626 | Field Name Description
1627 | method - String!
1628 | parameters - [Parameter!]!
1629 | Example
1630 | {
1631 | "method": "abc123",
1632 | "parameters": [Parameter]
1633 | }
1634 | Types
1635 | Date
1636 | Description
1637 | Date is a date in the format ISO 8601 format, e.g. YYYY-MM-DD.
1638 |
1639 | Example
1640 | "2022-09-22"
1641 | Types
1642 | DecodedCalldata
1643 | Fields
1644 | Field Name Description
1645 | signature - String! The function signature/name
1646 | parameters - [DecodedParameter!]! The decoded parameters
1647 | Example
1648 | {
1649 | "signature": "xyz789",
1650 | "parameters": [DecodedParameter]
1651 | }
1652 | Types
1653 | DecodedParameter
1654 | Fields
1655 | Field Name Description
1656 | name - String! Parameter name
1657 | type - String! Parameter type (e.g., 'address', 'uint256')
1658 | value - String! Parameter value as a string
1659 | Example
1660 | {
1661 | "name": "xyz789",
1662 | "type": "abc123",
1663 | "value": "abc123"
1664 | }
1665 | Types
1666 | Delegate
1667 | Fields
1668 | Field Name Description
1669 | id - IntID!
1670 | account - Account!
1671 | chainId - ChainID
1672 | delegatorsCount - Int!
1673 | governor - Governor
1674 | organization - Organization
1675 | statement - DelegateStatement
1676 | token - Token
1677 | votesCount - Uint256!
1678 | Arguments
1679 | blockNumber - Int
1680 | Example
1681 | {
1682 | "id": 2207450143689540900,
1683 | "account": Account,
1684 | "chainId": "eip155:1",
1685 | "delegatorsCount": 123,
1686 | "governor": Governor,
1687 | "organization": Organization,
1688 | "statement": DelegateStatement,
1689 | "token": Token,
1690 | "votesCount": 10987654321
1691 | }
1692 | Types
1693 | DelegateInput
1694 | Fields
1695 | Input Field Description
1696 | address - Address!
1697 | governorId - AccountID
1698 | organizationId - IntID
1699 | Example
1700 | {
1701 | "address": "0x1234567800000000000000000000000000000abc",
1702 | "governorId": "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
1703 | "organizationId": 2207450143689540900
1704 | }
1705 | Types
1706 | DelegateStatement
1707 | Fields
1708 | Field Name Description
1709 | id - IntID!
1710 | address - Address!
1711 | organizationID - IntID!
1712 | statement - String!
1713 | statementSummary - String
1714 | isSeekingDelegation - Boolean
1715 | issues - [Issue!]
1716 | Example
1717 | {
1718 | "id": 2207450143689540900,
1719 | "address": "0x1234567800000000000000000000000000000abc",
1720 | "organizationID": 2207450143689540900,
1721 | "statement": "abc123",
1722 | "statementSummary": "xyz789",
1723 | "isSeekingDelegation": false,
1724 | "issues": [Issue]
1725 | }
1726 | Types
1727 | DelegatesFiltersInput
1728 | Fields
1729 | Input Field Description
1730 | address - Address address filter in combination with organizationId allows fetching delegate info of this address from each chain
1731 | governorId - AccountID
1732 | hasVotes - Boolean
1733 | hasDelegators - Boolean
1734 | issueIds - [IntID!]
1735 | isSeekingDelegation - Boolean
1736 | organizationId - IntID
1737 | Example
1738 | {
1739 | "address": "0x1234567800000000000000000000000000000abc",
1740 | "governorId": "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
1741 | "hasVotes": true,
1742 | "hasDelegators": false,
1743 | "issueIds": [2207450143689540900],
1744 | "isSeekingDelegation": false,
1745 | "organizationId": 2207450143689540900
1746 | }
1747 | Types
1748 | DelegatesInput
1749 | Fields
1750 | Input Field Description
1751 | filters - DelegatesFiltersInput!
1752 | page - PageInput
1753 | sort - DelegatesSortInput
1754 | Example
1755 | {
1756 | "filters": DelegatesFiltersInput,
1757 | "page": PageInput,
1758 | "sort": DelegatesSortInput
1759 | }
1760 | Types
1761 | DelegatesSortBy
1762 | Values
1763 | Enum Value Description
1764 | id
1765 |
1766 | The default sorting method. It sorts by date.
1767 | votes
1768 |
1769 | Sorts by voting power.
1770 | delegators
1771 |
1772 | Sorts by total delegators.
1773 | prioritized
1774 |
1775 | Sorts by DAO prioritization.
1776 | Example
1777 | "id"
1778 | Types
1779 | DelegatesSortInput
1780 | Fields
1781 | Input Field Description
1782 | isDescending - Boolean!
1783 | sortBy - DelegatesSortBy!
1784 | Example
1785 | {"isDescending": true, "sortBy": "id"}
1786 | Types
1787 | Delegation
1788 | Fields
1789 | Field Name Description
1790 | id - IntID!
1791 | blockNumber - Int!
1792 | blockTimestamp - Timestamp!
1793 | chainId - ChainID!
1794 | delegator - Account!
1795 | delegate - Account!
1796 | organization - Organization!
1797 | token - Token!
1798 | votes - Uint256!
1799 | Example
1800 | {
1801 | "id": 2207450143689540900,
1802 | "blockNumber": 987,
1803 | "blockTimestamp": 1663224162,
1804 | "chainId": "eip155:1",
1805 | "delegator": Account,
1806 | "delegate": Account,
1807 | "organization": Organization,
1808 | "token": Token,
1809 | "votes": 10987654321
1810 | }
1811 | Types
1812 | DelegationInput
1813 | Fields
1814 | Input Field Description
1815 | address - Address!
1816 | tokenId - AssetID!
1817 | Example
1818 | {
1819 | "address": "0x1234567800000000000000000000000000000abc",
1820 | "tokenId": "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f"
1821 | }
1822 | Types
1823 | DelegationsFiltersInput
1824 | Fields
1825 | Input Field Description
1826 | address - Address!
1827 | governorId - AccountID
1828 | organizationId - IntID
1829 | Example
1830 | {
1831 | "address": "0x1234567800000000000000000000000000000abc",
1832 | "governorId": "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
1833 | "organizationId": 2207450143689540900
1834 | }
1835 | Types
1836 | DelegationsInput
1837 | Fields
1838 | Input Field Description
1839 | filters - DelegationsFiltersInput!
1840 | page - PageInput
1841 | sort - DelegationsSortInput
1842 | Example
1843 | {
1844 | "filters": DelegationsFiltersInput,
1845 | "page": PageInput,
1846 | "sort": DelegationsSortInput
1847 | }
1848 | Types
1849 | DelegationsSortBy
1850 | Values
1851 | Enum Value Description
1852 | id
1853 |
1854 | The default sorting method. It sorts by date.
1855 | votes
1856 |
1857 | Sorts by voting power.
1858 | Example
1859 | "id"
1860 | Types
1861 | DelegationsSortInput
1862 | Fields
1863 | Input Field Description
1864 | isDescending - Boolean!
1865 | sortBy - DelegationsSortBy!
1866 | Example
1867 | {"isDescending": true, "sortBy": "id"}
1868 | Types
1869 | Eligibility
1870 | Fields
1871 | Field Name Description
1872 | status - EligibilityStatus! Whether the account is eligible to claim
1873 | proof - [String!]
1874 | amount - Uint256 Amount the account can claim from this token
1875 | tx - HashID
1876 | Example
1877 | {
1878 | "status": "NOTELIGIBLE",
1879 | "proof": ["abc123"],
1880 | "amount": 10987654321,
1881 | "tx": "eip155:1:0xcd31cf5dbd3281442d80ceaa529eba678d55be86b7a342f5ed9cc8e49dadc855"
1882 | }
1883 | Types
1884 | EligibilityStatus
1885 | Values
1886 | Enum Value Description
1887 | NOTELIGIBLE
1888 |
1889 | ELIGIBLE
1890 |
1891 | CLAIMED
1892 |
1893 | Example
1894 | "NOTELIGIBLE"
1895 | Types
1896 | EndorsementService
1897 | Fields
1898 | Field Name Description
1899 | id - IntID!
1900 | competencyFields - [CompetencyFieldDescriptor!]!
1901 | Example
1902 | {
1903 | "id": 2207450143689540900,
1904 | "competencyFields": [CompetencyFieldDescriptor]
1905 | }
1906 | Types
1907 | ExecutableCall
1908 | Fields
1909 | Field Name Description
1910 | calldata - Bytes!
1911 | chainId - ChainID!
1912 | index - Int!
1913 | signature - String Target contract's function signature.
1914 | target - Address!
1915 | type - ExecutableCallType
1916 | value - Uint256!
1917 | decodedCalldata - DecodedCalldata Decoded representation of the calldata
1918 | Example
1919 | {
1920 | "calldata": "0x4321abcd",
1921 | "chainId": "eip155:1",
1922 | "index": 123,
1923 | "signature": "abc123",
1924 | "target": "0x1234567800000000000000000000000000000abc",
1925 | "type": "custom",
1926 | "value": 10987654321,
1927 | "decodedCalldata": DecodedCalldata
1928 | }
1929 | Types
1930 | ExecutableCallType
1931 | Values
1932 | Enum Value Description
1933 | custom
1934 |
1935 | erc20transfer
1936 |
1937 | erc20transferarbitrum
1938 |
1939 | empty
1940 |
1941 | nativetransfer
1942 |
1943 | orcamanagepod
1944 |
1945 | other
1946 |
1947 | reward
1948 |
1949 | swap
1950 |
1951 | Example
1952 | "custom"
1953 | Types
1954 | Float
1955 | Description
1956 | The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.
1957 |
1958 | Example
1959 | 123.45
1960 | Types
1961 | Governor
1962 | Fields
1963 | Field Name Description
1964 | id - AccountID!
1965 | chainId - ChainID!
1966 | contracts - Contracts!
1967 | isIndexing - Boolean!
1968 | isBehind - Boolean!
1969 | isPrimary - Boolean!
1970 | kind - GovernorKind!
1971 | name - String! Tally name of the governor contract
1972 | organization - Organization!
1973 | proposalStats - ProposalStats!
1974 | parameters - GovernorParameters!
1975 | quorum - Uint256! The minumum amount of votes (total or for depending on type) that are currently required to pass a proposal.
1976 | slug - String! Tally slug used for this goverance: tally.xyz/gov/[slug]
1977 | timelockId - AccountID Chain scoped address of the timelock contract for this governor if it exists.
1978 | tokenId - AssetID!
1979 | token - Token!
1980 | type - GovernorType!
1981 | delegatesCount - Int!
1982 | delegatesVotesCount - Uint256!
1983 | tokenOwnersCount - Int!
1984 | metadata - GovernorMetadata
1985 | Example
1986 | {
1987 | "id": "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
1988 | "chainId": "eip155:1",
1989 | "contracts": Contracts,
1990 | "isIndexing": true,
1991 | "isBehind": false,
1992 | "isPrimary": true,
1993 | "kind": "single",
1994 | "name": "Uniswap",
1995 | "organization": Organization,
1996 | "proposalStats": ProposalStats,
1997 | "parameters": GovernorParameters,
1998 | "quorum": 10987654321,
1999 | "slug": "uniswap",
2000 | "timelockId": "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
2001 | "tokenId": "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f",
2002 | "token": Token,
2003 | "type": "governoralpha",
2004 | "delegatesCount": 123,
2005 | "delegatesVotesCount": 10987654321,
2006 | "tokenOwnersCount": 123,
2007 | "metadata": GovernorMetadata
2008 | }
2009 | Types
2010 | GovernorContract
2011 | Fields
2012 | Field Name Description
2013 | address - Address!
2014 | type - GovernorType!
2015 | Example
2016 | {
2017 | "address": "0x1234567800000000000000000000000000000abc",
2018 | "type": "governoralpha"
2019 | }
2020 | Types
2021 | GovernorInput
2022 | Fields
2023 | Input Field Description
2024 | id - AccountID
2025 | slug - String
2026 | Example
2027 | {
2028 | "id": "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
2029 | "slug": "abc123"
2030 | }
2031 | Types
2032 | GovernorKind
2033 | Values
2034 | Enum Value Description
2035 | single
2036 |
2037 | multiprimary
2038 |
2039 | multisecondary
2040 |
2041 | multiother
2042 |
2043 | hub
2044 |
2045 | spoke
2046 |
2047 | Example
2048 | "single"
2049 | Types
2050 | GovernorMetadata
2051 | Fields
2052 | Field Name Description
2053 | description - String
2054 | Example
2055 | {"description": "abc123"}
2056 | Types
2057 | GovernorParameters
2058 | Fields
2059 | Field Name Description
2060 | quorumVotes - Uint256
2061 | proposalThreshold - Uint256
2062 | votingDelay - Uint256
2063 | votingPeriod - Uint256
2064 | gracePeriod - Uint256
2065 | quorumNumerator - Uint256
2066 | quorumDenominator - Uint256
2067 | clockMode - String
2068 | nomineeVettingDuration - Uint256
2069 | fullWeightDuration - Uint256
2070 | Example
2071 | {
2072 | "quorumVotes": 10987654321,
2073 | "proposalThreshold": 10987654321,
2074 | "votingDelay": 10987654321,
2075 | "votingPeriod": 10987654321,
2076 | "gracePeriod": 10987654321,
2077 | "quorumNumerator": 10987654321,
2078 | "quorumDenominator": 10987654321,
2079 | "clockMode": "abc123",
2080 | "nomineeVettingDuration": 10987654321,
2081 | "fullWeightDuration": 10987654321
2082 | }
2083 | Types
2084 | GovernorType
2085 | Values
2086 | Enum Value Description
2087 | governoralpha
2088 |
2089 | governorbravo
2090 |
2091 | openzeppelingovernor
2092 |
2093 | aave
2094 |
2095 | nounsfork
2096 |
2097 | nomineeelection
2098 |
2099 | memberelection
2100 |
2101 | hub
2102 |
2103 | spoke
2104 |
2105 | Example
2106 | "governoralpha"
2107 | Types
2108 | GovernorsFiltersInput
2109 | Fields
2110 | Input Field Description
2111 | organizationId - IntID!
2112 | includeInactive - Boolean
2113 | excludeSecondary - Boolean
2114 | Example
2115 | {
2116 | "organizationId": 2207450143689540900,
2117 | "includeInactive": false,
2118 | "excludeSecondary": false
2119 | }
2120 | Types
2121 | GovernorsInput
2122 | Fields
2123 | Input Field Description
2124 | filters - GovernorsFiltersInput!
2125 | page - PageInput
2126 | sort - GovernorsSortInput
2127 | Example
2128 | {
2129 | "filters": GovernorsFiltersInput,
2130 | "page": PageInput,
2131 | "sort": GovernorsSortInput
2132 | }
2133 | Types
2134 | GovernorsSortBy
2135 | Values
2136 | Enum Value Description
2137 | id
2138 |
2139 | The default sorting method. It sorts by date.
2140 | Example
2141 | "id"
2142 | Types
2143 | GovernorsSortInput
2144 | Fields
2145 | Input Field Description
2146 | isDescending - Boolean!
2147 | sortBy - GovernorsSortBy!
2148 | Example
2149 | {"isDescending": true, "sortBy": "id"}
2150 | Types
2151 | Hash
2152 | Description
2153 | Hash is for identifying transactions on a chain. Ex: 0xDEAD.
2154 |
2155 | Example
2156 | "0xcd31cf5dbd3281442d80ceaa529eba678d55be86b7a342f5ed9cc8e49dadc855"
2157 | Types
2158 | HashID
2159 | Description
2160 | HashID is a ChainID scoped identifier for identifying transactions across chains. Ex: eip155:1:0xDEAD.
2161 |
2162 | Example
2163 | "eip155:1:0xcd31cf5dbd3281442d80ceaa529eba678d55be86b7a342f5ed9cc8e49dadc855"
2164 | Types
2165 | ID
2166 | Description
2167 | The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.
2168 |
2169 | Example
2170 | 4
2171 | Types
2172 | Int
2173 | Description
2174 | The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
2175 |
2176 | Example
2177 | 987
2178 | Types
2179 | IntID
2180 | Description
2181 | IntID is a 64bit integer as a string - this is larger than Javascript's number.
2182 |
2183 | Example
2184 | 2207450143689540900
2185 | Types
2186 | Issue
2187 | Fields
2188 | Field Name Description
2189 | id - IntID!
2190 | organizationId - IntID
2191 | name - String
2192 | description - String
2193 | Example
2194 | {
2195 | "id": 2207450143689540900,
2196 | "organizationId": 2207450143689540900,
2197 | "name": "abc123",
2198 | "description": "xyz789"
2199 | }
2200 | Types
2201 | Member
2202 | Fields
2203 | Field Name Description
2204 | id - ID!
2205 | account - Account!
2206 | organization - Organization!
2207 | Example
2208 | {
2209 | "id": 4,
2210 | "account": Account,
2211 | "organization": Organization
2212 | }
2213 | Types
2214 | NativeCurrency
2215 | Fields
2216 | Field Name Description
2217 | name - String! Name of the Currency. e.g.: Ether
2218 | symbol - String! Symbol of the Currency. e.g.: ETH
2219 | decimals - Int! Decimals of the Currency. e.g.: 18
2220 | Example
2221 | {
2222 | "name": "abc123",
2223 | "symbol": "xyz789",
2224 | "decimals": 123
2225 | }
2226 | Types
2227 | Node
2228 | Description
2229 | Union of all node types that are paginated.
2230 |
2231 | Types
2232 | Union Types
2233 | Delegate
2234 |
2235 | Organization
2236 |
2237 | Member
2238 |
2239 | Delegation
2240 |
2241 | Governor
2242 |
2243 | Proposal
2244 |
2245 | Vote
2246 |
2247 | StakeEvent
2248 |
2249 | StakeEarning
2250 |
2251 | Contributor
2252 |
2253 | Allocation
2254 |
2255 | Example
2256 | Delegate
2257 | Types
2258 | Organization
2259 | Fields
2260 | Field Name Description
2261 | id - IntID!
2262 | slug - String!
2263 | name - String!
2264 | chainIds - [ChainID!]!
2265 | tokenIds - [AssetID!]!
2266 | governorIds - [AccountID!]!
2267 | metadata - OrganizationMetadata
2268 | creator - Account
2269 | hasActiveProposals - Boolean!
2270 | proposalsCount - Int!
2271 | delegatesCount - Int!
2272 | delegatesVotesCount - Uint256!
2273 | tokenOwnersCount - Int!
2274 | endorsementService - EndorsementService
2275 | Example
2276 | {
2277 | "id": 2207450143689540900,
2278 | "slug": "xyz789",
2279 | "name": "abc123",
2280 | "chainIds": ["eip155:1"],
2281 | "tokenIds": [
2282 | "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f"
2283 | ],
2284 | "governorIds": [
2285 | "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc"
2286 | ],
2287 | "metadata": OrganizationMetadata,
2288 | "creator": Account,
2289 | "hasActiveProposals": true,
2290 | "proposalsCount": 987,
2291 | "delegatesCount": 123,
2292 | "delegatesVotesCount": 10987654321,
2293 | "tokenOwnersCount": 987,
2294 | "endorsementService": EndorsementService
2295 | }
2296 | Types
2297 | OrganizationInput
2298 | Fields
2299 | Input Field Description
2300 | id - IntID
2301 | slug - String
2302 | Example
2303 | {
2304 | "id": 2207450143689540900,
2305 | "slug": "abc123"
2306 | }
2307 | Types
2308 | OrganizationMetadata
2309 | Fields
2310 | Field Name Description
2311 | color - String
2312 | description - String
2313 | icon - String
2314 | Example
2315 | {
2316 | "color": "abc123",
2317 | "description": "abc123",
2318 | "icon": "abc123"
2319 | }
2320 | Types
2321 | OrganizationsFiltersInput
2322 | Fields
2323 | Input Field Description
2324 | address - Address
2325 | chainId - ChainID
2326 | hasLogo - Boolean
2327 | isMember - Boolean Indicates whether the user holds any of the governance tokens associated with the organization.
2328 | Example
2329 | {
2330 | "address": "0x1234567800000000000000000000000000000abc",
2331 | "chainId": "eip155:1",
2332 | "hasLogo": true,
2333 | "isMember": true
2334 | }
2335 | Types
2336 | OrganizationsInput
2337 | Fields
2338 | Input Field Description
2339 | filters - OrganizationsFiltersInput
2340 | page - PageInput
2341 | sort - OrganizationsSortInput
2342 | Example
2343 | {
2344 | "filters": OrganizationsFiltersInput,
2345 | "page": PageInput,
2346 | "sort": OrganizationsSortInput
2347 | }
2348 | Types
2349 | OrganizationsSortBy
2350 | Values
2351 | Enum Value Description
2352 | id
2353 |
2354 | The default sorting method. It sorts by date.
2355 | name
2356 |
2357 | explore
2358 |
2359 | Sorts by live proposals and voters as on the Tally explore page.
2360 | popular
2361 |
2362 | Same as explore but does not prioritize live proposals.
2363 | Example
2364 | "id"
2365 | Types
2366 | OrganizationsSortInput
2367 | Fields
2368 | Input Field Description
2369 | isDescending - Boolean!
2370 | sortBy - OrganizationsSortBy!
2371 | Example
2372 | {"isDescending": true, "sortBy": "id"}
2373 | Types
2374 | PageInfo
2375 | Description
2376 | Page metadata including pagination cursors and total count
2377 |
2378 | Fields
2379 | Field Name Description
2380 | firstCursor - String Cursor of the first item in the page
2381 | lastCursor - String Cursor of the last item in the page
2382 | count - Int Total number of items across all pages. FYI, this is not yet implemented so the value will always be 0
2383 | Example
2384 | {
2385 | "firstCursor": "xyz789",
2386 | "lastCursor": "xyz789",
2387 | "count": 123
2388 | }
2389 | Types
2390 | PageInput
2391 | Description
2392 | Input to specify cursor based pagination parameters. Depending on which page is being fetched, between afterCursor & beforeCursor, only one's value needs to be provided
2393 |
2394 | Fields
2395 | Input Field Description
2396 | afterCursor - String Cursor to start pagination after to fetch the next page
2397 | beforeCursor - String Cursor to start pagination before to fetch the previous page
2398 | limit - Int Maximum number of items per page 20 is the hard limit set on the backend
2399 | Example
2400 | {
2401 | "afterCursor": "abc123",
2402 | "beforeCursor": "abc123",
2403 | "limit": 123
2404 | }
2405 | Types
2406 | PaginatedOutput
2407 | Description
2408 | Wraps a list of nodes and the pagination info
2409 |
2410 | Fields
2411 | Field Name Description
2412 | nodes - [Node!]! List of nodes for the page
2413 | pageInfo - PageInfo! Pagination information
2414 | Example
2415 | {
2416 | "nodes": [Delegate],
2417 | "pageInfo": PageInfo
2418 | }
2419 | Types
2420 | Parameter
2421 | Fields
2422 | Field Name Description
2423 | name - String!
2424 | type - String!
2425 | value - Any!
2426 | valueDecoded - [ValueDecoded!]
2427 | Example
2428 | {
2429 | "name": "xyz789",
2430 | "type": "xyz789",
2431 | "value": Any,
2432 | "valueDecoded": [ValueDecoded]
2433 | }
2434 | Types
2435 | Proposal
2436 | Fields
2437 | Field Name Description
2438 | id - IntID! Tally ID
2439 | onchainId - String ID onchain
2440 | block - Block
2441 | chainId - ChainID!
2442 | creator - Account Account that submitted this proposal onchain
2443 | end - BlockOrTimestamp! Last block or timestamp when you can cast a vote
2444 | events - [ProposalEvent!]! List of state transitions for this proposal. The last ProposalEvent is the current state.
2445 | executableCalls - [ExecutableCall!]
2446 | governor - Governor!
2447 | metadata - ProposalMetadata!
2448 | organization - Organization!
2449 | proposer - Account Account that created this proposal offchain
2450 | quorum - Uint256
2451 | status - ProposalStatus!
2452 | start - BlockOrTimestamp! First block when you can cast a vote, also the time when quorum is established
2453 | voteStats - [VoteStats!]
2454 | Example
2455 | {
2456 | "id": 2207450143689540900,
2457 | "onchainId": "abc123",
2458 | "block": Block,
2459 | "chainId": "eip155:1",
2460 | "creator": Account,
2461 | "end": Block,
2462 | "events": [ProposalEvent],
2463 | "executableCalls": [ExecutableCall],
2464 | "governor": Governor,
2465 | "metadata": ProposalMetadata,
2466 | "organization": Organization,
2467 | "proposer": Account,
2468 | "quorum": 10987654321,
2469 | "status": "active",
2470 | "start": Block,
2471 | "voteStats": [VoteStats]
2472 | }
2473 | Types
2474 | ProposalEvent
2475 | Fields
2476 | Field Name Description
2477 | block - Block
2478 | chainId - ChainID!
2479 | createdAt - Timestamp!
2480 | type - ProposalEventType!
2481 | txHash - Hash
2482 | Example
2483 | {
2484 | "block": Block,
2485 | "chainId": "eip155:1",
2486 | "createdAt": 1663224162,
2487 | "type": "activated",
2488 | "txHash": "0xcd31cf5dbd3281442d80ceaa529eba678d55be86b7a342f5ed9cc8e49dadc855"
2489 | }
2490 | Types
2491 | ProposalEventType
2492 | Values
2493 | Enum Value Description
2494 | activated
2495 |
2496 | canceled
2497 |
2498 | created
2499 |
2500 | defeated
2501 |
2502 | drafted
2503 |
2504 | executed
2505 |
2506 | expired
2507 |
2508 | extended
2509 |
2510 | pendingexecution
2511 |
2512 | queued
2513 |
2514 | succeeded
2515 |
2516 | callexecuted
2517 |
2518 | crosschainexecuted
2519 |
2520 | Example
2521 | "activated"
2522 | Types
2523 | ProposalInput
2524 | Fields
2525 | Input Field Description
2526 | id - IntID
2527 | onchainId - String this is not unique across governors; so must be used in combination with governorId
2528 | governorId - AccountID
2529 | includeArchived - Boolean
2530 | isLatest - Boolean
2531 | Example
2532 | {
2533 | "id": 2207450143689540900,
2534 | "onchainId": "xyz789",
2535 | "governorId": "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
2536 | "includeArchived": true,
2537 | "isLatest": true
2538 | }
2539 | Types
2540 | ProposalMetadata
2541 | Fields
2542 | Field Name Description
2543 | title - String! Proposal title: usually first line of description
2544 | description - String! Proposal description onchain
2545 | eta - Int Time at which a proposal can be executed
2546 | ipfsHash - String
2547 | previousEnd - Int
2548 | timelockId - AccountID
2549 | txHash - Hash
2550 | discourseURL - String
2551 | snapshotURL - String
2552 | Example
2553 | {
2554 | "title": "Fund the Grants Program",
2555 | "description": "Here's why it's a good idea to fund the Grants Program",
2556 | "eta": 1675437793,
2557 | "ipfsHash": "xyz789",
2558 | "previousEnd": 123,
2559 | "timelockId": "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
2560 | "txHash": "0xcd31cf5dbd3281442d80ceaa529eba678d55be86b7a342f5ed9cc8e49dadc855",
2561 | "discourseURL": "xyz789",
2562 | "snapshotURL": "abc123"
2563 | }
2564 | Types
2565 | ProposalStats
2566 | Fields
2567 | Field Name Description
2568 | total - Int! Total count of proposals
2569 | active - Int! Total count of active proposals
2570 | failed - Int! Total count of failed proposals including quorum not reached
2571 | passed - Int! Total count of passed proposals
2572 | Example
2573 | {"total": 123, "active": 987, "failed": 123, "passed": 987}
2574 | Types
2575 | ProposalStatus
2576 | Values
2577 | Enum Value Description
2578 | active
2579 |
2580 | archived
2581 |
2582 | canceled
2583 |
2584 | callexecuted
2585 |
2586 | defeated
2587 |
2588 | draft
2589 |
2590 | executed
2591 |
2592 | expired
2593 |
2594 | extended
2595 |
2596 | pending
2597 |
2598 | queued
2599 |
2600 | pendingexecution
2601 |
2602 | submitted
2603 |
2604 | succeeded
2605 |
2606 | crosschainexecuted
2607 |
2608 | Example
2609 | "active"
2610 | Types
2611 | ProposalsCreatedCountInput
2612 | Fields
2613 | Input Field Description
2614 | governorId - AccountID
2615 | organizationId - IntID
2616 | Example
2617 | {
2618 | "governorId": "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
2619 | "organizationId": 2207450143689540900
2620 | }
2621 | Types
2622 | ProposalsFiltersInput
2623 | Fields
2624 | Input Field Description
2625 | governorId - AccountID
2626 | includeArchived - Boolean Only drafts can be archived; so, this works ONLY with isDraft: true
2627 | isDraft - Boolean
2628 | organizationId - IntID
2629 | proposer - Address Address that created the proposal offchain; in other words, created the draft
2630 | Example
2631 | {
2632 | "governorId": "eip155:1:0x7e90e03654732abedf89Faf87f05BcD03ACEeFdc",
2633 | "includeArchived": false,
2634 | "isDraft": true,
2635 | "organizationId": 2207450143689540900,
2636 | "proposer": "0x1234567800000000000000000000000000000abc"
2637 | }
2638 | Types
2639 | ProposalsInput
2640 | Fields
2641 | Input Field Description
2642 | filters - ProposalsFiltersInput!
2643 | page - PageInput
2644 | sort - ProposalsSortInput
2645 | Example
2646 | {
2647 | "filters": ProposalsFiltersInput,
2648 | "page": PageInput,
2649 | "sort": ProposalsSortInput
2650 | }
2651 | Types
2652 | ProposalsSortBy
2653 | Values
2654 | Enum Value Description
2655 | id
2656 |
2657 | The default sorting method. It sorts by date.
2658 | Example
2659 | "id"
2660 | Types
2661 | ProposalsSortInput
2662 | Fields
2663 | Input Field Description
2664 | isDescending - Boolean!
2665 | sortBy - ProposalsSortBy!
2666 | Example
2667 | {"isDescending": true, "sortBy": "id"}
2668 | Types
2669 | Role
2670 | Values
2671 | Enum Value Description
2672 | ADMIN
2673 |
2674 | USER
2675 |
2676 | Example
2677 | "ADMIN"
2678 | Types
2679 | StakeEarning
2680 | Fields
2681 | Field Name Description
2682 | amount - Uint256!
2683 | date - Date!
2684 | Example
2685 | {
2686 | "amount": 10987654321,
2687 | "date": "2022-09-22"
2688 | }
2689 | Types
2690 | StakeEvent
2691 | Fields
2692 | Field Name Description
2693 | amount - Uint256!
2694 | block - Block!
2695 | type - StakeEventType!
2696 | Example
2697 | {"amount": 10987654321, "block": Block, "type": "deposit"}
2698 | Types
2699 | StakeEventType
2700 | Values
2701 | Enum Value Description
2702 | deposit
2703 |
2704 | withdraw
2705 |
2706 | Example
2707 | "deposit"
2708 | Types
2709 | String
2710 | Description
2711 | The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
2712 |
2713 | Example
2714 | "abc123"
2715 | Types
2716 | Timestamp
2717 | Description
2718 | Timestamp is a RFC3339 string.
2719 |
2720 | Example
2721 | 1663224162
2722 | Types
2723 | Token
2724 | Description
2725 | Core type that describes an onchain Token contract
2726 |
2727 | Fields
2728 | Field Name Description
2729 | id - AssetID!
2730 | type - TokenType! Token contract type
2731 | name - String! Onchain name
2732 | symbol - String! Onchain symbol
2733 | supply - Uint256! supply derived from Transfer events
2734 | decimals - Int! Number of decimal places included in Uint256 values
2735 | eligibility - Eligibility! Eligibility of an account to claim this token
2736 | Arguments
2737 | id - AccountID!
2738 | isIndexing - Boolean!
2739 | isBehind - Boolean!
2740 | Example
2741 | {
2742 | "id": "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f",
2743 | "type": "ERC20",
2744 | "name": "xyz789",
2745 | "symbol": "xyz789",
2746 | "supply": 10987654321,
2747 | "decimals": 987,
2748 | "eligibility": Eligibility,
2749 | "isIndexing": false,
2750 | "isBehind": true
2751 | }
2752 | Types
2753 | TokenContract
2754 | Fields
2755 | Field Name Description
2756 | address - Address!
2757 | type - TokenType!
2758 | Example
2759 | {
2760 | "address": "0x1234567800000000000000000000000000000abc",
2761 | "type": "ERC20"
2762 | }
2763 | Types
2764 | TokenInput
2765 | Fields
2766 | Input Field Description
2767 | id - AssetID!
2768 | Example
2769 | {
2770 | "id": "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f"
2771 | }
2772 | Types
2773 | TokenType
2774 | Values
2775 | Enum Value Description
2776 | ERC20
2777 |
2778 | ERC721
2779 |
2780 | ERC20AAVE
2781 |
2782 | SOLANASPOKETOKEN
2783 |
2784 | Example
2785 | "ERC20"
2786 | Types
2787 | Uint256
2788 | Description
2789 | Uint256 is a large unsigned integer represented as a string.
2790 |
2791 | Example
2792 | 10987654321
2793 | Types
2794 | UserBio
2795 | Fields
2796 | Field Name Description
2797 | value - String!
2798 | summary - String!
2799 | Example
2800 | {
2801 | "value": "abc123",
2802 | "summary": "xyz789"
2803 | }
2804 | Types
2805 | ValueDecoded
2806 | Fields
2807 | Field Name Description
2808 | operation - Int!
2809 | to - String!
2810 | value - String!
2811 | data - String!
2812 | dataDecoded - DataDecoded
2813 | Example
2814 | {
2815 | "operation": 987,
2816 | "to": "xyz789",
2817 | "value": "abc123",
2818 | "data": "xyz789",
2819 | "dataDecoded": DataDecoded
2820 | }
2821 | Types
2822 | Vote
2823 | Fields
2824 | Field Name Description
2825 | id - IntID!
2826 | amount - Uint256!
2827 | block - Block!
2828 | chainId - ChainID!
2829 | isBridged - Boolean
2830 | proposal - Proposal!
2831 | reason - String
2832 | type - VoteType!
2833 | txHash - Hash!
2834 | voter - Account!
2835 | Example
2836 | {
2837 | "id": 2207450143689540900,
2838 | "amount": 10987654321,
2839 | "block": Block,
2840 | "chainId": "eip155:1",
2841 | "isBridged": true,
2842 | "proposal": Proposal,
2843 | "reason": "abc123",
2844 | "type": "abstain",
2845 | "txHash": "0xcd31cf5dbd3281442d80ceaa529eba678d55be86b7a342f5ed9cc8e49dadc855",
2846 | "voter": Account
2847 | }
2848 | Types
2849 | VoteStats
2850 | Description
2851 | Voting Summary per Choice
2852 |
2853 | Fields
2854 | Field Name Description
2855 | type - VoteType!
2856 | votesCount - Uint256! Total votes casted for this Choice/VoteType
2857 | votersCount - Int! Total number of distinct voters for this Choice/VoteType
2858 | percent - Float! Percent of votes casted for this Choice/`Votetype'
2859 | Example
2860 | {
2861 | "type": "abstain",
2862 | "votesCount": 10987654321,
2863 | "votersCount": 123,
2864 | "percent": 987.65
2865 | }
2866 | Types
2867 | VoteType
2868 | Values
2869 | Enum Value Description
2870 | abstain
2871 |
2872 | against
2873 |
2874 | for
2875 |
2876 | pendingabstain
2877 |
2878 | pendingagainst
2879 |
2880 | pendingfor
2881 |
2882 | Example
2883 | "abstain"
2884 | Types
2885 | VotesFiltersInput
2886 | Fields
2887 | Input Field Description
2888 | proposalId - IntID
2889 | proposalIds - [IntID!]
2890 | voter - Address
2891 | includePendingVotes - Boolean
2892 | type - VoteType
2893 | Example
2894 | {
2895 | "proposalId": 2207450143689540900,
2896 | "proposalIds": [2207450143689540900],
2897 | "voter": "0x1234567800000000000000000000000000000abc",
2898 | "includePendingVotes": true,
2899 | "type": "abstain"
2900 | }
2901 | Types
2902 | VotesInput
2903 | Fields
2904 | Input Field Description
2905 | filters - VotesFiltersInput!
2906 | page - PageInput
2907 | sort - VotesSortInput
2908 | Example
2909 | {
2910 | "filters": VotesFiltersInput,
2911 | "page": PageInput,
2912 | "sort": VotesSortInput
2913 | }
2914 | Types
2915 | VotesSortBy
2916 | Values
2917 | Enum Value Description
2918 | id
2919 |
2920 | The default sorting method. It sorts by date.
2921 | amount
2922 |
2923 | Example
2924 | "id"
2925 | Types
2926 | VotesSortInput
2927 | Fields
2928 | Input Field Description
2929 | isDescending - Boolean!
2930 | sortBy - VotesSortBy!
2931 | Example
2932 | {"isDescending": true, "sortBy": "id"}
2933 | Documentation by Anvil SpectaQL
```