carbon-js-sdk 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -416,11 +416,16 @@ class TokenClient {
|
|
|
416
416
|
return coinIds;
|
|
417
417
|
}, []);
|
|
418
418
|
const geckoIdToUsdPriceMap = yield this.getUSDValuesFromCoinGecko(geckoIds);
|
|
419
|
+
const uscStablecoin = this.getNativeStablecoin();
|
|
419
420
|
//store price based on denoms
|
|
420
421
|
for (const denom of denoms) {
|
|
421
422
|
const coinId = (_a = this.geckoTokenNames[denom]) !== null && _a !== void 0 ? _a : denom;
|
|
422
423
|
const price = util_1.NumberUtils.bnOrZero((_b = geckoIdToUsdPriceMap === null || geckoIdToUsdPriceMap === void 0 ? void 0 : geckoIdToUsdPriceMap[coinId]) === null || _b === void 0 ? void 0 : _b.usd);
|
|
423
424
|
if (price.gt(0)) {
|
|
425
|
+
if (denom === (uscStablecoin === null || uscStablecoin === void 0 ? void 0 : uscStablecoin.denom)) {
|
|
426
|
+
this.usdValues[denom] = constant_1.uscUsdValue;
|
|
427
|
+
continue;
|
|
428
|
+
}
|
|
424
429
|
this.usdValues[denom] = price;
|
|
425
430
|
}
|
|
426
431
|
}
|
package/lib/constant/token.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { OptionalNetworkMap, SimpleMap } from "../util/type";
|
|
2
|
+
import BigNumber from "bignumber.js";
|
|
2
3
|
export declare const DenomPrefix: {
|
|
3
4
|
LPToken: string;
|
|
4
5
|
CDPToken: string;
|
|
5
6
|
};
|
|
7
|
+
export declare const uscUsdValue: BigNumber;
|
|
6
8
|
export declare const CommonAssetName: SimpleMap<string>;
|
|
7
9
|
export declare const CoinGeckoTokenNames: SimpleMap<string>;
|
|
8
10
|
export declare const TokenBlacklist: OptionalNetworkMap<string[]>;
|
package/lib/constant/token.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TokenBlacklist = exports.CoinGeckoTokenNames = exports.CommonAssetName = exports.DenomPrefix = void 0;
|
|
6
|
+
exports.TokenBlacklist = exports.CoinGeckoTokenNames = exports.CommonAssetName = exports.uscUsdValue = exports.DenomPrefix = void 0;
|
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
4
8
|
const network_1 = require("./network");
|
|
5
9
|
exports.DenomPrefix = {
|
|
6
10
|
LPToken: "clpt",
|
|
7
11
|
CDPToken: "cibt",
|
|
8
12
|
};
|
|
13
|
+
exports.uscUsdValue = new bignumber_js_1.default(1);
|
|
9
14
|
exports.CommonAssetName = {
|
|
10
15
|
swth: 'swth',
|
|
11
16
|
'swth-n': 'swth',
|