@compass-labs/api-sdk 0.0.23 → 0.0.25
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 +2 -0
- package/bin/mcp-server.js +720 -418
- package/bin/mcp-server.js.map +33 -34
- package/dist/commonjs/funcs/transactionBatchingAaveLoop.d.ts +27 -0
- package/dist/commonjs/funcs/transactionBatchingAaveLoop.d.ts.map +1 -0
- package/dist/commonjs/funcs/transactionBatchingAaveLoop.js +126 -0
- package/dist/commonjs/funcs/transactionBatchingAaveLoop.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/transactionBatchingAaveLoop.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/transactionBatchingAaveLoop.d.ts.map +1 -0
- package/dist/commonjs/{models/components/action.js → mcp-server/tools/transactionBatchingAaveLoop.js} +35 -27
- package/dist/commonjs/mcp-server/tools/transactionBatchingAaveLoop.js.map +1 -0
- package/dist/commonjs/models/components/aavehistoricaltransactionsresponse.d.ts +92 -5
- package/dist/commonjs/models/components/aavehistoricaltransactionsresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/aavehistoricaltransactionsresponse.js +121 -6
- package/dist/commonjs/models/components/aavehistoricaltransactionsresponse.js.map +1 -1
- package/dist/commonjs/models/components/aavelooprequest.d.ts +109 -0
- package/dist/commonjs/models/components/aavelooprequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/aavelooprequest.js +132 -0
- package/dist/commonjs/models/components/aavelooprequest.js.map +1 -0
- package/dist/commonjs/models/components/borrow.d.ts +69 -12
- package/dist/commonjs/models/components/borrow.d.ts.map +1 -1
- package/dist/commonjs/models/components/borrow.js +39 -13
- package/dist/commonjs/models/components/borrow.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +1 -4
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -4
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/liquidationcall.d.ts +32 -14
- package/dist/commonjs/models/components/liquidationcall.d.ts.map +1 -1
- package/dist/commonjs/models/components/liquidationcall.js +23 -14
- package/dist/commonjs/models/components/liquidationcall.js.map +1 -1
- package/dist/commonjs/models/components/morphoborrowrequest.d.ts +27 -5
- package/dist/commonjs/models/components/morphoborrowrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/morphoborrowrequest.js +22 -4
- package/dist/commonjs/models/components/morphoborrowrequest.js.map +1 -1
- package/dist/commonjs/models/components/morphodepositrequest.d.ts +27 -5
- package/dist/commonjs/models/components/morphodepositrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/morphodepositrequest.js +22 -4
- package/dist/commonjs/models/components/morphodepositrequest.js.map +1 -1
- package/dist/commonjs/models/components/morphorepayrequest.d.ts +27 -5
- package/dist/commonjs/models/components/morphorepayrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/morphorepayrequest.js +22 -4
- package/dist/commonjs/models/components/morphorepayrequest.js.map +1 -1
- package/dist/commonjs/models/components/morphosetvaultallowancerequest.d.ts +27 -5
- package/dist/commonjs/models/components/morphosetvaultallowancerequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/morphosetvaultallowancerequest.js +22 -4
- package/dist/commonjs/models/components/morphosetvaultallowancerequest.js.map +1 -1
- package/dist/commonjs/models/components/morphosupplycollateralrequest.d.ts +27 -5
- package/dist/commonjs/models/components/morphosupplycollateralrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/morphosupplycollateralrequest.js +22 -4
- package/dist/commonjs/models/components/morphosupplycollateralrequest.js.map +1 -1
- package/dist/commonjs/models/components/morphowithdrawcollateralrequest.d.ts +27 -5
- package/dist/commonjs/models/components/morphowithdrawcollateralrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/morphowithdrawcollateralrequest.js +22 -4
- package/dist/commonjs/models/components/morphowithdrawcollateralrequest.js.map +1 -1
- package/dist/commonjs/models/components/morphowithdrawrequest.d.ts +27 -5
- package/dist/commonjs/models/components/morphowithdrawrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/morphowithdrawrequest.js +22 -4
- package/dist/commonjs/models/components/morphowithdrawrequest.js.map +1 -1
- package/dist/commonjs/models/components/redeemunderlying.d.ts +32 -4
- package/dist/commonjs/models/components/redeemunderlying.d.ts.map +1 -1
- package/dist/commonjs/models/components/redeemunderlying.js +14 -4
- package/dist/commonjs/models/components/redeemunderlying.js.map +1 -1
- package/dist/commonjs/models/components/repay.d.ts +29 -4
- package/dist/commonjs/models/components/repay.d.ts.map +1 -1
- package/dist/commonjs/models/components/repay.js +14 -4
- package/dist/commonjs/models/components/repay.js.map +1 -1
- package/dist/commonjs/models/components/reserve.d.ts +25 -3
- package/dist/commonjs/models/components/reserve.d.ts.map +1 -1
- package/dist/commonjs/models/components/reserve.js +9 -4
- package/dist/commonjs/models/components/reserve.js.map +1 -1
- package/dist/commonjs/models/components/supply.d.ts +32 -4
- package/dist/commonjs/models/components/supply.d.ts.map +1 -1
- package/dist/commonjs/models/components/supply.js +14 -4
- package/dist/commonjs/models/components/supply.js.map +1 -1
- package/dist/commonjs/models/components/swapborrowrate.d.ts +27 -8
- package/dist/commonjs/models/components/swapborrowrate.d.ts.map +1 -1
- package/dist/commonjs/models/components/swapborrowrate.js +18 -8
- package/dist/commonjs/models/components/swapborrowrate.js.map +1 -1
- package/dist/commonjs/models/components/uniswapbuyexactlyparams.d.ts +15 -15
- package/dist/commonjs/models/components/uniswapbuyexactlyparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/uniswapbuyexactlyparams.js +18 -20
- package/dist/commonjs/models/components/uniswapbuyexactlyparams.js.map +1 -1
- package/dist/commonjs/models/components/uniswapbuyexactlyrequest.d.ts +15 -15
- package/dist/commonjs/models/components/uniswapbuyexactlyrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/uniswapbuyexactlyrequest.js +18 -20
- package/dist/commonjs/models/components/uniswapbuyexactlyrequest.js.map +1 -1
- package/dist/commonjs/models/components/usageascollateral.d.ts +26 -4
- package/dist/commonjs/models/components/usageascollateral.d.ts.map +1 -1
- package/dist/commonjs/models/components/usageascollateral.js +14 -4
- package/dist/commonjs/models/components/usageascollateral.js.map +1 -1
- package/dist/commonjs/models/operations/morphomarketposition.d.ts +3 -15
- package/dist/commonjs/models/operations/morphomarketposition.d.ts.map +1 -1
- package/dist/commonjs/models/operations/morphomarketposition.js +1 -5
- package/dist/commonjs/models/operations/morphomarketposition.js.map +1 -1
- package/dist/commonjs/models/operations/morphomarkets.d.ts +3 -15
- package/dist/commonjs/models/operations/morphomarkets.d.ts.map +1 -1
- package/dist/commonjs/models/operations/morphomarkets.js +1 -5
- package/dist/commonjs/models/operations/morphomarkets.js.map +1 -1
- package/dist/commonjs/models/operations/morphovaultposition.d.ts +3 -15
- package/dist/commonjs/models/operations/morphovaultposition.d.ts.map +1 -1
- package/dist/commonjs/models/operations/morphovaultposition.js +1 -5
- package/dist/commonjs/models/operations/morphovaultposition.js.map +1 -1
- package/dist/commonjs/models/operations/morphovaults.d.ts +5 -17
- package/dist/commonjs/models/operations/morphovaults.d.ts.map +1 -1
- package/dist/commonjs/models/operations/morphovaults.js +3 -7
- package/dist/commonjs/models/operations/morphovaults.js.map +1 -1
- package/dist/commonjs/sdk/transactionbatching.d.ts +17 -0
- package/dist/commonjs/sdk/transactionbatching.d.ts.map +1 -1
- package/dist/commonjs/sdk/transactionbatching.js +20 -0
- package/dist/commonjs/sdk/transactionbatching.js.map +1 -1
- package/dist/esm/funcs/transactionBatchingAaveLoop.d.ts +27 -0
- package/dist/esm/funcs/transactionBatchingAaveLoop.d.ts.map +1 -0
- package/dist/esm/funcs/transactionBatchingAaveLoop.js +90 -0
- package/dist/esm/funcs/transactionBatchingAaveLoop.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/transactionBatchingAaveLoop.d.ts +8 -0
- package/dist/esm/mcp-server/tools/transactionBatchingAaveLoop.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/transactionBatchingAaveLoop.js +38 -0
- package/dist/esm/mcp-server/tools/transactionBatchingAaveLoop.js.map +1 -0
- package/dist/esm/models/components/aavehistoricaltransactionsresponse.d.ts +92 -5
- package/dist/esm/models/components/aavehistoricaltransactionsresponse.d.ts.map +1 -1
- package/dist/esm/models/components/aavehistoricaltransactionsresponse.js +118 -5
- package/dist/esm/models/components/aavehistoricaltransactionsresponse.js.map +1 -1
- package/dist/esm/models/components/aavelooprequest.d.ts +109 -0
- package/dist/esm/models/components/aavelooprequest.d.ts.map +1 -0
- package/dist/esm/models/components/aavelooprequest.js +92 -0
- package/dist/esm/models/components/aavelooprequest.js.map +1 -0
- package/dist/esm/models/components/borrow.d.ts +69 -12
- package/dist/esm/models/components/borrow.d.ts.map +1 -1
- package/dist/esm/models/components/borrow.js +38 -12
- package/dist/esm/models/components/borrow.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +1 -4
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -4
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/liquidationcall.d.ts +32 -14
- package/dist/esm/models/components/liquidationcall.d.ts.map +1 -1
- package/dist/esm/models/components/liquidationcall.js +23 -14
- package/dist/esm/models/components/liquidationcall.js.map +1 -1
- package/dist/esm/models/components/morphoborrowrequest.d.ts +27 -5
- package/dist/esm/models/components/morphoborrowrequest.d.ts.map +1 -1
- package/dist/esm/models/components/morphoborrowrequest.js +21 -3
- package/dist/esm/models/components/morphoborrowrequest.js.map +1 -1
- package/dist/esm/models/components/morphodepositrequest.d.ts +27 -5
- package/dist/esm/models/components/morphodepositrequest.d.ts.map +1 -1
- package/dist/esm/models/components/morphodepositrequest.js +21 -3
- package/dist/esm/models/components/morphodepositrequest.js.map +1 -1
- package/dist/esm/models/components/morphorepayrequest.d.ts +27 -5
- package/dist/esm/models/components/morphorepayrequest.d.ts.map +1 -1
- package/dist/esm/models/components/morphorepayrequest.js +21 -3
- package/dist/esm/models/components/morphorepayrequest.js.map +1 -1
- package/dist/esm/models/components/morphosetvaultallowancerequest.d.ts +27 -5
- package/dist/esm/models/components/morphosetvaultallowancerequest.d.ts.map +1 -1
- package/dist/esm/models/components/morphosetvaultallowancerequest.js +21 -3
- package/dist/esm/models/components/morphosetvaultallowancerequest.js.map +1 -1
- package/dist/esm/models/components/morphosupplycollateralrequest.d.ts +27 -5
- package/dist/esm/models/components/morphosupplycollateralrequest.d.ts.map +1 -1
- package/dist/esm/models/components/morphosupplycollateralrequest.js +21 -3
- package/dist/esm/models/components/morphosupplycollateralrequest.js.map +1 -1
- package/dist/esm/models/components/morphowithdrawcollateralrequest.d.ts +27 -5
- package/dist/esm/models/components/morphowithdrawcollateralrequest.d.ts.map +1 -1
- package/dist/esm/models/components/morphowithdrawcollateralrequest.js +21 -3
- package/dist/esm/models/components/morphowithdrawcollateralrequest.js.map +1 -1
- package/dist/esm/models/components/morphowithdrawrequest.d.ts +27 -5
- package/dist/esm/models/components/morphowithdrawrequest.d.ts.map +1 -1
- package/dist/esm/models/components/morphowithdrawrequest.js +21 -3
- package/dist/esm/models/components/morphowithdrawrequest.js.map +1 -1
- package/dist/esm/models/components/redeemunderlying.d.ts +32 -4
- package/dist/esm/models/components/redeemunderlying.d.ts.map +1 -1
- package/dist/esm/models/components/redeemunderlying.js +14 -4
- package/dist/esm/models/components/redeemunderlying.js.map +1 -1
- package/dist/esm/models/components/repay.d.ts +29 -4
- package/dist/esm/models/components/repay.d.ts.map +1 -1
- package/dist/esm/models/components/repay.js +14 -4
- package/dist/esm/models/components/repay.js.map +1 -1
- package/dist/esm/models/components/reserve.d.ts +25 -3
- package/dist/esm/models/components/reserve.d.ts.map +1 -1
- package/dist/esm/models/components/reserve.js +9 -4
- package/dist/esm/models/components/reserve.js.map +1 -1
- package/dist/esm/models/components/supply.d.ts +32 -4
- package/dist/esm/models/components/supply.d.ts.map +1 -1
- package/dist/esm/models/components/supply.js +14 -4
- package/dist/esm/models/components/supply.js.map +1 -1
- package/dist/esm/models/components/swapborrowrate.d.ts +27 -8
- package/dist/esm/models/components/swapborrowrate.d.ts.map +1 -1
- package/dist/esm/models/components/swapborrowrate.js +18 -8
- package/dist/esm/models/components/swapborrowrate.js.map +1 -1
- package/dist/esm/models/components/uniswapbuyexactlyparams.d.ts +15 -15
- package/dist/esm/models/components/uniswapbuyexactlyparams.d.ts.map +1 -1
- package/dist/esm/models/components/uniswapbuyexactlyparams.js +15 -17
- package/dist/esm/models/components/uniswapbuyexactlyparams.js.map +1 -1
- package/dist/esm/models/components/uniswapbuyexactlyrequest.d.ts +15 -15
- package/dist/esm/models/components/uniswapbuyexactlyrequest.d.ts.map +1 -1
- package/dist/esm/models/components/uniswapbuyexactlyrequest.js +15 -17
- package/dist/esm/models/components/uniswapbuyexactlyrequest.js.map +1 -1
- package/dist/esm/models/components/usageascollateral.d.ts +26 -4
- package/dist/esm/models/components/usageascollateral.d.ts.map +1 -1
- package/dist/esm/models/components/usageascollateral.js +14 -4
- package/dist/esm/models/components/usageascollateral.js.map +1 -1
- package/dist/esm/models/operations/morphomarketposition.d.ts +3 -15
- package/dist/esm/models/operations/morphomarketposition.d.ts.map +1 -1
- package/dist/esm/models/operations/morphomarketposition.js +1 -5
- package/dist/esm/models/operations/morphomarketposition.js.map +1 -1
- package/dist/esm/models/operations/morphomarkets.d.ts +3 -15
- package/dist/esm/models/operations/morphomarkets.d.ts.map +1 -1
- package/dist/esm/models/operations/morphomarkets.js +1 -5
- package/dist/esm/models/operations/morphomarkets.js.map +1 -1
- package/dist/esm/models/operations/morphovaultposition.d.ts +3 -15
- package/dist/esm/models/operations/morphovaultposition.d.ts.map +1 -1
- package/dist/esm/models/operations/morphovaultposition.js +1 -5
- package/dist/esm/models/operations/morphovaultposition.js.map +1 -1
- package/dist/esm/models/operations/morphovaults.d.ts +5 -17
- package/dist/esm/models/operations/morphovaults.d.ts.map +1 -1
- package/dist/esm/models/operations/morphovaults.js +3 -7
- package/dist/esm/models/operations/morphovaults.js.map +1 -1
- package/dist/esm/sdk/transactionbatching.d.ts +17 -0
- package/dist/esm/sdk/transactionbatching.d.ts.map +1 -1
- package/dist/esm/sdk/transactionbatching.js +20 -0
- package/dist/esm/sdk/transactionbatching.js.map +1 -1
- package/docs/sdks/morpho/README.md +8 -18
- package/docs/sdks/transactionbatching/README.md +120 -2
- package/docs/sdks/uniswapv3/README.md +2 -2
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/transactionBatchingAaveLoop.ts +173 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/transactionBatchingAaveLoop.ts +47 -0
- package/src/models/components/aavehistoricaltransactionsresponse.ts +275 -13
- package/src/models/components/aavelooprequest.ts +219 -0
- package/src/models/components/borrow.ts +87 -24
- package/src/models/components/index.ts +1 -4
- package/src/models/components/liquidationcall.ts +58 -35
- package/src/models/components/morphoborrowrequest.ts +33 -7
- package/src/models/components/morphodepositrequest.ts +33 -7
- package/src/models/components/morphorepayrequest.ts +33 -7
- package/src/models/components/morphosetvaultallowancerequest.ts +35 -7
- package/src/models/components/morphosupplycollateralrequest.ts +34 -7
- package/src/models/components/morphowithdrawcollateralrequest.ts +36 -7
- package/src/models/components/morphowithdrawrequest.ts +33 -7
- package/src/models/components/redeemunderlying.ts +46 -8
- package/src/models/components/repay.ts +43 -8
- package/src/models/components/reserve.ts +37 -7
- package/src/models/components/supply.ts +46 -8
- package/src/models/components/swapborrowrate.ts +45 -16
- package/src/models/components/uniswapbuyexactlyparams.ts +26 -28
- package/src/models/components/uniswapbuyexactlyrequest.ts +26 -29
- package/src/models/components/usageascollateral.ts +40 -8
- package/src/models/operations/morphomarketposition.ts +1 -11
- package/src/models/operations/morphomarkets.ts +1 -11
- package/src/models/operations/morphovaultposition.ts +1 -11
- package/src/models/operations/morphovaults.ts +5 -15
- package/src/sdk/transactionbatching.ts +28 -0
- package/dist/commonjs/models/components/aavehistoricaltransactionbase.d.ts +0 -57
- package/dist/commonjs/models/components/aavehistoricaltransactionbase.d.ts.map +0 -1
- package/dist/commonjs/models/components/aavehistoricaltransactionbase.js +0 -97
- package/dist/commonjs/models/components/aavehistoricaltransactionbase.js.map +0 -1
- package/dist/commonjs/models/components/action.d.ts +0 -43
- package/dist/commonjs/models/components/action.d.ts.map +0 -1
- package/dist/commonjs/models/components/action.js.map +0 -1
- package/dist/commonjs/models/components/collateralreserve.d.ts +0 -31
- package/dist/commonjs/models/components/collateralreserve.d.ts.map +0 -1
- package/dist/commonjs/models/components/collateralreserve.js +0 -71
- package/dist/commonjs/models/components/collateralreserve.js.map +0 -1
- package/dist/commonjs/models/components/principalreserve.d.ts +0 -31
- package/dist/commonjs/models/components/principalreserve.d.ts.map +0 -1
- package/dist/commonjs/models/components/principalreserve.js +0 -71
- package/dist/commonjs/models/components/principalreserve.js.map +0 -1
- package/dist/esm/models/components/aavehistoricaltransactionbase.d.ts +0 -57
- package/dist/esm/models/components/aavehistoricaltransactionbase.d.ts.map +0 -1
- package/dist/esm/models/components/aavehistoricaltransactionbase.js +0 -59
- package/dist/esm/models/components/aavehistoricaltransactionbase.js.map +0 -1
- package/dist/esm/models/components/action.d.ts +0 -43
- package/dist/esm/models/components/action.d.ts.map +0 -1
- package/dist/esm/models/components/action.js +0 -30
- package/dist/esm/models/components/action.js.map +0 -1
- package/dist/esm/models/components/collateralreserve.d.ts +0 -31
- package/dist/esm/models/components/collateralreserve.d.ts.map +0 -1
- package/dist/esm/models/components/collateralreserve.js +0 -33
- package/dist/esm/models/components/collateralreserve.js.map +0 -1
- package/dist/esm/models/components/principalreserve.d.ts +0 -31
- package/dist/esm/models/components/principalreserve.d.ts.map +0 -1
- package/dist/esm/models/components/principalreserve.js +0 -33
- package/dist/esm/models/components/principalreserve.js.map +0 -1
- package/src/models/components/aavehistoricaltransactionbase.ts +0 -155
- package/src/models/components/action.ts +0 -36
- package/src/models/components/collateralreserve.ts +0 -70
- package/src/models/components/principalreserve.ts +0 -70
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
* [authorization](#authorization) - Get EIP-7702 Authorization
|
|
9
9
|
* [execute](#execute) - Execute Tx Batching
|
|
10
|
+
* [aaveLoop](#aaveloop) - Execute Aave Loop Strategy
|
|
10
11
|
|
|
11
12
|
## authorization
|
|
12
13
|
|
|
@@ -129,7 +130,7 @@ async function run() {
|
|
|
129
130
|
tokenIn: "WETH",
|
|
130
131
|
tokenOut: "USDC",
|
|
131
132
|
fee: "0.01",
|
|
132
|
-
|
|
133
|
+
amount: 1.5,
|
|
133
134
|
maxSlippagePercent: 0.5,
|
|
134
135
|
wrapEth: true,
|
|
135
136
|
},
|
|
@@ -177,7 +178,7 @@ async function run() {
|
|
|
177
178
|
tokenIn: "WETH",
|
|
178
179
|
tokenOut: "USDC",
|
|
179
180
|
fee: "0.01",
|
|
180
|
-
|
|
181
|
+
amount: 1.5,
|
|
181
182
|
maxSlippagePercent: 0.5,
|
|
182
183
|
wrapEth: true,
|
|
183
184
|
},
|
|
@@ -213,6 +214,123 @@ run();
|
|
|
213
214
|
|
|
214
215
|
### Errors
|
|
215
216
|
|
|
217
|
+
| Error Type | Status Code | Content Type |
|
|
218
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
219
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
220
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
221
|
+
|
|
222
|
+
## aaveLoop
|
|
223
|
+
|
|
224
|
+
Execute an Aave looping strategy that involves repeated supply and borrow
|
|
225
|
+
operations.
|
|
226
|
+
|
|
227
|
+
This endpoint creates a multicall transaction that performs a series of operations:
|
|
228
|
+
1. Approves and supplies initial token
|
|
229
|
+
2. For each loop:
|
|
230
|
+
- Borrows another token
|
|
231
|
+
- Swaps borrowed token back to supply token
|
|
232
|
+
- Supplies the swapped tokens
|
|
233
|
+
|
|
234
|
+
The transaction must be authorized using the /authorization endpoint to prevent replay attacks.
|
|
235
|
+
|
|
236
|
+
### Example Usage
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
240
|
+
|
|
241
|
+
const compassApiSDK = new CompassApiSDK({
|
|
242
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
async function run() {
|
|
246
|
+
const result = await compassApiSDK.transactionBatching.aaveLoop({
|
|
247
|
+
chain: "ethereum:mainnet",
|
|
248
|
+
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
249
|
+
signedAuthorization: {
|
|
250
|
+
nonce: 1000,
|
|
251
|
+
address: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
|
252
|
+
chainId: 42161,
|
|
253
|
+
r: 4.3251085460800106e+76,
|
|
254
|
+
s: 5.471500338403868e+76,
|
|
255
|
+
yParity: 0,
|
|
256
|
+
},
|
|
257
|
+
collateralToken: "osETH",
|
|
258
|
+
borrowToken: "sDAI",
|
|
259
|
+
collateralAmount: "1000",
|
|
260
|
+
loopCount: 2,
|
|
261
|
+
maxSlippagePercent: 0.5,
|
|
262
|
+
loanToValue: 20.5,
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
// Handle the result
|
|
266
|
+
console.log(result);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
run();
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Standalone function
|
|
273
|
+
|
|
274
|
+
The standalone function version of this method:
|
|
275
|
+
|
|
276
|
+
```typescript
|
|
277
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
278
|
+
import { transactionBatchingAaveLoop } from "@compass-labs/api-sdk/funcs/transactionBatchingAaveLoop.js";
|
|
279
|
+
|
|
280
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
281
|
+
// You can create one instance of it to use across an application.
|
|
282
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
283
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
async function run() {
|
|
287
|
+
const res = await transactionBatchingAaveLoop(compassApiSDK, {
|
|
288
|
+
chain: "ethereum:mainnet",
|
|
289
|
+
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
290
|
+
signedAuthorization: {
|
|
291
|
+
nonce: 1000,
|
|
292
|
+
address: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
|
293
|
+
chainId: 42161,
|
|
294
|
+
r: 4.3251085460800106e+76,
|
|
295
|
+
s: 5.471500338403868e+76,
|
|
296
|
+
yParity: 0,
|
|
297
|
+
},
|
|
298
|
+
collateralToken: "osETH",
|
|
299
|
+
borrowToken: "sDAI",
|
|
300
|
+
collateralAmount: "1000",
|
|
301
|
+
loopCount: 2,
|
|
302
|
+
maxSlippagePercent: 0.5,
|
|
303
|
+
loanToValue: 20.5,
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
if (!res.ok) {
|
|
307
|
+
throw res.error;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const { value: result } = res;
|
|
311
|
+
|
|
312
|
+
// Handle the result
|
|
313
|
+
console.log(result);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
run();
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Parameters
|
|
320
|
+
|
|
321
|
+
| Parameter | Type | Required | Description |
|
|
322
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
323
|
+
| `request` | [components.AaveLoopRequest](../../models/components/aavelooprequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
324
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
325
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
326
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
327
|
+
|
|
328
|
+
### Response
|
|
329
|
+
|
|
330
|
+
**Promise\<[components.UnsignedMulticallTransaction](../../models/components/unsignedmulticalltransaction.md)\>**
|
|
331
|
+
|
|
332
|
+
### Errors
|
|
333
|
+
|
|
216
334
|
| Error Type | Status Code | Content Type |
|
|
217
335
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
218
336
|
| errors.HTTPValidationError | 422 | application/json |
|
|
@@ -472,7 +472,7 @@ async function run() {
|
|
|
472
472
|
tokenIn: "SNX",
|
|
473
473
|
tokenOut: "cbETH",
|
|
474
474
|
fee: "1.0",
|
|
475
|
-
|
|
475
|
+
amount: 1.5,
|
|
476
476
|
maxSlippagePercent: 0.5,
|
|
477
477
|
chain: "ethereum:mainnet",
|
|
478
478
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
@@ -504,7 +504,7 @@ async function run() {
|
|
|
504
504
|
tokenIn: "SNX",
|
|
505
505
|
tokenOut: "cbETH",
|
|
506
506
|
fee: "1.0",
|
|
507
|
-
|
|
507
|
+
amount: 1.5,
|
|
508
508
|
maxSlippagePercent: 0.5,
|
|
509
509
|
chain: "ethereum:mainnet",
|
|
510
510
|
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CompassApiSDKCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Execute Aave Loop Strategy
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Execute an Aave looping strategy that involves repeated supply and borrow
|
|
32
|
+
* operations.
|
|
33
|
+
*
|
|
34
|
+
* This endpoint creates a multicall transaction that performs a series of operations:
|
|
35
|
+
* 1. Approves and supplies initial token
|
|
36
|
+
* 2. For each loop:
|
|
37
|
+
* - Borrows another token
|
|
38
|
+
* - Swaps borrowed token back to supply token
|
|
39
|
+
* - Supplies the swapped tokens
|
|
40
|
+
*
|
|
41
|
+
* The transaction must be authorized using the /authorization endpoint to prevent replay attacks.
|
|
42
|
+
*/
|
|
43
|
+
export function transactionBatchingAaveLoop(
|
|
44
|
+
client: CompassApiSDKCore,
|
|
45
|
+
request: components.AaveLoopRequest,
|
|
46
|
+
options?: RequestOptions,
|
|
47
|
+
): APIPromise<
|
|
48
|
+
Result<
|
|
49
|
+
components.UnsignedMulticallTransaction,
|
|
50
|
+
| errors.HTTPValidationError
|
|
51
|
+
| APIError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
| UnexpectedClientError
|
|
54
|
+
| InvalidRequestError
|
|
55
|
+
| RequestAbortedError
|
|
56
|
+
| RequestTimeoutError
|
|
57
|
+
| ConnectionError
|
|
58
|
+
>
|
|
59
|
+
> {
|
|
60
|
+
return new APIPromise($do(
|
|
61
|
+
client,
|
|
62
|
+
request,
|
|
63
|
+
options,
|
|
64
|
+
));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function $do(
|
|
68
|
+
client: CompassApiSDKCore,
|
|
69
|
+
request: components.AaveLoopRequest,
|
|
70
|
+
options?: RequestOptions,
|
|
71
|
+
): Promise<
|
|
72
|
+
[
|
|
73
|
+
Result<
|
|
74
|
+
components.UnsignedMulticallTransaction,
|
|
75
|
+
| errors.HTTPValidationError
|
|
76
|
+
| APIError
|
|
77
|
+
| SDKValidationError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| InvalidRequestError
|
|
80
|
+
| RequestAbortedError
|
|
81
|
+
| RequestTimeoutError
|
|
82
|
+
| ConnectionError
|
|
83
|
+
>,
|
|
84
|
+
APICall,
|
|
85
|
+
]
|
|
86
|
+
> {
|
|
87
|
+
const parsed = safeParse(
|
|
88
|
+
request,
|
|
89
|
+
(value) => components.AaveLoopRequest$outboundSchema.parse(value),
|
|
90
|
+
"Input validation failed",
|
|
91
|
+
);
|
|
92
|
+
if (!parsed.ok) {
|
|
93
|
+
return [parsed, { status: "invalid" }];
|
|
94
|
+
}
|
|
95
|
+
const payload = parsed.value;
|
|
96
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/v0/multicall/aave/loop")();
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
Accept: "application/json",
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
106
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
107
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
108
|
+
|
|
109
|
+
const context = {
|
|
110
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
111
|
+
operationID: "multicall_aave_loop",
|
|
112
|
+
oAuth2Scopes: [],
|
|
113
|
+
|
|
114
|
+
resolvedSecurity: requestSecurity,
|
|
115
|
+
|
|
116
|
+
securitySource: client._options.apiKeyAuth,
|
|
117
|
+
retryConfig: options?.retries
|
|
118
|
+
|| client._options.retryConfig
|
|
119
|
+
|| { strategy: "none" },
|
|
120
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const requestRes = client._createRequest(context, {
|
|
124
|
+
security: requestSecurity,
|
|
125
|
+
method: "POST",
|
|
126
|
+
baseURL: options?.serverURL,
|
|
127
|
+
path: path,
|
|
128
|
+
headers: headers,
|
|
129
|
+
body: body,
|
|
130
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
131
|
+
}, options);
|
|
132
|
+
if (!requestRes.ok) {
|
|
133
|
+
return [requestRes, { status: "invalid" }];
|
|
134
|
+
}
|
|
135
|
+
const req = requestRes.value;
|
|
136
|
+
|
|
137
|
+
const doResult = await client._do(req, {
|
|
138
|
+
context,
|
|
139
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
140
|
+
retryConfig: context.retryConfig,
|
|
141
|
+
retryCodes: context.retryCodes,
|
|
142
|
+
});
|
|
143
|
+
if (!doResult.ok) {
|
|
144
|
+
return [doResult, { status: "request-error", request: req }];
|
|
145
|
+
}
|
|
146
|
+
const response = doResult.value;
|
|
147
|
+
|
|
148
|
+
const responseFields = {
|
|
149
|
+
HttpMeta: { Response: response, Request: req },
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const [result] = await M.match<
|
|
153
|
+
components.UnsignedMulticallTransaction,
|
|
154
|
+
| errors.HTTPValidationError
|
|
155
|
+
| APIError
|
|
156
|
+
| SDKValidationError
|
|
157
|
+
| UnexpectedClientError
|
|
158
|
+
| InvalidRequestError
|
|
159
|
+
| RequestAbortedError
|
|
160
|
+
| RequestTimeoutError
|
|
161
|
+
| ConnectionError
|
|
162
|
+
>(
|
|
163
|
+
M.json(200, components.UnsignedMulticallTransaction$inboundSchema),
|
|
164
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
165
|
+
M.fail("4XX"),
|
|
166
|
+
M.fail("5XX"),
|
|
167
|
+
)(response, { extraFields: responseFields });
|
|
168
|
+
if (!result.ok) {
|
|
169
|
+
return [result, { status: "complete", request: req, response }];
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return [result, { status: "complete", request: req, response }];
|
|
173
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -57,8 +57,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
57
57
|
export const SDK_METADATA = {
|
|
58
58
|
language: "typescript",
|
|
59
59
|
openapiDocVersion: "0.0.1",
|
|
60
|
-
sdkVersion: "0.0.
|
|
61
|
-
genVersion: "2.
|
|
60
|
+
sdkVersion: "0.0.25",
|
|
61
|
+
genVersion: "2.599.0",
|
|
62
62
|
userAgent:
|
|
63
|
-
"speakeasy-sdk/typescript 0.0.
|
|
63
|
+
"speakeasy-sdk/typescript 0.0.25 2.599.0 0.0.1 @compass-labs/api-sdk",
|
|
64
64
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -51,6 +51,7 @@ import { tool$tokenAddress } from "./tools/tokenAddress.js";
|
|
|
51
51
|
import { tool$tokenBalance } from "./tools/tokenBalance.js";
|
|
52
52
|
import { tool$tokenPrice } from "./tools/tokenPrice.js";
|
|
53
53
|
import { tool$tokenTransfer } from "./tools/tokenTransfer.js";
|
|
54
|
+
import { tool$transactionBatchingAaveLoop } from "./tools/transactionBatchingAaveLoop.js";
|
|
54
55
|
import { tool$transactionBatchingAuthorization } from "./tools/transactionBatchingAuthorization.js";
|
|
55
56
|
import { tool$transactionBatchingExecute } from "./tools/transactionBatchingExecute.js";
|
|
56
57
|
import { tool$uniswapV3LiquidityProvisionIncrease } from "./tools/uniswapV3LiquidityProvisionIncrease.js";
|
|
@@ -82,7 +83,7 @@ export function createMCPServer(deps: {
|
|
|
82
83
|
}) {
|
|
83
84
|
const server = new McpServer({
|
|
84
85
|
name: "CompassApiSDK",
|
|
85
|
-
version: "0.0.
|
|
86
|
+
version: "0.0.25",
|
|
86
87
|
});
|
|
87
88
|
|
|
88
89
|
const client = new CompassApiSDKCore({
|
|
@@ -170,6 +171,7 @@ export function createMCPServer(deps: {
|
|
|
170
171
|
tool(tool$universalAllowanceSet);
|
|
171
172
|
tool(tool$transactionBatchingAuthorization);
|
|
172
173
|
tool(tool$transactionBatchingExecute);
|
|
174
|
+
tool(tool$transactionBatchingAaveLoop);
|
|
173
175
|
|
|
174
176
|
return server;
|
|
175
177
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { transactionBatchingAaveLoop } from "../../funcs/transactionBatchingAaveLoop.js";
|
|
6
|
+
import * as components from "../../models/components/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: components.AaveLoopRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$transactionBatchingAaveLoop: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "transaction-batching-aave-loop",
|
|
15
|
+
description: `Execute Aave Loop Strategy
|
|
16
|
+
|
|
17
|
+
Execute an Aave looping strategy that involves repeated supply and borrow
|
|
18
|
+
operations.
|
|
19
|
+
|
|
20
|
+
This endpoint creates a multicall transaction that performs a series of operations:
|
|
21
|
+
1. Approves and supplies initial token
|
|
22
|
+
2. For each loop:
|
|
23
|
+
- Borrows another token
|
|
24
|
+
- Swaps borrowed token back to supply token
|
|
25
|
+
- Supplies the swapped tokens
|
|
26
|
+
|
|
27
|
+
The transaction must be authorized using the /authorization endpoint to prevent replay attacks.`,
|
|
28
|
+
args,
|
|
29
|
+
tool: async (client, args, ctx) => {
|
|
30
|
+
const [result, apiCall] = await transactionBatchingAaveLoop(
|
|
31
|
+
client,
|
|
32
|
+
args.request,
|
|
33
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
34
|
+
).$inspect();
|
|
35
|
+
|
|
36
|
+
if (!result.ok) {
|
|
37
|
+
return {
|
|
38
|
+
content: [{ type: "text", text: result.error.message }],
|
|
39
|
+
isError: true,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const value = result.value;
|
|
44
|
+
|
|
45
|
+
return formatResult(value, apiCall);
|
|
46
|
+
},
|
|
47
|
+
};
|