@sonarwatch/portfolio-plugins 0.12.29 → 0.12.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. package/CHANGELOG.md +1819 -1806
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/index.js +8 -0
  5. package/src/index.js.map +1 -1
  6. package/src/plugins/balancer/helpers/pools.js +21 -21
  7. package/src/plugins/banx/calculateLoanRepayValue.d.ts +4 -0
  8. package/src/plugins/banx/calculateLoanRepayValue.js +37 -0
  9. package/src/plugins/banx/calculateLoanRepayValue.js.map +1 -0
  10. package/src/plugins/banx/collectionsJob.d.ts +3 -0
  11. package/src/plugins/banx/collectionsJob.js +40 -0
  12. package/src/plugins/banx/collectionsJob.js.map +1 -0
  13. package/src/plugins/banx/constants.d.ts +8 -0
  14. package/src/plugins/banx/constants.js +13 -1
  15. package/src/plugins/banx/constants.js.map +1 -1
  16. package/src/plugins/banx/filters.d.ts +2 -0
  17. package/src/plugins/banx/filters.js +26 -1
  18. package/src/plugins/banx/filters.js.map +1 -1
  19. package/src/plugins/banx/idl.d.ts +115 -0
  20. package/src/plugins/banx/idl.js +2256 -0
  21. package/src/plugins/banx/idl.js.map +1 -0
  22. package/src/plugins/banx/index.js +9 -2
  23. package/src/plugins/banx/index.js.map +1 -1
  24. package/src/plugins/banx/loansFetcher.d.ts +3 -0
  25. package/src/plugins/banx/loansFetcher.js +158 -0
  26. package/src/plugins/banx/loansFetcher.js.map +1 -0
  27. package/src/plugins/banx/offersFetcher.d.ts +3 -0
  28. package/src/plugins/banx/offersFetcher.js +99 -0
  29. package/src/plugins/banx/offersFetcher.js.map +1 -0
  30. package/src/plugins/banx/types.d.ts +200 -0
  31. package/src/plugins/citrus/collectionsJob.d.ts +3 -0
  32. package/src/plugins/citrus/collectionsJob.js +40 -0
  33. package/src/plugins/citrus/collectionsJob.js.map +1 -0
  34. package/src/plugins/citrus/constants.d.ts +12 -0
  35. package/src/plugins/citrus/constants.js +26 -0
  36. package/src/plugins/citrus/constants.js.map +1 -0
  37. package/src/plugins/citrus/filters.d.ts +2 -0
  38. package/src/plugins/citrus/filters.js +32 -0
  39. package/src/plugins/citrus/filters.js.map +1 -0
  40. package/src/plugins/citrus/idl.d.ts +73 -0
  41. package/src/plugins/citrus/idl.js +292 -0
  42. package/src/plugins/citrus/idl.js.map +1 -0
  43. package/src/plugins/citrus/index.d.ts +6 -0
  44. package/src/plugins/citrus/index.js +13 -0
  45. package/src/plugins/citrus/index.js.map +1 -0
  46. package/src/plugins/citrus/loansFetcher.d.ts +3 -0
  47. package/src/plugins/citrus/loansFetcher.js +150 -0
  48. package/src/plugins/citrus/loansFetcher.js.map +1 -0
  49. package/src/plugins/citrus/types.d.ts +54 -0
  50. package/src/plugins/citrus/types.js +3 -0
  51. package/src/plugins/citrus/types.js.map +1 -0
  52. package/src/plugins/raydium/clmmJob.js +4 -2
  53. package/src/plugins/raydium/clmmJob.js.map +1 -1
  54. package/src/plugins/sharky/collectionsJob.d.ts +3 -0
  55. package/src/plugins/sharky/collectionsJob.js +75 -0
  56. package/src/plugins/sharky/collectionsJob.js.map +1 -0
  57. package/src/plugins/sharky/constants.d.ts +12 -0
  58. package/src/plugins/sharky/constants.js +26 -0
  59. package/src/plugins/sharky/constants.js.map +1 -0
  60. package/src/plugins/sharky/filters.d.ts +6 -0
  61. package/src/plugins/sharky/filters.js +43 -0
  62. package/src/plugins/sharky/filters.js.map +1 -0
  63. package/src/plugins/sharky/idl.d.ts +135 -0
  64. package/src/plugins/sharky/idl.js +388 -0
  65. package/src/plugins/sharky/idl.js.map +1 -0
  66. package/src/plugins/sharky/index.d.ts +6 -0
  67. package/src/plugins/sharky/index.js +13 -0
  68. package/src/plugins/sharky/index.js.map +1 -0
  69. package/src/plugins/sharky/loansFetcher.d.ts +3 -0
  70. package/src/plugins/sharky/loansFetcher.js +141 -0
  71. package/src/plugins/sharky/loansFetcher.js.map +1 -0
  72. package/src/plugins/sharky/types.d.ts +66 -0
  73. package/src/plugins/sharky/types.js +11 -0
  74. package/src/plugins/sharky/types.js.map +1 -0
  75. package/src/plugins/sushiswap/helpers.js +24 -24
  76. package/src/plugins/uniswap-v2/helpers.js +22 -22
  77. package/src/utils/sei/constants.js +8 -8
  78. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  79. package/src/utils/solana/das/getAssetBatchDas.d.ts +4 -0
  80. package/src/utils/solana/das/getAssetBatchDas.js +68 -0
  81. package/src/utils/solana/das/getAssetBatchDas.js.map +1 -0
  82. package/src/utils/solana/das/heliusAssetToAssetCollectible.d.ts +7 -1
  83. package/src/utils/solana/das/heliusAssetToAssetCollectible.js +13 -9
  84. package/src/utils/solana/das/heliusAssetToAssetCollectible.js.map +1 -1
  85. package/src/utils/solana/das/types.d.ts +5 -0
  86. package/src/utils/solana/getAutoParsedMultipleAccountsInfo.d.ts +4 -0
  87. package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js +33 -0
  88. package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js.map +1 -0
  89. package/src/utils/solana/getAutoParsedProgramAccounts.d.ts +4 -0
  90. package/src/utils/solana/getAutoParsedProgramAccounts.js +37 -0
  91. package/src/utils/solana/getAutoParsedProgramAccounts.js.map +1 -0
  92. package/src/utils/solana/getMultipleAccountsInfoSafe.d.ts +2 -2
  93. package/src/utils/solana/getMultipleAccountsInfoSafe.js +3 -3
  94. package/src/utils/solana/getMultipleAccountsInfoSafe.js.map +1 -1
  95. package/src/utils/solana/getParsedMultipleAccountsInfo.d.ts +2 -2
  96. package/src/utils/solana/getParsedMultipleAccountsInfo.js +2 -2
  97. package/src/utils/solana/getParsedMultipleAccountsInfo.js.map +1 -1
  98. package/src/utils/solana/index.d.ts +2 -0
  99. package/src/utils/solana/index.js +2 -0
  100. package/src/utils/solana/index.js.map +1 -1
@@ -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;
@@ -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 { RpcEndpoint } from '@sonarwatch/portfolio-core';
2
+ import { HeliusAsset } from './types';
3
+ export declare function getAssetBatchDas(dasEndpoint: RpcEndpoint, publicKeys: string[]): Promise<HeliusAsset[]>;
4
+ export declare function getAssetBatchDasAsMap(dasEndpoint: RpcEndpoint, publicKeys: string[]): Promise<Map<string, HeliusAsset>>;
@@ -0,0 +1,68 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.getAssetBatchDasAsMap = exports.getAssetBatchDas = void 0;
16
+ const axios_1 = __importDefault(require("axios"));
17
+ const getBasicAuthHeaders_1 = require("../../misc/getBasicAuthHeaders");
18
+ const MAX_MINTS = 1000;
19
+ function getAssetBatchDas(dasEndpoint, publicKeys) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ if (publicKeys.length <= MAX_MINTS) {
22
+ return getAssetBatchDasUnsafe(dasEndpoint, publicKeys);
23
+ }
24
+ const assetsInfo = [];
25
+ const publicKeysToFetch = [...publicKeys];
26
+ while (publicKeysToFetch.length !== 0) {
27
+ const currPublicKeysToFetch = publicKeysToFetch.splice(0, MAX_MINTS);
28
+ const accountsInfoRes = yield getAssetBatchDasUnsafe(dasEndpoint, currPublicKeysToFetch);
29
+ assetsInfo.push(...accountsInfoRes);
30
+ }
31
+ return assetsInfo;
32
+ });
33
+ }
34
+ exports.getAssetBatchDas = getAssetBatchDas;
35
+ function getAssetBatchDasAsMap(dasEndpoint, publicKeys) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ const assets = yield getAssetBatchDas(dasEndpoint, publicKeys);
38
+ const assetsMap = new Map();
39
+ assets.forEach((asset) => {
40
+ if (!asset)
41
+ return;
42
+ assetsMap.set(asset.id, asset);
43
+ });
44
+ return assetsMap;
45
+ });
46
+ }
47
+ exports.getAssetBatchDasAsMap = getAssetBatchDasAsMap;
48
+ function getAssetBatchDasUnsafe(dasEndpoint, publicKeys) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ if (publicKeys.length === 0)
51
+ return [];
52
+ const httpHeaders = dasEndpoint.basicAuth
53
+ ? (0, getBasicAuthHeaders_1.getBasicAuthHeaders)(dasEndpoint.basicAuth.username, dasEndpoint.basicAuth.password)
54
+ : undefined;
55
+ const res = yield axios_1.default.post(dasEndpoint.url, {
56
+ jsonrpc: '2.0',
57
+ id: Math.random().toString(),
58
+ method: 'getAssetBatch',
59
+ params: {
60
+ ids: publicKeys,
61
+ },
62
+ }, {
63
+ headers: Object.assign({ 'Content-Type': 'application/json' }, httpHeaders),
64
+ });
65
+ return res.data.result;
66
+ });
67
+ }
68
+ //# sourceMappingURL=getAssetBatchDas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAssetBatchDas.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/solana/das/getAssetBatchDas.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAA6C;AAE7C,wEAAqE;AAErE,MAAM,SAAS,GAAG,IAAI,CAAC;AAEvB,SAAsB,gBAAgB,CACpC,WAAwB,EACxB,UAAoB;;QAEpB,IAAI,UAAU,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;YACnC,OAAO,sBAAsB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QACzD,CAAC;QACD,MAAM,UAAU,GAAG,EAAE,CAAC;QACtB,MAAM,iBAAiB,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;QAC1C,OAAO,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;YACrE,MAAM,eAAe,GAAG,MAAM,sBAAsB,CAClD,WAAW,EACX,qBAAqB,CACtB,CAAC;YACF,UAAU,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,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'./types';
3
- export declare function heliusAssetToAssetCollectible(asset: HeliusAsset): PortfolioAssetCollectible | null;
3
+ export declare function heliusAssetToAssetCollectible(asset: HeliusAsset, props?: {
4
+ tags?: string[];
5
+ collection?: {
6
+ floorPrice?: number;
7
+ name?: string;
8
+ };
9
+ }): PortfolioAssetCollectible | null;
@@ -2,18 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.heliusAssetToAssetCollectible = void 0;
4
4
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
5
- function heliusAssetToAssetCollectible(asset) {
6
- var _a, _b, _c, _d;
5
+ function heliusAssetToAssetCollectible(asset, props) {
6
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
7
7
  // Tags
8
8
  const tags = [];
9
9
  if (asset.compression.compressed)
10
10
  tags.push('compressed');
11
11
  if (asset.inscription)
12
12
  tags.push('inscription');
13
+ if ((_a = props === null || props === void 0 ? void 0 : props.tags) === null || _a === void 0 ? void 0 : _a.length)
14
+ tags.push(...props.tags);
13
15
  let amount = 1;
14
16
  let collection;
15
- const decimals = (_a = asset.token_info) === null || _a === void 0 ? void 0 : _a.decimals;
16
- const balance = (_b = asset.token_info) === null || _b === void 0 ? void 0 : _b.balance;
17
+ const decimals = (_b = asset.token_info) === null || _b === void 0 ? void 0 : _b.decimals;
18
+ const balance = (_c = asset.token_info) === null || _c === void 0 ? void 0 : _c.balance;
17
19
  if (decimals !== undefined && decimals !== 0)
18
20
  return null;
19
21
  // Amount
@@ -41,9 +43,11 @@ function heliusAssetToAssetCollectible(asset) {
41
43
  const collectionGroup = asset.grouping.find((g) => g.group_key === 'collection');
42
44
  if (collectionGroup) {
43
45
  collection = {
44
- floorPrice: null,
46
+ floorPrice: (_e = (_d = props === null || props === void 0 ? void 0 : props.collection) === null || _d === void 0 ? void 0 : _d.floorPrice) !== null && _e !== void 0 ? _e : null,
45
47
  id: collectionGroup.group_value,
46
- name: ((_c = collectionGroup.collection_metadata) === null || _c === void 0 ? void 0 : _c.name) || (collection === null || collection === void 0 ? void 0 : collection.name),
48
+ name: ((_f = collectionGroup.collection_metadata) === null || _f === void 0 ? void 0 : _f.name) ||
49
+ (collection === null || collection === void 0 ? void 0 : collection.name) ||
50
+ ((_g = props === null || props === void 0 ? void 0 : props.collection) === null || _g === void 0 ? void 0 : _g.name),
47
51
  };
48
52
  }
49
53
  return {
@@ -54,15 +58,15 @@ function heliusAssetToAssetCollectible(asset) {
54
58
  data: {
55
59
  address: asset.id,
56
60
  amount,
57
- price: null,
61
+ price: (_j = (_h = props === null || props === void 0 ? void 0 : props.collection) === null || _h === void 0 ? void 0 : _h.floorPrice) !== null && _j !== void 0 ? _j : null,
58
62
  name: asset.content.metadata.name,
59
63
  dataUri: asset.content.json_uri,
60
- imageUri: (_d = asset.content.links) === null || _d === void 0 ? void 0 : _d.image,
64
+ imageUri: (_k = asset.content.links) === null || _k === void 0 ? void 0 : _k.image,
61
65
  attributes: asset.content.metadata.attributes,
62
66
  collection,
63
67
  },
64
68
  networkId: portfolio_core_1.NetworkId.solana,
65
- value: null,
69
+ value: (_m = (_l = props === null || props === void 0 ? void 0 : props.collection) === null || _l === void 0 ? void 0 : _l.floorPrice) !== null && _m !== void 0 ? _m : null,
66
70
  };
67
71
  }
68
72
  exports.heliusAssetToAssetCollectible = heliusAssetToAssetCollectible;
@@ -1 +1 @@
1
- {"version":3,"file":"heliusAssetToAssetCollectible.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/solana/das/heliusAssetToAssetCollectible.ts"],"names":[],"mappings":";;;AAAA,+DAKoC;AAGpC,SAAgB,6BAA6B,CAC3C,KAAkB;;IAElB,OAAO;IACP,MAAM,IAAI,GAAyB,EAAE,CAAC;IACtC,IAAI,KAAK,CAAC,WAAW,CAAC,UAAU;QAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1D,IAAI,KAAK,CAAC,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,aAAa,C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AE,eAAe,CAAC,WAAW;YAC/B,IAAI,EAAE,CAAA,MAAA,eAAe,CAAC,mBAAmB,0CAAE,IAAI,MAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,CAAA;SACpE,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,EAAE,mCAAkB,CAAC,WAAW;QACpC,UAAU,EAAE;YACV,IAAI,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;SACzC;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,KAAK,CAAC,EAAE;YACjB,MAAM;YACN,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI;YACjC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ;YAC/B,QAAQ,EAAE,MAAA,KAAK,CAAC,OAAO,CAAC,KAAK,0CAAE,KAAK;YACpC,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU;YAC7C,UAAU;SACX;QACD,SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,KAAK,EAAE,IAAI;KACZ,CAAC;AACJ,CAAC;AAjED,sEAiEC"}
1
+ {"version":3,"file":"heliusAssetToAssetCollectible.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/solana/das/heliusAssetToAssetCollectible.ts"],"names":[],"mappings":";;;AAAA,+DAKoC;AAGpC,SAAgB,6BAA6B,CAC3C,KAAkB,EAClB,KAGC;;IAED,OAAO;IACP,MAAM,IAAI,GAAyB,EAAE,CAAC;IACtC,IAAI,KAAK,CAAC,WAAW,CAAC,UAAU;QAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1D,IAAI,KAAK,CAAC,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAEhD,IAAI,MAAA,KAAK,aAAL,KAAK,uBAAL,KAA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List;
12
12
  id: string;
13
13
  };
14
+ export type GetAssetBatchOutput = {
15
+ jsonrpc: string;
16
+ result: HeliusAsset[];
17
+ id: string;
18
+ };
14
19
  export type HeliusAssetList = {
15
20
  total: number;
16
21
  limit: number;
@@ -0,0 +1,4 @@
1
+ import { Commitment, Connection, GetMultipleAccountsConfig, PublicKey } from '@solana/web3.js';
2
+ import { IdlItem } from '@solanafm/explorer-kit-idls';
3
+ import { ParsedAccount } from './types';
4
+ export declare function getAutoParsedMultipleAccountsInfo<T>(connection: Connection, idlItem: IdlItem, publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<(ParsedAccount<T> | null)[]>;
@@ -0,0 +1,33 @@
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.getAutoParsedMultipleAccountsInfo = void 0;
13
+ const explorer_kit_1 = require("@solanafm/explorer-kit");
14
+ const getMultipleAccountsInfoSafe_1 = require("./getMultipleAccountsInfoSafe");
15
+ function getAutoParsedMultipleAccountsInfo(connection, idlItem, publicKeys, commitmentOrConfig) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ const parser = new explorer_kit_1.SolanaFMParser(idlItem, idlItem.programId.toString());
18
+ const eventParser = parser.createParser(explorer_kit_1.ParserType.ACCOUNT);
19
+ if (!eventParser || !(0, explorer_kit_1.checkIfAccountParser)(eventParser))
20
+ return [];
21
+ const accountsInfo = yield (0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(connection, publicKeys, commitmentOrConfig);
22
+ return accountsInfo.map((accountInfo, i) => {
23
+ if (!accountInfo)
24
+ return null;
25
+ const parsedAccount = eventParser.parseAccount(accountInfo.data.toString('base64'));
26
+ if (parsedAccount === null)
27
+ return null;
28
+ return Object.assign({ pubkey: publicKeys[i], lamports: accountInfo.lamports }, parsedAccount.data);
29
+ });
30
+ });
31
+ }
32
+ exports.getAutoParsedMultipleAccountsInfo = getAutoParsedMultipleAccountsInfo;
33
+ //# sourceMappingURL=getAutoParsedMultipleAccountsInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAutoParsedMultipleAccountsInfo.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/getAutoParsedMultipleAccountsInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,yDAIgC;AAChC,+EAA4E;AAG5E,SAAsB,iCAAiC,CACrD,UAAsB,EACtB,OAAgB,EAChB,UAAuB,EACvB,kBAA2D;;QAE3D,MAAM,MAAM,GAAG,IAAI,6BAAc,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzE,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,yBAAU,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,CAAC,WAAW,IAAI,CAAC,IAAA,mCAAoB,EAAC,WAAW,CAAC;YAAE,OAAO,EAAE,CAAC;QAElE,MAAM,YAAY,GAAG,MAAM,IAAA,yDAA2B,EACpD,UAAU,EACV,UAAU,EACV,kBAAkB,CACnB,CAAC;QAEF,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE;YACzC,IAAI,CAAC,WAAW;gBAAE,OAAO,IAAI,CAAC;YAE9B,MAAM,aAAa,GAAG,WAAW,CAAC,YAAY,CAC5C,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CACpC,CAAC;YACF,IAAI,aAAa,KAAK,IAAI;gBAAE,OAAO,IAAI,CAAC;YAExC,uBACE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EACrB,QAAQ,EAAE,WAAW,CAAC,QAAQ,IAC1B,aAAa,CAAC,IAAU,EAC5B;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AA/BD,8EA+BC"}
@@ -0,0 +1,4 @@
1
+ import { Connection, GetProgramAccountsFilter } from '@solana/web3.js';
2
+ import { IdlItem } from '@solanafm/explorer-kit-idls';
3
+ import { ParsedAccount } from './types';
4
+ export declare function getAutoParsedProgramAccounts<T>(connection: Connection, idlItem: IdlItem, filters?: GetProgramAccountsFilter[] | undefined, maxAccounts?: number): Promise<ParsedAccount<T>[]>;
@@ -0,0 +1,37 @@
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.getAutoParsedProgramAccounts = void 0;
13
+ const web3_js_1 = require("@solana/web3.js");
14
+ const explorer_kit_1 = require("@solanafm/explorer-kit");
15
+ const getProgramAccounts_1 = require("./getProgramAccounts");
16
+ function getAutoParsedProgramAccounts(connection, idlItem, filters = undefined, maxAccounts = -1) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ const parser = new explorer_kit_1.SolanaFMParser(idlItem, idlItem.programId.toString());
19
+ const eventParser = parser.createParser(explorer_kit_1.ParserType.ACCOUNT);
20
+ if (!eventParser || !(0, explorer_kit_1.checkIfAccountParser)(eventParser))
21
+ return [];
22
+ const accountsRes = yield (0, getProgramAccounts_1.getProgramAccounts)(connection, new web3_js_1.PublicKey(idlItem.programId), filters, maxAccounts);
23
+ return accountsRes
24
+ .map((accountRes) => {
25
+ try {
26
+ const parsedAccount = eventParser.parseAccount(accountRes.account.data.toString('base64'));
27
+ return Object.assign({ pubkey: accountRes.pubkey, lamports: accountRes.account.lamports }, parsedAccount === null || parsedAccount === void 0 ? void 0 : parsedAccount.data);
28
+ }
29
+ catch (err) {
30
+ return null;
31
+ }
32
+ })
33
+ .filter((acc) => acc !== null);
34
+ });
35
+ }
36
+ exports.getAutoParsedProgramAccounts = getAutoParsedProgramAccounts;
37
+ //# sourceMappingURL=getAutoParsedProgramAccounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAutoParsedProgramAccounts.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/getAutoParsedProgramAccounts.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAIyB;AACzB,yDAIgC;AAEhC,6DAA0D;AAG1D,SAAsB,4BAA4B,CAChD,UAAsB,EACtB,OAAgB,EAChB,UAAkD,SAAS,EAC3D,WAAW,GAAG,CAAC,CAAC;;QAEhB,MAAM,MAAM,GAAG,IAAI,6BAAc,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzE,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,yBAAU,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,CAAC,WAAW,IAAI,CAAC,IAAA,mCAAoB,EAAC,WAAW,CAAC;YAAE,OAAO,EAAE,CAAC;QAElE,MAAM,WAAW,GAAG,MAAM,IAAA,uCAAkB,EAC1C,UAAU,EACV,IAAI,mBAAS,CAAC,OAAO,CAAC,SAAS,CAAC,EAChC,OAAO,EACP,WAAW,CACZ,CAAC;QACF,OAAO,WAAW;aACf,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;YAClB,IAAI,CAAC;gBACH,MAAM,aAAa,GAAG,WAAW,CAAC,YAAY,CAC5C,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAC3C,CAAC;gBAEF,OAAO,gBACL,MAAM,EAAE,UAAU,CAAC,MAAM,EACzB,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,IAClC,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,CACH,CAAC;YACxB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,GAAG,EAA2B,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC;IAC5D,CAAC;CAAA;AAlCD,oEAkCC"}
@@ -1,3 +1,3 @@
1
1
  /// <reference types="node" />
2
- import { Connection, PublicKey } from '@solana/web3.js';
3
- export declare function getMultipleAccountsInfoSafe(connection: Connection, publicKeys: PublicKey[]): Promise<(import("@solana/web3.js").AccountInfo<Buffer> | null)[]>;
2
+ import { Commitment, Connection, GetMultipleAccountsConfig, PublicKey } from '@solana/web3.js';
3
+ export declare function getMultipleAccountsInfoSafe(connection: Connection, publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<(import("@solana/web3.js").AccountInfo<Buffer> | null)[]>;
@@ -11,16 +11,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.getMultipleAccountsInfoSafe = void 0;
13
13
  const MAX_ACCOUNT = 100;
14
- function getMultipleAccountsInfoSafe(connection, publicKeys) {
14
+ function getMultipleAccountsInfoSafe(connection, publicKeys, commitmentOrConfig) {
15
15
  return __awaiter(this, void 0, void 0, function* () {
16
16
  if (publicKeys.length <= MAX_ACCOUNT) {
17
- return connection.getMultipleAccountsInfo(publicKeys);
17
+ return connection.getMultipleAccountsInfo(publicKeys, commitmentOrConfig);
18
18
  }
19
19
  const accountsInfo = [];
20
20
  const publicKeysToFetch = [...publicKeys];
21
21
  while (publicKeysToFetch.length !== 0) {
22
22
  const currPublicKeysToFetch = publicKeysToFetch.splice(0, MAX_ACCOUNT);
23
- const accountsInfoRes = yield connection.getMultipleAccountsInfo(currPublicKeysToFetch);
23
+ const accountsInfoRes = yield connection.getMultipleAccountsInfo(currPublicKeysToFetch, commitmentOrConfig);
24
24
  accountsInfo.push(...accountsInfoRes);
25
25
  }
26
26
  return accountsInfo;
@@ -1 +1 @@
1
- {"version":3,"file":"getMultipleAccountsInfoSafe.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/getMultipleAccountsInfoSafe.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,SAAsB,2BAA2B,CAC/C,UAAsB,EACtB,UAAuB;;QAEvB,IAAI,UAAU,CAAC,MAAM,IAAI,WAAW,EAAE,CAAC;YACrC,OAAO,UAAU,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;QACxD,CAAC;QACD,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,MAAM,iBAAiB,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;QAC1C,OAAO,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;YACvE,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,uBAAuB,CAC9D,qBAAqB,CACtB,CAAC;YACF,YAAY,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;QACxC,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CAAA;AAjBD,kEAiBC"}
1
+ {"version":3,"file":"getMultipleAccountsInfoSafe.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/getMultipleAccountsInfoSafe.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,SAAsB,2BAA2B,CAC/C,UAAsB,EACtB,UAAuB,EACvB,kBAA2D;;QAE3D,IAAI,UAAU,CAAC,MAAM,IAAI,WAAW,EAAE,CAAC;YACrC,OAAO,UAAU,CAAC,uBAAuB,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;QAC5E,CAAC;QACD,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,MAAM,iBAAiB,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;QAC1C,OAAO,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;YACvE,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,uBAAuB,CAC9D,qBAAqB,EACrB,kBAAkB,CACnB,CAAC;YACF,YAAY,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;QACxC,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CAAA;AAnBD,kEAmBC"}
@@ -1,3 +1,3 @@
1
- import { Connection, PublicKey } from '@solana/web3.js';
1
+ import { Commitment, Connection, GetMultipleAccountsConfig, PublicKey } from '@solana/web3.js';
2
2
  import { GlobalBeetStruct, ParsedAccount } from './types';
3
- export declare function getParsedMultipleAccountsInfo<T>(connection: Connection, beetStruct: GlobalBeetStruct<T>, publicKeys: PublicKey[]): Promise<(ParsedAccount<T> | null)[]>;
3
+ export declare function getParsedMultipleAccountsInfo<T>(connection: Connection, beetStruct: GlobalBeetStruct<T>, publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<(ParsedAccount<T> | null)[]>;
@@ -11,9 +11,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.getParsedMultipleAccountsInfo = void 0;
13
13
  const getMultipleAccountsInfoSafe_1 = require("./getMultipleAccountsInfoSafe");
14
- function getParsedMultipleAccountsInfo(connection, beetStruct, publicKeys) {
14
+ function getParsedMultipleAccountsInfo(connection, beetStruct, publicKeys, commitmentOrConfig) {
15
15
  return __awaiter(this, void 0, void 0, function* () {
16
- const accountsInfo = yield (0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(connection, publicKeys);
16
+ const accountsInfo = yield (0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(connection, publicKeys, commitmentOrConfig);
17
17
  return accountsInfo.map((accountInfo, i) => accountInfo
18
18
  ? Object.assign({ pubkey: publicKeys[i] }, beetStruct.deserialize(accountInfo.data)[0])
19
19
  : null);
@@ -1 +1 @@
1
- {"version":3,"file":"getParsedMultipleAccountsInfo.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/getParsedMultipleAccountsInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+EAA4E;AAG5E,SAAsB,6BAA6B,CACjD,UAAsB,EACtB,UAA+B,EAC/B,UAAuB;;QAEvB,MAAM,YAAY,GAAG,MAAM,IAAA,yDAA2B,EACpD,UAAU,EACV,UAAU,CACX,CAAC;QACF,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,CACzC,WAAW;YACT,CAAC,CAAE,gBACC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,IAClB,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAC1B;YACxB,CAAC,CAAC,IAAI,CACT,CAAC;IACJ,CAAC;CAAA;AAjBD,sEAiBC"}
1
+ {"version":3,"file":"getParsedMultipleAccountsInfo.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/getParsedMultipleAccountsInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,+EAA4E;AAG5E,SAAsB,6BAA6B,CACjD,UAAsB,EACtB,UAA+B,EAC/B,UAAuB,EACvB,kBAA2D;;QAE3D,MAAM,YAAY,GAAG,MAAM,IAAA,yDAA2B,EACpD,UAAU,EACV,UAAU,EACV,kBAAkB,CACnB,CAAC;QACF,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,CACzC,WAAW;YACT,CAAC,CAAE,gBACC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,IAClB,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAC1B;YACxB,CAAC,CAAC,IAAI,CACT,CAAC;IACJ,CAAC;CAAA;AAnBD,sEAmBC"}
@@ -1,6 +1,8 @@
1
1
  export * from './beets/buffers';
2
2
  export * from './beets/numbers';
3
3
  export * from './constants';
4
+ export * from './getAutoParsedMultipleAccountsInfo';
5
+ export * from './getAutoParsedProgramAccounts';
4
6
  export * from './getParsedProgramAccounts';
5
7
  export * from './getParsedMultipleAccountsInfo';
6
8
  export * from './getProgramAccounts';
@@ -17,6 +17,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./beets/buffers"), exports);
18
18
  __exportStar(require("./beets/numbers"), exports);
19
19
  __exportStar(require("./constants"), exports);
20
+ __exportStar(require("./getAutoParsedMultipleAccountsInfo"), exports);
21
+ __exportStar(require("./getAutoParsedProgramAccounts"), exports);
20
22
  __exportStar(require("./getParsedProgramAccounts"), exports);
21
23
  __exportStar(require("./getParsedMultipleAccountsInfo"), exports);
22
24
  __exportStar(require("./getProgramAccounts"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,kDAAgC;AAChC,8CAA4B;AAC5B,6DAA2C;AAC3C,kEAAgD;AAChD,uDAAqC;AACrC,oDAAkC;AAClC,4CAA0B;AAC1B,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,kDAAgC;AAChC,8CAA4B;AAC5B,sEAAoD;AACpD,iEAA+C;AAC/C,6DAA2C;AAC3C,kEAAgD;AAChD,uDAAqC;AACrC,oDAAkC;AAClC,4CAA0B;AAC1B,0CAAwB"}