@orbs-network/twap 1.12.2 → 1.12.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/dist/src/lib.js +6 -2
- package/package.json +1 -1
package/dist/src/lib.js
CHANGED
|
@@ -19,6 +19,7 @@ const web3_candies_1 = require("@defi.org/web3-candies");
|
|
|
19
19
|
const paraswap_1 = require("./paraswap");
|
|
20
20
|
const lodash_1 = __importDefault(require("lodash"));
|
|
21
21
|
const odos_1 = require("./odos");
|
|
22
|
+
const openocean_1 = require("./openocean");
|
|
22
23
|
class TWAPLib {
|
|
23
24
|
constructor(config, maker, provider) {
|
|
24
25
|
this.config = config;
|
|
@@ -251,10 +252,13 @@ class TWAPLib {
|
|
|
251
252
|
return __awaiter(this, void 0, void 0, function* () {
|
|
252
253
|
let route;
|
|
253
254
|
if (this.config.exchangeType === "OdosExchange") {
|
|
254
|
-
route = yield odos_1.Odos.findRoute(this.config.chainId, srcToken, dstToken, srcAmount, this.config.exchangeAddress, this.config.pathfinderKey);
|
|
255
|
+
route = yield odos_1.Odos.findRoute(this.config.chainId, srcToken, dstToken, srcAmount, this.config.exchangeAddress, this.config.pathfinderKey, this.config.partner);
|
|
256
|
+
}
|
|
257
|
+
else if (this.config.exchangeType === "OpenOceanExchange") {
|
|
258
|
+
route = yield openocean_1.OpenOcean.findRoute(this.config.chainId, srcToken, dstToken, srcAmount, this.config.exchangeAddress, this.config.pathfinderKey, this.config.partner);
|
|
255
259
|
}
|
|
256
260
|
else {
|
|
257
|
-
route = yield paraswap_1.Paraswap.findRoute(this.config.chainId, srcToken, dstToken, srcAmount, this.config.exchangeAddress, this.config.pathfinderKey);
|
|
261
|
+
route = yield paraswap_1.Paraswap.findRoute(this.config.chainId, srcToken, dstToken, srcAmount, this.config.exchangeAddress, this.config.pathfinderKey, this.config.partner);
|
|
258
262
|
}
|
|
259
263
|
return Object.assign(Object.assign({}, route), { data: this.encodeBidData(route), srcToken, dstToken, srcAmount });
|
|
260
264
|
});
|