@paraswap/dex-lib 3.7.2 → 3.7.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/build/abi/Redstone.json +739 -0
- package/build/abi/aavev3stata/Factory.json +128 -0
- package/build/abi/aavev3stata/Token.json +735 -0
- package/build/abi/angle-transmuter/MorphoOracle.json +193 -0
- package/build/abi/angle-transmuter/MorphoVault.json +2506 -0
- package/build/abi/angle-transmuter/Pyth.json +1534 -0
- package/build/abi/angle-transmuter/Transmuter.json +1711 -0
- package/build/abi/angle-transmuter/TransmuterSidechain.json +1798 -0
- package/build/abi/idle-dao/idle-cdo-factory.json +38 -0
- package/build/abi/idle-dao/idle-cdo.json +1245 -0
- package/build/dex/aave-v1/aave-v1.d.ts +2 -1
- package/build/dex/aave-v1/aave-v1.js +22 -0
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/aave-v3-stata/aave-v3-stata.d.ts +50 -0
- package/build/dex/aave-v3-stata/aave-v3-stata.js +365 -0
- package/build/dex/aave-v3-stata/aave-v3-stata.js.map +1 -0
- package/build/dex/aave-v3-stata/config.d.ts +4 -0
- package/build/dex/aave-v3-stata/config.js +50 -0
- package/build/dex/aave-v3-stata/config.js.map +1 -0
- package/build/dex/aave-v3-stata/tokens.d.ts +9 -0
- package/build/dex/aave-v3-stata/tokens.js +37 -0
- package/build/dex/aave-v3-stata/tokens.js.map +1 -0
- package/build/dex/aave-v3-stata/types.d.ts +46 -0
- package/build/dex/aave-v3-stata/types.js +23 -0
- package/build/dex/aave-v3-stata/types.js.map +1 -0
- package/build/dex/aave-v3-stata/utils.d.ts +4 -0
- package/build/dex/aave-v3-stata/utils.js +67 -0
- package/build/dex/aave-v3-stata/utils.js.map +1 -0
- package/build/dex/angle-transmuter/angle-transmuter-pool.d.ts +67 -0
- package/build/dex/angle-transmuter/angle-transmuter-pool.js +448 -0
- package/build/dex/angle-transmuter/angle-transmuter-pool.js.map +1 -0
- package/build/dex/angle-transmuter/angle-transmuter.d.ts +59 -0
- package/build/dex/angle-transmuter/angle-transmuter.js +264 -0
- package/build/dex/angle-transmuter/angle-transmuter.js.map +1 -0
- package/build/dex/angle-transmuter/backedOracle.d.ts +19 -0
- package/build/dex/angle-transmuter/backedOracle.js +56 -0
- package/build/dex/angle-transmuter/backedOracle.js.map +1 -0
- package/build/dex/angle-transmuter/config.d.ts +4 -0
- package/build/dex/angle-transmuter/config.js +50 -0
- package/build/dex/angle-transmuter/config.js.map +1 -0
- package/build/dex/angle-transmuter/constants.d.ts +9 -0
- package/build/dex/angle-transmuter/constants.js +136 -0
- package/build/dex/angle-transmuter/constants.js.map +1 -0
- package/build/dex/angle-transmuter/morphoOracle.d.ts +42 -0
- package/build/dex/angle-transmuter/morphoOracle.js +179 -0
- package/build/dex/angle-transmuter/morphoOracle.js.map +1 -0
- package/build/dex/angle-transmuter/morphoVault.d.ts +20 -0
- package/build/dex/angle-transmuter/morphoVault.js +84 -0
- package/build/dex/angle-transmuter/morphoVault.js.map +1 -0
- package/build/dex/angle-transmuter/pyth.d.ts +19 -0
- package/build/dex/angle-transmuter/pyth.js +70 -0
- package/build/dex/angle-transmuter/pyth.js.map +1 -0
- package/build/dex/angle-transmuter/redstone.d.ts +20 -0
- package/build/dex/angle-transmuter/redstone.js +64 -0
- package/build/dex/angle-transmuter/redstone.js.map +1 -0
- package/build/dex/angle-transmuter/transmuter.d.ts +55 -0
- package/build/dex/angle-transmuter/transmuter.js +398 -0
- package/build/dex/angle-transmuter/transmuter.js.map +1 -0
- package/build/dex/angle-transmuter/types.d.ts +189 -0
- package/build/dex/angle-transmuter/types.js +33 -0
- package/build/dex/angle-transmuter/types.js.map +1 -0
- package/build/dex/angle-transmuter/utils.d.ts +9 -0
- package/build/dex/angle-transmuter/utils.js +257 -0
- package/build/dex/angle-transmuter/utils.js.map +1 -0
- package/build/dex/idle-dao/config.d.ts +6 -0
- package/build/dex/idle-dao/config.js +307 -0
- package/build/dex/idle-dao/config.js.map +1 -0
- package/build/dex/idle-dao/idle-dao-pool.d.ts +56 -0
- package/build/dex/idle-dao/idle-dao-pool.js +176 -0
- package/build/dex/idle-dao/idle-dao-pool.js.map +1 -0
- package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +16 -0
- package/build/dex/idle-dao/idle-dao-pooling-pool.js +57 -0
- package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +1 -0
- package/build/dex/idle-dao/idle-dao.d.ts +41 -0
- package/build/dex/idle-dao/idle-dao.js +238 -0
- package/build/dex/idle-dao/idle-dao.js.map +1 -0
- package/build/dex/idle-dao/scripts.d.ts +9 -0
- package/build/dex/idle-dao/scripts.js +552 -0
- package/build/dex/idle-dao/scripts.js.map +1 -0
- package/build/dex/idle-dao/tokens.d.ts +9 -0
- package/build/dex/idle-dao/tokens.js +65 -0
- package/build/dex/idle-dao/tokens.js.map +1 -0
- package/build/dex/idle-dao/types.d.ts +35 -0
- package/build/dex/idle-dao/types.js +11 -0
- package/build/dex/idle-dao/types.js.map +1 -0
- package/build/dex/idle-dao/utils.d.ts +8 -0
- package/build/dex/idle-dao/utils.js +148 -0
- package/build/dex/idle-dao/utils.js.map +1 -0
- package/build/dex/index.js +2 -0
- package/build/dex/index.js.map +1 -1
- package/build/dex/platypus/platypus.d.ts +2 -1
- package/build/dex/platypus/platypus.js +31 -0
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/swaap-v1/swaap-v1.d.ts +2 -1
- package/build/dex/swaap-v1/swaap-v1.js +10 -0
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/lib/chainlink.d.ts +2 -0
- package/build/lib/chainlink.js +9 -0
- package/build/lib/chainlink.js.map +1 -1
- package/build/utils.d.ts +1 -1
- package/package.json +1 -1
- package/src/abi/Redstone.json +739 -0
- package/src/abi/angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json +1246 -0
- package/src/abi/angle-transmuter/ChainlinkEACAggregatorProxy.json +509 -0
- package/src/abi/angle-transmuter/MorphoOracle.json +193 -0
- package/src/abi/angle-transmuter/MorphoVault.json +2506 -0
- package/src/abi/angle-transmuter/Pyth.json +1534 -0
- package/src/abi/angle-transmuter/Transmuter.json +1711 -0
- package/src/abi/angle-transmuter/TransmuterSidechain.json +1798 -0
- package/src/dex/angle-transmuter/angle-transmuter-e2e.test.ts +156 -0
- package/src/dex/angle-transmuter/angle-transmuter-events.test.ts +365 -0
- package/src/dex/angle-transmuter/angle-transmuter-integration.test.ts +390 -0
- package/src/dex/angle-transmuter/angle-transmuter-pool.ts +895 -0
- package/src/dex/angle-transmuter/angle-transmuter.ts +408 -0
- package/src/dex/angle-transmuter/backedOracle.ts +91 -0
- package/src/dex/angle-transmuter/config.ts +50 -0
- package/src/dex/angle-transmuter/constants.ts +138 -0
- package/src/dex/angle-transmuter/morphoOracle.ts +335 -0
- package/src/dex/angle-transmuter/morphoVault.ts +134 -0
- package/src/dex/angle-transmuter/pyth.ts +105 -0
- package/src/dex/angle-transmuter/redstone.ts +105 -0
- package/src/dex/angle-transmuter/transmuter.ts +619 -0
- package/src/dex/angle-transmuter/types.ts +203 -0
- package/src/dex/angle-transmuter/utils.ts +358 -0
- package/src/dex/index.ts +2 -0
- package/src/lib/chainlink.ts +15 -0
- package/tests/constants-e2e.ts +48 -3
- package/build/abi/Uncompressor.json +0 -250
- package/build/dex/bProtocol.d.ts +0 -18
- package/build/dex/bProtocol.js +0 -39
- package/build/dex/bProtocol.js.map +0 -1
- package/build/dex/bancor.d.ts +0 -26
- package/build/dex/bancor.js +0 -58
- package/build/dex/bancor.js.map +0 -1
- package/build/dex/compound.d.ts +0 -18
- package/build/dex/compound.js +0 -46
- package/build/dex/compound.js.map +0 -1
- package/build/dex/curve-v2.d.ts +0 -58
- package/build/dex/curve-v2.js +0 -180
- package/build/dex/curve-v2.js.map +0 -1
- package/build/dex/dodo-v1.d.ts +0 -33
- package/build/dex/dodo-v1.js +0 -63
- package/build/dex/dodo-v1.js.map +0 -1
- package/build/dex/etherfi/etherfi.d.ts +0 -26
- package/build/dex/etherfi/etherfi.js +0 -96
- package/build/dex/etherfi/etherfi.js.map +0 -1
- package/build/dex/lido.d.ts +0 -19
- package/build/dex/lido.js +0 -42
- package/build/dex/lido.js.map +0 -1
- package/build/dex/onebit.d.ts +0 -25
- package/build/dex/onebit.js +0 -42
- package/build/dex/onebit.js.map +0 -1
- package/build/dex/sdai/config.d.ts +0 -11
- package/build/dex/sdai/config.js +0 -21
- package/build/dex/sdai/config.js.map +0 -1
- package/build/dex/sdai/constants.d.ts +0 -2
- package/build/dex/sdai/constants.js +0 -6
- package/build/dex/sdai/constants.js.map +0 -1
- package/build/dex/sdai/scripts/validate-state.d.ts +0 -1
- package/build/dex/sdai/scripts/validate-state.js +0 -102
- package/build/dex/sdai/scripts/validate-state.js.map +0 -1
- package/build/dex/sdai/sdai-pool.d.ts +0 -16
- package/build/dex/sdai/sdai-pool.js +0 -85
- package/build/dex/sdai/sdai-pool.js.map +0 -1
- package/build/dex/sdai/sdai.d.ts +0 -51
- package/build/dex/sdai/sdai.js +0 -172
- package/build/dex/sdai/sdai.js.map +0 -1
- package/build/dex/sdai/types.d.ts +0 -21
- package/build/dex/sdai/types.js +0 -11
- package/build/dex/sdai/types.js.map +0 -1
- package/build/dex/sdai/utils.d.ts +0 -4
- package/build/dex/sdai/utils.js +0 -39
- package/build/dex/sdai/utils.js.map +0 -1
- package/build/dex/smoothy.d.ts +0 -26
- package/build/dex/smoothy.js +0 -48
- package/build/dex/smoothy.js.map +0 -1
- package/build/dex/stable-pool.d.ts +0 -28
- package/build/dex/stable-pool.js +0 -62
- package/build/dex/stable-pool.js.map +0 -1
- package/build/dex/trader-joe-v2.1.d.ts +0 -43
- package/build/dex/trader-joe-v2.1.js +0 -79
- package/build/dex/trader-joe-v2.1.js.map +0 -1
- package/build/executor/compressor/Compressor.d.ts +0 -23
- package/build/executor/compressor/Compressor.js +0 -144
- package/build/executor/compressor/Compressor.js.map +0 -1
- package/build/executor/compressor/compress.d.ts +0 -17
- package/build/executor/compressor/compress.js +0 -187
- package/build/executor/compressor/compress.js.map +0 -1
- package/build/executor/compressor/compress_functions/addressSubstitution.d.ts +0 -6
- package/build/executor/compressor/compress_functions/addressSubstitution.js +0 -29
- package/build/executor/compressor/compress_functions/addressSubstitution.js.map +0 -1
- package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.d.ts +0 -10
- package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js +0 -40
- package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js.map +0 -1
- package/build/executor/compressor/compress_functions/byteSubstitution.d.ts +0 -11
- package/build/executor/compressor/compress_functions/byteSubstitution.js +0 -64
- package/build/executor/compressor/compress_functions/byteSubstitution.js.map +0 -1
- package/build/executor/compressor/compress_functions/ffSubstitution.d.ts +0 -7
- package/build/executor/compressor/compress_functions/ffSubstitution.js +0 -54
- package/build/executor/compressor/compress_functions/ffSubstitution.js.map +0 -1
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute.d.ts +0 -8
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js +0 -67
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js.map +0 -1
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.d.ts +0 -8
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js +0 -61
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js.map +0 -1
- package/build/executor/compressor/compress_functions/reverseAddressSubstitution.d.ts +0 -6
- package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js +0 -37
- package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js.map +0 -1
- package/build/executor/compressor/compress_functions/searchUnusedBytes.d.ts +0 -9
- package/build/executor/compressor/compress_functions/searchUnusedBytes.js +0 -33
- package/build/executor/compressor/compress_functions/searchUnusedBytes.js.map +0 -1
- package/build/executor/compressor/fetchSaved.d.ts +0 -0
- package/build/executor/compressor/fetchSaved.js +0 -17
- package/build/executor/compressor/fetchSaved.js.map +0 -1
- package/build/executor/compressor/utils/computeCostL2.d.ts +0 -2
- package/build/executor/compressor/utils/computeCostL2.js +0 -14
- package/build/executor/compressor/utils/computeCostL2.js.map +0 -1
- package/build/executor/compressor/utils/findLongestDuplicatedString.d.ts +0 -2
- package/build/executor/compressor/utils/findLongestDuplicatedString.js +0 -30
- package/build/executor/compressor/utils/findLongestDuplicatedString.js.map +0 -1
- package/build/executor/compressor/utils/getAllIndexes.d.ts +0 -2
- package/build/executor/compressor/utils/getAllIndexes.js +0 -12
- package/build/executor/compressor/utils/getAllIndexes.js.map +0 -1
- package/build/executor/compressor/utils/getByteForAddress.d.ts +0 -2
- package/build/executor/compressor/utils/getByteForAddress.js +0 -14
- package/build/executor/compressor/utils/getByteForAddress.js.map +0 -1
- package/build/executor/compressor/utils/intTo2Bytes.d.ts +0 -2
- package/build/executor/compressor/utils/intTo2Bytes.js +0 -14
- package/build/executor/compressor/utils/intTo2Bytes.js.map +0 -1
- package/build/executor/compressor/utils/intTo3Bytes.d.ts +0 -2
- package/build/executor/compressor/utils/intTo3Bytes.js +0 -18
- package/build/executor/compressor/utils/intTo3Bytes.js.map +0 -1
- package/build/executor/compressor/utils/intToByte.d.ts +0 -2
- package/build/executor/compressor/utils/intToByte.js +0 -10
- package/build/executor/compressor/utils/intToByte.js.map +0 -1
package/tests/constants-e2e.ts
CHANGED
|
@@ -46,6 +46,7 @@ export const Tokens: {
|
|
|
46
46
|
USDC: {
|
|
47
47
|
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
48
48
|
decimals: 6,
|
|
49
|
+
symbol: 'USDC',
|
|
49
50
|
addBalance: balancesFn,
|
|
50
51
|
addAllowance: allowedFn,
|
|
51
52
|
},
|
|
@@ -350,6 +351,22 @@ export const Tokens: {
|
|
|
350
351
|
EURA: {
|
|
351
352
|
address: '0x1a7e4e63778b4f12a199c062f3efdd288afcbce8',
|
|
352
353
|
decimals: 18,
|
|
354
|
+
symbol: 'EURA',
|
|
355
|
+
},
|
|
356
|
+
EUROC: {
|
|
357
|
+
address: '0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c',
|
|
358
|
+
decimals: 6,
|
|
359
|
+
symbol: 'EUROC',
|
|
360
|
+
},
|
|
361
|
+
bERNX: {
|
|
362
|
+
address: '0x3f95AA88dDbB7D9D484aa3D482bf0a80009c52c9',
|
|
363
|
+
decimals: 18,
|
|
364
|
+
symbol: 'bERNX',
|
|
365
|
+
},
|
|
366
|
+
bC3M: {
|
|
367
|
+
address: '0x2F123cF3F37CE3328CC9B5b8415f9EC5109b45e7',
|
|
368
|
+
decimals: 18,
|
|
369
|
+
symbol: 'bC3M',
|
|
353
370
|
},
|
|
354
371
|
stEUR: {
|
|
355
372
|
address: '0x004626a008b1acdc4c74ab51644093b155e59a23',
|
|
@@ -358,6 +375,17 @@ export const Tokens: {
|
|
|
358
375
|
USDA: {
|
|
359
376
|
address: '0x0000206329b97DB379d5E1Bf586BbDB969C63274',
|
|
360
377
|
decimals: 18,
|
|
378
|
+
symbol: 'USDA',
|
|
379
|
+
},
|
|
380
|
+
bIB01: {
|
|
381
|
+
address: '0xCA30c93B02514f86d5C86a6e375E3A330B435Fb5',
|
|
382
|
+
decimals: 18,
|
|
383
|
+
symbol: 'bIB01',
|
|
384
|
+
},
|
|
385
|
+
steakUSDC: {
|
|
386
|
+
address: '0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB',
|
|
387
|
+
decimals: 18,
|
|
388
|
+
symbol: 'steakUSDC',
|
|
361
389
|
},
|
|
362
390
|
stUSD: {
|
|
363
391
|
address: '0x0022228a2cc5E7eF0274A7Baa600d44da5aB5776',
|
|
@@ -565,6 +593,7 @@ export const Tokens: {
|
|
|
565
593
|
EURA: {
|
|
566
594
|
address: '0xe0b52e49357fd4daf2c15e02058dce6bc0057db4',
|
|
567
595
|
decimals: 18,
|
|
596
|
+
symbol: 'EURA',
|
|
568
597
|
},
|
|
569
598
|
stEUR: {
|
|
570
599
|
address: '0x004626a008b1acdc4c74ab51644093b155e59a23',
|
|
@@ -573,6 +602,7 @@ export const Tokens: {
|
|
|
573
602
|
USDA: {
|
|
574
603
|
address: '0x0000206329b97DB379d5E1Bf586BbDB969C63274',
|
|
575
604
|
decimals: 18,
|
|
605
|
+
symbol: 'USDA',
|
|
576
606
|
},
|
|
577
607
|
stUSD: {
|
|
578
608
|
address: '0x0022228a2cc5E7eF0274A7Baa600d44da5aB5776',
|
|
@@ -791,10 +821,12 @@ export const Tokens: {
|
|
|
791
821
|
EURA: {
|
|
792
822
|
address: '0x12f31B73D812C6Bb0d735a218c086d44D5fe5f89',
|
|
793
823
|
decimals: 18,
|
|
824
|
+
symbol: 'EURA',
|
|
794
825
|
},
|
|
795
826
|
USDA: {
|
|
796
827
|
address: '0x0000206329b97DB379d5E1Bf586BbDB969C63274',
|
|
797
828
|
decimals: 18,
|
|
829
|
+
symbol: 'USDA',
|
|
798
830
|
},
|
|
799
831
|
stUSD: {
|
|
800
832
|
address: '0x0022228a2cc5E7eF0274A7Baa600d44da5aB5776',
|
|
@@ -993,8 +1025,9 @@ export const Tokens: {
|
|
|
993
1025
|
decimals: 6,
|
|
994
1026
|
},
|
|
995
1027
|
USDC: {
|
|
996
|
-
address: '
|
|
1028
|
+
address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
|
|
997
1029
|
decimals: 6,
|
|
1030
|
+
symbol: 'USDC',
|
|
998
1031
|
},
|
|
999
1032
|
crvUSD: {
|
|
1000
1033
|
address: '0x498bf2b1e120fed3ad3d42ea2165e9b73f99c1e5',
|
|
@@ -1061,6 +1094,7 @@ export const Tokens: {
|
|
|
1061
1094
|
EURA: {
|
|
1062
1095
|
address: '0xfa5ed56a203466cbbc2430a43c66b9d8723528e7',
|
|
1063
1096
|
decimals: 18,
|
|
1097
|
+
symbol: 'EURA',
|
|
1064
1098
|
},
|
|
1065
1099
|
stEUR: {
|
|
1066
1100
|
address: '0x004626a008b1acdc4c74ab51644093b155e59a23',
|
|
@@ -1069,6 +1103,7 @@ export const Tokens: {
|
|
|
1069
1103
|
USDA: {
|
|
1070
1104
|
address: '0x0000206329b97DB379d5E1Bf586BbDB969C63274',
|
|
1071
1105
|
decimals: 18,
|
|
1106
|
+
symbol: 'USDA',
|
|
1072
1107
|
},
|
|
1073
1108
|
stUSD: {
|
|
1074
1109
|
address: '0x0022228a2cc5E7eF0274A7Baa600d44da5aB5776',
|
|
@@ -1188,6 +1223,7 @@ export const Tokens: {
|
|
|
1188
1223
|
EURA: {
|
|
1189
1224
|
address: '0x9485aca5bbbe1667ad97c7fe7c4531a624c8b1ed',
|
|
1190
1225
|
decimals: 18,
|
|
1226
|
+
symbol: 'EURA',
|
|
1191
1227
|
},
|
|
1192
1228
|
stEUR: {
|
|
1193
1229
|
address: '0x004626a008b1acdc4c74ab51644093b155e59a23',
|
|
@@ -1196,6 +1232,7 @@ export const Tokens: {
|
|
|
1196
1232
|
USDA: {
|
|
1197
1233
|
address: '0x0000206329b97DB379d5E1Bf586BbDB969C63274',
|
|
1198
1234
|
decimals: 18,
|
|
1235
|
+
symbol: 'USDA',
|
|
1199
1236
|
},
|
|
1200
1237
|
stUSD: {
|
|
1201
1238
|
address: '0x0022228a2cc5E7eF0274A7Baa600d44da5aB5776',
|
|
@@ -1246,7 +1283,8 @@ export const Tokens: {
|
|
|
1246
1283
|
decimals: 18,
|
|
1247
1284
|
},
|
|
1248
1285
|
USDC: {
|
|
1249
|
-
address: '
|
|
1286
|
+
address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
|
|
1287
|
+
symbol: 'USDC',
|
|
1250
1288
|
decimals: 6,
|
|
1251
1289
|
},
|
|
1252
1290
|
USDM: {
|
|
@@ -1292,10 +1330,12 @@ export const Tokens: {
|
|
|
1292
1330
|
EURA: {
|
|
1293
1331
|
address: '0xA61BeB4A3d02decb01039e378237032B351125B4',
|
|
1294
1332
|
decimals: 18,
|
|
1333
|
+
symbol: 'EURA',
|
|
1295
1334
|
},
|
|
1296
1335
|
USDA: {
|
|
1297
1336
|
address: '0x0000206329b97DB379d5E1Bf586BbDB969C63274',
|
|
1298
1337
|
decimals: 18,
|
|
1338
|
+
symbol: 'USDA',
|
|
1299
1339
|
},
|
|
1300
1340
|
stUSD: {
|
|
1301
1341
|
address: '0x0022228a2cc5E7eF0274A7Baa600d44da5aB5776',
|
|
@@ -1377,6 +1417,11 @@ export const Holders: {
|
|
|
1377
1417
|
aEthWETH: '0xfEA3F5b06D41Cb1526b9cAf8be63c5b37C475f23',
|
|
1378
1418
|
dUSDC: '0x2FC2F705110A7F46Ce85F701d7217EF1018f01A3',
|
|
1379
1419
|
PSP: '0xE5E5440a1CE69C5cf67BFFA74d185e57c31b43E5',
|
|
1420
|
+
EUROC: '0x64AE5802620398143FC7113037769175F74825Ea',
|
|
1421
|
+
bC3M: '0x5f9F41497f9e11fd7D4c4B067413199682eE2CFF',
|
|
1422
|
+
bERNX: '0x5F7A4c11bde4f218f0025Ef444c369d838ffa2aD',
|
|
1423
|
+
bIB01: '0x5F7A4c11bde4f218f0025Ef444c369d838ffa2aD',
|
|
1424
|
+
steakUSDC: '0xC977d218Fde6A39c7aCE71C8243545c276B48931',
|
|
1380
1425
|
EURA: '0xa116f421ff82a9704428259fd8cc63347127b777',
|
|
1381
1426
|
stEUR: '0xdC7Aa225964267c7E0EfB35f4931426209E90312',
|
|
1382
1427
|
USDA: '0x2686bC6A56D205010637CE1DF124b20Cb19E4054',
|
|
@@ -1609,7 +1654,7 @@ export const Holders: {
|
|
|
1609
1654
|
SDEX: '0xa5d378c05192e3f1f365d6298921879c4d51c5a3',
|
|
1610
1655
|
EURA: '0x5b5614b9fffab7c751799eb12d5cb9165c8c40ad',
|
|
1611
1656
|
stEUR: '0xA9DdD91249DFdd450E81E1c56Ab60E1A62651701',
|
|
1612
|
-
USDA: '
|
|
1657
|
+
USDA: '0x7FE4b2632f5AE6d930677D662AF26Bc0a06672b3',
|
|
1613
1658
|
stUSD: '0x8deeffb6047b8ee91b09334eb2a4ca120f43f596',
|
|
1614
1659
|
ALB: '0x365c6d588e8611125de3bea5b9280c304fa54113',
|
|
1615
1660
|
AERO: '0x807877258b55bfefabdd469da1c72731c5070839',
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"inputs": [
|
|
4
|
-
{
|
|
5
|
-
"internalType": "address[]",
|
|
6
|
-
"name": "_savedAddresses",
|
|
7
|
-
"type": "address[]"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"internalType": "bytes4[]",
|
|
11
|
-
"name": "_methodPrefixes",
|
|
12
|
-
"type": "bytes4[]"
|
|
13
|
-
},
|
|
14
|
-
{ "internalType": "address", "name": "_augustus", "type": "address" },
|
|
15
|
-
{ "internalType": "address", "name": "_owner", "type": "address" }
|
|
16
|
-
],
|
|
17
|
-
"stateMutability": "nonpayable",
|
|
18
|
-
"type": "constructor"
|
|
19
|
-
},
|
|
20
|
-
{ "inputs": [], "name": "NotOwnerOrAugustus", "type": "error" },
|
|
21
|
-
{
|
|
22
|
-
"inputs": [
|
|
23
|
-
{ "internalType": "address", "name": "owner", "type": "address" }
|
|
24
|
-
],
|
|
25
|
-
"name": "OwnableInvalidOwner",
|
|
26
|
-
"type": "error"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"inputs": [
|
|
30
|
-
{ "internalType": "address", "name": "account", "type": "address" }
|
|
31
|
-
],
|
|
32
|
-
"name": "OwnableUnauthorizedAccount",
|
|
33
|
-
"type": "error"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"anonymous": false,
|
|
37
|
-
"inputs": [
|
|
38
|
-
{
|
|
39
|
-
"indexed": true,
|
|
40
|
-
"internalType": "address",
|
|
41
|
-
"name": "addressToSave",
|
|
42
|
-
"type": "address"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"indexed": true,
|
|
46
|
-
"internalType": "bytes3",
|
|
47
|
-
"name": "byteToSave",
|
|
48
|
-
"type": "bytes3"
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
"name": "AddressSaved",
|
|
52
|
-
"type": "event"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"anonymous": false,
|
|
56
|
-
"inputs": [
|
|
57
|
-
{
|
|
58
|
-
"indexed": true,
|
|
59
|
-
"internalType": "bytes4",
|
|
60
|
-
"name": "methodPrefixToSave",
|
|
61
|
-
"type": "bytes4"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"indexed": true,
|
|
65
|
-
"internalType": "uint256",
|
|
66
|
-
"name": "indexSaved",
|
|
67
|
-
"type": "uint256"
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"name": "MethodPrefixSaved",
|
|
71
|
-
"type": "event"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"anonymous": false,
|
|
75
|
-
"inputs": [
|
|
76
|
-
{
|
|
77
|
-
"indexed": true,
|
|
78
|
-
"internalType": "address",
|
|
79
|
-
"name": "previousOwner",
|
|
80
|
-
"type": "address"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"indexed": true,
|
|
84
|
-
"internalType": "address",
|
|
85
|
-
"name": "newOwner",
|
|
86
|
-
"type": "address"
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
"name": "OwnershipTransferred",
|
|
90
|
-
"type": "event"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"inputs": [],
|
|
94
|
-
"name": "MAX_UINT24",
|
|
95
|
-
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
96
|
-
"stateMutability": "view",
|
|
97
|
-
"type": "function"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
"inputs": [],
|
|
101
|
-
"name": "MAX_UINT8",
|
|
102
|
-
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
103
|
-
"stateMutability": "view",
|
|
104
|
-
"type": "function"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
108
|
-
"name": "addressToByte",
|
|
109
|
-
"outputs": [{ "internalType": "bytes3", "name": "", "type": "bytes3" }],
|
|
110
|
-
"stateMutability": "view",
|
|
111
|
-
"type": "function"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"inputs": [],
|
|
115
|
-
"name": "augustus",
|
|
116
|
-
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
117
|
-
"stateMutability": "view",
|
|
118
|
-
"type": "function"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"inputs": [
|
|
122
|
-
{ "internalType": "bytes3", "name": "inputByte", "type": "bytes3" }
|
|
123
|
-
],
|
|
124
|
-
"name": "getAddressForByte",
|
|
125
|
-
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
126
|
-
"stateMutability": "view",
|
|
127
|
-
"type": "function"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
"inputs": [],
|
|
131
|
-
"name": "getAllSavedAddresses",
|
|
132
|
-
"outputs": [
|
|
133
|
-
{ "internalType": "address[]", "name": "", "type": "address[]" }
|
|
134
|
-
],
|
|
135
|
-
"stateMutability": "view",
|
|
136
|
-
"type": "function"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"inputs": [],
|
|
140
|
-
"name": "getAllSavedByteForMethodPrefixes",
|
|
141
|
-
"outputs": [{ "internalType": "bytes4[]", "name": "", "type": "bytes4[]" }],
|
|
142
|
-
"stateMutability": "view",
|
|
143
|
-
"type": "function"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"inputs": [
|
|
147
|
-
{ "internalType": "address", "name": "addressToGet", "type": "address" }
|
|
148
|
-
],
|
|
149
|
-
"name": "getByteForAddress",
|
|
150
|
-
"outputs": [{ "internalType": "bytes3", "name": "", "type": "bytes3" }],
|
|
151
|
-
"stateMutability": "view",
|
|
152
|
-
"type": "function"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"inputs": [],
|
|
156
|
-
"name": "owner",
|
|
157
|
-
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
158
|
-
"stateMutability": "view",
|
|
159
|
-
"type": "function"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"inputs": [],
|
|
163
|
-
"name": "renounceOwnership",
|
|
164
|
-
"outputs": [],
|
|
165
|
-
"stateMutability": "nonpayable",
|
|
166
|
-
"type": "function"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
170
|
-
"name": "savedAddresses",
|
|
171
|
-
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
172
|
-
"stateMutability": "view",
|
|
173
|
-
"type": "function"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
177
|
-
"name": "savedMethodPrefixes",
|
|
178
|
-
"outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }],
|
|
179
|
-
"stateMutability": "view",
|
|
180
|
-
"type": "function"
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"inputs": [
|
|
184
|
-
{ "internalType": "address", "name": "addressToSave", "type": "address" }
|
|
185
|
-
],
|
|
186
|
-
"name": "setByteForAddress",
|
|
187
|
-
"outputs": [],
|
|
188
|
-
"stateMutability": "nonpayable",
|
|
189
|
-
"type": "function"
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
"inputs": [
|
|
193
|
-
{
|
|
194
|
-
"internalType": "address[]",
|
|
195
|
-
"name": "addressesToSave",
|
|
196
|
-
"type": "address[]"
|
|
197
|
-
}
|
|
198
|
-
],
|
|
199
|
-
"name": "setByteForAddresses",
|
|
200
|
-
"outputs": [],
|
|
201
|
-
"stateMutability": "nonpayable",
|
|
202
|
-
"type": "function"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
"inputs": [
|
|
206
|
-
{
|
|
207
|
-
"internalType": "bytes4",
|
|
208
|
-
"name": "methodPrefixToSave",
|
|
209
|
-
"type": "bytes4"
|
|
210
|
-
}
|
|
211
|
-
],
|
|
212
|
-
"name": "setByteForMethodPrefix",
|
|
213
|
-
"outputs": [],
|
|
214
|
-
"stateMutability": "nonpayable",
|
|
215
|
-
"type": "function"
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
"inputs": [
|
|
219
|
-
{
|
|
220
|
-
"internalType": "bytes4[]",
|
|
221
|
-
"name": "methodPrefixesToSave",
|
|
222
|
-
"type": "bytes4[]"
|
|
223
|
-
}
|
|
224
|
-
],
|
|
225
|
-
"name": "setByteMethodPrefixes",
|
|
226
|
-
"outputs": [],
|
|
227
|
-
"stateMutability": "nonpayable",
|
|
228
|
-
"type": "function"
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
"inputs": [
|
|
232
|
-
{ "internalType": "address", "name": "newOwner", "type": "address" }
|
|
233
|
-
],
|
|
234
|
-
"name": "transferOwnership",
|
|
235
|
-
"outputs": [],
|
|
236
|
-
"stateMutability": "nonpayable",
|
|
237
|
-
"type": "function"
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"inputs": [
|
|
241
|
-
{ "internalType": "bytes", "name": "compressedData", "type": "bytes" }
|
|
242
|
-
],
|
|
243
|
-
"name": "uncompress",
|
|
244
|
-
"outputs": [
|
|
245
|
-
{ "internalType": "bytes", "name": "uncompressedData", "type": "bytes" }
|
|
246
|
-
],
|
|
247
|
-
"stateMutability": "nonpayable",
|
|
248
|
-
"type": "function"
|
|
249
|
-
}
|
|
250
|
-
]
|
package/build/dex/bProtocol.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { SwapSide } from '../constants';
|
|
3
|
-
import { AdapterExchangeParam, SimpleExchangeParam } from '../types';
|
|
4
|
-
import { IDexTxBuilder } from './idex';
|
|
5
|
-
import { SimpleExchange } from './simple-exchange';
|
|
6
|
-
import { IDexHelper } from '../dex-helper';
|
|
7
|
-
export declare type BProtocolData = {
|
|
8
|
-
exchange: string;
|
|
9
|
-
};
|
|
10
|
-
declare type BProtocolParam = [lusdAmount: string, minEthReturn: string, dest: string];
|
|
11
|
-
export declare class BProtocol extends SimpleExchange implements IDexTxBuilder<BProtocolData, BProtocolParam> {
|
|
12
|
-
static dexKeys: string[];
|
|
13
|
-
exchangeRouterInterface: Interface;
|
|
14
|
-
constructor(dexHelper: IDexHelper);
|
|
15
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: BProtocolData, side: SwapSide): AdapterExchangeParam;
|
|
16
|
-
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: BProtocolData, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
package/build/dex/bProtocol.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BProtocol = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const simple_exchange_1 = require("./simple-exchange");
|
|
9
|
-
const BProtocol_json_1 = __importDefault(require("../abi/BProtocol.json"));
|
|
10
|
-
var BProtocolFunctions;
|
|
11
|
-
(function (BProtocolFunctions) {
|
|
12
|
-
BProtocolFunctions["swap"] = "swap";
|
|
13
|
-
})(BProtocolFunctions || (BProtocolFunctions = {}));
|
|
14
|
-
class BProtocol extends simple_exchange_1.SimpleExchange {
|
|
15
|
-
constructor(dexHelper) {
|
|
16
|
-
super(dexHelper, 'bprotocol');
|
|
17
|
-
this.exchangeRouterInterface = new abi_1.Interface(BProtocol_json_1.default);
|
|
18
|
-
}
|
|
19
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
20
|
-
return {
|
|
21
|
-
targetExchange: data.exchange,
|
|
22
|
-
payload: '0x',
|
|
23
|
-
networkFee: '0',
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
27
|
-
const swapFunction = BProtocolFunctions.swap;
|
|
28
|
-
const swapFunctionParams = [
|
|
29
|
-
srcAmount,
|
|
30
|
-
destAmount,
|
|
31
|
-
this.augustusAddress,
|
|
32
|
-
];
|
|
33
|
-
const swapData = this.exchangeRouterInterface.encodeFunctionData(swapFunction, swapFunctionParams);
|
|
34
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, data.exchange);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.BProtocol = BProtocol;
|
|
38
|
-
BProtocol.dexKeys = ['bprotocol'];
|
|
39
|
-
//# sourceMappingURL=bProtocol.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bProtocol.js","sourceRoot":"","sources":["../../src/dex/bProtocol.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAI7D,uDAAmD;AACnD,2EAAiD;AAOjD,IAAK,kBAEJ;AAFD,WAAK,kBAAkB;IACrB,mCAAa,CAAA;AACf,CAAC,EAFI,kBAAkB,KAAlB,kBAAkB,QAEtB;AAED,MAAa,SACX,SAAQ,gCAAc;IAMtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAC9B,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAS,CAC1C,wBAA8B,CAC/B,CAAC;IACJ,CAAC;IAED,eAAe,CACb,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAmB,EACnB,IAAc;QAEd,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,QAAQ;YAC7B,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAmB,EACnB,IAAc;QAEd,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC;QAC7C,MAAM,kBAAkB,GAAmB;YACzC,SAAS;YACT,UAAU;YACV,IAAI,CAAC,eAAe;SACrB,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAC9D,YAAY,EACZ,kBAAkB,CACnB,CAAC;QAEF,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,IAAI,CAAC,QAAQ,CACd,CAAC;IACJ,CAAC;;AAxDH,8BAyDC;AArDQ,iBAAO,GAAG,CAAC,WAAW,CAAC,CAAC"}
|
package/build/dex/bancor.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { SwapSide } from '../constants';
|
|
3
|
-
import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
|
|
4
|
-
import { IDexTxBuilder } from './idex';
|
|
5
|
-
import { SimpleExchange } from './simple-exchange';
|
|
6
|
-
import { IDexHelper } from '../dex-helper';
|
|
7
|
-
export declare type BancorData = {
|
|
8
|
-
minDestToken: string;
|
|
9
|
-
path: Address[];
|
|
10
|
-
bancorNetwork?: string;
|
|
11
|
-
};
|
|
12
|
-
declare type BancorParam = [
|
|
13
|
-
path: Address[],
|
|
14
|
-
srcAmount: string,
|
|
15
|
-
minDestToken: string,
|
|
16
|
-
affiliateAccount: string,
|
|
17
|
-
affiliateFee: string
|
|
18
|
-
];
|
|
19
|
-
export declare class Bancor extends SimpleExchange implements IDexTxBuilder<BancorData, BancorParam> {
|
|
20
|
-
static dexKeys: string[];
|
|
21
|
-
exchangeRouterInterface: Interface;
|
|
22
|
-
constructor(dexHelper: IDexHelper);
|
|
23
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: BancorData, side: SwapSide): AdapterExchangeParam;
|
|
24
|
-
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: BancorData, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
package/build/dex/bancor.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Bancor = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const constants_1 = require("../constants");
|
|
9
|
-
const simple_exchange_1 = require("./simple-exchange");
|
|
10
|
-
const Bancor_json_1 = __importDefault(require("../abi/Bancor.json"));
|
|
11
|
-
const BANCOR_NETWORK = {
|
|
12
|
-
1: '0x2F9EC37d6CcFFf1caB21733BdaDEdE11c823cCB0',
|
|
13
|
-
};
|
|
14
|
-
const BancorRegistry = {
|
|
15
|
-
1: '0x52ae12abe5d8bd778bd5397f99ca900624cfadd4',
|
|
16
|
-
};
|
|
17
|
-
var BancorFunctions;
|
|
18
|
-
(function (BancorFunctions) {
|
|
19
|
-
BancorFunctions["convert2"] = "convert2";
|
|
20
|
-
})(BancorFunctions || (BancorFunctions = {}));
|
|
21
|
-
class Bancor extends simple_exchange_1.SimpleExchange {
|
|
22
|
-
constructor(dexHelper) {
|
|
23
|
-
super(dexHelper, 'bancor');
|
|
24
|
-
this.exchangeRouterInterface = new abi_1.Interface(Bancor_json_1.default);
|
|
25
|
-
}
|
|
26
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
27
|
-
if (side === constants_1.SwapSide.BUY)
|
|
28
|
-
throw new Error(`Buy not supported`);
|
|
29
|
-
const { path } = data;
|
|
30
|
-
const payload = this.abiCoder.encodeParameter({
|
|
31
|
-
ParentStruct: {
|
|
32
|
-
path: 'address[]',
|
|
33
|
-
},
|
|
34
|
-
}, { path });
|
|
35
|
-
return {
|
|
36
|
-
targetExchange: BancorRegistry[this.network],
|
|
37
|
-
payload,
|
|
38
|
-
networkFee: '0',
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
42
|
-
if (side === constants_1.SwapSide.BUY)
|
|
43
|
-
throw new Error(`Buy not supported`);
|
|
44
|
-
const defaultArgs = [
|
|
45
|
-
data.path,
|
|
46
|
-
srcAmount,
|
|
47
|
-
data.minDestToken || '1',
|
|
48
|
-
constants_1.NULL_ADDRESS,
|
|
49
|
-
'0',
|
|
50
|
-
];
|
|
51
|
-
const swapMethod = BancorFunctions.convert2;
|
|
52
|
-
const swapData = this.exchangeRouterInterface.encodeFunctionData(swapMethod, defaultArgs);
|
|
53
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, data.bancorNetwork || BANCOR_NETWORK[this.network]);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.Bancor = Bancor;
|
|
57
|
-
Bancor.dexKeys = ['bancor'];
|
|
58
|
-
//# sourceMappingURL=bancor.js.map
|
package/build/dex/bancor.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bancor.js","sourceRoot":"","sources":["../../src/dex/bancor.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAC7D,4CAAsD;AAGtD,uDAAmD;AACnD,qEAA2C;AAI3C,MAAM,cAAc,GAAkC;IACpD,CAAC,EAAE,4CAA4C;CAChD,CAAC;AAEF,MAAM,cAAc,GAAkC;IACpD,CAAC,EAAE,4CAA4C;CAChD,CAAC;AAgBF,IAAK,eAEJ;AAFD,WAAK,eAAe;IAClB,wCAAqB,CAAA;AACvB,CAAC,EAFI,eAAe,KAAf,eAAe,QAEnB;AAED,MAAa,MACX,SAAQ,gCAAc;IAMtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC3B,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAS,CAAC,qBAA2B,CAAC,CAAC;IAC5E,CAAC;IAED,eAAe,CACb,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAgB,EAChB,IAAc;QAEd,IAAI,IAAI,KAAK,oBAAQ,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAEhE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QACtB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAC3C;YACE,YAAY,EAAE;gBACZ,IAAI,EAAE,WAAW;aAClB;SACF,EACD,EAAE,IAAI,EAAE,CACT,CAAC;QAEF,OAAO;YACL,cAAc,EAAE,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;YAC5C,OAAO;YACP,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAgB,EAChB,IAAc;QAEd,IAAI,IAAI,KAAK,oBAAQ,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAEhE,MAAM,WAAW,GAAG;YAClB,IAAI,CAAC,IAAI;YACT,SAAS;YACT,IAAI,CAAC,YAAY,IAAI,GAAG;YACxB,wBAAY;YACZ,GAAG;SACJ,CAAC;QACF,MAAM,UAAU,GAAG,eAAe,CAAC,QAAQ,CAAC;QAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAC9D,UAAU,EACV,WAAW,CACZ,CAAC;QAEF,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,IAAI,CAAC,aAAa,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CACnD,CAAC;IACJ,CAAC;;AAtEH,wBAuEC;AAnEQ,cAAO,GAAG,CAAC,QAAQ,CAAC,CAAC"}
|
package/build/dex/compound.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { SwapSide } from '../constants';
|
|
3
|
-
import { AdapterExchangeParam, SimpleExchangeParam } from '../types';
|
|
4
|
-
import { IDexTxBuilder } from './idex';
|
|
5
|
-
import { SimpleExchange } from './simple-exchange';
|
|
6
|
-
import { IDexHelper } from '../dex-helper';
|
|
7
|
-
export declare type CompoundData = {
|
|
8
|
-
fromCToken: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare type CompoundParam = [srcAmount: string];
|
|
11
|
-
export declare class Compound extends SimpleExchange implements IDexTxBuilder<CompoundData, CompoundParam> {
|
|
12
|
-
static dexKeys: string[];
|
|
13
|
-
cethInterface: Interface;
|
|
14
|
-
constructor(dexHelper: IDexHelper);
|
|
15
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: CompoundData, side: SwapSide): AdapterExchangeParam;
|
|
16
|
-
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: CompoundData, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
package/build/dex/compound.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Compound = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const constants_1 = require("../constants");
|
|
9
|
-
const simple_exchange_1 = require("./simple-exchange");
|
|
10
|
-
const Compound_CETH_json_1 = __importDefault(require("../abi/Compound_CETH.json")); // CETH abi
|
|
11
|
-
const utils_1 = require("../utils");
|
|
12
|
-
var CompoundFunctions;
|
|
13
|
-
(function (CompoundFunctions) {
|
|
14
|
-
CompoundFunctions["redeem"] = "redeem";
|
|
15
|
-
CompoundFunctions["mint"] = "mint";
|
|
16
|
-
})(CompoundFunctions || (CompoundFunctions = {}));
|
|
17
|
-
class Compound extends simple_exchange_1.SimpleExchange {
|
|
18
|
-
constructor(dexHelper) {
|
|
19
|
-
super(dexHelper, 'compound');
|
|
20
|
-
this.cethInterface = new abi_1.Interface(Compound_CETH_json_1.default);
|
|
21
|
-
}
|
|
22
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
23
|
-
const cToken = data.fromCToken ? srcToken : destToken; // Warning
|
|
24
|
-
const payload = this.abiCoder.encodeParameter({
|
|
25
|
-
ParentStruct: {
|
|
26
|
-
cToken: 'address',
|
|
27
|
-
},
|
|
28
|
-
}, { cToken });
|
|
29
|
-
return {
|
|
30
|
-
// target exchange is not used by the contract
|
|
31
|
-
targetExchange: constants_1.NULL_ADDRESS,
|
|
32
|
-
payload,
|
|
33
|
-
networkFee: '0',
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
37
|
-
const cToken = data.fromCToken ? srcToken : destToken;
|
|
38
|
-
const swapData = (0, utils_1.isETHAddress)(srcToken)
|
|
39
|
-
? this.cethInterface.encodeFunctionData(CompoundFunctions.mint)
|
|
40
|
-
: this.erc20Interface.encodeFunctionData(data.fromCToken ? CompoundFunctions.redeem : CompoundFunctions.mint, [srcAmount]);
|
|
41
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, cToken, undefined, undefined, undefined, data.fromCToken);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.Compound = Compound;
|
|
45
|
-
Compound.dexKeys = ['compound'];
|
|
46
|
-
//# sourceMappingURL=compound.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compound.js","sourceRoot":"","sources":["../../src/dex/compound.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAC7D,4CAAsD;AAGtD,uDAAmD;AACnD,mFAA6C,CAAC,WAAW;AACzD,oCAAwC;AAQxC,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IACpB,sCAAiB,CAAA;IACjB,kCAAa,CAAA;AACf,CAAC,EAHI,iBAAiB,KAAjB,iBAAiB,QAGrB;AAED,MAAa,QACX,SAAQ,gCAAc;IAMtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,eAAS,CAAC,4BAAsB,CAAC,CAAC;IAC7D,CAAC;IAED,eAAe,CACb,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAkB,EAClB,IAAc;QAEd,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU;QAEjE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAC3C;YACE,YAAY,EAAE;gBACZ,MAAM,EAAE,SAAS;aAClB;SACF,EACD,EAAE,MAAM,EAAE,CACX,CAAC;QAEF,OAAO;YACL,8CAA8C;YAC9C,cAAc,EAAE,wBAAY;YAC5B,OAAO;YACP,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAkB,EAClB,IAAc;QAEd,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;QACtD,MAAM,QAAQ,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAC;YACrC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,IAAI,CAAC;YAC/D,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,kBAAkB,CACpC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,EACnE,CAAC,SAAS,CAAC,CACZ,CAAC;QAEN,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,SAAS,EACT,SAAS,EACT,SAAS,EACT,IAAI,CAAC,UAAU,CAChB,CAAC;IACJ,CAAC;;AAnEH,4BAoEC;AAhEQ,gBAAO,GAAG,CAAC,UAAU,CAAC,CAAC"}
|