@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 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) {
@@ -7,6 +7,7 @@ export declare namespace Odos {
7
7
  interface Route {
8
8
  dstAmount: BN;
9
9
  srcUsd: BN;
10
+ dstUsd: BN;
10
11
  data: string;
11
12
  path: string[];
12
13
  }
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
  };
@@ -13,6 +13,7 @@ export declare namespace Paraswap {
13
13
  interface Route {
14
14
  dstAmount: BN;
15
15
  srcUsd: BN;
16
+ dstUsd: BN;
16
17
  data: string;
17
18
  path: string[];
18
19
  }
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbs-network/twap",
3
- "version": "1.10.6",
3
+ "version": "1.10.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/orbs-network/twap.git"