@sonarwatch/portfolio-plugins 0.14.32 → 0.14.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/package.json +1 -1
  3. package/src/plugins/elixir/positionsFetcher.js +29 -51
  4. package/src/plugins/elixir/positionsFetcher.js.map +1 -1
  5. package/src/plugins/metaplex/resizableNftFetcher.js +3 -1
  6. package/src/plugins/metaplex/resizableNftFetcher.js.map +1 -1
  7. package/src/plugins/tensor/airdropPowerUsersFetcher.js +25 -21
  8. package/src/plugins/tensor/airdropPowerUsersFetcher.js.map +1 -1
  9. package/src/plugins/tensor/constants.d.ts +1 -3
  10. package/src/plugins/tensor/constants.js +2 -4
  11. package/src/plugins/tensor/constants.js.map +1 -1
  12. package/src/plugins/tensor/filters.d.ts +1 -1
  13. package/src/plugins/tensor/filters.js +5 -5
  14. package/src/plugins/tensor/filters.js.map +1 -1
  15. package/src/plugins/tensor/helpers.d.ts +1 -1
  16. package/src/plugins/tensor/helpers.js +4 -7
  17. package/src/plugins/tensor/helpers.js.map +1 -1
  18. package/src/plugins/tensor/sharedEscrowFetcher.js +14 -18
  19. package/src/plugins/tensor/sharedEscrowFetcher.js.map +1 -1
  20. package/src/plugins/tensor/struct.d.ts +5 -0
  21. package/src/plugins/tensor/struct.js +5 -1
  22. package/src/plugins/tensor/struct.js.map +1 -1
  23. package/src/plugins/whalesmarket/depositFetcher.js +1 -0
  24. package/src/plugins/whalesmarket/depositFetcher.js.map +1 -1
  25. package/src/utils/elementbuilder/ElementLiquidityBuilder.d.ts +2 -1
  26. package/src/utils/elementbuilder/ElementLiquidityBuilder.js +2 -2
  27. package/src/utils/elementbuilder/ElementLiquidityBuilder.js.map +1 -1
  28. package/src/utils/elementbuilder/LiquidityBuilder.d.ts +3 -1
  29. package/src/utils/elementbuilder/LiquidityBuilder.js +3 -1
  30. package/src/utils/elementbuilder/LiquidityBuilder.js.map +1 -1
  31. package/src/utils/elementbuilder/LiquidityParams.d.ts +3 -0
  32. package/src/utils/elementbuilder/LiquidityParams.js +3 -0
  33. package/src/utils/elementbuilder/LiquidityParams.js.map +1 -0
  34. package/src/plugins/elixir/helpers.d.ts +0 -2
  35. package/src/plugins/elixir/helpers.js +0 -40
  36. package/src/plugins/elixir/helpers.js.map +0 -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.33](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.32...plugins-0.14.33) (2024-11-15)
6
+
7
+
8
+
5
9
  ## [0.14.32](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.31...plugins-0.14.32) (2024-11-14)
6
10
 
7
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.14.32",
3
+ "version": "0.14.33",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -13,11 +13,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
16
17
  const constants_1 = require("./constants");
17
18
  const clients_1 = require("../../utils/clients");
18
19
  const getDynamicFieldObject_1 = require("../../utils/sui/getDynamicFieldObject");
19
- const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
20
- const helpers_1 = require("./helpers");
20
+ const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
21
21
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
22
22
  const client = (0, clients_1.getClientSui)();
23
23
  const [vaultObjects, vaultTvls] = yield Promise.all([
@@ -69,24 +69,17 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
69
69
  coinType: coinType[0].type,
70
70
  };
71
71
  }))).then((dfs) => dfs.filter((df) => df !== null));
72
- const coinsTypes = [];
73
- activeShares.forEach((a) => {
74
- if (a &&
75
- a.coinType &&
76
- !coinsTypes.includes((0, portfolio_core_1.formatMoveTokenAddress)(a.coinType)))
77
- coinsTypes.push((0, portfolio_core_1.formatMoveTokenAddress)(a.coinType));
78
- });
79
- const tokenPrices = yield cache.getTokenPricesAsMap(coinsTypes, portfolio_core_1.NetworkId.sui);
80
- const elements = [];
72
+ const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui, constants_1.platformId);
81
73
  activeShares.forEach((a) => {
82
74
  var _a;
83
- const assets = [];
84
75
  if (!a)
85
76
  return;
86
- const tokenPrice = tokenPrices.get((0, portfolio_core_1.formatMoveTokenAddress)(a.coinType));
87
- if (!tokenPrice)
88
- return;
89
- const yields = [];
77
+ const element = elementRegistry.addElementLiquidity({
78
+ label: 'LiquidityPool',
79
+ });
80
+ const liquidity = element.addLiquidity({
81
+ name: (_a = constants_1.vaults.find((v) => v.address === a.vault)) === null || _a === void 0 ? void 0 : _a.vaultName,
82
+ });
90
83
  if (a.shares) {
91
84
  let tvl;
92
85
  vaultTvls.forEach((t) => {
@@ -95,50 +88,35 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
95
88
  }
96
89
  });
97
90
  if (tvl) {
98
- const userActiveAmounts = (0, helpers_1.formatAndCleanBigInt)(((0, helpers_1.convertDecimalStringToScaledBigInt)(a.shares, 6) *
99
- BigInt(tvl.USDC.amount_wei)) /
100
- BigInt(a.total_shares), 18);
101
- if (Number(userActiveAmounts) > 0) {
102
- assets.push((0, tokenPriceToAssetToken_1.default)(a.coinType, Number(userActiveAmounts) / Math.pow(10, tokenPrice.decimals), portfolio_core_1.NetworkId.sui, tokenPrice));
103
- yields.push((0, portfolio_core_1.yieldFromApy)(Number(tvl.pool_apy) / 100));
91
+ const userActiveAmounts = new bignumber_js_1.default(a.shares)
92
+ .multipliedBy(new bignumber_js_1.default(tvl.USDC.amount_wei).dividedBy(Math.pow(10, 27)))
93
+ .dividedBy(a.total_shares);
94
+ if (userActiveAmounts.gt(0)) {
95
+ liquidity.addAsset({
96
+ address: a.coinType,
97
+ amount: userActiveAmounts,
98
+ alreadyShifted: true,
99
+ });
100
+ liquidity.addYield((0, portfolio_core_1.yieldFromApy)(Number(tvl.pool_apy) / 100));
104
101
  }
105
102
  }
106
103
  }
107
- const pendingAmount = a.pending
108
- ? Number(a.pending) / Math.pow(10, tokenPrice.decimals)
109
- : undefined;
104
+ const pendingAmount = a.pending ? Number(a.pending) : undefined;
110
105
  if (pendingAmount) {
111
- assets.push((0, tokenPriceToAssetToken_1.default)(a.coinType, pendingAmount, portfolio_core_1.NetworkId.sui, tokenPrice, undefined, { isClaimable: true }));
112
- yields.push({
106
+ liquidity.addAsset({
107
+ address: a.coinType,
108
+ amount: pendingAmount,
109
+ attributes: {
110
+ isClaimable: true,
111
+ },
112
+ });
113
+ liquidity.addYield({
113
114
  apr: 0,
114
115
  apy: 0,
115
116
  });
116
117
  }
117
- const assetsValue = (0, portfolio_core_1.getUsdValueSum)(assets.map((as) => as.value));
118
- const value = assetsValue;
119
- if (assets.length > 0) {
120
- const liquidities = [
121
- {
122
- value,
123
- assets,
124
- assetsValue,
125
- rewardAssets: [],
126
- rewardAssetsValue: null,
127
- yields,
128
- name: (_a = constants_1.vaults.find((v) => v.address === a.vault)) === null || _a === void 0 ? void 0 : _a.vaultName,
129
- },
130
- ];
131
- elements.push({
132
- type: 'liquidity',
133
- data: { liquidities },
134
- label: 'LiquidityPool',
135
- networkId: portfolio_core_1.NetworkId.sui,
136
- platformId: constants_1.platformId,
137
- value: (0, portfolio_core_1.getUsdValueSum)(liquidities.map((liq) => liq.value)),
138
- });
139
- }
140
118
  });
141
- return elements;
119
+ return elementRegistry.getElements(cache);
142
120
  });
143
121
  const fetcher = {
144
122
  id: `${constants_1.platformId}-positions`,
@@ -1 +1 @@
1
- {"version":3,"file":"positionsFetcher.js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AAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,WAAW,GAAyB;gBACxC;oBACE,KAAK;oBACL,MAAM;oBACN,WAAW;oBACX,YAAY,EAAE,EAAE;oBAChB,iBAAiB,EAAE,IAAI;oBACvB,MAAM;oBACN,IAAI,EAAE,MAAA,kBAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,KAAK,CAAC,0CAAE,SAAS;iBAC3D;aACF,CAAC;YAEF,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,EAAE,WAAW,EAAE;gBACrB,KAAK,EAAE,eAAe;gBACtB,SAAS,EAAE,0BAAS,CAAC,GAAG;gBACxB,UAAU,EAAV,sBAAU;gBACV,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;aAC3D,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elixir/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAGrC,2CAMqB;AAErB,iDAAmD;AACnD,iFAA8E;AAE9E,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,CAAC,YAAY,EAAE,S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C,SAAS,CAAC;QAChE,IAAI,aAAa,EAAE,CAAC;YAClB,SAAS,CAAC,QAAQ,CAAC;gBACjB,OAAO,EAAE,CAAC,CAAC,QAAQ;gBACnB,MAAM,EAAE,aAAa;gBACrB,UAAU,EAAE;oBACV,WAAW,EAAE,IAAI;iBAClB;aACF,CAAC,CAAC;YACH,SAAS,CAAC,QAAQ,CAAC;gBACjB,GAAG,EAAE,CAAC;gBACN,GAAG,EAAE,CAAC;aACP,CAAC,CAAC;QACL,CAAC;IACH,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,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -23,7 +23,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
23
23
  const asset = yield client.getTokenAccountsByOwner(new web3_js_1.PublicKey(owner), {
24
24
  programId: new web3_js_1.PublicKey(solana_1.solanaTokenPid),
25
25
  });
26
- const tokenAccounts = asset.value.map((account) => solana_1.tokenAccountStruct.deserialize(account.account.data)[0]);
26
+ const tokenAccounts = asset.value
27
+ .map((account) => solana_1.tokenAccountStruct.deserialize(account.account.data)[0])
28
+ .filter((tA) => !tA.amount.isZero());
27
29
  const metadataPubkeys = [];
28
30
  const editionPubkeys = [];
29
31
  tokenAccounts.forEach((account) => {
@@ -1 +1 @@
1
- {"version":3,"file":"resizableNftFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/metaplex/resizableNftFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAA4E;AAC5E,6CAA4C;AAE5C,2CAIqB;AAErB,gFAA6E;AAC7E,iDAAsD;AACtD,+CAAwE;AACxE,uCAAqE;AACrE,gGAA6F;AAE7F,MAAM,QA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AAC,CAAC;QACpC,IAAI,CAAC,cAAc;YAAE,SAAS;QAE9B,IAAI,CAAA,MAAA,gBAAgB,CAAC,CAAC,CAAC,0CAAE,IAAI,CAAC,UAAU,MAAK,GAAG,EAAE,CAAC;YACjD,IAAI,cAAc,CAAC,IAAI,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;gBAC3C,MAAM,IAAI,kCAAsB,CAAC;YACnC,CAAC;YACD,IAAI,cAAc,CAAC,IAAI,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;gBAC3C,MAAM,IAAI,iCAAqB,CAAC;YAClC,CAAC;QACH,CAAC;IACH,CAAC;IAED,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;QAChB,IAAI,EAAE,gBAAgB;KACvB,CAAC,CAAC;IAEH,OAAO,CAAC,QAAQ,CAAC;QACf,OAAO,EAAE,oCAAmB;QAC5B,MAAM;QACN,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE;YACV,WAAW,EAAE,IAAI;SAClB;KACF,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"resizableNftFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/metaplex/resizableNftFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAA4E;AAC5E,6CAA4C;AAE5C,2CAIqB;AAErB,gFAA6E;AAC7E,iDAAsD;AACtD,+CAAwE;AACxE,uCAAqE;AACrE,gGAA6F;AAE7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E,EAAE,CAAC;QACjD,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAAE,SAAS;QAEnC,cAAc,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,cAAc;YAAE,SAAS;QAE9B,IAAI,CAAA,MAAA,gBAAgB,CAAC,CAAC,CAAC,0CAAE,IAAI,CAAC,UAAU,MAAK,GAAG,EAAE,CAAC;YACjD,IAAI,cAAc,CAAC,IAAI,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;gBAC3C,MAAM,IAAI,kCAAsB,CAAC;YACnC,CAAC;YACD,IAAI,cAAc,CAAC,IAAI,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;gBAC3C,MAAM,IAAI,iCAAqB,CAAC;YAClC,CAAC;QACH,CAAC;IACH,CAAC;IAED,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;QAChB,IAAI,EAAE,gBAAgB;KACvB,CAAC,CAAC;IAEH,OAAO,CAAC,QAAQ,CAAC;QACf,OAAO,EAAE,oCAAmB;QAC5B,MAAM;QACN,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE;YACV,WAAW,EAAE,IAAI;SAClB;KACF,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -8,33 +8,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
+ const web3_js_1 = require("@solana/web3.js");
16
14
  const constants_1 = require("./constants");
15
+ const clients_1 = require("../../utils/clients");
16
+ const solana_1 = require("../../utils/solana");
17
+ const struct_1 = require("./struct");
18
+ const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
17
19
  const helpers_1 = require("./helpers");
18
- const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
20
+ const filters_1 = require("./filters");
19
21
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
20
- const amount = (0, helpers_1.findPowerUserAllocation)(owner);
21
- if (!amount)
22
+ if (!(0, helpers_1.ownerHasPowerUserAllocation)(owner))
23
+ return [];
24
+ const connection = (0, clients_1.getClientSolana)();
25
+ const accounts = yield (0, solana_1.getParsedProgramAccounts)(connection, struct_1.vestingAccountStruct, new web3_js_1.PublicKey(constants_1.magmaProgramId), (0, filters_1.vestingFilter)(owner), 1);
26
+ if (!accounts.length)
27
+ return [];
28
+ const tokenAccounts = yield connection.getParsedTokenAccountsByOwner(accounts[0].pubkey, { mint: new web3_js_1.PublicKey(constants_1.tnsrMint) });
29
+ if (!tokenAccounts.value[0])
22
30
  return [];
23
- const tokenPrice = yield cache.getTokenPrice(constants_1.tnsrMint, portfolio_core_1.NetworkId.solana);
24
- const asset = (0, tokenPriceToAssetToken_1.default)(constants_1.tnsrMint, amount, portfolio_core_1.NetworkId.solana, tokenPrice, undefined, { isClaimable: false });
25
- return [
26
- {
27
- type: 'multiple',
28
- label: 'Airdrop',
29
- networkId: portfolio_core_1.NetworkId.solana,
30
- platformId: constants_1.platformId,
31
- name: 'Power User',
32
- data: {
33
- assets: [asset],
34
- },
35
- value: asset.value,
36
- },
37
- ];
31
+ const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
32
+ const element = elementRegistry.addElementMultiple({
33
+ label: 'Airdrop',
34
+ name: 'Power User',
35
+ });
36
+ element.addAsset({
37
+ address: tokenAccounts.value[0].account.data.parsed.info.mint,
38
+ amount: tokenAccounts.value[0].account.data.parsed.info.tokenAmount.uiAmount,
39
+ alreadyShifted: true,
40
+ });
41
+ return elementRegistry.getElements(cache);
38
42
  });
39
43
  const fetcher = {
40
44
  id: `${constants_1.platformId}-airdrop-power-users`,
@@ -1 +1 @@
1
- {"version":3,"file":"airdropPowerUsersFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/airdropPowerUsersFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAmD;AACnD,uCAAoD;AACpD,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,iCAAuB,EAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEvB,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,oBAAQ,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IAEzE,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,oBAAQ,EACR,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,UAAU,EACV,SAAS,EACT,EAAE,WAAW,EAAE,KAAK,EAAE,CACvB,CAAC;IAEF,OAAO;QACL;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;YACD,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,sBAAsB;IACvC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"airdropPowerUsersFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/airdropPowerUsersFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAG5C,2CAAmE;AACnE,iDAAsD;AACtD,+CAA8D;AAC9D,qCAAgD;AAChD,gFAA6E;AAC7E,uCAAwD;AACxD,uCAA0C;AAE1C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,IAAI,CAAC,IAAA,qCAA2B,EAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,UAAU,EACV,6BAAoB,EACpB,IAAI,mBAAS,CAAC,0BAAc,CAAC,EAC7B,IAAA,uBAAa,EAAC,KAAK,CAAC,EACpB,CAAC,CACF,CAAC;IAEF,IAAI,CAAC,QAAQ,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEhC,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,6BAA6B,CAClE,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAClB,EAAE,IAAI,EAAE,IAAI,mBAAS,CAAC,oBAAQ,CAAC,EAAE,CAClC,CAAC;IAEF,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IAEvC,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IAE1E,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;QACjD,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,YAAY;KACnB,CAAC,CAAC;IAEH,OAAO,CAAC,QAAQ,CAAC;QACf,OAAO,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI;QAC7D,MAAM,EACJ,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ;QACtE,cAAc,EAAE,IAAI;KACrB,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,sBAAsB;IACvC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -2,8 +2,6 @@ import { PublicKey } from '@solana/web3.js';
2
2
  import { Platform } from '@sonarwatch/portfolio-core';
3
3
  export declare const platformId = "tensor";
4
4
  export declare const platform: Platform;
5
- export declare const cachePrefix = "tensor";
6
5
  export declare const tensorPid: PublicKey;
7
- export declare const locksPid: PublicKey;
8
6
  export declare const tnsrMint = "TNSRxcUxoT9xBG3de7PiJyTDYu7kskLqcpddxnEJAS6";
9
- export declare const tnsrDecimals = 9;
7
+ export declare const magmaProgramId = "3zK38YBP6u3BpLUpaa6QhRHh4VXdv3J8cmD24fFpuyqy";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tnsrDecimals = exports.tnsrMint = exports.locksPid = exports.tensorPid = exports.cachePrefix = exports.platform = exports.platformId = void 0;
3
+ exports.magmaProgramId = exports.tnsrMint = exports.tensorPid = exports.platform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.platformId = 'tensor';
6
6
  exports.platform = {
@@ -10,9 +10,7 @@ exports.platform = {
10
10
  twitter: 'https://twitter.com/tensor_hq',
11
11
  website: 'https://www.tensor.trade/',
12
12
  };
13
- exports.cachePrefix = 'tensor';
14
13
  exports.tensorPid = new web3_js_1.PublicKey('TSWAPaqyCSx2KABk68Shruf4rp7CxcNi8hAsbdwmHbN');
15
- exports.locksPid = new web3_js_1.PublicKey('TLoCKic2wGJm7VhZKumih4Lc35fUhYqVMgA4j389Buk');
16
14
  exports.tnsrMint = 'TNSRxcUxoT9xBG3de7PiJyTDYu7kskLqcpddxnEJAS6';
17
- exports.tnsrDecimals = 9;
15
+ exports.magmaProgramId = '3zK38YBP6u3BpLUpaa6QhRHh4VXdv3J8cmD24fFpuyqy';
18
16
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,+CAA+C;IACtD,OAAO,EAAE,+BAA+B;IACxC,OAAO,EAAE,2BAA2B;CACrC,CAAC;AACW,QAAA,WAAW,GAAG,QAAQ,CAAC;AAEvB,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,6CAA6C,CAC9C,CAAC;AACW,QAAA,QAAQ,GAAG,6CAA6C,CAAC;AACzD,QAAA,YAAY,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,+CAA+C;IACtD,OAAO,EAAE,+BAA+B;IACxC,OAAO,EAAE,2BAA2B;CACrC,CAAC;AAEW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,QAAQ,GAAG,6CAA6C,CAAC;AAEzD,QAAA,cAAc,GAAG,8CAA8C,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import { GetProgramAccountsFilter } from '@solana/web3.js';
2
2
  export declare const singleListingFilter: (owner: string) => GetProgramAccountsFilter[];
3
3
  export declare const poolFilter: (owner: string) => GetProgramAccountsFilter[];
4
- export declare const locksFilter: (owner: string) => GetProgramAccountsFilter[];
4
+ export declare const vestingFilter: (owner: string) => GetProgramAccountsFilter[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.locksFilter = exports.poolFilter = exports.singleListingFilter = void 0;
3
+ exports.vestingFilter = exports.poolFilter = exports.singleListingFilter = void 0;
4
4
  const struct_1 = require("./struct");
5
5
  const singleListingFilter = (owner) => [
6
6
  { dataSize: struct_1.singleListingStruct.byteSize },
@@ -22,14 +22,14 @@ const poolFilter = (owner) => [
22
22
  },
23
23
  ];
24
24
  exports.poolFilter = poolFilter;
25
- const locksFilter = (owner) => [
26
- { dataSize: 472 },
25
+ const vestingFilter = (owner) => [
27
26
  {
28
27
  memcmp: {
28
+ offset: 8,
29
29
  bytes: owner,
30
- offset: 47,
31
30
  },
32
31
  },
32
+ { dataSize: 269 },
33
33
  ];
34
- exports.locksFilter = locksFilter;
34
+ exports.vestingFilter = vestingFilter;
35
35
  //# sourceMappingURL=filters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/filters.ts"],"names":[],"mappings":";;;AACA,qCAA+C;AAExC,MAAM,mBAAmB,GAAG,CACjC,KAAa,EACe,EAAE,CAAC;IAC/B,EAAE,QAAQ,EAAE,4BAAmB,CAAC,QAAQ,EAAE;IAC1C;QACE,MAAM,EAAE;YACN,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,CAAC;SACV;KACF;CACF,CAAC;AAVW,QAAA,mBAAmB,uBAU9B;AAEK,MAAM,UAAU,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACvE,EAAE,QAAQ,EAAE,GAAG,EAAE;IACjB;QACE,MAAM,EAAE;YACN,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,EAAE;SACX;KACF;CACF,CAAC;AARW,QAAA,UAAU,cAQrB;AAEK,MAAM,WAAW,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACxE,EAAE,QAAQ,EAAE,GAAG,EAAE;IACjB;QACE,MAAM,EAAE;YACN,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,EAAE;SACX;KACF;CACF,CAAC;AARW,QAAA,WAAW,eAQtB"}
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/filters.ts"],"names":[],"mappings":";;;AACA,qCAA+C;AAExC,MAAM,mBAAmB,GAAG,CACjC,KAAa,EACe,EAAE,CAAC;IAC/B,EAAE,QAAQ,EAAE,4BAAmB,CAAC,QAAQ,EAAE;IAC1C;QACE,MAAM,EAAE;YACN,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,CAAC;SACV;KACF;CACF,CAAC;AAVW,QAAA,mBAAmB,uBAU9B;AAEK,MAAM,UAAU,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACvE,EAAE,QAAQ,EAAE,GAAG,EAAE;IACjB;QACE,MAAM,EAAE;YACN,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,EAAE;SACX;KACF;CACF,CAAC;AARW,QAAA,UAAU,cAQrB;AAEK,MAAM,aAAa,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IAC1E;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AARW,QAAA,aAAa,iBAQxB"}
@@ -1,3 +1,3 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
- export declare function findPowerUserAllocation(owner: string): number | undefined;
2
+ export declare function ownerHasPowerUserAllocation(owner: string): boolean;
3
3
  export declare const findMarginPDA: (owner: string) => PublicKey;
@@ -3,19 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.findMarginPDA = exports.findPowerUserAllocation = void 0;
6
+ exports.findMarginPDA = exports.ownerHasPowerUserAllocation = void 0;
7
7
  const bn_js_1 = __importDefault(require("bn.js"));
8
8
  const web3_js_1 = require("@solana/web3.js");
9
9
  const powerUsers_json_1 = __importDefault(require("./powerUsers.json"));
10
10
  const constants_1 = require("./constants");
11
- function findPowerUserAllocation(owner) {
11
+ function ownerHasPowerUserAllocation(owner) {
12
12
  const users = powerUsers_json_1.default;
13
- const amount = users[owner];
14
- if (!amount)
15
- return undefined;
16
- return amount;
13
+ return users[owner] !== null;
17
14
  }
18
- exports.findPowerUserAllocation = findPowerUserAllocation;
15
+ exports.ownerHasPowerUserAllocation = ownerHasPowerUserAllocation;
19
16
  const findMarginPDA = (owner) => web3_js_1.PublicKey.findProgramAddressSync([
20
17
  Buffer.from('margin'),
21
18
  web3_js_1.PublicKey.findProgramAddressSync([], constants_1.tensorPid)[0].toBytes(),
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAuB;AACvB,6CAA4C;AAC5C,wEAA2C;AAC3C,2CAAwC;AAExC,SAAgB,uBAAuB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AC,CAAC,OAAO,EAAE;IAC9B,8DAA8D;IAC9D,IAAI,eAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,UAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;CAClD,EACD,qBAAS,CACV,CAAC,CAAC,CAAC,CAAC;AAVM,QAAA,aAAa,iBAUnB"}
@@ -16,8 +16,8 @@ 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 helpers_1 = require("./helpers");
20
+ const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
21
21
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
22
22
  const client = (0, clients_1.getClientSolana)();
23
23
  const marginPDA = (0, helpers_1.findMarginPDA)(owner);
@@ -25,23 +25,19 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
25
25
  if (!solRawBalance || solRawBalance === 0)
26
26
  return [];
27
27
  const rent = yield client.getMinimumBalanceForRentExemption(8);
28
- const solTokenPrice = yield cache.getTokenPrice(portfolio_core_1.solanaNativeAddress, portfolio_core_1.NetworkId.solana);
29
- const amount = new bignumber_js_1.default(solRawBalance)
30
- .minus(rent)
31
- .dividedBy(Math.pow(10, portfolio_core_1.solanaNetwork.native.decimals))
32
- .toNumber();
33
- const asset = (0, tokenPriceToAssetToken_1.default)(portfolio_core_1.solanaNativeAddress, amount, portfolio_core_1.NetworkId.solana, solTokenPrice);
34
- return [
35
- {
36
- type: portfolio_core_1.PortfolioElementType.multiple,
37
- label: 'Deposit',
38
- networkId: portfolio_core_1.NetworkId.solana,
39
- platformId: constants_1.platformId,
40
- name: 'Shared Escrow',
41
- value: asset.value,
42
- data: { assets: [asset] },
43
- },
44
- ];
28
+ const amount = new bignumber_js_1.default(solRawBalance).minus(rent);
29
+ if (amount.lte(1000000))
30
+ return [];
31
+ const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
32
+ const element = elementRegistry.addElementMultiple({
33
+ label: 'Deposit',
34
+ name: 'Shared Escrow',
35
+ });
36
+ element.addAsset({
37
+ address: portfolio_core_1.solanaNativeAddress,
38
+ amount,
39
+ });
40
+ return elementRegistry.getElements(cache);
45
41
  });
46
42
  const fetcher = {
47
43
  id: `${constants_1.platformId}-shared-escrow`,
@@ -1 +1 @@
1
- {"version":3,"file":"sharedEscrowFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/sharedEscrowFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AAGrC,2CAAyC;AACzC,iDAAsD;AACtD,qGAA6E;AAC7E,uCAA0C;AAE1C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,SAAS,GAAG,IAAA,uBAAa,EAAC,KAAK,CAAC,CAAC;IAEvC,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAEzD,IAAI,CAAC,aAAa,IAAI,aAAa,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,iCAAiC,CAAC,CAAC,CAAC,CAAC;IAE/D,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,aAAa,CAC7C,oCAAmB,EACnB,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,MAAM,MAAM,GAAG,IAAI,sBAAS,CAAC,aAAa,CAAC;SACxC,KAAK,CAAC,IAAI,CAAC;SACX,SAAS,CAAC,SAAA,EAAE,EAAI,8BAAa,CAAC,MAAM,CAAC,QAAQ,CAAA,CAAC;SAC9C,QAAQ,EAAE,CAAC;IAEd,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,oCAAmB,EACnB,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,aAAa,CACd,CAAC;IAEF,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE;SAC1B;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AACF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,gBAAgB;IACjC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"sharedEscrowFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/sharedEscrowFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA4E;AAC5E,gEAAqC;AAGrC,2CAAyC;AACzC,iDAAsD;AACtD,uCAA0C;AAC1C,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,SAAS,GAAG,IAAA,uBAAa,EAAC,KAAK,CAAC,CAAC;IAEvC,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAEzD,IAAI,CAAC,aAAa,IAAI,aAAa,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,iCAAiC,CAAC,CAAC,CAAC,CAAC;IAE/D,MAAM,MAAM,GAAG,IAAI,sBAAS,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAExD,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IAE1E,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;QACjD,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,eAAe;KACtB,CAAC,CAAC;IAEH,OAAO,CAAC,QAAQ,CAAC;QACf,OAAO,EAAE,oCAAmB;QAC5B,MAAM;KACP,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AACF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,gBAAgB;IACjC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -89,3 +89,8 @@ export type OrderStateLock = {
89
89
  reserved: number[];
90
90
  };
91
91
  export declare const orderStateLockStruct: BeetStruct<OrderStateLock, Partial<OrderStateLock>>;
92
+ export type VestingAccount = {
93
+ padding: Buffer;
94
+ owner: PublicKey;
95
+ };
96
+ export declare const vestingAccountStruct: BeetStruct<VestingAccount, Partial<VestingAccount>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.orderStateLockStruct = exports.OrderType = exports.poolStruct = exports.tSwapStruct = exports.tSwapConfigStruct = exports.poolConfigStruct = exports.CurveType = exports.PoolType = exports.singleListingStruct = void 0;
3
+ exports.vestingAccountStruct = exports.orderStateLockStruct = exports.OrderType = exports.poolStruct = exports.tSwapStruct = exports.tSwapConfigStruct = exports.poolConfigStruct = exports.CurveType = exports.PoolType = exports.singleListingStruct = void 0;
4
4
  const beet_1 = require("@metaplex-foundation/beet");
5
5
  const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
6
  const solana_1 = require("../../utils/solana");
@@ -86,4 +86,8 @@ exports.orderStateLockStruct = new beet_1.BeetStruct([
86
86
  ['takerWithdrawnFunds', solana_1.u64],
87
87
  ['reserved', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 128)],
88
88
  ], (args) => args);
89
+ exports.vestingAccountStruct = new beet_1.BeetStruct([
90
+ ['padding', (0, solana_1.blob)(8)],
91
+ ['owner', beet_solana_1.publicKey],
92
+ ], (args) => args);
89
93
  //# sourceMappingURL=struct.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/struct.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AACnC,kEAA6D;AAG7D,+CAAoD;AAavC,QAAA,mBAAmB,GAAG,IAAI,iBAAU,CAC/C;IACE,CAAC,SAAS,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACpB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,MAAM,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtC,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;CAC5C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAqB,CAChC,CAAC;AAEF,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,yCAAK,CAAA;IACL,qCAAG,CAAA;IACH,yCAAK,CAAA;AACP,CAAC,EAJW,QAAQ,wBAAR,QAAQ,QAInB;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,6CAAM,CAAA;IACN,uDAAW,CAAA;AACb,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAUY,QAAA,gBAAgB,GAAG,IAA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AAC;IAC1B,CAAC,oBAAoB,EAAE,UAAG,CAAC;IAC3B,CAAC,qBAAqB,EAAE,YAAG,CAAC;IAC5B,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,GAAG,CAAC,CAAC;CAC7C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAsB,CACjC,CAAC"}
1
+ {"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/struct.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AACnC,kEAA6D;AAG7D,+CAAoD;AAavC,QAAA,mBAAmB,GAAG,IAAI,iBAAU,CAC/C;IACE,CAAC,SAAS,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACpB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,MAAM,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtC,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;CAC5C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAqB,CAChC,CAAC;AAEF,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,yCAAK,CAAA;IACL,qCAAG,CAAA;IACH,yCAAK,CAAA;AACP,CAAC,EAJW,QAAQ,wBAAR,QAAQ,QAInB;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,6CAAM,CAAA;IACN,uDAAW,CAAA;AACb,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAUY,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,UAAU,EAAE,SAAE,CAAC;IAChB,CAAC,WAAW,EAAE,SAAE,CAAC;IACjB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,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C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAsB,CACjC,CAAC;AAOW,QAAA,oBAAoB,GAAG,IAAI,iBAAU,CAChD;IACE,CAAC,SAAS,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACpB,CAAC,OAAO,EAAE,uBAAS,CAAC;CACrB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAsB,CACjC,CAAC"}
@@ -131,6 +131,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
131
131
  const amountToCollatAmount = collateral.dividedBy(offer.totalAmount);
132
132
  const amount = order.amount.times(amountToCollatAmount).toNumber();
133
133
  const side = offer.offerType === structs_1.OfferType.Buy ? 'Sell Order' : 'Buy Order';
134
+ console.log(offer);
134
135
  const collatAsset = (0, tokenPriceToAssetToken_1.default)(mint, amount, portfolio_core_1.NetworkId.solana, tokenPrice, undefined, {
135
136
  tags: [side],
136
137
  });
@@ -1 +1 @@
1
- {"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/depositFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,6CAA4C;AAG5C,2CAAyD;AACzD,iDAAsD;AACtD,+CAG4B;AAC5B,uCAQmB;AACnB,uCAAyE;AACzE,qGAA6E;AAC7E,mCAA0C;AAE1C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACpE,IAAA,iCAAwB,EAAC,MAAM,EAAE,qBAAW,EAAE,eAAG,EAAE,IAAA,qBAAW,EAAC,KAAK,CAAC,CAAC;QACtE,IAAA,iCAAwB,EAAC,MAAM,EAAE,qBAAW,EAAE,eAAG,EAAE,IAAA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,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAElC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI;YAAE,SAAS;QAC/B,IAAI,IAAI,CAAC;QACT,IAAI,IAAI,CAAC,QAAQ,KAAK,gBAAQ,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,GAAG,QAAQ,CAAC;QAClB,CAAC;aAAM,IAAI,IAAI,CAAC,QAAQ,KAAK,gBAAQ,CAAC,SAAS,EAAE,CAAC;YAChD,IAAI,GAAG,YAAY,CAAC;QACtB,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,GAAG,IAAI,MAAM,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,GAAG;YACjD,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,EAAE,MAAM,EAAE;YAChB,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/depositFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,6CAA4C;AAG5C,2CAAyD;AACzD,iDAAsD;AACtD,+CAG4B;AAC5B,uCAQmB;AACnB,uCAAyE;AACzE,qGAA6E;AA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IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -3,10 +3,11 @@ import { ElementBuilder } from './ElementBuilder';
3
3
  import { ElementParams } from './ElementParams';
4
4
  import { TokenPriceMap } from '../../TokenPriceMap';
5
5
  import { LiquidityBuilder } from './LiquidityBuilder';
6
+ import { LiquidityParams } from './LiquidityParams';
6
7
  export declare class ElementLiquidityBuilder extends ElementBuilder {
7
8
  liquidities: LiquidityBuilder[];
8
9
  constructor(params: ElementParams);
9
- addLiquidity(): LiquidityBuilder;
10
+ addLiquidity(params?: LiquidityParams): LiquidityBuilder;
10
11
  mints(): string[];
11
12
  get(networkId: NetworkIdType, platformId: string, tokenPrices: TokenPriceMap): PortfolioElement | null;
12
13
  }
@@ -9,8 +9,8 @@ class ElementLiquidityBuilder extends ElementBuilder_1.ElementBuilder {
9
9
  super(params);
10
10
  this.liquidities = [];
11
11
  }
12
- addLiquidity() {
13
- const liquidityBuilder = new LiquidityBuilder_1.LiquidityBuilder();
12
+ addLiquidity(params) {
13
+ const liquidityBuilder = new LiquidityBuilder_1.LiquidityBuilder(params);
14
14
  this.liquidities.push(liquidityBuilder);
15
15
  return liquidityBuilder;
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ElementLiquidityBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/ElementLiquidityBuilder.ts"],"names":[],"mappings":";;;AAAA,+DAMoC;AACpC,qDAAkD;AAGlD,yDAAsD;AAEtD,MAAa,uBAAwB,SAAQ,+BAAc;IAGzD,YAAY,MAAqB;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IAED,YAAY;QACV,MAAM,gBAAgB,GAAG,IAAI,mCAAgB,EAAE,CAAC;QAChD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACxC,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACvE,CAAC;IAEQ,GAAG,CACV,SAAwB,EACxB,UAAkB,EAClB,WAA0B;QAE1B,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW;aACjC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;aACzC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAyB,CAAC;QAErD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAE1C,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS;YACT,UAAU;YACV,IAAI,EAAE;gBACJ,WAAW;aACZ;YACD,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC9D,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;QAEF,OAAO,OAAoC,CAAC;IAC9C,CAAC;CACF;AA5CD,0DA4CC"}
1
+ {"version":3,"file":"ElementLiquidityBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/ElementLiquidityBuilder.ts"],"names":[],"mappings":";;;AAAA,+DAMoC;AACpC,qDAAkD;AAGlD,yDA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AAC;CACF;AA5CD,0DA4CC"}
@@ -2,11 +2,13 @@ import { NetworkIdType, PortfolioLiquidity, Yield } from '@sonarwatch/portfolio-
2
2
  import { TokenPriceMap } from '../../TokenPriceMap';
3
3
  import { AssetBuilder } from './AssetBuilder';
4
4
  import { PortfolioAssetParams } from './PortfolioAssetParams';
5
+ import { LiquidityParams } from './LiquidityParams';
5
6
  export declare class LiquidityBuilder {
7
+ private readonly params?;
6
8
  assets: AssetBuilder[];
7
9
  rewardAssets: AssetBuilder[];
8
10
  yields: Yield[];
9
- constructor();
11
+ constructor(params?: LiquidityParams);
10
12
  addAsset(params: PortfolioAssetParams): void;
11
13
  addRewardAsset(params: PortfolioAssetParams): void;
12
14
  addYield(ayield: Yield): void;
@@ -4,10 +4,11 @@ exports.LiquidityBuilder = void 0;
4
4
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
5
5
  const AssetBuilder_1 = require("./AssetBuilder");
6
6
  class LiquidityBuilder {
7
- constructor() {
7
+ constructor(params) {
8
8
  this.assets = [];
9
9
  this.rewardAssets = [];
10
10
  this.yields = [];
11
+ this.params = params;
11
12
  }
12
13
  addAsset(params) {
13
14
  this.assets.push(new AssetBuilder_1.AssetBuilder(params));
@@ -45,6 +46,7 @@ class LiquidityBuilder {
45
46
  rewardAssetsValue,
46
47
  value,
47
48
  yields: this.yields,
49
+ name: this.params ? this.params.name : undefined,
48
50
  };
49
51
  }
50
52
  }
@@ -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;QACvB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACnB,CAAC;IAED,QAAQ,CAAC,MAA4B;QACn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,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,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QAE5B,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;AAI9C,MAAa,gBAAgB;IAM3B,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,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,KAAK;QACH,O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;YAAE,OAAO,IAAI,CAAC;QAE5B,OAAO;YACL,MAAM;YACN,WAAW;YACX,YAAY;YACZ,iBAAiB;YACjB,KAAK;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;SAC3B,CAAC;IAC1B,CAAC;CACF;AA/DD,4CA+DC"}
@@ -0,0 +1,3 @@
1
+ export type LiquidityParams = {
2
+ name?: string;
3
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=LiquidityParams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiquidityParams.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/LiquidityParams.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export declare function convertDecimalStringToScaledBigInt(e: string, t?: number): bigint;
2
- export declare function formatAndCleanBigInt(e: bigint, t?: number): string;
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatAndCleanBigInt = exports.convertDecimalStringToScaledBigInt = void 0;
4
- function convertDecimalStringToScaledBigInt(e, t = 18) {
5
- const n = e.split('.');
6
- if (n.length === 2) {
7
- const [r, i] = n;
8
- if (BigInt(r) > BigInt(0))
9
- return BigInt(`${r}${i}${'0'.repeat(t - i.length)}`);
10
- return i.length < t
11
- ? BigInt(`${i}${'0'.repeat(t - i.length)}`)
12
- : BigInt(`${i}`.substring(0, t));
13
- }
14
- return BigInt(`${e}${'0'.repeat(t)}`);
15
- }
16
- exports.convertDecimalStringToScaledBigInt = convertDecimalStringToScaledBigInt;
17
- function cleanNumericString(e) {
18
- return e
19
- .replace(/0+$/, '')
20
- .replace(/\.$/, '')
21
- .replace(/^0+/, '')
22
- .replace(/^\./, '0.')
23
- .replace(/^$/, '0');
24
- }
25
- function formatBigIntWithDecimals(e, t = 0) {
26
- const n = e.toString();
27
- const r = n.length;
28
- if (r <= t)
29
- return `0.${'0'.repeat(t - r)}${n}`;
30
- {
31
- const i = n.slice(0, r - t);
32
- const s = n.slice(r - t);
33
- return `${i}.${s}`;
34
- }
35
- }
36
- function formatAndCleanBigInt(e, t = 0) {
37
- return cleanNumericString(formatBigIntWithDecimals(e, t));
38
- }
39
- exports.formatAndCleanBigInt = formatAndCleanBigInt;
40
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elixir/helpers.ts"],"names":[],"mappings":";;;AAAA,SAAgB,kCAAkC,CAAC,CAAS,EAAE,CAAC,GAAG,EAAE;IAClE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnB,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;QACjB,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;YACvB,OAAO,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAEvD,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC;YACjB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3C,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAA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