diff --git a/package-lock.json b/package-lock.json index 5fb9a9910..0b413b01b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1162,9 +1162,9 @@ } }, "@snapshot-labs/snapshot.js": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@snapshot-labs/snapshot.js/-/snapshot.js-0.2.3.tgz", - "integrity": "sha512-fJ94USSlXvnNDSCxNHXs1ksrRmYIy4kHk/vuo8ZrqKgQwA8LH/0ppqO/BR4Xt1NypTmzx3+2Nbph/T5n9DD4Fg==", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@snapshot-labs/snapshot.js/-/snapshot.js-0.2.8.tgz", + "integrity": "sha512-aFFSYOG/QkZNYxfrb4idXSpq1yE8ZEyLCLGSgbut+nZoc3oosR9mZj2C7q6Mor5q/4UuKZR6nhRSMCnlWMoTYA==", "requires": { "@ethersproject/abi": "^5.0.4", "@ethersproject/address": "^5.0.4", @@ -1502,9 +1502,9 @@ } }, "ajv": { - "version": "8.6.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz", - "integrity": "sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w==", + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", "requires": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", diff --git a/package.json b/package.json index 7fc10aa37..5ece0712e 100755 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@ethersproject/strings": "^5.0.5", "@ethersproject/units": "^5.0.3", "@ethersproject/wallet": "^5.4.0", - "@snapshot-labs/snapshot.js": "^0.2.3", + "@snapshot-labs/snapshot.js": "^0.2.8", "@uniswap/sdk-core": "^3.0.1", "@uniswap/v3-sdk": "^3.3.1", "cross-fetch": "^3.0.6", diff --git a/src/strategies/coordinape/index.ts b/src/strategies/coordinape/index.ts index d7f6f73db..fb9295c44 100644 --- a/src/strategies/coordinape/index.ts +++ b/src/strategies/coordinape/index.ts @@ -23,15 +23,12 @@ export async function strategy( }); const gifts = await res.json(); const scores = {}; - gifts.forEach(gift => { + gifts.forEach((gift) => { const address = getAddress(gift.recipient_address); if (!scores[address]) scores[address] = 0; scores[address] += gift.tokens; }); return Object.fromEntries( - addresses.map(address => [ - address, - scores[getAddress(address)] || 0 - ]) + addresses.map((address) => [address, scores[getAddress(address)] || 0]) ); } diff --git a/src/strategies/faraland-staking/index.ts b/src/strategies/faraland-staking/index.ts index 1357adde0..8f2429af4 100644 --- a/src/strategies/faraland-staking/index.ts +++ b/src/strategies/faraland-staking/index.ts @@ -2,8 +2,10 @@ import { getAddress } from '@ethersproject/address'; import { subgraphRequest } from '../../utils'; const FLASHSTAKE_SUBGRAPH_URL = { - '1': 'https://queries-graphnode.faraland.io/subgraphs/name/edwardevans094/farastore-v12', - '56': 'https://queries-graphnode.faraland.io/subgraphs/name/edwardevans094/farastore-v12' + '1': + 'https://queries-graphnode.faraland.io/subgraphs/name/edwardevans094/farastore-v12', + '56': + 'https://queries-graphnode.faraland.io/subgraphs/name/edwardevans094/farastore-v12' }; export const author = 'edwardEvans094'; diff --git a/src/strategies/has-rock/index.ts b/src/strategies/has-rock/index.ts index b93a9073e..f05c0bbe5 100644 --- a/src/strategies/has-rock/index.ts +++ b/src/strategies/has-rock/index.ts @@ -26,9 +26,9 @@ export async function strategy( const result = {} as any; - addresses.forEach((address, x) => { + addresses.forEach((address) => { let addressRocks = 0; - response.forEach((rockObject, i) => { + response.forEach((rockObject) => { if (rockObject.owner == address) { addressRocks++; } diff --git a/src/strategies/iotex-staked-balance/index.ts b/src/strategies/iotex-staked-balance/index.ts index 8e49c0ad0..8a56ba592 100644 --- a/src/strategies/iotex-staked-balance/index.ts +++ b/src/strategies/iotex-staked-balance/index.ts @@ -23,20 +23,17 @@ export async function strategy( ) { const height = typeof snapshot === 'number' ? snapshot : 10000000000; const apiUrl = getUrl(network); - const response = await fetch( - `${apiUrl}/api.StakingService.GetVoteByHeight`, - { - method: 'POST', - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - address: addresses, - height - }) - } - ); + const response = await fetch(`${apiUrl}/api.StakingService.GetVoteByHeight`, { + method: 'POST', + headers: { + Accept: 'application/json', + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + address: addresses, + height + }) + }); const ret: ApiReturn = await response.json(); return Object.fromEntries( diff --git a/src/strategies/sunrisegaming-staking/index.ts b/src/strategies/sunrisegaming-staking/index.ts index 4871dcbae..0c9cf1edb 100644 --- a/src/strategies/sunrisegaming-staking/index.ts +++ b/src/strategies/sunrisegaming-staking/index.ts @@ -24,7 +24,7 @@ export async function strategy( const blockTag = typeof snapshot === 'number' ? snapshot : 'latest'; // Get staked LP in staking constract - let stakedRes = await multicall( + const stakedRes = await multicall( network, provider, masterChefAbi, @@ -40,7 +40,9 @@ export async function strategy( return Object.fromEntries( stakedRes.map((stakedInfo, i) => { - const parsedAmount = parseFloat(formatUnits(bn(stakedInfo.amount), options.decimal)); + const parsedAmount = parseFloat( + formatUnits(bn(stakedInfo.amount), options.decimal) + ); return [addresses[i], parsedAmount]; }) ); diff --git a/src/strategies/sunrisegaming-univ2-lp/index.ts b/src/strategies/sunrisegaming-univ2-lp/index.ts index 63f05b133..48c6c6319 100644 --- a/src/strategies/sunrisegaming-univ2-lp/index.ts +++ b/src/strategies/sunrisegaming-univ2-lp/index.ts @@ -51,7 +51,7 @@ export async function strategy( res = res.slice(2); // Get staked LP in staking constract - let stakedRes = await multicall( + const stakedRes = await multicall( network, provider, masterChefAbi, @@ -68,7 +68,7 @@ export async function strategy( // How much tokens user has from LP tokens const usersTokensFromLp = res.slice(0, addresses.length).map((amount, i) => { const totalLp = bn(amount).add(bn(stakedRes[i].amount)); // decimal: 18 - + // (LP + StakedLP) x token.balanceOf(LPToken) / LPToken.totalSupply() return totalLp.mul(totalTokensInPool).div(lpTokenTotalSupply); // decimal: options.decimal });