Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Operators and Nominator Roles Verification #577

Closed
wants to merge 8 commits into from
Closed
7 changes: 4 additions & 3 deletions explorer/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ DISCORD_BOT_TOKEN="<discord-bot-token>"

# Subspace Discord Server Role ID's
DISCORD_GUILD_ROLE_ID_FARMER="<discord-farmer-role-id>"
DISCORD_GUILD_ROLE_ID_OPERATOR="<discord-operator-role-id>"
DISCORD_GUILD_ROLE_ID_NOMINATOR="<discord-nominator-role-id>"


# RPC URL
NEXT_PUBLIC_RPC_URL="wss://"
NEXT_PUBLIC_NOVA_RPC_URL="wss://"

# Mock Wallet Configuration (to be used for development only)
# NEXT_PUBLIC_MOCK_WALLET="true"
# NEXT_PUBLIC_MOCK_WALLET_ADDRESS="" # jeremy
# NEXT_PUBLIC_MOCK_WALLET_ADDRESS="" # top 10 farmer
# NEXT_PUBLIC_MOCK_WALLET_ADDRESS="" # top 10 nominators
# NEXT_PUBLIC_MOCK_WALLET_ADDRESS=""
# NEXT_PUBLIC_MOCK_WALLET_SOURCE="polkadot-js"
4 changes: 2 additions & 2 deletions explorer/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const documents = {
"\n query AccountsTopLeaderboard($first: Int!) {\n farmers: accountRewardsConnection(\n orderBy: amount_DESC\n first: $first\n where: { vote_gt: 0, vote_isNull: false, OR: { block_gt: 0, block_isNull: false } }\n ) {\n edges {\n cursor\n node {\n id\n }\n }\n }\n operators: operatorRewardsConnection(orderBy: amount_DESC, first: $first, where: {}) {\n edges {\n cursor\n node {\n amount\n id\n }\n }\n }\n nominators: accountRewardsConnection(\n orderBy: operator_DESC\n first: $first\n where: { operator_gt: 0, operator_isNull: false }\n ) {\n edges {\n cursor\n node {\n id\n }\n }\n }\n }\n": types.AccountsTopLeaderboardDocument,
"\n query ExtrinsicsSummary($first: Int!, $subspaceAccount: String) {\n extrinsics: extrinsicsConnection(\n orderBy: id_DESC\n first: $first\n where: { signer: { id_eq: $subspaceAccount } }\n ) {\n edges {\n node {\n id\n success\n block {\n id\n timestamp\n height\n }\n name\n }\n }\n totalCount\n }\n }\n": types.ExtrinsicsSummaryDocument,
"\n query StakingSummary($first: Int!, $subspaceAccount: String) {\n operators: operatorsConnection(\n orderBy: id_ASC\n first: $first\n where: { operatorOwner_eq: $subspaceAccount }\n ) {\n edges {\n node {\n id\n operatorOwner\n currentDomainId\n currentTotalStake\n totalShares\n }\n }\n totalCount\n }\n nominators: nominatorsConnection(\n orderBy: id_ASC\n first: $first\n where: { account: { id_eq: $subspaceAccount } }\n ) {\n edges {\n node {\n id\n shares\n account {\n id\n }\n operator {\n id\n operatorOwner\n currentDomainId\n currentTotalStake\n totalShares\n }\n }\n }\n totalCount\n }\n }\n": types.StakingSummaryDocument,
"\n query CheckRole($subspaceAccount: String!) {\n isFarmer: rewardEvents(\n where: { name_eq: \"Rewards.VoteReward\", account: { id_eq: $subspaceAccount } }\n limit: 1\n ) {\n account {\n id\n }\n }\n }\n": types.CheckRoleDocument,
"\n query CheckRole($subspaceAccount: String!) {\n farmer: rewardEvents(\n where: { name_eq: \"Rewards.VoteReward\", account: { id_eq: $subspaceAccount } }\n limit: 1\n ) {\n account {\n id\n }\n }\n operator: operatorsConnection(\n first: 1\n where: { operatorOwner_eq: $subspaceAccount }\n orderBy: id_ASC\n ) {\n totalCount\n }\n nominator: nominatorsConnection(\n first: 1\n where: { account: { id_eq: $subspaceAccount } }\n orderBy: id_ASC\n ) {\n totalCount\n }\n }\n": types.CheckRoleDocument,
"\n query BlocksAndExtrinsicByHash($hash: String!) {\n blocks(limit: 10, where: { hash_eq: $hash }) {\n id\n height\n }\n extrinsics(limit: 10, where: { hash_eq: $hash }) {\n id\n }\n }\n": types.BlocksAndExtrinsicByHashDocument,
"\n query GetResults(\n $term: String!\n $blockId: BigInt!\n $isAccount: Boolean!\n $isBlock: Boolean!\n $isExtrinsic: Boolean!\n $isExtrinsicHash: Boolean!\n $isEvent: Boolean!\n ) {\n accountById(id: $term) @include(if: $isAccount) {\n id\n }\n blocks(limit: 1, where: { height_eq: $blockId }) @include(if: $isBlock) {\n height\n }\n extrinsicById(id: $term) @include(if: $isExtrinsic) {\n id\n name\n block {\n height\n }\n indexInBlock\n timestamp\n }\n extrinsics(limit: 1, where: { hash_eq: $term }) @include(if: $isExtrinsicHash) {\n id\n }\n eventById(id: $term) @include(if: $isEvent) {\n id\n name\n block {\n height\n }\n indexInBlock\n timestamp\n }\n }\n": types.GetResultsDocument,
};
Expand Down Expand Up @@ -210,7 +210,7 @@ export function graphql(source: "\n query StakingSummary($first: Int!, $subspac
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "\n query CheckRole($subspaceAccount: String!) {\n isFarmer: rewardEvents(\n where: { name_eq: \"Rewards.VoteReward\", account: { id_eq: $subspaceAccount } }\n limit: 1\n ) {\n account {\n id\n }\n }\n }\n"): (typeof documents)["\n query CheckRole($subspaceAccount: String!) {\n isFarmer: rewardEvents(\n where: { name_eq: \"Rewards.VoteReward\", account: { id_eq: $subspaceAccount } }\n limit: 1\n ) {\n account {\n id\n }\n }\n }\n"];
export function graphql(source: "\n query CheckRole($subspaceAccount: String!) {\n farmer: rewardEvents(\n where: { name_eq: \"Rewards.VoteReward\", account: { id_eq: $subspaceAccount } }\n limit: 1\n ) {\n account {\n id\n }\n }\n operator: operatorsConnection(\n first: 1\n where: { operatorOwner_eq: $subspaceAccount }\n orderBy: id_ASC\n ) {\n totalCount\n }\n nominator: nominatorsConnection(\n first: 1\n where: { account: { id_eq: $subspaceAccount } }\n orderBy: id_ASC\n ) {\n totalCount\n }\n }\n"): (typeof documents)["\n query CheckRole($subspaceAccount: String!) {\n farmer: rewardEvents(\n where: { name_eq: \"Rewards.VoteReward\", account: { id_eq: $subspaceAccount } }\n limit: 1\n ) {\n account {\n id\n }\n }\n operator: operatorsConnection(\n first: 1\n where: { operatorOwner_eq: $subspaceAccount }\n orderBy: id_ASC\n ) {\n totalCount\n }\n nominator: nominatorsConnection(\n first: 1\n where: { account: { id_eq: $subspaceAccount } }\n orderBy: id_ASC\n ) {\n totalCount\n }\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand Down
Loading
Loading