@sonarwatch/portfolio-plugins 0.14.9 → 0.14.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/package.json +1 -1
  3. package/src/index.js +4 -0
  4. package/src/index.js.map +1 -1
  5. package/src/plugins/cetus/clmmsFetcher.js +59 -55
  6. package/src/plugins/cetus/clmmsFetcher.js.map +1 -1
  7. package/src/plugins/cetus/farmsFetcher.js +66 -37
  8. package/src/plugins/cetus/farmsFetcher.js.map +1 -1
  9. package/src/plugins/cetus/helpers.d.ts +3 -1
  10. package/src/plugins/cetus/helpers.js +102 -1
  11. package/src/plugins/cetus/helpers.js.map +1 -1
  12. package/src/plugins/cetus/types.d.ts +28 -0
  13. package/src/plugins/cetus/types.js.map +1 -1
  14. package/src/plugins/loverflow/airdropClaimFetcher.d.ts +3 -0
  15. package/src/plugins/loverflow/airdropClaimFetcher.js +42 -0
  16. package/src/plugins/loverflow/airdropClaimFetcher.js.map +1 -0
  17. package/src/plugins/loverflow/constants.d.ts +6 -0
  18. package/src/plugins/loverflow/constants.js +16 -0
  19. package/src/plugins/loverflow/constants.js.map +1 -0
  20. package/src/plugins/loverflow/helpers.d.ts +2 -0
  21. package/src/plugins/loverflow/helpers.js +9 -0
  22. package/src/plugins/loverflow/helpers.js.map +1 -0
  23. package/src/plugins/loverflow/index.d.ts +6 -0
  24. package/src/plugins/loverflow/index.js +12 -0
  25. package/src/plugins/loverflow/index.js.map +1 -0
  26. package/src/plugins/loverflow/structs.d.ts +16 -0
  27. package/src/plugins/loverflow/structs.js +18 -0
  28. package/src/plugins/loverflow/structs.js.map +1 -0
  29. package/src/plugins/loverflow/types.d.ts +5 -0
  30. package/src/plugins/loverflow/types.js +3 -0
  31. package/src/plugins/loverflow/types.js.map +1 -0
  32. package/src/utils/elementbuilder/AssetBuilder.d.ts +1 -1
  33. package/src/utils/elementbuilder/AssetBuilder.js +2 -2
  34. package/src/utils/elementbuilder/AssetBuilder.js.map +1 -1
  35. package/src/utils/elementbuilder/ElementBuilder.d.ts +2 -1
  36. package/src/utils/elementbuilder/ElementBuilder.js +5 -0
  37. package/src/utils/elementbuilder/ElementBuilder.js.map +1 -1
  38. package/src/utils/elementbuilder/LiquidityBuilder.js +1 -1
  39. package/src/utils/elementbuilder/LiquidityBuilder.js.map +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.14.10](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.9...plugins-0.14.10) (2024-10-18)
6
+
7
+
8
+
5
9
  ## [0.14.9](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.8...plugins-0.14.9) (2024-10-18)
6
10
 
7
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.14.9",
3
+ "version": "0.14.10",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
package/src/index.js CHANGED
@@ -148,6 +148,7 @@ const joule_1 = require("./plugins/joule");
148
148
  const meso_1 = require("./plugins/meso");
149
149
  const loopscale_1 = require("./plugins/loopscale");
150
150
  const vaultka_1 = require("./plugins/vaultka");
151
+ const loverflow_1 = require("./plugins/loverflow");
151
152
  const zelo_1 = require("./plugins/zelo");
152
153
  var constants_1 = require("./plugins/tokens/constants");
153
154
  Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
@@ -290,6 +291,7 @@ exports.platforms = [
290
291
  ...meso_1.platforms,
291
292
  ...loopscale_1.platforms,
292
293
  ...vaultka_1.platforms,
294
+ ...loverflow_1.platforms,
293
295
  ...zelo_1.platforms,
294
296
  ];
295
297
  // JOBS //
@@ -416,6 +418,7 @@ exports.jobs = [
416
418
  ...meso_1.jobs,
417
419
  ...loopscale_1.jobs,
418
420
  ...vaultka_1.jobs,
421
+ ...loverflow_1.jobs,
419
422
  ...zelo_1.jobs,
420
423
  ];
421
424
  // FETCHERS //
@@ -543,6 +546,7 @@ exports.fetchers = [
543
546
  ...meso_1.fetchers,
544
547
  ...loopscale_1.fetchers,
545
548
  ...vaultka_1.fetchers,
549
+ ...loverflow_1.fetchers,
546
550
  ...zelo_1.fetchers,
547
551
  ];
548
552
  exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,wEAAgD;AAChD,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAKyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEAIsC;AACtC,uDAI+B;AAC/B,mDAI6B;AAC7B,qDAG8B;AAC9B,uDAG+B;AAC/B,2CAIyB;AACzB,6CAK0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,+CAI2B;AAC3B,uDAG+B;AAC/B,yCAGwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,6CAI0B;AAC1B,+CAI2B;AAC3B,qDAG8B;AAC9B,iDAI4B;AAC5B,iDAI4B;AAC5B,mDAG6B;AAC7B,yCAIwB;AACxB,2CAIyB;AACzB,yCAIwB;AACxB,iDAI4B;AAC5B,+CAK2B;AAC3B,yCAIwB;AACxB,2CAIyB;AACzB,mDAI6B;AAC7B,2CAIyB;AACzB,2CAIyB;AAC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pB,GAAG,kBAAe;IAClB,GAAG,eAAY;CAChB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,GAAG,yBAAsB;IACzB,GAAG,wBAAqB;IACxB,GAAG,yBAAsB;IACzB,sBAAmB;IACnB,sBAAmB;IACnB,yBAAsB;IACtB,sBAAmB;IACnB,GAAG,0BAAuB;CAC3B,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,wEAAgD;AAChD,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAKyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEAIsC;AACtC,uDAI+B;AAC/B,mDAI6B;AAC7B,qDAG8B;AAC9B,uDAG+B;AAC/B,2CAIyB;AACzB,6CAK0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,+CAI2B;AAC3B,uDAG+B;AAC/B,yCAGwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,6CAI0B;AAC1B,+CAI2B;AAC3B,qDAG8B;AAC9B,iDAI4B;AAC5B,iDAI4B;AAC5B,mDAG6B;AAC7B,yCAIwB;AACxB,2CAIyB;AACzB,yCAIwB;AACxB,iDAI4B;AAC5B,+CAK2B;AAC3B,yCAIwB;AACxB,2CAIyB;AACzB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ACnB,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,oBAAiB;IACpB,GAAG,eAAY;CAChB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,GAAG,yBAAsB;IACzB,GAAG,wBAAqB;IACxB,GAAG,yBAAsB;IACzB,sBAAmB;IACnB,sBAAmB;IACnB,yBAAsB;IACtB,sBAAmB;IACnB,GAAG,0BAAuB;CAC3B,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
@@ -17,10 +17,10 @@ const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
17
  const constants_1 = require("./constants");
18
18
  const clients_1 = require("../../utils/clients");
19
19
  const helpers_1 = require("./helpers");
20
- const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
21
20
  const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
22
21
  const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
23
22
  const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
23
+ const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
24
24
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
25
25
  const client = (0, clients_1.getClientSui)();
26
26
  const ownerRes = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
@@ -48,74 +48,78 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
48
48
  if (clmmPositions.length === 0)
49
49
  return [];
50
50
  const poolsIds = clmmPositions.map((position) => position.pool);
51
- // const pools = await cache.getItems<Pool>(poolsIds, {
52
- // prefix: clmmPoolsPrefix,
53
- // networkId: NetworkId.sui,
54
- // });
55
51
  const poolsById = new Map();
56
- // pools.forEach((pool) => {
57
- // if (pool) {
58
- // poolsById.set(pool.poolAddress, pool);
59
- // }
60
- // });
61
- // if (poolsById.size === 0) return [];
62
- const mints = [];
63
52
  const poolsObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, [...new Set(poolsIds)]);
64
53
  poolsObjects.forEach((poolObj) => {
65
54
  var _a, _b;
66
55
  if ((_b = (_a = poolObj.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields) {
67
56
  const pool = (0, helpers_1.getPoolFromObject)(poolObj);
68
57
  poolsById.set(poolObj.data.objectId, pool);
69
- mints.push(pool.coinTypeA, pool.coinTypeB);
70
58
  }
71
59
  });
72
- const tokenPriceById = yield cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.sui);
73
- const assets = [];
74
- let totalLiquidityValue = 0;
75
- for (const clmmPosition of clmmPositions) {
60
+ const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui, constants_1.platformId);
61
+ const [allFees, allRewards] = yield Promise.all([
62
+ (0, helpers_1.fetchPosFeeAmount)(clmmPositions.map((clmmPosition) => ({
63
+ poolAddress: clmmPosition.pool,
64
+ positionId: clmmPosition.pos_object_id,
65
+ coinTypeA: clmmPosition.coin_type_a,
66
+ coinTypeB: clmmPosition.coin_type_b,
67
+ }))),
68
+ (0, helpers_1.fetchPosRewardersAmount)(clmmPositions
69
+ .map((clmmPosition) => {
70
+ if (!clmmPosition)
71
+ return null;
72
+ const pool = poolsById.get(clmmPosition.pool);
73
+ if (!pool)
74
+ return null;
75
+ return {
76
+ poolAddress: clmmPosition.pool,
77
+ positionId: clmmPosition.pos_object_id,
78
+ coinTypeA: clmmPosition.coin_type_a,
79
+ coinTypeB: clmmPosition.coin_type_b,
80
+ rewarderInfo: pool.rewarder_infos,
81
+ };
82
+ })
83
+ .filter((v) => v !== null)),
84
+ ]);
85
+ clmmPositions.forEach((clmmPosition, i) => {
76
86
  const pool = poolsById.get(clmmPosition.pool);
77
87
  if (!pool)
78
- continue;
88
+ return;
89
+ const fees = allFees[i];
90
+ const rewards = allRewards[i];
79
91
  const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), pool.current_tick_index, clmmPosition.tick_lower_index, clmmPosition.tick_upper_index, false);
80
- const tokenPriceA = tokenPriceById.get(pool.coinTypeA);
81
- if (!tokenPriceA)
82
- continue;
83
- const assetTokenA = (0, tokenPriceToAssetToken_1.default)(pool.coinTypeA, tokenAmountA.dividedBy(Math.pow(10, tokenPriceA.decimals)).toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceA);
84
- const tokenPriceB = tokenPriceById.get(pool.coinTypeB);
85
- if (!tokenPriceB)
86
- continue;
87
- const assetTokenB = (0, tokenPriceToAssetToken_1.default)(pool.coinTypeB, tokenAmountB.dividedBy(Math.pow(10, tokenPriceB.decimals)).toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceB);
88
- if (!assetTokenA ||
89
- !assetTokenB ||
90
- assetTokenA.value === null ||
91
- assetTokenB.value === null)
92
- continue;
93
- const value = assetTokenA.value + assetTokenB.value;
94
- assets.push({
95
- assets: [assetTokenA, assetTokenB],
96
- assetsValue: value,
97
- rewardAssets: [],
98
- rewardAssetsValue: 0,
99
- value,
100
- yields: [],
101
- });
102
- totalLiquidityValue += value;
103
- }
104
- if (assets.length === 0)
105
- return [];
106
- return [
107
- {
108
- type: portfolio_core_1.PortfolioElementType.liquidity,
109
- networkId: portfolio_core_1.NetworkId.sui,
110
- platformId: constants_1.platformId,
92
+ const element = elementRegistry.addElementLiquidity({
111
93
  label: 'LiquidityPool',
112
94
  tags: ['Concentrated'],
113
- value: totalLiquidityValue,
114
- data: {
115
- liquidities: assets,
116
- },
117
- },
118
- ];
95
+ });
96
+ const liquidity = element.addLiquidity();
97
+ liquidity.addAsset({
98
+ address: pool.coinTypeA,
99
+ amount: tokenAmountA,
100
+ });
101
+ liquidity.addAsset({
102
+ address: pool.coinTypeB,
103
+ amount: tokenAmountB,
104
+ });
105
+ liquidity.addRewardAsset({
106
+ address: pool.coinTypeA,
107
+ amount: fees.feeOwedA,
108
+ });
109
+ liquidity.addRewardAsset({
110
+ address: pool.coinTypeB,
111
+ amount: fees.feeOwedB,
112
+ });
113
+ rewards.rewarderAmountOwed.forEach((rewarderAmountOwed) => {
114
+ liquidity.addRewardAsset({
115
+ address: rewarderAmountOwed.coin_address,
116
+ amount: rewarderAmountOwed.amount_owed,
117
+ });
118
+ });
119
+ if (tokenAmountA.isZero() || tokenAmountB.isZero())
120
+ element.addTag('Out Of Range');
121
+ });
122
+ return elementRegistry.getElements(cache);
119
123
  });
120
124
  const fetcher = {
121
125
  id: `${constants_1.platformId}-clmms`,
@@ -1 +1 @@
1
- {"version":3,"file":"clmmsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cetus/clmmsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAGrC,2CAAsE;AACtE,iDAAmD;AACnD,uCAImB;AAGnB,qGAA6E;AAC7E,wFAAyF;AACzF,qEAAkE;AAClE,qEAAkE;AAElE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAe,EAAC,MAAM,EAAE,KAAK,EAAE;QACpD,OAAO,EAAE;YACP,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,IAAI;SAChB;QACD,MAAM,EAAE,EAAE,OAAO,EAAE,6BAAiB,EAAE;KACvC,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,aAAa,GAAe,EAAE,CAAC;I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OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,MAAM,EAAE,YAAY;SACrB,CAAC,CAAC;QAEH,SAAS,CAAC,cAAc,CAAC;YACvB,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,MAAM,EAAE,IAAI,CAAC,QAAQ;SACtB,CAAC,CAAC;QAEH,SAAS,CAAC,cAAc,CAAC;YACvB,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,MAAM,EAAE,IAAI,CAAC,QAAQ;SACtB,CAAC,CAAC;QAEH,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,kBAAkB,EAAE,EAAE;YACxD,SAAS,CAAC,cAAc,CAAC;gBACvB,OAAO,EAAE,kBAAkB,CAAC,YAAY;gBACxC,MAAM,EAAE,kBAAkB,CAAC,WAAW;aACvC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,YAAY,CAAC,MAAM,EAAE,IAAI,YAAY,CAAC,MAAM,EAAE;YAChD,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -16,11 +16,12 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
16
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
17
  const constants_1 = require("./constants");
18
18
  const clients_1 = require("../../utils/clients");
19
- const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
20
19
  const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
21
20
  const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
22
21
  const bitsToNumber_1 = require("../../utils/sui/bitsToNumber");
23
22
  const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
23
+ const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
24
+ const helpers_1 = require("./helpers");
24
25
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
25
26
  const client = (0, clients_1.getClientSui)();
26
27
  const positions = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
@@ -33,7 +34,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
33
34
  });
34
35
  if (positions.length === 0)
35
36
  return [];
36
- const [farms, pools] = yield Promise.all([
37
+ const [farms, pools, allFees] = yield Promise.all([
37
38
  (0, multiGetObjects_1.multiGetObjects)(client, positions
38
39
  .map((position) => { var _a, _b; return (_b = (_a = position.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.pool_id; })
39
40
  .filter((s) => s !== null)),
@@ -45,14 +46,41 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
45
46
  networkId: portfolio_core_1.NetworkId.sui,
46
47
  })
47
48
  .then((res) => res.filter((p) => p !== null)),
49
+ (0, helpers_1.fetchPosFeeAmount)(positions
50
+ .map((position) => {
51
+ var _a, _b;
52
+ const clmmPosition = (_b = (_a = position.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.clmm_postion.fields;
53
+ if (!clmmPosition)
54
+ return null;
55
+ return {
56
+ poolAddress: clmmPosition.pool,
57
+ positionId: clmmPosition.id.id,
58
+ coinTypeA: clmmPosition.coin_type_a.fields.name,
59
+ coinTypeB: clmmPosition.coin_type_b.fields.name,
60
+ };
61
+ })
62
+ .filter((v) => v !== null)),
48
63
  ]);
49
- const mints = [];
50
- pools.forEach((pool) => {
51
- mints.push((0, portfolio_core_1.formatMoveTokenAddress)(pool.coinTypeA), (0, portfolio_core_1.formatMoveTokenAddress)(pool.coinTypeB));
52
- });
53
- const elements = [];
54
- const tokenPrices = yield cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.sui);
55
- positions.forEach((position) => {
64
+ const allRewards = yield (0, helpers_1.fetchPosRewardersAmount)(positions
65
+ .map((position) => {
66
+ var _a, _b;
67
+ const clmmPosition = (_b = (_a = position.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.clmm_postion.fields;
68
+ if (!clmmPosition)
69
+ return null;
70
+ const pool = pools.find((p) => p.poolAddress === clmmPosition.pool);
71
+ if (!pool)
72
+ return null;
73
+ return {
74
+ poolAddress: clmmPosition.pool,
75
+ positionId: clmmPosition.id.id,
76
+ coinTypeA: clmmPosition.coin_type_a.fields.name,
77
+ coinTypeB: clmmPosition.coin_type_b.fields.name,
78
+ rewarderInfo: pool.rewarder_infos,
79
+ };
80
+ })
81
+ .filter((v) => v !== null));
82
+ const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui, constants_1.platformId);
83
+ positions.forEach((position, i) => {
56
84
  var _a, _b, _c, _d;
57
85
  if (!((_b = (_a = position.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields))
58
86
  return;
@@ -66,6 +94,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
66
94
  });
67
95
  if (!pool)
68
96
  return;
97
+ const fees = allFees[i];
98
+ const rewards = allRewards[i];
69
99
  const tickLowerIndex = (0, bitsToNumber_1.bitsToNumber)(position.data.content.fields.clmm_postion.fields.tick_lower_index.fields
70
100
  .bits);
71
101
  const tickUpperIndex = (0, bitsToNumber_1.bitsToNumber)(position.data.content.fields.clmm_postion.fields.tick_upper_index.fields
@@ -75,37 +105,36 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
75
105
  const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(position.data.content.fields.clmm_postion.fields.liquidity), pool.current_tick_index, tickLowerIndex < effectiveTickLower ? effectiveTickLower : tickLowerIndex, tickUpperIndex < effectiveTickUpper ? tickUpperIndex : effectiveTickUpper, false);
76
106
  if (tokenAmountA.isZero() && tokenAmountB.isZero())
77
107
  return;
78
- const tokenPriceA = tokenPrices.get(pool.coinTypeA);
79
- const tokenPriceB = tokenPrices.get(pool.coinTypeB);
80
- const assets = [];
81
- if (tokenAmountA.isGreaterThan(0) && tokenPriceA) {
82
- assets.push((0, tokenPriceToAssetToken_1.default)(tokenPriceA.address, tokenAmountA.dividedBy(Math.pow(10, tokenPriceA.decimals)).toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceA));
83
- }
84
- if (tokenAmountB.isGreaterThan(0) && tokenPriceB) {
85
- assets.push((0, tokenPriceToAssetToken_1.default)(tokenPriceB.address, tokenAmountB.dividedBy(Math.pow(10, tokenPriceB.decimals)).toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceB));
86
- }
87
- const liquidities = [
88
- {
89
- assets,
90
- assetsValue: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
91
- rewardAssets: [],
92
- rewardAssetsValue: 0,
93
- value: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
94
- yields: [],
95
- },
96
- ];
97
- elements.push({
98
- type: portfolio_core_1.PortfolioElementType.liquidity,
99
- networkId: portfolio_core_1.NetworkId.sui,
100
- platformId: constants_1.platformId,
108
+ const element = elementRegistry.addElementLiquidity({
101
109
  label: 'Farming',
102
- value: (0, portfolio_core_1.getUsdValueSum)(liquidities.map((a) => a.value)),
103
- data: {
104
- liquidities,
105
- },
106
110
  });
111
+ const liquidity = element.addLiquidity();
112
+ liquidity.addAsset({
113
+ address: pool.coinTypeA,
114
+ amount: tokenAmountA,
115
+ });
116
+ liquidity.addAsset({
117
+ address: pool.coinTypeB,
118
+ amount: tokenAmountB,
119
+ });
120
+ liquidity.addRewardAsset({
121
+ address: pool.coinTypeA,
122
+ amount: fees.feeOwedA,
123
+ });
124
+ liquidity.addRewardAsset({
125
+ address: pool.coinTypeB,
126
+ amount: fees.feeOwedB,
127
+ });
128
+ rewards.rewarderAmountOwed.forEach((rewarderAmountOwed) => {
129
+ liquidity.addRewardAsset({
130
+ address: rewarderAmountOwed.coin_address,
131
+ amount: rewarderAmountOwed.amount_owed,
132
+ });
133
+ });
134
+ if (tokenAmountA.isZero() || tokenAmountB.isZero())
135
+ element.addTag('Out Of Range');
107
136
  });
108
- return elements;
137
+ return elementRegistry.getElements(cache);
109
138
  });
110
139
  const fetcher = {
111
140
  id: `${constants_1.platformId}-farms`,
@@ -1 +1 @@
1
- {"version":3,"file":"farmsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cetus/farmsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAGrC,2CAAuE;AACvE,iDAAmD;AAEnD,qGAA6E;AAC7E,qEAAkE;AAClE,qEAAkE;AAClE,+DAA4D;AAC5D,wFAAyF;AAEzF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,MAAM,IAAA,iCAAe,EAAqB,MAAM,EAAE,KAAK,EAAE;QACzE,OAAO,EAAE;YACP,WAAW,EAAE,IAAI;SAClB;QACD,MAAM,EAAE;YACN,UAAU,EAAE,uBAAW;SACxB;KACF,CAAC,CAAC;IACH,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEtC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACvC,IAAA,iCAAe,EACb,MAAM,EACN,SAAS;aACN,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,eAAC,OAAA,MAAA,MAAA,QAAQ,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,OAAO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SAAS,CAAC,cAAc,CAAC;YACvB,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,MAAM,EAAE,IAAI,CAAC,QAAQ;SACtB,CAAC,CAAC;QAEH,SAAS,CAAC,cAAc,CAAC;YACvB,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,MAAM,EAAE,IAAI,CAAC,QAAQ;SACtB,CAAC,CAAC;QAEH,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,kBAAkB,EAAE,EAAE;YACxD,SAAS,CAAC,cAAc,CAAC;gBACvB,OAAO,EAAE,kBAAkB,CAAC,YAAY;gBACxC,MAAM,EAAE,kBAAkB,CAAC,WAAW;aACvC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,YAAY,CAAC,MAAM,EAAE,IAAI,YAAY,CAAC,MAAM,EAAE;YAChD,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import Decimal from 'decimal.js';
2
2
  import BigNumber from 'bignumber.js';
3
- import { NFT, Pool, Position, SuiAddressType, SuiStructTag } from './types';
3
+ import { CollectFeesQuote, FetchPosFeeParams, FetchPosRewardParams, NFT, Pool, Position, PosRewarderResult, SuiAddressType, SuiStructTag } from './types';
4
4
  import { ObjectResponse } from '../../utils/sui/types';
5
5
  export declare function fromX64(num: BigNumber): Decimal;
6
6
  export declare function composeType(address: string, generics: SuiAddressType[]): SuiAddressType;
@@ -14,3 +14,5 @@ export declare function asIntN(int: bigint, bits?: number): number;
14
14
  export declare function getPoolFromObject(object: ObjectResponse<unknown>): Pool;
15
15
  export declare function buildPosition(objects: ObjectResponse<unknown>): Position;
16
16
  export declare function buildNFT(objects: ObjectResponse<unknown>): NFT;
17
+ export declare const fetchPosFeeAmount: (params: FetchPosFeeParams[]) => Promise<CollectFeesQuote[]>;
18
+ export declare const fetchPosRewardersAmount: (params: FetchPosRewardParams[]) => Promise<PosRewarderResult[]>;
@@ -1,18 +1,29 @@
1
1
  "use strict";
2
2
  /* eslint-disable no-param-reassign */
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
3
12
  var __importDefault = (this && this.__importDefault) || function (mod) {
4
13
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
14
  };
6
15
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.buildNFT = exports.buildPosition = exports.getPoolFromObject = exports.asIntN = exports.normalizeCoinType = exports.buildPoolName = exports.isSuiCoin = exports.extractStructTagFromType = exports.composeType = exports.fromX64 = void 0;
16
+ exports.fetchPosRewardersAmount = exports.fetchPosFeeAmount = exports.buildNFT = exports.buildPosition = exports.getPoolFromObject = exports.asIntN = exports.normalizeCoinType = exports.buildPoolName = exports.isSuiCoin = exports.extractStructTagFromType = exports.composeType = exports.fromX64 = void 0;
8
17
  const decimal_js_1 = __importDefault(require("decimal.js"));
9
18
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
10
19
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
11
20
  const utils_1 = require("@mysten/sui/utils");
21
+ const transactions_1 = require("@mysten/sui/transactions");
12
22
  const types_1 = require("./types");
13
23
  const getObjectDeletedResponse_1 = require("../../utils/sui/getObjectDeletedResponse");
14
24
  const getObjectNotExistsResponse_1 = require("../../utils/sui/getObjectNotExistsResponse");
15
25
  const bitsToNumber_1 = require("../../utils/sui/bitsToNumber");
26
+ const clients_1 = require("../../utils/clients");
16
27
  function fromX64(num) {
17
28
  return new decimal_js_1.default(num.toString()).mul(decimal_js_1.default.pow(2, -64));
18
29
  }
@@ -203,4 +214,94 @@ function buildNFT(objects) {
203
214
  return nft;
204
215
  }
205
216
  exports.buildNFT = buildNFT;
217
+ const fetchPosFeeAmount = (params) => __awaiter(void 0, void 0, void 0, function* () {
218
+ var _a, _b;
219
+ const tx = new transactions_1.Transaction();
220
+ for (const paramItem of params) {
221
+ const typeArguments = [paramItem.coinTypeA, paramItem.coinTypeB];
222
+ const args = [
223
+ tx.object('0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f'),
224
+ tx.object(paramItem.poolAddress),
225
+ tx.pure.address(paramItem.positionId),
226
+ ];
227
+ tx.moveCall({
228
+ target: `0x8faab90228e4c4df91c41626bbaefa19fc25c514405ac64de54578dec9e6f5ee::fetcher_script::fetch_position_fees`,
229
+ arguments: args,
230
+ typeArguments,
231
+ });
232
+ }
233
+ const simulateRes = yield (0, clients_1.getClientSui)().devInspectTransactionBlock({
234
+ transactionBlock: tx,
235
+ sender: simulationAccount,
236
+ });
237
+ if (simulateRes.error != null) {
238
+ throw new Error(`fetch position fee error code: ${(_a = simulateRes.error) !== null && _a !== void 0 ? _a : 'unknown error'}, please check config and postion and pool object ids`);
239
+ }
240
+ const valueData = (_b = simulateRes.events) === null || _b === void 0 ? void 0 : _b.filter((item) => extractStructTagFromType(item.type).name === `FetchPositionFeesEvent`);
241
+ if (valueData.length === 0) {
242
+ return [];
243
+ }
244
+ const result = [];
245
+ for (let i = 0; i < valueData.length; i += 1) {
246
+ const { parsedJson } = valueData[i];
247
+ const posRrewarderResult = {
248
+ feeOwedA: new bignumber_js_1.default(parsedJson.fee_owned_a),
249
+ feeOwedB: new bignumber_js_1.default(parsedJson.fee_owned_b),
250
+ position_id: parsedJson.position_id,
251
+ };
252
+ result.push(posRrewarderResult);
253
+ }
254
+ return result;
255
+ });
256
+ exports.fetchPosFeeAmount = fetchPosFeeAmount;
257
+ const simulationAccount = '0x326ce9894f08dcaa337fa232641cc34db957aec9ff6614c1186bc9a7508df0bb';
258
+ const fetchPosRewardersAmount = (params) => __awaiter(void 0, void 0, void 0, function* () {
259
+ var _c, _d;
260
+ const tx = new transactions_1.Transaction();
261
+ for (const paramItem of params) {
262
+ const typeArguments = [paramItem.coinTypeA, paramItem.coinTypeB];
263
+ const args = [
264
+ tx.object('0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f'),
265
+ tx.object(paramItem.poolAddress),
266
+ tx.pure.address(paramItem.positionId),
267
+ tx.object(portfolio_core_1.suiClockAddress),
268
+ ];
269
+ tx.moveCall({
270
+ target: `0x8faab90228e4c4df91c41626bbaefa19fc25c514405ac64de54578dec9e6f5ee::fetcher_script::fetch_position_rewards`,
271
+ arguments: args,
272
+ typeArguments,
273
+ });
274
+ }
275
+ const simulateRes = yield (0, clients_1.getClientSui)().devInspectTransactionBlock({
276
+ transactionBlock: tx,
277
+ sender: simulationAccount,
278
+ });
279
+ if (simulateRes.error != null) {
280
+ throw new Error(`fetch position rewards error code: ${(_c = simulateRes.error) !== null && _c !== void 0 ? _c : 'unknown error'}, please check config and params`);
281
+ }
282
+ const valueData = (_d = simulateRes.events) === null || _d === void 0 ? void 0 : _d.filter((item) => extractStructTagFromType(item.type).name === `FetchPositionRewardsEvent`);
283
+ if (valueData.length === 0) {
284
+ return [];
285
+ }
286
+ if (valueData.length !== params.length) {
287
+ throw new Error('valueData.length !== params.pools.length');
288
+ }
289
+ const result = [];
290
+ for (let i = 0; i < valueData.length; i += 1) {
291
+ const posRrewarderResult = {
292
+ poolAddress: params[i].poolAddress,
293
+ positionId: params[i].positionId,
294
+ rewarderAmountOwed: [],
295
+ };
296
+ for (let j = 0; j < params[i].rewarderInfo.length; j += 1) {
297
+ posRrewarderResult.rewarderAmountOwed.push({
298
+ amount_owed: new bignumber_js_1.default(valueData[i].parsedJson.data[j]),
299
+ coin_address: params[i].rewarderInfo[j].coinAddress,
300
+ });
301
+ }
302
+ result.push(posRrewarderResult);
303
+ }
304
+ return result;
305
+ });
306
+ exports.fetchPosRewardersAmount = fetchPosRewardersAmount;
206
307
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cetus/helpers.ts"],"names":[],"mappings":";AAAA,sCAAsC;;;;;;AAEtC,4DAAiC;AACjC,gEAAqC;AACrC,+DAAwD;AACxD,6CAAyD;AACzD,mCAQiB;AAEjB,uFAAoF;AACpF,2FAAwF;AACxF,+DAA4D;AAE5D,SAAgB,OAAO,CAAC,GAAc;IACpC,OAAO,IAAI,oBAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,CAAC,oBAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9D,CAAC;AAFD,0BAEC;AAiBD,SAAgB,WAAW,CACzB,OAAe,EACf,GAAG,IAAe;IAElB,MAAM,QAAQ,GAAa,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAE,IAAI,CAAC,GAAG,EAAe;QAC1B,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAElD,IAAI,MAAM,GAAW,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEvC,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;QACh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,CAAC,CAAC,UAAU;YAChC,kBAAkB,EAAE,EAAE;SACvB,CAAC;QAEF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1D,kBAAkB,CAAC,kBAAkB,CAAC,IAAI,CAAC;gBACzC,WAAW,EAAE,IAAI,sBAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC3D,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,WAAW;aACpD,CAAC,CAAC;QACL,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAA,CAAC;AAnEW,QAAA,uBAAuB,2BAmElC"}
@@ -1,3 +1,4 @@
1
+ import BigNumber from 'bignumber.js';
1
2
  import { ID } from '../../utils/sui/structs/id';
2
3
  export type SuiAddressType = string;
3
4
  export type SuiObjectIdType = string;
@@ -250,3 +251,30 @@ export type DcaOrder = {
250
251
  status: string;
251
252
  user: string;
252
253
  };
254
+ export type FetchPosFeeParams = {
255
+ poolAddress: string;
256
+ positionId: string;
257
+ coinTypeA: string;
258
+ coinTypeB: string;
259
+ };
260
+ export type CollectFeesQuote = {
261
+ position_id: string;
262
+ feeOwedA: BigNumber;
263
+ feeOwedB: BigNumber;
264
+ };
265
+ export type FetchPosRewardParams = {
266
+ poolAddress: string;
267
+ positionId: string;
268
+ coinTypeA: string;
269
+ coinTypeB: string;
270
+ rewarderInfo: Rewarder[];
271
+ };
272
+ export type RewarderAmountOwed = {
273
+ amount_owed: BigNumber;
274
+ coin_address: string;
275
+ };
276
+ export type PosRewarderResult = {
277
+ poolAddress: string;
278
+ positionId: string;
279
+ rewarderAmountOwed: RewarderAmountOwed[];
280
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cetus/types.ts"],"names":[],"mappings":";;;AAwDA,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,yCAAqB,CAAA;IACrB,uCAAmB,CAAA;IACnB,6CAAyB,CAAA;AAC3B,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cetus/types.ts"],"names":[],"mappings":";;;AAyDA,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,yCAAqB,CAAA;IACrB,uCAAmB,CAAA;IACnB,6CAAyB,CAAA;AAC3B,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,42 @@
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
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
+ const constants_1 = require("./constants");
14
+ const clients_1 = require("../../utils/clients");
15
+ const structs_1 = require("./structs");
16
+ const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
17
+ const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
18
+ const helpers_1 = require("./helpers");
19
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
20
+ const connection = (0, clients_1.getClientSolana)();
21
+ const claim = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(connection, structs_1.claimStruct, (0, helpers_1.getPda)(owner));
22
+ if (!claim || claim.amount.isZero())
23
+ return [];
24
+ const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
25
+ const element = elementRegistry.addElementMultiple({
26
+ label: 'Airdrop',
27
+ });
28
+ element.addAsset({
29
+ address: claim.mintAddress.toString(),
30
+ amount: claim.amount.dividedBy(Math.pow(10, 9)),
31
+ alreadyShifted: true,
32
+ attributes: { isClaimable: true },
33
+ });
34
+ return elementRegistry.getElements(cache);
35
+ });
36
+ const fetcher = {
37
+ id: `${constants_1.platformId}-claim`,
38
+ networkId: portfolio_core_1.NetworkId.solana,
39
+ executor,
40
+ };
41
+ exports.default = fetcher;
42
+ //# sourceMappingURL=airdropClaimFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"airdropClaimFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loverflow/airdropClaimFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAEvD,2CAAyC;AAEzC,iDAAsD;AACtD,uCAAwC;AACxC,gFAA6E;AAC7E,kFAA+E;AAC/E,uCAAmC;AAEnC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,KAAK,GAAG,MAAM,IAAA,2CAAoB,EACtC,UAAU,EACV,qBAAW,EACX,IAAA,gBAAM,EAAC,KAAK,CAAC,CACd,CAAC;IACF,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC;IAE/C,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;QACjD,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;IACH,OAAO,CAAC,QAAQ,CAAC;QACf,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE;QACrC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC;QACvC,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;KAClC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import { Platform } from '@sonarwatch/portfolio-core';
3
+ export declare const platformId = "loverflow";
4
+ export declare const platform: Platform;
5
+ export declare const marketsCacheKey = "markets";
6
+ export declare const pid: PublicKey;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pid = exports.marketsCacheKey = exports.platform = exports.platformId = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
5
+ exports.platformId = 'loverflow';
6
+ exports.platform = {
7
+ id: exports.platformId,
8
+ name: 'loverflow',
9
+ image: 'https://sonar.watch/img/platforms/loverflow.webp',
10
+ website: 'https://loverflow.ibx.exchange/claim',
11
+ twitter: 'https://x.com/IBXtrade',
12
+ // defiLlamaId: 'loverflow', // from https://defillama.com/docs/api
13
+ };
14
+ exports.marketsCacheKey = `markets`;
15
+ exports.pid = new web3_js_1.PublicKey('3VQxX1xitpPBXFARqarDQJPLDEUUBPzfUV1s1GPDSCvg');
16
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loverflow/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,sCAAsC;IAC/C,OAAO,EAAE,wBAAwB;IACjC,mEAAmE;CACpE,CAAC;AACW,QAAA,eAAe,GAAG,SAAS,CAAC;AAE5B,QAAA,GAAG,GAAG,IAAI,mBAAS,CAC9B,8CAA8C,CAC/C,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ export declare function getPda(owner: string): PublicKey;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPda = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
5
+ function getPda(owner) {
6
+ return web3_js_1.PublicKey.findProgramAddressSync([new web3_js_1.PublicKey(owner).toBuffer().slice(0, 31)], new web3_js_1.PublicKey('CChTq6PthWU82YZkbveA3WDf7s97BWhBK4Vx9bmsT743'))[0];
7
+ }
8
+ exports.getPda = getPda;
9
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loverflow/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAE5C,SAAgB,MAAM,CAAC,KAAa;IAClC,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAC9C,IAAI,mBAAS,CAAC,8CAA8C,CAAC,CAC9D,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AALD,wBAKC"}
@@ -0,0 +1,6 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ import { Fetcher } from '../../Fetcher';
3
+ import { Job } from '../../Job';
4
+ export declare const platforms: Platform[];
5
+ export declare const jobs: Job[];
6
+ export declare const fetchers: Fetcher[];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fetchers = exports.jobs = exports.platforms = void 0;
7
+ const constants_1 = require("./constants");
8
+ const airdropClaimFetcher_1 = __importDefault(require("./airdropClaimFetcher"));
9
+ exports.platforms = [constants_1.platform];
10
+ exports.jobs = [];
11
+ exports.fetchers = [airdropClaimFetcher_1.default];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loverflow/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,gFAAiD;AAEpC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,6BAAY,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { BeetStruct } from '@metaplex-foundation/beet';
2
+ import { PublicKey } from '@solana/web3.js';
3
+ import BigNumber from 'bignumber.js';
4
+ export type Schedule = {
5
+ releaseTime: BigNumber;
6
+ amount: BigNumber;
7
+ };
8
+ export declare const scheduleStruct: BeetStruct<Schedule, Partial<Schedule>>;
9
+ export type Claim = {
10
+ destinationAddress: PublicKey;
11
+ mintAddress: PublicKey;
12
+ isInitialized: boolean;
13
+ releaseTime: BigNumber;
14
+ amount: BigNumber;
15
+ };
16
+ export declare const claimStruct: BeetStruct<Claim, Partial<Claim>>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.claimStruct = exports.scheduleStruct = void 0;
4
+ const beet_1 = require("@metaplex-foundation/beet");
5
+ const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
+ const solana_1 = require("../../utils/solana");
7
+ exports.scheduleStruct = new beet_1.BeetStruct([
8
+ ['releaseTime', solana_1.u64],
9
+ ['amount', solana_1.u64],
10
+ ], (args) => args);
11
+ exports.claimStruct = new beet_1.BeetStruct([
12
+ ['destinationAddress', beet_solana_1.publicKey],
13
+ ['mintAddress', beet_solana_1.publicKey],
14
+ ['isInitialized', beet_1.bool],
15
+ ['releaseTime', solana_1.u64],
16
+ ['amount', solana_1.u64],
17
+ ], (args) => args);
18
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loverflow/structs.ts"],"names":[],"mappings":";;;AAAA,oDAA6D;AAC7D,kEAA6D;AAG7D,+CAAyC;AAO5B,QAAA,cAAc,GAAG,IAAI,iBAAU,CAC1C;IACE,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,QAAQ,EAAE,YAAG,CAAC;CAChB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC;AASW,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;IACE,CAAC,oBAAoB,EAAE,uBAAS,CAAC;IACjC,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,eAAe,EAAE,WAAI,CAAC;IACvB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,QAAQ,EAAE,YAAG,CAAC;CAChB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ID } from '../../utils/sui/structs/id';
2
+ export type Receipt = {
3
+ id: ID;
4
+ amountDeposited: string;
5
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loverflow/types.ts"],"names":[],"mappings":""}
@@ -8,5 +8,5 @@ export declare class AssetBuilder {
8
8
  attributes: PortfolioAssetAttributes;
9
9
  alreadyShifted: boolean;
10
10
  constructor(params: PortfolioAssetParams);
11
- get(networkId: NetworkIdType, tokenPrices: TokenPriceMap): PortfolioAsset | null;
11
+ get(networkId: NetworkIdType, tokenPrices: TokenPriceMap, keepIfZero?: boolean): PortfolioAsset | null;
12
12
  }
@@ -13,9 +13,9 @@ class AssetBuilder {
13
13
  this.attributes = params.attributes || {};
14
14
  this.alreadyShifted = params.alreadyShifted || false;
15
15
  }
16
- get(networkId, tokenPrices) {
16
+ get(networkId, tokenPrices, keepIfZero) {
17
17
  let amount = new bignumber_js_1.default(this.amount);
18
- if (amount.isZero())
18
+ if (!keepIfZero && amount.isZero())
19
19
  return null;
20
20
  const tokenPrice = tokenPrices.get(this.address);
21
21
  if (!tokenPrice)
@@ -1 +1 @@
1
- {"version":3,"file":"AssetBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/AssetBuilder.ts"],"names":[],"mappings":";;;;;;AAKA,gEAAqC;AAErC,4FAAoE;AAGpE,MAAa,YAAY;IAMvB,YAAY,MAA4B;QACtC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;QAC1C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,KAAK,CAAC;IACvD,CAAC;IAED,GAAG,CACD,SAAwB,EACxB,WAA0B;QAE1B,IAAI,MAAM,GAAG,IAAI,sBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,MAAM,CAAC,MAAM,EAAE;YAAE,OAAO,IAAI,CAAC;QACjC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAE7B,IAAI,CAAC,IAAI,CAAC,cAAc;YACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC,CAAC;QAEvD,OAAO,IAAA,gCAAsB,EAC3B,UAAU,CAAC,OAAO,EAClB,MAAM,CAAC,QAAQ,EAAE,EACjB,SAAS,EACT,UAAU,EACV,SAAS,EACT,IAAI,CAAC,UAAU,CAChB,CAAC;IACJ,CAAC;CACF;AAlCD,oCAkCC"}
1
+ {"version":3,"file":"AssetBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/AssetBuilder.ts"],"names":[],"mappings":";;;;;;AAKA,gEAAqC;AAErC,4FAAoE;AAGpE,MAAa,YAAY;IAMvB,YAAY,MAA4B;QACtC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;QAC1C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,KAAK,CAAC;IACvD,CAAC;IAED,GAAG,CACD,SAAwB,EACxB,WAA0B,EAC1B,UAAoB;QAEpB,IAAI,MAAM,GAAG,IAAI,sBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE;YAAE,OAAO,IAAI,CAAC;QAChD,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAE7B,IAAI,CAAC,IAAI,CAAC,cAAc;YACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC,CAAC;QAEvD,OAAO,IAAA,gCAAsB,EAC3B,UAAU,CAAC,OAAO,EAClB,MAAM,CAAC,QAAQ,EAAE,EACjB,SAAS,EACT,UAAU,EACV,SAAS,EACT,IAAI,CAAC,UAAU,CAChB,CAAC;IACJ,CAAC;CACF;AAnCD,oCAmCC"}
@@ -5,8 +5,9 @@ export declare abstract class ElementBuilder {
5
5
  readonly type: PortfolioElementTypeType;
6
6
  readonly label: PortfolioElementLabel;
7
7
  readonly name?: string;
8
- readonly tags?: string[];
8
+ tags?: string[];
9
9
  protected constructor(params: ElementParams);
10
+ addTag(tag: string): void;
10
11
  abstract mints(): string[];
11
12
  abstract get(networkId: NetworkIdType, platformId: string, tokenPrices: TokenPriceMap): PortfolioElement | null;
12
13
  }
@@ -8,6 +8,11 @@ class ElementBuilder {
8
8
  this.name = params.name;
9
9
  this.tags = params.tags;
10
10
  }
11
+ addTag(tag) {
12
+ if (!this.tags)
13
+ this.tags = [];
14
+ this.tags.push(tag);
15
+ }
11
16
  }
12
17
  exports.ElementBuilder = ElementBuilder;
13
18
  //# sourceMappingURL=ElementBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ElementBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/ElementBuilder.ts"],"names":[],"mappings":";;;AASA,MAAsB,cAAc;IAMlC,YAAsB,MAAqB;QACzC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;CASF;AApBD,wCAoBC"}
1
+ {"version":3,"file":"ElementBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/ElementBuilder.ts"],"names":[],"mappings":";;;AASA,MAAsB,cAAc;IAMlC,YAAsB,MAAqB;QACzC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;CASF;AAzBD,wCAyBC"}
@@ -26,7 +26,7 @@ class LiquidityBuilder {
26
26
  }
27
27
  get(networkId, tokenPrices) {
28
28
  const assets = this.assets
29
- .map((a) => a.get(networkId, tokenPrices))
29
+ .map((a) => a.get(networkId, tokenPrices, true))
30
30
  .filter((a) => a !== null);
31
31
  const rewardAssets = this.rewardAssets
32
32
  .map((a) => a.get(networkId, tokenPrices))
@@ -1 +1 @@
1
- {"version":3,"file":"LiquidityBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/LiquidityBuilder.ts"],"names":[],"mappings":";;;AAAA,+DAMoC;AAEpC,iDAA8C;AAG9C,MAAa,gBAAgB;IAK3B;QACE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;Q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C;QAElE,MAAM,WAAW,GAAG,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACvE,MAAM,iBAAiB,GAAG,IAAA,+BAAc,EACtC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CACzC,CAAC;QACF,MAAM,KAAK,GAAG,CAAC,WAAW,IAAI,CAAC,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,CAAC,CAAC;QAE5D,IAAI,KAAK,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAE7B,OAAO;YACL,MAAM;YACN,WAAW;YACX,YAAY;YACZ,iBAAiB;YACjB,KAAK;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;SACE,CAAC;IAC1B,CAAC;CACF;AA5DD,4CA4DC"}
1
+ {"version":3,"file":"LiquidityBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/LiquidityBuilder.ts"],"names":[],"mappings":";;;AAAA,+DAMoC;AAEpC,iDAA8C;AAG9C,MAAa,gBAAgB;IAK3B;QACE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACnB,CAAC;IAED,QAAQ,CAAC,MAA4B;QACnC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,cAAc,CAAC,MAA4B;QACzC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,QAAQ,CAAC,MAAa;QACpB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;IAED,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