@sonarwatch/portfolio-plugins 0.14.26 → 0.14.28

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.14.26",
3
+ "version": "0.14.28",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -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;
@@ -6,7 +6,7 @@ exports.platform = {
6
6
  id: exports.platformId,
7
7
  name: 'DeepBook',
8
8
  image: 'https://sonar.watch/img/platforms/deepbook.webp',
9
- website: 'https://deepbook.com/',
9
+ website: 'https://deepbook.tech/',
10
10
  twitter: 'https://x.com/DeepBookonSui',
11
11
  defiLlamaId: 'deepbook', // from https://defillama.com/docs/api
12
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/deepbook/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,6BAA6B;IACtC,WAAW,EAAE,UAAU,EAAE,sCAAsC;CAChE,CAAC;AACW,QAAA,cAAc,GAAmB;IAC5C,WAAW,EAAE,uBAAuB;IACpC,SAAS,EAAE,8BAA8B;IACzC,WAAW,EAAE,UAAU;IACvB,EAAE,EAAE,GAAG,kBAAU,eAAe;IAChC,KAAK,EAAE,iDAAiD;IACxD,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,aAAa;CAC1B,CAAC;AAEW,QAAA,QAAQ,GACnB,gFAAgF,CAAC;AACtE,QAAA,YAAY,GAAG,CAAC,CAAC;AAEjB,QAAA,UAAU,GAAG,QAAQ,CAAC;AAEtB,QAAA,WAAW,GAAG,SAAS,CAAC;AAExB,QAAA,aAAa,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/deepbook/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,wBAAwB;IACjC,OAAO,EAAE,6BAA6B;IACtC,WAAW,EAAE,UAAU,EAAE,sCAAsC;CAChE,CAAC;AACW,QAAA,cAAc,GAAmB;IAC5C,WAAW,EAAE,uBAAuB;IACpC,SAAS,EAAE,8BAA8B;IACzC,WAAW,EAAE,UAAU;IACvB,EAAE,EAAE,GAAG,kBAAU,eAAe;IAChC,KAAK,EAAE,iDAAiD;IACxD,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,aAAa;CAC1B,CAAC;AAEW,QAAA,QAAQ,GACnB,gFAAgF,CAAC;AACtE,QAAA,YAAY,GAAG,CAAC,CAAC;AAEjB,QAAA,UAAU,GAAG,QAAQ,CAAC;AAEtB,QAAA,WAAW,GAAG,SAAS,CAAC;AAExB,QAAA,aAAa,GAAG,OAAO,CAAC"}
@@ -63,10 +63,12 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
63
63
  address: stakePoolAccount.stakeTokenMint,
64
64
  amount: (M.isGreaterThan(A) ? A : M).toNumber(),
65
65
  }); */
66
- element.addRewardAsset({
67
- address: portfolio_core_1.solanaNativeAddress,
68
- amount: stakingAccount.claimableReward,
69
- });
66
+ if (new bignumber_js_1.default(stakingAccount.claimableReward).isGreaterThan(0.002)) {
67
+ element.addRewardAsset({
68
+ address: portfolio_core_1.solanaNativeAddress,
69
+ amount: stakingAccount.claimableReward,
70
+ });
71
+ }
70
72
  element.addSuppliedAsset({
71
73
  address: stakePoolAccount.stakeTokenMint,
72
74
  amount: stakingAccount.withdrawingTokens,
@@ -1 +1 @@
1
- {"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nxfinance/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA4E;AAC5E,6CAA4C;AAC5C,gEAAqC;AAErC,2CAMqB;AAErB,iDAAsD;AACtD,+CAAuE;AAEvE,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,cAAc,GAAG,CACrB,MAAM,IAAA,0CAAiC,EACrC,UAAU,EACV,mCAAuB,EACvB;QACE,mBAA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C3D,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU;iBAClC,YAAY,CAAC,IAAI,sBAAS,CAAC,GAAG,CAAC,CAAC;iBAChC,QAAQ,EAAE;SACd;KACF,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,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"}
1
+ {"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nxfinance/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA4E;AAC5E,6CAA4C;AAC5C,gEAAqC;AAErC,2CAMqB;AAErB,iDAAsD;AACtD,+CAAuE;AAEvE,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,cAAc,GAAG,CACrB,MAAM,IAAA,0CAAiC,EACrC,UAAU,EACV,mCAAuB,EACvB;QACE,mBAAS,CAAC,sBAAsB,CAC9B;YACE,IAAI,mBAAS,CAAC,qBAAS,CAAC,CAAC,QAAQ,EAAE;YACnC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC;YACjC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;SAChC,EACD,IAAI,mBAAS,CAAC,4BAAgB,CAAC,CAChC,CAAC,CAAC,CAAC;KACL,CACF,CACF,CAAC,CAAC,CAAC,CAAC;IAEL,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,YAAY,KAAK,GAAG;QAAE,OAAO,EAAE,CAAC;IAEtE,MAAM,g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,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
54
54
  }
55
55
  function getV3PairsAddresses(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;
@@ -42,20 +42,20 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
42
42
  const clients_1 = require("../../utils/clients");
43
43
  const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
44
44
  const helpers_1 = require("./helpers");
45
- const query = (0, graphql_request_1.gql) `
46
- query GetAirdropFinalFrontend($authority: String!) {
47
- getAirdropFinalFrontend(authority: $authority) {
48
- authority
49
- community_allocation
50
- eligibility
51
- main_allocation
52
- og_allocation
53
- s1_allocation
54
- s2_allocation
55
- total_allocation
56
- __typename
57
- }
58
- }
45
+ const query = (0, graphql_request_1.gql) `
46
+ query GetAirdropFinalFrontend($authority: String!) {
47
+ getAirdropFinalFrontend(authority: $authority) {
48
+ authority
49
+ community_allocation
50
+ eligibility
51
+ main_allocation
52
+ og_allocation
53
+ s1_allocation
54
+ s2_allocation
55
+ total_allocation
56
+ __typename
57
+ }
58
+ }
59
59
  `;
60
60
  const networkId = portfolio_core_1.NetworkId.solana;
61
61
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
@@ -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;