carbon-js-sdk 0.4.4 → 0.4.5
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.
- package/lib/clients/TokenClient.js +10 -2
- package/package.json +1 -1
|
@@ -117,10 +117,18 @@ class TokenClient {
|
|
|
117
117
|
return (_a = util_1.NumberUtils.toUnitless(humanAmt, decimals)) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
|
|
118
118
|
}
|
|
119
119
|
tokenForId(id) {
|
|
120
|
-
|
|
120
|
+
let tokensList = Object.values(this.tokens);
|
|
121
|
+
if (TokenClient.isPoolToken(id)) {
|
|
122
|
+
tokensList = Object.values(this.poolTokens);
|
|
123
|
+
}
|
|
124
|
+
else if (TokenClient.isCdpToken(id)) {
|
|
125
|
+
tokensList = Object.values(this.cdpTokens);
|
|
126
|
+
}
|
|
127
|
+
return tokensList.find((token) => token.id === id);
|
|
121
128
|
}
|
|
122
129
|
tokenForDenom(denom) {
|
|
123
|
-
|
|
130
|
+
var _a, _b;
|
|
131
|
+
return (_b = (_a = this.poolTokens[denom]) !== null && _a !== void 0 ? _a : this.cdpTokens[denom]) !== null && _b !== void 0 ? _b : this.tokens[denom];
|
|
124
132
|
}
|
|
125
133
|
getFeeInfo(denom) {
|
|
126
134
|
return __awaiter(this, void 0, void 0, function* () {
|