@orbs-network/twap 1.13.0 → 1.13.2

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.
@@ -6,14 +6,16 @@ export interface TokenData {
6
6
  logoUrl?: string;
7
7
  }
8
8
  export declare enum ParaswapOnlyDex {
9
- UniSwapV2 = "Uniswap",
9
+ UniSwap = "Uniswap,UniswapV2,UniswapV3",
10
10
  SushiSwap = "SushiSwap",
11
11
  QuickSwap = "QuickSwap,QuickSwapV3",
12
- SpiritSwap = "SpiritSwap,SpiritSwapV2",
12
+ SpiritSwap = "SpiritSwap,SpiritSwapV2,SpiritSwapV3",
13
13
  SpookySwap = "SpookySwap",
14
14
  Pangolin = "PangolinSwap",
15
- TraderJoe = "TraderJoe",
16
- PancakeSwap = "PancakeSwap,PancakeSwapV2,PancakeSwapV3"
15
+ TraderJoe = "TraderJoe,TraderJoeV2,TraderJoeV2.1",
16
+ Thena = "Thena,ThenaFusion",
17
+ PancakeSwap = "PancakeSwap,PancakeSwapV2,PancakeswapV3",
18
+ Chronos = "Chronos"
17
19
  }
18
20
  export declare enum OdosOnlyDex {
19
21
  Chronos = "Chronos Stable,Chronos Volatile,Wrapped Ether"
@@ -15,14 +15,16 @@ Object.defineProperty(exports, "nativeTokenAddresses", { enumerable: true, get:
15
15
  Object.defineProperty(exports, "zeroAddress", { enumerable: true, get: function () { return web3_candies_2.zeroAddress; } });
16
16
  var ParaswapOnlyDex;
17
17
  (function (ParaswapOnlyDex) {
18
- ParaswapOnlyDex["UniSwapV2"] = "Uniswap";
18
+ ParaswapOnlyDex["UniSwap"] = "Uniswap,UniswapV2,UniswapV3";
19
19
  ParaswapOnlyDex["SushiSwap"] = "SushiSwap";
20
20
  ParaswapOnlyDex["QuickSwap"] = "QuickSwap,QuickSwapV3";
21
- ParaswapOnlyDex["SpiritSwap"] = "SpiritSwap,SpiritSwapV2";
21
+ ParaswapOnlyDex["SpiritSwap"] = "SpiritSwap,SpiritSwapV2,SpiritSwapV3";
22
22
  ParaswapOnlyDex["SpookySwap"] = "SpookySwap";
23
23
  ParaswapOnlyDex["Pangolin"] = "PangolinSwap";
24
- ParaswapOnlyDex["TraderJoe"] = "TraderJoe";
25
- ParaswapOnlyDex["PancakeSwap"] = "PancakeSwap,PancakeSwapV2,PancakeSwapV3";
24
+ ParaswapOnlyDex["TraderJoe"] = "TraderJoe,TraderJoeV2,TraderJoeV2.1";
25
+ ParaswapOnlyDex["Thena"] = "Thena,ThenaFusion";
26
+ ParaswapOnlyDex["PancakeSwap"] = "PancakeSwap,PancakeSwapV2,PancakeswapV3";
27
+ ParaswapOnlyDex["Chronos"] = "Chronos";
26
28
  })(ParaswapOnlyDex = exports.ParaswapOnlyDex || (exports.ParaswapOnlyDex = {}));
27
29
  var OdosOnlyDex;
28
30
  (function (OdosOnlyDex) {
@@ -65,7 +67,7 @@ exports.Configs = {
65
67
  PangolinDaas: Object.assign(Object.assign({}, exports.ChainConfigs.avax), { name: "PangolinDaas", partner: "Orbs:TWAP:PangolinDaas", exchangeAddress: "0x1579EED0527781B1A748043AA1f59a3858Ace4a7", exchangeType: "PangolinDaasExchange", pathfinderKey: ParaswapOnlyDex.Pangolin }),
66
68
  QuickSwap: Object.assign(Object.assign({}, exports.ChainConfigs.poly), { name: "QuickSwap", partner: "Orbs:TWAP:QuickSwap", exchangeAddress: "0x26D0ec4Be402BCE03AAa8aAf0CF67e9428ba54eF", exchangeType: "ParaswapExchange", pathfinderKey: ParaswapOnlyDex.QuickSwap }),
67
69
  Chronos: Object.assign(Object.assign({}, exports.ChainConfigs.arb), { name: "Chronos", partner: "Orbs:TWAP:Chronos", exchangeAddress: "0xA0b07F9a11dFb01388149abBdbc5B4f2196600AB", exchangeType: "OdosExchange", pathfinderKey: OdosOnlyDex.Chronos }),
68
- Thena: Object.assign(Object.assign({}, exports.ChainConfigs.bsc), { name: "Thena", partner: "Orbs:TWAP:Thena", exchangeAddress: "0xc2aBC02acd77Bb2407efA22348dA9afC8B375290", exchangeType: "OpenOceanExchange", pathfinderKey: OpenOceanOnlyDex.Thena }),
70
+ Thena: Object.assign(Object.assign({}, exports.ChainConfigs.bsc), { name: "Thena", partner: "Orbs:TWAP:Thena", exchangeAddress: "0xD63430c74C8E70D9dbdCA04C6a9E6E9E929028DA", exchangeType: "ParaswapExchange", pathfinderKey: ParaswapOnlyDex.Thena }),
69
71
  PancakeSwap: Object.assign(Object.assign({}, exports.ChainConfigs.bsc), { name: "PancakeSwap", partner: "Orbs:TWAP:PancakeSwap", exchangeAddress: "0xD63430c74C8E70D9dbdCA04C6a9E6E9E929028DA", exchangeType: "ParaswapExchange", pathfinderKey: ParaswapOnlyDex.PancakeSwap }),
70
72
  };
71
73
  const chainConfig = (chainId) => lodash_1.default.find(exports.ChainConfigs, (c) => c.chainId === chainId);
@@ -50,7 +50,7 @@ var OpenOcean;
50
50
  const srcUsd = (0, web3_candies_1.bn)(tokens[(0, web3_candies_1.web3)().utils.toChecksumAddress(src.address)].usd);
51
51
  const dstUsd = (0, web3_candies_1.bn)(tokens[(0, web3_candies_1.web3)().utils.toChecksumAddress(dst.address)].usd);
52
52
  const dstAmount = (0, web3_candies_1.bn)(j.data.outAmount);
53
- const data = j.data.data || "";
53
+ const data = j.data.data || "0x";
54
54
  return {
55
55
  dstAmount,
56
56
  srcUsd,
@@ -38,7 +38,7 @@ var Paraswap;
38
38
  throw new Error(`${response.statusText}`);
39
39
  const route = (yield response.json()).priceRoute;
40
40
  const path = getDirectPath(route, onlyDex);
41
- let data = "";
41
+ let data = "0x";
42
42
  try {
43
43
  if (exchangeAdapter !== web3_candies_1.zeroAddress) {
44
44
  data = yield buildSwapData(route, exchangeAdapter);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbs-network/twap",
3
- "version": "1.13.0",
3
+ "version": "1.13.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/orbs-network/twap.git"
@@ -8,7 +8,7 @@
8
8
  "author": "Orbs",
9
9
  "license": "MIT",
10
10
  "dependencies": {
11
- "@defi.org/web3-candies": "4.x"
11
+ "@defi.org/web3-candies": "4.16.x"
12
12
  },
13
13
  "main": "./dist/src/index.js",
14
14
  "types": "./dist/src/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "test:eth": "NETWORK=ETH BLOCK=14905987 hardhat test",
31
31
  "test:ftm": "NETWORK=FTM BLOCK=39800909 hardhat test",
32
32
  "test:poly": "NETWORK=POLY hardhat test",
33
- "test:avax": "NETWORK=AVAX BLOCK=15609313 hardhat test",
33
+ "test:avax": "NETWORK=AVAX hardhat test",
34
34
  "test:arb": "NETWORK=ARB hardhat test",
35
35
  "test:bsc": "NETWORK=BSC hardhat test"
36
36
  },