@orbs-network/twap 1.10.13 → 1.11.1

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.
@@ -1,3 +1,4 @@
1
+ export { nativeTokenAddresses, zeroAddress } from "@defi.org/web3-candies";
1
2
  export interface TokenData {
2
3
  address: string;
3
4
  decimals: number;
@@ -11,7 +12,8 @@ export declare enum ParaswapOnlyDex {
11
12
  SpiritSwap = "SpiritSwap,SpiritSwapV2",
12
13
  SpookySwap = "SpookySwap",
13
14
  Pangolin = "PangolinSwap",
14
- TraderJoe = "TraderJoe"
15
+ TraderJoe = "TraderJoe",
16
+ Thena = ""
15
17
  }
16
18
  export declare enum OdosOnlyDex {
17
19
  Chronos = "Chronos Stable,Chronos Volatile,Wrapped Ether"
@@ -243,14 +245,235 @@ export declare const ChainConfigs: {
243
245
  minChunkSizeUsd: number;
244
246
  nativeToken: {
245
247
  address: string;
246
- decimals: number;
247
248
  symbol: string;
249
+ decimals: number;
248
250
  logoUrl: string;
249
251
  };
250
252
  wToken: {
253
+ symbol: string;
254
+ address: string;
255
+ decimals: number;
256
+ weth: boolean;
257
+ logoUrl: string;
258
+ };
259
+ };
260
+ bsc: {
261
+ twapAbi: ({
262
+ inputs: {
263
+ internalType: string;
264
+ name: string;
265
+ type: string;
266
+ }[];
267
+ stateMutability: string;
268
+ type: string;
269
+ anonymous?: undefined;
270
+ name?: undefined;
271
+ outputs?: undefined;
272
+ } | {
273
+ anonymous: boolean;
274
+ inputs: ({
275
+ indexed: boolean;
276
+ internalType: string;
277
+ name: string;
278
+ type: string;
279
+ components?: undefined;
280
+ } | {
281
+ components: {
282
+ internalType: string;
283
+ name: string;
284
+ type: string;
285
+ }[];
286
+ indexed: boolean;
287
+ internalType: string;
288
+ name: string;
289
+ type: string;
290
+ })[];
291
+ name: string;
292
+ type: string;
293
+ stateMutability?: undefined;
294
+ outputs?: undefined;
295
+ } | {
296
+ inputs: {
297
+ components: {
298
+ internalType: string;
299
+ name: string;
300
+ type: string;
301
+ }[];
302
+ internalType: string;
303
+ name: string;
304
+ type: string;
305
+ }[];
306
+ name: string;
307
+ outputs: {
308
+ internalType: string;
309
+ name: string;
310
+ type: string;
311
+ }[];
312
+ stateMutability: string;
313
+ type: string;
314
+ anonymous?: undefined;
315
+ } | {
316
+ inputs: {
317
+ internalType: string;
318
+ name: string;
319
+ type: string;
320
+ }[];
321
+ name: string;
322
+ outputs: ({
323
+ internalType: string;
324
+ name: string;
325
+ type: string;
326
+ components?: undefined;
327
+ } | {
328
+ components: {
329
+ internalType: string;
330
+ name: string;
331
+ type: string;
332
+ }[];
333
+ internalType: string;
334
+ name: string;
335
+ type: string;
336
+ })[];
337
+ stateMutability: string;
338
+ type: string;
339
+ anonymous?: undefined;
340
+ } | {
341
+ inputs: {
342
+ internalType: string;
343
+ name: string;
344
+ type: string;
345
+ }[];
346
+ name: string;
347
+ outputs: {
348
+ components: ({
349
+ internalType: string;
350
+ name: string;
351
+ type: string;
352
+ components?: undefined;
353
+ } | {
354
+ components: {
355
+ internalType: string;
356
+ name: string;
357
+ type: string;
358
+ }[];
359
+ internalType: string;
360
+ name: string;
361
+ type: string;
362
+ })[];
363
+ internalType: string;
364
+ name: string;
365
+ type: string;
366
+ }[];
367
+ stateMutability: string;
368
+ type: string;
369
+ anonymous?: undefined;
370
+ } | {
371
+ stateMutability: string;
372
+ type: string;
373
+ inputs?: undefined;
374
+ anonymous?: undefined;
375
+ name?: undefined;
376
+ outputs?: undefined;
377
+ })[];
378
+ lensAbi: ({
379
+ inputs: {
380
+ internalType: string;
381
+ name: string;
382
+ type: string;
383
+ }[];
384
+ stateMutability: string;
385
+ type: string;
386
+ name?: undefined;
387
+ outputs?: undefined;
388
+ } | {
389
+ inputs: never[];
390
+ name: string;
391
+ outputs: {
392
+ internalType: string;
393
+ name: string;
394
+ type: string;
395
+ }[];
396
+ stateMutability: string;
397
+ type: string;
398
+ } | {
399
+ inputs: {
400
+ internalType: string;
401
+ name: string;
402
+ type: string;
403
+ }[];
404
+ name: string;
405
+ outputs: {
406
+ components: ({
407
+ internalType: string;
408
+ name: string;
409
+ type: string;
410
+ components?: undefined;
411
+ } | {
412
+ components: {
413
+ internalType: string;
414
+ name: string;
415
+ type: string;
416
+ }[];
417
+ internalType: string;
418
+ name: string;
419
+ type: string;
420
+ })[];
421
+ internalType: string;
422
+ name: string;
423
+ type: string;
424
+ }[];
425
+ stateMutability: string;
426
+ type: string;
427
+ })[];
428
+ takerAbi: ({
429
+ inputs: {
430
+ internalType: string;
431
+ name: string;
432
+ type: string;
433
+ }[];
434
+ stateMutability: string;
435
+ type: string;
436
+ name?: undefined;
437
+ outputs?: undefined;
438
+ } | {
439
+ inputs: {
440
+ internalType: string;
441
+ name: string;
442
+ type: string;
443
+ }[];
444
+ name: string;
445
+ outputs: {
446
+ internalType: string;
447
+ name: string;
448
+ type: string;
449
+ }[];
450
+ stateMutability: string;
451
+ type: string;
452
+ } | {
453
+ stateMutability: string;
454
+ type: string;
455
+ inputs?: undefined;
456
+ name?: undefined;
457
+ outputs?: undefined;
458
+ })[];
459
+ chainName: string;
460
+ chainId: number;
461
+ twapVersion: number;
462
+ twapAddress: string;
463
+ lensAddress: string;
464
+ bidDelaySeconds: number;
465
+ minChunkSizeUsd: number;
466
+ nativeToken: {
251
467
  address: string;
468
+ symbol: string;
252
469
  decimals: number;
470
+ logoUrl: string;
471
+ };
472
+ wToken: {
253
473
  symbol: string;
474
+ address: string;
475
+ decimals: number;
476
+ weth: boolean;
254
477
  logoUrl: string;
255
478
  };
256
479
  };
@@ -462,14 +685,15 @@ export declare const ChainConfigs: {
462
685
  minChunkSizeUsd: number;
463
686
  nativeToken: {
464
687
  address: string;
465
- decimals: number;
466
688
  symbol: string;
689
+ decimals: number;
467
690
  logoUrl: string;
468
691
  };
469
692
  wToken: {
693
+ symbol: string;
470
694
  address: string;
471
695
  decimals: number;
472
- symbol: string;
696
+ weth: boolean;
473
697
  logoUrl: string;
474
698
  };
475
699
  };
@@ -483,14 +707,15 @@ export declare const ChainConfigs: {
483
707
  minChunkSizeUsd: number;
484
708
  nativeToken: {
485
709
  address: string;
486
- decimals: number;
487
710
  symbol: string;
711
+ decimals: number;
488
712
  logoUrl: string;
489
713
  };
490
714
  wToken: {
715
+ symbol: string;
491
716
  address: string;
492
717
  decimals: number;
493
- symbol: string;
718
+ weth: boolean;
494
719
  logoUrl: string;
495
720
  };
496
721
  twapAbi: ({
@@ -880,14 +1105,15 @@ export declare const ChainConfigs: {
880
1105
  minChunkSizeUsd: number;
881
1106
  nativeToken: {
882
1107
  address: string;
883
- decimals: number;
884
1108
  symbol: string;
1109
+ decimals: number;
885
1110
  logoUrl: string;
886
1111
  };
887
1112
  wToken: {
1113
+ symbol: string;
888
1114
  address: string;
889
1115
  decimals: number;
890
- symbol: string;
1116
+ weth: boolean;
891
1117
  logoUrl: string;
892
1118
  };
893
1119
  };
@@ -1099,14 +1325,15 @@ export declare const ChainConfigs: {
1099
1325
  minChunkSizeUsd: number;
1100
1326
  nativeToken: {
1101
1327
  address: string;
1102
- decimals: number;
1103
1328
  symbol: string;
1329
+ decimals: number;
1104
1330
  logoUrl: string;
1105
1331
  };
1106
1332
  wToken: {
1333
+ symbol: string;
1107
1334
  address: string;
1108
1335
  decimals: number;
1109
- symbol: string;
1336
+ weth: boolean;
1110
1337
  logoUrl: string;
1111
1338
  };
1112
1339
  };
@@ -1118,6 +1345,7 @@ export declare const Configs: {
1118
1345
  PangolinDaas: Config;
1119
1346
  QuickSwap: Config;
1120
1347
  Chronos: Config;
1348
+ Thena: Config;
1121
1349
  };
1122
1350
  export declare const chainConfig: (chainId: number) => {
1123
1351
  twapAbi: ({
@@ -1327,14 +1555,15 @@ export declare const chainConfig: (chainId: number) => {
1327
1555
  minChunkSizeUsd: number;
1328
1556
  nativeToken: {
1329
1557
  address: string;
1330
- decimals: number;
1331
1558
  symbol: string;
1559
+ decimals: number;
1332
1560
  logoUrl: string;
1333
1561
  };
1334
1562
  wToken: {
1563
+ symbol: string;
1335
1564
  address: string;
1336
1565
  decimals: number;
1337
- symbol: string;
1566
+ weth: boolean;
1338
1567
  logoUrl: string;
1339
1568
  };
1340
1569
  } | {
@@ -1545,17 +1774,216 @@ export declare const chainConfig: (chainId: number) => {
1545
1774
  minChunkSizeUsd: number;
1546
1775
  nativeToken: {
1547
1776
  address: string;
1548
- decimals: number;
1549
1777
  symbol: string;
1778
+ decimals: number;
1550
1779
  logoUrl: string;
1551
1780
  };
1552
1781
  wToken: {
1782
+ symbol: string;
1553
1783
  address: string;
1554
1784
  decimals: number;
1555
- symbol: string;
1785
+ weth: boolean;
1556
1786
  logoUrl: string;
1557
1787
  };
1558
1788
  } | {
1789
+ twapAbi: ({
1790
+ inputs: {
1791
+ internalType: string;
1792
+ name: string;
1793
+ type: string;
1794
+ }[];
1795
+ stateMutability: string;
1796
+ type: string;
1797
+ anonymous?: undefined;
1798
+ name?: undefined;
1799
+ outputs?: undefined;
1800
+ } | {
1801
+ anonymous: boolean;
1802
+ inputs: ({
1803
+ indexed: boolean;
1804
+ internalType: string;
1805
+ name: string;
1806
+ type: string;
1807
+ components?: undefined;
1808
+ } | {
1809
+ components: {
1810
+ internalType: string;
1811
+ name: string;
1812
+ type: string;
1813
+ }[];
1814
+ indexed: boolean;
1815
+ internalType: string;
1816
+ name: string;
1817
+ type: string;
1818
+ })[];
1819
+ name: string;
1820
+ type: string;
1821
+ stateMutability?: undefined;
1822
+ outputs?: undefined;
1823
+ } | {
1824
+ inputs: {
1825
+ components: {
1826
+ internalType: string;
1827
+ name: string;
1828
+ type: string;
1829
+ }[];
1830
+ internalType: string;
1831
+ name: string;
1832
+ type: string;
1833
+ }[];
1834
+ name: string;
1835
+ outputs: {
1836
+ internalType: string;
1837
+ name: string;
1838
+ type: string;
1839
+ }[];
1840
+ stateMutability: string;
1841
+ type: string;
1842
+ anonymous?: undefined;
1843
+ } | {
1844
+ inputs: {
1845
+ internalType: string;
1846
+ name: string;
1847
+ type: string;
1848
+ }[];
1849
+ name: string;
1850
+ outputs: ({
1851
+ internalType: string;
1852
+ name: string;
1853
+ type: string;
1854
+ components?: undefined;
1855
+ } | {
1856
+ components: {
1857
+ internalType: string;
1858
+ name: string;
1859
+ type: string;
1860
+ }[];
1861
+ internalType: string;
1862
+ name: string;
1863
+ type: string;
1864
+ })[];
1865
+ stateMutability: string;
1866
+ type: string;
1867
+ anonymous?: undefined;
1868
+ } | {
1869
+ inputs: {
1870
+ internalType: string;
1871
+ name: string;
1872
+ type: string;
1873
+ }[];
1874
+ name: string;
1875
+ outputs: {
1876
+ components: ({
1877
+ internalType: string;
1878
+ name: string;
1879
+ type: string;
1880
+ components?: undefined;
1881
+ } | {
1882
+ components: {
1883
+ internalType: string;
1884
+ name: string;
1885
+ type: string;
1886
+ }[];
1887
+ internalType: string;
1888
+ name: string;
1889
+ type: string;
1890
+ })[];
1891
+ internalType: string;
1892
+ name: string;
1893
+ type: string;
1894
+ }[];
1895
+ stateMutability: string;
1896
+ type: string;
1897
+ anonymous?: undefined;
1898
+ } | {
1899
+ stateMutability: string;
1900
+ type: string;
1901
+ inputs?: undefined;
1902
+ anonymous?: undefined;
1903
+ name?: undefined;
1904
+ outputs?: undefined;
1905
+ })[];
1906
+ lensAbi: ({
1907
+ inputs: {
1908
+ internalType: string;
1909
+ name: string;
1910
+ type: string;
1911
+ }[];
1912
+ stateMutability: string;
1913
+ type: string;
1914
+ name?: undefined;
1915
+ outputs?: undefined;
1916
+ } | {
1917
+ inputs: never[];
1918
+ name: string;
1919
+ outputs: {
1920
+ internalType: string;
1921
+ name: string;
1922
+ type: string;
1923
+ }[];
1924
+ stateMutability: string;
1925
+ type: string;
1926
+ } | {
1927
+ inputs: {
1928
+ internalType: string;
1929
+ name: string;
1930
+ type: string;
1931
+ }[];
1932
+ name: string;
1933
+ outputs: {
1934
+ components: ({
1935
+ internalType: string;
1936
+ name: string;
1937
+ type: string;
1938
+ components?: undefined;
1939
+ } | {
1940
+ components: {
1941
+ internalType: string;
1942
+ name: string;
1943
+ type: string;
1944
+ }[];
1945
+ internalType: string;
1946
+ name: string;
1947
+ type: string;
1948
+ })[];
1949
+ internalType: string;
1950
+ name: string;
1951
+ type: string;
1952
+ }[];
1953
+ stateMutability: string;
1954
+ type: string;
1955
+ })[];
1956
+ takerAbi: ({
1957
+ inputs: {
1958
+ internalType: string;
1959
+ name: string;
1960
+ type: string;
1961
+ }[];
1962
+ stateMutability: string;
1963
+ type: string;
1964
+ name?: undefined;
1965
+ outputs?: undefined;
1966
+ } | {
1967
+ inputs: {
1968
+ internalType: string;
1969
+ name: string;
1970
+ type: string;
1971
+ }[];
1972
+ name: string;
1973
+ outputs: {
1974
+ internalType: string;
1975
+ name: string;
1976
+ type: string;
1977
+ }[];
1978
+ stateMutability: string;
1979
+ type: string;
1980
+ } | {
1981
+ stateMutability: string;
1982
+ type: string;
1983
+ inputs?: undefined;
1984
+ name?: undefined;
1985
+ outputs?: undefined;
1986
+ })[];
1559
1987
  chainName: string;
1560
1988
  chainId: number;
1561
1989
  twapVersion: number;
@@ -1565,14 +1993,36 @@ export declare const chainConfig: (chainId: number) => {
1565
1993
  minChunkSizeUsd: number;
1566
1994
  nativeToken: {
1567
1995
  address: string;
1568
- decimals: number;
1569
1996
  symbol: string;
1997
+ decimals: number;
1570
1998
  logoUrl: string;
1571
1999
  };
1572
2000
  wToken: {
2001
+ symbol: string;
1573
2002
  address: string;
1574
2003
  decimals: number;
2004
+ weth: boolean;
2005
+ logoUrl: string;
2006
+ };
2007
+ } | {
2008
+ chainName: string;
2009
+ chainId: number;
2010
+ twapVersion: number;
2011
+ twapAddress: string;
2012
+ lensAddress: string;
2013
+ bidDelaySeconds: number;
2014
+ minChunkSizeUsd: number;
2015
+ nativeToken: {
2016
+ address: string;
1575
2017
  symbol: string;
2018
+ decimals: number;
2019
+ logoUrl: string;
2020
+ };
2021
+ wToken: {
2022
+ symbol: string;
2023
+ address: string;
2024
+ decimals: number;
2025
+ weth: boolean;
1576
2026
  logoUrl: string;
1577
2027
  };
1578
2028
  twapAbi: ({
@@ -1961,14 +2411,15 @@ export declare const chainConfig: (chainId: number) => {
1961
2411
  minChunkSizeUsd: number;
1962
2412
  nativeToken: {
1963
2413
  address: string;
1964
- decimals: number;
1965
2414
  symbol: string;
2415
+ decimals: number;
1966
2416
  logoUrl: string;
1967
2417
  };
1968
2418
  wToken: {
2419
+ symbol: string;
1969
2420
  address: string;
1970
2421
  decimals: number;
1971
- symbol: string;
2422
+ weth: boolean;
1972
2423
  logoUrl: string;
1973
2424
  };
1974
2425
  } | {
@@ -2179,14 +2630,15 @@ export declare const chainConfig: (chainId: number) => {
2179
2630
  minChunkSizeUsd: number;
2180
2631
  nativeToken: {
2181
2632
  address: string;
2182
- decimals: number;
2183
2633
  symbol: string;
2634
+ decimals: number;
2184
2635
  logoUrl: string;
2185
2636
  };
2186
2637
  wToken: {
2638
+ symbol: string;
2187
2639
  address: string;
2188
2640
  decimals: number;
2189
- symbol: string;
2641
+ weth: boolean;
2190
2642
  logoUrl: string;
2191
2643
  };
2192
2644
  };
@@ -3,13 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.chainConfig = exports.Configs = exports.ChainConfigs = exports.OdosOnlyDex = exports.ParaswapOnlyDex = void 0;
6
+ exports.chainConfig = exports.Configs = exports.ChainConfigs = exports.OdosOnlyDex = exports.ParaswapOnlyDex = exports.zeroAddress = exports.nativeTokenAddresses = void 0;
7
7
  const web3_candies_1 = require("@defi.org/web3-candies");
8
8
  const lodash_1 = __importDefault(require("lodash"));
9
9
  const TWAP_json_1 = __importDefault(require("../artifacts/contracts/TWAP.sol/TWAP.json"));
10
10
  const Lens_json_1 = __importDefault(require("../artifacts/contracts/periphery/Lens.sol/Lens.json"));
11
11
  const Taker_json_1 = __importDefault(require("../artifacts/contracts/periphery/Taker.sol/Taker.json"));
12
12
  const legacy_abi_1 = require("./legacy-abi");
13
+ var web3_candies_2 = require("@defi.org/web3-candies");
14
+ Object.defineProperty(exports, "nativeTokenAddresses", { enumerable: true, get: function () { return web3_candies_2.nativeTokenAddresses; } });
15
+ Object.defineProperty(exports, "zeroAddress", { enumerable: true, get: function () { return web3_candies_2.zeroAddress; } });
13
16
  var ParaswapOnlyDex;
14
17
  (function (ParaswapOnlyDex) {
15
18
  ParaswapOnlyDex["UniSwapV2"] = "Uniswap";
@@ -19,6 +22,7 @@ var ParaswapOnlyDex;
19
22
  ParaswapOnlyDex["SpookySwap"] = "SpookySwap";
20
23
  ParaswapOnlyDex["Pangolin"] = "PangolinSwap";
21
24
  ParaswapOnlyDex["TraderJoe"] = "TraderJoe";
25
+ ParaswapOnlyDex["Thena"] = "";
22
26
  })(ParaswapOnlyDex = exports.ParaswapOnlyDex || (exports.ParaswapOnlyDex = {}));
23
27
  var OdosOnlyDex;
24
28
  (function (OdosOnlyDex) {
@@ -30,28 +34,9 @@ const defaultAbis = {
30
34
  takerAbi: Taker_json_1.default.abi,
31
35
  };
32
36
  exports.ChainConfigs = {
33
- eth: Object.assign({ chainName: "eth", chainId: 1, twapVersion: 0, twapAddress: "", lensAddress: "", bidDelaySeconds: 60, minChunkSizeUsd: 100, nativeToken: {
34
- address: web3_candies_1.zeroAddress,
35
- decimals: 18,
36
- symbol: "ETH",
37
- logoUrl: "https://app.1inch.io/assets/images/network-logos/ethereum.svg",
38
- }, wToken: {
39
- address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
40
- decimals: 18,
41
- symbol: "WETH",
42
- logoUrl: "https://tokens.1inch.io/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png",
43
- } }, defaultAbis),
44
- arb: Object.assign({ chainName: "arb", chainId: 42161, twapVersion: 4, twapAddress: "0xD63430c74C8E70D9dbdCA04C6a9E6E9E929028DA", lensAddress: "0xD13609A8ace04D11Ea2FFE176B69dF77C6d9375E", bidDelaySeconds: 60, minChunkSizeUsd: 10, nativeToken: {
45
- address: web3_candies_1.zeroAddress,
46
- decimals: 18,
47
- symbol: "ETH",
48
- logoUrl: "https://app.1inch.io/assets/images/network-logos/ethereum.svg",
49
- }, wToken: {
50
- address: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
51
- decimals: 18,
52
- symbol: "WETH",
53
- logoUrl: "https://tokens.1inch.io/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png",
54
- } }, defaultAbis),
37
+ eth: Object.assign({ chainName: "eth", chainId: 1, twapVersion: 0, twapAddress: "", lensAddress: "", bidDelaySeconds: 60, minChunkSizeUsd: 100, nativeToken: web3_candies_1.networks.eth.native, wToken: web3_candies_1.networks.eth.wToken }, defaultAbis),
38
+ bsc: Object.assign({ chainName: "bsc", chainId: 56, twapVersion: 4, twapAddress: "0x25a0A78f5ad07b2474D3D42F1c1432178465936d", lensAddress: "0x3b7C090857a4068e16396550423ebadae502768F", bidDelaySeconds: 60, minChunkSizeUsd: 10, nativeToken: web3_candies_1.networks.bsc.native, wToken: web3_candies_1.networks.bsc.wToken }, defaultAbis),
39
+ arb: Object.assign({ chainName: "arb", chainId: 42161, twapVersion: 4, twapAddress: "0xD63430c74C8E70D9dbdCA04C6a9E6E9E929028DA", lensAddress: "0xD13609A8ace04D11Ea2FFE176B69dF77C6d9375E", bidDelaySeconds: 60, minChunkSizeUsd: 10, nativeToken: web3_candies_1.networks.arb.native, wToken: web3_candies_1.networks.arb.wToken }, defaultAbis),
55
40
  ftm: {
56
41
  chainName: "ftm",
57
42
  chainId: 250,
@@ -60,44 +45,14 @@ exports.ChainConfigs = {
60
45
  lensAddress: "0x042799657E971855eD619046aeDf7F30DB56d2D6",
61
46
  bidDelaySeconds: 60,
62
47
  minChunkSizeUsd: 10,
63
- nativeToken: {
64
- address: web3_candies_1.zeroAddress,
65
- decimals: 18,
66
- symbol: "FTM",
67
- logoUrl: "https://app.1inch.io/assets/images/network-logos/fantom.svg",
68
- },
69
- wToken: {
70
- address: "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",
71
- decimals: 18,
72
- symbol: "WFTM",
73
- logoUrl: "https://tokens.1inch.io/0x4e15361fd6b4bb609fa63c81a2be19d873717870.png",
74
- },
48
+ nativeToken: web3_candies_1.networks.ftm.native,
49
+ wToken: web3_candies_1.networks.ftm.wToken,
75
50
  twapAbi: legacy_abi_1.twapAbiV3,
76
51
  lensAbi: legacy_abi_1.lensAbiV3,
77
52
  takerAbi: legacy_abi_1.takerAbiV3,
78
53
  },
79
- poly: Object.assign({ chainName: "poly", chainId: 137, twapVersion: 4, twapAddress: "0xceFf098C9199c5d9cf24078dc14Eb8F787631cC0", lensAddress: "0x8ffde23Fba2d7Aea9C3CBf2d5B7B533BB46754a8", bidDelaySeconds: 60, minChunkSizeUsd: 10, nativeToken: {
80
- address: web3_candies_1.zeroAddress,
81
- decimals: 18,
82
- symbol: "MATIC",
83
- logoUrl: "https://app.1inch.io/assets/images/network-logos/polygon.svg",
84
- }, wToken: {
85
- address: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
86
- decimals: 18,
87
- symbol: "WMATIC",
88
- logoUrl: "https://tokens.1inch.io/0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0.png",
89
- } }, defaultAbis),
90
- avax: Object.assign({ chainName: "avax", chainId: 43114, twapVersion: 4, twapAddress: "0xF2687e119B0A4aB00bED9c9F425403566D605020", lensAddress: "0xfA1e5Da0Cbb780b891Cd635264354a9F4d3A726E", bidDelaySeconds: 60, minChunkSizeUsd: 10, nativeToken: {
91
- address: web3_candies_1.zeroAddress,
92
- decimals: 18,
93
- symbol: "AVAX",
94
- logoUrl: "https://app.1inch.io/assets/images/network-logos/avalanche.svg",
95
- }, wToken: {
96
- address: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
97
- decimals: 18,
98
- symbol: "WAVAX",
99
- logoUrl: "https://tokens.1inch.io/0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7.png",
100
- } }, defaultAbis),
54
+ poly: Object.assign({ chainName: "poly", chainId: 137, twapVersion: 4, twapAddress: "0xceFf098C9199c5d9cf24078dc14Eb8F787631cC0", lensAddress: "0x8ffde23Fba2d7Aea9C3CBf2d5B7B533BB46754a8", bidDelaySeconds: 60, minChunkSizeUsd: 10, nativeToken: web3_candies_1.networks.poly.native, wToken: web3_candies_1.networks.poly.wToken }, defaultAbis),
55
+ avax: Object.assign({ chainName: "avax", chainId: 43114, twapVersion: 4, twapAddress: "0xF2687e119B0A4aB00bED9c9F425403566D605020", lensAddress: "0xfA1e5Da0Cbb780b891Cd635264354a9F4d3A726E", bidDelaySeconds: 60, minChunkSizeUsd: 10, nativeToken: web3_candies_1.networks.avax.native, wToken: web3_candies_1.networks.avax.wToken }, defaultAbis),
101
56
  };
102
57
  exports.Configs = {
103
58
  SpiritSwap: Object.assign(Object.assign({}, exports.ChainConfigs.ftm), { partner: "SpiritSwap", exchangeAddress: "0xAd19179201be5A51D1cBd3bB2fC651BB05822404", exchangeType: "ParaswapExchange", pathfinderKey: ParaswapOnlyDex.SpiritSwap }),
@@ -106,6 +61,7 @@ exports.Configs = {
106
61
  PangolinDaas: Object.assign(Object.assign({}, exports.ChainConfigs.avax), { partner: "PangolinDaas", exchangeAddress: "0x1579EED0527781B1A748043AA1f59a3858Ace4a7", exchangeType: "PangolinDaasExchange", pathfinderKey: ParaswapOnlyDex.Pangolin }),
107
62
  QuickSwap: Object.assign(Object.assign({}, exports.ChainConfigs.poly), { partner: "QuickSwap", exchangeAddress: "0x26D0ec4Be402BCE03AAa8aAf0CF67e9428ba54eF", exchangeType: "ParaswapExchange", pathfinderKey: ParaswapOnlyDex.QuickSwap }),
108
63
  Chronos: Object.assign(Object.assign({}, exports.ChainConfigs.arb), { partner: "Chronos", exchangeAddress: "0xA0b07F9a11dFb01388149abBdbc5B4f2196600AB", exchangeType: "OdosExchange", pathfinderKey: OdosOnlyDex.Chronos }),
64
+ Thena: Object.assign(Object.assign({}, exports.ChainConfigs.bsc), { partner: "Thena", exchangeAddress: "0xD63430c74C8E70D9dbdCA04C6a9E6E9E929028DA", exchangeType: "ParaswapExchange", pathfinderKey: ParaswapOnlyDex.Thena }),
109
65
  };
110
66
  const chainConfig = (chainId) => lodash_1.default.find(exports.ChainConfigs, (c) => c.chainId === chainId);
111
67
  exports.chainConfig = chainConfig;
@@ -45,9 +45,7 @@ var Paraswap;
45
45
  data = yield buildSwapData(route, exchangeAdapter);
46
46
  }
47
47
  }
48
- catch (e) {
49
- console.error(e);
50
- }
48
+ catch (e) { }
51
49
  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 };
52
50
  });
53
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbs-network/twap",
3
- "version": "1.10.13",
3
+ "version": "1.11.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/orbs-network/twap.git"
@@ -31,7 +31,8 @@
31
31
  "test:ftm": "NETWORK=FTM BLOCK=39800909 hardhat test",
32
32
  "test:poly": "NETWORK=POLY BLOCK=29174252 hardhat test",
33
33
  "test:avax": "NETWORK=AVAX BLOCK=15609313 hardhat test",
34
- "test:arb": "NETWORK=ARB hardhat test"
34
+ "test:arb": "NETWORK=ARB hardhat test",
35
+ "test:bsc": "NETWORK=BSC hardhat test"
35
36
  },
36
37
  "prettier": {
37
38
  "printWidth": 120