@paraswap/dex-lib 2.42.16 → 2.42.17-wombat.0
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 +39 -0
- package/.vscode/settings.json +2 -0
- package/.vscode/tasks.json +15 -0
- package/build/abi/algebra/SwapRouter.json +281 -0
- package/build/abi/wombat/asset.json +769 -0
- package/build/abi/wombat/bmw.json +1247 -0
- package/build/abi/wombat/pool.json +1364 -0
- package/build/config.js +7 -6
- package/build/config.js.map +1 -1
- package/build/dex/index.js +2 -0
- package/build/dex/index.js.map +1 -1
- package/build/dex/swaap-v2/stable-coins.d.ts +5 -0
- package/build/dex/swaap-v2/stable-coins.js +26 -0
- package/build/dex/swaap-v2/stable-coins.js.map +1 -0
- package/build/dex/wombat/config.d.ts +4 -0
- package/build/dex/wombat/config.js +77 -0
- package/build/dex/wombat/config.js.map +1 -0
- package/build/dex/wombat/types.d.ts +33 -0
- package/build/dex/wombat/types.js +3 -0
- package/build/dex/wombat/types.js.map +1 -0
- package/build/dex/wombat/utils.d.ts +9 -0
- package/build/dex/wombat/utils.js +66 -0
- package/build/dex/wombat/utils.js.map +1 -0
- package/build/dex/wombat/wombat-bmw.d.ts +40 -0
- package/build/dex/wombat/wombat-bmw.js +147 -0
- package/build/dex/wombat/wombat-bmw.js.map +1 -0
- package/build/dex/wombat/wombat-pool.d.ts +22 -0
- package/build/dex/wombat/wombat-pool.js +161 -0
- package/build/dex/wombat/wombat-pool.js.map +1 -0
- package/build/dex/wombat/wombat-quoter.d.ts +16 -0
- package/build/dex/wombat/wombat-quoter.js +176 -0
- package/build/dex/wombat/wombat-quoter.js.map +1 -0
- package/build/dex/wombat/wombat.d.ts +55 -0
- package/build/dex/wombat/wombat.js +290 -0
- package/build/dex/wombat/wombat.js.map +1 -0
- package/build/rebase-tokens.json +17 -0
- package/package.json +1 -1
- package/src/abi/wombat/asset.json +769 -0
- package/src/abi/wombat/bmw.json +1247 -0
- package/src/abi/wombat/pool.json +1364 -0
- package/src/config.ts +7 -7
- package/src/dex/index.ts +2 -0
- package/src/dex/wombat/config.ts +77 -0
- package/src/dex/wombat/types.ts +55 -0
- package/src/dex/wombat/utils.ts +62 -0
- package/src/dex/wombat/wombat-bmw.ts +209 -0
- package/src/dex/wombat/wombat-e2e.test.ts +264 -0
- package/src/dex/wombat/wombat-integration.test.ts +258 -0
- package/src/dex/wombat/wombat-pool.ts +231 -0
- package/src/dex/wombat/wombat-quoter.ts +269 -0
- package/src/dex/wombat/wombat.ts +426 -0
- package/tests/constants-e2e.ts +20 -4
- package/tests/utils-e2e.ts +2 -1
- package/build/abi/algebra/AlgebraPool.abi.json +0 -727
- package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +0 -193
- package/build/dex/algebra/algebra-pool.d.ts +0 -46
- package/build/dex/algebra/algebra-pool.js +0 -336
- package/build/dex/algebra/algebra-pool.js.map +0 -1
- package/build/dex/quickswap/camelot-v3.d.ts +0 -6
- package/build/dex/quickswap/camelot-v3.js +0 -19
- package/build/dex/quickswap/camelot-v3.js.map +0 -1
- package/build/dex/quickswap/zyberswap-v3.d.ts +0 -6
- package/build/dex/quickswap/zyberswap-v3.js +0 -19
- package/build/dex/quickswap/zyberswap-v3.js.map +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"type": "node",
|
|
6
|
+
"request": "launch",
|
|
7
|
+
"name": "Current",
|
|
8
|
+
"program": "${file}",
|
|
9
|
+
"preLaunchTask": "npm: build",
|
|
10
|
+
"sourceMaps": true,
|
|
11
|
+
"smartStep": true,
|
|
12
|
+
"internalConsoleOptions": "openOnSessionStart",
|
|
13
|
+
"outFiles": ["${workspaceFolder}/build/**/*.js"]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"type": "node",
|
|
17
|
+
"request": "launch",
|
|
18
|
+
"name": "Debug Jest Tests",
|
|
19
|
+
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
|
|
20
|
+
"args": [
|
|
21
|
+
"--project",
|
|
22
|
+
"tsconfig.json",
|
|
23
|
+
// "${workspaceFolder}/src/dex/algebra/scripts/validate-state.ts",
|
|
24
|
+
"${workspaceFolder}/scripts/dex-integration.ts",
|
|
25
|
+
"test",
|
|
26
|
+
"algebra"
|
|
27
|
+
],
|
|
28
|
+
"console": "integratedTerminal",
|
|
29
|
+
"internalConsoleOptions": "neverOpen",
|
|
30
|
+
// "disableOptimisticBPs": true,
|
|
31
|
+
"runtimeArgs": ["--nolazy"],
|
|
32
|
+
"sourceMaps": true,
|
|
33
|
+
"smartStep": true,
|
|
34
|
+
"skipFiles": ["<node_internals>/**"],
|
|
35
|
+
"cwd": "${workspaceFolder}",
|
|
36
|
+
// "protocol": "inspector"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{ "internalType": "address", "name": "_factory", "type": "address" },
|
|
5
|
+
{ "internalType": "address", "name": "_WNativeToken", "type": "address" },
|
|
6
|
+
{ "internalType": "address", "name": "_poolDeployer", "type": "address" }
|
|
7
|
+
],
|
|
8
|
+
"stateMutability": "nonpayable",
|
|
9
|
+
"type": "constructor"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"inputs": [],
|
|
13
|
+
"name": "WNativeToken",
|
|
14
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
15
|
+
"stateMutability": "view",
|
|
16
|
+
"type": "function"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"inputs": [
|
|
20
|
+
{ "internalType": "int256", "name": "amount0Delta", "type": "int256" },
|
|
21
|
+
{ "internalType": "int256", "name": "amount1Delta", "type": "int256" },
|
|
22
|
+
{ "internalType": "bytes", "name": "_data", "type": "bytes" }
|
|
23
|
+
],
|
|
24
|
+
"name": "algebraSwapCallback",
|
|
25
|
+
"outputs": [],
|
|
26
|
+
"stateMutability": "nonpayable",
|
|
27
|
+
"type": "function"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"inputs": [
|
|
31
|
+
{
|
|
32
|
+
"components": [
|
|
33
|
+
{ "internalType": "bytes", "name": "path", "type": "bytes" },
|
|
34
|
+
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
35
|
+
{ "internalType": "uint256", "name": "deadline", "type": "uint256" },
|
|
36
|
+
{ "internalType": "uint256", "name": "amountIn", "type": "uint256" },
|
|
37
|
+
{
|
|
38
|
+
"internalType": "uint256",
|
|
39
|
+
"name": "amountOutMinimum",
|
|
40
|
+
"type": "uint256"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"internalType": "struct ISwapRouter.ExactInputParams",
|
|
44
|
+
"name": "params",
|
|
45
|
+
"type": "tuple"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"name": "exactInput",
|
|
49
|
+
"outputs": [
|
|
50
|
+
{ "internalType": "uint256", "name": "amountOut", "type": "uint256" }
|
|
51
|
+
],
|
|
52
|
+
"stateMutability": "payable",
|
|
53
|
+
"type": "function"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"inputs": [
|
|
57
|
+
{
|
|
58
|
+
"components": [
|
|
59
|
+
{ "internalType": "address", "name": "tokenIn", "type": "address" },
|
|
60
|
+
{ "internalType": "address", "name": "tokenOut", "type": "address" },
|
|
61
|
+
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
62
|
+
{ "internalType": "uint256", "name": "deadline", "type": "uint256" },
|
|
63
|
+
{ "internalType": "uint256", "name": "amountIn", "type": "uint256" },
|
|
64
|
+
{
|
|
65
|
+
"internalType": "uint256",
|
|
66
|
+
"name": "amountOutMinimum",
|
|
67
|
+
"type": "uint256"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"internalType": "uint160",
|
|
71
|
+
"name": "limitSqrtPrice",
|
|
72
|
+
"type": "uint160"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"internalType": "struct ISwapRouter.ExactInputSingleParams",
|
|
76
|
+
"name": "params",
|
|
77
|
+
"type": "tuple"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"name": "exactInputSingleSupportingFeeOnTransferTokens",
|
|
81
|
+
"outputs": [
|
|
82
|
+
{ "internalType": "uint256", "name": "amountOut", "type": "uint256" }
|
|
83
|
+
],
|
|
84
|
+
"stateMutability": "nonpayable",
|
|
85
|
+
"type": "function"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"inputs": [
|
|
89
|
+
{
|
|
90
|
+
"components": [
|
|
91
|
+
{ "internalType": "bytes", "name": "path", "type": "bytes" },
|
|
92
|
+
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
93
|
+
{ "internalType": "uint256", "name": "deadline", "type": "uint256" },
|
|
94
|
+
{ "internalType": "uint256", "name": "amountOut", "type": "uint256" },
|
|
95
|
+
{
|
|
96
|
+
"internalType": "uint256",
|
|
97
|
+
"name": "amountInMaximum",
|
|
98
|
+
"type": "uint256"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"internalType": "struct ISwapRouter.ExactOutputParams",
|
|
102
|
+
"name": "params",
|
|
103
|
+
"type": "tuple"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"name": "exactOutput",
|
|
107
|
+
"outputs": [
|
|
108
|
+
{ "internalType": "uint256", "name": "amountIn", "type": "uint256" }
|
|
109
|
+
],
|
|
110
|
+
"stateMutability": "payable",
|
|
111
|
+
"type": "function"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"inputs": [
|
|
115
|
+
{
|
|
116
|
+
"components": [
|
|
117
|
+
{ "internalType": "address", "name": "tokenIn", "type": "address" },
|
|
118
|
+
{ "internalType": "address", "name": "tokenOut", "type": "address" },
|
|
119
|
+
{ "internalType": "uint24", "name": "fee", "type": "uint24" },
|
|
120
|
+
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
121
|
+
{ "internalType": "uint256", "name": "deadline", "type": "uint256" },
|
|
122
|
+
{ "internalType": "uint256", "name": "amountOut", "type": "uint256" },
|
|
123
|
+
{
|
|
124
|
+
"internalType": "uint256",
|
|
125
|
+
"name": "amountInMaximum",
|
|
126
|
+
"type": "uint256"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"internalType": "uint160",
|
|
130
|
+
"name": "limitSqrtPrice",
|
|
131
|
+
"type": "uint160"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"internalType": "struct ISwapRouter.ExactOutputSingleParams",
|
|
135
|
+
"name": "params",
|
|
136
|
+
"type": "tuple"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"name": "exactOutputSingle",
|
|
140
|
+
"outputs": [
|
|
141
|
+
{ "internalType": "uint256", "name": "amountIn", "type": "uint256" }
|
|
142
|
+
],
|
|
143
|
+
"stateMutability": "payable",
|
|
144
|
+
"type": "function"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"inputs": [],
|
|
148
|
+
"name": "factory",
|
|
149
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
150
|
+
"stateMutability": "view",
|
|
151
|
+
"type": "function"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"inputs": [
|
|
155
|
+
{ "internalType": "bytes[]", "name": "data", "type": "bytes[]" }
|
|
156
|
+
],
|
|
157
|
+
"name": "multicall",
|
|
158
|
+
"outputs": [
|
|
159
|
+
{ "internalType": "bytes[]", "name": "results", "type": "bytes[]" }
|
|
160
|
+
],
|
|
161
|
+
"stateMutability": "payable",
|
|
162
|
+
"type": "function"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"inputs": [],
|
|
166
|
+
"name": "poolDeployer",
|
|
167
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
168
|
+
"stateMutability": "view",
|
|
169
|
+
"type": "function"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"inputs": [],
|
|
173
|
+
"name": "refundNativeToken",
|
|
174
|
+
"outputs": [],
|
|
175
|
+
"stateMutability": "payable",
|
|
176
|
+
"type": "function"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"inputs": [
|
|
180
|
+
{ "internalType": "address", "name": "token", "type": "address" },
|
|
181
|
+
{ "internalType": "uint256", "name": "value", "type": "uint256" },
|
|
182
|
+
{ "internalType": "uint256", "name": "deadline", "type": "uint256" },
|
|
183
|
+
{ "internalType": "uint8", "name": "v", "type": "uint8" },
|
|
184
|
+
{ "internalType": "bytes32", "name": "r", "type": "bytes32" },
|
|
185
|
+
{ "internalType": "bytes32", "name": "s", "type": "bytes32" }
|
|
186
|
+
],
|
|
187
|
+
"name": "selfPermit",
|
|
188
|
+
"outputs": [],
|
|
189
|
+
"stateMutability": "payable",
|
|
190
|
+
"type": "function"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"inputs": [
|
|
194
|
+
{ "internalType": "address", "name": "token", "type": "address" },
|
|
195
|
+
{ "internalType": "uint256", "name": "nonce", "type": "uint256" },
|
|
196
|
+
{ "internalType": "uint256", "name": "expiry", "type": "uint256" },
|
|
197
|
+
{ "internalType": "uint8", "name": "v", "type": "uint8" },
|
|
198
|
+
{ "internalType": "bytes32", "name": "r", "type": "bytes32" },
|
|
199
|
+
{ "internalType": "bytes32", "name": "s", "type": "bytes32" }
|
|
200
|
+
],
|
|
201
|
+
"name": "selfPermitAllowed",
|
|
202
|
+
"outputs": [],
|
|
203
|
+
"stateMutability": "payable",
|
|
204
|
+
"type": "function"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"inputs": [
|
|
208
|
+
{ "internalType": "address", "name": "token", "type": "address" },
|
|
209
|
+
{ "internalType": "uint256", "name": "nonce", "type": "uint256" },
|
|
210
|
+
{ "internalType": "uint256", "name": "expiry", "type": "uint256" },
|
|
211
|
+
{ "internalType": "uint8", "name": "v", "type": "uint8" },
|
|
212
|
+
{ "internalType": "bytes32", "name": "r", "type": "bytes32" },
|
|
213
|
+
{ "internalType": "bytes32", "name": "s", "type": "bytes32" }
|
|
214
|
+
],
|
|
215
|
+
"name": "selfPermitAllowedIfNecessary",
|
|
216
|
+
"outputs": [],
|
|
217
|
+
"stateMutability": "payable",
|
|
218
|
+
"type": "function"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"inputs": [
|
|
222
|
+
{ "internalType": "address", "name": "token", "type": "address" },
|
|
223
|
+
{ "internalType": "uint256", "name": "value", "type": "uint256" },
|
|
224
|
+
{ "internalType": "uint256", "name": "deadline", "type": "uint256" },
|
|
225
|
+
{ "internalType": "uint8", "name": "v", "type": "uint8" },
|
|
226
|
+
{ "internalType": "bytes32", "name": "r", "type": "bytes32" },
|
|
227
|
+
{ "internalType": "bytes32", "name": "s", "type": "bytes32" }
|
|
228
|
+
],
|
|
229
|
+
"name": "selfPermitIfNecessary",
|
|
230
|
+
"outputs": [],
|
|
231
|
+
"stateMutability": "payable",
|
|
232
|
+
"type": "function"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"inputs": [
|
|
236
|
+
{ "internalType": "address", "name": "token", "type": "address" },
|
|
237
|
+
{ "internalType": "uint256", "name": "amountMinimum", "type": "uint256" },
|
|
238
|
+
{ "internalType": "address", "name": "recipient", "type": "address" }
|
|
239
|
+
],
|
|
240
|
+
"name": "sweepToken",
|
|
241
|
+
"outputs": [],
|
|
242
|
+
"stateMutability": "payable",
|
|
243
|
+
"type": "function"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"inputs": [
|
|
247
|
+
{ "internalType": "address", "name": "token", "type": "address" },
|
|
248
|
+
{ "internalType": "uint256", "name": "amountMinimum", "type": "uint256" },
|
|
249
|
+
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
250
|
+
{ "internalType": "uint256", "name": "feeBips", "type": "uint256" },
|
|
251
|
+
{ "internalType": "address", "name": "feeRecipient", "type": "address" }
|
|
252
|
+
],
|
|
253
|
+
"name": "sweepTokenWithFee",
|
|
254
|
+
"outputs": [],
|
|
255
|
+
"stateMutability": "payable",
|
|
256
|
+
"type": "function"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"inputs": [
|
|
260
|
+
{ "internalType": "uint256", "name": "amountMinimum", "type": "uint256" },
|
|
261
|
+
{ "internalType": "address", "name": "recipient", "type": "address" }
|
|
262
|
+
],
|
|
263
|
+
"name": "unwrapWNativeToken",
|
|
264
|
+
"outputs": [],
|
|
265
|
+
"stateMutability": "payable",
|
|
266
|
+
"type": "function"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"inputs": [
|
|
270
|
+
{ "internalType": "uint256", "name": "amountMinimum", "type": "uint256" },
|
|
271
|
+
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
272
|
+
{ "internalType": "uint256", "name": "feeBips", "type": "uint256" },
|
|
273
|
+
{ "internalType": "address", "name": "feeRecipient", "type": "address" }
|
|
274
|
+
],
|
|
275
|
+
"name": "unwrapWNativeTokenWithFee",
|
|
276
|
+
"outputs": [],
|
|
277
|
+
"stateMutability": "payable",
|
|
278
|
+
"type": "function"
|
|
279
|
+
},
|
|
280
|
+
{ "stateMutability": "payable", "type": "receive" }
|
|
281
|
+
]
|