@ape.swap/bonds-sdk 2.6.8 → 2.6.9
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/dist/main.js +18 -9
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -49151,7 +49151,7 @@ const PRICE_GETTER_ADDRESSES = {
|
|
|
49151
49151
|
[types.ChainId.MATIC]: '0x6908356faC751dA36F4ec1B4ADBc56d0B3862155', // Price getter v2.1
|
|
49152
49152
|
[types.ChainId.MAINNET]: '0x10ffd467e8701fc2887b3df9b9a31adfefd388ec', // Price getter V2.1
|
|
49153
49153
|
[types.ChainId.TLOS]: '0x85d2C626E28a42E184cF8e32db1461013D23331D',
|
|
49154
|
-
[types.ChainId.ARBITRUM]: '
|
|
49154
|
+
[types.ChainId.ARBITRUM]: '0xf1e931A569d8B3Ff5cCd11d2F42422FCABA6DBa4', // Price getter V3 (V2 backwards compatible)
|
|
49155
49155
|
[types.ChainId.LINEA]: '0x35b1eadAbaDD0Edd26076247f3dEdF9E15De8D5D',
|
|
49156
49156
|
[types.ChainId.LIGHTLINK]: '0xC22Db8dDe3A3591fFB02be868Ce2901d30671FE4',
|
|
49157
49157
|
[types.ChainId.IOTA]: '0xC22Db8dDe3A3591fFB02be868Ce2901d30671FE4',
|
|
@@ -71092,7 +71092,7 @@ function getTokenPricesV2FromPriceGetter(tokensToCall_1, chain_1) {
|
|
|
71092
71092
|
function getPriceGetterCallData(tokensToCall, // replace 'any' with the actual type
|
|
71093
71093
|
supportedChainId, lpTokens) {
|
|
71094
71094
|
return Object.values(tokensToCall).map((token) => {
|
|
71095
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
71095
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
71096
71096
|
const liquidityDex = (_a = token.liquidityDex) === null || _a === void 0 ? void 0 : _a[supportedChainId];
|
|
71097
71097
|
let dexFactory;
|
|
71098
71098
|
let protocol = 2;
|
|
@@ -71101,24 +71101,29 @@ supportedChainId, lpTokens) {
|
|
|
71101
71101
|
let factoryAlgebra = (_g = (_f = types.defaultDexFactories === null || types.defaultDexFactories === void 0 ? void 0 : types.defaultDexFactories[supportedChainId]) === null || _f === void 0 ? void 0 : _f[4]) !== null && _g !== void 0 ? _g : ZERO_ADDRESS;
|
|
71102
71102
|
let factorySolidly = (_j = (_h = types.defaultDexFactories === null || types.defaultDexFactories === void 0 ? void 0 : types.defaultDexFactories[supportedChainId]) === null || _h === void 0 ? void 0 : _h[7]) !== null && _j !== void 0 ? _j : ZERO_ADDRESS;
|
|
71103
71103
|
let factoryXFAI = (_l = (_k = types.defaultDexFactories === null || types.defaultDexFactories === void 0 ? void 0 : types.defaultDexFactories[supportedChainId]) === null || _k === void 0 ? void 0 : _k[8]) !== null && _l !== void 0 ? _l : ZERO_ADDRESS;
|
|
71104
|
+
let factoryCurve = (_o = (_m = types.defaultDexFactories === null || types.defaultDexFactories === void 0 ? void 0 : types.defaultDexFactories[supportedChainId]) === null || _m === void 0 ? void 0 : _m[9]) !== null && _o !== void 0 ? _o : ZERO_ADDRESS;
|
|
71104
71105
|
if (liquidityDex) {
|
|
71105
|
-
dexFactory = (
|
|
71106
|
-
protocol = (
|
|
71106
|
+
dexFactory = (_p = types.dexFactories[supportedChainId]) === null || _p === void 0 ? void 0 : _p[liquidityDex];
|
|
71107
|
+
protocol = (_q = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.protocol) !== null && _q !== void 0 ? _q : types.Protocols.V2;
|
|
71107
71108
|
switch (protocol) {
|
|
71108
71109
|
case types.Protocols.V2:
|
|
71109
|
-
factoryV2 = (
|
|
71110
|
+
factoryV2 = (_r = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _r !== void 0 ? _r : factoryV2;
|
|
71110
71111
|
break;
|
|
71111
71112
|
case types.Protocols.V3:
|
|
71112
|
-
factoryV3 = (
|
|
71113
|
+
factoryV3 = (_s = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _s !== void 0 ? _s : factoryV3;
|
|
71113
71114
|
break;
|
|
71114
71115
|
case types.Protocols.Algebra:
|
|
71115
|
-
factoryAlgebra = (
|
|
71116
|
+
factoryAlgebra = (_t = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _t !== void 0 ? _t : factoryAlgebra;
|
|
71116
71117
|
break;
|
|
71117
71118
|
case types.Protocols.Solidly:
|
|
71118
|
-
factorySolidly = (
|
|
71119
|
+
factorySolidly = (_u = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _u !== void 0 ? _u : factorySolidly;
|
|
71119
71120
|
break;
|
|
71120
71121
|
case types.Protocols.XFAI:
|
|
71121
|
-
factoryXFAI = (
|
|
71122
|
+
factoryXFAI = (_v = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _v !== void 0 ? _v : factoryXFAI;
|
|
71123
|
+
break;
|
|
71124
|
+
case types.Protocols.Curve:
|
|
71125
|
+
factoryCurve = (_w = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _w !== void 0 ? _w : factoryCurve;
|
|
71126
|
+
break;
|
|
71122
71127
|
}
|
|
71123
71128
|
}
|
|
71124
71129
|
const errMsg = `No default dex factory found for retrieving price. For Protocol: ${protocol}.`;
|
|
@@ -71146,6 +71151,10 @@ supportedChainId, lpTokens) {
|
|
|
71146
71151
|
if (lpTokens && protocol == types.Protocols.V3) {
|
|
71147
71152
|
protocol = types.Protocols.Steer;
|
|
71148
71153
|
}
|
|
71154
|
+
// This is a temporary fix for Curve. We should move to new Price getter interface. This is the way backwards compatibility is handled for now for Curve.
|
|
71155
|
+
if (protocol == types.Protocols.Curve) {
|
|
71156
|
+
factoryV2 = factoryCurve;
|
|
71157
|
+
}
|
|
71149
71158
|
if ([types.ChainId.LINEA, types.ChainId.LIGHTLINK, types.ChainId.IOTA, types.ChainId.BASE, types.ChainId.ARBITRUM].includes(supportedChainId) &&
|
|
71150
71159
|
!token.lpToken) {
|
|
71151
71160
|
return [
|