@defisaver/positions-sdk 2.1.13-dev-plasma-fluid4 → 2.1.13-dev-plasma-fluid6
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/cjs/fluid/index.js +39 -0
- package/cjs/markets/fluid/index.d.ts +2 -2
- package/cjs/markets/fluid/index.js +10 -10
- package/cjs/services/priceService.d.ts +489 -0
- package/cjs/services/priceService.js +110 -1
- package/cjs/types/fluid.d.ts +1 -1
- package/cjs/types/fluid.js +1 -1
- package/esm/fluid/index.js +40 -1
- package/esm/markets/fluid/index.d.ts +2 -2
- package/esm/markets/fluid/index.js +8 -8
- package/esm/services/priceService.d.ts +489 -0
- package/esm/services/priceService.js +101 -1
- package/esm/types/fluid.d.ts +1 -1
- package/esm/types/fluid.js +1 -1
- package/package.json +2 -2
- package/src/fluid/index.ts +65 -0
- package/src/services/priceService.ts +120 -1
|
@@ -6,6 +6,9 @@ export declare const getUSDCPrice: (client: Client) => Promise<string>;
|
|
|
6
6
|
export declare const getCompPrice: (client: Client) => Promise<string>;
|
|
7
7
|
export declare const getWstETHPrice: (client: Client, network?: NetworkNumber) => Promise<string>;
|
|
8
8
|
export declare const getWeETHPrice: (client: Client, network?: NetworkNumber) => Promise<string>;
|
|
9
|
+
export declare const getWsrETHPrice: (client: Client, network?: NetworkNumber) => Promise<string>;
|
|
10
|
+
export declare const getSyrupUSDTPrice: (client: Client, network?: NetworkNumber) => Promise<string>;
|
|
11
|
+
export declare const getWstUSRPrice: (client: Client, network?: NetworkNumber) => Promise<string>;
|
|
9
12
|
export declare const getWstETHChainLinkPriceCalls: (client: PublicClient, network: NetworkNumber) => ({
|
|
10
13
|
address: `0x${string}`;
|
|
11
14
|
abi: readonly [{
|
|
@@ -1324,10 +1327,496 @@ export declare const getWeETHChainLinkPriceCalls: (client: PublicClient, network
|
|
|
1324
1327
|
functionName: string;
|
|
1325
1328
|
args: never[];
|
|
1326
1329
|
})[];
|
|
1330
|
+
export declare const getWsrETHChainLinkPriceCalls: (client: PublicClient, network: NetworkNumber) => {
|
|
1331
|
+
address: `0x${string}`;
|
|
1332
|
+
abi: readonly [{
|
|
1333
|
+
readonly inputs: readonly [];
|
|
1334
|
+
readonly name: "NonContractCall";
|
|
1335
|
+
readonly type: "error";
|
|
1336
|
+
}, {
|
|
1337
|
+
readonly inputs: readonly [];
|
|
1338
|
+
readonly name: "SenderNotAdmin";
|
|
1339
|
+
readonly type: "error";
|
|
1340
|
+
}, {
|
|
1341
|
+
readonly inputs: readonly [];
|
|
1342
|
+
readonly name: "SenderNotOwner";
|
|
1343
|
+
readonly type: "error";
|
|
1344
|
+
}, {
|
|
1345
|
+
readonly inputs: readonly [];
|
|
1346
|
+
readonly name: "adminVault";
|
|
1347
|
+
readonly outputs: readonly [{
|
|
1348
|
+
readonly internalType: "contract AdminVault";
|
|
1349
|
+
readonly name: "";
|
|
1350
|
+
readonly type: "address";
|
|
1351
|
+
}];
|
|
1352
|
+
readonly stateMutability: "view";
|
|
1353
|
+
readonly type: "function";
|
|
1354
|
+
}, {
|
|
1355
|
+
readonly inputs: readonly [{
|
|
1356
|
+
readonly internalType: "address";
|
|
1357
|
+
readonly name: "";
|
|
1358
|
+
readonly type: "address";
|
|
1359
|
+
}, {
|
|
1360
|
+
readonly internalType: "address";
|
|
1361
|
+
readonly name: "";
|
|
1362
|
+
readonly type: "address";
|
|
1363
|
+
}];
|
|
1364
|
+
readonly name: "aggregators";
|
|
1365
|
+
readonly outputs: readonly [{
|
|
1366
|
+
readonly internalType: "address";
|
|
1367
|
+
readonly name: "";
|
|
1368
|
+
readonly type: "address";
|
|
1369
|
+
}];
|
|
1370
|
+
readonly stateMutability: "view";
|
|
1371
|
+
readonly type: "function";
|
|
1372
|
+
}, {
|
|
1373
|
+
readonly inputs: readonly [{
|
|
1374
|
+
readonly internalType: "address";
|
|
1375
|
+
readonly name: "base";
|
|
1376
|
+
readonly type: "address";
|
|
1377
|
+
}, {
|
|
1378
|
+
readonly internalType: "address";
|
|
1379
|
+
readonly name: "quote";
|
|
1380
|
+
readonly type: "address";
|
|
1381
|
+
}];
|
|
1382
|
+
readonly name: "getFeed";
|
|
1383
|
+
readonly outputs: readonly [{
|
|
1384
|
+
readonly internalType: "address";
|
|
1385
|
+
readonly name: "aggregator";
|
|
1386
|
+
readonly type: "address";
|
|
1387
|
+
}];
|
|
1388
|
+
readonly stateMutability: "view";
|
|
1389
|
+
readonly type: "function";
|
|
1390
|
+
}, {
|
|
1391
|
+
readonly inputs: readonly [];
|
|
1392
|
+
readonly name: "kill";
|
|
1393
|
+
readonly outputs: readonly [];
|
|
1394
|
+
readonly stateMutability: "nonpayable";
|
|
1395
|
+
readonly type: "function";
|
|
1396
|
+
}, {
|
|
1397
|
+
readonly inputs: readonly [{
|
|
1398
|
+
readonly internalType: "address";
|
|
1399
|
+
readonly name: "base";
|
|
1400
|
+
readonly type: "address";
|
|
1401
|
+
}, {
|
|
1402
|
+
readonly internalType: "address";
|
|
1403
|
+
readonly name: "quote";
|
|
1404
|
+
readonly type: "address";
|
|
1405
|
+
}];
|
|
1406
|
+
readonly name: "latestRoundData";
|
|
1407
|
+
readonly outputs: readonly [{
|
|
1408
|
+
readonly internalType: "uint80";
|
|
1409
|
+
readonly name: "roundId";
|
|
1410
|
+
readonly type: "uint80";
|
|
1411
|
+
}, {
|
|
1412
|
+
readonly internalType: "int256";
|
|
1413
|
+
readonly name: "answer";
|
|
1414
|
+
readonly type: "int256";
|
|
1415
|
+
}, {
|
|
1416
|
+
readonly internalType: "uint256";
|
|
1417
|
+
readonly name: "startedAt";
|
|
1418
|
+
readonly type: "uint256";
|
|
1419
|
+
}, {
|
|
1420
|
+
readonly internalType: "uint256";
|
|
1421
|
+
readonly name: "updatedAt";
|
|
1422
|
+
readonly type: "uint256";
|
|
1423
|
+
}, {
|
|
1424
|
+
readonly internalType: "uint80";
|
|
1425
|
+
readonly name: "answeredInRound";
|
|
1426
|
+
readonly type: "uint80";
|
|
1427
|
+
}];
|
|
1428
|
+
readonly stateMutability: "view";
|
|
1429
|
+
readonly type: "function";
|
|
1430
|
+
}, {
|
|
1431
|
+
readonly inputs: readonly [{
|
|
1432
|
+
readonly internalType: "address";
|
|
1433
|
+
readonly name: "base";
|
|
1434
|
+
readonly type: "address";
|
|
1435
|
+
}, {
|
|
1436
|
+
readonly internalType: "address";
|
|
1437
|
+
readonly name: "quote";
|
|
1438
|
+
readonly type: "address";
|
|
1439
|
+
}, {
|
|
1440
|
+
readonly internalType: "address";
|
|
1441
|
+
readonly name: "aggregator";
|
|
1442
|
+
readonly type: "address";
|
|
1443
|
+
}];
|
|
1444
|
+
readonly name: "setFeed";
|
|
1445
|
+
readonly outputs: readonly [];
|
|
1446
|
+
readonly stateMutability: "nonpayable";
|
|
1447
|
+
readonly type: "function";
|
|
1448
|
+
}, {
|
|
1449
|
+
readonly inputs: readonly [{
|
|
1450
|
+
readonly internalType: "address[]";
|
|
1451
|
+
readonly name: "bases";
|
|
1452
|
+
readonly type: "address[]";
|
|
1453
|
+
}, {
|
|
1454
|
+
readonly internalType: "address[]";
|
|
1455
|
+
readonly name: "quotes";
|
|
1456
|
+
readonly type: "address[]";
|
|
1457
|
+
}, {
|
|
1458
|
+
readonly internalType: "address[]";
|
|
1459
|
+
readonly name: "aggregator";
|
|
1460
|
+
readonly type: "address[]";
|
|
1461
|
+
}];
|
|
1462
|
+
readonly name: "setFeeds";
|
|
1463
|
+
readonly outputs: readonly [];
|
|
1464
|
+
readonly stateMutability: "nonpayable";
|
|
1465
|
+
readonly type: "function";
|
|
1466
|
+
}, {
|
|
1467
|
+
readonly inputs: readonly [{
|
|
1468
|
+
readonly internalType: "address";
|
|
1469
|
+
readonly name: "_token";
|
|
1470
|
+
readonly type: "address";
|
|
1471
|
+
}, {
|
|
1472
|
+
readonly internalType: "address";
|
|
1473
|
+
readonly name: "_receiver";
|
|
1474
|
+
readonly type: "address";
|
|
1475
|
+
}, {
|
|
1476
|
+
readonly internalType: "uint256";
|
|
1477
|
+
readonly name: "_amount";
|
|
1478
|
+
readonly type: "uint256";
|
|
1479
|
+
}];
|
|
1480
|
+
readonly name: "withdrawStuckFunds";
|
|
1481
|
+
readonly outputs: readonly [];
|
|
1482
|
+
readonly stateMutability: "nonpayable";
|
|
1483
|
+
readonly type: "function";
|
|
1484
|
+
}];
|
|
1485
|
+
functionName: string;
|
|
1486
|
+
args: string[];
|
|
1487
|
+
}[];
|
|
1488
|
+
export declare const getSyrupUSDTChainLinkPriceCalls: (client: PublicClient, network: NetworkNumber) => {
|
|
1489
|
+
address: `0x${string}`;
|
|
1490
|
+
abi: readonly [{
|
|
1491
|
+
readonly inputs: readonly [];
|
|
1492
|
+
readonly name: "NonContractCall";
|
|
1493
|
+
readonly type: "error";
|
|
1494
|
+
}, {
|
|
1495
|
+
readonly inputs: readonly [];
|
|
1496
|
+
readonly name: "SenderNotAdmin";
|
|
1497
|
+
readonly type: "error";
|
|
1498
|
+
}, {
|
|
1499
|
+
readonly inputs: readonly [];
|
|
1500
|
+
readonly name: "SenderNotOwner";
|
|
1501
|
+
readonly type: "error";
|
|
1502
|
+
}, {
|
|
1503
|
+
readonly inputs: readonly [];
|
|
1504
|
+
readonly name: "adminVault";
|
|
1505
|
+
readonly outputs: readonly [{
|
|
1506
|
+
readonly internalType: "contract AdminVault";
|
|
1507
|
+
readonly name: "";
|
|
1508
|
+
readonly type: "address";
|
|
1509
|
+
}];
|
|
1510
|
+
readonly stateMutability: "view";
|
|
1511
|
+
readonly type: "function";
|
|
1512
|
+
}, {
|
|
1513
|
+
readonly inputs: readonly [{
|
|
1514
|
+
readonly internalType: "address";
|
|
1515
|
+
readonly name: "";
|
|
1516
|
+
readonly type: "address";
|
|
1517
|
+
}, {
|
|
1518
|
+
readonly internalType: "address";
|
|
1519
|
+
readonly name: "";
|
|
1520
|
+
readonly type: "address";
|
|
1521
|
+
}];
|
|
1522
|
+
readonly name: "aggregators";
|
|
1523
|
+
readonly outputs: readonly [{
|
|
1524
|
+
readonly internalType: "address";
|
|
1525
|
+
readonly name: "";
|
|
1526
|
+
readonly type: "address";
|
|
1527
|
+
}];
|
|
1528
|
+
readonly stateMutability: "view";
|
|
1529
|
+
readonly type: "function";
|
|
1530
|
+
}, {
|
|
1531
|
+
readonly inputs: readonly [{
|
|
1532
|
+
readonly internalType: "address";
|
|
1533
|
+
readonly name: "base";
|
|
1534
|
+
readonly type: "address";
|
|
1535
|
+
}, {
|
|
1536
|
+
readonly internalType: "address";
|
|
1537
|
+
readonly name: "quote";
|
|
1538
|
+
readonly type: "address";
|
|
1539
|
+
}];
|
|
1540
|
+
readonly name: "getFeed";
|
|
1541
|
+
readonly outputs: readonly [{
|
|
1542
|
+
readonly internalType: "address";
|
|
1543
|
+
readonly name: "aggregator";
|
|
1544
|
+
readonly type: "address";
|
|
1545
|
+
}];
|
|
1546
|
+
readonly stateMutability: "view";
|
|
1547
|
+
readonly type: "function";
|
|
1548
|
+
}, {
|
|
1549
|
+
readonly inputs: readonly [];
|
|
1550
|
+
readonly name: "kill";
|
|
1551
|
+
readonly outputs: readonly [];
|
|
1552
|
+
readonly stateMutability: "nonpayable";
|
|
1553
|
+
readonly type: "function";
|
|
1554
|
+
}, {
|
|
1555
|
+
readonly inputs: readonly [{
|
|
1556
|
+
readonly internalType: "address";
|
|
1557
|
+
readonly name: "base";
|
|
1558
|
+
readonly type: "address";
|
|
1559
|
+
}, {
|
|
1560
|
+
readonly internalType: "address";
|
|
1561
|
+
readonly name: "quote";
|
|
1562
|
+
readonly type: "address";
|
|
1563
|
+
}];
|
|
1564
|
+
readonly name: "latestRoundData";
|
|
1565
|
+
readonly outputs: readonly [{
|
|
1566
|
+
readonly internalType: "uint80";
|
|
1567
|
+
readonly name: "roundId";
|
|
1568
|
+
readonly type: "uint80";
|
|
1569
|
+
}, {
|
|
1570
|
+
readonly internalType: "int256";
|
|
1571
|
+
readonly name: "answer";
|
|
1572
|
+
readonly type: "int256";
|
|
1573
|
+
}, {
|
|
1574
|
+
readonly internalType: "uint256";
|
|
1575
|
+
readonly name: "startedAt";
|
|
1576
|
+
readonly type: "uint256";
|
|
1577
|
+
}, {
|
|
1578
|
+
readonly internalType: "uint256";
|
|
1579
|
+
readonly name: "updatedAt";
|
|
1580
|
+
readonly type: "uint256";
|
|
1581
|
+
}, {
|
|
1582
|
+
readonly internalType: "uint80";
|
|
1583
|
+
readonly name: "answeredInRound";
|
|
1584
|
+
readonly type: "uint80";
|
|
1585
|
+
}];
|
|
1586
|
+
readonly stateMutability: "view";
|
|
1587
|
+
readonly type: "function";
|
|
1588
|
+
}, {
|
|
1589
|
+
readonly inputs: readonly [{
|
|
1590
|
+
readonly internalType: "address";
|
|
1591
|
+
readonly name: "base";
|
|
1592
|
+
readonly type: "address";
|
|
1593
|
+
}, {
|
|
1594
|
+
readonly internalType: "address";
|
|
1595
|
+
readonly name: "quote";
|
|
1596
|
+
readonly type: "address";
|
|
1597
|
+
}, {
|
|
1598
|
+
readonly internalType: "address";
|
|
1599
|
+
readonly name: "aggregator";
|
|
1600
|
+
readonly type: "address";
|
|
1601
|
+
}];
|
|
1602
|
+
readonly name: "setFeed";
|
|
1603
|
+
readonly outputs: readonly [];
|
|
1604
|
+
readonly stateMutability: "nonpayable";
|
|
1605
|
+
readonly type: "function";
|
|
1606
|
+
}, {
|
|
1607
|
+
readonly inputs: readonly [{
|
|
1608
|
+
readonly internalType: "address[]";
|
|
1609
|
+
readonly name: "bases";
|
|
1610
|
+
readonly type: "address[]";
|
|
1611
|
+
}, {
|
|
1612
|
+
readonly internalType: "address[]";
|
|
1613
|
+
readonly name: "quotes";
|
|
1614
|
+
readonly type: "address[]";
|
|
1615
|
+
}, {
|
|
1616
|
+
readonly internalType: "address[]";
|
|
1617
|
+
readonly name: "aggregator";
|
|
1618
|
+
readonly type: "address[]";
|
|
1619
|
+
}];
|
|
1620
|
+
readonly name: "setFeeds";
|
|
1621
|
+
readonly outputs: readonly [];
|
|
1622
|
+
readonly stateMutability: "nonpayable";
|
|
1623
|
+
readonly type: "function";
|
|
1624
|
+
}, {
|
|
1625
|
+
readonly inputs: readonly [{
|
|
1626
|
+
readonly internalType: "address";
|
|
1627
|
+
readonly name: "_token";
|
|
1628
|
+
readonly type: "address";
|
|
1629
|
+
}, {
|
|
1630
|
+
readonly internalType: "address";
|
|
1631
|
+
readonly name: "_receiver";
|
|
1632
|
+
readonly type: "address";
|
|
1633
|
+
}, {
|
|
1634
|
+
readonly internalType: "uint256";
|
|
1635
|
+
readonly name: "_amount";
|
|
1636
|
+
readonly type: "uint256";
|
|
1637
|
+
}];
|
|
1638
|
+
readonly name: "withdrawStuckFunds";
|
|
1639
|
+
readonly outputs: readonly [];
|
|
1640
|
+
readonly stateMutability: "nonpayable";
|
|
1641
|
+
readonly type: "function";
|
|
1642
|
+
}];
|
|
1643
|
+
functionName: string;
|
|
1644
|
+
args: string[];
|
|
1645
|
+
}[];
|
|
1646
|
+
export declare const getWstUSRChainLinkPriceCalls: (client: PublicClient, network: NetworkNumber) => {
|
|
1647
|
+
address: `0x${string}`;
|
|
1648
|
+
abi: readonly [{
|
|
1649
|
+
readonly inputs: readonly [];
|
|
1650
|
+
readonly name: "NonContractCall";
|
|
1651
|
+
readonly type: "error";
|
|
1652
|
+
}, {
|
|
1653
|
+
readonly inputs: readonly [];
|
|
1654
|
+
readonly name: "SenderNotAdmin";
|
|
1655
|
+
readonly type: "error";
|
|
1656
|
+
}, {
|
|
1657
|
+
readonly inputs: readonly [];
|
|
1658
|
+
readonly name: "SenderNotOwner";
|
|
1659
|
+
readonly type: "error";
|
|
1660
|
+
}, {
|
|
1661
|
+
readonly inputs: readonly [];
|
|
1662
|
+
readonly name: "adminVault";
|
|
1663
|
+
readonly outputs: readonly [{
|
|
1664
|
+
readonly internalType: "contract AdminVault";
|
|
1665
|
+
readonly name: "";
|
|
1666
|
+
readonly type: "address";
|
|
1667
|
+
}];
|
|
1668
|
+
readonly stateMutability: "view";
|
|
1669
|
+
readonly type: "function";
|
|
1670
|
+
}, {
|
|
1671
|
+
readonly inputs: readonly [{
|
|
1672
|
+
readonly internalType: "address";
|
|
1673
|
+
readonly name: "";
|
|
1674
|
+
readonly type: "address";
|
|
1675
|
+
}, {
|
|
1676
|
+
readonly internalType: "address";
|
|
1677
|
+
readonly name: "";
|
|
1678
|
+
readonly type: "address";
|
|
1679
|
+
}];
|
|
1680
|
+
readonly name: "aggregators";
|
|
1681
|
+
readonly outputs: readonly [{
|
|
1682
|
+
readonly internalType: "address";
|
|
1683
|
+
readonly name: "";
|
|
1684
|
+
readonly type: "address";
|
|
1685
|
+
}];
|
|
1686
|
+
readonly stateMutability: "view";
|
|
1687
|
+
readonly type: "function";
|
|
1688
|
+
}, {
|
|
1689
|
+
readonly inputs: readonly [{
|
|
1690
|
+
readonly internalType: "address";
|
|
1691
|
+
readonly name: "base";
|
|
1692
|
+
readonly type: "address";
|
|
1693
|
+
}, {
|
|
1694
|
+
readonly internalType: "address";
|
|
1695
|
+
readonly name: "quote";
|
|
1696
|
+
readonly type: "address";
|
|
1697
|
+
}];
|
|
1698
|
+
readonly name: "getFeed";
|
|
1699
|
+
readonly outputs: readonly [{
|
|
1700
|
+
readonly internalType: "address";
|
|
1701
|
+
readonly name: "aggregator";
|
|
1702
|
+
readonly type: "address";
|
|
1703
|
+
}];
|
|
1704
|
+
readonly stateMutability: "view";
|
|
1705
|
+
readonly type: "function";
|
|
1706
|
+
}, {
|
|
1707
|
+
readonly inputs: readonly [];
|
|
1708
|
+
readonly name: "kill";
|
|
1709
|
+
readonly outputs: readonly [];
|
|
1710
|
+
readonly stateMutability: "nonpayable";
|
|
1711
|
+
readonly type: "function";
|
|
1712
|
+
}, {
|
|
1713
|
+
readonly inputs: readonly [{
|
|
1714
|
+
readonly internalType: "address";
|
|
1715
|
+
readonly name: "base";
|
|
1716
|
+
readonly type: "address";
|
|
1717
|
+
}, {
|
|
1718
|
+
readonly internalType: "address";
|
|
1719
|
+
readonly name: "quote";
|
|
1720
|
+
readonly type: "address";
|
|
1721
|
+
}];
|
|
1722
|
+
readonly name: "latestRoundData";
|
|
1723
|
+
readonly outputs: readonly [{
|
|
1724
|
+
readonly internalType: "uint80";
|
|
1725
|
+
readonly name: "roundId";
|
|
1726
|
+
readonly type: "uint80";
|
|
1727
|
+
}, {
|
|
1728
|
+
readonly internalType: "int256";
|
|
1729
|
+
readonly name: "answer";
|
|
1730
|
+
readonly type: "int256";
|
|
1731
|
+
}, {
|
|
1732
|
+
readonly internalType: "uint256";
|
|
1733
|
+
readonly name: "startedAt";
|
|
1734
|
+
readonly type: "uint256";
|
|
1735
|
+
}, {
|
|
1736
|
+
readonly internalType: "uint256";
|
|
1737
|
+
readonly name: "updatedAt";
|
|
1738
|
+
readonly type: "uint256";
|
|
1739
|
+
}, {
|
|
1740
|
+
readonly internalType: "uint80";
|
|
1741
|
+
readonly name: "answeredInRound";
|
|
1742
|
+
readonly type: "uint80";
|
|
1743
|
+
}];
|
|
1744
|
+
readonly stateMutability: "view";
|
|
1745
|
+
readonly type: "function";
|
|
1746
|
+
}, {
|
|
1747
|
+
readonly inputs: readonly [{
|
|
1748
|
+
readonly internalType: "address";
|
|
1749
|
+
readonly name: "base";
|
|
1750
|
+
readonly type: "address";
|
|
1751
|
+
}, {
|
|
1752
|
+
readonly internalType: "address";
|
|
1753
|
+
readonly name: "quote";
|
|
1754
|
+
readonly type: "address";
|
|
1755
|
+
}, {
|
|
1756
|
+
readonly internalType: "address";
|
|
1757
|
+
readonly name: "aggregator";
|
|
1758
|
+
readonly type: "address";
|
|
1759
|
+
}];
|
|
1760
|
+
readonly name: "setFeed";
|
|
1761
|
+
readonly outputs: readonly [];
|
|
1762
|
+
readonly stateMutability: "nonpayable";
|
|
1763
|
+
readonly type: "function";
|
|
1764
|
+
}, {
|
|
1765
|
+
readonly inputs: readonly [{
|
|
1766
|
+
readonly internalType: "address[]";
|
|
1767
|
+
readonly name: "bases";
|
|
1768
|
+
readonly type: "address[]";
|
|
1769
|
+
}, {
|
|
1770
|
+
readonly internalType: "address[]";
|
|
1771
|
+
readonly name: "quotes";
|
|
1772
|
+
readonly type: "address[]";
|
|
1773
|
+
}, {
|
|
1774
|
+
readonly internalType: "address[]";
|
|
1775
|
+
readonly name: "aggregator";
|
|
1776
|
+
readonly type: "address[]";
|
|
1777
|
+
}];
|
|
1778
|
+
readonly name: "setFeeds";
|
|
1779
|
+
readonly outputs: readonly [];
|
|
1780
|
+
readonly stateMutability: "nonpayable";
|
|
1781
|
+
readonly type: "function";
|
|
1782
|
+
}, {
|
|
1783
|
+
readonly inputs: readonly [{
|
|
1784
|
+
readonly internalType: "address";
|
|
1785
|
+
readonly name: "_token";
|
|
1786
|
+
readonly type: "address";
|
|
1787
|
+
}, {
|
|
1788
|
+
readonly internalType: "address";
|
|
1789
|
+
readonly name: "_receiver";
|
|
1790
|
+
readonly type: "address";
|
|
1791
|
+
}, {
|
|
1792
|
+
readonly internalType: "uint256";
|
|
1793
|
+
readonly name: "_amount";
|
|
1794
|
+
readonly type: "uint256";
|
|
1795
|
+
}];
|
|
1796
|
+
readonly name: "withdrawStuckFunds";
|
|
1797
|
+
readonly outputs: readonly [];
|
|
1798
|
+
readonly stateMutability: "nonpayable";
|
|
1799
|
+
readonly type: "function";
|
|
1800
|
+
}];
|
|
1801
|
+
functionName: string;
|
|
1802
|
+
args: string[];
|
|
1803
|
+
}[];
|
|
1327
1804
|
export declare const parseWstETHPriceCalls: (_ethPrice: string, wstETHrateAnswer: string, decimals: string) => {
|
|
1328
1805
|
ethPrice: Dec;
|
|
1329
1806
|
wstETHRate: string;
|
|
1330
1807
|
};
|
|
1808
|
+
export declare const parseWrsETHPriceCalls: (ethPriceAnswer: string, wrsETHrateAnswer: string) => {
|
|
1809
|
+
ethPrice: Dec;
|
|
1810
|
+
wrsETHRate: Dec;
|
|
1811
|
+
};
|
|
1812
|
+
export declare const parseSyrupUSDTPriceCalls: (usdtPriceAnswer: string, syrupUSDTRateAnswer: string) => {
|
|
1813
|
+
syrupUSDTRate: Dec;
|
|
1814
|
+
USDTRate: Dec;
|
|
1815
|
+
};
|
|
1816
|
+
export declare const parseWstUSRPriceCalls: (usrPrice: string, _wstUSRRate: string) => {
|
|
1817
|
+
wstUSRRate: Dec;
|
|
1818
|
+
USRRate: Dec;
|
|
1819
|
+
};
|
|
1331
1820
|
export declare const parseWeETHPriceCalls: (_ethPrice: string, weETHrateAnswer: string, decimals: string) => {
|
|
1332
1821
|
ethPrice: Dec;
|
|
1333
1822
|
weETHRate: string;
|
|
@@ -9,9 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import Dec from 'decimal.js';
|
|
11
11
|
import { getAssetInfo } from '@defisaver/tokens';
|
|
12
|
-
import { BTCPriceFeedContractViem, COMPPriceFeedContractViem, ETHPriceFeedContractViem, USDCPriceFeedContractViem, WeETHPriceFeedContractViem, WstETHPriceFeedContractViem, } from '../contracts';
|
|
12
|
+
import { BTCPriceFeedContractViem, COMPPriceFeedContractViem, DFSFeedRegistryContractViem, ETHPriceFeedContractViem, USDCPriceFeedContractViem, WeETHPriceFeedContractViem, WstETHPriceFeedContractViem, } from '../contracts';
|
|
13
13
|
import { NetworkNumber } from '../types/common';
|
|
14
14
|
import { getEthAmountForDecimals } from './utils';
|
|
15
|
+
import { USD_QUOTE } from '../constants';
|
|
15
16
|
export const getEthPrice = (client) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
17
|
const contract = ETHPriceFeedContractViem(client, NetworkNumber.Eth);
|
|
17
18
|
const price = yield contract.read.latestAnswer();
|
|
@@ -51,6 +52,36 @@ export const getWeETHPrice = (client_1, ...args_1) => __awaiter(void 0, [client_
|
|
|
51
52
|
const weETHRate = getEthAmountForDecimals(weETHRateWei[1].toString(), decimals);
|
|
52
53
|
return new Dec(ethPrice).mul(weETHRate).toString();
|
|
53
54
|
});
|
|
55
|
+
export const getWsrETHPrice = (client_1, ...args_1) => __awaiter(void 0, [client_1, ...args_1], void 0, function* (client, network = NetworkNumber.Eth) {
|
|
56
|
+
const feedRegistryContract = DFSFeedRegistryContractViem(client, network);
|
|
57
|
+
const [ethPriceWei, wrsETHRateWei] = yield Promise.all([
|
|
58
|
+
feedRegistryContract.read.latestRoundData([getAssetInfo('WETH', network).address, USD_QUOTE]),
|
|
59
|
+
feedRegistryContract.read.latestRoundData([getAssetInfo('wrsETH', network).address, getAssetInfo('WETH', network).address]),
|
|
60
|
+
]);
|
|
61
|
+
const ethPrice = new Dec(ethPriceWei[1].toString()).div(1e8);
|
|
62
|
+
const wrsETHRate = getEthAmountForDecimals(wrsETHRateWei[1].toString(), 18);
|
|
63
|
+
return new Dec(ethPrice).mul(wrsETHRate).toString();
|
|
64
|
+
});
|
|
65
|
+
export const getSyrupUSDTPrice = (client_1, ...args_1) => __awaiter(void 0, [client_1, ...args_1], void 0, function* (client, network = NetworkNumber.Eth) {
|
|
66
|
+
const feedRegistryContract = DFSFeedRegistryContractViem(client, network);
|
|
67
|
+
const [usdtPriceWei, syrupUSDTRateWei] = yield Promise.all([
|
|
68
|
+
feedRegistryContract.read.latestRoundData([getAssetInfo('USDT', network).address, USD_QUOTE]),
|
|
69
|
+
feedRegistryContract.read.latestRoundData([getAssetInfo('syrupUSDT', network).address, getAssetInfo('USDT', network).address]),
|
|
70
|
+
]);
|
|
71
|
+
const usdtPrice = new Dec(usdtPriceWei[1].toString()).div(1e8);
|
|
72
|
+
const syrupUSDTPrice = getEthAmountForDecimals(syrupUSDTRateWei[1].toString(), 18);
|
|
73
|
+
return new Dec(usdtPrice).mul(syrupUSDTPrice).toString();
|
|
74
|
+
});
|
|
75
|
+
export const getWstUSRPrice = (client_1, ...args_1) => __awaiter(void 0, [client_1, ...args_1], void 0, function* (client, network = NetworkNumber.Eth) {
|
|
76
|
+
const feedRegistryContract = DFSFeedRegistryContractViem(client, network);
|
|
77
|
+
const [usrPriceWei, wstUSRRateWei] = yield Promise.all([
|
|
78
|
+
feedRegistryContract.read.latestRoundData([getAssetInfo('USR', network).address, USD_QUOTE]),
|
|
79
|
+
feedRegistryContract.read.latestRoundData([getAssetInfo('wstUSR', network).address, getAssetInfo('USR', network).address]),
|
|
80
|
+
]);
|
|
81
|
+
const usrPrice = new Dec(usrPriceWei[1].toString()).div(1e8);
|
|
82
|
+
const wstUSRPrice = getEthAmountForDecimals(wstUSRRateWei[1].toString(), 18);
|
|
83
|
+
return new Dec(usrPrice).mul(wstUSRPrice).toString();
|
|
84
|
+
});
|
|
54
85
|
export const getWstETHChainLinkPriceCalls = (client, network) => {
|
|
55
86
|
const wstETHFeedContract = WstETHPriceFeedContractViem(client, network);
|
|
56
87
|
const ethFeedContract = ETHPriceFeedContractViem(client, network);
|
|
@@ -101,11 +132,80 @@ export const getWeETHChainLinkPriceCalls = (client, network) => {
|
|
|
101
132
|
];
|
|
102
133
|
return calls;
|
|
103
134
|
};
|
|
135
|
+
export const getWsrETHChainLinkPriceCalls = (client, network) => {
|
|
136
|
+
const feedRegistryContract = DFSFeedRegistryContractViem(client, network);
|
|
137
|
+
const calls = [
|
|
138
|
+
{
|
|
139
|
+
address: feedRegistryContract.address,
|
|
140
|
+
abi: feedRegistryContract.abi,
|
|
141
|
+
functionName: 'latestRoundData',
|
|
142
|
+
args: [getAssetInfo('WETH', network).address, USD_QUOTE],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
address: feedRegistryContract.address,
|
|
146
|
+
abi: feedRegistryContract.abi,
|
|
147
|
+
functionName: 'latestRoundData',
|
|
148
|
+
args: [getAssetInfo('wrsETH', network).address, getAssetInfo('WETH', network).address],
|
|
149
|
+
},
|
|
150
|
+
];
|
|
151
|
+
return calls;
|
|
152
|
+
};
|
|
153
|
+
export const getSyrupUSDTChainLinkPriceCalls = (client, network) => {
|
|
154
|
+
const feedRegistryContract = DFSFeedRegistryContractViem(client, network);
|
|
155
|
+
const calls = [
|
|
156
|
+
{
|
|
157
|
+
address: feedRegistryContract.address,
|
|
158
|
+
abi: feedRegistryContract.abi,
|
|
159
|
+
functionName: 'latestRoundData',
|
|
160
|
+
args: [getAssetInfo('USDT', network).address, USD_QUOTE],
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
address: feedRegistryContract.address,
|
|
164
|
+
abi: feedRegistryContract.abi,
|
|
165
|
+
functionName: 'latestRoundData',
|
|
166
|
+
args: [getAssetInfo('syrupUSDT', network).address, getAssetInfo('USDT', network).address],
|
|
167
|
+
},
|
|
168
|
+
];
|
|
169
|
+
return calls;
|
|
170
|
+
};
|
|
171
|
+
export const getWstUSRChainLinkPriceCalls = (client, network) => {
|
|
172
|
+
const feedRegistryContract = DFSFeedRegistryContractViem(client, network);
|
|
173
|
+
const calls = [
|
|
174
|
+
{
|
|
175
|
+
address: feedRegistryContract.address,
|
|
176
|
+
abi: feedRegistryContract.abi,
|
|
177
|
+
functionName: 'latestRoundData',
|
|
178
|
+
args: [getAssetInfo('USR', network).address, USD_QUOTE],
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
address: feedRegistryContract.address,
|
|
182
|
+
abi: feedRegistryContract.abi,
|
|
183
|
+
functionName: 'latestRoundData',
|
|
184
|
+
args: [getAssetInfo('wstUSR', network).address, getAssetInfo('USR', network).address],
|
|
185
|
+
},
|
|
186
|
+
];
|
|
187
|
+
return calls;
|
|
188
|
+
};
|
|
104
189
|
export const parseWstETHPriceCalls = (_ethPrice, wstETHrateAnswer, decimals) => {
|
|
105
190
|
const ethPrice = new Dec(_ethPrice).div(1e8);
|
|
106
191
|
const wstETHRate = getEthAmountForDecimals(wstETHrateAnswer, decimals);
|
|
107
192
|
return { ethPrice, wstETHRate };
|
|
108
193
|
};
|
|
194
|
+
export const parseWrsETHPriceCalls = (ethPriceAnswer, wrsETHrateAnswer) => {
|
|
195
|
+
const ethPrice = new Dec(ethPriceAnswer).div(1e8);
|
|
196
|
+
const wrsETHRate = new Dec(wrsETHrateAnswer).div(1e18);
|
|
197
|
+
return { ethPrice, wrsETHRate };
|
|
198
|
+
};
|
|
199
|
+
export const parseSyrupUSDTPriceCalls = (usdtPriceAnswer, syrupUSDTRateAnswer) => {
|
|
200
|
+
const syrupUSDTRate = new Dec(syrupUSDTRateAnswer).div(1e8);
|
|
201
|
+
const USDTRate = new Dec(usdtPriceAnswer).div(1e18);
|
|
202
|
+
return { syrupUSDTRate, USDTRate };
|
|
203
|
+
};
|
|
204
|
+
export const parseWstUSRPriceCalls = (usrPrice, _wstUSRRate) => {
|
|
205
|
+
const wstUSRRate = new Dec(_wstUSRRate).div(1e8);
|
|
206
|
+
const USRRate = new Dec(usrPrice).div(1e18);
|
|
207
|
+
return { wstUSRRate, USRRate };
|
|
208
|
+
};
|
|
109
209
|
export const parseWeETHPriceCalls = (_ethPrice, weETHrateAnswer, decimals) => {
|
|
110
210
|
const ethPrice = new Dec(_ethPrice).div(1e8);
|
|
111
211
|
const weETHRate = getEthAmountForDecimals(weETHrateAnswer, decimals);
|
package/esm/types/fluid.d.ts
CHANGED
|
@@ -153,7 +153,7 @@ export declare enum FluidPlasmaVersions {
|
|
|
153
153
|
FLUID_XAUT_USDE_8_PLASMA = "FLUID_XAUT_USDE_8_PLASMA",
|
|
154
154
|
FLUID_USDE_USDT_9_PLASMA = "FLUID_USDE_USDT_9_PLASMA",
|
|
155
155
|
FLUID_USDAI_USDT_10_PLASMA = "FLUID_USDAI_USDT_10_PLASMA",
|
|
156
|
-
|
|
156
|
+
FLUID_ETH_WEETH_ETH_11_PLASMA = "FLUID_ETH_WEETH_ETH_11_PLASMA",
|
|
157
157
|
FLUID_SUSDE_USDT_USDT_12_PLASMA = "FLUID_SUSDE_USDT_USDT_12_PLASMA",
|
|
158
158
|
FLUID_USDE_USDT_USDT_13_PLASMA = "FLUID_USDE_USDT_USDT_13_PLASMA",
|
|
159
159
|
FLUID_USDAI_USDT_USDT_14_PLASMA = "FLUID_USDAI_USDT_USDT_14_PLASMA",
|
package/esm/types/fluid.js
CHANGED
|
@@ -137,7 +137,7 @@ export var FluidPlasmaVersions;
|
|
|
137
137
|
FluidPlasmaVersions["FLUID_XAUT_USDE_8_PLASMA"] = "FLUID_XAUT_USDE_8_PLASMA";
|
|
138
138
|
FluidPlasmaVersions["FLUID_USDE_USDT_9_PLASMA"] = "FLUID_USDE_USDT_9_PLASMA";
|
|
139
139
|
FluidPlasmaVersions["FLUID_USDAI_USDT_10_PLASMA"] = "FLUID_USDAI_USDT_10_PLASMA";
|
|
140
|
-
FluidPlasmaVersions["
|
|
140
|
+
FluidPlasmaVersions["FLUID_ETH_WEETH_ETH_11_PLASMA"] = "FLUID_ETH_WEETH_ETH_11_PLASMA";
|
|
141
141
|
FluidPlasmaVersions["FLUID_SUSDE_USDT_USDT_12_PLASMA"] = "FLUID_SUSDE_USDT_USDT_12_PLASMA";
|
|
142
142
|
FluidPlasmaVersions["FLUID_USDE_USDT_USDT_13_PLASMA"] = "FLUID_USDE_USDT_USDT_13_PLASMA";
|
|
143
143
|
FluidPlasmaVersions["FLUID_USDAI_USDT_USDT_14_PLASMA"] = "FLUID_USDAI_USDT_USDT_14_PLASMA";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defisaver/positions-sdk",
|
|
3
|
-
"version": "2.1.13-dev-plasma-
|
|
3
|
+
"version": "2.1.13-dev-plasma-fluid6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "ISC",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@defisaver/tokens": "^1.7.
|
|
24
|
+
"@defisaver/tokens": "^1.7.8",
|
|
25
25
|
"@types/lodash": "^4.17.15",
|
|
26
26
|
"@types/memoizee": "^0.4.12",
|
|
27
27
|
"decimal.js": "^10.6.0",
|