@sonarwatch/portfolio-plugins 0.14.37 → 0.14.39

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/CHANGELOG.md +1748 -1740
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/plugins/adrena/alpPriceJob.d.ts +3 -0
  5. package/src/plugins/adrena/alpPriceJob.js +49 -0
  6. package/src/plugins/adrena/alpPriceJob.js.map +1 -0
  7. package/src/plugins/adrena/index.js +2 -1
  8. package/src/plugins/adrena/index.js.map +1 -1
  9. package/src/plugins/adrena/structs.d.ts +21 -0
  10. package/src/plugins/adrena/structs.js +21 -1
  11. package/src/plugins/adrena/structs.js.map +1 -1
  12. package/src/plugins/balancer/helpers/pools.js +21 -21
  13. package/src/plugins/bonkrewards/positionFetcher.js +0 -2
  14. package/src/plugins/bonkrewards/positionFetcher.js.map +1 -1
  15. package/src/plugins/meteora/dlmmVaultsFetcher.js +37 -44
  16. package/src/plugins/meteora/dlmmVaultsFetcher.js.map +1 -1
  17. package/src/plugins/meteora/struct.d.ts +3 -3
  18. package/src/plugins/meteora/struct.js +3 -3
  19. package/src/plugins/meteora/struct.js.map +1 -1
  20. package/src/plugins/pyth/pricingJob.js +11 -0
  21. package/src/plugins/pyth/pricingJob.js.map +1 -1
  22. package/src/plugins/scallop/obligationsFetcher.js +1 -0
  23. package/src/plugins/scallop/obligationsFetcher.js.map +1 -1
  24. package/src/plugins/sushiswap/helpers.js +24 -24
  25. package/src/plugins/uniswap-v2/helpers.js +22 -22
  26. package/src/plugins/zeta/airdropFetcher.js +14 -14
  27. package/src/utils/sei/constants.js +8 -8
  28. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  29. package/src/utils/solana/getSupply.d.ts +4 -0
  30. package/src/utils/solana/getSupply.js +28 -0
  31. package/src/utils/solana/getSupply.js.map +1 -0
@@ -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;
@@ -0,0 +1,4 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import BigNumber from 'bignumber.js';
3
+ import { SolanaClient } from '../clients/types';
4
+ export declare function getSupply(connection: SolanaClient, mint: PublicKey): Promise<BigNumber | null>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getSupply = void 0;
13
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
14
+ const getParsedAccountInfo_1 = require("./getParsedAccountInfo");
15
+ const structs_1 = require("./structs");
16
+ const solMints = [portfolio_core_1.solanaNativeAddress, portfolio_core_1.solanaNativeWrappedAddress];
17
+ function getSupply(connection, mint) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ if (solMints.includes(mint.toString()))
20
+ return null;
21
+ const mintAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(connection, structs_1.mintAccountStruct, mint);
22
+ return mintAccount
23
+ ? mintAccount.supply.div(Math.pow(10, mintAccount.decimals))
24
+ : null;
25
+ });
26
+ }
27
+ exports.getSupply = getSupply;
28
+ //# sourceMappingURL=getSupply.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSupply.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/getSupply.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+DAGoC;AAGpC,iEAA8D;AAC9D,uCAA8C;AAE9C,MAAM,QAAQ,GAAG,CAAC,oCAAmB,EAAE,2CAA0B,CAAC,CAAC;AAEnE,SAAsB,SAAS,CAC7B,UAAwB,EACxB,IAAe;;QAEf,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YAAE,OAAO,IAAI,CAAC;QAEpD,MAAM,WAAW,GAAG,MAAM,IAAA,2CAAoB,EAC5C,UAAU,EACV,2BAAiB,EACjB,IAAI,CACL,CAAC;QACF,OAAO,WAAW;YAChB,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,SAAA,EAAE,EAAI,WAAW,CAAC,QAAQ,CAAA,CAAC;YACpD,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;CAAA;AAdD,8BAcC"}