@sonarwatch/portfolio-plugins 0.11.162 → 0.11.163
Sign up to get free protection for your applications and to get access to all the features.
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.11.163](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.162...plugins-0.11.163) (2024-04-04)
|
6
|
+
|
7
|
+
|
8
|
+
|
5
9
|
## [0.11.162](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.161...plugins-0.11.162) (2024-04-04)
|
6
10
|
|
7
11
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.163",
|
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.
|
44
|
+
"@sonarwatch/portfolio-core": "0.11.163"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
@@ -19,7 +19,7 @@ const constants_1 = require("./constants");
|
|
19
19
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
20
20
|
const banxFactor = new bignumber_js_1.default(Math.pow(10, constants_1.banxDecimals));
|
21
21
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
-
// Account fetch was taking up to 1 min so better to use their API.
|
22
|
+
// Account fetch was taking up to 1 min so better to use their API for now.
|
23
23
|
// const client = getClientSolana();
|
24
24
|
// const accounts = await getParsedProgramAccounts(
|
25
25
|
// client,
|
@@ -39,12 +39,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
39
39
|
.catch(() => null);
|
40
40
|
if (!banxRes)
|
41
41
|
return [];
|
42
|
-
const
|
43
|
-
|
44
|
-
|
42
|
+
const amount = new bignumber_js_1.default(banxRes.data.data.banxTokenStake.tokensStaked).dividedBy(banxFactor);
|
43
|
+
if (amount.isZero())
|
44
|
+
return [];
|
45
45
|
const tokenPrice = yield cache.getTokenPrice(constants_1.banxMint, portfolio_core_1.NetworkId.solana);
|
46
|
-
const assets = [
|
47
|
-
|
46
|
+
const assets = [
|
47
|
+
(0, tokenPriceToAssetToken_1.default)(constants_1.banxMint, amount.toNumber(), portfolio_core_1.NetworkId.solana, tokenPrice),
|
48
|
+
];
|
48
49
|
return [
|
49
50
|
{
|
50
51
|
type: portfolio_core_1.PortfolioElementType.multiple,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/banx/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AACrC,kDAA6C;AAG7C,2CAA6E;AAC7E,qGAA6E;AAG7E,MAAM,UAAU,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,wBAAY,CAAA,CAAC,CAAC;AAErD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/banx/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AACrC,kDAA6C;AAG7C,2CAA6E;AAC7E,qGAA6E;AAG7E,MAAM,UAAU,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,wBAAY,CAAA,CAAC,CAAC;AAErD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,2EAA2E;IAE3E,oCAAoC;I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