@curvefi/api 2.22.0 → 2.24.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/README.md +3 -1
- package/lib/constants/abis/factory-v2/MetaSbtc2.json +1011 -0
- package/lib/constants/abis/factory-v2/MetaSbtc2Balance.json +1024 -0
- package/lib/constants/abis/sbtc2/meta_zap.json +164 -0
- package/lib/constants/abis/sbtc2/swap.json +829 -0
- package/lib/constants/pools/ethereum.js +25 -0
- package/lib/curve.js +19 -16
- package/lib/factory/constants.js +49 -38
- package/lib/factory/factory-api.d.ts +2 -1
- package/lib/factory/factory-api.js +54 -30
- package/lib/factory/factory.js +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +1 -0
- package/lib/interfaces.d.ts +1 -1
- package/lib/router.d.ts +3 -1
- package/lib/router.js +79 -53
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1020,8 +1020,10 @@ import curve from "@curvefi/api";
|
|
|
1020
1020
|
// ]
|
|
1021
1021
|
const swapTx = await curve.router.swap('DAI', 'CRV', '1000');
|
|
1022
1022
|
// OR const swapTx = await curve.router.swap('0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xD533a949740bb3306d119CC777fa900bA034cd52', '1000');
|
|
1023
|
-
console.log(swapTx);
|
|
1023
|
+
console.log(swapTx.hash);
|
|
1024
1024
|
// 0xc7ba1d60871c0295ac5471bb602c37ec0f00a71543b3a041308ebd91833f26ba
|
|
1025
|
+
const swappedAmount = await curve.router.getSwappedAmount(swapTx, 'CRV');
|
|
1026
|
+
// 1573.668171170839785062
|
|
1025
1027
|
|
|
1026
1028
|
await curve.getBalances(['DAI', 'CRV']);
|
|
1027
1029
|
// [ '8900.0', '100428.626463428100672494' ]
|