@rabby-wallet/rabby-swap 0.0.39 → 0.0.41
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/dist/abi.d.ts +41 -0
- package/dist/abi.js +480 -0
- package/dist/consts.d.ts +3 -1
- package/dist/consts.js +2 -0
- package/dist/dexs/odos.d.ts +5 -0
- package/dist/dexs/odos.js +26 -0
- package/dist/dexs/paraswap_v6.d.ts +5 -0
- package/dist/dexs/paraswap_v6.js +107 -0
- package/dist/dexs/wrapToken.js +3 -0
- package/dist/list.d.ts +58 -0
- package/dist/list.js +60 -1
- package/dist/quote.js +10 -0
- package/dist/utils.d.ts +1 -1
- package/package.json +5 -5
package/dist/abi.d.ts
CHANGED
|
@@ -262,3 +262,44 @@ export declare const KyberswapABI: ({
|
|
|
262
262
|
name?: undefined;
|
|
263
263
|
outputs?: undefined;
|
|
264
264
|
})[];
|
|
265
|
+
export declare const ParaSwapV6ABI: ({
|
|
266
|
+
inputs: ({
|
|
267
|
+
components: ({
|
|
268
|
+
components: {
|
|
269
|
+
internalType: string;
|
|
270
|
+
name: string;
|
|
271
|
+
type: string;
|
|
272
|
+
}[];
|
|
273
|
+
internalType: string;
|
|
274
|
+
name: string;
|
|
275
|
+
type: string;
|
|
276
|
+
} | {
|
|
277
|
+
internalType: string;
|
|
278
|
+
name: string;
|
|
279
|
+
type: string;
|
|
280
|
+
components?: undefined;
|
|
281
|
+
})[];
|
|
282
|
+
internalType: string;
|
|
283
|
+
name: string;
|
|
284
|
+
type: string;
|
|
285
|
+
} | {
|
|
286
|
+
internalType: string;
|
|
287
|
+
name: string;
|
|
288
|
+
type: string;
|
|
289
|
+
components?: undefined;
|
|
290
|
+
})[];
|
|
291
|
+
name: string;
|
|
292
|
+
outputs: {
|
|
293
|
+
internalType: string;
|
|
294
|
+
name: string;
|
|
295
|
+
type: string;
|
|
296
|
+
}[];
|
|
297
|
+
stateMutability: string;
|
|
298
|
+
type: string;
|
|
299
|
+
} | {
|
|
300
|
+
stateMutability: string;
|
|
301
|
+
type: string;
|
|
302
|
+
inputs?: undefined;
|
|
303
|
+
name?: undefined;
|
|
304
|
+
outputs?: undefined;
|
|
305
|
+
})[];
|
package/dist/abi.js
CHANGED
|
@@ -1251,3 +1251,483 @@ export const KyberswapABI = [
|
|
|
1251
1251
|
},
|
|
1252
1252
|
{ stateMutability: "payable", type: "receive" },
|
|
1253
1253
|
];
|
|
1254
|
+
export const ParaSwapV6ABI = [
|
|
1255
|
+
{
|
|
1256
|
+
inputs: [
|
|
1257
|
+
{ internalType: "address", name: "executor", type: "address" },
|
|
1258
|
+
{
|
|
1259
|
+
components: [
|
|
1260
|
+
{
|
|
1261
|
+
internalType: "contract IERC20",
|
|
1262
|
+
name: "srcToken",
|
|
1263
|
+
type: "address",
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
internalType: "contract IERC20",
|
|
1267
|
+
name: "destToken",
|
|
1268
|
+
type: "address",
|
|
1269
|
+
},
|
|
1270
|
+
{ internalType: "uint256", name: "fromAmount", type: "uint256" },
|
|
1271
|
+
{ internalType: "uint256", name: "toAmount", type: "uint256" },
|
|
1272
|
+
{ internalType: "uint256", name: "quotedAmount", type: "uint256" },
|
|
1273
|
+
{ internalType: "bytes32", name: "metadata", type: "bytes32" },
|
|
1274
|
+
{
|
|
1275
|
+
internalType: "address payable",
|
|
1276
|
+
name: "beneficiary",
|
|
1277
|
+
type: "address",
|
|
1278
|
+
},
|
|
1279
|
+
],
|
|
1280
|
+
internalType: "struct GenericData",
|
|
1281
|
+
name: "swapData",
|
|
1282
|
+
type: "tuple",
|
|
1283
|
+
},
|
|
1284
|
+
{ internalType: "uint256", name: "partnerAndFee", type: "uint256" },
|
|
1285
|
+
{ internalType: "bytes", name: "permit", type: "bytes" },
|
|
1286
|
+
{ internalType: "bytes", name: "executorData", type: "bytes" },
|
|
1287
|
+
],
|
|
1288
|
+
name: "swapExactAmountIn",
|
|
1289
|
+
outputs: [
|
|
1290
|
+
{ internalType: "uint256", name: "receivedAmount", type: "uint256" },
|
|
1291
|
+
{ internalType: "uint256", name: "paraswapShare", type: "uint256" },
|
|
1292
|
+
{ internalType: "uint256", name: "partnerShare", type: "uint256" },
|
|
1293
|
+
],
|
|
1294
|
+
stateMutability: "payable",
|
|
1295
|
+
type: "function",
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
inputs: [
|
|
1299
|
+
{
|
|
1300
|
+
components: [
|
|
1301
|
+
{ internalType: "uint256", name: "fromAmount", type: "uint256" },
|
|
1302
|
+
{ internalType: "uint256", name: "toAmount", type: "uint256" },
|
|
1303
|
+
{ internalType: "uint256", name: "quotedAmount", type: "uint256" },
|
|
1304
|
+
{ internalType: "bytes32", name: "metadata", type: "bytes32" },
|
|
1305
|
+
{
|
|
1306
|
+
internalType: "uint256",
|
|
1307
|
+
name: "beneficiaryAndApproveFlag",
|
|
1308
|
+
type: "uint256",
|
|
1309
|
+
},
|
|
1310
|
+
],
|
|
1311
|
+
internalType: "struct BalancerV2Data",
|
|
1312
|
+
name: "balancerData",
|
|
1313
|
+
type: "tuple",
|
|
1314
|
+
},
|
|
1315
|
+
{ internalType: "uint256", name: "partnerAndFee", type: "uint256" },
|
|
1316
|
+
{ internalType: "bytes", name: "permit", type: "bytes" },
|
|
1317
|
+
{ internalType: "bytes", name: "data", type: "bytes" },
|
|
1318
|
+
],
|
|
1319
|
+
name: "swapExactAmountInOnBalancerV2",
|
|
1320
|
+
outputs: [
|
|
1321
|
+
{ internalType: "uint256", name: "receivedAmount", type: "uint256" },
|
|
1322
|
+
{ internalType: "uint256", name: "paraswapShare", type: "uint256" },
|
|
1323
|
+
{ internalType: "uint256", name: "partnerShare", type: "uint256" },
|
|
1324
|
+
],
|
|
1325
|
+
stateMutability: "payable",
|
|
1326
|
+
type: "function",
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
inputs: [
|
|
1330
|
+
{
|
|
1331
|
+
components: [
|
|
1332
|
+
{ internalType: "uint256", name: "curveData", type: "uint256" },
|
|
1333
|
+
{ internalType: "uint256", name: "curveAssets", type: "uint256" },
|
|
1334
|
+
{
|
|
1335
|
+
internalType: "contract IERC20",
|
|
1336
|
+
name: "srcToken",
|
|
1337
|
+
type: "address",
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
internalType: "contract IERC20",
|
|
1341
|
+
name: "destToken",
|
|
1342
|
+
type: "address",
|
|
1343
|
+
},
|
|
1344
|
+
{ internalType: "uint256", name: "fromAmount", type: "uint256" },
|
|
1345
|
+
{ internalType: "uint256", name: "toAmount", type: "uint256" },
|
|
1346
|
+
{ internalType: "uint256", name: "quotedAmount", type: "uint256" },
|
|
1347
|
+
{ internalType: "bytes32", name: "metadata", type: "bytes32" },
|
|
1348
|
+
{
|
|
1349
|
+
internalType: "address payable",
|
|
1350
|
+
name: "beneficiary",
|
|
1351
|
+
type: "address",
|
|
1352
|
+
},
|
|
1353
|
+
],
|
|
1354
|
+
internalType: "struct CurveV1Data",
|
|
1355
|
+
name: "curveV1Data",
|
|
1356
|
+
type: "tuple",
|
|
1357
|
+
},
|
|
1358
|
+
{ internalType: "uint256", name: "partnerAndFee", type: "uint256" },
|
|
1359
|
+
{ internalType: "bytes", name: "permit", type: "bytes" },
|
|
1360
|
+
],
|
|
1361
|
+
name: "swapExactAmountInOnCurveV1",
|
|
1362
|
+
outputs: [
|
|
1363
|
+
{ internalType: "uint256", name: "receivedAmount", type: "uint256" },
|
|
1364
|
+
{ internalType: "uint256", name: "paraswapShare", type: "uint256" },
|
|
1365
|
+
{ internalType: "uint256", name: "partnerShare", type: "uint256" },
|
|
1366
|
+
],
|
|
1367
|
+
stateMutability: "payable",
|
|
1368
|
+
type: "function",
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
inputs: [
|
|
1372
|
+
{
|
|
1373
|
+
components: [
|
|
1374
|
+
{ internalType: "uint256", name: "curveData", type: "uint256" },
|
|
1375
|
+
{ internalType: "uint256", name: "i", type: "uint256" },
|
|
1376
|
+
{ internalType: "uint256", name: "j", type: "uint256" },
|
|
1377
|
+
{ internalType: "address", name: "poolAddress", type: "address" },
|
|
1378
|
+
{
|
|
1379
|
+
internalType: "contract IERC20",
|
|
1380
|
+
name: "srcToken",
|
|
1381
|
+
type: "address",
|
|
1382
|
+
},
|
|
1383
|
+
{
|
|
1384
|
+
internalType: "contract IERC20",
|
|
1385
|
+
name: "destToken",
|
|
1386
|
+
type: "address",
|
|
1387
|
+
},
|
|
1388
|
+
{ internalType: "uint256", name: "fromAmount", type: "uint256" },
|
|
1389
|
+
{ internalType: "uint256", name: "toAmount", type: "uint256" },
|
|
1390
|
+
{ internalType: "uint256", name: "quotedAmount", type: "uint256" },
|
|
1391
|
+
{ internalType: "bytes32", name: "metadata", type: "bytes32" },
|
|
1392
|
+
{
|
|
1393
|
+
internalType: "address payable",
|
|
1394
|
+
name: "beneficiary",
|
|
1395
|
+
type: "address",
|
|
1396
|
+
},
|
|
1397
|
+
],
|
|
1398
|
+
internalType: "struct CurveV2Data",
|
|
1399
|
+
name: "curveV2Data",
|
|
1400
|
+
type: "tuple",
|
|
1401
|
+
},
|
|
1402
|
+
{ internalType: "uint256", name: "partnerAndFee", type: "uint256" },
|
|
1403
|
+
{ internalType: "bytes", name: "permit", type: "bytes" },
|
|
1404
|
+
],
|
|
1405
|
+
name: "swapExactAmountInOnCurveV2",
|
|
1406
|
+
outputs: [
|
|
1407
|
+
{ internalType: "uint256", name: "receivedAmount", type: "uint256" },
|
|
1408
|
+
{ internalType: "uint256", name: "paraswapShare", type: "uint256" },
|
|
1409
|
+
{ internalType: "uint256", name: "partnerShare", type: "uint256" },
|
|
1410
|
+
],
|
|
1411
|
+
stateMutability: "payable",
|
|
1412
|
+
type: "function",
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
inputs: [
|
|
1416
|
+
{
|
|
1417
|
+
components: [
|
|
1418
|
+
{
|
|
1419
|
+
internalType: "contract IERC20",
|
|
1420
|
+
name: "srcToken",
|
|
1421
|
+
type: "address",
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
internalType: "contract IERC20",
|
|
1425
|
+
name: "destToken",
|
|
1426
|
+
type: "address",
|
|
1427
|
+
},
|
|
1428
|
+
{ internalType: "uint256", name: "fromAmount", type: "uint256" },
|
|
1429
|
+
{ internalType: "uint256", name: "toAmount", type: "uint256" },
|
|
1430
|
+
{ internalType: "uint256", name: "quotedAmount", type: "uint256" },
|
|
1431
|
+
{ internalType: "bytes32", name: "metadata", type: "bytes32" },
|
|
1432
|
+
{
|
|
1433
|
+
internalType: "address payable",
|
|
1434
|
+
name: "beneficiary",
|
|
1435
|
+
type: "address",
|
|
1436
|
+
},
|
|
1437
|
+
{ internalType: "bytes", name: "pools", type: "bytes" },
|
|
1438
|
+
],
|
|
1439
|
+
internalType: "struct UniswapV2Data",
|
|
1440
|
+
name: "uniData",
|
|
1441
|
+
type: "tuple",
|
|
1442
|
+
},
|
|
1443
|
+
{ internalType: "uint256", name: "partnerAndFee", type: "uint256" },
|
|
1444
|
+
{ internalType: "bytes", name: "permit", type: "bytes" },
|
|
1445
|
+
],
|
|
1446
|
+
name: "swapExactAmountInOnUniswapV2",
|
|
1447
|
+
outputs: [
|
|
1448
|
+
{ internalType: "uint256", name: "receivedAmount", type: "uint256" },
|
|
1449
|
+
{ internalType: "uint256", name: "paraswapShare", type: "uint256" },
|
|
1450
|
+
{ internalType: "uint256", name: "partnerShare", type: "uint256" },
|
|
1451
|
+
],
|
|
1452
|
+
stateMutability: "payable",
|
|
1453
|
+
type: "function",
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
inputs: [
|
|
1457
|
+
{
|
|
1458
|
+
components: [
|
|
1459
|
+
{
|
|
1460
|
+
internalType: "contract IERC20",
|
|
1461
|
+
name: "srcToken",
|
|
1462
|
+
type: "address",
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
internalType: "contract IERC20",
|
|
1466
|
+
name: "destToken",
|
|
1467
|
+
type: "address",
|
|
1468
|
+
},
|
|
1469
|
+
{ internalType: "uint256", name: "fromAmount", type: "uint256" },
|
|
1470
|
+
{ internalType: "uint256", name: "toAmount", type: "uint256" },
|
|
1471
|
+
{ internalType: "uint256", name: "quotedAmount", type: "uint256" },
|
|
1472
|
+
{ internalType: "bytes32", name: "metadata", type: "bytes32" },
|
|
1473
|
+
{
|
|
1474
|
+
internalType: "address payable",
|
|
1475
|
+
name: "beneficiary",
|
|
1476
|
+
type: "address",
|
|
1477
|
+
},
|
|
1478
|
+
{ internalType: "bytes", name: "pools", type: "bytes" },
|
|
1479
|
+
],
|
|
1480
|
+
internalType: "struct UniswapV3Data",
|
|
1481
|
+
name: "uniData",
|
|
1482
|
+
type: "tuple",
|
|
1483
|
+
},
|
|
1484
|
+
{ internalType: "uint256", name: "partnerAndFee", type: "uint256" },
|
|
1485
|
+
{ internalType: "bytes", name: "permit", type: "bytes" },
|
|
1486
|
+
],
|
|
1487
|
+
name: "swapExactAmountInOnUniswapV3",
|
|
1488
|
+
outputs: [
|
|
1489
|
+
{ internalType: "uint256", name: "receivedAmount", type: "uint256" },
|
|
1490
|
+
{ internalType: "uint256", name: "paraswapShare", type: "uint256" },
|
|
1491
|
+
{ internalType: "uint256", name: "partnerShare", type: "uint256" },
|
|
1492
|
+
],
|
|
1493
|
+
stateMutability: "payable",
|
|
1494
|
+
type: "function",
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
inputs: [
|
|
1498
|
+
{ internalType: "address", name: "executor", type: "address" },
|
|
1499
|
+
{
|
|
1500
|
+
components: [
|
|
1501
|
+
{
|
|
1502
|
+
internalType: "contract IERC20",
|
|
1503
|
+
name: "srcToken",
|
|
1504
|
+
type: "address",
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
internalType: "contract IERC20",
|
|
1508
|
+
name: "destToken",
|
|
1509
|
+
type: "address",
|
|
1510
|
+
},
|
|
1511
|
+
{ internalType: "uint256", name: "fromAmount", type: "uint256" },
|
|
1512
|
+
{ internalType: "uint256", name: "toAmount", type: "uint256" },
|
|
1513
|
+
{ internalType: "uint256", name: "quotedAmount", type: "uint256" },
|
|
1514
|
+
{ internalType: "bytes32", name: "metadata", type: "bytes32" },
|
|
1515
|
+
{
|
|
1516
|
+
internalType: "address payable",
|
|
1517
|
+
name: "beneficiary",
|
|
1518
|
+
type: "address",
|
|
1519
|
+
},
|
|
1520
|
+
],
|
|
1521
|
+
internalType: "struct GenericData",
|
|
1522
|
+
name: "swapData",
|
|
1523
|
+
type: "tuple",
|
|
1524
|
+
},
|
|
1525
|
+
{ internalType: "uint256", name: "partnerAndFee", type: "uint256" },
|
|
1526
|
+
{ internalType: "bytes", name: "permit", type: "bytes" },
|
|
1527
|
+
{ internalType: "bytes", name: "executorData", type: "bytes" },
|
|
1528
|
+
],
|
|
1529
|
+
name: "swapExactAmountOut",
|
|
1530
|
+
outputs: [
|
|
1531
|
+
{ internalType: "uint256", name: "spentAmount", type: "uint256" },
|
|
1532
|
+
{ internalType: "uint256", name: "receivedAmount", type: "uint256" },
|
|
1533
|
+
{ internalType: "uint256", name: "paraswapShare", type: "uint256" },
|
|
1534
|
+
{ internalType: "uint256", name: "partnerShare", type: "uint256" },
|
|
1535
|
+
],
|
|
1536
|
+
stateMutability: "payable",
|
|
1537
|
+
type: "function",
|
|
1538
|
+
},
|
|
1539
|
+
{
|
|
1540
|
+
inputs: [
|
|
1541
|
+
{
|
|
1542
|
+
components: [
|
|
1543
|
+
{ internalType: "uint256", name: "fromAmount", type: "uint256" },
|
|
1544
|
+
{ internalType: "uint256", name: "toAmount", type: "uint256" },
|
|
1545
|
+
{ internalType: "uint256", name: "quotedAmount", type: "uint256" },
|
|
1546
|
+
{ internalType: "bytes32", name: "metadata", type: "bytes32" },
|
|
1547
|
+
{
|
|
1548
|
+
internalType: "uint256",
|
|
1549
|
+
name: "beneficiaryAndApproveFlag",
|
|
1550
|
+
type: "uint256",
|
|
1551
|
+
},
|
|
1552
|
+
],
|
|
1553
|
+
internalType: "struct BalancerV2Data",
|
|
1554
|
+
name: "balancerData",
|
|
1555
|
+
type: "tuple",
|
|
1556
|
+
},
|
|
1557
|
+
{ internalType: "uint256", name: "partnerAndFee", type: "uint256" },
|
|
1558
|
+
{ internalType: "bytes", name: "permit", type: "bytes" },
|
|
1559
|
+
{ internalType: "bytes", name: "data", type: "bytes" },
|
|
1560
|
+
],
|
|
1561
|
+
name: "swapExactAmountOutOnBalancerV2",
|
|
1562
|
+
outputs: [
|
|
1563
|
+
{ internalType: "uint256", name: "spentAmount", type: "uint256" },
|
|
1564
|
+
{ internalType: "uint256", name: "receivedAmount", type: "uint256" },
|
|
1565
|
+
{ internalType: "uint256", name: "paraswapShare", type: "uint256" },
|
|
1566
|
+
{ internalType: "uint256", name: "partnerShare", type: "uint256" },
|
|
1567
|
+
],
|
|
1568
|
+
stateMutability: "payable",
|
|
1569
|
+
type: "function",
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
inputs: [
|
|
1573
|
+
{
|
|
1574
|
+
components: [
|
|
1575
|
+
{
|
|
1576
|
+
internalType: "contract IERC20",
|
|
1577
|
+
name: "srcToken",
|
|
1578
|
+
type: "address",
|
|
1579
|
+
},
|
|
1580
|
+
{
|
|
1581
|
+
internalType: "contract IERC20",
|
|
1582
|
+
name: "destToken",
|
|
1583
|
+
type: "address",
|
|
1584
|
+
},
|
|
1585
|
+
{ internalType: "uint256", name: "fromAmount", type: "uint256" },
|
|
1586
|
+
{ internalType: "uint256", name: "toAmount", type: "uint256" },
|
|
1587
|
+
{ internalType: "uint256", name: "quotedAmount", type: "uint256" },
|
|
1588
|
+
{ internalType: "bytes32", name: "metadata", type: "bytes32" },
|
|
1589
|
+
{
|
|
1590
|
+
internalType: "address payable",
|
|
1591
|
+
name: "beneficiary",
|
|
1592
|
+
type: "address",
|
|
1593
|
+
},
|
|
1594
|
+
{ internalType: "bytes", name: "pools", type: "bytes" },
|
|
1595
|
+
],
|
|
1596
|
+
internalType: "struct UniswapV2Data",
|
|
1597
|
+
name: "uniData",
|
|
1598
|
+
type: "tuple",
|
|
1599
|
+
},
|
|
1600
|
+
{ internalType: "uint256", name: "partnerAndFee", type: "uint256" },
|
|
1601
|
+
{ internalType: "bytes", name: "permit", type: "bytes" },
|
|
1602
|
+
],
|
|
1603
|
+
name: "swapExactAmountOutOnUniswapV2",
|
|
1604
|
+
outputs: [
|
|
1605
|
+
{ internalType: "uint256", name: "spentAmount", type: "uint256" },
|
|
1606
|
+
{ internalType: "uint256", name: "receivedAmount", type: "uint256" },
|
|
1607
|
+
{ internalType: "uint256", name: "paraswapShare", type: "uint256" },
|
|
1608
|
+
{ internalType: "uint256", name: "partnerShare", type: "uint256" },
|
|
1609
|
+
],
|
|
1610
|
+
stateMutability: "payable",
|
|
1611
|
+
type: "function",
|
|
1612
|
+
},
|
|
1613
|
+
{
|
|
1614
|
+
inputs: [
|
|
1615
|
+
{
|
|
1616
|
+
components: [
|
|
1617
|
+
{
|
|
1618
|
+
internalType: "contract IERC20",
|
|
1619
|
+
name: "srcToken",
|
|
1620
|
+
type: "address",
|
|
1621
|
+
},
|
|
1622
|
+
{
|
|
1623
|
+
internalType: "contract IERC20",
|
|
1624
|
+
name: "destToken",
|
|
1625
|
+
type: "address",
|
|
1626
|
+
},
|
|
1627
|
+
{ internalType: "uint256", name: "fromAmount", type: "uint256" },
|
|
1628
|
+
{ internalType: "uint256", name: "toAmount", type: "uint256" },
|
|
1629
|
+
{ internalType: "uint256", name: "quotedAmount", type: "uint256" },
|
|
1630
|
+
{ internalType: "bytes32", name: "metadata", type: "bytes32" },
|
|
1631
|
+
{
|
|
1632
|
+
internalType: "address payable",
|
|
1633
|
+
name: "beneficiary",
|
|
1634
|
+
type: "address",
|
|
1635
|
+
},
|
|
1636
|
+
{ internalType: "bytes", name: "pools", type: "bytes" },
|
|
1637
|
+
],
|
|
1638
|
+
internalType: "struct UniswapV3Data",
|
|
1639
|
+
name: "uniData",
|
|
1640
|
+
type: "tuple",
|
|
1641
|
+
},
|
|
1642
|
+
{ internalType: "uint256", name: "partnerAndFee", type: "uint256" },
|
|
1643
|
+
{ internalType: "bytes", name: "permit", type: "bytes" },
|
|
1644
|
+
],
|
|
1645
|
+
name: "swapExactAmountOutOnUniswapV3",
|
|
1646
|
+
outputs: [
|
|
1647
|
+
{ internalType: "uint256", name: "spentAmount", type: "uint256" },
|
|
1648
|
+
{ internalType: "uint256", name: "receivedAmount", type: "uint256" },
|
|
1649
|
+
{ internalType: "uint256", name: "paraswapShare", type: "uint256" },
|
|
1650
|
+
{ internalType: "uint256", name: "partnerShare", type: "uint256" },
|
|
1651
|
+
],
|
|
1652
|
+
stateMutability: "payable",
|
|
1653
|
+
type: "function",
|
|
1654
|
+
},
|
|
1655
|
+
{
|
|
1656
|
+
inputs: [
|
|
1657
|
+
{
|
|
1658
|
+
components: [
|
|
1659
|
+
{ internalType: "uint256", name: "fromAmount", type: "uint256" },
|
|
1660
|
+
{ internalType: "uint256", name: "toAmount", type: "uint256" },
|
|
1661
|
+
{
|
|
1662
|
+
internalType: "uint8",
|
|
1663
|
+
name: "wrapApproveDirection",
|
|
1664
|
+
type: "uint8",
|
|
1665
|
+
},
|
|
1666
|
+
{ internalType: "bytes32", name: "metadata", type: "bytes32" },
|
|
1667
|
+
{
|
|
1668
|
+
internalType: "address payable",
|
|
1669
|
+
name: "beneficiary",
|
|
1670
|
+
type: "address",
|
|
1671
|
+
},
|
|
1672
|
+
],
|
|
1673
|
+
internalType: "struct AugustusRFQData",
|
|
1674
|
+
name: "data",
|
|
1675
|
+
type: "tuple",
|
|
1676
|
+
},
|
|
1677
|
+
{
|
|
1678
|
+
components: [
|
|
1679
|
+
{
|
|
1680
|
+
components: [
|
|
1681
|
+
{
|
|
1682
|
+
internalType: "uint256",
|
|
1683
|
+
name: "nonceAndMeta",
|
|
1684
|
+
type: "uint256",
|
|
1685
|
+
},
|
|
1686
|
+
{ internalType: "uint128", name: "expiry", type: "uint128" },
|
|
1687
|
+
{ internalType: "address", name: "makerAsset", type: "address" },
|
|
1688
|
+
{ internalType: "address", name: "takerAsset", type: "address" },
|
|
1689
|
+
{ internalType: "address", name: "maker", type: "address" },
|
|
1690
|
+
{ internalType: "address", name: "taker", type: "address" },
|
|
1691
|
+
{ internalType: "uint256", name: "makerAmount", type: "uint256" },
|
|
1692
|
+
{ internalType: "uint256", name: "takerAmount", type: "uint256" },
|
|
1693
|
+
],
|
|
1694
|
+
internalType: "struct Order",
|
|
1695
|
+
name: "order",
|
|
1696
|
+
type: "tuple",
|
|
1697
|
+
},
|
|
1698
|
+
{ internalType: "bytes", name: "signature", type: "bytes" },
|
|
1699
|
+
{
|
|
1700
|
+
internalType: "uint256",
|
|
1701
|
+
name: "takerTokenFillAmount",
|
|
1702
|
+
type: "uint256",
|
|
1703
|
+
},
|
|
1704
|
+
{ internalType: "bytes", name: "permitTakerAsset", type: "bytes" },
|
|
1705
|
+
{ internalType: "bytes", name: "permitMakerAsset", type: "bytes" },
|
|
1706
|
+
],
|
|
1707
|
+
internalType: "struct OrderInfo[]",
|
|
1708
|
+
name: "orders",
|
|
1709
|
+
type: "tuple[]",
|
|
1710
|
+
},
|
|
1711
|
+
{ internalType: "bytes", name: "permit", type: "bytes" },
|
|
1712
|
+
],
|
|
1713
|
+
name: "swapOnAugustusRFQTryBatchFill",
|
|
1714
|
+
outputs: [
|
|
1715
|
+
{ internalType: "uint256", name: "spentAmount", type: "uint256" },
|
|
1716
|
+
{ internalType: "uint256", name: "receivedAmount", type: "uint256" },
|
|
1717
|
+
],
|
|
1718
|
+
stateMutability: "payable",
|
|
1719
|
+
type: "function",
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
inputs: [
|
|
1723
|
+
{ internalType: "int256", name: "amount0Delta", type: "int256" },
|
|
1724
|
+
{ internalType: "int256", name: "amount1Delta", type: "int256" },
|
|
1725
|
+
{ internalType: "bytes", name: "data", type: "bytes" },
|
|
1726
|
+
],
|
|
1727
|
+
name: "uniswapV3SwapCallback",
|
|
1728
|
+
outputs: [],
|
|
1729
|
+
stateMutability: "nonpayable",
|
|
1730
|
+
type: "function",
|
|
1731
|
+
},
|
|
1732
|
+
{ stateMutability: "payable", type: "receive" },
|
|
1733
|
+
];
|
package/dist/consts.d.ts
CHANGED
package/dist/consts.js
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CHAINS_ENUM } from "@debank/common";
|
|
2
|
+
import { TxWithChainId, DecodeCalldataResult } from "../quote";
|
|
3
|
+
export declare const SUPPORT_CHAINS: CHAINS_ENUM[];
|
|
4
|
+
export declare const getQuote: (options: import("../quote").QuoteParams, api: import("@rabby-wallet/rabby-api").OpenApiService) => Promise<import("../quote").QuoteResult>;
|
|
5
|
+
export declare const decodeCalldata: (tx: TxWithChainId) => DecodeCalldataResult | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CHAINS_ENUM } from "@debank/common";
|
|
2
|
+
import { generateGetQuote } from "../utils";
|
|
3
|
+
import { DEX_ENUM } from "../consts";
|
|
4
|
+
export const SUPPORT_CHAINS = [
|
|
5
|
+
CHAINS_ENUM.ETH,
|
|
6
|
+
CHAINS_ENUM.OP,
|
|
7
|
+
CHAINS_ENUM.BSC,
|
|
8
|
+
CHAINS_ENUM.POLYGON,
|
|
9
|
+
CHAINS_ENUM.FTM,
|
|
10
|
+
CHAINS_ENUM.ERA,
|
|
11
|
+
CHAINS_ENUM.MANTLE,
|
|
12
|
+
CHAINS_ENUM.BASE,
|
|
13
|
+
CHAINS_ENUM.ARBITRUM,
|
|
14
|
+
CHAINS_ENUM.AVAX,
|
|
15
|
+
CHAINS_ENUM.LINEA,
|
|
16
|
+
CHAINS_ENUM.SCRL,
|
|
17
|
+
CHAINS_ENUM.MODE,
|
|
18
|
+
];
|
|
19
|
+
export const getQuote = generateGetQuote({
|
|
20
|
+
SUPPORT_CHAINS,
|
|
21
|
+
id: "odos",
|
|
22
|
+
dex: DEX_ENUM.ODOS,
|
|
23
|
+
});
|
|
24
|
+
export const decodeCalldata = (tx) => {
|
|
25
|
+
return null;
|
|
26
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CHAINS_ENUM } from "@debank/common";
|
|
2
|
+
import { TxWithChainId, DecodeCalldataResult } from "../quote";
|
|
3
|
+
export declare const SUPPORT_CHAINS: CHAINS_ENUM[];
|
|
4
|
+
export declare const getQuote: (options: import("../quote").QuoteParams, api: import("@rabby-wallet/rabby-api").OpenApiService) => Promise<import("../quote").QuoteResult>;
|
|
5
|
+
export declare const decodeCalldata: (tx: TxWithChainId) => DecodeCalldataResult | null;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Interface } from "@ethersproject/abi";
|
|
2
|
+
import { CHAINS_ENUM, CHAINS } from "@debank/common";
|
|
3
|
+
import { generateGetQuote, isSameAddress } from "../utils";
|
|
4
|
+
import { ParaSwapV6ABI } from "../abi";
|
|
5
|
+
import { DEX_ENUM } from "../consts";
|
|
6
|
+
const NATIVE_TOKEN = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
7
|
+
export const SUPPORT_CHAINS = [
|
|
8
|
+
CHAINS_ENUM.ETH,
|
|
9
|
+
CHAINS_ENUM.POLYGON,
|
|
10
|
+
CHAINS_ENUM.BSC,
|
|
11
|
+
CHAINS_ENUM.AVAX,
|
|
12
|
+
CHAINS_ENUM.OP,
|
|
13
|
+
CHAINS_ENUM.ARBITRUM,
|
|
14
|
+
CHAINS_ENUM.FTM,
|
|
15
|
+
CHAINS_ENUM.BASE,
|
|
16
|
+
// CHAINS_ENUM.PZE,
|
|
17
|
+
];
|
|
18
|
+
export const getQuote = generateGetQuote({
|
|
19
|
+
SUPPORT_CHAINS,
|
|
20
|
+
id: "paraswap_v6",
|
|
21
|
+
dex: DEX_ENUM.PARASWAPV6,
|
|
22
|
+
});
|
|
23
|
+
export const decodeCalldata = (tx) => {
|
|
24
|
+
const chain = Object.values(CHAINS).find((item) => item.id === tx.chainId);
|
|
25
|
+
const nullAddress = "0x0000000000000000000000000000000000000000";
|
|
26
|
+
if (!chain)
|
|
27
|
+
return null;
|
|
28
|
+
const contractInterface = new Interface(ParaSwapV6ABI);
|
|
29
|
+
const result = contractInterface.parseTransaction({
|
|
30
|
+
data: tx.data,
|
|
31
|
+
});
|
|
32
|
+
switch (result.name) {
|
|
33
|
+
case "swapExactAmountInOnUniswapV2":
|
|
34
|
+
case "swapExactAmountInOnUniswapV3": {
|
|
35
|
+
const [data] = result.args;
|
|
36
|
+
const [srcToken, destToken, fromAmount, toAmount, quotedAmount, metadata, beneficiary,] = data;
|
|
37
|
+
if (!srcToken || !destToken || !fromAmount || !toAmount)
|
|
38
|
+
return null;
|
|
39
|
+
return {
|
|
40
|
+
fromToken: isSameAddress(srcToken, NATIVE_TOKEN)
|
|
41
|
+
? chain.nativeTokenAddress
|
|
42
|
+
: srcToken,
|
|
43
|
+
fromTokenAmount: fromAmount.toString(),
|
|
44
|
+
toToken: isSameAddress(destToken, NATIVE_TOKEN)
|
|
45
|
+
? chain.nativeTokenAddress
|
|
46
|
+
: destToken,
|
|
47
|
+
minReceiveToTokenAmount: toAmount.toString(),
|
|
48
|
+
toTokenReceiver: beneficiary === nullAddress ? tx.from : beneficiary,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
case "swapExactAmountIn": {
|
|
52
|
+
const [_, data] = result.args;
|
|
53
|
+
const [srcToken, destToken, fromAmount, toAmount, quotedAmount, metadata, beneficiary,] = data;
|
|
54
|
+
if (!srcToken || !destToken || !fromAmount || !toAmount)
|
|
55
|
+
return null;
|
|
56
|
+
return {
|
|
57
|
+
fromToken: isSameAddress(srcToken, NATIVE_TOKEN)
|
|
58
|
+
? chain.nativeTokenAddress
|
|
59
|
+
: srcToken,
|
|
60
|
+
fromTokenAmount: fromAmount.toString(),
|
|
61
|
+
toToken: isSameAddress(destToken, NATIVE_TOKEN)
|
|
62
|
+
? chain.nativeTokenAddress
|
|
63
|
+
: destToken,
|
|
64
|
+
minReceiveToTokenAmount: toAmount.toString(),
|
|
65
|
+
toTokenReceiver: beneficiary === nullAddress ? tx.from : beneficiary,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
case "swapExactAmountInOnCurveV1": {
|
|
69
|
+
const [data] = result.args;
|
|
70
|
+
const [curveData, curveAssets, srcToken, destToken, fromAmount, toAmount, quotedAmount, metadata, beneficiary,] = data;
|
|
71
|
+
if (!srcToken || !destToken || !fromAmount || !toAmount)
|
|
72
|
+
return null;
|
|
73
|
+
return {
|
|
74
|
+
fromToken: isSameAddress(srcToken, NATIVE_TOKEN)
|
|
75
|
+
? chain.nativeTokenAddress
|
|
76
|
+
: srcToken,
|
|
77
|
+
fromTokenAmount: fromAmount.toString(),
|
|
78
|
+
toToken: isSameAddress(destToken, NATIVE_TOKEN)
|
|
79
|
+
? chain.nativeTokenAddress
|
|
80
|
+
: destToken,
|
|
81
|
+
minReceiveToTokenAmount: toAmount.toString(),
|
|
82
|
+
toTokenReceiver: beneficiary === nullAddress ? tx.from : beneficiary,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
case "swapExactAmountInOnCurveV2": {
|
|
86
|
+
const [data] = result.args;
|
|
87
|
+
const [curveData, i, j, poolAddress, srcToken, destToken, fromAmount, toAmount, quotedAmount, metadata, beneficiary,] = data;
|
|
88
|
+
if (!srcToken || !destToken || !fromAmount || !toAmount)
|
|
89
|
+
return null;
|
|
90
|
+
return {
|
|
91
|
+
fromToken: isSameAddress(srcToken, NATIVE_TOKEN)
|
|
92
|
+
? chain.nativeTokenAddress
|
|
93
|
+
: srcToken,
|
|
94
|
+
fromTokenAmount: fromAmount.toString(),
|
|
95
|
+
toToken: isSameAddress(destToken, NATIVE_TOKEN)
|
|
96
|
+
? chain.nativeTokenAddress
|
|
97
|
+
: destToken,
|
|
98
|
+
minReceiveToTokenAmount: toAmount.toString(),
|
|
99
|
+
toTokenReceiver: beneficiary === nullAddress ? tx.from : beneficiary,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// swapExactAmountInOnBalancerV2
|
|
103
|
+
// swapOnAugustusRFQTryBatchFill
|
|
104
|
+
default:
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
};
|
package/dist/dexs/wrapToken.js
CHANGED
|
@@ -30,6 +30,9 @@ export const SUPPORT_CHAINS = [
|
|
|
30
30
|
CHAINS_ENUM.ERA,
|
|
31
31
|
// CHAINS_ENUM.PZE,
|
|
32
32
|
// CHAINS_ENUM.ROSE,
|
|
33
|
+
CHAINS_ENUM.SCRL,
|
|
34
|
+
CHAINS_ENUM.MODE,
|
|
35
|
+
CHAINS_ENUM.MANTLE,
|
|
33
36
|
];
|
|
34
37
|
export const getQuote = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
38
|
const chain = CHAINS[options.chain];
|
package/dist/list.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ export declare const WrapTokenAddressMap: {
|
|
|
14
14
|
AURORA: string;
|
|
15
15
|
BASE: string;
|
|
16
16
|
ERA: string;
|
|
17
|
+
SCRL: string;
|
|
18
|
+
MANTLE: string;
|
|
19
|
+
MODE: string;
|
|
17
20
|
};
|
|
18
21
|
export declare const DEX_SUPPORT_CHAINS: {
|
|
19
22
|
WrapToken: CHAINS_ENUM[];
|
|
@@ -22,6 +25,8 @@ export declare const DEX_SUPPORT_CHAINS: {
|
|
|
22
25
|
"0xAPI": CHAINS_ENUM[];
|
|
23
26
|
OpenOcean: CHAINS_ENUM[];
|
|
24
27
|
Kyberswap: CHAINS_ENUM[];
|
|
28
|
+
ParaSwapV6: CHAINS_ENUM[];
|
|
29
|
+
ODOS: CHAINS_ENUM[];
|
|
25
30
|
};
|
|
26
31
|
export declare const DEX_ROUTER_WHITELIST: {
|
|
27
32
|
"1inch": {
|
|
@@ -89,6 +94,32 @@ export declare const DEX_ROUTER_WHITELIST: {
|
|
|
89
94
|
LINEA: string;
|
|
90
95
|
BASE: string;
|
|
91
96
|
};
|
|
97
|
+
ParaSwapV6: {
|
|
98
|
+
ETH: string;
|
|
99
|
+
POLYGON: string;
|
|
100
|
+
BSC: string;
|
|
101
|
+
AVAX: string;
|
|
102
|
+
FTM: string;
|
|
103
|
+
OP: string;
|
|
104
|
+
ARBITRUM: string;
|
|
105
|
+
BASE: string;
|
|
106
|
+
PZE: string;
|
|
107
|
+
};
|
|
108
|
+
ODOS: {
|
|
109
|
+
ETH: string;
|
|
110
|
+
OP: string;
|
|
111
|
+
BSC: string;
|
|
112
|
+
POLYGON: string;
|
|
113
|
+
FTM: string;
|
|
114
|
+
ERA: string;
|
|
115
|
+
MANTLE: string;
|
|
116
|
+
BASE: string;
|
|
117
|
+
ARBITRUM: string;
|
|
118
|
+
AVAX: string;
|
|
119
|
+
LINEA: string;
|
|
120
|
+
SCRL: string;
|
|
121
|
+
MODE: string;
|
|
122
|
+
};
|
|
92
123
|
};
|
|
93
124
|
export declare const DEX_SPENDER_WHITELIST: {
|
|
94
125
|
"1inch": {
|
|
@@ -114,6 +145,7 @@ export declare const DEX_SPENDER_WHITELIST: {
|
|
|
114
145
|
OP: string;
|
|
115
146
|
ARBITRUM: string;
|
|
116
147
|
BASE: string;
|
|
148
|
+
PZE: string;
|
|
117
149
|
};
|
|
118
150
|
"0xAPI": {
|
|
119
151
|
ETH: string;
|
|
@@ -156,4 +188,30 @@ export declare const DEX_SPENDER_WHITELIST: {
|
|
|
156
188
|
LINEA: string;
|
|
157
189
|
BASE: string;
|
|
158
190
|
};
|
|
191
|
+
ParaSwapV6: {
|
|
192
|
+
ETH: string;
|
|
193
|
+
POLYGON: string;
|
|
194
|
+
BSC: string;
|
|
195
|
+
AVAX: string;
|
|
196
|
+
FTM: string;
|
|
197
|
+
OP: string;
|
|
198
|
+
ARBITRUM: string;
|
|
199
|
+
BASE: string;
|
|
200
|
+
PZE: string;
|
|
201
|
+
};
|
|
202
|
+
ODOS: {
|
|
203
|
+
ETH: string;
|
|
204
|
+
OP: string;
|
|
205
|
+
BSC: string;
|
|
206
|
+
POLYGON: string;
|
|
207
|
+
FTM: string;
|
|
208
|
+
ERA: string;
|
|
209
|
+
MANTLE: string;
|
|
210
|
+
BASE: string;
|
|
211
|
+
ARBITRUM: string;
|
|
212
|
+
AVAX: string;
|
|
213
|
+
LINEA: string;
|
|
214
|
+
SCRL: string;
|
|
215
|
+
MODE: string;
|
|
216
|
+
};
|
|
159
217
|
};
|
package/dist/list.js
CHANGED
|
@@ -3,8 +3,10 @@ import { SUPPORT_CHAINS as wrapTokenSupportChains } from "./dexs/wrapToken";
|
|
|
3
3
|
import { SUPPORT_CHAINS as zeroXSupportChains } from "./dexs/0xapi";
|
|
4
4
|
import { SUPPORT_CHAINS as oneInchSupportChains } from "./dexs/1inch";
|
|
5
5
|
import { SUPPORT_CHAINS as paraswapSupportChains } from "./dexs/paraswap";
|
|
6
|
+
import { SUPPORT_CHAINS as paraswapV6SupportChains } from "./dexs/paraswap_v6";
|
|
6
7
|
import { SUPPORT_CHAINS as kyberswapSupportChains } from "./dexs/kyberswap";
|
|
7
8
|
import { SUPPORT_CHAINS as openOceanSupportChains } from "./dexs/openocean";
|
|
9
|
+
import { SUPPORT_CHAINS as odosSupportChains } from "./dexs/odos";
|
|
8
10
|
import { DEX_ENUM } from "./consts";
|
|
9
11
|
export const WrapTokenAddressMap = {
|
|
10
12
|
[CHAINS_ENUM.ETH]: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
@@ -24,6 +26,9 @@ export const WrapTokenAddressMap = {
|
|
|
24
26
|
[CHAINS_ENUM.BASE]: "0x4200000000000000000000000000000000000006",
|
|
25
27
|
[CHAINS_ENUM.ERA]: "0x5aea5775959fbc2557cc8789bc1bf90a239d9a91",
|
|
26
28
|
// [CHAINS_ENUM.PZE]: "0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9",
|
|
29
|
+
[CHAINS_ENUM.SCRL]: "0x5300000000000000000000000000000000000004",
|
|
30
|
+
[CHAINS_ENUM.MANTLE]: "0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8",
|
|
31
|
+
[CHAINS_ENUM.MODE]: "0x4200000000000000000000000000000000000006",
|
|
27
32
|
};
|
|
28
33
|
export const DEX_SUPPORT_CHAINS = {
|
|
29
34
|
[DEX_ENUM.WRAPTOKEN]: wrapTokenSupportChains,
|
|
@@ -32,6 +37,8 @@ export const DEX_SUPPORT_CHAINS = {
|
|
|
32
37
|
[DEX_ENUM.ZEROXAPI]: zeroXSupportChains,
|
|
33
38
|
[DEX_ENUM.OPENOCEAN]: openOceanSupportChains,
|
|
34
39
|
[DEX_ENUM.KYBERSWAP]: kyberswapSupportChains,
|
|
40
|
+
[DEX_ENUM.PARASWAPV6]: paraswapV6SupportChains,
|
|
41
|
+
[DEX_ENUM.ODOS]: odosSupportChains,
|
|
35
42
|
};
|
|
36
43
|
export const DEX_ROUTER_WHITELIST = {
|
|
37
44
|
[DEX_ENUM.ONEINCH]: {
|
|
@@ -99,6 +106,32 @@ export const DEX_ROUTER_WHITELIST = {
|
|
|
99
106
|
[CHAINS_ENUM.LINEA]: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",
|
|
100
107
|
[CHAINS_ENUM.BASE]: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",
|
|
101
108
|
},
|
|
109
|
+
[DEX_ENUM.PARASWAPV6]: {
|
|
110
|
+
[CHAINS_ENUM.ETH]: "0x6A000F20005980200259B80c5102003040001068",
|
|
111
|
+
[CHAINS_ENUM.POLYGON]: "0x6A000F20005980200259B80c5102003040001068",
|
|
112
|
+
[CHAINS_ENUM.BSC]: "0x6A000F20005980200259B80c5102003040001068",
|
|
113
|
+
[CHAINS_ENUM.AVAX]: "0x6A000F20005980200259B80c5102003040001068",
|
|
114
|
+
[CHAINS_ENUM.FTM]: "0x6A000F20005980200259B80c5102003040001068",
|
|
115
|
+
[CHAINS_ENUM.OP]: "0x6A000F20005980200259B80c5102003040001068",
|
|
116
|
+
[CHAINS_ENUM.ARBITRUM]: "0x6A000F20005980200259B80c5102003040001068",
|
|
117
|
+
[CHAINS_ENUM.BASE]: "0x6A000F20005980200259B80c5102003040001068",
|
|
118
|
+
[CHAINS_ENUM.PZE]: "0x6A000F20005980200259B80c5102003040001068",
|
|
119
|
+
},
|
|
120
|
+
[DEX_ENUM.ODOS]: {
|
|
121
|
+
[CHAINS_ENUM.ETH]: "0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559",
|
|
122
|
+
[CHAINS_ENUM.OP]: "0xCa423977156BB05b13A2BA3b76Bc5419E2fE9680",
|
|
123
|
+
[CHAINS_ENUM.BSC]: "0x89b8AA89FDd0507a99d334CBe3C808fAFC7d850E",
|
|
124
|
+
[CHAINS_ENUM.POLYGON]: "0x4E3288c9ca110bCC82bf38F09A7b425c095d92Bf",
|
|
125
|
+
[CHAINS_ENUM.FTM]: "0xD0c22A5435F4E8E5770C1fAFb5374015FC12F7cD",
|
|
126
|
+
[CHAINS_ENUM.ERA]: "0x4bBa932E9792A2b917D47830C93a9BC79320E4f7",
|
|
127
|
+
[CHAINS_ENUM.MANTLE]: "0xD9F4e85489aDCD0bAF0Cd63b4231c6af58c26745",
|
|
128
|
+
[CHAINS_ENUM.BASE]: "0x19cEeAd7105607Cd444F5ad10dd51356436095a1",
|
|
129
|
+
[CHAINS_ENUM.ARBITRUM]: "0xa669e7A0d4b3e4Fa48af2dE86BD4CD7126Be4e13",
|
|
130
|
+
[CHAINS_ENUM.AVAX]: "0x88de50B233052e4Fb783d4F6db78Cc34fEa3e9FC",
|
|
131
|
+
[CHAINS_ENUM.LINEA]: "0x2d8879046f1559E53eb052E949e9544bCB72f414",
|
|
132
|
+
[CHAINS_ENUM.SCRL]: "0xbFe03C9E20a9Fc0b37de01A172F207004935E0b1",
|
|
133
|
+
[CHAINS_ENUM.MODE]: "0x7E15EB462cdc67Cf92Af1f7102465a8F8c784874",
|
|
134
|
+
},
|
|
102
135
|
};
|
|
103
136
|
export const DEX_SPENDER_WHITELIST = {
|
|
104
137
|
[DEX_ENUM.ONEINCH]: {
|
|
@@ -124,7 +157,7 @@ export const DEX_SPENDER_WHITELIST = {
|
|
|
124
157
|
[CHAINS_ENUM.OP]: "0x216b4b4ba9f3e719726886d34a177484278bfcae",
|
|
125
158
|
[CHAINS_ENUM.ARBITRUM]: "0x216b4b4ba9f3e719726886d34a177484278bfcae",
|
|
126
159
|
[CHAINS_ENUM.BASE]: "0x93aAAe79a53759cD164340E4C8766E4Db5331cD7",
|
|
127
|
-
|
|
160
|
+
[CHAINS_ENUM.PZE]: "0xc8a21fcd5a100c3ecc037c97e2f9c53a8d3a02a1",
|
|
128
161
|
},
|
|
129
162
|
[DEX_ENUM.ZEROXAPI]: {
|
|
130
163
|
[CHAINS_ENUM.ETH]: "0xdef1c0ded9bec7f1a1670819833240f027b25eff",
|
|
@@ -167,4 +200,30 @@ export const DEX_SPENDER_WHITELIST = {
|
|
|
167
200
|
[CHAINS_ENUM.LINEA]: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",
|
|
168
201
|
[CHAINS_ENUM.BASE]: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",
|
|
169
202
|
},
|
|
203
|
+
[DEX_ENUM.PARASWAPV6]: {
|
|
204
|
+
[CHAINS_ENUM.ETH]: "0x6A000F20005980200259B80c5102003040001068",
|
|
205
|
+
[CHAINS_ENUM.POLYGON]: "0x6A000F20005980200259B80c5102003040001068",
|
|
206
|
+
[CHAINS_ENUM.BSC]: "0x6A000F20005980200259B80c5102003040001068",
|
|
207
|
+
[CHAINS_ENUM.AVAX]: "0x6A000F20005980200259B80c5102003040001068",
|
|
208
|
+
[CHAINS_ENUM.FTM]: "0x6A000F20005980200259B80c5102003040001068",
|
|
209
|
+
[CHAINS_ENUM.OP]: "0x6A000F20005980200259B80c5102003040001068",
|
|
210
|
+
[CHAINS_ENUM.ARBITRUM]: "0x6A000F20005980200259B80c5102003040001068",
|
|
211
|
+
[CHAINS_ENUM.BASE]: "0x6A000F20005980200259B80c5102003040001068",
|
|
212
|
+
[CHAINS_ENUM.PZE]: "0x6A000F20005980200259B80c5102003040001068",
|
|
213
|
+
},
|
|
214
|
+
[DEX_ENUM.ODOS]: {
|
|
215
|
+
[CHAINS_ENUM.ETH]: "0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559",
|
|
216
|
+
[CHAINS_ENUM.OP]: "0xCa423977156BB05b13A2BA3b76Bc5419E2fE9680",
|
|
217
|
+
[CHAINS_ENUM.BSC]: "0x89b8AA89FDd0507a99d334CBe3C808fAFC7d850E",
|
|
218
|
+
[CHAINS_ENUM.POLYGON]: "0x4E3288c9ca110bCC82bf38F09A7b425c095d92Bf",
|
|
219
|
+
[CHAINS_ENUM.FTM]: "0xD0c22A5435F4E8E5770C1fAFb5374015FC12F7cD",
|
|
220
|
+
[CHAINS_ENUM.ERA]: "0x4bBa932E9792A2b917D47830C93a9BC79320E4f7",
|
|
221
|
+
[CHAINS_ENUM.MANTLE]: "0xD9F4e85489aDCD0bAF0Cd63b4231c6af58c26745",
|
|
222
|
+
[CHAINS_ENUM.BASE]: "0x19cEeAd7105607Cd444F5ad10dd51356436095a1",
|
|
223
|
+
[CHAINS_ENUM.ARBITRUM]: "0xa669e7A0d4b3e4Fa48af2dE86BD4CD7126Be4e13",
|
|
224
|
+
[CHAINS_ENUM.AVAX]: "0x88de50B233052e4Fb783d4F6db78Cc34fEa3e9FC",
|
|
225
|
+
[CHAINS_ENUM.LINEA]: "0x2d8879046f1559E53eb052E949e9544bCB72f414",
|
|
226
|
+
[CHAINS_ENUM.SCRL]: "0xbFe03C9E20a9Fc0b37de01A172F207004935E0b1",
|
|
227
|
+
[CHAINS_ENUM.MODE]: "0x7E15EB462cdc67Cf92Af1f7102465a8F8c784874",
|
|
228
|
+
},
|
|
170
229
|
};
|
package/dist/quote.js
CHANGED
|
@@ -15,6 +15,8 @@ import { getQuote as paraSwapGetQuote, decodeCalldata as paraSwapDecodeCalldata,
|
|
|
15
15
|
import { getQuote as openOceanGetQuote, decodeCalldata as openOceanDecodeCalldata, } from "./dexs/openocean";
|
|
16
16
|
import { getQuote as uniswapGetQuote, decodeCalldata as uniswapDecodeCalldata, } from "./dexs/uniswap";
|
|
17
17
|
import { getQuote as kyberswapGetQuote, decodeCalldata as kyberswapDecodeCalldata, } from "./dexs/kyberswap";
|
|
18
|
+
import { getQuote as paraSwapV6GetQuote, decodeCalldata as paraSwapV6DecodeCalldata, } from "./dexs/paraswap_v6";
|
|
19
|
+
import { getQuote as odosGetQuote, decodeCalldata as odosDecodeCalldata, } from "./dexs/odos";
|
|
18
20
|
export const getQuote = (id, params, api) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
21
|
switch (id) {
|
|
20
22
|
case DEX_ENUM.WRAPTOKEN:
|
|
@@ -31,6 +33,10 @@ export const getQuote = (id, params, api) => __awaiter(void 0, void 0, void 0, f
|
|
|
31
33
|
return yield uniswapGetQuote(params, api);
|
|
32
34
|
case DEX_ENUM.KYBERSWAP:
|
|
33
35
|
return yield kyberswapGetQuote(params, api);
|
|
36
|
+
case DEX_ENUM.PARASWAPV6:
|
|
37
|
+
return yield paraSwapV6GetQuote(params, api);
|
|
38
|
+
case DEX_ENUM.ODOS:
|
|
39
|
+
return yield odosGetQuote(params, api);
|
|
34
40
|
default:
|
|
35
41
|
throw new Error(`${id} is not supported!`);
|
|
36
42
|
}
|
|
@@ -49,6 +55,10 @@ export const decodeCalldata = (id, tx) => {
|
|
|
49
55
|
return uniswapDecodeCalldata(tx);
|
|
50
56
|
case DEX_ENUM.KYBERSWAP:
|
|
51
57
|
return kyberswapDecodeCalldata(tx);
|
|
58
|
+
case DEX_ENUM.PARASWAPV6:
|
|
59
|
+
return paraSwapV6DecodeCalldata(tx);
|
|
60
|
+
case DEX_ENUM.ODOS:
|
|
61
|
+
return odosDecodeCalldata(tx);
|
|
52
62
|
default:
|
|
53
63
|
throw new Error(`${id} is not supported!`);
|
|
54
64
|
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ import { DEX_ENUM } from "./consts";
|
|
|
5
5
|
export declare const isSameAddress: (addr1: string, addr2: string) => boolean;
|
|
6
6
|
export declare const generateGetQuote: ({ SUPPORT_CHAINS, id, dex, }: {
|
|
7
7
|
SUPPORT_CHAINS: CHAINS_ENUM[];
|
|
8
|
-
id: "uniswap3" | "matcha" | "openocean" | "1inch_v6" | "paraswap" | "kyberswap";
|
|
8
|
+
id: "uniswap3" | "matcha" | "openocean" | "1inch_v6" | "paraswap" | "kyberswap" | "odos" | "paraswap_v6";
|
|
9
9
|
dex: DEX_ENUM;
|
|
10
10
|
}) => (options: QuoteParams, api: OpenApiService) => Promise<QuoteResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rabby-wallet/rabby-swap",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"web3-eth-abi": "^1.8.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@debank/common": "^0.3.
|
|
26
|
+
"@debank/common": "^0.3.60",
|
|
27
27
|
"@babel/preset-env": "^7.19.1",
|
|
28
|
-
"@rabby-wallet/rabby-api": "^0.7.
|
|
28
|
+
"@rabby-wallet/rabby-api": "^0.7.28",
|
|
29
29
|
"@types/jest": "^29.0.3",
|
|
30
30
|
"@types/node": "^18.7.18",
|
|
31
31
|
"axios-mock-adapter": "^1.21.2",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"typescript": "^4.8.3"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@debank/common": ">=0.3.
|
|
42
|
-
"@rabby-wallet/rabby-api": ">=0.
|
|
41
|
+
"@debank/common": ">=0.3.60",
|
|
42
|
+
"@rabby-wallet/rabby-api": ">=0.6.28"
|
|
43
43
|
},
|
|
44
44
|
"author": "vvvvvv1vvvvvv",
|
|
45
45
|
"license": "ISC",
|