Skip to content

Commit

Permalink
Merge pull request #41 from sushiswap/update_kashi_query
Browse files Browse the repository at this point in the history
Updated kashi staked info query
  • Loading branch information
jiro-ono authored May 20, 2021
2 parents acfc6c1 + 9d207fe commit 1976df7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sushiswap/sushi-data",
"license": "MIT",
"version": "1.0.24",
"version": "1.0.25",
"author": "SushiSwap",
"main": "index",
"scripts": {
Expand Down
17 changes: 9 additions & 8 deletions queries/bentobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ module.exports = {
},

async kashiStakedInfo() {
const result = await request(ENDPOINTS[1],
gql`{
kashiPairs(where: {masterContract: "${MASTER_CONTRACT}"}) {
${kashiStakedInfo.properties.toString()}
}
}`
);
const results = await pageResults({
api: ENDPOINTS[1],
query: {
entity: 'kashiPairs',
properties: kashiStakedInfo.properties
}
})

let result = {}
result.sushiUSD = await sushiPriceUSD();
result.ethUSD = await ethPriceUSD();

Expand All @@ -59,7 +60,7 @@ module.exports = {

let pools = await chefPools();
let onsen_pools = pools.map(pool => pool.pair)
let filtered_result = result.kashiPairs.filter(pair => onsen_pools.includes(pair.id))
let filtered_result = results.filter(pair => onsen_pools.includes(pair.id))

return kashiStakedInfo.callback(filtered_result)
},
Expand Down

0 comments on commit 1976df7

Please sign in to comment.