@sonarwatch/portfolio-plugins 0.12.188 → 0.12.190

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/CHANGELOG.md +1558 -1550
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/Fetcher.js +2 -0
  5. package/src/Fetcher.js.map +1 -1
  6. package/src/plugins/aave/index.js +4 -2
  7. package/src/plugins/aave/index.js.map +1 -1
  8. package/src/plugins/auxexchange/aptosLpJob.js +3 -3
  9. package/src/plugins/auxexchange/aptosLpJob.js.map +1 -1
  10. package/src/plugins/balancer/helpers/pools.js +21 -21
  11. package/src/plugins/bluefin/bankFetcher.js +2 -2
  12. package/src/plugins/bluefin/bankFetcher.js.map +1 -1
  13. package/src/plugins/bluefin/poolFetcher.js +3 -3
  14. package/src/plugins/bluefin/poolFetcher.js.map +1 -1
  15. package/src/plugins/bluefin/positionFetcher.js +1 -1
  16. package/src/plugins/bluefin/positionFetcher.js.map +1 -1
  17. package/src/plugins/bluemove/poolsJob.js +18 -11
  18. package/src/plugins/bluemove/poolsJob.js.map +1 -1
  19. package/src/plugins/clone/index.js +8 -7
  20. package/src/plugins/clone/index.js.map +1 -1
  21. package/src/plugins/deepbook/constants.js +2 -1
  22. package/src/plugins/deepbook/constants.js.map +1 -1
  23. package/src/plugins/liquiditypools-sei/job.js +3 -3
  24. package/src/plugins/liquiditypools-sei/job.js.map +1 -1
  25. package/src/plugins/orca/lpTokensJob.js +2 -2
  26. package/src/plugins/orca/lpTokensJob.js.map +1 -1
  27. package/src/plugins/sushiswap/helpers.js +24 -24
  28. package/src/plugins/uniswap-v2/helpers.js +22 -22
  29. package/src/plugins/zeta/airdropFetcher.js +14 -14
  30. package/src/utils/clmm/tokenPricesFromSqrt.js +7 -3
  31. package/src/utils/clmm/tokenPricesFromSqrt.js.map +1 -1
  32. package/src/utils/misc/MemoizedCache.d.ts +2 -1
  33. package/src/utils/misc/MemoizedCache.js +7 -2
  34. package/src/utils/misc/MemoizedCache.js.map +1 -1
  35. package/src/utils/misc/checkComputeAndStoreTokensPrices.js +3 -3
  36. package/src/utils/misc/checkComputeAndStoreTokensPrices.js.map +1 -1
  37. package/src/utils/misc/{getDecimalsForToken.d.ts → getCachedDecimalsForToken.d.ts} +5 -2
  38. package/src/utils/misc/{getDecimalsForToken.js → getCachedDecimalsForToken.js} +30 -12
  39. package/src/utils/misc/getCachedDecimalsForToken.js.map +1 -0
  40. package/src/utils/misc/getLpUnderlyingTokenSource.js +2 -1
  41. package/src/utils/misc/getLpUnderlyingTokenSource.js.map +1 -1
  42. package/src/utils/sei/constants.js +8 -8
  43. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  44. package/src/utils/sui/constants.d.ts +2 -1
  45. package/src/utils/sui/constants.js +3 -2
  46. package/src/utils/sui/constants.js.map +1 -1
  47. package/src/utils/misc/getDecimalsForToken.js.map +0 -1
@@ -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* () {
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.sqrtPriceX64ToPrice = void 0;
16
16
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
17
  const decimal_js_1 = __importDefault(require("decimal.js"));
18
- const getDecimalsForToken_1 = require("../misc/getDecimalsForToken");
18
+ const getCachedDecimalsForToken_1 = require("../misc/getCachedDecimalsForToken");
19
19
  const constants_1 = require("../../plugins/tokens/constants");
20
20
  const getSourceWeight_1 = __importDefault(require("../misc/getSourceWeight"));
21
21
  const computeAndStoreLpPrice_1 = require("../misc/computeAndStoreLpPrice");
@@ -34,8 +34,12 @@ function storeTokenPricesFromSqrt(cache, networkId, source, reserveX, reserveY,
34
34
  const [tokenPriceX, tokenPriceY] = yield cache.getTokenPrices([mintX, mintY], networkId);
35
35
  if (!tokenPriceX && !tokenPriceY)
36
36
  return undefined;
37
- const decimalsX = tempDecimalsX || (yield (0, getDecimalsForToken_1.getDecimalsForToken)(cache, mintX, networkId));
38
- const decimalsY = tempDecimalsY || (yield (0, getDecimalsForToken_1.getDecimalsForToken)(cache, mintY, networkId));
37
+ const decimalsX = tempDecimalsX ||
38
+ (tokenPriceX === null || tokenPriceX === void 0 ? void 0 : tokenPriceX.decimals) ||
39
+ (yield (0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, mintX, networkId));
40
+ const decimalsY = tempDecimalsY ||
41
+ (tokenPriceY === null || tokenPriceY === void 0 ? void 0 : tokenPriceY.decimals) ||
42
+ (yield (0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, mintY, networkId));
39
43
  if (!decimalsX || !decimalsY)
40
44
  return undefined;
41
45
  const xToYPrice = sqrtPriceX64ToPrice(sqrtPrice, decimalsX, decimalsY);
@@ -1 +1 @@
1
- {"version":3,"file":"tokenPricesFromSqrt.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clmm/tokenPricesFromSqrt.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAIoC;AAEpC,4DAAiC;AAEjC,qEAAkE;AAClE,8DAAsE;AACtE,8EAAsD;AACtD,2EAAkE;AAClE,mFAA0E;AAE1E,SAA8B,wBAAwB,CACpD,KAAY,EACZ,SAAwB,EACxB,MAAc,EACd,QAAmB,EACnB,QAAmB,EACnB,SAAoB,EACpB,KAAa,EACb,KAAa,EACb,aAAsB,EACtB,aAAsB;;;QAEtB,MAAM,WAAW,GACf,MAAA,MAAA,iDAAoB;aACjB,GAAG,CAAC,SAAS,CAAC,0CACb,QAAQ,CAAC,IAAA,mCAAkB,EAAC,KAAK,EAAE,SAAS,CAAC,CAAC,mCAAI,KAAK,CAAC;QAC9D,MAAM,WAAW,GACf,MAAA,MAAA,iDAAoB;aACjB,GAAG,CAAC,SAAS,CAAC,0CACb,QAAQ,CAAC,IAAA,mCAAkB,EAAC,KAAK,EAAE,SAAS,CAAC,CAAC,mCAAI,KAAK,CAAC;QAC9D,IAAI,CA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AAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAExE,SAAgB,mBAAmB,CACjC,YAAuB,EACvB,SAAiB,EACjB,SAAiB;IAEjB,OAAO,cAAc,CAAC,IAAI,oBAAO,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxD,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,oBAAO,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;AACjD,CAAC;AARD,kDAQC"}
1
+ {"version":3,"file":"tokenPricesFromSqrt.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clmm/tokenPricesFromSqrt.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAIoC;AAEpC,4DAAiC;AAEjC,iFAA8E;AAC9E,8DAAsE;AACtE,8EAAsD;AACtD,2EAAkE;AAClE,mFAA0E;AAE1E,SAA8B,wBAAwB,CACpD,KAAY,EACZ,SAAwB,EACxB,MAAc,EACd,QAAmB,EACnB,QAAmB,EACnB,SAAoB,EACpB,KAAa,EACb,KAAa,EACb,aAAsB,EACtB,aAAsB;;;QAEtB,MAAM,WAAW,GACf,MAAA,MAAA,iDAAoB;aACjB,GAAG,CAAC,SAAS,CAAC,0CACb,QAAQ,CAAC,IAAA,mCAAkB,EAAC,KAAK,EAAE,SAAS,CAAC,CAAC,mCAAI,KAAK,CAAC;QAC9D,MAAM,WAAW,GACf,MAAA,MAAA,iDAAoB;aACjB,GAAG,CAAC,SAAS,CAAC,0CACb,QAAQ,CAAC,IAAA,mCAAkB,EAAC,KAAK,EAAE,SAAS,CAAC,CAAC,mCAAI,KAAK,CAAC;QAC9D,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW;YAAE,OAAO,SAAS,CAAC;QACnD,IAAI,WAAW,IAAI,WAAW;YAAE,OAAO,SAAS,CAAC;QAEjD,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,MAAM,KAAK,CAA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,mBAAmB,CACjC,YAAuB,EACvB,SAAiB,EACjB,SAAiB;IAEjB,OAAO,cAAc,CAAC,IAAI,oBAAO,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxD,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,oBAAO,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;AACjD,CAAC;AARD,kDAQC"}
@@ -5,8 +5,9 @@ export declare class MemoizedCache<T extends StorageValue, K = T> {
5
5
  private readonly opts;
6
6
  private readonly transform;
7
7
  private readonly ttl;
8
+ private readonly fetch;
8
9
  private item;
9
10
  private lastUpdate;
10
- constructor(key: string, opts: TransactionOptions, transform?: (i: T | undefined) => K, ttl?: number);
11
+ constructor(key: string, opts: TransactionOptions, transform?: (i: T | undefined) => K, ttl?: number, fetch?: () => Promise<T>);
11
12
  getItem: (cache: Cache) => Promise<K>;
12
13
  }
@@ -14,11 +14,15 @@ const defaultMemoizedCacheRefreshInterval = 3600000;
14
14
  // T is the type of stored item in cache
15
15
  // K is the type of the item after transformation
16
16
  class MemoizedCache {
17
- constructor(key, opts, transform, ttl = defaultMemoizedCacheRefreshInterval) {
17
+ constructor(key, opts, transform, ttl = defaultMemoizedCacheRefreshInterval, fetch) {
18
18
  this.getItem = (cache) => __awaiter(this, void 0, void 0, function* () {
19
19
  const now = Date.now();
20
20
  if (!this.item || this.lastUpdate + this.ttl < now) {
21
- const rawItem = yield cache.getItem(this.key, this.opts);
21
+ let rawItem = yield cache.getItem(this.key, this.opts);
22
+ if (!rawItem && this.fetch) {
23
+ rawItem = yield this.fetch();
24
+ yield cache.setItem(this.key, rawItem, this.opts);
25
+ }
22
26
  this.item = this.transform ? this.transform(rawItem) : rawItem;
23
27
  this.lastUpdate = now;
24
28
  }
@@ -29,6 +33,7 @@ class MemoizedCache {
29
33
  this.transform = transform;
30
34
  this.ttl = ttl;
31
35
  this.lastUpdate = 0;
36
+ this.fetch = fetch;
32
37
  }
33
38
  }
34
39
  exports.MemoizedCache = MemoizedCache;
@@ -1 +1 @@
1
- {"version":3,"file":"MemoizedCache.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/MemoizedCache.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,MAAM,mCAAmC,GAAG,OAAO,CAAC;AAEpD,wCAAwC;AACxC,iDAAiD;AACjD,MAAa,aAAa;IASxB,YACE,GAAW,EACX,IAAwB,EACxB,SAAmC,EACnC,MAAc,mCAAmC;QASnD,YAAO,GAAG,CAAO,KAAY,EAAE,EAAE;YAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAEvB,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;gBACnD,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,CAAI,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC5D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,OAAa,CAAC;gBACtE,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;YACxB,CAAC;YAED,OAAO,IAAI,CAAC,IAAI,CAAC;QACnB,CAAC,CAAA,CAAC;QAjBA,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IACtB,CAAC;CAaF;AAjCD,sCAiCC"}
1
+ {"version":3,"file":"MemoizedCache.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/MemoizedCache.ts"],"names":[],"mappings":";;;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B,CAAC;CAmBF;AA1CD,sCA0CC"}
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.tokensToRelyOnByNetwork = void 0;
16
16
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
17
  const getSourceWeight_1 = __importDefault(require("./getSourceWeight"));
18
- const getDecimalsForToken_1 = require("./getDecimalsForToken");
18
+ const getCachedDecimalsForToken_1 = require("./getCachedDecimalsForToken");
19
19
  const constants_1 = require("../../plugins/tokens/constants");
20
20
  const solana_1 = require("../solana");
21
21
  /**
@@ -114,7 +114,7 @@ function checkComputeAndStoreTokensPrices(cache, source, networkId, tokenX, toke
114
114
  decimalsTokenX = tokenPriceX.decimals;
115
115
  }
116
116
  else {
117
- decimalsTokenX = yield (0, getDecimalsForToken_1.getDecimalsForToken)(cache, tokenX.mint, networkId);
117
+ decimalsTokenX = yield (0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, tokenX.mint, networkId);
118
118
  }
119
119
  let decimalsTokenY;
120
120
  if (tokenY.decimal) {
@@ -124,7 +124,7 @@ function checkComputeAndStoreTokensPrices(cache, source, networkId, tokenX, toke
124
124
  decimalsTokenY = tokenPriceY.decimals;
125
125
  }
126
126
  else {
127
- decimalsTokenY = yield (0, getDecimalsForToken_1.getDecimalsForToken)(cache, tokenY.mint, networkId);
127
+ decimalsTokenY = yield (0, getCachedDecimalsForToken_1.getCachedDecimalsForToken)(cache, tokenY.mint, networkId);
128
128
  }
129
129
  if (decimalsTokenX === null || decimalsTokenY === null)
130
130
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"checkComputeAndStoreTokensPrices.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/checkComputeAndStoreTokensPrices.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAMoC;AAGpC,wEAAgD;AAChD,+DAA4D;AAC5D,8DAAsE;AACtE,sCAA2C;AAe3C;;;;;;;;;GASG;AACU,QAAA,uBAAuB,G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CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;YACxD,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;YAC5C,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC;YAC/D,IAAI,QAAQ,KAAK,SAAS;gBAAE,OAAO,SAAS,CAAC;YAE7C,MAAM,oBAAoB,GAAqB;gBAC7C,EAAE,EAAE,MAAM;gBACV,MAAM;gBACN,OAAO;gBACP,SAAS;gBACT,UAAU,EAAE,gCAAoB,CAAC,EAAE;gBACnC,QAAQ;gBACR,KAAK;gBACL,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACtB,CAAC;YAEF,uBAAuB,GAAG;gBACxB,SAAS;gBACT,OAAO,EAAE,MAAM,CAAC,IAAI;gBACpB,QAAQ,EAAE,cAAc;gBACxB,KAAK,EAAE,MAAM;aACd,CAAC;YAEF,uBAAuB,GAAG;gBACxB,SAAS;gBACT,OAAO,EAAE,MAAM,CAAC,IAAI;gBACpB,QAAQ,EAAE,cAAc;gBACxB,KAAK,EAAE,MAAM;aACd,CAAC;YAEF,MAAM,KAAK,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;YACtD,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,CAAC;QAC9D,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CAAA;AApID,mDAoIC"}
1
+ {"version":3,"file":"checkComputeAndStoreTokensPrices.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/checkComputeAndStoreTokensPrices.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAMoC;AAGpC,wEAAgD;AAChD,2EAAwE;AACxE,8DAAsE;AACtE,sCAA2C;AAe3C;;;;;;;;;GASG;AACU,QAAA,uBAAuB,GAAiC,IAAI,GAAG,CAAC;IAC3E;QACE,0BAAS,CAAC,GAAG;QACb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CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;YAC5C,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC;YAC/D,IAAI,QAAQ,KAAK,SAAS;gBAAE,OAAO,SAAS,CAAC;YAE7C,MAAM,oBAAoB,GAAqB;gBAC7C,EAAE,EAAE,MAAM;gBACV,MAAM;gBACN,OAAO;gBACP,SAAS;gBACT,UAAU,EAAE,gCAAoB,CAAC,EAAE;gBACnC,QAAQ;gBACR,KAAK;gBACL,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACtB,CAAC;YAEF,uBAAuB,GAAG;gBACxB,SAAS;gBACT,OAAO,EAAE,MAAM,CAAC,IAAI;gBACpB,QAAQ,EAAE,cAAc;gBACxB,KAAK,EAAE,MAAM;aACd,CAAC;YAEF,uBAAuB,GAAG;gBACxB,SAAS;gBACT,OAAO,EAAE,MAAM,CAAC,IAAI;gBACpB,QAAQ,EAAE,cAAc;gBACxB,KAAK,EAAE,MAAM;aACd,CAAC;YAEF,MAAM,KAAK,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;YACtD,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,CAAC;QAC9D,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CAAA;AA5ID,mDA4IC"}
@@ -1,5 +1,7 @@
1
1
  import { NetworkIdType } from '@sonarwatch/portfolio-core';
2
2
  import { Cache } from '../../Cache';
3
+ type Decimal = number | null;
4
+ export declare function getDecimalsForToken(address: string, networkId: NetworkIdType): Promise<Decimal>;
3
5
  /**
4
6
  * Return the decimals of a token on any network using RPC calls or TokenList.
5
7
  *
@@ -7,6 +9,7 @@ import { Cache } from '../../Cache';
7
9
  * @param address The mint/address of the token.
8
10
  * @param networkId The network on which to execute the request.
9
11
  *
10
- * @returns The number of decimals or undefined if unsucessful request.
12
+ * @returns The number of decimals or undefined if unsuccessful request.
11
13
  */
12
- export declare function getDecimalsForToken(cache: Cache, address: string, networkId: NetworkIdType): Promise<number | null>;
14
+ export declare function getCachedDecimalsForToken(cache: Cache, address: string, networkId: NetworkIdType): Promise<Decimal>;
15
+ export {};
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getDecimalsForToken = void 0;
12
+ exports.getCachedDecimalsForToken = exports.getDecimalsForToken = void 0;
13
13
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
14
14
  const web3_js_1 = require("@solana/web3.js");
15
15
  const core_1 = require("@sei-js/core");
@@ -19,16 +19,10 @@ const sei_1 = require("../sei");
19
19
  const getDecimals_1 = require("../aptos/getDecimals");
20
20
  const getDecimals_2 = require("../solana/getDecimals");
21
21
  const getDecimals_3 = require("../sui/getDecimals");
22
- /**
23
- * Return the decimals of a token on any network using RPC calls or TokenList.
24
- *
25
- * @param cache Cache where to look for decimals
26
- * @param address The mint/address of the token.
27
- * @param networkId The network on which to execute the request.
28
- *
29
- * @returns The number of decimals or undefined if unsucessful request.
30
- */
31
- function getDecimalsForToken(cache, address, networkId) {
22
+ const MemoizedCache_1 = require("./MemoizedCache");
23
+ const ttl = 60 * 60 * 24;
24
+ const decimalsMemo = new Map();
25
+ function getDecimalsForToken(address, networkId) {
32
26
  return __awaiter(this, void 0, void 0, function* () {
33
27
  switch (networkId) {
34
28
  case 'aptos': {
@@ -69,4 +63,28 @@ function getDecimalsForToken(cache, address, networkId) {
69
63
  });
70
64
  }
71
65
  exports.getDecimalsForToken = getDecimalsForToken;
72
- //# sourceMappingURL=getDecimalsForToken.js.map
66
+ /**
67
+ * Return the decimals of a token on any network using RPC calls or TokenList.
68
+ *
69
+ * @param cache Cache where to look for decimals
70
+ * @param address The mint/address of the token.
71
+ * @param networkId The network on which to execute the request.
72
+ *
73
+ * @returns The number of decimals or undefined if unsuccessful request.
74
+ */
75
+ function getCachedDecimalsForToken(cache, address, networkId) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ const key = `${networkId}-${(0, portfolio_core_1.formatTokenAddress)(address, networkId)}`;
78
+ let decimalMemo = decimalsMemo.get(key);
79
+ if (!decimalMemo) {
80
+ decimalMemo = new MemoizedCache_1.MemoizedCache((0, portfolio_core_1.formatTokenAddress)(address, networkId), {
81
+ prefix: 'decimalsfortoken',
82
+ networkId,
83
+ }, undefined, ttl, () => __awaiter(this, void 0, void 0, function* () { return getDecimalsForToken(address, networkId); }));
84
+ decimalsMemo.set(key, decimalMemo);
85
+ }
86
+ return decimalMemo.getItem(cache);
87
+ });
88
+ }
89
+ exports.getCachedDecimalsForToken = getCachedDecimalsForToken;
90
+ //# sourceMappingURL=getCachedDecimalsForToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCachedDecimalsForToken.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getCachedDecimalsForToken.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAIoC;AACpC,6CAA4C;AAC5C,uCAAiD;AACjD,wCAKoB;AACpB,oDAAsD;AACtD,gCAAsD;AAEtD,sDAAuE;AACvE,uDAAyE;AACzE,oDAAmE;AACnE,mDAAgD;AAGhD,MAAM,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEzB,MAAM,YAAY,GAAwC,IAAI,GAAG,EAAE,CAAC;AAEpE,SAAsB,mBAAmB,CACvC,OAAe,EACf,SAAwB;;QAExB,QAAQ,SAAS,EAAE,CAAC;YAClB,KAAK,OAAO,CAAC,CAAC,CAAC;gBACb,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;gBAChC,OAAO,IAAA,yBAAgB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC3C,CAAC;YACD,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACd,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;gBACjC,OAA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;QACnE,CAAC;IACH,CAAC;CAAA;AA3CD,kDA2CC;AAED;;;;;;;;GAQG;AACH,SAAsB,yBAAyB,CAC7C,KAAY,EACZ,OAAe,EACf,SAAwB;;QAExB,MAAM,GAAG,GAAG,GAAG,SAAS,IAAI,IAAA,mCAAkB,EAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;QAErE,IAAI,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAExC,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,IAAI,6BAAa,CAC7B,IAAA,mCAAkB,EAAC,OAAO,EAAE,SAAS,CAAC,EACtC;gBACE,MAAM,EAAE,kBAAkB;gBAC1B,SAAS;aACV,EACD,SAAS,EACT,GAAG,EACH,GAAS,EAAE,gDAAC,OAAA,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA,GAAA,CACpD,CAAC;YACF,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QACrC,CAAC;QAED,OAAO,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAxBD,8DAwBC"}
@@ -41,8 +41,9 @@ exports.defaultAcceptedPairs = new Map([
41
41
  [
42
42
  portfolio_core_1.suiNativeAddress,
43
43
  '0x2::sui::SUI',
44
- constants_2.usdcSuiType, // USDCet
44
+ constants_2.wUsdcSuiType, // USDCet
45
45
  '0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN', // USDCet
46
+ constants_2.usdcSuiType, // native USDC
46
47
  ].map((a) => (0, portfolio_core_1.formatTokenAddress)(a, portfolio_core_1.NetworkId.sui)),
47
48
  ],
48
49
  ]);
@@ -1 +1 @@
1
- {"version":3,"file":"getLpUnderlyingTokenSource.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getLpUnderlyingTokenSource.ts"],"names":[],"mappings":";;;;;;AAAA,+DAYoC;AAC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,CAAC,aAAa,CAAC;QAEnE,MAAM,MAAM,GAAqB;YAC/B,EAAE,EAAE,QAAQ;YACZ,SAAS;YACT,UAAU,EAAE,gCAAoB,CAAC,EAAE;YACnC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;YACtB,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,KAAK;YACL,MAAM,EAAE,IAAA,yBAAe,EAAC,iBAAiB,CAAC;YAC1C,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,aAAa;YACb,WAAW;SACZ,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAnFD,gEAmFC"}
1
+ {"version":3,"file":"getLpUnderlyingTokenSource.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getLpUnderlyingTokenSource.ts"],"names":[],"mappings":";;;;;;AAAA,+DAYoC;AACpC,8DAAsE;AACtE,wEAAgD;AAChD,gDAA6D;AAC7D,2CAAkD;AAClD,sCAA2C;AAE9B,QAAA,oBAAoB,GAAG,IAAI,GAAG,CAA0B;IACnE;QACE,0BAAS,CAAC,GAAG;QACb;YACE,iCAAgB;YAChB,sEAAsE,EAAE,OAAO;YAC/E,qHAAqH,EAAE,SAAS;SACjI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,mCAAkB,EAAC,CAAC,EAAE,0BAAS,CAAC,GAAG,CAAC,CAAC;KACnD;IACD;QACE,0BAAS,CAAC,MAAM;QAChB;YACE,oCAAmB;YACnB,2CAA0B;YAC1B,uBAAc,EAAE,OAAO;YACvB,8CAA8C,EAAE,OAAO;SACxD,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,mCAAkB,EAAC,CAAC,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;KACtD;IACD;QACE,0BAAS,CAAC,KAAK;QACf;YACE,mCAAkB;YAClB,6EA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M,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,uBAAuB,KAAK,UAAU,CAAC,CAAC,CAAC;YAAE,SAAS;QACxD,IAAI,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAAE,SAAS;QACpD,IACE,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,kCAAiB,CAAC;YAE5D,SAAS;QAEX,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,CAAC,MAAM,IAAI,eAAe,CAAC,MAAM;YACpC,YAAY,GAAG,CAAC,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;QACnD,MAAM,KAAK,GAAG,CAAC,YAAY,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC;QAEnE,MAAM,MAAM,GAAqB;YAC/B,EAAE,EAAE,QAAQ;YACZ,SAAS;YACT,UAAU,EAAE,gCAAoB,CAAC,EAAE;YACnC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;YACtB,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,KAAK;YACL,MAAM,EAAE,IAAA,yBAAe,EAAC,iBAAiB,CAAC;YAC1C,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,aAAa;YACb,WAAW;SACZ,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAnFD,gEAmFC"}
@@ -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;
@@ -1,3 +1,4 @@
1
1
  export declare const kioskItemType = "0x2::kiosk::Item";
2
2
  export declare const obKioskStructType = "0x95a441d389b07437d00dd07e0b6f05f513d7659b13fd7c5d3923c7d9d847199b::ob_kiosk::OwnerToken";
3
- export declare const usdcSuiType = "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN";
3
+ export declare const wUsdcSuiType = "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN";
4
+ export declare const usdcSuiType = "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.usdcSuiType = exports.obKioskStructType = exports.kioskItemType = void 0;
3
+ exports.usdcSuiType = exports.wUsdcSuiType = exports.obKioskStructType = exports.kioskItemType = void 0;
4
4
  exports.kioskItemType = '0x2::kiosk::Item';
5
5
  exports.obKioskStructType = '0x95a441d389b07437d00dd07e0b6f05f513d7659b13fd7c5d3923c7d9d847199b::ob_kiosk::OwnerToken';
6
- exports.usdcSuiType = '0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN';
6
+ exports.wUsdcSuiType = '0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN';
7
+ exports.usdcSuiType = '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC';
7
8
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/sui/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,kBAAkB,CAAC;AACnC,QAAA,iBAAiB,GAC5B,0FAA0F,CAAC;AAChF,QAAA,WAAW,GACtB,gFAAgF,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/sui/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,kBAAkB,CAAC;AACnC,QAAA,iBAAiB,GAC5B,0FAA0F,CAAC;AAChF,QAAA,YAAY,GACvB,gFAAgF,CAAC;AACtE,QAAA,WAAW,GACtB,gFAAgF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDecimalsForToken.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getDecimalsForToken.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAAsE;AACtE,6CAA4C;AAC5C,uCAAiD;AACjD,wCAKoB;AACpB,oDAAsD;AACtD,gCAAsD;AAEtD,sDAAuE;AACvE,uDAAyE;AACzE,oDAAmE;AAEnE;;;;;;;;GAQG;AACH,SAAsB,mBAAmB,CACvC,KAAY,EACZ,OAAe,EACf,SAAwB;;QAExB,QA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