@sonarwatch/portfolio-plugins 0.11.204 → 0.11.205

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # @sonarwatch/portfolio-plugins
2
-
3
- This library is @sonarwatch/portfolio-plugins
1
+ # @sonarwatch/portfolio-plugins
2
+
3
+ This library is @sonarwatch/portfolio-plugins
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.11.204",
3
+ "version": "0.11.205",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
@@ -41,7 +41,7 @@
41
41
  "web3-v1": "npm:web3@^1.5.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "@sonarwatch/portfolio-core": "0.11.204"
44
+ "@sonarwatch/portfolio-core": "0.11.205"
45
45
  },
46
46
  "main": "./src/index.js",
47
47
  "types": "./src/index.d.ts"
@@ -36,27 +36,27 @@ exports.getBalancerPoolsV2 = void 0;
36
36
  const graphql_request_1 = __importStar(require("graphql-request"));
37
37
  function getBalancerPoolsV2(url) {
38
38
  return __awaiter(this, void 0, void 0, function* () {
39
- const query = (0, graphql_request_1.gql) `
40
- query pools {
41
- pools(
42
- first: 1000
43
- orderBy: totalLiquidity
44
- orderDirection: desc
45
- where: { totalLiquidity_gt: "500" }
46
- ) {
47
- id
48
- address
49
- symbol
50
- totalLiquidity
51
- totalShares
52
- tokens {
53
- balance
54
- decimals
55
- symbol
56
- address
57
- }
58
- }
59
- }
39
+ const query = (0, graphql_request_1.gql) `
40
+ query pools {
41
+ pools(
42
+ first: 1000
43
+ orderBy: totalLiquidity
44
+ orderDirection: desc
45
+ where: { totalLiquidity_gt: "500" }
46
+ ) {
47
+ id
48
+ address
49
+ symbol
50
+ totalLiquidity
51
+ totalShares
52
+ tokens {
53
+ balance
54
+ decimals
55
+ symbol
56
+ address
57
+ }
58
+ }
59
+ }
60
60
  `;
61
61
  const res = yield (0, graphql_request_1.default)(url, query);
62
62
  const pools = res.pools;
@@ -16,14 +16,17 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
16
  const constants_1 = require("./constants");
17
17
  const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
18
18
  const helpersAirdrop_1 = require("./helpersAirdrop");
19
+ const helpers_1 = require("../jupiter/helpers");
20
+ const clients_1 = require("../../utils/clients");
19
21
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
20
- // const client = getClientSolana();
21
- // const claimStatus = deriveClaimStatus(owner, res.data.merkle_tree, '');
22
- // const account = await client.getAccountInfo(claimStatus);
23
- // if (account) return [];
24
- const amount = yield (0, helpersAirdrop_1.fetchAirdropAmount)(owner);
22
+ const { amount, merkle } = yield (0, helpersAirdrop_1.fetchAirdropInfo)(owner);
25
23
  if (amount === 0)
26
24
  return [];
25
+ const client = (0, clients_1.getClientSolana)();
26
+ const claimStatus = (0, helpers_1.deriveClaimStatus)(owner, merkle, constants_1.distributorPid);
27
+ const account = yield client.getAccountInfo(claimStatus);
28
+ if (account)
29
+ return [];
27
30
  const tokenPrice = constants_1.driftMint
28
31
  ? yield cache.getTokenPrice(constants_1.driftMint, portfolio_core_1.NetworkId.solana)
29
32
  : undefined;
@@ -38,7 +41,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
38
41
  imageUri: constants_1.platform.image,
39
42
  },
40
43
  attributes: {
41
- lockedUntil: -1,
44
+ lockedUntil: helpersAirdrop_1.claimStart,
42
45
  },
43
46
  networkId: portfolio_core_1.NetworkId.solana,
44
47
  value: null,
@@ -1 +1 @@
1
- {"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAA8D;AAC9D,qGAA6E;AAC7E,qDAAsD;AAEtD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAA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,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;YACD,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,SAAS;SACjB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -9,5 +9,6 @@ export declare const prefixSpotMarkets = "drift-spotMarkets";
9
9
  export declare const driftProgram: PublicKey;
10
10
  export declare const preMarketPriceKey = "premarketPrice";
11
11
  export declare const airdropUrl = "https://airdrop.drift.trade/eligibility/";
12
+ export declare const distributorPid = "E7HtfkEMhmn9uwL7EFNydcXBWy5WCYN1vFmKKjipEH1x";
12
13
  export declare const driftDecimals = 6;
13
14
  export declare const driftMint: undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.driftMint = exports.driftDecimals = exports.airdropUrl = exports.preMarketPriceKey = exports.driftProgram = exports.prefixSpotMarkets = exports.platform = exports.platformWebsite = exports.platformImage = exports.platformName = exports.platformId = void 0;
3
+ exports.driftMint = exports.driftDecimals = exports.distributorPid = exports.airdropUrl = exports.preMarketPriceKey = exports.driftProgram = exports.prefixSpotMarkets = exports.platform = exports.platformWebsite = exports.platformImage = exports.platformName = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.platformId = 'drift';
6
6
  exports.platformName = 'Drift';
@@ -17,6 +17,7 @@ exports.prefixSpotMarkets = `${exports.platformId}-spotMarkets`;
17
17
  exports.driftProgram = new web3_js_1.PublicKey('dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH');
18
18
  exports.preMarketPriceKey = 'premarketPrice';
19
19
  exports.airdropUrl = 'https://airdrop.drift.trade/eligibility/';
20
+ exports.distributorPid = 'E7HtfkEMhmn9uwL7EFNydcXBWy5WCYN1vFmKKjipEH1x';
20
21
  exports.driftDecimals = 6;
21
22
  exports.driftMint = undefined;
22
23
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,YAAY,GAAG,OAAO,CAAC;AACvB,QAAA,aAAa,GAAG,6CAA6C,CAAC;AAC9D,QAAA,eAAe,GAAG,0BAA0B,CAAC;AAC7C,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,oBAAY;IAClB,KAAK,EAAE,qBAAa;IACpB,WAAW,EAAE,OAAO;IACpB,OAAO,EAAE,uBAAe;CACzB,CAAC;AACW,QAAA,iBAAiB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAEhD,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,iBAAiB,GAAG,gBAAgB,CAAC;AAErC,QAAA,UAAU,GAAG,0CAA0C,CAAC;AACxD,QAAA,aAAa,GAAG,CAAC,CAAC;AAClB,QAAA,SAAS,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,YAAY,GAAG,OAAO,CAAC;AACvB,QAAA,aAAa,GAAG,6CAA6C,CAAC;AAC9D,QAAA,eAAe,GAAG,0BAA0B,CAAC;AAC7C,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,oBAAY;IAClB,KAAK,EAAE,qBAAa;IACpB,WAAW,EAAE,OAAO;IACpB,OAAO,EAAE,uBAAe;CACzB,CAAC;AACW,QAAA,iBAAiB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAEhD,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,iBAAiB,GAAG,gBAAgB,CAAC;AAErC,QAAA,UAAU,GAAG,0CAA0C,CAAC;AACxD,QAAA,cAAc,GAAG,8CAA8C,CAAC;AAChE,QAAA,aAAa,GAAG,CAAC,CAAC;AAClB,QAAA,SAAS,GAAG,SAAS,CAAC"}
@@ -1,3 +1,5 @@
1
+ import { AirdropInfo } from './types';
1
2
  import { AirdropFetcher } from '../../AirdropFetcher';
2
- export declare function fetchAirdropAmount(owner: string): Promise<number>;
3
+ export declare const claimStart = 1715860800000;
4
+ export declare function fetchAirdropInfo(owner: string): Promise<AirdropInfo>;
3
5
  export declare const airdropFetcher: AirdropFetcher;
@@ -12,13 +12,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.airdropFetcher = exports.fetchAirdropAmount = void 0;
15
+ exports.airdropFetcher = exports.fetchAirdropInfo = exports.claimStart = void 0;
16
16
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
17
  const axios_1 = __importDefault(require("axios"));
18
18
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
19
19
  const constants_1 = require("./constants");
20
20
  const driftFactor = new bignumber_js_1.default(Math.pow(10, constants_1.driftDecimals));
21
- function fetchAirdropAmount(owner) {
21
+ exports.claimStart = 1715860800000;
22
+ function fetchAirdropInfo(owner) {
22
23
  return __awaiter(this, void 0, void 0, function* () {
23
24
  const res = yield axios_1.default.get(constants_1.airdropUrl + owner, {
24
25
  headers: {
@@ -30,12 +31,18 @@ function fetchAirdropAmount(owner) {
30
31
  return status === 404 || status === 200;
31
32
  },
32
33
  });
33
- return new bignumber_js_1.default(res.data.start_amount || 0)
34
- .dividedBy(driftFactor)
35
- .toNumber();
34
+ const availableAmount = Date.now() > res.data.end_ts * 1000
35
+ ? res.data.end_amount
36
+ : res.data.start_amount;
37
+ return {
38
+ amount: new bignumber_js_1.default(availableAmount || 0)
39
+ .dividedBy(driftFactor)
40
+ .toNumber(),
41
+ merkle: res.data.merkle_tree,
42
+ };
36
43
  });
37
44
  }
38
- exports.fetchAirdropAmount = fetchAirdropAmount;
45
+ exports.fetchAirdropInfo = fetchAirdropInfo;
39
46
  const airdropStatics = {
40
47
  claimLink: 'https://drift.foundation/eligibility',
41
48
  id: 'drift-airdrop-1',
@@ -44,11 +51,11 @@ const airdropStatics = {
44
51
  name: undefined,
45
52
  emitterName: constants_1.platformName,
46
53
  emitterLink: constants_1.platformWebsite,
47
- claimStart: undefined,
54
+ claimStart: exports.claimStart,
48
55
  claimEnd: undefined,
49
56
  };
50
57
  const fetchAirdropExecutor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
51
- let amount = yield fetchAirdropAmount(owner);
58
+ let { amount } = yield fetchAirdropInfo(owner);
52
59
  if (amount === 0)
53
60
  amount = -1;
54
61
  const claimStatus = (0, portfolio_core_1.getAirdropClaimStatus)(airdropStatics.claimStart, airdropStatics.claimEnd);
@@ -1 +1 @@
1
- {"version":3,"file":"helpersAirdrop.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/helpersAirdrop.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,kDAA6C;AAC7C,+DAA8E;AAC9E,2CAMqB;AAIrB,MAAM,WAAW,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,yBAAa,CAAA,CAAC,CAAC;AACvD,SAAsB,kBAAkB,CAAC,KAAa;;QACpD,MAAM,GAAG,GAAmC,MAAM,eAAK,CAAC,GAAG,CACzD,sBAAU,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AV,kBAAU;IACV,QAAQ,EAAE,SAAS;CACpB,CAAC;AACF,MAAM,oBAAoB,GAA2B,CAAO,KAAa,EAAE,EAAE;IAC3E,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAI,MAAM,KAAK,CAAC;QAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IAE9B,MAAM,WAAW,GAAG,IAAA,sCAAqB,EACvC,cAAc,CAAC,UAAU,EACzB,cAAc,CAAC,QAAQ,CACxB,CAAC;IACF,uCACK,cAAc,KACjB,MAAM;QACN,WAAW,EACX,SAAS,EAAE,KAAK,EAChB,KAAK,EAAE,IAAI,IACX;AACJ,CAAC,CAAA,CAAC;AAEW,QAAA,cAAc,GAAmB;IAC5C,EAAE,EAAE,cAAc,CAAC,EAAE;IACrB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ,EAAE,oBAAoB;CAC/B,CAAC"}
@@ -19,3 +19,7 @@ export type AirdropResponse = {
19
19
  claimed_amount: number;
20
20
  error: string;
21
21
  };
22
+ export type AirdropInfo = {
23
+ merkle: string;
24
+ amount: number;
25
+ };
@@ -48,12 +48,14 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
48
48
  stakingPosition.data.content.fields.value.fields.amount !== '0') {
49
49
  const amount = new bignumber_js_1.default(stakingPosition.data.content.fields.value.fields.amount).dividedBy(Math.pow(10, constants_1.lpDecimals));
50
50
  assets.push((0, tokenPriceToAssetToken_1.default)(constants_1.xflxMint, amount.toNumber(), portfolio_core_1.NetworkId.sui, xflxTokenPrice));
51
- assets.push((0, tokenPriceToAssetToken_1.default)(portfolio_core_1.suiNativeAddress, new bignumber_js_1.default(stakingPosition.data.content.fields.value.fields.sui_pending)
52
- .dividedBy(Math.pow(10, portfolio_core_1.suiNativeDecimals))
53
- .toNumber(), portfolio_core_1.NetworkId.sui, suiTokenPrice, undefined, { isClaimable: true }));
54
- assets.push((0, tokenPriceToAssetToken_1.default)(constants_1.flxMint, new bignumber_js_1.default(stakingPosition.data.content.fields.value.fields.flx_pending)
55
- .dividedBy(Math.pow(10, constants_1.flxDecimals))
56
- .toNumber(), portfolio_core_1.NetworkId.sui, flxTokenPrice, undefined, { isClaimable: true }));
51
+ if (stakingPosition.data.content.fields.value.fields.sui_pending !== '0')
52
+ assets.push((0, tokenPriceToAssetToken_1.default)(portfolio_core_1.suiNativeAddress, new bignumber_js_1.default(stakingPosition.data.content.fields.value.fields.sui_pending)
53
+ .dividedBy(Math.pow(10, portfolio_core_1.suiNativeDecimals))
54
+ .toNumber(), portfolio_core_1.NetworkId.sui, suiTokenPrice, undefined, { isClaimable: true }));
55
+ if (stakingPosition.data.content.fields.value.fields.flx_pending !== '0')
56
+ assets.push((0, tokenPriceToAssetToken_1.default)(constants_1.flxMint, new bignumber_js_1.default(stakingPosition.data.content.fields.value.fields.flx_pending)
57
+ .dividedBy(Math.pow(10, constants_1.flxDecimals))
58
+ .toNumber(), portfolio_core_1.NetworkId.sui, flxTokenPrice, undefined, { isClaimable: true }));
57
59
  }
58
60
  unstakingPositions.forEach((unstakingPosition) => {
59
61
  var _a, _b;
@@ -1 +1 @@
1
- {"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowx/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,gEAAqC;AAGrC,2CAQqB;AACrB,iFAA8E;AAC9E,iDAAmD;AAEnD,qGAA6E;AAC7E,qEAAkE;AAClE,uCAA2C;AAE3C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC9D,IAAA,6CAAqB,EAAkB,MAAM,EAAE;YAC7C,QAAQ,EAAE,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,MAAM,CAAC,iBAAiB,CAAC,CAAC;YAE7D,MAAM,KAAK,mCACN,IAAA,gCAAsB,EACvB,oBAAQ,EACR,MAAM,CAAC,QAAQ,EAAE,EACjB,0BAAS,CAAC,GAAG,EACb,cAAc,CACf,KACD,UAAU,EAAE;oBACV,IAAI,EAAE,CAAC,WAAW,CAAC;oBACnB,WAAW,EAAE,WAAW;iBACzB,GACF,CAAC;YAEF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,EAAE,MAAM,EAAE;YAChB,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -13,8 +13,11 @@ function getPoolsRewardsAsMap(lendingMarkets) {
13
13
  const { reserves } = lendingMarket;
14
14
  for (const reserve of reserves) {
15
15
  const poolsRewards = reserve.fields.deposits_pool_reward_manager.fields.pool_rewards;
16
- for (const poolReward of poolsRewards)
16
+ for (const poolReward of poolsRewards) {
17
+ if (!poolReward)
18
+ continue;
17
19
  rewardMintByPoolId.set(poolReward.fields.id.id, poolReward.fields);
20
+ }
18
21
  }
19
22
  }
20
23
  return rewardMintByPoolId;
@@ -1 +1 @@
1
- {"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3PairsAddresses(url, length = 300) {
56
56
  return __awaiter(this, void 0, void 0, function* () {
57
- const query = (0, graphql_request_1.gql) `
58
- {
59
- pools(
60
- orderBy: totalValueLockedUSD
61
- first: ${length}
62
- orderDirection: desc
63
- where: { volumeUSD_not: "0", liquidity_not: "0" }
64
- ) {
65
- id
66
- token0Price
67
- token1Price
68
- liquidity
69
- token0 {
70
- id
71
- totalSupply
72
- decimals
73
- }
74
- token1 {
75
- id
76
- totalSupply
77
- decimals
78
- }
79
- }
80
- }
57
+ const query = (0, graphql_request_1.gql) `
58
+ {
59
+ pools(
60
+ orderBy: totalValueLockedUSD
61
+ first: ${length}
62
+ orderDirection: desc
63
+ where: { volumeUSD_not: "0", liquidity_not: "0" }
64
+ ) {
65
+ id
66
+ token0Price
67
+ token1Price
68
+ liquidity
69
+ token0 {
70
+ id
71
+ totalSupply
72
+ decimals
73
+ }
74
+ token1 {
75
+ id
76
+ totalSupply
77
+ decimals
78
+ }
79
+ }
80
+ }
81
81
  `;
82
82
  const res = yield (0, graphql_request_1.default)(url, query);
83
83
  const pools = res.pools;
@@ -40,28 +40,28 @@ function getPairKey(version) {
40
40
  exports.getPairKey = getPairKey;
41
41
  function getPairsV2FromTheGraph(url, length = 300) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
- const query = (0, graphql_request_1.gql) `
44
- {
45
- pairs(
46
- orderBy: reserveUSD
47
- first: ${length}
48
- orderDirection: desc
49
- where: { trackedReserveETH_not: "0" }
50
- ) {
51
- id
52
- reserve0
53
- reserve1
54
- totalSupply
55
- token0 {
56
- id
57
- decimals
58
- }
59
- token1 {
60
- id
61
- decimals
62
- }
63
- }
64
- }
43
+ const query = (0, graphql_request_1.gql) `
44
+ {
45
+ pairs(
46
+ orderBy: reserveUSD
47
+ first: ${length}
48
+ orderDirection: desc
49
+ where: { trackedReserveETH_not: "0" }
50
+ ) {
51
+ id
52
+ reserve0
53
+ reserve1
54
+ totalSupply
55
+ token0 {
56
+ id
57
+ decimals
58
+ }
59
+ token1 {
60
+ id
61
+ decimals
62
+ }
63
+ }
64
+ }
65
65
  `;
66
66
  const res = yield (0, graphql_request_1.default)(url, query);
67
67
  const pairs = res.pairs;
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
4
- exports.infoQueryMsg = JSON.parse(`{
5
- "info": {}
4
+ exports.infoQueryMsg = JSON.parse(`{
5
+ "info": {}
6
6
  }`);
7
- exports.tokenInfoQueryMsg = JSON.parse(`{
8
- "token_info": {}
7
+ exports.tokenInfoQueryMsg = JSON.parse(`{
8
+ "token_info": {}
9
9
  }`);
10
- exports.minterQueryMsg = JSON.parse(`{
11
- "minter": {}
10
+ exports.minterQueryMsg = JSON.parse(`{
11
+ "minter": {}
12
12
  }`);
13
- exports.poolQueryMsg = JSON.parse(`{
14
- "pool": {}
13
+ exports.poolQueryMsg = JSON.parse(`{
14
+ "pool": {}
15
15
  }`);
16
16
  //# sourceMappingURL=constants.js.map
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  function getQueryBalanceByOwner(owner) {
4
- return JSON.parse(`{
5
- "balance": {
6
- "address": "${owner}"
7
- }
4
+ return JSON.parse(`{
5
+ "balance": {
6
+ "address": "${owner}"
7
+ }
8
8
  }`);
9
9
  }
10
10
  exports.default = getQueryBalanceByOwner;