@sonarwatch/portfolio-plugins 0.11.202 → 0.11.204

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.11.204](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.203...plugins-0.11.204) (2024-05-14)
6
+
7
+
8
+
9
+ ## [0.11.203](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.202...plugins-0.11.203) (2024-05-14)
10
+
11
+
12
+
5
13
  ## [0.11.202](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.201...plugins-0.11.202) (2024-05-06)
6
14
 
7
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.11.202",
3
+ "version": "0.11.204",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
@@ -41,7 +41,7 @@
41
41
  "web3-v1": "npm:web3@^1.5.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "@sonarwatch/portfolio-core": "0.11.202"
44
+ "@sonarwatch/portfolio-core": "0.11.204"
45
45
  },
46
46
  "main": "./src/index.js",
47
47
  "types": "./src/index.d.ts"
package/src/index.js CHANGED
@@ -110,6 +110,7 @@ const clone_1 = require("./plugins/clone");
110
110
  const sandglass_1 = require("./plugins/sandglass");
111
111
  const kriya_1 = require("./plugins/kriya");
112
112
  const haedal_1 = require("./plugins/haedal");
113
+ const flowx_1 = require("./plugins/flowx");
113
114
  var constants_1 = require("./plugins/tokens/constants");
114
115
  Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
115
116
  Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
@@ -209,6 +210,7 @@ exports.platforms = [
209
210
  ...nosana_1.platforms,
210
211
  ...jito_1.platforms,
211
212
  ...magiceden_1.platforms,
213
+ ...flowx_1.platforms,
212
214
  ...clone_1.platforms,
213
215
  ...sandglass_1.platforms,
214
216
  ...kriya_1.platforms,
@@ -299,6 +301,7 @@ exports.jobs = [
299
301
  ...sandglass_1.jobs,
300
302
  ...kriya_1.jobs,
301
303
  ...haedal_1.jobs,
304
+ ...flowx_1.jobs,
302
305
  ];
303
306
  // FETCHERS //
304
307
  exports.fetchers = [
@@ -387,6 +390,7 @@ exports.fetchers = [
387
390
  ...sandglass_1.fetchers,
388
391
  ...kriya_1.fetchers,
389
392
  ...haedal_1.fetchers,
393
+ ...flowx_1.fetchers,
390
394
  ];
391
395
  exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
392
396
  exports.airdropFetchers = [
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,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+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,6CAI0B;AAC1B,6CAG0B;AAC1B,yCAIwB;AACxB,+CAI2B;AAC3B,uDAG+B;AAC/B,yCAGwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,6CAI0B;AAC1B,+CAI2B;AAC3B,qDA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C;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,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+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,6CAI0B;AAC1B,6CAG0B;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,iDAI4B;AAC5B,iDAI4B;AAC5B,+CAI2B;AAC3B,yCAIwB;AACxB,2CAIyB;AACzB,mDAI6B;AAC7B,2CAIyB;AACzB,2CAIyB;AACzB,sCAIsB;AACtB,+CAI2B;AAC3B,yCAIwB;AACxB,iDAI4B;AAC5B,yCAIwB;AACxB,mDAI6B;AAC7B,qDAI8B;AAC9B,2CAIyB;AACzB,2CAKyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,2CAIyB;AACzB,uDAI+B;AAC/B,6DAIkC;AAClC,2CAIyB;AACzB,yCA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;IACf,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,qBAAkB;IACrB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,sBAAmB;IACtB,GAAG,yBAAsB;IACzB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,2BAAsB;IACzB,GAAG,yBAAkB;IACrB,GAAG,eAAY;IACf,GAAG,cAAW;IACd,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,kBAAe;IAClB,GAAG,cAAW;IACd,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,gBAAa;CACjB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,sBAAmB;IACnB,sBAAmB;CACpB,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ export declare const platformId = "flowx";
3
+ export declare const platform: Platform;
4
+ export declare const flxMint = "0x6dae8ca14311574fdfe555524ea48558e3d1360d1607d1c7f98af867e3b7976c::flx::FLX";
5
+ export declare const xflxMint = "0x65ed6d4e666fcbc1afcd9d4b1d6d4af7def3eeeeaa663f5bebae8101112290f6::xflx::XFLX";
6
+ export declare const flxDecimals = 8;
7
+ export declare const lpDecimals = 8;
8
+ export declare const packageId = "0x943535499ac300765aa930072470e0b515cfd7eebcaa5c43762665eaad9cc6f2";
9
+ export declare const factory = "0xba153169476e8c3114962261d1edc70de5ad9781b83cc617ecc8c1923191cae0";
10
+ export declare const pairsOwner = "0xd15e209f5a250d6055c264975fee57ec09bf9d6acdda3b5f866f76023d1563e6";
11
+ export declare const poolsOwner = "0x5c38d069b2f208b0894078465a31b5beb425104894f3237195c90666a82753a2";
12
+ export declare const stakingParentObject = "0xa3d00f45134cc1949ab98c523c3114c1ae83a8d36f2f73478f713272ca14990f";
13
+ export declare const unstackStruct = "0x7d30f6c265b25255d33de0ed09eec5fb8747cf1a2622646fc8f594cce2180523::staking::UnstakeRecipient";
14
+ export declare const poolsPrefix = "flowx-pools";
15
+ export declare const poolsKey = "pools";
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.poolsKey = exports.poolsPrefix = exports.unstackStruct = exports.stakingParentObject = exports.poolsOwner = exports.pairsOwner = exports.factory = exports.packageId = exports.lpDecimals = exports.flxDecimals = exports.xflxMint = exports.flxMint = exports.platform = exports.platformId = void 0;
4
+ exports.platformId = 'flowx';
5
+ exports.platform = {
6
+ id: exports.platformId,
7
+ name: 'FlowX Finance',
8
+ image: 'https://sonar.watch/img/platforms/flowx.webp',
9
+ defiLlamaId: 'flowx-finance',
10
+ website: 'https://flowx.finance',
11
+ twitter: 'https://twitter.com/FlowX_finance',
12
+ };
13
+ exports.flxMint = '0x6dae8ca14311574fdfe555524ea48558e3d1360d1607d1c7f98af867e3b7976c::flx::FLX';
14
+ exports.xflxMint = '0x65ed6d4e666fcbc1afcd9d4b1d6d4af7def3eeeeaa663f5bebae8101112290f6::xflx::XFLX';
15
+ exports.flxDecimals = 8;
16
+ exports.lpDecimals = 8;
17
+ exports.packageId = '0x943535499ac300765aa930072470e0b515cfd7eebcaa5c43762665eaad9cc6f2';
18
+ exports.factory = '0xba153169476e8c3114962261d1edc70de5ad9781b83cc617ecc8c1923191cae0';
19
+ exports.pairsOwner = '0xd15e209f5a250d6055c264975fee57ec09bf9d6acdda3b5f866f76023d1563e6';
20
+ exports.poolsOwner = '0x5c38d069b2f208b0894078465a31b5beb425104894f3237195c90666a82753a2';
21
+ exports.stakingParentObject = '0xa3d00f45134cc1949ab98c523c3114c1ae83a8d36f2f73478f713272ca14990f';
22
+ exports.unstackStruct = '0x7d30f6c265b25255d33de0ed09eec5fb8747cf1a2622646fc8f594cce2180523::staking::UnstakeRecipient';
23
+ exports.poolsPrefix = `${exports.platformId}-pools`;
24
+ exports.poolsKey = 'pools';
25
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowx/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,eAAe;IAC5B,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,mCAAmC;CAC7C,CAAC;AAEW,QAAA,OAAO,GAClB,8EAA8E,CAAC;AACpE,QAAA,QAAQ,GACnB,gFAAgF,CAAC;AACtE,QAAA,WAAW,GAAG,CAAC,CAAC;AAEhB,QAAA,UAAU,GAAG,CAAC,CAAC;AAEf,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAC1D,QAAA,OAAO,GAClB,oEAAoE,CAAC;AAC1D,QAAA,UAAU,GACrB,oEAAoE,CAAC;AAC1D,QAAA,UAAU,GACrB,oEAAoE,CAAC;AAC1D,QAAA,mBAAmB,GAC9B,oEAAoE,CAAC;AAC1D,QAAA,aAAa,GACxB,+FAA+F,CAAC;AAErF,QAAA,WAAW,GAAG,GAAG,kBAAU,QAAQ,CAAC;AACpC,QAAA,QAAQ,GAAG,OAAO,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function getUnlockingAt(unlockedAtEpoch: string): number;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUnlockingAt = void 0;
4
+ function getUnlockingAt(unlockedAtEpoch) {
5
+ // https://suivision.xyz/object/0xcc9def46072f7ef0e81e1793a718a58ec94d5ed95e9f7254f4a226426aa4db5a
6
+ const initialEpoch = 6;
7
+ const initialEpochStart = 1713949200;
8
+ const epochDuration = 1209600;
9
+ return ((Number(unlockedAtEpoch) - initialEpoch) * epochDuration + initialEpochStart);
10
+ }
11
+ exports.getUnlockingAt = getUnlockingAt;
12
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowx/helpers.ts"],"names":[],"mappings":";;;AAAA,SAAgB,cAAc,CAAC,eAAuB;IACpD,kGAAkG;IAClG,MAAM,YAAY,GAAG,CAAC,CAAC;IACvB,MAAM,iBAAiB,GAAG,UAAU,CAAC;IACrC,MAAM,aAAa,GAAG,OAAO,CAAC;IAE9B,OAAO,CACL,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,YAAY,CAAC,GAAG,aAAa,GAAG,iBAAiB,CAC7E,CAAC;AACJ,CAAC;AATD,wCASC"}
@@ -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,15 @@
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 stakingFetcher_1 = __importDefault(require("./stakingFetcher"));
9
+ const poolJob_1 = __importDefault(require("./poolJob"));
10
+ const stakingPoolJob_1 = __importDefault(require("./stakingPoolJob"));
11
+ const stakingPoolFetcher_1 = __importDefault(require("./stakingPoolFetcher"));
12
+ exports.platforms = [constants_1.platform];
13
+ exports.jobs = [poolJob_1.default, stakingPoolJob_1.default];
14
+ exports.fetchers = [stakingFetcher_1.default, stakingPoolFetcher_1.default];
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowx/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;AAC9C,wDAAgC;AAChC,sEAA8C;AAC9C,8EAAsD;AAEzC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,iBAAO,EAAE,wBAAc,CAAC,CAAC;AACxC,QAAA,QAAQ,GAAc,CAAC,wBAAc,EAAE,4BAAkB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,109 @@
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 getDynamicFields_1 = require("../../utils/sui/getDynamicFields");
16
+ const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
17
+ const getLpTokenSourceRaw_1 = require("../../utils/misc/getLpTokenSourceRaw");
18
+ const aptos_1 = require("../../utils/aptos");
19
+ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
20
+ const client = (0, clients_1.getClientSui)();
21
+ const pairIds = yield (0, getDynamicFields_1.getDynamicFields)(client, constants_1.pairsOwner).then((pairs) => pairs.map((p) => p.objectId));
22
+ if (pairIds.length === 0)
23
+ return;
24
+ const lpSources = [];
25
+ const pairObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, pairIds, {
26
+ showContent: true,
27
+ });
28
+ const pairInfos = pairObjects.map((pairInfo) => {
29
+ var _a, _b, _c, _d;
30
+ if (!((_b = (_a = pairInfo.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.value.fields)) {
31
+ return null;
32
+ }
33
+ const enhancedPairInfo = (_d = (_c = pairInfo.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields.value.fields;
34
+ const { keys: coinTypeX } = (0, aptos_1.parseTypeString)(enhancedPairInfo.reserve_x.type);
35
+ if (coinTypeX) {
36
+ enhancedPairInfo.reserve_x.coinType = coinTypeX[0].type;
37
+ }
38
+ const { keys: coinTypeY } = (0, aptos_1.parseTypeString)(enhancedPairInfo.reserve_y.type);
39
+ if (coinTypeY) {
40
+ enhancedPairInfo.reserve_y.coinType = coinTypeY[0].type;
41
+ }
42
+ const { keys: coinType } = (0, aptos_1.parseTypeString)(enhancedPairInfo.lp_supply.type);
43
+ if (coinType) {
44
+ enhancedPairInfo.coinType = coinType[0].type;
45
+ }
46
+ return enhancedPairInfo;
47
+ });
48
+ // list coinTypes
49
+ const coinTypes = new Set();
50
+ pairInfos.forEach((pairInfo) => {
51
+ if (pairInfo) {
52
+ if (pairInfo.reserve_x.coinType &&
53
+ !coinTypes.has(pairInfo.reserve_x.coinType))
54
+ coinTypes.add(pairInfo.reserve_x.coinType);
55
+ if (pairInfo.reserve_y.coinType &&
56
+ !coinTypes.has(pairInfo.reserve_y.coinType))
57
+ coinTypes.add(pairInfo.reserve_y.coinType);
58
+ }
59
+ });
60
+ // get tokenPrices
61
+ const tokenPrices = yield cache.getTokenPricesAsMap([...coinTypes], portfolio_core_1.NetworkId.sui);
62
+ pairInfos.forEach((pairInfo) => {
63
+ if (!pairInfo ||
64
+ !pairInfo.reserve_x.coinType ||
65
+ !pairInfo.reserve_y.coinType ||
66
+ !pairInfo.coinType)
67
+ return;
68
+ const tokenPriceX = tokenPrices.get((0, portfolio_core_1.formatTokenAddress)(pairInfo.reserve_x.coinType, portfolio_core_1.NetworkId.sui));
69
+ const tokenPriceY = tokenPrices.get((0, portfolio_core_1.formatTokenAddress)(pairInfo.reserve_y.coinType, portfolio_core_1.NetworkId.sui));
70
+ if (!tokenPriceX || !tokenPriceY)
71
+ return;
72
+ const newLpSources = (0, getLpTokenSourceRaw_1.getLpTokenSourceRaw)({
73
+ networkId: portfolio_core_1.NetworkId.sui,
74
+ sourceId: pairInfo.coinType,
75
+ platformId: constants_1.platformId,
76
+ priceUnderlyings: true,
77
+ lpDetails: {
78
+ address: pairInfo.coinType,
79
+ decimals: constants_1.lpDecimals,
80
+ supplyRaw: pairInfo.lp_supply.fields.value,
81
+ },
82
+ poolUnderlyingsRaw: [
83
+ {
84
+ address: (0, portfolio_core_1.formatTokenAddress)(pairInfo.reserve_x.coinType, portfolio_core_1.NetworkId.sui),
85
+ decimals: tokenPriceX.decimals,
86
+ reserveAmountRaw: pairInfo.reserve_x.fields.balance,
87
+ weight: 0.5,
88
+ tokenPrice: tokenPriceX,
89
+ },
90
+ {
91
+ address: (0, portfolio_core_1.formatTokenAddress)(pairInfo.reserve_y.coinType, portfolio_core_1.NetworkId.sui),
92
+ decimals: tokenPriceY.decimals,
93
+ reserveAmountRaw: pairInfo.reserve_y.fields.balance,
94
+ weight: 0.5,
95
+ tokenPrice: tokenPriceY,
96
+ },
97
+ ],
98
+ });
99
+ lpSources.push(...newLpSources);
100
+ });
101
+ yield cache.setTokenPriceSources(lpSources);
102
+ });
103
+ const job = {
104
+ id: `${constants_1.platformId}-pool`,
105
+ executor,
106
+ label: 'normal',
107
+ };
108
+ exports.default = job;
109
+ //# sourceMappingURL=poolJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poolJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowx/poolJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAAiE;AACjE,iDAAmD;AACnD,uEAAoE;AACpE,qEAAkE;AAClE,8EAA2E;AAE3E,6CAAoD;AAEpD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,MAAM,IAAA,mCAAgB,EAAC,MAAM,EAAE,sBAAU,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CACxE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAC7B,CAAC;IACF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEjC,MAAM,SAAS,GAAuB,EAAE,CAAC;IAEzC,MAAM,WAAW,GAAG,MAAM,IAAA,iCAAe,EAAa,MAAM,EAAE,OAAO,EAAE;QACrE,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;;QAC7C,IAAI,CAAC,CAAA,MAAA,MAAA,QAAQ,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAA,EAAE,CAAC;YACjD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,gBAAgB,GACpB,MAAA,MAAA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ClB;oBACE,OAAO,EAAE,IAAA,mCAAkB,EACzB,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAC3B,0BAAS,CAAC,GAAG,CACd;oBACD,QAAQ,EAAE,WAAW,CAAC,QAAQ;oBAC9B,gBAAgB,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO;oBACnD,MAAM,EAAE,GAAG;oBACX,UAAU,EAAE,WAAW;iBACxB;gBACD;oBACE,OAAO,EAAE,IAAA,mCAAkB,EACzB,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAC3B,0BAAS,CAAC,GAAG,CACd;oBACD,QAAQ,EAAE,WAAW,CAAC,QAAQ;oBAC9B,gBAAgB,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO;oBACnD,MAAM,EAAE,GAAG;oBACX,UAAU,EAAE,WAAW;iBACxB;aACF;SACF,CAAC,CAAC;QAEH,SAAS,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;AAC9C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
+ const constants_1 = require("./constants");
18
+ const getDynamicFieldObject_1 = require("../../utils/sui/getDynamicFieldObject");
19
+ const clients_1 = require("../../utils/clients");
20
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
21
+ const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
22
+ const helpers_1 = require("./helpers");
23
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
24
+ var _a, _b, _c;
25
+ const client = (0, clients_1.getClientSui)();
26
+ const [stakingPosition, unstakingPositions] = yield Promise.all([
27
+ (0, getDynamicFieldObject_1.getDynamicFieldObject)(client, {
28
+ parentId: constants_1.stakingParentObject,
29
+ name: { type: 'address', value: owner },
30
+ }),
31
+ (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
32
+ filter: {
33
+ StructType: constants_1.unstackStruct,
34
+ },
35
+ options: {
36
+ showContent: true,
37
+ },
38
+ }),
39
+ ]);
40
+ if (unstakingPositions.length === 0 &&
41
+ ((_b = (_a = stakingPosition.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.value.fields.amount) === '0')
42
+ return [];
43
+ // Token Prices
44
+ const [xflxTokenPrice, flxTokenPrice, suiTokenPrice] = yield cache.getTokenPrices([constants_1.xflxMint, constants_1.flxMint, portfolio_core_1.suiNativeAddress], portfolio_core_1.NetworkId.sui);
45
+ const assets = [];
46
+ if (!stakingPosition.error &&
47
+ ((_c = stakingPosition.data) === null || _c === void 0 ? void 0 : _c.content) &&
48
+ stakingPosition.data.content.fields.value.fields.amount !== '0') {
49
+ const amount = new bignumber_js_1.default(stakingPosition.data.content.fields.value.fields.amount).dividedBy(Math.pow(10, constants_1.lpDecimals));
50
+ assets.push((0, tokenPriceToAssetToken_1.default)(constants_1.xflxMint, amount.toNumber(), portfolio_core_1.NetworkId.sui, xflxTokenPrice));
51
+ assets.push((0, tokenPriceToAssetToken_1.default)(portfolio_core_1.suiNativeAddress, new bignumber_js_1.default(stakingPosition.data.content.fields.value.fields.sui_pending)
52
+ .dividedBy(Math.pow(10, portfolio_core_1.suiNativeDecimals))
53
+ .toNumber(), portfolio_core_1.NetworkId.sui, suiTokenPrice, undefined, { isClaimable: true }));
54
+ assets.push((0, tokenPriceToAssetToken_1.default)(constants_1.flxMint, new bignumber_js_1.default(stakingPosition.data.content.fields.value.fields.flx_pending)
55
+ .dividedBy(Math.pow(10, constants_1.flxDecimals))
56
+ .toNumber(), portfolio_core_1.NetworkId.sui, flxTokenPrice, undefined, { isClaimable: true }));
57
+ }
58
+ unstakingPositions.forEach((unstakingPosition) => {
59
+ var _a, _b;
60
+ const fields = (_b = (_a = unstakingPosition.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields;
61
+ if (fields && fields.balance !== '0') {
62
+ const amount = new bignumber_js_1.default(fields.balance).dividedBy(Math.pow(10, constants_1.lpDecimals));
63
+ const unlockingAt = (0, helpers_1.getUnlockingAt)(fields.unlocked_at_epoch);
64
+ const asset = Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(constants_1.xflxMint, amount.toNumber(), portfolio_core_1.NetworkId.sui, xflxTokenPrice)), { attributes: {
65
+ tags: ['unstaking'],
66
+ lockedUntil: unlockingAt,
67
+ } });
68
+ assets.push(asset);
69
+ }
70
+ });
71
+ if (assets.length === 0)
72
+ return [];
73
+ return [
74
+ {
75
+ type: portfolio_core_1.PortfolioElementType.multiple,
76
+ label: 'Staked',
77
+ networkId: portfolio_core_1.NetworkId.sui,
78
+ platformId: constants_1.platformId,
79
+ data: { assets },
80
+ value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
81
+ },
82
+ ];
83
+ });
84
+ const fetcher = {
85
+ id: `${constants_1.platformId}-staking`,
86
+ networkId: portfolio_core_1.NetworkId.sui,
87
+ executor,
88
+ };
89
+ exports.default = fetcher;
90
+ //# sourceMappingURL=stakingFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowx/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,gEAAqC;AAGrC,2CAQqB;AACrB,iFAA8E;AAC9E,iDAAmD;AAEnD,qGAA6E;AAC7E,qEAAkE;AAClE,uCAA2C;AAE3C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC9D,IAAA,6CAAqB,EAAkB,MAAM,EAAE;YAC7C,QAAQ,EAAE,+BAAmB;YAC7B,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE;SACxC,CAAC;QACF,IAAA,iCAAe,EAA0B,MAAM,EAAE,KAAK,EAAE;YACtD,MAAM,EAAE;gBACN,UAAU,EAAE,yBAAa;aAC1B;YACD,OAAO,EAAE;gBACP,WAAW,EAAE,IAAI;aAClB;SACF,CAAC;KACH,CAAC,CAAC;IACH,IACE,kBAAkB,CAAC,MAAM,KAAK,CAAC;QAC/B,CAAA,MAAA,MAAA,eAAe,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,MAAK,GAAG;QAEjE,OAAO,EAAE,CAAC;IAEZ,eAAe;IACf,MA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AE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
+ const constants_1 = require("./constants");
18
+ const clients_1 = require("../../utils/clients");
19
+ const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
20
+ const tokenPriceToAssetTokens_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetTokens"));
21
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
22
+ var _a, _b, _c, _d, _e, _f, _g;
23
+ const client = (0, clients_1.getClientSui)();
24
+ const activePositions = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
25
+ filter: {
26
+ StructType: `${constants_1.packageId}::position::Position`,
27
+ },
28
+ }).then((positions) => positions.filter((pos) => { var _a, _b; return Number((_b = (_a = pos.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.amount) > 0; }));
29
+ if (activePositions.length === 0)
30
+ return [];
31
+ const pools = yield cache.getItem(constants_1.poolsKey, {
32
+ prefix: constants_1.poolsPrefix,
33
+ networkId: portfolio_core_1.NetworkId.sui,
34
+ });
35
+ if (!pools)
36
+ return [];
37
+ const mints = new Set();
38
+ activePositions.forEach((position) => {
39
+ var _a, _b;
40
+ if (!((_b = (_a = position.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.pool_idx))
41
+ return;
42
+ const pool = pools[Number(position.data.content.fields.pool_idx)];
43
+ const token = (0, portfolio_core_1.formatMoveTokenAddress)(pool.lpToken);
44
+ mints.add(token);
45
+ });
46
+ const tokenPrices = yield cache.getTokenPricesAsMap([...mints], portfolio_core_1.NetworkId.sui);
47
+ const liquidities = [];
48
+ for (const position of activePositions) {
49
+ if (!((_b = (_a = position.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.pool_idx) ||
50
+ ((_e = (_d = (_c = position.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields) === null || _e === void 0 ? void 0 : _e.amount) === '0')
51
+ continue;
52
+ const pool = pools.at(Number(position.data.content.fields.pool_idx));
53
+ if (!pool)
54
+ continue;
55
+ const coinType = pool.lpToken;
56
+ const tokenPrice = tokenPrices.get((0, portfolio_core_1.formatTokenAddress)(coinType, portfolio_core_1.NetworkId.sui));
57
+ if (!tokenPrice)
58
+ continue;
59
+ const amount = new bignumber_js_1.default((_g = (_f = position.data) === null || _f === void 0 ? void 0 : _f.content.fields) === null || _g === void 0 ? void 0 : _g.amount)
60
+ .dividedBy(Math.pow(10, tokenPrice.decimals))
61
+ .toNumber();
62
+ if (amount === 0)
63
+ continue;
64
+ const assets = (0, tokenPriceToAssetTokens_1.default)(coinType, amount, portfolio_core_1.NetworkId.sui, tokenPrice);
65
+ const liquidity = {
66
+ assets,
67
+ assetsValue: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
68
+ rewardAssets: [],
69
+ rewardAssetsValue: 0,
70
+ value: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
71
+ yields: [],
72
+ name: tokenPrice.liquidityName,
73
+ };
74
+ liquidities.push(liquidity);
75
+ }
76
+ if (liquidities.length === 0)
77
+ return [];
78
+ return [
79
+ {
80
+ type: portfolio_core_1.PortfolioElementType.liquidity,
81
+ networkId: portfolio_core_1.NetworkId.sui,
82
+ platformId: constants_1.platformId,
83
+ label: 'Farming',
84
+ value: (0, portfolio_core_1.getUsdValueSum)(liquidities.map((a) => a.value)),
85
+ data: {
86
+ liquidities,
87
+ },
88
+ },
89
+ ];
90
+ });
91
+ const fetcher = {
92
+ id: `${constants_1.platformId}-staking-pool`,
93
+ networkId: portfolio_core_1.NetworkId.sui,
94
+ executor,
95
+ };
96
+ exports.default = fetcher;
97
+ //# sourceMappingURL=stakingPoolFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stakingPoolFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowx/stakingPoolFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,gEAAqC;AAGrC,2CAA2E;AAC3E,iDAAmD;AAEnD,qEAAkE;AAClE,uGAA+E;AAE/E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,eAAe,GAAG,MAAM,IAAA,iCAAe,EAAiB,MAAM,EAAE,KAAK,EAAE;QAC3E,MAAM,EAAE;YACN,UAAU,EAAE,GAAG,qBAAS,sBAAsB;SAC/C;KACF,CAAC,CAAC,IAAI,CAAC,CAAC,S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,EAAE;YACV,IAAI,EAAE,UAAU,CAAC,aAAa;SAC/B,CAAC;QACF,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAExC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACtD,IAAI,EAAE;gBACJ,WAAW;aACZ;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,eAAe;IAChC,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,53 @@
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 getDynamicFields_1 = require("../../utils/sui/getDynamicFields");
15
+ const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
16
+ const clients_1 = require("../../utils/clients");
17
+ const aptos_1 = require("../../utils/aptos");
18
+ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
19
+ var _a, _b, _c, _d;
20
+ const client = (0, clients_1.getClientSui)();
21
+ const [poolsIds] = yield Promise.all([
22
+ (0, getDynamicFields_1.getDynamicFields)(client, constants_1.poolsOwner).then((pools) => pools.map((p) => p.objectId)),
23
+ ]);
24
+ const poolsObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, poolsIds);
25
+ const pools = [];
26
+ for (const poolObject of poolsObjects) {
27
+ const poolObjectFields = (_b = (_a = poolObject.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.value.fields;
28
+ if (!poolObjectFields)
29
+ continue;
30
+ const poolId = (_d = (_c = poolObject.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields.name;
31
+ if (!poolId)
32
+ continue;
33
+ const { keys: coinTypeLpToken } = (0, aptos_1.parseTypeString)(poolObjectFields.lp_custodian.type);
34
+ const { keys: coinTypeRewardToken } = (0, aptos_1.parseTypeString)(poolObjectFields.reward_token_custodian.type);
35
+ if (!coinTypeLpToken || !coinTypeRewardToken)
36
+ continue;
37
+ pools[Number(poolId)] = {
38
+ lpToken: coinTypeLpToken[0].type,
39
+ rewardToken: coinTypeRewardToken[0].type,
40
+ };
41
+ }
42
+ yield cache.setItem(constants_1.poolsKey, pools, {
43
+ prefix: constants_1.poolsPrefix,
44
+ networkId: portfolio_core_1.NetworkId.sui,
45
+ });
46
+ });
47
+ const job = {
48
+ id: `${constants_1.platformId}-staking-pool`,
49
+ executor,
50
+ label: 'normal',
51
+ };
52
+ exports.default = job;
53
+ //# sourceMappingURL=stakingPoolJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stakingPoolJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plug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BAAmB;YAAE,SAAS;QAEvD,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG;YACtB,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI;YAChC,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,IAAI;SACjC,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,CAAC,OAAO,CAAC,oBAAQ,EAAE,KAAK,EAAE;QACnC,MAAM,EAAE,uBAAW;QACnB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,eAAe;IAChC,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,78 @@
1
+ export type StakingPosition = {
2
+ id: {
3
+ id: string;
4
+ };
5
+ name: string;
6
+ value: {
7
+ type: string;
8
+ fields: {
9
+ amount: string;
10
+ flx_pending: string;
11
+ sui_pending: string;
12
+ last_settled_epoch: string;
13
+ };
14
+ };
15
+ };
16
+ export type UnstakingPositionObject = {
17
+ balance: string;
18
+ unlocked_at_epoch: string;
19
+ };
20
+ export type PositionObject = {
21
+ amount: string;
22
+ flx_reward_debt: string;
23
+ id: {
24
+ id: string;
25
+ };
26
+ pool_idx: string;
27
+ token_reward_debt: string;
28
+ };
29
+ export type PairObject = {
30
+ value: {
31
+ type: string;
32
+ fields: PairObjectFields;
33
+ };
34
+ };
35
+ export type PairObjectFields = {
36
+ coinType: string | null;
37
+ lp_supply: {
38
+ type: string;
39
+ fields: {
40
+ value: string;
41
+ };
42
+ };
43
+ reserve_x: {
44
+ type: string;
45
+ coinType: string | null;
46
+ fields: {
47
+ value: string;
48
+ balance: string;
49
+ };
50
+ };
51
+ reserve_y: {
52
+ type: string;
53
+ coinType: string | null;
54
+ fields: {
55
+ value: string;
56
+ balance: string;
57
+ };
58
+ };
59
+ };
60
+ export type PoolObject = {
61
+ name: string;
62
+ value: {
63
+ type: string;
64
+ fields: PoolObjectFields;
65
+ };
66
+ };
67
+ export type PoolObjectFields = {
68
+ lp_custodian: {
69
+ type: string;
70
+ };
71
+ reward_token_custodian: {
72
+ type: string;
73
+ };
74
+ };
75
+ export type Pool = {
76
+ lpToken: string;
77
+ rewardToken: string;
78
+ };
@@ -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/flowx/types.ts"],"names":[],"mappings":""}