@orbs-network/twap 1.10.6 → 1.10.7
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.d.ts +8 -0
- package/dist/src/lib.js +1 -1
- package/dist/src/odos.d.ts +1 -0
- package/dist/src/odos.js +2 -0
- package/dist/src/paraswap.d.ts +1 -0
- package/dist/src/paraswap.js +1 -1
- package/package.json +1 -1
package/dist/src/lib.d.ts
CHANGED
|
@@ -50,14 +50,22 @@ export declare class TWAPLib {
|
|
|
50
50
|
getToken(address: string): Promise<TokenData>;
|
|
51
51
|
findRoute(srcToken: TokenData, dstToken: TokenData, srcAmount: BN.Value): Promise<{
|
|
52
52
|
data: string;
|
|
53
|
+
srcToken: TokenData;
|
|
54
|
+
dstToken: TokenData;
|
|
55
|
+
srcAmount: BN.Value;
|
|
53
56
|
dstAmount: BN;
|
|
54
57
|
srcUsd: BN;
|
|
58
|
+
dstUsd: BN;
|
|
55
59
|
path: string[];
|
|
56
60
|
}>;
|
|
57
61
|
findRouteForNextBid(order: Order): Promise<{
|
|
58
62
|
data: string;
|
|
63
|
+
srcToken: TokenData;
|
|
64
|
+
dstToken: TokenData;
|
|
65
|
+
srcAmount: BN.Value;
|
|
59
66
|
dstAmount: BN;
|
|
60
67
|
srcUsd: BN;
|
|
68
|
+
dstUsd: BN;
|
|
61
69
|
path: string[];
|
|
62
70
|
}>;
|
|
63
71
|
encodeBidData(route: Paraswap.Route | Odos.Route): string;
|
package/dist/src/lib.js
CHANGED
|
@@ -250,7 +250,7 @@ class TWAPLib {
|
|
|
250
250
|
else {
|
|
251
251
|
route = yield paraswap_1.Paraswap.findRoute(this.config.chainId, srcToken, dstToken, srcAmount, this.config.exchangeAddress, this.config.pathfinderKey);
|
|
252
252
|
}
|
|
253
|
-
return Object.assign(Object.assign({}, route), { data: this.encodeBidData(route) });
|
|
253
|
+
return Object.assign(Object.assign({}, route), { data: this.encodeBidData(route), srcToken, dstToken, srcAmount });
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
256
|
findRouteForNextBid(order) {
|
package/dist/src/odos.d.ts
CHANGED
package/dist/src/odos.js
CHANGED
|
@@ -46,11 +46,13 @@ var Odos;
|
|
|
46
46
|
throw new Error(`${response.statusText}`);
|
|
47
47
|
const j = yield response.json();
|
|
48
48
|
const srcUsd = (0, web3_candies_1.bn)(j.inValues[0]);
|
|
49
|
+
const dstUsd = (0, web3_candies_1.bn)(j.outValues[0]);
|
|
49
50
|
const dstAmount = (0, web3_candies_1.bn)(j.outAmounts[0]);
|
|
50
51
|
const data = yield buildSwapData(j.pathId, dstAmount, exchangeAdapter);
|
|
51
52
|
return {
|
|
52
53
|
dstAmount,
|
|
53
54
|
srcUsd,
|
|
55
|
+
dstUsd,
|
|
54
56
|
data,
|
|
55
57
|
path: [],
|
|
56
58
|
};
|
package/dist/src/paraswap.d.ts
CHANGED
package/dist/src/paraswap.js
CHANGED
|
@@ -59,7 +59,7 @@ var Paraswap;
|
|
|
59
59
|
const route = (yield response.json()).priceRoute;
|
|
60
60
|
const path = getDirectPath(route, onlyDex);
|
|
61
61
|
const data = yield buildSwapData(route, exchangeAdapter);
|
|
62
|
-
return { dstAmount: (0, bignumber_js_1.default)(route.destAmount), srcUsd: (0, bignumber_js_1.default)(route.srcUSD), data, path };
|
|
62
|
+
return { dstAmount: (0, bignumber_js_1.default)(route.destAmount), srcUsd: (0, bignumber_js_1.default)(route.srcUSD), dstUsd: (0, bignumber_js_1.default)(route.destUSD), data, path };
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
Paraswap.findRoute = findRoute;
|