@paraswap/dex-lib 3.8.15 → 3.8.16
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/{integral/pool.json → inception/inception-ineth-pool.json} +558 -537
- package/build/abi/inception/inception-ineth.json +609 -0
- package/build/abi/inception/inception-ratio-feed.json +93 -0
- package/build/abi/inception/inception-vault.json +991 -0
- package/build/abi/infusion/InfusionFactory.json +147 -0
- package/build/abi/infusion/InfusionPair.json +658 -0
- package/build/abi/infusion/InfusionRouter.json +442 -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/angle-transmuter/angle-transmuter.js +1 -1
- package/build/dex/angle-transmuter/angle-transmuter.js.map +1 -1
- package/build/dex/idex.d.ts +11 -7
- 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/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/inception/config.d.ts +5 -0
- package/build/dex/inception/config.js +112 -0
- package/build/dex/inception/config.js.map +1 -0
- package/build/dex/inception/inception-event-pool.d.ts +23 -0
- package/build/dex/inception/inception-event-pool.js +34 -0
- package/build/dex/inception/inception-event-pool.js.map +1 -0
- package/build/dex/{integral/integral.d.ts → inception/inception-native.d.ts} +21 -19
- package/build/dex/inception/inception-native.js +131 -0
- package/build/dex/inception/inception-native.js.map +1 -0
- package/build/dex/inception/inception-pool.d.ts +18 -0
- package/build/dex/inception/inception-pool.js +32 -0
- package/build/dex/inception/inception-pool.js.map +1 -0
- package/build/dex/inception/inception-price-feed.d.ts +19 -0
- package/build/dex/inception/inception-price-feed.js +51 -0
- package/build/dex/inception/inception-price-feed.js.map +1 -0
- package/build/dex/inception/inception.d.ts +44 -0
- package/build/dex/inception/inception.js +162 -0
- package/build/dex/inception/inception.js.map +1 -0
- package/build/dex/inception/tokens.d.ts +9 -0
- package/build/dex/inception/tokens.js +28 -0
- package/build/dex/inception/tokens.js.map +1 -0
- package/build/dex/inception/types.d.ts +22 -0
- package/build/dex/inception/types.js +3 -0
- package/build/dex/inception/types.js.map +1 -0
- package/build/dex/inception/utils.d.ts +7 -0
- package/build/dex/inception/utils.js +58 -0
- package/build/dex/inception/utils.js.map +1 -0
- package/build/dex/{integral → infusion}/config.d.ts +1 -1
- package/build/dex/infusion/config.js +25 -0
- package/build/dex/infusion/config.js.map +1 -0
- package/build/dex/infusion/infusion-stable-pool.d.ts +4 -0
- package/build/dex/infusion/infusion-stable-pool.js +74 -0
- package/build/dex/infusion/infusion-stable-pool.js.map +1 -0
- package/build/dex/infusion/infusion.d.ts +54 -0
- package/build/dex/infusion/infusion.js +510 -0
- package/build/dex/infusion/infusion.js.map +1 -0
- package/build/dex/infusion/types.d.ts +47 -0
- package/build/dex/infusion/types.js +3 -0
- package/build/dex/infusion/types.js.map +1 -0
- package/build/dex/infusion/utils/isStablePair.d.ts +2 -0
- package/build/dex/infusion/utils/isStablePair.js +18 -0
- package/build/dex/infusion/utils/isStablePair.js.map +1 -0
- package/build/dex/oswap/oswap.js +1 -4
- package/build/dex/oswap/oswap.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/dex/weth/config.js +3 -0
- package/build/dex/weth/config.js.map +1 -1
- package/package.json +1 -1
- package/src/dex/angle-transmuter/angle-transmuter.ts +1 -1
- package/src/dex/idex.ts +48 -41
- package/src/dex/weth/config.ts +3 -0
- package/src/dex/weth/weth-e2e.test.ts +156 -0
- package/.vscode/launch.json +0 -16
- package/.vscode/settings.json +0 -3
- package/build/abi/Uncompressor.json +0 -250
- package/build/abi/integral/factory.json +0 -333
- package/build/abi/integral/oracle.json +0 -501
- package/build/abi/integral/relayer.json +0 -1536
- package/build/abi/maverick-v2/MaverickV2Router.json +0 -778
- 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/integral/config.js +0 -20
- package/build/dex/integral/config.js.map +0 -1
- package/build/dex/integral/context.d.ts +0 -40
- package/build/dex/integral/context.js +0 -158
- package/build/dex/integral/context.js.map +0 -1
- package/build/dex/integral/helpers.d.ts +0 -17
- package/build/dex/integral/helpers.js +0 -157
- package/build/dex/integral/helpers.js.map +0 -1
- package/build/dex/integral/integral-factory.d.ts +0 -24
- package/build/dex/integral/integral-factory.js +0 -95
- package/build/dex/integral/integral-factory.js.map +0 -1
- package/build/dex/integral/integral-pool.d.ts +0 -50
- package/build/dex/integral/integral-pool.js +0 -149
- package/build/dex/integral/integral-pool.js.map +0 -1
- package/build/dex/integral/integral-pricing.d.ts +0 -18
- package/build/dex/integral/integral-pricing.js +0 -114
- package/build/dex/integral/integral-pricing.js.map +0 -1
- package/build/dex/integral/integral-relayer.d.ts +0 -42
- package/build/dex/integral/integral-relayer.js +0 -192
- package/build/dex/integral/integral-relayer.js.map +0 -1
- package/build/dex/integral/integral-token.d.ts +0 -27
- package/build/dex/integral/integral-token.js +0 -59
- package/build/dex/integral/integral-token.js.map +0 -1
- package/build/dex/integral/integral.js +0 -377
- package/build/dex/integral/integral.js.map +0 -1
- package/build/dex/integral/types.d.ts +0 -84
- package/build/dex/integral/types.js +0 -9
- package/build/dex/integral/types.js.map +0 -1
- package/build/dex/integral/utils-e2e.d.ts +0 -9
- package/build/dex/integral/utils-e2e.js +0 -131
- package/build/dex/integral/utils-e2e.js.map +0 -1
- package/build/dex/integral/utils.d.ts +0 -17
- package/build/dex/integral/utils.js +0 -94
- package/build/dex/integral/utils.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
|
@@ -0,0 +1,442 @@
|
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger } from '../../types';
|
|
2
|
+
import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger, NumberAsString, DexExchangeParam } from '../../types';
|
|
3
3
|
import { SwapSide, Network } from '../../constants';
|
|
4
4
|
import { IDex } from '../../dex/idex';
|
|
5
5
|
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
@@ -28,6 +28,7 @@ export declare class AaveV1 extends SimpleExchange implements IDex<AaveV1Data, A
|
|
|
28
28
|
getCalldataGasCost(poolPrices: PoolPrices<AaveV1Data>): number | number[];
|
|
29
29
|
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: AaveV1Data, side: SwapSide): AdapterExchangeParam;
|
|
30
30
|
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: AaveV1Data, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
31
|
+
getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: AaveV1Data, side: SwapSide): DexExchangeParam;
|
|
31
32
|
updatePoolState(): Promise<void>;
|
|
32
33
|
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
33
34
|
}
|
|
@@ -139,6 +139,28 @@ class AaveV1 extends simple_exchange_1.SimpleExchange {
|
|
|
139
139
|
const swapData = Interface.encodeFunctionData(swapFunction, swapFunctionParams);
|
|
140
140
|
return this.buildSimpleParamWithoutWETHConversion(srcToken, amount, destToken, destAmount, swapData, swapCallee, spender);
|
|
141
141
|
}
|
|
142
|
+
// DEAD
|
|
143
|
+
getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
|
|
144
|
+
const amount = side === constants_1.SwapSide.SELL ? srcAmount : destAmount;
|
|
145
|
+
const [Interface, swapFunction, swapFunctionParams, swapCallee] = (() => {
|
|
146
|
+
if (data.fromAToken) {
|
|
147
|
+
return [this.aContract, AaveV1Functions.redeem, [amount], srcToken];
|
|
148
|
+
}
|
|
149
|
+
return [
|
|
150
|
+
this.aavePool,
|
|
151
|
+
AaveV1Functions.deposit,
|
|
152
|
+
[srcToken, amount, REF_CODE],
|
|
153
|
+
AAVE_LENDING_POOL,
|
|
154
|
+
];
|
|
155
|
+
})();
|
|
156
|
+
const exchangeData = Interface.encodeFunctionData(swapFunction, swapFunctionParams);
|
|
157
|
+
return {
|
|
158
|
+
needWrapNative: this.needWrapNative,
|
|
159
|
+
dexFuncHasRecipient: false,
|
|
160
|
+
exchangeData,
|
|
161
|
+
targetExchange: swapCallee,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
142
164
|
// This is called once before getTopPoolsForToken is
|
|
143
165
|
// called for multiple tokens. This can be helpful to
|
|
144
166
|
// update common state required for calculating
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aave-v1.js","sourceRoot":"","sources":["../../../src/dex/aave-v1/aave-v1.ts"],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AC;IAED,oDAAoD;IACpD,qDAAqD;IACrD,+CAA+C;IAC/C,gDAAgD;IAChD,oBAAoB;IACpB,eAAe;QACb,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,oDAAoD;IACpD,yCAAyC;IACzC,KAAK,CAAC,mBAAmB,CACvB,YAAqB,EACrB,KAAa;QAEb,OAAO,EAAE,CAAC;IACZ,CAAC;;AA9NH,wBA+NC;AAxNe,yBAAkB,GAC9B,IAAA,6BAAqB,EAAC,qBAAY,CAAC,CAAC"}
|
|
@@ -79,7 +79,7 @@ class AngleTransmuter extends simple_exchange_1.SimpleExchange {
|
|
|
79
79
|
// Returns the list of contract adapters (name and index)
|
|
80
80
|
// for a buy/sell. Return null if there are no adapters.
|
|
81
81
|
getAdapters(side) {
|
|
82
|
-
return
|
|
82
|
+
return null;
|
|
83
83
|
}
|
|
84
84
|
// Returns list of pool identifiers that can be used
|
|
85
85
|
// for a given swap. poolIdentifiers must be unique
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angle-transmuter.js","sourceRoot":"","sources":["../../../src/dex/angle-transmuter/angle-transmuter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,+CAAoD;AACpD,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAA2D;AAC3D,mEAAmE;AACnE,4CAAsE;AACtE,6CAAoD;AACpD,sEAA4C;AAC5C,gDAAmE;AAEnE,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEjC,MAAa,eACX,SAAQ,gCAAc;IAuBtB,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB,EACpB,WAAW,iBAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAClC,SAAoB,8BAAqB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;QAEpE,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QANhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GA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6B,CAAE,EAC3C,WAAW,EACX,IAAI,CAAC,SAAS,CAAC,aAAa,CAC7B,CAAC;YACF,MAAM,CAAC,WAAW,CAAC,OAAO,CACxB,CAAC,KAAc,EAAE,EAAE,CACjB,CAAC,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,CACpE,CAAC;YACF,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,IAAI,gDAAwB,CACxD,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,MAAM,EACX,MAAM,CACP,CAAC;YACF,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;SAC3D;IACH,CAAC;IAED,yDAAyD;IACzD,wDAAwD;IACxD,WAAW,CAAC,IAAc;QACxB,OAAO,IAAI,CAAC
|
|
1
|
+
{"version":3,"file":"angle-transmuter.js","sourceRoot":"","sources":["../../../src/dex/angle-transmuter/angle-transmuter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,+CAAoD;AACpD,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAA2D;AAC3D,mEAAmE;AACnE,4CAAsE;AACtE,6CAAoD;AACpD,sEAA4C;AAC5C,gDAAmE;AAEnE,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEjC,MAAa,eACX,SAAQ,gCAAc;IAuBtB,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB,EACpB,WAAW,iBAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAClC,SAAoB,8BAAqB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;QAEpE,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QANhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAA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,WAAW,CAAC;gBAChD,gDAAgD;gBAChD,CAAC,UAAU,KAAK,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE;oBACxD,WAAW,KAAK,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,EAC7D;gBACA,OAAO;oBACL,KAAK,EAAE,IAAI;oBACX,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE;oBACnD,QAAQ,EAAE,UAAU;iBACrB,CAAC;aACH;SACF;QACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzD,CAAC;;AAzXH,0CA0XC;AA9We,8BAAc,GAAG,IAAI,iBAAS,CAAC,oBAAQ,CAAC,CAAC;AAOzC,kCAAkB,GAC9B,IAAA,6BAAqB,EAAC,8BAAqB,CAAC,CAAC"}
|
package/build/dex/idex.d.ts
CHANGED
|
@@ -6,19 +6,23 @@ export declare type Context = {
|
|
|
6
6
|
isGlobalSrcToken: boolean;
|
|
7
7
|
isGlobalDestToken: boolean;
|
|
8
8
|
};
|
|
9
|
-
export interface
|
|
10
|
-
needWrapNative: boolean;
|
|
11
|
-
needsSequentialPreprocessing?: boolean;
|
|
12
|
-
getNetworkFee?(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: ExchangeData, side: SwapSide): NumberAsString;
|
|
13
|
-
preProcessTransaction?(optimalSwapExchange: OptimalSwapExchange<ExchangeData>, srcToken: Token, destToken: Token, side: SwapSide, options: PreprocessTransactionOptions): AsyncOrSync<[OptimalSwapExchange<ExchangeData>, ExchangeTxInfo]>;
|
|
14
|
-
getTokenFromAddress?(address: Address): Token;
|
|
9
|
+
export interface IDexTxBuilderV5<ExchangeData, DirectParam = null> {
|
|
15
10
|
getAdapterParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, // required for buy case
|
|
16
11
|
data: ExchangeData, side: SwapSide): AdapterExchangeParam;
|
|
17
12
|
getSimpleParam?(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: ExchangeData, side: SwapSide): AsyncOrSync<SimpleExchangeParam>;
|
|
18
|
-
getDexParam?(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: ExchangeData, side: SwapSide, context: Context, executorAddress: Address): AsyncOrSync<DexExchangeParam>;
|
|
19
13
|
getDirectParam?(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, expectedAmount: NumberAsString, data: ExchangeData, side: SwapSide, permit: string, uuid: string, feePercent: NumberAsString, deadline: NumberAsString, partner: string, beneficiary: string, contractMethod: string): TxInfo<DirectParam>;
|
|
14
|
+
}
|
|
15
|
+
export interface IDexTxBuilderV6<ExchangeData, DirectParam = null> {
|
|
16
|
+
getDexParam?(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: ExchangeData, side: SwapSide, context: Context, executorAddress: Address): AsyncOrSync<DexExchangeParam>;
|
|
20
17
|
getDirectParamV6?(srcToken: Address, destToken: Address, fromAmount: NumberAsString, toAmount: NumberAsString, quotedAmount: NumberAsString, data: ExchangeData, side: SwapSide, permit: string, uuid: string, partnerAndFee: string, beneficiary: string, blockNumber: number, contractMethod: string): TxInfo<DirectParam>;
|
|
21
18
|
}
|
|
19
|
+
export interface IDexTxBuilder<ExchangeData, DirectParam = null> extends IDexTxBuilderV5<ExchangeData, DirectParam>, IDexTxBuilderV6<ExchangeData, DirectParam> {
|
|
20
|
+
needWrapNative: boolean;
|
|
21
|
+
needsSequentialPreprocessing?: boolean;
|
|
22
|
+
getNetworkFee?(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: ExchangeData, side: SwapSide): NumberAsString;
|
|
23
|
+
preProcessTransaction?(optimalSwapExchange: OptimalSwapExchange<ExchangeData>, srcToken: Token, destToken: Token, side: SwapSide, options: PreprocessTransactionOptions): AsyncOrSync<[OptimalSwapExchange<ExchangeData>, ExchangeTxInfo]>;
|
|
24
|
+
getTokenFromAddress?(address: Address): Token;
|
|
25
|
+
}
|
|
22
26
|
export interface IDexPricing<ExchangeData> {
|
|
23
27
|
readonly dexKey: string;
|
|
24
28
|
readonly hasConstantPriceLargeAmounts: boolean;
|