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.
@@ -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
- return Object.values(this.tokens).find((token) => token.id === id);
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
- return this.tokens[denom];
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* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-js-sdk",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "TypeScript SDK for Carbon blockchain",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",