@defillama/sdk 4.0.2 → 4.0.3
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/build/ChainApi.js +10 -1
- package/package.json +1 -1
package/build/ChainApi.js
CHANGED
|
@@ -110,7 +110,16 @@ var ChainApi = /** @class */ (function () {
|
|
|
110
110
|
};
|
|
111
111
|
ChainApi.prototype.add = function (token, balance, _a) {
|
|
112
112
|
var _b = _a === void 0 ? {} : _a, _c = _b.skipChain, skipChain = _c === void 0 ? false : _c;
|
|
113
|
-
|
|
113
|
+
token = token.replace(/\//g, ':');
|
|
114
|
+
var isIBCToken = token.startsWith('ibc:');
|
|
115
|
+
var chain = this.chain;
|
|
116
|
+
if (skipChain || isIBCToken) {
|
|
117
|
+
chain = undefined;
|
|
118
|
+
}
|
|
119
|
+
if (chain === 'injective' && token.startsWith('peggy0x')) {
|
|
120
|
+
chain = 'ethereum';
|
|
121
|
+
token = token.replace('peggy', '');
|
|
122
|
+
}
|
|
114
123
|
(0, generalUtil_1.sumSingleBalance)(this._balances, token, balance, chain);
|
|
115
124
|
};
|
|
116
125
|
ChainApi.prototype.addToken = function (token, balance, _a) {
|