UNPKG

eas-poll-action-module

Version:

A helper library for creating and voting on polls with the EasPollActionModule Open Action.

16 lines (15 loc) 2.08 kB
export declare const EAS_VOTE_SCHEMA = "uint256 publicationProfileId,uint256 publicationId,uint256 actorProfileId,address actorProfileOwner,address transactionExecutor,uint8 optionIndex,uint40 timestamp"; export declare const EAS_VOTE_ABI: { type: string; name: string; }[]; export declare const EAS_POLL_ACTION_MODULE_ADDRESS = "0xc91C3d3eD7089a9b52945c8967CF0854f08E9e7a"; export declare const EAS_ADDRESS = "0x5E634ef5355f45A855d02D66eCD687b1502AF790"; export declare const EAS_VOTE_SCHEMA_UID = "0x5e67b8b854d74789f6fa56f202907f85e3e53b87abe3d218c9f6dee1cc60ecbd"; export declare const EAS_GRAPHQL_ENDPOINT = "https://polygon.easscan.org/graphql"; export declare const EAS_ADDRESS_TESTNET = "0xaEF4103A04090071165F78D45D83A0C0782c2B2a"; export declare const EAS_VOTE_SCHEMA_UID_TESTNET = "0x44c235a2465c4d70bd980bdcf968d1997b237e2c7d30a2de1b59b98fee4a1f37"; export declare const EAS_GRAPHQL_ENDPOINT_TESTNET = "https://polygon-mumbai.easscan.org/graphql"; export declare const GET_VOTE_COUNT_QUERY = "\n query GetVoteCount($schemaId: String!, $pollId: String!) {\n groupByAttestation(\n where: { schemaId: { equals: $schemaId }, data: { startsWith: $pollId }, revoked: { equals: false } }\n by: [schemaId]\n orderBy: [{ _count: { schemaId: asc } }]\n ) {\n _count {\n _all\n }\n }\n }\n"; export declare const GET_VOTE_COUNT_FOR_OPTION_QUERY = "\n query GetVoteCountForOptionIndex($schemaId: String!, $pollId: String!, $optionIndex: String!) {\n groupByAttestation(\n where: {\n schemaId: { equals: $schemaId }\n decodedDataJson: { contains: $optionIndex }\n data: { startsWith: $pollId }\n revoked: { equals: false }\n }\n by: [schemaId]\n ) {\n _count {\n _all\n }\n }\n }\n"; export declare const GET_VOTE_FOR_ACTOR_QUERY = "\n query GetVote($schemaId: String!, $data: String!) {\n attestations(\n where: {schemaId: {equals: $schemaId}, data: {startsWith: $data}}\n ) {\n attester\n id\n revoked\n data\n }\n }\n";