@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,40 +7,265 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
7
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from "./
|
|
10
|
+
Borrow,
|
|
11
|
+
Borrow$inboundSchema,
|
|
12
|
+
Borrow$Outbound,
|
|
13
|
+
Borrow$outboundSchema,
|
|
14
|
+
} from "./borrow.js";
|
|
15
|
+
import {
|
|
16
|
+
LiquidationCall,
|
|
17
|
+
LiquidationCall$inboundSchema,
|
|
18
|
+
LiquidationCall$Outbound,
|
|
19
|
+
LiquidationCall$outboundSchema,
|
|
20
|
+
} from "./liquidationcall.js";
|
|
21
|
+
import {
|
|
22
|
+
RedeemUnderlying,
|
|
23
|
+
RedeemUnderlying$inboundSchema,
|
|
24
|
+
RedeemUnderlying$Outbound,
|
|
25
|
+
RedeemUnderlying$outboundSchema,
|
|
26
|
+
} from "./redeemunderlying.js";
|
|
27
|
+
import {
|
|
28
|
+
Repay,
|
|
29
|
+
Repay$inboundSchema,
|
|
30
|
+
Repay$Outbound,
|
|
31
|
+
Repay$outboundSchema,
|
|
32
|
+
} from "./repay.js";
|
|
33
|
+
import {
|
|
34
|
+
Supply,
|
|
35
|
+
Supply$inboundSchema,
|
|
36
|
+
Supply$Outbound,
|
|
37
|
+
Supply$outboundSchema,
|
|
38
|
+
} from "./supply.js";
|
|
39
|
+
import {
|
|
40
|
+
SwapBorrowRate,
|
|
41
|
+
SwapBorrowRate$inboundSchema,
|
|
42
|
+
SwapBorrowRate$Outbound,
|
|
43
|
+
SwapBorrowRate$outboundSchema,
|
|
44
|
+
} from "./swapborrowrate.js";
|
|
45
|
+
import {
|
|
46
|
+
UsageAsCollateral,
|
|
47
|
+
UsageAsCollateral$inboundSchema,
|
|
48
|
+
UsageAsCollateral$Outbound,
|
|
49
|
+
UsageAsCollateral$outboundSchema,
|
|
50
|
+
} from "./usageascollateral.js";
|
|
51
|
+
|
|
52
|
+
export type Transaction =
|
|
53
|
+
| (RedeemUnderlying & { action: "RedeemUnderlying" })
|
|
54
|
+
| (Repay & { action: "Repay" })
|
|
55
|
+
| (Supply & { action: "Supply" })
|
|
56
|
+
| (UsageAsCollateral & { action: "UsageAsCollateral" })
|
|
57
|
+
| (Borrow & { action: "Borrow" })
|
|
58
|
+
| (SwapBorrowRate & { action: "SwapBorrowRate" })
|
|
59
|
+
| (LiquidationCall & { action: "LiquidationCall" });
|
|
15
60
|
|
|
16
61
|
/**
|
|
17
62
|
* Response model for getting Aave historical transactions.
|
|
18
63
|
*/
|
|
19
64
|
export type AaveHistoricalTransactionsResponse = {
|
|
20
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Specifies how many transactions to skip before returning results, letting you choose the starting point for the data you want to receive.
|
|
67
|
+
*/
|
|
21
68
|
offset: number;
|
|
69
|
+
/**
|
|
70
|
+
* Sets the maximum number of transactions to include in the response, helping control the size of the returned dataset.
|
|
71
|
+
*/
|
|
22
72
|
limit: number;
|
|
23
|
-
transactions: Array<
|
|
73
|
+
transactions: Array<
|
|
74
|
+
| (RedeemUnderlying & { action: "RedeemUnderlying" })
|
|
75
|
+
| (Repay & { action: "Repay" })
|
|
76
|
+
| (Supply & { action: "Supply" })
|
|
77
|
+
| (UsageAsCollateral & { action: "UsageAsCollateral" })
|
|
78
|
+
| (Borrow & { action: "Borrow" })
|
|
79
|
+
| (SwapBorrowRate & { action: "SwapBorrowRate" })
|
|
80
|
+
| (LiquidationCall & { action: "LiquidationCall" })
|
|
81
|
+
>;
|
|
24
82
|
};
|
|
25
83
|
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const Transaction$inboundSchema: z.ZodType<
|
|
86
|
+
Transaction,
|
|
87
|
+
z.ZodTypeDef,
|
|
88
|
+
unknown
|
|
89
|
+
> = z.union([
|
|
90
|
+
RedeemUnderlying$inboundSchema.and(
|
|
91
|
+
z.object({ action: z.literal("RedeemUnderlying") }).transform((v) => ({
|
|
92
|
+
action: v.action,
|
|
93
|
+
})),
|
|
94
|
+
),
|
|
95
|
+
Repay$inboundSchema.and(
|
|
96
|
+
z.object({ action: z.literal("Repay") }).transform((v) => ({
|
|
97
|
+
action: v.action,
|
|
98
|
+
})),
|
|
99
|
+
),
|
|
100
|
+
Supply$inboundSchema.and(
|
|
101
|
+
z.object({ action: z.literal("Supply") }).transform((v) => ({
|
|
102
|
+
action: v.action,
|
|
103
|
+
})),
|
|
104
|
+
),
|
|
105
|
+
UsageAsCollateral$inboundSchema.and(
|
|
106
|
+
z.object({ action: z.literal("UsageAsCollateral") }).transform((v) => ({
|
|
107
|
+
action: v.action,
|
|
108
|
+
})),
|
|
109
|
+
),
|
|
110
|
+
Borrow$inboundSchema.and(
|
|
111
|
+
z.object({ action: z.literal("Borrow") }).transform((v) => ({
|
|
112
|
+
action: v.action,
|
|
113
|
+
})),
|
|
114
|
+
),
|
|
115
|
+
SwapBorrowRate$inboundSchema.and(
|
|
116
|
+
z.object({ action: z.literal("SwapBorrowRate") }).transform((v) => ({
|
|
117
|
+
action: v.action,
|
|
118
|
+
})),
|
|
119
|
+
),
|
|
120
|
+
LiquidationCall$inboundSchema.and(
|
|
121
|
+
z.object({ action: z.literal("LiquidationCall") }).transform((v) => ({
|
|
122
|
+
action: v.action,
|
|
123
|
+
})),
|
|
124
|
+
),
|
|
125
|
+
]);
|
|
126
|
+
|
|
127
|
+
/** @internal */
|
|
128
|
+
export type Transaction$Outbound =
|
|
129
|
+
| (RedeemUnderlying$Outbound & { action: "RedeemUnderlying" })
|
|
130
|
+
| (Repay$Outbound & { action: "Repay" })
|
|
131
|
+
| (Supply$Outbound & { action: "Supply" })
|
|
132
|
+
| (UsageAsCollateral$Outbound & { action: "UsageAsCollateral" })
|
|
133
|
+
| (Borrow$Outbound & { action: "Borrow" })
|
|
134
|
+
| (SwapBorrowRate$Outbound & { action: "SwapBorrowRate" })
|
|
135
|
+
| (LiquidationCall$Outbound & { action: "LiquidationCall" });
|
|
136
|
+
|
|
137
|
+
/** @internal */
|
|
138
|
+
export const Transaction$outboundSchema: z.ZodType<
|
|
139
|
+
Transaction$Outbound,
|
|
140
|
+
z.ZodTypeDef,
|
|
141
|
+
Transaction
|
|
142
|
+
> = z.union([
|
|
143
|
+
RedeemUnderlying$outboundSchema.and(
|
|
144
|
+
z.object({ action: z.literal("RedeemUnderlying") }).transform((v) => ({
|
|
145
|
+
action: v.action,
|
|
146
|
+
})),
|
|
147
|
+
),
|
|
148
|
+
Repay$outboundSchema.and(
|
|
149
|
+
z.object({ action: z.literal("Repay") }).transform((v) => ({
|
|
150
|
+
action: v.action,
|
|
151
|
+
})),
|
|
152
|
+
),
|
|
153
|
+
Supply$outboundSchema.and(
|
|
154
|
+
z.object({ action: z.literal("Supply") }).transform((v) => ({
|
|
155
|
+
action: v.action,
|
|
156
|
+
})),
|
|
157
|
+
),
|
|
158
|
+
UsageAsCollateral$outboundSchema.and(
|
|
159
|
+
z.object({ action: z.literal("UsageAsCollateral") }).transform((v) => ({
|
|
160
|
+
action: v.action,
|
|
161
|
+
})),
|
|
162
|
+
),
|
|
163
|
+
Borrow$outboundSchema.and(
|
|
164
|
+
z.object({ action: z.literal("Borrow") }).transform((v) => ({
|
|
165
|
+
action: v.action,
|
|
166
|
+
})),
|
|
167
|
+
),
|
|
168
|
+
SwapBorrowRate$outboundSchema.and(
|
|
169
|
+
z.object({ action: z.literal("SwapBorrowRate") }).transform((v) => ({
|
|
170
|
+
action: v.action,
|
|
171
|
+
})),
|
|
172
|
+
),
|
|
173
|
+
LiquidationCall$outboundSchema.and(
|
|
174
|
+
z.object({ action: z.literal("LiquidationCall") }).transform((v) => ({
|
|
175
|
+
action: v.action,
|
|
176
|
+
})),
|
|
177
|
+
),
|
|
178
|
+
]);
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @internal
|
|
182
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
183
|
+
*/
|
|
184
|
+
export namespace Transaction$ {
|
|
185
|
+
/** @deprecated use `Transaction$inboundSchema` instead. */
|
|
186
|
+
export const inboundSchema = Transaction$inboundSchema;
|
|
187
|
+
/** @deprecated use `Transaction$outboundSchema` instead. */
|
|
188
|
+
export const outboundSchema = Transaction$outboundSchema;
|
|
189
|
+
/** @deprecated use `Transaction$Outbound` instead. */
|
|
190
|
+
export type Outbound = Transaction$Outbound;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export function transactionToJSON(transaction: Transaction): string {
|
|
194
|
+
return JSON.stringify(Transaction$outboundSchema.parse(transaction));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function transactionFromJSON(
|
|
198
|
+
jsonString: string,
|
|
199
|
+
): SafeParseResult<Transaction, SDKValidationError> {
|
|
200
|
+
return safeParse(
|
|
201
|
+
jsonString,
|
|
202
|
+
(x) => Transaction$inboundSchema.parse(JSON.parse(x)),
|
|
203
|
+
`Failed to parse 'Transaction' from JSON`,
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
26
207
|
/** @internal */
|
|
27
208
|
export const AaveHistoricalTransactionsResponse$inboundSchema: z.ZodType<
|
|
28
209
|
AaveHistoricalTransactionsResponse,
|
|
29
210
|
z.ZodTypeDef,
|
|
30
211
|
unknown
|
|
31
212
|
> = z.object({
|
|
32
|
-
total: z.number().int(),
|
|
33
213
|
offset: z.number().int(),
|
|
34
214
|
limit: z.number().int(),
|
|
35
|
-
transactions: z.array(
|
|
215
|
+
transactions: z.array(
|
|
216
|
+
z.union([
|
|
217
|
+
RedeemUnderlying$inboundSchema.and(
|
|
218
|
+
z.object({ action: z.literal("RedeemUnderlying") }).transform((v) => ({
|
|
219
|
+
action: v.action,
|
|
220
|
+
})),
|
|
221
|
+
),
|
|
222
|
+
Repay$inboundSchema.and(
|
|
223
|
+
z.object({ action: z.literal("Repay") }).transform((v) => ({
|
|
224
|
+
action: v.action,
|
|
225
|
+
})),
|
|
226
|
+
),
|
|
227
|
+
Supply$inboundSchema.and(
|
|
228
|
+
z.object({ action: z.literal("Supply") }).transform((v) => ({
|
|
229
|
+
action: v.action,
|
|
230
|
+
})),
|
|
231
|
+
),
|
|
232
|
+
UsageAsCollateral$inboundSchema.and(
|
|
233
|
+
z.object({ action: z.literal("UsageAsCollateral") }).transform((v) => ({
|
|
234
|
+
action: v.action,
|
|
235
|
+
})),
|
|
236
|
+
),
|
|
237
|
+
Borrow$inboundSchema.and(
|
|
238
|
+
z.object({ action: z.literal("Borrow") }).transform((v) => ({
|
|
239
|
+
action: v.action,
|
|
240
|
+
})),
|
|
241
|
+
),
|
|
242
|
+
SwapBorrowRate$inboundSchema.and(
|
|
243
|
+
z.object({ action: z.literal("SwapBorrowRate") }).transform((v) => ({
|
|
244
|
+
action: v.action,
|
|
245
|
+
})),
|
|
246
|
+
),
|
|
247
|
+
LiquidationCall$inboundSchema.and(
|
|
248
|
+
z.object({ action: z.literal("LiquidationCall") }).transform((v) => ({
|
|
249
|
+
action: v.action,
|
|
250
|
+
})),
|
|
251
|
+
),
|
|
252
|
+
]),
|
|
253
|
+
),
|
|
36
254
|
});
|
|
37
255
|
|
|
38
256
|
/** @internal */
|
|
39
257
|
export type AaveHistoricalTransactionsResponse$Outbound = {
|
|
40
|
-
total: number;
|
|
41
258
|
offset: number;
|
|
42
259
|
limit: number;
|
|
43
|
-
transactions: Array<
|
|
260
|
+
transactions: Array<
|
|
261
|
+
| (RedeemUnderlying$Outbound & { action: "RedeemUnderlying" })
|
|
262
|
+
| (Repay$Outbound & { action: "Repay" })
|
|
263
|
+
| (Supply$Outbound & { action: "Supply" })
|
|
264
|
+
| (UsageAsCollateral$Outbound & { action: "UsageAsCollateral" })
|
|
265
|
+
| (Borrow$Outbound & { action: "Borrow" })
|
|
266
|
+
| (SwapBorrowRate$Outbound & { action: "SwapBorrowRate" })
|
|
267
|
+
| (LiquidationCall$Outbound & { action: "LiquidationCall" })
|
|
268
|
+
>;
|
|
44
269
|
};
|
|
45
270
|
|
|
46
271
|
/** @internal */
|
|
@@ -49,10 +274,47 @@ export const AaveHistoricalTransactionsResponse$outboundSchema: z.ZodType<
|
|
|
49
274
|
z.ZodTypeDef,
|
|
50
275
|
AaveHistoricalTransactionsResponse
|
|
51
276
|
> = z.object({
|
|
52
|
-
total: z.number().int(),
|
|
53
277
|
offset: z.number().int(),
|
|
54
278
|
limit: z.number().int(),
|
|
55
|
-
transactions: z.array(
|
|
279
|
+
transactions: z.array(
|
|
280
|
+
z.union([
|
|
281
|
+
RedeemUnderlying$outboundSchema.and(
|
|
282
|
+
z.object({ action: z.literal("RedeemUnderlying") }).transform((v) => ({
|
|
283
|
+
action: v.action,
|
|
284
|
+
})),
|
|
285
|
+
),
|
|
286
|
+
Repay$outboundSchema.and(
|
|
287
|
+
z.object({ action: z.literal("Repay") }).transform((v) => ({
|
|
288
|
+
action: v.action,
|
|
289
|
+
})),
|
|
290
|
+
),
|
|
291
|
+
Supply$outboundSchema.and(
|
|
292
|
+
z.object({ action: z.literal("Supply") }).transform((v) => ({
|
|
293
|
+
action: v.action,
|
|
294
|
+
})),
|
|
295
|
+
),
|
|
296
|
+
UsageAsCollateral$outboundSchema.and(
|
|
297
|
+
z.object({ action: z.literal("UsageAsCollateral") }).transform((v) => ({
|
|
298
|
+
action: v.action,
|
|
299
|
+
})),
|
|
300
|
+
),
|
|
301
|
+
Borrow$outboundSchema.and(
|
|
302
|
+
z.object({ action: z.literal("Borrow") }).transform((v) => ({
|
|
303
|
+
action: v.action,
|
|
304
|
+
})),
|
|
305
|
+
),
|
|
306
|
+
SwapBorrowRate$outboundSchema.and(
|
|
307
|
+
z.object({ action: z.literal("SwapBorrowRate") }).transform((v) => ({
|
|
308
|
+
action: v.action,
|
|
309
|
+
})),
|
|
310
|
+
),
|
|
311
|
+
LiquidationCall$outboundSchema.and(
|
|
312
|
+
z.object({ action: z.literal("LiquidationCall") }).transform((v) => ({
|
|
313
|
+
action: v.action,
|
|
314
|
+
})),
|
|
315
|
+
),
|
|
316
|
+
]),
|
|
317
|
+
),
|
|
56
318
|
});
|
|
57
319
|
|
|
58
320
|
/**
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import { Chain, Chain$inboundSchema, Chain$outboundSchema } from "./chain.js";
|
|
11
|
+
import {
|
|
12
|
+
SignedAuthorization,
|
|
13
|
+
SignedAuthorization$inboundSchema,
|
|
14
|
+
SignedAuthorization$Outbound,
|
|
15
|
+
SignedAuthorization$outboundSchema,
|
|
16
|
+
} from "./signedauthorization.js";
|
|
17
|
+
import {
|
|
18
|
+
TokenEnum,
|
|
19
|
+
TokenEnum$inboundSchema,
|
|
20
|
+
TokenEnum$outboundSchema,
|
|
21
|
+
} from "./tokenenum.js";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Amount of collateral token to supply to Aave
|
|
25
|
+
*/
|
|
26
|
+
export type CollateralAmount = number | string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Request model for executing an Aave loop transaction.
|
|
30
|
+
*/
|
|
31
|
+
export type AaveLoopRequest = {
|
|
32
|
+
/**
|
|
33
|
+
* The chain to use.
|
|
34
|
+
*/
|
|
35
|
+
chain: Chain;
|
|
36
|
+
/**
|
|
37
|
+
* The address of the transaction sender.
|
|
38
|
+
*/
|
|
39
|
+
sender: string;
|
|
40
|
+
signedAuthorization: SignedAuthorization;
|
|
41
|
+
/**
|
|
42
|
+
* A class representing the token.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
*
|
|
46
|
+
* This class is used to represent the token in the system. Notice individual
|
|
47
|
+
* endpoints' documentation where per chain tokens are presented.
|
|
48
|
+
*/
|
|
49
|
+
collateralToken: TokenEnum;
|
|
50
|
+
/**
|
|
51
|
+
* A class representing the token.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
*
|
|
55
|
+
* This class is used to represent the token in the system. Notice individual
|
|
56
|
+
* endpoints' documentation where per chain tokens are presented.
|
|
57
|
+
*/
|
|
58
|
+
borrowToken: TokenEnum;
|
|
59
|
+
/**
|
|
60
|
+
* Amount of collateral token to supply to Aave
|
|
61
|
+
*/
|
|
62
|
+
collateralAmount: number | string;
|
|
63
|
+
/**
|
|
64
|
+
* Number of times to perform the supply-borrow loop
|
|
65
|
+
*/
|
|
66
|
+
loopCount: number;
|
|
67
|
+
/**
|
|
68
|
+
* Maximum allowed slippage for token swaps in percentage
|
|
69
|
+
*/
|
|
70
|
+
maxSlippagePercent: number;
|
|
71
|
+
/**
|
|
72
|
+
* Loan To Value percentage of the loop
|
|
73
|
+
*/
|
|
74
|
+
loanToValue: number;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const CollateralAmount$inboundSchema: z.ZodType<
|
|
79
|
+
CollateralAmount,
|
|
80
|
+
z.ZodTypeDef,
|
|
81
|
+
unknown
|
|
82
|
+
> = z.union([z.number(), z.string()]);
|
|
83
|
+
|
|
84
|
+
/** @internal */
|
|
85
|
+
export type CollateralAmount$Outbound = number | string;
|
|
86
|
+
|
|
87
|
+
/** @internal */
|
|
88
|
+
export const CollateralAmount$outboundSchema: z.ZodType<
|
|
89
|
+
CollateralAmount$Outbound,
|
|
90
|
+
z.ZodTypeDef,
|
|
91
|
+
CollateralAmount
|
|
92
|
+
> = z.union([z.number(), z.string()]);
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @internal
|
|
96
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
97
|
+
*/
|
|
98
|
+
export namespace CollateralAmount$ {
|
|
99
|
+
/** @deprecated use `CollateralAmount$inboundSchema` instead. */
|
|
100
|
+
export const inboundSchema = CollateralAmount$inboundSchema;
|
|
101
|
+
/** @deprecated use `CollateralAmount$outboundSchema` instead. */
|
|
102
|
+
export const outboundSchema = CollateralAmount$outboundSchema;
|
|
103
|
+
/** @deprecated use `CollateralAmount$Outbound` instead. */
|
|
104
|
+
export type Outbound = CollateralAmount$Outbound;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function collateralAmountToJSON(
|
|
108
|
+
collateralAmount: CollateralAmount,
|
|
109
|
+
): string {
|
|
110
|
+
return JSON.stringify(
|
|
111
|
+
CollateralAmount$outboundSchema.parse(collateralAmount),
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function collateralAmountFromJSON(
|
|
116
|
+
jsonString: string,
|
|
117
|
+
): SafeParseResult<CollateralAmount, SDKValidationError> {
|
|
118
|
+
return safeParse(
|
|
119
|
+
jsonString,
|
|
120
|
+
(x) => CollateralAmount$inboundSchema.parse(JSON.parse(x)),
|
|
121
|
+
`Failed to parse 'CollateralAmount' from JSON`,
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** @internal */
|
|
126
|
+
export const AaveLoopRequest$inboundSchema: z.ZodType<
|
|
127
|
+
AaveLoopRequest,
|
|
128
|
+
z.ZodTypeDef,
|
|
129
|
+
unknown
|
|
130
|
+
> = z.object({
|
|
131
|
+
chain: Chain$inboundSchema,
|
|
132
|
+
sender: z.string(),
|
|
133
|
+
signed_authorization: SignedAuthorization$inboundSchema,
|
|
134
|
+
collateral_token: TokenEnum$inboundSchema,
|
|
135
|
+
borrow_token: TokenEnum$inboundSchema,
|
|
136
|
+
collateral_amount: z.union([z.number(), z.string()]),
|
|
137
|
+
loop_count: z.number().int(),
|
|
138
|
+
max_slippage_percent: z.number(),
|
|
139
|
+
loan_to_value: z.number(),
|
|
140
|
+
}).transform((v) => {
|
|
141
|
+
return remap$(v, {
|
|
142
|
+
"signed_authorization": "signedAuthorization",
|
|
143
|
+
"collateral_token": "collateralToken",
|
|
144
|
+
"borrow_token": "borrowToken",
|
|
145
|
+
"collateral_amount": "collateralAmount",
|
|
146
|
+
"loop_count": "loopCount",
|
|
147
|
+
"max_slippage_percent": "maxSlippagePercent",
|
|
148
|
+
"loan_to_value": "loanToValue",
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
/** @internal */
|
|
153
|
+
export type AaveLoopRequest$Outbound = {
|
|
154
|
+
chain: string;
|
|
155
|
+
sender: string;
|
|
156
|
+
signed_authorization: SignedAuthorization$Outbound;
|
|
157
|
+
collateral_token: string;
|
|
158
|
+
borrow_token: string;
|
|
159
|
+
collateral_amount: number | string;
|
|
160
|
+
loop_count: number;
|
|
161
|
+
max_slippage_percent: number;
|
|
162
|
+
loan_to_value: number;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/** @internal */
|
|
166
|
+
export const AaveLoopRequest$outboundSchema: z.ZodType<
|
|
167
|
+
AaveLoopRequest$Outbound,
|
|
168
|
+
z.ZodTypeDef,
|
|
169
|
+
AaveLoopRequest
|
|
170
|
+
> = z.object({
|
|
171
|
+
chain: Chain$outboundSchema,
|
|
172
|
+
sender: z.string(),
|
|
173
|
+
signedAuthorization: SignedAuthorization$outboundSchema,
|
|
174
|
+
collateralToken: TokenEnum$outboundSchema,
|
|
175
|
+
borrowToken: TokenEnum$outboundSchema,
|
|
176
|
+
collateralAmount: z.union([z.number(), z.string()]),
|
|
177
|
+
loopCount: z.number().int(),
|
|
178
|
+
maxSlippagePercent: z.number(),
|
|
179
|
+
loanToValue: z.number(),
|
|
180
|
+
}).transform((v) => {
|
|
181
|
+
return remap$(v, {
|
|
182
|
+
signedAuthorization: "signed_authorization",
|
|
183
|
+
collateralToken: "collateral_token",
|
|
184
|
+
borrowToken: "borrow_token",
|
|
185
|
+
collateralAmount: "collateral_amount",
|
|
186
|
+
loopCount: "loop_count",
|
|
187
|
+
maxSlippagePercent: "max_slippage_percent",
|
|
188
|
+
loanToValue: "loan_to_value",
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @internal
|
|
194
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
195
|
+
*/
|
|
196
|
+
export namespace AaveLoopRequest$ {
|
|
197
|
+
/** @deprecated use `AaveLoopRequest$inboundSchema` instead. */
|
|
198
|
+
export const inboundSchema = AaveLoopRequest$inboundSchema;
|
|
199
|
+
/** @deprecated use `AaveLoopRequest$outboundSchema` instead. */
|
|
200
|
+
export const outboundSchema = AaveLoopRequest$outboundSchema;
|
|
201
|
+
/** @deprecated use `AaveLoopRequest$Outbound` instead. */
|
|
202
|
+
export type Outbound = AaveLoopRequest$Outbound;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export function aaveLoopRequestToJSON(
|
|
206
|
+
aaveLoopRequest: AaveLoopRequest,
|
|
207
|
+
): string {
|
|
208
|
+
return JSON.stringify(AaveLoopRequest$outboundSchema.parse(aaveLoopRequest));
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function aaveLoopRequestFromJSON(
|
|
212
|
+
jsonString: string,
|
|
213
|
+
): SafeParseResult<AaveLoopRequest, SDKValidationError> {
|
|
214
|
+
return safeParse(
|
|
215
|
+
jsonString,
|
|
216
|
+
(x) => AaveLoopRequest$inboundSchema.parse(JSON.parse(x)),
|
|
217
|
+
`Failed to parse 'AaveLoopRequest' from JSON`,
|
|
218
|
+
);
|
|
219
|
+
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
10
|
import {
|
|
@@ -13,37 +14,97 @@ import {
|
|
|
13
14
|
Reserve$outboundSchema,
|
|
14
15
|
} from "./reserve.js";
|
|
15
16
|
|
|
17
|
+
/**
|
|
18
|
+
* The interest rate mode to borrow: 1 represents stable interest rate mode. 2 represents variable interest rate mode
|
|
19
|
+
*/
|
|
20
|
+
export const Borrowratemode = {
|
|
21
|
+
One: 1,
|
|
22
|
+
Two: 2,
|
|
23
|
+
} as const;
|
|
24
|
+
/**
|
|
25
|
+
* The interest rate mode to borrow: 1 represents stable interest rate mode. 2 represents variable interest rate mode
|
|
26
|
+
*/
|
|
27
|
+
export type Borrowratemode = ClosedEnum<typeof Borrowratemode>;
|
|
28
|
+
|
|
16
29
|
export type Borrow = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The id of a historical transaction on aave
|
|
32
|
+
*/
|
|
33
|
+
id: string;
|
|
34
|
+
/**
|
|
35
|
+
* Timestamp in unix time
|
|
36
|
+
*/
|
|
37
|
+
timestamp: number;
|
|
38
|
+
/**
|
|
39
|
+
* Transaction hash. You can paste these into the search bar on etherscan
|
|
40
|
+
*/
|
|
41
|
+
txHash: string;
|
|
42
|
+
/**
|
|
43
|
+
* Quantity of token
|
|
44
|
+
*/
|
|
45
|
+
amount: number;
|
|
46
|
+
/**
|
|
47
|
+
* The interest rate mode to borrow: 1 represents stable interest rate mode. 2 represents variable interest rate mode
|
|
48
|
+
*/
|
|
49
|
+
borrowRateMode: Borrowratemode;
|
|
22
50
|
reserve: Reserve;
|
|
23
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Price of token in USD
|
|
53
|
+
*/
|
|
54
|
+
assetPriceUSD: number;
|
|
55
|
+
/**
|
|
56
|
+
* The type of transaction
|
|
57
|
+
*/
|
|
58
|
+
action?: "Borrow" | undefined;
|
|
59
|
+
block: number;
|
|
24
60
|
};
|
|
25
61
|
|
|
62
|
+
/** @internal */
|
|
63
|
+
export const Borrowratemode$inboundSchema: z.ZodNativeEnum<
|
|
64
|
+
typeof Borrowratemode
|
|
65
|
+
> = z.nativeEnum(Borrowratemode);
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const Borrowratemode$outboundSchema: z.ZodNativeEnum<
|
|
69
|
+
typeof Borrowratemode
|
|
70
|
+
> = Borrowratemode$inboundSchema;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
75
|
+
*/
|
|
76
|
+
export namespace Borrowratemode$ {
|
|
77
|
+
/** @deprecated use `Borrowratemode$inboundSchema` instead. */
|
|
78
|
+
export const inboundSchema = Borrowratemode$inboundSchema;
|
|
79
|
+
/** @deprecated use `Borrowratemode$outboundSchema` instead. */
|
|
80
|
+
export const outboundSchema = Borrowratemode$outboundSchema;
|
|
81
|
+
}
|
|
82
|
+
|
|
26
83
|
/** @internal */
|
|
27
84
|
export const Borrow$inboundSchema: z.ZodType<Borrow, z.ZodTypeDef, unknown> = z
|
|
28
85
|
.object({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
86
|
+
id: z.string(),
|
|
87
|
+
timestamp: z.number().int(),
|
|
88
|
+
txHash: z.string(),
|
|
89
|
+
amount: z.number(),
|
|
90
|
+
borrowRateMode: Borrowratemode$inboundSchema,
|
|
34
91
|
reserve: Reserve$inboundSchema,
|
|
35
|
-
assetPriceUSD: z.
|
|
92
|
+
assetPriceUSD: z.number(),
|
|
93
|
+
action: z.literal("Borrow").optional(),
|
|
94
|
+
block: z.number().int(),
|
|
36
95
|
});
|
|
37
96
|
|
|
38
97
|
/** @internal */
|
|
39
98
|
export type Borrow$Outbound = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
99
|
+
id: string;
|
|
100
|
+
timestamp: number;
|
|
101
|
+
txHash: string;
|
|
102
|
+
amount: number;
|
|
103
|
+
borrowRateMode: number;
|
|
45
104
|
reserve: Reserve$Outbound;
|
|
46
|
-
assetPriceUSD:
|
|
105
|
+
assetPriceUSD: number;
|
|
106
|
+
action: "Borrow";
|
|
107
|
+
block: number;
|
|
47
108
|
};
|
|
48
109
|
|
|
49
110
|
/** @internal */
|
|
@@ -52,13 +113,15 @@ export const Borrow$outboundSchema: z.ZodType<
|
|
|
52
113
|
z.ZodTypeDef,
|
|
53
114
|
Borrow
|
|
54
115
|
> = z.object({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
116
|
+
id: z.string(),
|
|
117
|
+
timestamp: z.number().int(),
|
|
118
|
+
txHash: z.string(),
|
|
119
|
+
amount: z.number(),
|
|
120
|
+
borrowRateMode: Borrowratemode$outboundSchema,
|
|
60
121
|
reserve: Reserve$outboundSchema,
|
|
61
|
-
assetPriceUSD: z.
|
|
122
|
+
assetPriceUSD: z.number(),
|
|
123
|
+
action: z.literal("Borrow").default("Borrow" as const),
|
|
124
|
+
block: z.number().int(),
|
|
62
125
|
});
|
|
63
126
|
|
|
64
127
|
/**
|