@paraswap/dex-lib 3.8.13 → 3.8.15
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/.vscode/launch.json +16 -0
- package/.vscode/settings.json +3 -0
- package/build/abi/Uncompressor.json +250 -0
- package/build/abi/concentrator/arUSD5115.json +1746 -0
- package/build/abi/fx-protocol/FxMarket.json +1284 -0
- package/build/abi/fx-protocol/weETHOralce.json +676 -0
- package/build/abi/integral/factory.json +333 -0
- package/build/abi/integral/oracle.json +501 -0
- package/build/abi/{inception/inception-ineth-pool.json → integral/pool.json} +522 -543
- package/build/abi/integral/relayer.json +1536 -0
- package/build/abi/maverick-v2/MaverickV2Router.json +778 -0
- package/build/dex/aave-v1/aave-v1.d.ts +1 -2
- package/build/dex/aave-v1/aave-v1.js +0 -22
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/bProtocol.d.ts +18 -0
- package/build/dex/bProtocol.js +39 -0
- package/build/dex/bProtocol.js.map +1 -0
- package/build/dex/bancor.d.ts +26 -0
- package/build/dex/bancor.js +58 -0
- package/build/dex/bancor.js.map +1 -0
- package/build/dex/compound.d.ts +18 -0
- package/build/dex/compound.js +46 -0
- package/build/dex/compound.js.map +1 -0
- package/build/dex/concentrator-arusd/concentrator-arusd-event.d.ts +17 -0
- package/build/dex/concentrator-arusd/concentrator-arusd-event.js +66 -0
- package/build/dex/concentrator-arusd/concentrator-arusd-event.js.map +1 -0
- package/build/dex/concentrator-arusd/concentrator-arusd.d.ts +6 -3
- package/build/dex/concentrator-arusd/concentrator-arusd.js +45 -41
- package/build/dex/concentrator-arusd/concentrator-arusd.js.map +1 -1
- package/build/dex/concentrator-arusd/config.d.ts +1 -2
- package/build/dex/concentrator-arusd/config.js +2 -6
- package/build/dex/concentrator-arusd/config.js.map +1 -1
- package/build/dex/concentrator-arusd/types.d.ts +7 -3
- package/build/dex/concentrator-arusd/utils.d.ts +4 -0
- package/build/dex/concentrator-arusd/utils.js +27 -0
- package/build/dex/concentrator-arusd/utils.js.map +1 -0
- package/build/dex/curve-v2.d.ts +58 -0
- package/build/dex/curve-v2.js +180 -0
- package/build/dex/curve-v2.js.map +1 -0
- package/build/dex/dodo-v1.d.ts +33 -0
- package/build/dex/dodo-v1.js +63 -0
- package/build/dex/dodo-v1.js.map +1 -0
- package/build/dex/etherfi/etherfi.d.ts +26 -0
- package/build/dex/etherfi/etherfi.js +96 -0
- package/build/dex/etherfi/etherfi.js.map +1 -0
- package/build/dex/fx-protocol-rusd/config.d.ts +1 -2
- package/build/dex/fx-protocol-rusd/config.js +3 -6
- package/build/dex/fx-protocol-rusd/config.js.map +1 -1
- package/build/dex/fx-protocol-rusd/fx-protocol-rusd-event.d.ts +18 -0
- package/build/dex/fx-protocol-rusd/fx-protocol-rusd-event.js +71 -0
- package/build/dex/fx-protocol-rusd/fx-protocol-rusd-event.js.map +1 -0
- package/build/dex/fx-protocol-rusd/fx-protocol-rusd.d.ts +10 -10
- package/build/dex/fx-protocol-rusd/fx-protocol-rusd.js +75 -70
- package/build/dex/fx-protocol-rusd/fx-protocol-rusd.js.map +1 -1
- package/build/dex/fx-protocol-rusd/types.d.ts +6 -3
- package/build/dex/fx-protocol-rusd/utils.d.ts +4 -0
- package/build/dex/fx-protocol-rusd/utils.js +26 -0
- package/build/dex/fx-protocol-rusd/utils.js.map +1 -0
- package/build/dex/index.js +4 -0
- package/build/dex/index.js.map +1 -1
- package/build/dex/{infusion → integral}/config.d.ts +1 -1
- package/build/dex/integral/config.js +20 -0
- package/build/dex/integral/config.js.map +1 -0
- package/build/dex/integral/context.d.ts +40 -0
- package/build/dex/integral/context.js +158 -0
- package/build/dex/integral/context.js.map +1 -0
- package/build/dex/integral/helpers.d.ts +17 -0
- package/build/dex/integral/helpers.js +157 -0
- package/build/dex/integral/helpers.js.map +1 -0
- package/build/dex/integral/integral-factory.d.ts +24 -0
- package/build/dex/integral/integral-factory.js +95 -0
- package/build/dex/integral/integral-factory.js.map +1 -0
- package/build/dex/integral/integral-pool.d.ts +50 -0
- package/build/dex/integral/integral-pool.js +149 -0
- package/build/dex/integral/integral-pool.js.map +1 -0
- package/build/dex/integral/integral-pricing.d.ts +18 -0
- package/build/dex/integral/integral-pricing.js +114 -0
- package/build/dex/integral/integral-pricing.js.map +1 -0
- package/build/dex/integral/integral-relayer.d.ts +42 -0
- package/build/dex/integral/integral-relayer.js +192 -0
- package/build/dex/integral/integral-relayer.js.map +1 -0
- package/build/dex/integral/integral-token.d.ts +27 -0
- package/build/dex/integral/integral-token.js +59 -0
- package/build/dex/integral/integral-token.js.map +1 -0
- package/build/dex/{inception/inception-native.d.ts → integral/integral.d.ts} +19 -21
- package/build/dex/integral/integral.js +377 -0
- package/build/dex/integral/integral.js.map +1 -0
- package/build/dex/integral/types.d.ts +84 -0
- package/build/dex/integral/types.js +9 -0
- package/build/dex/integral/types.js.map +1 -0
- package/build/dex/integral/utils-e2e.d.ts +9 -0
- package/build/dex/integral/utils-e2e.js +131 -0
- package/build/dex/integral/utils-e2e.js.map +1 -0
- package/build/dex/integral/utils.d.ts +17 -0
- package/build/dex/integral/utils.js +94 -0
- package/build/dex/integral/utils.js.map +1 -0
- package/build/dex/lido.d.ts +19 -0
- package/build/dex/lido.js +42 -0
- package/build/dex/lido.js.map +1 -0
- package/build/dex/onebit.d.ts +25 -0
- package/build/dex/onebit.js +42 -0
- package/build/dex/onebit.js.map +1 -0
- package/build/dex/oswap/oswap.js +4 -1
- package/build/dex/oswap/oswap.js.map +1 -1
- package/build/dex/platypus/platypus.d.ts +1 -2
- package/build/dex/platypus/platypus.js +0 -31
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/sdai/config.d.ts +11 -0
- package/build/dex/sdai/config.js +21 -0
- package/build/dex/sdai/config.js.map +1 -0
- package/build/dex/sdai/constants.d.ts +2 -0
- package/build/dex/sdai/constants.js +6 -0
- package/build/dex/sdai/constants.js.map +1 -0
- package/build/dex/sdai/scripts/validate-state.d.ts +1 -0
- package/build/dex/sdai/scripts/validate-state.js +102 -0
- package/build/dex/sdai/scripts/validate-state.js.map +1 -0
- package/build/dex/sdai/sdai-pool.d.ts +16 -0
- package/build/dex/sdai/sdai-pool.js +85 -0
- package/build/dex/sdai/sdai-pool.js.map +1 -0
- package/build/dex/sdai/sdai.d.ts +51 -0
- package/build/dex/sdai/sdai.js +172 -0
- package/build/dex/sdai/sdai.js.map +1 -0
- package/build/dex/sdai/types.d.ts +21 -0
- package/build/dex/sdai/types.js +11 -0
- package/build/dex/sdai/types.js.map +1 -0
- package/build/dex/sdai/utils.d.ts +4 -0
- package/build/dex/sdai/utils.js +39 -0
- package/build/dex/sdai/utils.js.map +1 -0
- package/build/dex/smoothy.d.ts +26 -0
- package/build/dex/smoothy.js +48 -0
- package/build/dex/smoothy.js.map +1 -0
- package/build/dex/stable-pool.d.ts +28 -0
- package/build/dex/stable-pool.js +62 -0
- package/build/dex/stable-pool.js.map +1 -0
- package/build/dex/swaap-v1/swaap-v1.d.ts +1 -2
- package/build/dex/swaap-v1/swaap-v1.js +0 -10
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/dex/trader-joe-v2.1.d.ts +43 -0
- package/build/dex/trader-joe-v2.1.js +79 -0
- package/build/dex/trader-joe-v2.1.js.map +1 -0
- package/build/executor/Executor01BytecodeBuilder.js +4 -5
- package/build/executor/Executor01BytecodeBuilder.js.map +1 -1
- package/build/executor/Executor02BytecodeBuilder.js +2 -3
- package/build/executor/Executor02BytecodeBuilder.js.map +1 -1
- package/build/executor/Executor03BytecodeBuilder.js +24 -14
- package/build/executor/Executor03BytecodeBuilder.js.map +1 -1
- package/build/executor/compressor/Compressor.d.ts +23 -0
- package/build/executor/compressor/Compressor.js +144 -0
- package/build/executor/compressor/Compressor.js.map +1 -0
- package/build/executor/compressor/compress.d.ts +17 -0
- package/build/executor/compressor/compress.js +187 -0
- package/build/executor/compressor/compress.js.map +1 -0
- package/build/executor/compressor/compress_functions/addressSubstitution.d.ts +6 -0
- package/build/executor/compressor/compress_functions/addressSubstitution.js +29 -0
- package/build/executor/compressor/compress_functions/addressSubstitution.js.map +1 -0
- package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.d.ts +10 -0
- package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js +40 -0
- package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js.map +1 -0
- package/build/executor/compressor/compress_functions/byteSubstitution.d.ts +11 -0
- package/build/executor/compressor/compress_functions/byteSubstitution.js +64 -0
- package/build/executor/compressor/compress_functions/byteSubstitution.js.map +1 -0
- package/build/executor/compressor/compress_functions/ffSubstitution.d.ts +7 -0
- package/build/executor/compressor/compress_functions/ffSubstitution.js +54 -0
- package/build/executor/compressor/compress_functions/ffSubstitution.js.map +1 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute.d.ts +8 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js +67 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js.map +1 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.d.ts +8 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js +61 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js.map +1 -0
- package/build/executor/compressor/compress_functions/reverseAddressSubstitution.d.ts +6 -0
- package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js +37 -0
- package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js.map +1 -0
- package/build/executor/compressor/compress_functions/searchUnusedBytes.d.ts +9 -0
- package/build/executor/compressor/compress_functions/searchUnusedBytes.js +33 -0
- package/build/executor/compressor/compress_functions/searchUnusedBytes.js.map +1 -0
- package/build/executor/compressor/fetchSaved.d.ts +0 -0
- package/build/executor/compressor/fetchSaved.js +17 -0
- package/build/executor/compressor/fetchSaved.js.map +1 -0
- package/build/executor/compressor/utils/computeCostL2.d.ts +2 -0
- package/build/executor/compressor/utils/computeCostL2.js +14 -0
- package/build/executor/compressor/utils/computeCostL2.js.map +1 -0
- package/build/executor/compressor/utils/findLongestDuplicatedString.d.ts +2 -0
- package/build/executor/compressor/utils/findLongestDuplicatedString.js +30 -0
- package/build/executor/compressor/utils/findLongestDuplicatedString.js.map +1 -0
- package/build/executor/compressor/utils/getAllIndexes.d.ts +2 -0
- package/build/executor/compressor/utils/getAllIndexes.js +12 -0
- package/build/executor/compressor/utils/getAllIndexes.js.map +1 -0
- package/build/executor/compressor/utils/getByteForAddress.d.ts +2 -0
- package/build/executor/compressor/utils/getByteForAddress.js +14 -0
- package/build/executor/compressor/utils/getByteForAddress.js.map +1 -0
- package/build/executor/compressor/utils/intTo2Bytes.d.ts +2 -0
- package/build/executor/compressor/utils/intTo2Bytes.js +14 -0
- package/build/executor/compressor/utils/intTo2Bytes.js.map +1 -0
- package/build/executor/compressor/utils/intTo3Bytes.d.ts +2 -0
- package/build/executor/compressor/utils/intTo3Bytes.js +18 -0
- package/build/executor/compressor/utils/intTo3Bytes.js.map +1 -0
- package/build/executor/compressor/utils/intToByte.d.ts +2 -0
- package/build/executor/compressor/utils/intToByte.js +10 -0
- package/build/executor/compressor/utils/intToByte.js.map +1 -0
- package/build/generic-swap-transaction-builder.d.ts +1 -1
- package/build/generic-swap-transaction-builder.js +10 -10
- package/build/generic-swap-transaction-builder.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/concentrator/arUSD.json +568 -0
- package/src/abi/concentrator/arUSD5115.json +1746 -0
- package/src/abi/fx-protocol/FxMarket.json +1284 -0
- package/src/abi/fx-protocol/FxUSD.json +1227 -0
- package/src/abi/fx-protocol/weETHOralce.json +676 -0
- package/src/dex/concentrator-arusd/concentrator-arusd-e2e.test.ts +92 -0
- package/src/dex/concentrator-arusd/concentrator-arusd-event.ts +100 -0
- package/src/dex/concentrator-arusd/concentrator-arusd-integration.test.ts +104 -0
- package/src/dex/concentrator-arusd/concentrator-arusd.ts +269 -0
- package/src/dex/concentrator-arusd/concetrator-arusd-events.test.ts +97 -0
- package/src/dex/concentrator-arusd/config.ts +13 -0
- package/src/dex/concentrator-arusd/types.ts +16 -0
- package/src/dex/concentrator-arusd/utils.ts +36 -0
- package/src/dex/fx-protocol-rusd/config.ts +14 -0
- package/src/dex/fx-protocol-rusd/fx-protocol-e2e.test.ts +96 -0
- package/src/dex/fx-protocol-rusd/fx-protocol-events.test.ts +101 -0
- package/src/dex/fx-protocol-rusd/fx-protocol-integration.test.ts +104 -0
- package/src/dex/fx-protocol-rusd/fx-protocol-rusd-event.ts +112 -0
- package/src/dex/fx-protocol-rusd/fx-protocol-rusd.ts +282 -0
- package/src/dex/fx-protocol-rusd/types.ts +16 -0
- package/src/dex/fx-protocol-rusd/utils.ts +47 -0
- package/src/dex/index.ts +4 -0
- package/src/dex/wsteth/wsteth-integration.test.ts +0 -1
- package/src/executor/Executor01BytecodeBuilder.ts +4 -8
- package/src/executor/Executor02BytecodeBuilder.ts +2 -7
- package/src/executor/Executor03BytecodeBuilder.ts +34 -19
- package/src/generic-swap-transaction-builder.ts +3 -5
- package/tests/constants-e2e.ts +10 -0
- package/build/abi/inception/inception-ineth.json +0 -609
- package/build/abi/inception/inception-ratio-feed.json +0 -93
- package/build/abi/inception/inception-vault.json +0 -991
- package/build/abi/infusion/InfusionFactory.json +0 -147
- package/build/abi/infusion/InfusionPair.json +0 -658
- package/build/abi/infusion/InfusionRouter.json +0 -442
- package/build/dex/idle-dao/idle-dao-pool.d.ts +0 -56
- package/build/dex/idle-dao/idle-dao-pool.js +0 -176
- package/build/dex/idle-dao/idle-dao-pool.js.map +0 -1
- package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +0 -16
- package/build/dex/idle-dao/idle-dao-pooling-pool.js +0 -57
- package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +0 -1
- package/build/dex/idle-dao/scripts.d.ts +0 -9
- package/build/dex/idle-dao/scripts.js +0 -552
- package/build/dex/idle-dao/scripts.js.map +0 -1
- package/build/dex/inception/config.d.ts +0 -5
- package/build/dex/inception/config.js +0 -112
- package/build/dex/inception/config.js.map +0 -1
- package/build/dex/inception/inception-event-pool.d.ts +0 -23
- package/build/dex/inception/inception-event-pool.js +0 -34
- package/build/dex/inception/inception-event-pool.js.map +0 -1
- package/build/dex/inception/inception-native.js +0 -131
- package/build/dex/inception/inception-native.js.map +0 -1
- package/build/dex/inception/inception-pool.d.ts +0 -18
- package/build/dex/inception/inception-pool.js +0 -32
- package/build/dex/inception/inception-pool.js.map +0 -1
- package/build/dex/inception/inception-price-feed.d.ts +0 -19
- package/build/dex/inception/inception-price-feed.js +0 -51
- package/build/dex/inception/inception-price-feed.js.map +0 -1
- package/build/dex/inception/inception.d.ts +0 -44
- package/build/dex/inception/inception.js +0 -162
- package/build/dex/inception/inception.js.map +0 -1
- package/build/dex/inception/tokens.d.ts +0 -9
- package/build/dex/inception/tokens.js +0 -28
- package/build/dex/inception/tokens.js.map +0 -1
- package/build/dex/inception/types.d.ts +0 -22
- package/build/dex/inception/types.js +0 -3
- package/build/dex/inception/types.js.map +0 -1
- package/build/dex/inception/utils.d.ts +0 -7
- package/build/dex/inception/utils.js +0 -58
- package/build/dex/inception/utils.js.map +0 -1
- package/build/dex/infusion/config.js +0 -25
- package/build/dex/infusion/config.js.map +0 -1
- package/build/dex/infusion/infusion-stable-pool.d.ts +0 -4
- package/build/dex/infusion/infusion-stable-pool.js +0 -74
- package/build/dex/infusion/infusion-stable-pool.js.map +0 -1
- package/build/dex/infusion/infusion.d.ts +0 -54
- package/build/dex/infusion/infusion.js +0 -532
- package/build/dex/infusion/infusion.js.map +0 -1
- package/build/dex/infusion/types.d.ts +0 -47
- package/build/dex/infusion/types.js +0 -3
- package/build/dex/infusion/types.js.map +0 -1
- package/build/dex/infusion/utils/isStablePair.d.ts +0 -2
- package/build/dex/infusion/utils/isStablePair.js +0 -18
- package/build/dex/infusion/utils/isStablePair.js.map +0 -1
|
@@ -1,442 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"inputs": [
|
|
4
|
-
{ "internalType": "address", "name": "_factory", "type": "address" },
|
|
5
|
-
{
|
|
6
|
-
"internalType": "contract ILockFactory",
|
|
7
|
-
"name": "_lockFactory",
|
|
8
|
-
"type": "address"
|
|
9
|
-
},
|
|
10
|
-
{ "internalType": "address", "name": "_weth", "type": "address" }
|
|
11
|
-
],
|
|
12
|
-
"stateMutability": "nonpayable",
|
|
13
|
-
"type": "constructor"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"inputs": [
|
|
17
|
-
{ "internalType": "address", "name": "target", "type": "address" }
|
|
18
|
-
],
|
|
19
|
-
"name": "AddressEmptyCode",
|
|
20
|
-
"type": "error"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"inputs": [
|
|
24
|
-
{ "internalType": "address", "name": "account", "type": "address" }
|
|
25
|
-
],
|
|
26
|
-
"name": "AddressInsufficientBalance",
|
|
27
|
-
"type": "error"
|
|
28
|
-
},
|
|
29
|
-
{ "inputs": [], "name": "FailedInnerCall", "type": "error" },
|
|
30
|
-
{
|
|
31
|
-
"inputs": [
|
|
32
|
-
{ "internalType": "address", "name": "token", "type": "address" }
|
|
33
|
-
],
|
|
34
|
-
"name": "SafeERC20FailedOperation",
|
|
35
|
-
"type": "error"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"inputs": [
|
|
39
|
-
{ "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" },
|
|
40
|
-
{
|
|
41
|
-
"components": [
|
|
42
|
-
{ "internalType": "address", "name": "from", "type": "address" },
|
|
43
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
44
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" }
|
|
45
|
-
],
|
|
46
|
-
"internalType": "struct Router.route[]",
|
|
47
|
-
"name": "routes",
|
|
48
|
-
"type": "tuple[]"
|
|
49
|
-
},
|
|
50
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
51
|
-
{ "internalType": "uint256", "name": "deadline", "type": "uint256" }
|
|
52
|
-
],
|
|
53
|
-
"name": "UNSAFE_swapExactTokensForTokens",
|
|
54
|
-
"outputs": [
|
|
55
|
-
{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }
|
|
56
|
-
],
|
|
57
|
-
"stateMutability": "nonpayable",
|
|
58
|
-
"type": "function"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"inputs": [
|
|
62
|
-
{ "internalType": "address", "name": "tokenA", "type": "address" },
|
|
63
|
-
{ "internalType": "address", "name": "tokenB", "type": "address" },
|
|
64
|
-
{
|
|
65
|
-
"internalType": "uint256",
|
|
66
|
-
"name": "amountADesired",
|
|
67
|
-
"type": "uint256"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"internalType": "uint256",
|
|
71
|
-
"name": "amountBDesired",
|
|
72
|
-
"type": "uint256"
|
|
73
|
-
},
|
|
74
|
-
{ "internalType": "uint256", "name": "amountAMin", "type": "uint256" },
|
|
75
|
-
{ "internalType": "uint256", "name": "amountBMin", "type": "uint256" },
|
|
76
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
77
|
-
{ "internalType": "uint256", "name": "deadline", "type": "uint256" },
|
|
78
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" },
|
|
79
|
-
{ "internalType": "uint256", "name": "lockerFeesP", "type": "uint256" }
|
|
80
|
-
],
|
|
81
|
-
"name": "addLiquidity",
|
|
82
|
-
"outputs": [
|
|
83
|
-
{ "internalType": "uint256", "name": "amountA", "type": "uint256" },
|
|
84
|
-
{ "internalType": "uint256", "name": "amountB", "type": "uint256" },
|
|
85
|
-
{ "internalType": "uint256", "name": "liquidity", "type": "uint256" }
|
|
86
|
-
],
|
|
87
|
-
"stateMutability": "nonpayable",
|
|
88
|
-
"type": "function"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"inputs": [
|
|
92
|
-
{ "internalType": "address", "name": "token", "type": "address" },
|
|
93
|
-
{
|
|
94
|
-
"internalType": "uint256",
|
|
95
|
-
"name": "amountTokenDesired",
|
|
96
|
-
"type": "uint256"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"internalType": "uint256",
|
|
100
|
-
"name": "amountTokenMin",
|
|
101
|
-
"type": "uint256"
|
|
102
|
-
},
|
|
103
|
-
{ "internalType": "uint256", "name": "amountETHMin", "type": "uint256" },
|
|
104
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
105
|
-
{ "internalType": "uint256", "name": "deadline", "type": "uint256" },
|
|
106
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" },
|
|
107
|
-
{ "internalType": "uint256", "name": "lockerFeesP", "type": "uint256" }
|
|
108
|
-
],
|
|
109
|
-
"name": "addLiquidityETH",
|
|
110
|
-
"outputs": [
|
|
111
|
-
{ "internalType": "uint256", "name": "amountToken", "type": "uint256" },
|
|
112
|
-
{ "internalType": "uint256", "name": "amountETH", "type": "uint256" },
|
|
113
|
-
{ "internalType": "uint256", "name": "liquidity", "type": "uint256" }
|
|
114
|
-
],
|
|
115
|
-
"stateMutability": "payable",
|
|
116
|
-
"type": "function"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"inputs": [],
|
|
120
|
-
"name": "factory",
|
|
121
|
-
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
122
|
-
"stateMutability": "view",
|
|
123
|
-
"type": "function"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"inputs": [
|
|
127
|
-
{ "internalType": "uint256", "name": "amountIn", "type": "uint256" },
|
|
128
|
-
{ "internalType": "address", "name": "tokenIn", "type": "address" },
|
|
129
|
-
{ "internalType": "address", "name": "tokenOut", "type": "address" }
|
|
130
|
-
],
|
|
131
|
-
"name": "getAmountOut",
|
|
132
|
-
"outputs": [
|
|
133
|
-
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
|
|
134
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" }
|
|
135
|
-
],
|
|
136
|
-
"stateMutability": "view",
|
|
137
|
-
"type": "function"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"inputs": [
|
|
141
|
-
{ "internalType": "uint256", "name": "amountIn", "type": "uint256" },
|
|
142
|
-
{
|
|
143
|
-
"components": [
|
|
144
|
-
{ "internalType": "address", "name": "from", "type": "address" },
|
|
145
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
146
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" }
|
|
147
|
-
],
|
|
148
|
-
"internalType": "struct Router.route[]",
|
|
149
|
-
"name": "routes",
|
|
150
|
-
"type": "tuple[]"
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
"name": "getAmountsOut",
|
|
154
|
-
"outputs": [
|
|
155
|
-
{ "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }
|
|
156
|
-
],
|
|
157
|
-
"stateMutability": "view",
|
|
158
|
-
"type": "function"
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
"inputs": [
|
|
162
|
-
{ "internalType": "address", "name": "tokenA", "type": "address" },
|
|
163
|
-
{ "internalType": "address", "name": "tokenB", "type": "address" },
|
|
164
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" }
|
|
165
|
-
],
|
|
166
|
-
"name": "getReserves",
|
|
167
|
-
"outputs": [
|
|
168
|
-
{ "internalType": "uint256", "name": "reserveA", "type": "uint256" },
|
|
169
|
-
{ "internalType": "uint256", "name": "reserveB", "type": "uint256" }
|
|
170
|
-
],
|
|
171
|
-
"stateMutability": "view",
|
|
172
|
-
"type": "function"
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
"inputs": [
|
|
176
|
-
{ "internalType": "address", "name": "pair", "type": "address" }
|
|
177
|
-
],
|
|
178
|
-
"name": "isPair",
|
|
179
|
-
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
180
|
-
"stateMutability": "view",
|
|
181
|
-
"type": "function"
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"inputs": [],
|
|
185
|
-
"name": "lockFactory",
|
|
186
|
-
"outputs": [
|
|
187
|
-
{ "internalType": "contract ILockFactory", "name": "", "type": "address" }
|
|
188
|
-
],
|
|
189
|
-
"stateMutability": "view",
|
|
190
|
-
"type": "function"
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"inputs": [
|
|
194
|
-
{ "internalType": "address", "name": "tokenA", "type": "address" },
|
|
195
|
-
{ "internalType": "address", "name": "tokenB", "type": "address" },
|
|
196
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" }
|
|
197
|
-
],
|
|
198
|
-
"name": "pairFor",
|
|
199
|
-
"outputs": [
|
|
200
|
-
{ "internalType": "address", "name": "pair", "type": "address" }
|
|
201
|
-
],
|
|
202
|
-
"stateMutability": "view",
|
|
203
|
-
"type": "function"
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
"inputs": [
|
|
207
|
-
{ "internalType": "address", "name": "tokenA", "type": "address" },
|
|
208
|
-
{ "internalType": "address", "name": "tokenB", "type": "address" },
|
|
209
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" },
|
|
210
|
-
{
|
|
211
|
-
"internalType": "uint256",
|
|
212
|
-
"name": "amountADesired",
|
|
213
|
-
"type": "uint256"
|
|
214
|
-
},
|
|
215
|
-
{ "internalType": "uint256", "name": "amountBDesired", "type": "uint256" }
|
|
216
|
-
],
|
|
217
|
-
"name": "quoteAddLiquidity",
|
|
218
|
-
"outputs": [
|
|
219
|
-
{ "internalType": "uint256", "name": "amountA", "type": "uint256" },
|
|
220
|
-
{ "internalType": "uint256", "name": "amountB", "type": "uint256" },
|
|
221
|
-
{ "internalType": "uint256", "name": "liquidity", "type": "uint256" }
|
|
222
|
-
],
|
|
223
|
-
"stateMutability": "view",
|
|
224
|
-
"type": "function"
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
"inputs": [
|
|
228
|
-
{ "internalType": "address", "name": "tokenA", "type": "address" },
|
|
229
|
-
{ "internalType": "address", "name": "tokenB", "type": "address" },
|
|
230
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" },
|
|
231
|
-
{ "internalType": "uint256", "name": "liquidity", "type": "uint256" }
|
|
232
|
-
],
|
|
233
|
-
"name": "quoteRemoveLiquidity",
|
|
234
|
-
"outputs": [
|
|
235
|
-
{ "internalType": "uint256", "name": "amountA", "type": "uint256" },
|
|
236
|
-
{ "internalType": "uint256", "name": "amountB", "type": "uint256" }
|
|
237
|
-
],
|
|
238
|
-
"stateMutability": "view",
|
|
239
|
-
"type": "function"
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"inputs": [
|
|
243
|
-
{ "internalType": "address", "name": "tokenA", "type": "address" },
|
|
244
|
-
{ "internalType": "address", "name": "tokenB", "type": "address" },
|
|
245
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" },
|
|
246
|
-
{ "internalType": "uint256", "name": "liquidity", "type": "uint256" },
|
|
247
|
-
{ "internalType": "uint256", "name": "amountAMin", "type": "uint256" },
|
|
248
|
-
{ "internalType": "uint256", "name": "amountBMin", "type": "uint256" },
|
|
249
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
250
|
-
{ "internalType": "uint256", "name": "deadline", "type": "uint256" }
|
|
251
|
-
],
|
|
252
|
-
"name": "removeLiquidity",
|
|
253
|
-
"outputs": [
|
|
254
|
-
{ "internalType": "uint256", "name": "amountA", "type": "uint256" },
|
|
255
|
-
{ "internalType": "uint256", "name": "amountB", "type": "uint256" }
|
|
256
|
-
],
|
|
257
|
-
"stateMutability": "nonpayable",
|
|
258
|
-
"type": "function"
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
"inputs": [
|
|
262
|
-
{ "internalType": "address", "name": "token", "type": "address" },
|
|
263
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" },
|
|
264
|
-
{ "internalType": "uint256", "name": "liquidity", "type": "uint256" },
|
|
265
|
-
{
|
|
266
|
-
"internalType": "uint256",
|
|
267
|
-
"name": "amountTokenMin",
|
|
268
|
-
"type": "uint256"
|
|
269
|
-
},
|
|
270
|
-
{ "internalType": "uint256", "name": "amountETHMin", "type": "uint256" },
|
|
271
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
272
|
-
{ "internalType": "uint256", "name": "deadline", "type": "uint256" }
|
|
273
|
-
],
|
|
274
|
-
"name": "removeLiquidityETH",
|
|
275
|
-
"outputs": [
|
|
276
|
-
{ "internalType": "uint256", "name": "amountToken", "type": "uint256" },
|
|
277
|
-
{ "internalType": "uint256", "name": "amountETH", "type": "uint256" }
|
|
278
|
-
],
|
|
279
|
-
"stateMutability": "nonpayable",
|
|
280
|
-
"type": "function"
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
"inputs": [
|
|
284
|
-
{ "internalType": "address", "name": "token", "type": "address" },
|
|
285
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" },
|
|
286
|
-
{ "internalType": "uint256", "name": "liquidity", "type": "uint256" },
|
|
287
|
-
{
|
|
288
|
-
"internalType": "uint256",
|
|
289
|
-
"name": "amountTokenMin",
|
|
290
|
-
"type": "uint256"
|
|
291
|
-
},
|
|
292
|
-
{ "internalType": "uint256", "name": "amountETHMin", "type": "uint256" },
|
|
293
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
294
|
-
{ "internalType": "uint256", "name": "deadline", "type": "uint256" },
|
|
295
|
-
{ "internalType": "bool", "name": "approveMax", "type": "bool" },
|
|
296
|
-
{ "internalType": "uint8", "name": "v", "type": "uint8" },
|
|
297
|
-
{ "internalType": "bytes32", "name": "r", "type": "bytes32" },
|
|
298
|
-
{ "internalType": "bytes32", "name": "s", "type": "bytes32" }
|
|
299
|
-
],
|
|
300
|
-
"name": "removeLiquidityETHWithPermit",
|
|
301
|
-
"outputs": [
|
|
302
|
-
{ "internalType": "uint256", "name": "amountToken", "type": "uint256" },
|
|
303
|
-
{ "internalType": "uint256", "name": "amountETH", "type": "uint256" }
|
|
304
|
-
],
|
|
305
|
-
"stateMutability": "nonpayable",
|
|
306
|
-
"type": "function"
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
"inputs": [
|
|
310
|
-
{ "internalType": "address", "name": "tokenA", "type": "address" },
|
|
311
|
-
{ "internalType": "address", "name": "tokenB", "type": "address" },
|
|
312
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" },
|
|
313
|
-
{ "internalType": "uint256", "name": "liquidity", "type": "uint256" },
|
|
314
|
-
{ "internalType": "uint256", "name": "amountAMin", "type": "uint256" },
|
|
315
|
-
{ "internalType": "uint256", "name": "amountBMin", "type": "uint256" },
|
|
316
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
317
|
-
{ "internalType": "uint256", "name": "deadline", "type": "uint256" },
|
|
318
|
-
{ "internalType": "bool", "name": "approveMax", "type": "bool" },
|
|
319
|
-
{ "internalType": "uint8", "name": "v", "type": "uint8" },
|
|
320
|
-
{ "internalType": "bytes32", "name": "r", "type": "bytes32" },
|
|
321
|
-
{ "internalType": "bytes32", "name": "s", "type": "bytes32" }
|
|
322
|
-
],
|
|
323
|
-
"name": "removeLiquidityWithPermit",
|
|
324
|
-
"outputs": [
|
|
325
|
-
{ "internalType": "uint256", "name": "amountA", "type": "uint256" },
|
|
326
|
-
{ "internalType": "uint256", "name": "amountB", "type": "uint256" }
|
|
327
|
-
],
|
|
328
|
-
"stateMutability": "nonpayable",
|
|
329
|
-
"type": "function"
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
"inputs": [
|
|
333
|
-
{ "internalType": "address", "name": "tokenA", "type": "address" },
|
|
334
|
-
{ "internalType": "address", "name": "tokenB", "type": "address" }
|
|
335
|
-
],
|
|
336
|
-
"name": "sortTokens",
|
|
337
|
-
"outputs": [
|
|
338
|
-
{ "internalType": "address", "name": "token0", "type": "address" },
|
|
339
|
-
{ "internalType": "address", "name": "token1", "type": "address" }
|
|
340
|
-
],
|
|
341
|
-
"stateMutability": "pure",
|
|
342
|
-
"type": "function"
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
"inputs": [
|
|
346
|
-
{ "internalType": "uint256", "name": "amountOutMin", "type": "uint256" },
|
|
347
|
-
{
|
|
348
|
-
"components": [
|
|
349
|
-
{ "internalType": "address", "name": "from", "type": "address" },
|
|
350
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
351
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" }
|
|
352
|
-
],
|
|
353
|
-
"internalType": "struct Router.route[]",
|
|
354
|
-
"name": "routes",
|
|
355
|
-
"type": "tuple[]"
|
|
356
|
-
},
|
|
357
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
358
|
-
{ "internalType": "uint256", "name": "deadline", "type": "uint256" }
|
|
359
|
-
],
|
|
360
|
-
"name": "swapExactETHForTokens",
|
|
361
|
-
"outputs": [
|
|
362
|
-
{ "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }
|
|
363
|
-
],
|
|
364
|
-
"stateMutability": "payable",
|
|
365
|
-
"type": "function"
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
"inputs": [
|
|
369
|
-
{ "internalType": "uint256", "name": "amountIn", "type": "uint256" },
|
|
370
|
-
{ "internalType": "uint256", "name": "amountOutMin", "type": "uint256" },
|
|
371
|
-
{
|
|
372
|
-
"components": [
|
|
373
|
-
{ "internalType": "address", "name": "from", "type": "address" },
|
|
374
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
375
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" }
|
|
376
|
-
],
|
|
377
|
-
"internalType": "struct Router.route[]",
|
|
378
|
-
"name": "routes",
|
|
379
|
-
"type": "tuple[]"
|
|
380
|
-
},
|
|
381
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
382
|
-
{ "internalType": "uint256", "name": "deadline", "type": "uint256" }
|
|
383
|
-
],
|
|
384
|
-
"name": "swapExactTokensForETH",
|
|
385
|
-
"outputs": [
|
|
386
|
-
{ "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }
|
|
387
|
-
],
|
|
388
|
-
"stateMutability": "nonpayable",
|
|
389
|
-
"type": "function"
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
"inputs": [
|
|
393
|
-
{ "internalType": "uint256", "name": "amountIn", "type": "uint256" },
|
|
394
|
-
{ "internalType": "uint256", "name": "amountOutMin", "type": "uint256" },
|
|
395
|
-
{
|
|
396
|
-
"components": [
|
|
397
|
-
{ "internalType": "address", "name": "from", "type": "address" },
|
|
398
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
399
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" }
|
|
400
|
-
],
|
|
401
|
-
"internalType": "struct Router.route[]",
|
|
402
|
-
"name": "routes",
|
|
403
|
-
"type": "tuple[]"
|
|
404
|
-
},
|
|
405
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
406
|
-
{ "internalType": "uint256", "name": "deadline", "type": "uint256" }
|
|
407
|
-
],
|
|
408
|
-
"name": "swapExactTokensForTokens",
|
|
409
|
-
"outputs": [
|
|
410
|
-
{ "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }
|
|
411
|
-
],
|
|
412
|
-
"stateMutability": "nonpayable",
|
|
413
|
-
"type": "function"
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
"inputs": [
|
|
417
|
-
{ "internalType": "uint256", "name": "amountIn", "type": "uint256" },
|
|
418
|
-
{ "internalType": "uint256", "name": "amountOutMin", "type": "uint256" },
|
|
419
|
-
{ "internalType": "address", "name": "tokenFrom", "type": "address" },
|
|
420
|
-
{ "internalType": "address", "name": "tokenTo", "type": "address" },
|
|
421
|
-
{ "internalType": "bool", "name": "stable", "type": "bool" },
|
|
422
|
-
{ "internalType": "address", "name": "to", "type": "address" },
|
|
423
|
-
{ "internalType": "uint256", "name": "deadline", "type": "uint256" }
|
|
424
|
-
],
|
|
425
|
-
"name": "swapExactTokensForTokensSimple",
|
|
426
|
-
"outputs": [
|
|
427
|
-
{ "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }
|
|
428
|
-
],
|
|
429
|
-
"stateMutability": "nonpayable",
|
|
430
|
-
"type": "function"
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
"inputs": [],
|
|
434
|
-
"name": "weth",
|
|
435
|
-
"outputs": [
|
|
436
|
-
{ "internalType": "contract IWETH", "name": "", "type": "address" }
|
|
437
|
-
],
|
|
438
|
-
"stateMutability": "view",
|
|
439
|
-
"type": "function"
|
|
440
|
-
},
|
|
441
|
-
{ "stateMutability": "payable", "type": "receive" }
|
|
442
|
-
]
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import BigNumber from 'bignumber.js';
|
|
2
|
-
import { Contract } from 'web3-eth-contract';
|
|
3
|
-
import { Interface } from '@ethersproject/abi';
|
|
4
|
-
import { DeepReadonly } from 'ts-essentials';
|
|
5
|
-
import { Log, Logger } from '../../types';
|
|
6
|
-
import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
|
|
7
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
8
|
-
import { PoolState, IdleToken } from './types';
|
|
9
|
-
import { IdleDao } from './idle-dao';
|
|
10
|
-
declare type BlocksTransfers = Record<number, {
|
|
11
|
-
underlyingAmount: BigNumber;
|
|
12
|
-
idleAmount: BigNumber;
|
|
13
|
-
processed: boolean;
|
|
14
|
-
}>;
|
|
15
|
-
export declare class IdleDaoEventPool extends StatefulEventSubscriber<PoolState> {
|
|
16
|
-
readonly parentName: string;
|
|
17
|
-
protected network: number;
|
|
18
|
-
protected dexHelper: IDexHelper;
|
|
19
|
-
protected logger: Logger;
|
|
20
|
-
protected idleToken: IdleToken;
|
|
21
|
-
protected IdleDao: IdleDao;
|
|
22
|
-
handlers: {
|
|
23
|
-
[event: string]: (event: any, state: DeepReadonly<PoolState>, log: Readonly<Log>) => Promise<DeepReadonly<PoolState> | null>;
|
|
24
|
-
};
|
|
25
|
-
logDecoder: (log: Log) => any;
|
|
26
|
-
cdoContract: Contract;
|
|
27
|
-
poolInterface: Interface;
|
|
28
|
-
addressesSubscribed: string[];
|
|
29
|
-
blocksTransfers: BlocksTransfers;
|
|
30
|
-
constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, idleToken: IdleToken, IdleDao: IdleDao);
|
|
31
|
-
/**
|
|
32
|
-
* The function is called every time any of the subscribed
|
|
33
|
-
* addresses release log. The function accepts the current
|
|
34
|
-
* state, updates the state according to the log, and returns
|
|
35
|
-
* the updated state.
|
|
36
|
-
* @param state - Current state of event subscriber
|
|
37
|
-
* @param log - Log released by one of the subscribed addresses
|
|
38
|
-
* @returns Updates state of the event subscriber after the log
|
|
39
|
-
*/
|
|
40
|
-
protected processLog(state: DeepReadonly<PoolState>, log: Readonly<Log>): Promise<DeepReadonly<PoolState> | null>;
|
|
41
|
-
/**
|
|
42
|
-
* The function generates state using on-chain calls. This
|
|
43
|
-
* function is called to regenerate state if the event based
|
|
44
|
-
* system fails to fetch events and the local state is no
|
|
45
|
-
* more correct.
|
|
46
|
-
* @param blockNumber - Blocknumber for which the state should
|
|
47
|
-
* should be generated
|
|
48
|
-
* @returns state of the event subscriber at blocknumber
|
|
49
|
-
*/
|
|
50
|
-
generateState(blockNumber: number): Promise<DeepReadonly<PoolState>>;
|
|
51
|
-
setBlockState(blockNumber: number, state: PoolState): void;
|
|
52
|
-
handleCoinTransfer(event: any, state: PoolState, log: Log): Promise<DeepReadonly<PoolState> | null>;
|
|
53
|
-
processBlockTransfer(blockNumber: number, state: PoolState): PoolState;
|
|
54
|
-
handleCoinTransfer_old(event: any, state: PoolState, log: Log): Promise<DeepReadonly<PoolState> | null>;
|
|
55
|
-
}
|
|
56
|
-
export {};
|