@sonarwatch/portfolio-plugins 0.12.180 → 0.12.182
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/plugins/bucket/bucketsJob.js +71 -0
- package/src/plugins/bucket/bucketsJob.js.map +1 -0
- package/src/plugins/bucket/collateralFetcher.js +46 -60
- package/src/plugins/bucket/collateralFetcher.js.map +1 -1
- package/src/plugins/bucket/constants.d.ts +8 -5
- package/src/plugins/bucket/constants.js +11 -20
- package/src/plugins/bucket/constants.js.map +1 -1
- package/src/plugins/bucket/index.js +5 -2
- package/src/plugins/bucket/index.js.map +1 -1
- package/src/plugins/bucket/sbuckJob.d.ts +3 -0
- package/src/plugins/bucket/sbuckJob.js +56 -0
- package/src/plugins/bucket/sbuckJob.js.map +1 -0
- package/src/plugins/bucket/stakingFetcher.d.ts +3 -0
- package/src/plugins/bucket/stakingFetcher.js +47 -0
- package/src/plugins/bucket/stakingFetcher.js.map +1 -0
- package/src/plugins/bucket/types.d.ts +113 -0
- package/src/plugins/moonwalk/constants.d.ts +1 -0
- package/src/plugins/moonwalk/constants.js +2 -1
- package/src/plugins/moonwalk/constants.js.map +1 -1
- package/src/plugins/moonwalk/gamesFetcher.js +24 -61
- package/src/plugins/moonwalk/gamesFetcher.js.map +1 -1
- package/src/plugins/moonwalk/index.js +1 -2
- package/src/plugins/moonwalk/index.js.map +1 -1
- package/src/plugins/moonwalk/types.d.ts +12 -0
- package/src/plugins/moonwalk/types.js +3 -0
- package/src/plugins/moonwalk/types.js.map +1 -0
- package/src/plugins/save/obligationsFetcher.js +3 -3
- package/src/plugins/save/obligationsFetcher.js.map +1 -1
- package/src/plugins/moonwalk/gamesJob.js +0 -37
- package/src/plugins/moonwalk/gamesJob.js.map +0 -1
- /package/src/plugins/{moonwalk/gamesJob.d.ts → bucket/bucketsJob.d.ts} +0 -0
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.12.182](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.181...plugins-0.12.182) (2024-10-08)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.12.181](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.180...plugins-0.12.181) (2024-10-08)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.12.180](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.179...plugins-0.12.180) (2024-10-07)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
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,
|
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,y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,mBAAgB;IACnB,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,iBAAc;IACjB,GAAG,iBAAc;IACjB,GAAG,kBAAe;IAClB,GAAG,oBAAiB;IACpB,GAAG,8BAA2B;IAC9B,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,oBAAiB;CACrB,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"}
|
@@ -0,0 +1,71 @@
|
|
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 getObject_1 = require("../../utils/sui/getObject");
|
16
|
+
const getDynamicFieldObjects_1 = require("../../utils/sui/getDynamicFieldObjects");
|
17
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
18
|
+
const client = (0, clients_1.getClientSui)();
|
19
|
+
const [bucketProtocol, fields] = yield Promise.all([
|
20
|
+
(0, getObject_1.getObject)(client, constants_1.bucketProtocolId),
|
21
|
+
(0, getDynamicFieldObjects_1.getDynamicFieldObjects)(client, constants_1.bucketProtocolId),
|
22
|
+
]);
|
23
|
+
const buckets = [];
|
24
|
+
fields.forEach((field) => {
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
26
|
+
if (!((_a = field.data) === null || _a === void 0 ? void 0 : _a.content))
|
27
|
+
return;
|
28
|
+
if ((_c = (_b = field.data) === null || _b === void 0 ? void 0 : _b.type) === null || _c === void 0 ? void 0 : _c.includes('::bucket::Bucket')) {
|
29
|
+
const token = (_f = (_e = (_d = field.data.type) === null || _d === void 0 ? void 0 : _d.split('<').pop()) === null || _e === void 0 ? void 0 : _e.replace('>', '')) !== null && _f !== void 0 ? _f : '';
|
30
|
+
const a = field.data.content.fields;
|
31
|
+
buckets.push({
|
32
|
+
token,
|
33
|
+
baseFeeRate: Number((_g = a.base_fee_rate) !== null && _g !== void 0 ? _g : 5e3),
|
34
|
+
bottleTableSize: (_h = a.bottle_table.fields.table.fields.size) !== null && _h !== void 0 ? _h : '',
|
35
|
+
bottleTableId: (_j = a.bottle_table.fields.table.fields.id.id) !== null && _j !== void 0 ? _j : '',
|
36
|
+
collateralDecimal: (_k = a.collateral_decimal) !== null && _k !== void 0 ? _k : 0,
|
37
|
+
collateralVault: (_l = a.collateral_vault) !== null && _l !== void 0 ? _l : '',
|
38
|
+
latestRedemptionTime: Number((_m = a.latest_redemption_time) !== null && _m !== void 0 ? _m : 0),
|
39
|
+
minCollateralRatio: (_o = a.min_collateral_ratio) !== null && _o !== void 0 ? _o : '',
|
40
|
+
mintedBuckAmount: (_p = a.minted_buck_amount) !== null && _p !== void 0 ? _p : '',
|
41
|
+
minBottleSize: (_r = (_q = bucketProtocol.data) === null || _q === void 0 ? void 0 : _q.content) === null || _r === void 0 ? void 0 : _r.fields.min_bottle_size,
|
42
|
+
maxMintAmount: (_s = a.max_mint_amount) !== null && _s !== void 0 ? _s : '',
|
43
|
+
recoveryModeThreshold: (_t = a.recovery_mode_threshold) !== null && _t !== void 0 ? _t : '',
|
44
|
+
});
|
45
|
+
}
|
46
|
+
});
|
47
|
+
fields.forEach((field) => {
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
49
|
+
if (!((_a = field.data) === null || _a === void 0 ? void 0 : _a.content))
|
50
|
+
return;
|
51
|
+
if ((_c = (_b = field.data) === null || _b === void 0 ? void 0 : _b.type) === null || _c === void 0 ? void 0 : _c.includes('::pipe::Pipe')) {
|
52
|
+
const token = (_h = (_g = (_f = (_e = (_d = field.data) === null || _d === void 0 ? void 0 : _d.type) === null || _e === void 0 ? void 0 : _e.split('<').pop()) === null || _f === void 0 ? void 0 : _f.replace('>', '').split(', ')[0]) === null || _g === void 0 ? void 0 : _g.trim()) !== null && _h !== void 0 ? _h : '';
|
53
|
+
const bucket = buckets.find((b) => b.token === token);
|
54
|
+
if (bucket) {
|
55
|
+
const a = field.data.content.fields;
|
56
|
+
bucket.collateralVault = (BigInt(bucket.collateralVault) + BigInt(a.output_volume)).toString();
|
57
|
+
}
|
58
|
+
}
|
59
|
+
});
|
60
|
+
yield cache.setItem(constants_1.bucketsCacheKey, buckets, {
|
61
|
+
prefix: constants_1.platformId,
|
62
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
63
|
+
});
|
64
|
+
});
|
65
|
+
const job = {
|
66
|
+
id: `${constants_1.platformId}-buckets`,
|
67
|
+
executor,
|
68
|
+
label: 'normal',
|
69
|
+
};
|
70
|
+
exports.default = job;
|
71
|
+
//# sourceMappingURL=bucketsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"bucketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bucket/bucketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAA4E;AAC5E,iDAAmD;AAEnD,yDAAsD;AACtD,mFAAgF;AAEhF,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACjD,IAAA,qBAAS,EAAiB,MAAM,EAAE,4BAAgB,CAAC;QACnD,IAAA,+CAAsB,EAAC,MAAM,EAAE,4BAAgB,CAAC;KACjD,CAAC,CAAC;IAEH,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;;QACvB,IAAI,CAAC,CAAA,MAAA,KAAK,CAAC,IAAI,0CAAE,OAAO,CAAA;YAAE,OAAO;QAEjC,IAAI,MAAA,MAAA,KAAK,CAAC,IAAI,0CAAE,IAAI,0CAAE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACnD,MAAM,KAAK,GAAG,MAAA,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,IAAI,0CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,0CAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,mCAAI,EAAE,CAAC;YAExE,MA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AAM,KAAK,GACT,MAAA,MAAA,MAAA,MAAA,MAAA,KAAK,CAAC,IAAI,0CAAE,IAAI,0CACZ,KAAK,CAAC,GAAG,EACV,GAAG,EAAE,0CACJ,OAAO,CAAC,GAAG,EAAE,EAAE,EAChB,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,0CACb,IAAI,EAAE,mCAAI,EAAE,CAAC;YACnB,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;YACtD,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAoB,CAAC;gBAClD,MAAM,CAAC,eAAe,GAAG,CACvB,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CACzD,CAAC,QAAQ,EAAE,CAAC;YACf,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,CAAC,OAAO,CAAC,2BAAe,EAAE,OAAO,EAAE;QAC5C,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -8,78 +8,64 @@ 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");
|
16
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
13
|
const constants_1 = require("./constants");
|
18
14
|
const clients_1 = require("../../utils/clients");
|
19
|
-
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
20
15
|
const getDynamicFieldObject_1 = require("../../utils/sui/getDynamicFieldObject");
|
16
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
17
|
+
const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
|
18
|
+
const bucketsMemo = new MemoizedCache_1.MemoizedCache(constants_1.bucketsCacheKey, {
|
19
|
+
prefix: constants_1.platformId,
|
20
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
21
|
+
});
|
21
22
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
-
var _a;
|
23
23
|
const client = (0, clients_1.getClientSui)();
|
24
|
-
const
|
25
|
-
if (!
|
24
|
+
const buckets = yield bucketsMemo.getItem(cache);
|
25
|
+
if (!buckets || !buckets.length)
|
26
26
|
return [];
|
27
|
-
const
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
27
|
+
const positions = yield Promise.all(buckets.map((bucket) => __awaiter(void 0, void 0, void 0, function* () {
|
28
|
+
var _a, _b;
|
29
|
+
let address = owner;
|
30
|
+
if (Object.keys(constants_1.bottleTableException).includes(bucket.token)) {
|
31
|
+
const stakeProof = yield (0, getDynamicFieldObject_1.getDynamicFieldObject)(client, {
|
32
|
+
parentId: constants_1.bottleTableException[bucket.token],
|
33
|
+
name: {
|
34
|
+
type: 'address',
|
35
|
+
value: owner,
|
36
|
+
},
|
37
|
+
});
|
38
|
+
address =
|
39
|
+
((_b = (_a = stakeProof.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.value[0].fields.strap_address) ||
|
40
|
+
owner;
|
41
|
+
}
|
42
|
+
return (0, getDynamicFieldObject_1.getDynamicFieldObject)(client, {
|
43
|
+
parentId: bucket.bottleTableId,
|
36
44
|
name: {
|
37
45
|
type: 'address',
|
38
|
-
value:
|
46
|
+
value: address,
|
39
47
|
},
|
40
|
-
};
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
continue;
|
50
|
-
const suppliedQuantity = new bignumber_js_1.default(collateralInfo.collateral_amount)
|
51
|
-
.dividedBy(Math.pow(10, tokenPrice.decimals))
|
52
|
-
.toNumber();
|
53
|
-
if (suppliedQuantity === 0)
|
54
|
-
continue;
|
55
|
-
const borrowedQuantity = new bignumber_js_1.default(collateralInfo.buck_amount)
|
56
|
-
.dividedBy(Math.pow(10, buckPrice.decimals))
|
57
|
-
.toNumber();
|
58
|
-
borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(constants_1.buckId, borrowedQuantity, portfolio_core_1.NetworkId.sui, buckPrice));
|
59
|
-
suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(collateral.tokenId, suppliedQuantity, portfolio_core_1.NetworkId.sui, tokenPrice));
|
60
|
-
const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({ suppliedAssets, borrowedAssets, rewardAssets });
|
61
|
-
const element = {
|
62
|
-
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
63
|
-
networkId: portfolio_core_1.NetworkId.sui,
|
64
|
-
platformId: constants_1.platformId,
|
48
|
+
});
|
49
|
+
})));
|
50
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui, constants_1.platformId);
|
51
|
+
buckets.forEach((bucket, i) => {
|
52
|
+
var _a, _b, _c, _d, _e, _f;
|
53
|
+
const positionData = positions[i];
|
54
|
+
if (!((_b = (_a = positionData.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.value.fields.value.fields))
|
55
|
+
return;
|
56
|
+
const element = elementRegistry.addElementBorrowlend({
|
65
57
|
label: 'Lending',
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
value,
|
78
|
-
},
|
79
|
-
};
|
80
|
-
elements.push(element);
|
81
|
-
}
|
82
|
-
return elements;
|
58
|
+
});
|
59
|
+
element.addBorrowedAsset({
|
60
|
+
address: constants_1.buckId,
|
61
|
+
amount: (_d = (_c = positionData.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields.value.fields.value.fields.buck_amount,
|
62
|
+
});
|
63
|
+
element.addSuppliedAsset({
|
64
|
+
address: bucket.token,
|
65
|
+
amount: (_f = (_e = positionData.data) === null || _e === void 0 ? void 0 : _e.content) === null || _f === void 0 ? void 0 : _f.fields.value.fields.value.fields.collateral_amount,
|
66
|
+
});
|
67
|
+
});
|
68
|
+
return elementRegistry.getElements(cache);
|
83
69
|
});
|
84
70
|
const fetcher = {
|
85
71
|
id: `${constants_1.platformId}-collateral`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"collateralFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bucket/collateralFetcher.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"collateralFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bucket/collateralFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAKqB;AACrB,iDAAmD;AAEnD,iFAA8E;AAC9E,gFAA6E;AAC7E,kEAA+D;AAE/D,MAAM,WAAW,GAAG,IAAI,6BAAa,CAAW,2BAAe,EAAE;IAC/D,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;CACzB,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoB,CAAO,KAAa,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G,SAAS,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,CAAC,CAAA,MAAA,MAAA,YAAY,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAA;YAAE,OAAO;QAE1E,MAAM,OAAO,GAAG,eAAe,CAAC,oBAAoB,CAAC;YACnD,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;QAEH,OAAO,CAAC,gBAAgB,CAAC;YACvB,OAAO,EAAE,kBAAM;YACf,MAAM,EACJ,MAAA,MAAA,YAAY,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CACzD,WAAW;SACjB,CAAC,CAAC;QAEH,OAAO,CAAC,gBAAgB,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC,KAAK;YACrB,MAAM,EACJ,MAAA,MAAA,YAAY,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CACzD,iBAAiB;SACvB,CAAC,CAAC;IACL,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,aAAa;IAC9B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,9 +1,12 @@
|
|
1
1
|
import { Platform } from '@sonarwatch/portfolio-core';
|
2
2
|
export declare const platformId = "bucket";
|
3
3
|
export declare const platform: Platform;
|
4
|
-
export declare const bottleType = "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::bottle::Bottle";
|
5
4
|
export declare const buckId = "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK";
|
6
|
-
export declare const
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
export declare const sbuckId = "0x1798f84ee72176114ddbf5525a6d964c5f8ea1b3738d08d50d0d3de4cf584884::sbuck::SBUCK";
|
6
|
+
export declare const sBuckFlask = "0xc6ecc9731e15d182bc0a46ebe1754a779a4bfb165c201102ad51a36838a1a7b8";
|
7
|
+
export declare const stakeProofParentId = "0xbb4c253eec08636e0416cb8e820b4386c1042747fbdc5a5df6c025c9c6a06fef";
|
8
|
+
export declare const bucketProtocolId = "0x9e3dab13212b27f5434416939db5dec6a319d15b89a84fd074d03ece6350d3df";
|
9
|
+
export declare const bucketsCacheKey = "buckets";
|
10
|
+
export declare const bottleTableException: {
|
11
|
+
[key: string]: string;
|
12
|
+
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.bottleTableException = exports.bucketsCacheKey = exports.bucketProtocolId = exports.stakeProofParentId = exports.sBuckFlask = exports.sbuckId = exports.buckId = exports.platform = exports.platformId = void 0;
|
4
4
|
exports.platformId = 'bucket';
|
5
5
|
exports.platform = {
|
6
6
|
id: exports.platformId,
|
@@ -9,24 +9,15 @@ exports.platform = {
|
|
9
9
|
defiLlamaId: 'bucket-protocol',
|
10
10
|
website: 'https://bucketprotocol.io/',
|
11
11
|
};
|
12
|
-
exports.bottleType = '0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::bottle::Bottle';
|
13
12
|
exports.buckId = '0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK';
|
14
|
-
exports.
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
tokenId: '0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN',
|
25
|
-
parentId: '0x9cba3b4a99686c924ff3dc8940b70b35348bbe457767419be19feaec5594255c',
|
26
|
-
},
|
27
|
-
{
|
28
|
-
tokenId: '0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN',
|
29
|
-
parentId: '0xd21552e2b0df056f5f86206d758d4c87438d302e592575099726bd9d0ea16128',
|
30
|
-
},
|
31
|
-
];
|
13
|
+
exports.sbuckId = '0x1798f84ee72176114ddbf5525a6d964c5f8ea1b3738d08d50d0d3de4cf584884::sbuck::SBUCK';
|
14
|
+
exports.sBuckFlask = '0xc6ecc9731e15d182bc0a46ebe1754a779a4bfb165c201102ad51a36838a1a7b8';
|
15
|
+
exports.stakeProofParentId = '0xbb4c253eec08636e0416cb8e820b4386c1042747fbdc5a5df6c025c9c6a06fef';
|
16
|
+
exports.bucketProtocolId = '0x9e3dab13212b27f5434416939db5dec6a319d15b89a84fd074d03ece6350d3df';
|
17
|
+
exports.bucketsCacheKey = 'buckets';
|
18
|
+
exports.bottleTableException = {
|
19
|
+
'0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc::afsui::AFSUI': '0x95d0d20ab42f78f75a7d63513ed60415b9dcb41c58ef493a7a69b531b212e713',
|
20
|
+
'0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::hasui::HASUI': '0x3674f3183780166553d42174d02229c679e431b9a5911d02a28271a8fd9abd88',
|
21
|
+
'0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT': '0x502760cac10dd4fae78672c1e27bc0e5cdbae449aa2b15dbfb72434af33cb8f6',
|
22
|
+
};
|
32
23
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bucket/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,iBAAiB;IAC9B,OAAO,EAAE,4BAA4B;CACtC,CAAC;AAEW,QAAA,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bucket/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,iBAAiB;IAC9B,OAAO,EAAE,4BAA4B;CACtC,CAAC;AAEW,QAAA,MAAM,GACjB,gFAAgF,CAAC;AACtE,QAAA,OAAO,GAClB,kFAAkF,CAAC;AAExE,QAAA,UAAU,GACrB,oEAAoE,CAAC;AAC1D,QAAA,kBAAkB,GAC7B,oEAAoE,CAAC;AAE1D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAE1D,QAAA,eAAe,GAAG,SAAS,CAAC;AAE5B,QAAA,oBAAoB,GAA8B;IAC7D,kFAAkF,EAChF,oEAAoE;IACtE,kFAAkF,EAChF,oEAAoE;IACtE,gFAAgF,EAC9E,oEAAoE;CACvE,CAAC"}
|
@@ -6,7 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.platforms = exports.fetchers = exports.jobs = void 0;
|
7
7
|
const collateralFetcher_1 = __importDefault(require("./collateralFetcher"));
|
8
8
|
const constants_1 = require("./constants");
|
9
|
-
|
10
|
-
|
9
|
+
const sbuckJob_1 = __importDefault(require("./sbuckJob"));
|
10
|
+
const stakingFetcher_1 = __importDefault(require("./stakingFetcher"));
|
11
|
+
const bucketsJob_1 = __importDefault(require("./bucketsJob"));
|
12
|
+
exports.jobs = [sbuckJob_1.default, bucketsJob_1.default];
|
13
|
+
exports.fetchers = [collateralFetcher_1.default, stakingFetcher_1.default];
|
11
14
|
exports.platforms = [constants_1.platform];
|
12
15
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bucket/index.ts"],"names":[],"mappings":";;;;;;AAGA,4EAAoD;AACpD,2CAAuC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bucket/index.ts"],"names":[],"mappings":";;;;;;AAGA,4EAAoD;AACpD,2CAAuC;AACvC,0DAAkC;AAClC,sEAA8C;AAC9C,8DAAsC;AAEzB,QAAA,IAAI,GAAU,CAAC,kBAAQ,EAAE,oBAAU,CAAC,CAAC;AACrC,QAAA,QAAQ,GAAc,CAAC,2BAAiB,EAAE,wBAAc,CAAC,CAAC;AAC1D,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC"}
|
@@ -0,0 +1,56 @@
|
|
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 bignumber_js_1 = __importDefault(require("bignumber.js"));
|
16
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
|
+
const constants_1 = require("./constants");
|
18
|
+
const clients_1 = require("../../utils/clients");
|
19
|
+
const getObject_1 = require("../../utils/sui/getObject");
|
20
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
21
|
+
var _a;
|
22
|
+
const client = (0, clients_1.getClientSui)();
|
23
|
+
const [flask, buckPrice] = yield Promise.all([
|
24
|
+
(0, getObject_1.getObject)(client, constants_1.sBuckFlask),
|
25
|
+
cache.getTokenPrice(constants_1.buckId, portfolio_core_1.NetworkId.sui),
|
26
|
+
]);
|
27
|
+
if (!buckPrice || !((_a = flask.data) === null || _a === void 0 ? void 0 : _a.content))
|
28
|
+
return;
|
29
|
+
const ratio = new bignumber_js_1.default(flask.data.content.fields.reserves).dividedBy(flask.data.content.fields.sbuck_supply.fields.value);
|
30
|
+
yield cache.setTokenPriceSource({
|
31
|
+
id: constants_1.sBuckFlask,
|
32
|
+
weight: 1,
|
33
|
+
address: constants_1.sbuckId,
|
34
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
35
|
+
platformId: constants_1.platformId,
|
36
|
+
decimals: 9,
|
37
|
+
price: ratio.multipliedBy(buckPrice.price).toNumber(),
|
38
|
+
underlyings: [
|
39
|
+
{
|
40
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
41
|
+
address: constants_1.buckId,
|
42
|
+
price: buckPrice.price,
|
43
|
+
decimals: 9,
|
44
|
+
amountPerLp: ratio.toNumber(),
|
45
|
+
},
|
46
|
+
],
|
47
|
+
timestamp: Date.now(),
|
48
|
+
});
|
49
|
+
});
|
50
|
+
const job = {
|
51
|
+
id: `${constants_1.platformId}-sbuck`,
|
52
|
+
executor,
|
53
|
+
label: 'normal',
|
54
|
+
};
|
55
|
+
exports.default = job;
|
56
|
+
//# sourceMappingURL=sbuckJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"sbuckJob.js","sourceRoot":"","sources":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K,CAAC,QAAQ,EAAE;aAC9B;SACF;QACD,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;KACtB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,47 @@
|
|
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 getDynamicFieldObject_1 = require("../../utils/sui/getDynamicFieldObject");
|
16
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
17
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
18
|
+
var _a;
|
19
|
+
const client = (0, clients_1.getClientSui)();
|
20
|
+
const stakeProof = yield (0, getDynamicFieldObject_1.getDynamicFieldObject)(client, {
|
21
|
+
parentId: constants_1.stakeProofParentId,
|
22
|
+
name: {
|
23
|
+
type: 'address',
|
24
|
+
value: owner,
|
25
|
+
},
|
26
|
+
});
|
27
|
+
if (!((_a = stakeProof.data) === null || _a === void 0 ? void 0 : _a.content))
|
28
|
+
return [];
|
29
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui, constants_1.platformId);
|
30
|
+
stakeProof.data.content.fields.value.forEach((pos) => {
|
31
|
+
const element = elementRegistry.addElementMultiple({
|
32
|
+
label: 'Staked',
|
33
|
+
});
|
34
|
+
element.addAsset({
|
35
|
+
address: constants_1.sbuckId,
|
36
|
+
amount: pos.fields.stake_amount,
|
37
|
+
});
|
38
|
+
});
|
39
|
+
return elementRegistry.getElements(cache);
|
40
|
+
});
|
41
|
+
const fetcher = {
|
42
|
+
id: `${constants_1.platformId}-staking`,
|
43
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
44
|
+
executor,
|
45
|
+
};
|
46
|
+
exports.default = fetcher;
|
47
|
+
//# sourceMappingURL=stakingFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bucket/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAsE;AACtE,iDAAmD;AACnD,iFAA8E;AAC9E,gFAA6E;AAG7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,UAAU,GAAG,MAAM,IAAA,6CAAqB,EAAa,MAAM,EAAE;QACjE,QAAQ,EAAE,8BAAkB;QAC5B,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,KAAK;SACb;KACF,CAAC,CAAC;IAEH,IAAI,CAAC,CAAA,MAAA,UAAU,CAAC,IAAI,0CAAE,OAAO,CAAA;QAAE,OAAO,EAAE,CAAC;IAEzC,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,GAAG,EAAE,sBAAU,CAAC,CAAC;IAEvE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnD,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;YACjD,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;QAEH,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,mBAAO;YAChB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY;SAChC,CAAC,CAAC;IACL,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,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -21,3 +21,116 @@ export type CollateralFields = {
|
|
21
21
|
};
|
22
22
|
};
|
23
23
|
};
|
24
|
+
export type Flask = {
|
25
|
+
id: ID;
|
26
|
+
reserves: string;
|
27
|
+
sbuck_supply: {
|
28
|
+
fields: {
|
29
|
+
value: string;
|
30
|
+
};
|
31
|
+
type: string;
|
32
|
+
};
|
33
|
+
version: string;
|
34
|
+
};
|
35
|
+
export type StakeProof = {
|
36
|
+
id: ID;
|
37
|
+
name: string;
|
38
|
+
value: {
|
39
|
+
fields: {
|
40
|
+
fountain_id: string;
|
41
|
+
id: ID;
|
42
|
+
lock_until: string;
|
43
|
+
stake_amount: string;
|
44
|
+
stake_weight: string;
|
45
|
+
start_uint: string;
|
46
|
+
};
|
47
|
+
type: string;
|
48
|
+
}[];
|
49
|
+
};
|
50
|
+
export type BucketProtocol = {
|
51
|
+
buck_treasury_cap: {
|
52
|
+
fields: {
|
53
|
+
ID: ID;
|
54
|
+
total_supply: {
|
55
|
+
fields: {
|
56
|
+
value: string;
|
57
|
+
};
|
58
|
+
type: string;
|
59
|
+
};
|
60
|
+
};
|
61
|
+
type: string;
|
62
|
+
};
|
63
|
+
id: ID;
|
64
|
+
min_bottle_size: string;
|
65
|
+
version: string;
|
66
|
+
};
|
67
|
+
export type BucketObject = {
|
68
|
+
id: ID;
|
69
|
+
base_fee_rate: string;
|
70
|
+
bottle_table: {
|
71
|
+
fields: {
|
72
|
+
debt_per_unit_stake: string;
|
73
|
+
id: ID;
|
74
|
+
last_debt_error: string;
|
75
|
+
last_reward_error: string;
|
76
|
+
reward_per_unit_stake: string;
|
77
|
+
table: {
|
78
|
+
fields: {
|
79
|
+
id: ID;
|
80
|
+
head: string;
|
81
|
+
size: string;
|
82
|
+
tail: string;
|
83
|
+
};
|
84
|
+
type: string;
|
85
|
+
};
|
86
|
+
total_collateral_snapshot: string;
|
87
|
+
total_stake: string;
|
88
|
+
total_stake_snapshot: string;
|
89
|
+
};
|
90
|
+
type: string;
|
91
|
+
};
|
92
|
+
collateral_decimal: number;
|
93
|
+
collateral_vault: string;
|
94
|
+
latest_redemption_time: string;
|
95
|
+
max_mint_amount: string;
|
96
|
+
min_collateral_ratio: string;
|
97
|
+
minted_buck_amount: string;
|
98
|
+
recovery_mode_threshold: string;
|
99
|
+
surplus_bottle_table: {
|
100
|
+
fields: {
|
101
|
+
id: ID;
|
102
|
+
size: string;
|
103
|
+
};
|
104
|
+
type: string;
|
105
|
+
};
|
106
|
+
total_flash_loan_amount: string;
|
107
|
+
};
|
108
|
+
export type Bucket = {
|
109
|
+
token: string;
|
110
|
+
baseFeeRate: number;
|
111
|
+
bottleTableSize: string;
|
112
|
+
bottleTableId: string;
|
113
|
+
collateralDecimal: number;
|
114
|
+
collateralVault: string;
|
115
|
+
latestRedemptionTime: number;
|
116
|
+
minCollateralRatio: string;
|
117
|
+
mintedBuckAmount: string;
|
118
|
+
minBottleSize: string | undefined;
|
119
|
+
maxMintAmount: string;
|
120
|
+
recoveryModeThreshold: string;
|
121
|
+
};
|
122
|
+
export type PipeObject = {
|
123
|
+
output_volume: string;
|
124
|
+
};
|
125
|
+
export type FountainStakeProof = {
|
126
|
+
id: ID;
|
127
|
+
name: string;
|
128
|
+
value: {
|
129
|
+
fields: {
|
130
|
+
fountain_id: string;
|
131
|
+
id: ID;
|
132
|
+
strap_address: string;
|
133
|
+
};
|
134
|
+
type: string;
|
135
|
+
}[];
|
136
|
+
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.programId = exports.gamesCacheId = exports.platform = exports.platformId = void 0;
|
3
|
+
exports.api = exports.programId = exports.gamesCacheId = exports.platform = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'moonwalk';
|
6
6
|
exports.platform = {
|
@@ -13,4 +13,5 @@ exports.platform = {
|
|
13
13
|
};
|
14
14
|
exports.gamesCacheId = `games`;
|
15
15
|
exports.programId = new web3_js_1.PublicKey('FitAFk15vtx2PBjfr7QTnefaHRx6HwajRiZMt1DdSSKU');
|
16
|
+
exports.api = 'https://api.moonwalk.fit/api/users/tokens/';
|
16
17
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,qCAAqC;IAC9C,qEAAqE;CACtE,CAAC;AACW,QAAA,YAAY,GAAG,OAAO,CAAC;AACvB,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,8CAA8C,CAC/C,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,qCAAqC;IAC9C,qEAAqE;CACtE,CAAC;AACW,QAAA,YAAY,GAAG,OAAO,CAAC;AACvB,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,GAAG,GAAG,4CAA4C,CAAC"}
|
@@ -13,72 +13,35 @@ 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
|
16
|
+
const axios_1 = __importDefault(require("axios"));
|
17
17
|
const constants_1 = require("./constants");
|
18
|
-
const
|
19
|
-
const solana_1 = require("../../utils/solana");
|
20
|
-
const structs_1 = require("./structs");
|
21
|
-
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
|
-
const constants_2 = require("../bonkrewards/constants");
|
23
|
-
const helpers_1 = require("./helpers");
|
24
|
-
const cachedGames = new Map();
|
25
|
-
let lastCachedGames = 0;
|
18
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
26
19
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
27
|
-
const
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
20
|
+
const apiResponse = yield axios_1.default.get(constants_1.api + owner, {
|
21
|
+
timeout: 3000,
|
22
|
+
});
|
23
|
+
if (!apiResponse.data)
|
24
|
+
return [];
|
25
|
+
const registry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
26
|
+
for (const game of apiResponse.data) {
|
27
|
+
const element = registry.addElementMultiple({
|
28
|
+
label: 'Deposit',
|
29
|
+
name: game.game,
|
33
30
|
});
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
element.addAsset({
|
32
|
+
address: game.token,
|
33
|
+
amount: game.claimable,
|
34
|
+
alreadyShifted: true,
|
35
|
+
attributes: { isClaimable: true },
|
37
36
|
});
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
{
|
44
|
-
memcmp: {
|
45
|
-
bytes: owner,
|
46
|
-
offset: 9,
|
47
|
-
},
|
48
|
-
},
|
49
|
-
]);
|
50
|
-
if (accounts.length === 0)
|
51
|
-
return [];
|
52
|
-
const tokenPrices = yield cache.getTokenPricesAsMap([portfolio_core_1.solanaNativeAddress, solana_1.usdcSolanaMint, constants_2.bonkMint], portfolio_core_1.NetworkId.solana);
|
53
|
-
const assets = [];
|
54
|
-
accounts.forEach((acc) => {
|
55
|
-
if (acc.claimed)
|
56
|
-
return;
|
57
|
-
const game = cachedGames.get(acc.gameId.toString());
|
58
|
-
if (!game)
|
59
|
-
return;
|
60
|
-
const { mint } = (0, helpers_1.getMintFromCurrency)(game.currency);
|
61
|
-
const tokenPrice = tokenPrices.get(mint);
|
62
|
-
const amount = new bignumber_js_1.default(game.playerDeposit).toNumber();
|
63
|
-
const lockedUntil = Number(game.blocktimeEnd);
|
64
|
-
const asset = (0, tokenPriceToAssetToken_1.default)(mint, amount, portfolio_core_1.NetworkId.solana, tokenPrice, tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.price, {
|
65
|
-
lockedUntil,
|
37
|
+
element.addAsset({
|
38
|
+
address: game.token,
|
39
|
+
amount: game.locked,
|
40
|
+
alreadyShifted: true,
|
41
|
+
attributes: { lockedUntil: game.end * 1000 },
|
66
42
|
});
|
67
|
-
|
68
|
-
|
69
|
-
if (assets.length === 0)
|
70
|
-
return [];
|
71
|
-
const element = {
|
72
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
73
|
-
label: 'Deposit',
|
74
|
-
platformId: constants_1.platformId,
|
75
|
-
type: portfolio_core_1.PortfolioElementType.multiple,
|
76
|
-
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
|
77
|
-
data: {
|
78
|
-
assets,
|
79
|
-
},
|
80
|
-
};
|
81
|
-
return [element];
|
43
|
+
}
|
44
|
+
return registry.getElements(cache);
|
82
45
|
});
|
83
46
|
const fetcher = {
|
84
47
|
id: `${constants_1.platformId}-games`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"gamesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/gamesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"gamesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/gamesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA6C;AAE7C,2CAA8C;AAG9C,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,WAAW,GAAyB,MAAM,eAAK,CAAC,GAAG,CAAC,eAAG,GAAG,KAAK,EAAE;QACrE,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,WAAW,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IACnE,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,QAAQ,CAAC,kBAAkB,CAAC;YAC1C,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC;QACH,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,IAAI,CAAC,KAAK;YACnB,MAAM,EAAE,IAAI,CAAC,SAAS;YACtB,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;SAClC,CAAC,CAAC;QACH,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,IAAI,CAAC,KAAK;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,GAAG,IAAI,EAAE;SAC7C,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACrC,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"}
|
@@ -5,9 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
7
|
const constants_1 = require("./constants");
|
8
|
-
const gamesJob_1 = __importDefault(require("./gamesJob"));
|
9
8
|
const gamesFetcher_1 = __importDefault(require("./gamesFetcher"));
|
10
9
|
exports.platforms = [constants_1.platform];
|
11
|
-
exports.jobs = [
|
10
|
+
exports.jobs = [];
|
12
11
|
exports.fetchers = [gamesFetcher_1.default];
|
13
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,sBAAY,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/types.ts"],"names":[],"mappings":""}
|
@@ -31,9 +31,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
31
31
|
if (market)
|
32
32
|
marketsByAddress.set(market.address.toString(), market);
|
33
33
|
});
|
34
|
-
|
34
|
+
for (const marketInfo of marketsByAddress.values()) {
|
35
35
|
if (!marketInfo)
|
36
|
-
|
36
|
+
continue;
|
37
37
|
const seeds = [
|
38
38
|
(0, helpers_1.getObligationSeed)(marketInfo.address, 0),
|
39
39
|
(0, helpers_1.getObligationSeed)(marketInfo.address, 1),
|
@@ -44,7 +44,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
44
44
|
const obligationAddress = yield web3_js_1.PublicKey.createWithSeed(new web3_js_1.PublicKey(owner), seed, constants_1.pid);
|
45
45
|
obligationAddresses.push(obligationAddress);
|
46
46
|
}
|
47
|
-
}
|
47
|
+
}
|
48
48
|
const obligationsRaw = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.obligationStruct, obligationAddresses);
|
49
49
|
if (obligationsRaw.length === 0)
|
50
50
|
return [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAAyD;AAGzD,2CAA0E;AAC1E,uCAA0E;AAE1E,+CAG4B;AAC5B,iDAAsD;AACtD,uCAAyD;AACzD,gGAA6F;AAE7F,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,mBAAmB,GAAgB,EAAE,CAAC;IAE5C,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,CAAe,sBAAU,EAAE;QAC5D,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,MAAM,gBAAgB,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC5D,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACzB,IAAI,MAAM;YAAE,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,MAAM,
|
1
|
+
{"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAAyD;AAGzD,2CAA0E;AAC1E,uCAA0E;AAE1E,+CAG4B;AAC5B,iDAAsD;AACtD,uCAAyD;AACzD,gGAA6F;AAE7F,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,mBAAmB,GAAgB,EAAE,CAAC;IAE5C,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,CAAe,sBAAU,EAAE;QAC5D,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,MAAM,gBAAgB,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC5D,OA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C,IAAI,CAAC,KAAK,CAAC,EACjB,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,MAAM,YAAY,GAAG,MAAM,IAAA,yDAA2B,EAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC9E,MAAM,gBAAgB,GAAqC,IAAI,GAAG,EAAE,CAAC;IACrE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9C,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,OAAO,KAAK,IAAI;YAAE,SAAS;QAE/B,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,IAAA,oCAA0B,EAC/B,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,CACjB,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,37 +0,0 @@
|
|
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 solana_1 = require("../../utils/solana");
|
16
|
-
const structs_1 = require("./structs");
|
17
|
-
const helpers_1 = require("./helpers");
|
18
|
-
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
-
const connection = (0, clients_1.getClientSolana)();
|
20
|
-
const games = yield (0, solana_1.getParsedProgramAccounts)(connection, structs_1.gameStruct, constants_1.programId, [
|
21
|
-
{
|
22
|
-
dataSize: structs_1.gameStruct.byteSize,
|
23
|
-
},
|
24
|
-
]);
|
25
|
-
const cachedGames = games.map((g) => (0, helpers_1.gameToCached)(g));
|
26
|
-
yield cache.setItem(constants_1.gamesCacheId, cachedGames, {
|
27
|
-
prefix: constants_1.platformId,
|
28
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
29
|
-
});
|
30
|
-
});
|
31
|
-
const job = {
|
32
|
-
id: `${constants_1.platformId}-games`,
|
33
|
-
executor,
|
34
|
-
label: 'normal',
|
35
|
-
};
|
36
|
-
exports.default = job;
|
37
|
-
//# sourceMappingURL=gamesJob.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"gamesJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/gamesJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAkE;AAClE,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAuC;AACvC,uCAAyC;AAEzC,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,KAAK,GAAG,MAAM,IAAA,iCAAwB,EAC1C,UAAU,EACV,oBAAU,EACV,qBAAS,EACT;QACE;YACE,QAAQ,EAAE,oBAAU,CAAC,QAAQ;SAC9B;KACF,CACF,CAAC;IACF,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,KAAK,CAAC,OAAO,CAAC,wBAAY,EAAE,WAAW,EAAE;QAC7C,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
File without changes
|