diff --git a/packages/js-client/package.json b/packages/js-client/package.json index 3755573f..c8ba211e 100644 --- a/packages/js-client/package.json +++ b/packages/js-client/package.json @@ -71,7 +71,7 @@ "@ethersproject/wallet": "^5.7.0", "graphql": "^16.6.0", "graphql-request": "4.3.0", - "@vocdoni/gasless-voting-ethers": "./vocdoni-gasless-voting-ethers-v0.0.1-rc4.tgz", + "@vocdoni/gasless-voting-ethers": "./vocdoni-gasless-voting-ethers-v0.0.1-rc6.tgz", "@vocdoni/sdk": "0.3.1", "axios": "0.27.2", "@types/big.js": "^6.1.5" diff --git a/packages/js-client/src/internal/graphql-queries/example.ts b/packages/js-client/src/internal/graphql-queries/example.ts deleted file mode 100644 index 39573c0e..00000000 --- a/packages/js-client/src/internal/graphql-queries/example.ts +++ /dev/null @@ -1,11 +0,0 @@ -// import { gql } from 'graphql-request'; - -// export const QueryExample = gql` -// query Example($proposalId: ID!) { -// dao(id: $proposalId) { -// Example { -// value -// } -// } -// } -// `; diff --git a/packages/js-client/src/internal/graphql-queries/proposal.ts b/packages/js-client/src/internal/graphql-queries/proposal.ts index b3128901..6ce085fc 100644 --- a/packages/js-client/src/internal/graphql-queries/proposal.ts +++ b/packages/js-client/src/internal/graphql-queries/proposal.ts @@ -1,77 +1,54 @@ import { gql } from 'graphql-request'; -export const QueryTokenVotingProposal = gql` - query TokenVotingProposal($proposalId: ID!) { - tokenVotingProposal(id: $proposalId) { +export const QueryPluginProposal = gql` + query PluginProposal($proposalId: ID!) { + pluginProposals(id: $proposalId) { id dao { id - subdomain } - creator metadata - createdAt - creationBlockNumber - executionDate - executionBlockNumber actions { - to + id value data } - yes - no - abstain - votingMode - supportThreshold + allowFailureMap + failureMap + pluginProposalId + vochainProposalId + creator startDate + createdAt voteEndDate + tallyEndDate + creationBlockNumber + snapshotBlock executed - earlyExecutable - potentiallyExecutable + executionDate + executionBlockNumber executionTxHash - voters { - voter { - address - } - voteReplaced - voteOption - votingPower + approvers { + id } - plugin { - token { - id - name - symbol - __typename - ... on ERC20Contract { - decimals - } - ... on ERC20WrapperContract { - decimals - underlyingToken { - id - name - symbol - decimals - } - } - } + tally { + id + values } - totalVotingPower - minVotingPower + tallyApproved } } `; -export const QueryTokenVotingProposals = gql` - query TokenVotingProposals( - $where: TokenVotingProposal_filter! + +export const QueryPluginProposals = gql` + query QueryPluginProposals( + $where: PluginProposal_filter! $limit: Int! $skip: Int! $direction: OrderDirection! - $sortBy: TokenVotingProposal_orderBy! + $sortBy: TPluginProposal_orderBy! ) { - tokenVotingProposals( + pluginProposals( where: $where first: $limit skip: $skip @@ -81,50 +58,36 @@ export const QueryTokenVotingProposals = gql` id dao { id - subdomain } - creator metadata - yes - no - abstain + actions { + id + value + data + } + allowFailureMap + failureMap + pluginProposalId + vochainProposalId + creator startDate + createdAt voteEndDate + tallyEndDate + creationBlockNumber + snapshotBlock executed - earlyExecutable - potentiallyExecutable - votingMode - supportThreshold - minVotingPower - totalVotingPower - voters { - voter { - address - } - voteReplaced - voteOption - votingPower + executionDate + executionBlockNumber + executionTxHash + approvers { + id } - plugin { - token { - id - name - symbol - __typename - ... on ERC20Contract { - decimals - } - ... on ERC20WrapperContract { - decimals - underlyingToken { - id - name - symbol - decimals - } - } - } + tally { + id + values } + tallyApproved } } `; diff --git a/packages/subgraph/src/plugin/plugin.ts b/packages/subgraph/src/plugin/plugin.ts index b2f0bcc3..b9dc46d0 100644 --- a/packages/subgraph/src/plugin/plugin.ts +++ b/packages/subgraph/src/plugin/plugin.ts @@ -131,7 +131,7 @@ export function handleProposalExecuted(event: ProposalExecuted): void { } } -export function handleCommitteeMembersAdded( +export function handleExecutionMultisigMembersAdded( event: ExecutionMultisigMembersAdded ): void { const pluginAddress = event.address; @@ -157,7 +157,7 @@ export function handleCommitteeMembersAdded( } } -export function handleCommitteeMembersRemoved( +export function handleExecutionMultisigMembersRemoved( event: ExecutionMultisigMembersRemoved ): void { const pluginAddress = event.address; diff --git a/packages/subgraph/utils/constants.ts b/packages/subgraph/utils/constants.ts index d6de3d32..ccf5f804 100644 --- a/packages/subgraph/utils/constants.ts +++ b/packages/subgraph/utils/constants.ts @@ -1,4 +1,4 @@ export const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'; export const PLUGIN_INTERFACE = '0x11223344'; -export const PLUGIN_REPO_ADDRESS = '0x2a5cc5974d3ab30d4b0a6e6a605e06956c975171'; // make sure address are lowercased +export const PLUGIN_REPO_ADDRESS = '0x74057f3f3809a874f28e3ebe80a1f1a5a137b64e'; // make sure address are lowercased diff --git a/yarn.lock b/yarn.lock index 2f0d723e..39a557dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -24,6 +24,13 @@ dependencies: ethers "^5.6.2" +"@aragon/osx-ethers@1.3.0-rc0.4", "@aragon/osx-ethers@^1.3.0-rc0.4": + version "1.3.0-rc0.4" + resolved "https://registry.yarnpkg.com/@aragon/osx-ethers/-/osx-ethers-1.3.0-rc0.4.tgz#878af071e454ef068801104deae8439f0f8f1720" + integrity sha512-FDuF6LC1OLnjFK4C8+P4Wf0sORrrUQ/JtUAxL5ABVtBD8JpyyhtdWGDiv/yWIooLyC2l8aqbDLPuiYWhw1DjEQ== + dependencies: + ethers "^5.6.2" + "@aragon/osx@^1.3.0-rc0.3": version "1.3.0-rc0.3" resolved "https://registry.yarnpkg.com/@aragon/osx/-/osx-1.3.0-rc0.3.tgz#d35ff40ccbb1b7e24f0c74ecb31953e14d79be73" @@ -33,12 +40,12 @@ "@openzeppelin/contracts" "4.8.1" "@openzeppelin/contracts-upgradeable" "4.8.1" -"@aragon/sdk-client-common@^1.7.0", "@aragon/sdk-client-common@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@aragon/sdk-client-common/-/sdk-client-common-1.8.0.tgz#07dd809bf7b6d04c470b828d4a8d261fed8af55f" - integrity sha512-R23KZx5T0o9uhgzFza1Npg4NsD6TtmID1QT+eg6jKPfk25aX2nq6MaVL92fOpIYO3c0drEM80+8Te/RDPi/fRg== +"@aragon/sdk-client-common@^1.11.0", "@aragon/sdk-client-common@^1.9.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@aragon/sdk-client-common/-/sdk-client-common-1.11.0.tgz#37d4f4ab4012fd65e06e40c3f41b9c3163328dcf" + integrity sha512-zn3BP5vnW7NHgc0fDEbAkVzuiOk+hzSh9oCwOcHY9tLGdGR+g+D0Jzpwqu9McBBur6TpzcW3xdNgMMGTqr21ZA== dependencies: - "@aragon/osx-ethers" "^1.3.0-rc0.3" + "@aragon/osx-ethers" "^1.3.0-rc0.4" "@aragon/osx-ethers-v1.0.0" "npm:@aragon/osx-ethers@1.2.1" "@aragon/sdk-ipfs" "^1.1.0" "@ethersproject/abstract-signer" "^5.5.0" @@ -51,13 +58,13 @@ graphql-request "^4.3.0" yup "^1.2.0" -"@aragon/sdk-client@^1.14.0": - version "1.17.0" - resolved "https://registry.yarnpkg.com/@aragon/sdk-client/-/sdk-client-1.17.0.tgz#c794d3f6b85170157ec7d0efa9b1ba594d5303be" - integrity sha512-bk1MnbGGskZ62Dl6FdWmDALKWcUOFVEJBR/yk1rNXnbON5z3p/Cb60ODDcL3Vt0Ve+XYMpc4JR9jjkRKMJLvmA== +"@aragon/sdk-client@^1.17.1": + version "1.19.0" + resolved "https://registry.yarnpkg.com/@aragon/sdk-client/-/sdk-client-1.19.0.tgz#13f8e95c72aff84c4ff3520220dd8948cd9a3bd4" + integrity sha512-JXxLlkEnTA+ycGl4yTus4y8OvxJXQxoX9k2tfG9pIcVFxgeLAojCAGabDo88S+6AX5rDc0jEF9b3NQbjWo1lnA== dependencies: - "@aragon/osx-ethers" "1.3.0-rc0.3" - "@aragon/sdk-client-common" "^1.8.0" + "@aragon/osx-ethers" "1.3.0-rc0.4" + "@aragon/sdk-client-common" "^1.11.0" "@aragon/sdk-ipfs" "^1.1.0" "@ethersproject/abstract-signer" "^5.5.0" "@ethersproject/bignumber" "^5.6.0" @@ -71,11 +78,6 @@ graphql-request "^4.3.0" yup "^1.2.0" -"@aragon/sdk-common@^1.7.0": - version "1.7.0" - resolved "https://registry.yarnpkg.com/@aragon/sdk-common/-/sdk-common-1.7.0.tgz#7e71617aec584ff241ff4c7a0d0e73303f169539" - integrity sha512-Op5c52Qn6MdNdPu+ZJDj9ai1Leur+VpVebaGE3HaZMPYE34IPXblmM10YU05H9Znf5g6jvIDLRB8xQmUOTFscw== - "@aragon/sdk-ipfs@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@aragon/sdk-ipfs/-/sdk-ipfs-1.1.0.tgz#178ee5ce840ce40b44ba0345dd5068e1b5608f9d" @@ -3506,9 +3508,9 @@ "@typescript-eslint/types" "5.60.0" eslint-visitor-keys "^3.3.0" -"@vocdoni/gasless-voting-ethers@./vocdoni-gasless-voting-ethers-v0.0.1-rc1.tgz": - version "0.0.1-rc1" - resolved "./vocdoni-gasless-voting-ethers-v0.0.1-rc1.tgz#1894038992f64a79cafa67c12baae96b4203facd" +"@vocdoni/gasless-voting-ethers@./vocdoni-gasless-voting-ethers-v0.0.1-rc6.tgz": + version "0.0.1-rc6" + resolved "./vocdoni-gasless-voting-ethers-v0.0.1-rc6.tgz#90a40413564cbd89f89dd41b76e6745bf59fd84a" dependencies: ethers "^5.6.2"