From 30b0c68d249c05ec1d50e2fd972056cb2641e0b4 Mon Sep 17 00:00:00 2001 From: Rhys Bartels-Waller Date: Thu, 1 Apr 2021 21:08:24 +1100 Subject: [PATCH] feature: allow rewards query This is to enable remote clients to fetch rewards information --- source/features/rewards/api/README.md | 1 + .../api/getRewardsForAddresses.graphql | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 source/features/rewards/api/README.md create mode 100644 source/features/rewards/api/getRewardsForAddresses.graphql diff --git a/source/features/rewards/api/README.md b/source/features/rewards/api/README.md new file mode 100644 index 00000000..55a491c7 --- /dev/null +++ b/source/features/rewards/api/README.md @@ -0,0 +1 @@ +Present to be included in the list of allowed queries. diff --git a/source/features/rewards/api/getRewardsForAddresses.graphql b/source/features/rewards/api/getRewardsForAddresses.graphql new file mode 100644 index 00000000..5f63d7b8 --- /dev/null +++ b/source/features/rewards/api/getRewardsForAddresses.graphql @@ -0,0 +1,22 @@ +query getRewardsForAddresses ( + $addresses: [StakeAddress!]! + $limit: Int + $offset: Int + $order_by: [Reward_order_by!] +) { + rewards( + limit: $limit + offset: $offset + order_by: $order_by + where: { address: { _in: $addresses }} + ) { + address + amount + earnedIn { + number + } + stakePool { + id + } + } +}