@compass-labs/api-sdk 2.1.11 → 2.1.12-rc.1
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/CONTRIBUTING.md +26 -0
- package/USAGE.md +20 -0
- package/codeSamples_typescript.yaml +551 -0
- package/dist/commonjs/funcs/bridgeCctpBurn.d.ts +1 -1
- package/dist/commonjs/funcs/bridgeCctpBurn.js +1 -1
- package/dist/commonjs/funcs/bridgeCctpMint.d.ts +2 -4
- package/dist/commonjs/funcs/bridgeCctpMint.d.ts.map +1 -1
- package/dist/commonjs/funcs/bridgeCctpMint.js +2 -4
- package/dist/commonjs/funcs/bridgeCctpMint.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/sdk/bridge.d.ts +3 -5
- package/dist/commonjs/sdk/bridge.d.ts.map +1 -1
- package/dist/commonjs/sdk/bridge.js +3 -5
- package/dist/commonjs/sdk/bridge.js.map +1 -1
- package/dist/esm/funcs/bridgeCctpBurn.d.ts +1 -1
- package/dist/esm/funcs/bridgeCctpBurn.js +1 -1
- package/dist/esm/funcs/bridgeCctpMint.d.ts +2 -4
- package/dist/esm/funcs/bridgeCctpMint.d.ts.map +1 -1
- package/dist/esm/funcs/bridgeCctpMint.js +2 -4
- package/dist/esm/funcs/bridgeCctpMint.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/sdk/bridge.d.ts +3 -5
- package/dist/esm/sdk/bridge.d.ts.map +1 -1
- package/dist/esm/sdk/bridge.js +3 -5
- package/dist/esm/sdk/bridge.js.map +1 -1
- package/docs/lib/utils/retryconfig.md +24 -0
- package/docs/models/components/aaveavgrateresponse.md +27 -0
- package/docs/models/components/aaveborrowparams.md +24 -0
- package/docs/models/components/aaveborrowparamsamount.md +19 -0
- package/docs/models/components/aaveborrowrequest.md +29 -0
- package/docs/models/components/aaveborrowrequestamount.md +19 -0
- package/docs/models/components/aaveborrowrequestchain.md +15 -0
- package/docs/models/components/aavehistoricaltransactionsresponse.md +23 -0
- package/docs/models/components/aavehistoricaltransactionsresponsetransaction.md +148 -0
- package/docs/models/components/aaveliquiditychangeresponse.md +21 -0
- package/docs/models/components/aavelooprequest.md +46 -0
- package/docs/models/components/aavelooprequestchain.md +15 -0
- package/docs/models/components/aaveposition.md +25 -0
- package/docs/models/components/aaverateresponse.md +27 -0
- package/docs/models/components/aaverepayparams.md +24 -0
- package/docs/models/components/aaverepayparamsamount.md +19 -0
- package/docs/models/components/aaverepayrequest.md +29 -0
- package/docs/models/components/aaverepayrequestamount.md +19 -0
- package/docs/models/components/aaverepayrequestchain.md +15 -0
- package/docs/models/components/aavereserveoverviewresponse.md +21 -0
- package/docs/models/components/aavestdrateresponse.md +27 -0
- package/docs/models/components/aavesupplyparams.md +22 -0
- package/docs/models/components/aavesupplyparamsamount.md +19 -0
- package/docs/models/components/aavesupplyrequest.md +26 -0
- package/docs/models/components/aavesupplyrequestamount.md +19 -0
- package/docs/models/components/aavesupplyrequestchain.md +15 -0
- package/docs/models/components/aavesupportedtokenmetadata.md +23 -0
- package/docs/models/components/aavesupportedtokensresponse.md +24 -0
- package/docs/models/components/aavetokenpriceresponse.md +17 -0
- package/docs/models/components/aaveusdcratesresponse.md +40 -0
- package/docs/models/components/aaveuserpositionpertokenresponse.md +33 -0
- package/docs/models/components/aaveuserpositionsummaryresponse.md +27 -0
- package/docs/models/components/aavevenue.md +19 -0
- package/docs/models/components/aavewithdrawparams.md +23 -0
- package/docs/models/components/aavewithdrawparamsamount.md +19 -0
- package/docs/models/components/aavewithdrawrequest.md +27 -0
- package/docs/models/components/aavewithdrawrequestamount.md +19 -0
- package/docs/models/components/aavewithdrawrequestchain.md +15 -0
- package/docs/models/components/aerodromelppositionsresponse.md +17 -0
- package/docs/models/components/aerodromeposition.md +41 -0
- package/docs/models/components/aerodromeslipstreambuyexactlyparams.md +29 -0
- package/docs/models/components/aerodromeslipstreambuyexactlyparamsamountinmaximum.md +19 -0
- package/docs/models/components/aerodromeslipstreambuyexactlyparamsamountout.md +19 -0
- package/docs/models/components/aerodromeslipstreambuyexactlyrequest.md +33 -0
- package/docs/models/components/aerodromeslipstreambuyexactlyrequestamountinmaximum.md +19 -0
- package/docs/models/components/aerodromeslipstreambuyexactlyrequestamountout.md +19 -0
- package/docs/models/components/aerodromeslipstreambuyexactlyrequestchain.md +15 -0
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionparams.md +32 -0
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionparamsamount0desired.md +19 -0
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionparamsamount0min.md +19 -0
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionparamsamount1desired.md +19 -0
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionparamsamount1min.md +19 -0
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequest.md +31 -0
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestamount0desired.md +19 -0
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestamount0min.md +19 -0
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestamount1desired.md +19 -0
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestamount1min.md +19 -0
- package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestchain.md +15 -0
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionparams.md +38 -0
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionparamsamount0desired.md +19 -0
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionparamsamount0min.md +19 -0
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionparamsamount1desired.md +19 -0
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionparamsamount1min.md +19 -0
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequest.md +43 -0
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestamount0desired.md +19 -0
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestamount0min.md +19 -0
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestamount1desired.md +19 -0
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestamount1min.md +19 -0
- package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestchain.md +15 -0
- package/docs/models/components/aerodromeslipstreampoolpriceresponse.md +23 -0
- package/docs/models/components/aerodromeslipstreamsellexactlyparams.md +29 -0
- package/docs/models/components/aerodromeslipstreamsellexactlyparamsamountin.md +19 -0
- package/docs/models/components/aerodromeslipstreamsellexactlyparamsamountoutminimum.md +19 -0
- package/docs/models/components/aerodromeslipstreamsellexactlyrequest.md +33 -0
- package/docs/models/components/aerodromeslipstreamsellexactlyrequestamountin.md +19 -0
- package/docs/models/components/aerodromeslipstreamsellexactlyrequestamountoutminimum.md +19 -0
- package/docs/models/components/aerodromeslipstreamsellexactlyrequestchain.md +15 -0
- package/docs/models/components/aerodromeslipstreamwithdrawliquidityprovisionparams.md +26 -0
- package/docs/models/components/aerodromeslipstreamwithdrawliquidityprovisionparamspercentageforwithdrawal.md +19 -0
- package/docs/models/components/aerodromeslipstreamwithdrawliquidityprovisionrequest.md +25 -0
- package/docs/models/components/aerodromeslipstreamwithdrawliquidityprovisionrequestchain.md +15 -0
- package/docs/models/components/aerodromeslipstreamwithdrawliquidityprovisionrequestpercentageforwithdrawal.md +19 -0
- package/docs/models/components/allowanceinforesponse.md +27 -0
- package/docs/models/components/approvetransferrequest.md +22 -0
- package/docs/models/components/approvetransferresponse.md +48 -0
- package/docs/models/components/apy.md +23 -0
- package/docs/models/components/batchedsafeoperationsresponseinput.md +47 -0
- package/docs/models/components/batchedsafeoperationsresponseoutput.md +47 -0
- package/docs/models/components/batcheduseroperationsrequest.md +36 -0
- package/docs/models/components/batcheduseroperationsrequestchain.md +15 -0
- package/docs/models/components/batcheduseroperationsresponse.md +17 -0
- package/docs/models/components/body.md +424 -0
- package/docs/models/components/borrow.md +37 -0
- package/docs/models/components/borrowratemode.md +17 -0
- package/docs/models/components/bundlertransactionresponse.md +28 -0
- package/docs/models/components/chain.md +17 -0
- package/docs/models/components/chaininfo.md +18 -0
- package/docs/models/components/chainratedata.md +21 -0
- package/docs/models/components/compassapibackendv1modelsgenericreadresponseportfoliotokenbalance.md +27 -0
- package/docs/models/components/compassapibackendv1modelsmorphoreadresponsecheckuserpositionapydata.md +20 -0
- package/docs/models/components/compassapibackendv1modelsmorphoreadresponsecheckuserpositionasset.md +27 -0
- package/docs/models/components/compassapibackendv1modelsmorphoreadresponsecheckuserpositionmarketstate.md +34 -0
- package/docs/models/components/compassapibackendv1modelsmorphoreadresponsecheckuserpositionvaultposition.md +52 -0
- package/docs/models/components/compassapibackendv1modelsmorphoreadresponsecheckuserpositionvaultstate.md +24 -0
- package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetmarketapydata.md +23 -0
- package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetmarketasset.md +27 -0
- package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetmarketmarketstate.md +28 -0
- package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetmarketsasset.md +23 -0
- package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetmarketsmarketstate.md +31 -0
- package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetvaultsasset.md +25 -0
- package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetvaultsvaultstate.md +28 -0
- package/docs/models/components/compassapibackendv1modelspendlereadresponsemarketuserposition.md +28 -0
- package/docs/models/components/compassapibackendv1modelspendlereadresponsepositionstokenbalance.md +19 -0
- package/docs/models/components/compassapibackendv1modelsvaultsreadresponsevaultuserposition.md +19 -0
- package/docs/models/components/compassapibackendv1modelswildcatreadresponsemarketuserposition.md +19 -0
- package/docs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.md +27 -0
- package/docs/models/components/compassapibackendv2modelsgassponsorshippermit2typeddataeip712domain.md +21 -0
- package/docs/models/components/compassapibackendv2modelsgassponsorshippermit2typeddataeip712types.md +61 -0
- package/docs/models/components/compassapibackendv2modelsgassponsorshippermittypeddataeip712domain.md +26 -0
- package/docs/models/components/compassapibackendv2modelsgassponsorshippermittypeddataeip712types.md +21 -0
- package/docs/models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.md +23 -0
- package/docs/models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712types.md +23 -0
- package/docs/models/components/cooldownend.md +19 -0
- package/docs/models/components/cooldownposition.md +21 -0
- package/docs/models/components/createaccountrequest.md +24 -0
- package/docs/models/components/createaccountrequestchain.md +15 -0
- package/docs/models/components/createaccountresponse.md +31 -0
- package/docs/models/components/denomination.md +17 -0
- package/docs/models/components/depositforburnrequest.md +27 -0
- package/docs/models/components/depositforburnrequestamount.md +19 -0
- package/docs/models/components/depositforburnrequestchain.md +17 -0
- package/docs/models/components/depositforburnrequesttransfermode.md +17 -0
- package/docs/models/components/depositforburnresponse.md +68 -0
- package/docs/models/components/depositforburnresponsetransfermode.md +17 -0
- package/docs/models/components/destinationchain.md +17 -0
- package/docs/models/components/details.md +33 -0
- package/docs/models/components/earnmanagerequest.md +30 -0
- package/docs/models/components/earnmanagerequestaction.md +17 -0
- package/docs/models/components/earnmanageresponse.md +29 -0
- package/docs/models/components/earnpositionresponse.md +26 -0
- package/docs/models/components/earnpositionsresponse.md +17 -0
- package/docs/models/components/earnswaprequest.md +29 -0
- package/docs/models/components/earnswaprequestamountin.md +19 -0
- package/docs/models/components/earnswapresponse.md +58 -0
- package/docs/models/components/earntransferrequest.md +27 -0
- package/docs/models/components/earntransferrequestaction.md +17 -0
- package/docs/models/components/earntransferrequestamount.md +19 -0
- package/docs/models/components/earntransferresponse.md +56 -0
- package/docs/models/components/earntransferresponseeip712.md +102 -0
- package/docs/models/components/eip712domainfield.md +21 -0
- package/docs/models/components/eip712field.md +19 -0
- package/docs/models/components/ensnameinforesponse.md +21 -0
- package/docs/models/components/erc20data.md +23 -0
- package/docs/models/components/ethenadepositparams.md +20 -0
- package/docs/models/components/ethenadepositparamsamount.md +19 -0
- package/docs/models/components/ethenadepositrequest.md +24 -0
- package/docs/models/components/ethenadepositrequestamount.md +19 -0
- package/docs/models/components/ethenadepositrequestchain.md +15 -0
- package/docs/models/components/ethenagetvaultresponse.md +45 -0
- package/docs/models/components/ethenarequesttowithdrawparams.md +19 -0
- package/docs/models/components/ethenarequesttowithdrawrequest.md +23 -0
- package/docs/models/components/ethenarequesttowithdrawrequestchain.md +15 -0
- package/docs/models/components/ethenarequesttowithdrawtransactionresponse.md +29 -0
- package/docs/models/components/ethenarequesttowithdrawtransactionresponsetransaction.md +33 -0
- package/docs/models/components/ethenaunstakeparams.md +18 -0
- package/docs/models/components/ethenaunstakerequest.md +22 -0
- package/docs/models/components/ethenaunstakerequestchain.md +15 -0
- package/docs/models/components/fee.md +21 -0
- package/docs/models/components/feeamount.md +19 -0
- package/docs/models/components/feeenum.md +19 -0
- package/docs/models/components/initialcollateralamount.md +19 -0
- package/docs/models/components/interestratemode.md +19 -0
- package/docs/models/components/liquidationcall.md +45 -0
- package/docs/models/components/loantovalue.md +19 -0
- package/docs/models/components/loc.md +17 -0
- package/docs/models/components/lpbalance.md +21 -0
- package/docs/models/components/market.md +17 -0
- package/docs/models/components/marketposition.md +35 -0
- package/docs/models/components/markettokens.md +50 -0
- package/docs/models/components/maxslippagepercent.md +19 -0
- package/docs/models/components/maxsupplyapydata.md +24 -0
- package/docs/models/components/mintpreparecompletedresponse.md +27 -0
- package/docs/models/components/mintpreparependingresponse.md +33 -0
- package/docs/models/components/mintpreparereadyresponse.md +36 -0
- package/docs/models/components/mintpreparerequest.md +22 -0
- package/docs/models/components/morphoborrowparams.md +23 -0
- package/docs/models/components/morphoborrowparamsamount.md +19 -0
- package/docs/models/components/morphoborrowrequest.md +28 -0
- package/docs/models/components/morphoborrowrequestamount.md +19 -0
- package/docs/models/components/morphoborrowrequestchain.md +15 -0
- package/docs/models/components/morphocheckmarketpositionresponse.md +25 -0
- package/docs/models/components/morphocheckuserpositionresponse.md +28 -0
- package/docs/models/components/morphodepositparams.md +22 -0
- package/docs/models/components/morphodepositparamsamount.md +19 -0
- package/docs/models/components/morphodepositrequest.md +26 -0
- package/docs/models/components/morphodepositrequestamount.md +19 -0
- package/docs/models/components/morphodepositrequestchain.md +15 -0
- package/docs/models/components/morphogetmarketresponse.md +71 -0
- package/docs/models/components/morphogetmarketsresponse.md +17 -0
- package/docs/models/components/morphogetvaultsresponse.md +17 -0
- package/docs/models/components/morphomarket.md +49 -0
- package/docs/models/components/morphorepayparams.md +23 -0
- package/docs/models/components/morphorepayrequest.md +28 -0
- package/docs/models/components/morphorepayrequestchain.md +15 -0
- package/docs/models/components/morphosupplycollateralparams.md +23 -0
- package/docs/models/components/morphosupplycollateralparamsamount.md +19 -0
- package/docs/models/components/morphosupplycollateralrequest.md +28 -0
- package/docs/models/components/morphosupplycollateralrequestamount.md +19 -0
- package/docs/models/components/morphosupplycollateralrequestchain.md +15 -0
- package/docs/models/components/morphovault.md +51 -0
- package/docs/models/components/morphowithdrawcollateralparams.md +23 -0
- package/docs/models/components/morphowithdrawcollateralparamsamount.md +19 -0
- package/docs/models/components/morphowithdrawcollateralrequest.md +28 -0
- package/docs/models/components/morphowithdrawcollateralrequestamount.md +19 -0
- package/docs/models/components/morphowithdrawcollateralrequestchain.md +15 -0
- package/docs/models/components/morphowithdrawparams.md +22 -0
- package/docs/models/components/morphowithdrawrequest.md +26 -0
- package/docs/models/components/morphowithdrawrequestchain.md +15 -0
- package/docs/models/components/movement10percent.md +18 -0
- package/docs/models/components/multicallauthorizationrequest.md +25 -0
- package/docs/models/components/multicallauthorizationrequestchain.md +15 -0
- package/docs/models/components/multicallauthorizationresponse.md +23 -0
- package/docs/models/components/multicallexecuterequest.md +84 -0
- package/docs/models/components/multicallexecuterequestchain.md +15 -0
- package/docs/models/components/multiplier.md +19 -0
- package/docs/models/components/odosswapparams.md +25 -0
- package/docs/models/components/odosswapparamsamountin.md +19 -0
- package/docs/models/components/odosswaprequest.md +29 -0
- package/docs/models/components/odosswaprequestamountin.md +19 -0
- package/docs/models/components/odosswaprequestchain.md +15 -0
- package/docs/models/components/odostransactionresponse.md +23 -0
- package/docs/models/components/odostransactionresponsetransaction.md +33 -0
- package/docs/models/components/openposition.md +33 -0
- package/docs/models/components/operationtype.md +17 -0
- package/docs/models/components/pendlegetmarketresponse.md +55 -0
- package/docs/models/components/pendlelistmarketsresponse.md +42 -0
- package/docs/models/components/pendlelistuserpositionsresponse.md +67 -0
- package/docs/models/components/pendlemanageliquidityparams.md +27 -0
- package/docs/models/components/pendlemanageliquidityparamsaction.md +17 -0
- package/docs/models/components/pendlemanageliquidityparamsamountin.md +19 -0
- package/docs/models/components/pendlemanageliquidityrequest.md +31 -0
- package/docs/models/components/pendlemanageliquidityrequestaction.md +17 -0
- package/docs/models/components/pendlemanageliquidityrequestamountin.md +19 -0
- package/docs/models/components/pendlemanageliquidityrequestchain.md +15 -0
- package/docs/models/components/pendlemarket.md +48 -0
- package/docs/models/components/pendleredeemyieldparams.md +19 -0
- package/docs/models/components/pendleredeemyieldrequest.md +23 -0
- package/docs/models/components/pendleredeemyieldrequestchain.md +15 -0
- package/docs/models/components/pendletradeptparams.md +27 -0
- package/docs/models/components/pendletradeptparamsaction.md +17 -0
- package/docs/models/components/pendletradeptparamsamountin.md +19 -0
- package/docs/models/components/pendletradeptrequest.md +31 -0
- package/docs/models/components/pendletradeptrequestaction.md +17 -0
- package/docs/models/components/pendletradeptrequestamountin.md +19 -0
- package/docs/models/components/pendletradeptrequestchain.md +15 -0
- package/docs/models/components/pendletradeytparams.md +27 -0
- package/docs/models/components/pendletradeytparamsaction.md +17 -0
- package/docs/models/components/pendletradeytparamsamountin.md +19 -0
- package/docs/models/components/pendletradeytrequest.md +31 -0
- package/docs/models/components/pendletradeytrequestaction.md +17 -0
- package/docs/models/components/pendletradeytrequestamountin.md +19 -0
- package/docs/models/components/pendletradeytrequestchain.md +15 -0
- package/docs/models/components/pendletxresponse.md +29 -0
- package/docs/models/components/pendletxresponsetransaction.md +33 -0
- package/docs/models/components/permit2typeddatainput.md +76 -0
- package/docs/models/components/permit2typeddataoutput.md +76 -0
- package/docs/models/components/permitfield.md +21 -0
- package/docs/models/components/permitmessage.md +27 -0
- package/docs/models/components/permittransferfrommessage.md +26 -0
- package/docs/models/components/permittypeddataresponseinput.md +39 -0
- package/docs/models/components/permittypeddataresponseoutput.md +39 -0
- package/docs/models/components/portfolio.md +28 -0
- package/docs/models/components/position.md +70 -0
- package/docs/models/components/positionunion.md +32 -0
- package/docs/models/components/protocol.md +15 -0
- package/docs/models/components/r.md +19 -0
- package/docs/models/components/repay.md +35 -0
- package/docs/models/components/reserve.md +22 -0
- package/docs/models/components/s.md +19 -0
- package/docs/models/components/safetxfield.md +21 -0
- package/docs/models/components/safetxmessage.md +37 -0
- package/docs/models/components/security.md +17 -0
- package/docs/models/components/setallowanceparams.md +25 -0
- package/docs/models/components/setallowanceparamsamount.md +19 -0
- package/docs/models/components/setallowanceparamscontractenum.md +15 -0
- package/docs/models/components/setallowanceparamscontractunion.md +20 -0
- package/docs/models/components/setallowancerequest.md +29 -0
- package/docs/models/components/setallowancerequestamount.md +19 -0
- package/docs/models/components/setallowancerequestchain.md +15 -0
- package/docs/models/components/setallowancerequestcontractenum.md +15 -0
- package/docs/models/components/setallowancerequestcontractunion.md +19 -0
- package/docs/models/components/signedauthorization.md +27 -0
- package/docs/models/components/skybuyparams.md +21 -0
- package/docs/models/components/skybuyparamsamount.md +19 -0
- package/docs/models/components/skybuyparamstokenin.md +17 -0
- package/docs/models/components/skybuyrequest.md +25 -0
- package/docs/models/components/skybuyrequestamount.md +19 -0
- package/docs/models/components/skybuyrequestchain.md +15 -0
- package/docs/models/components/skybuyrequesttokenin.md +17 -0
- package/docs/models/components/skycheckpositionresponse.md +19 -0
- package/docs/models/components/skydepositparams.md +20 -0
- package/docs/models/components/skydepositparamsamount.md +19 -0
- package/docs/models/components/skydepositrequest.md +24 -0
- package/docs/models/components/skydepositrequestamount.md +19 -0
- package/docs/models/components/skydepositrequestchain.md +15 -0
- package/docs/models/components/skysellparams.md +21 -0
- package/docs/models/components/skysellparamsamount.md +19 -0
- package/docs/models/components/skysellparamstokenout.md +17 -0
- package/docs/models/components/skysellrequest.md +25 -0
- package/docs/models/components/skysellrequestamount.md +19 -0
- package/docs/models/components/skysellrequestchain.md +15 -0
- package/docs/models/components/skysellrequesttokenout.md +17 -0
- package/docs/models/components/skywithdrawparams.md +20 -0
- package/docs/models/components/skywithdrawrequest.md +24 -0
- package/docs/models/components/skywithdrawrequestchain.md +15 -0
- package/docs/models/components/slippage.md +19 -0
- package/docs/models/components/sponsorgasrequest.md +84 -0
- package/docs/models/components/sponsorgasrequesteip712.md +129 -0
- package/docs/models/components/sponsorgasresponse.md +27 -0
- package/docs/models/components/supply.md +35 -0
- package/docs/models/components/supportedchaininfo.md +19 -0
- package/docs/models/components/swapborrowrate.md +39 -0
- package/docs/models/components/syposition.md +19 -0
- package/docs/models/components/tokenbalanceresponse.md +25 -0
- package/docs/models/components/tokenconfig.md +23 -0
- package/docs/models/components/tokenlistresponse.md +26 -0
- package/docs/models/components/tokenpermissions.md +19 -0
- package/docs/models/components/tokenpriceresponse.md +17 -0
- package/docs/models/components/tokentransferparams.md +25 -0
- package/docs/models/components/tokentransferparamsamount.md +19 -0
- package/docs/models/components/tokentransferrequest.md +29 -0
- package/docs/models/components/tokentransferrequestamount.md +19 -0
- package/docs/models/components/tokentransferrequestchain.md +15 -0
- package/docs/models/components/transactionresponse.md +21 -0
- package/docs/models/components/transactionresponsetransaction.md +33 -0
- package/docs/models/components/underlyingtoken.md +23 -0
- package/docs/models/components/uniswapbuyexactlyparams.md +27 -0
- package/docs/models/components/uniswapbuyexactlyparamsamountout.md +19 -0
- package/docs/models/components/uniswapbuyexactlyrequest.md +33 -0
- package/docs/models/components/uniswapbuyexactlyrequestamountout.md +19 -0
- package/docs/models/components/uniswapbuyexactlyrequestchain.md +15 -0
- package/docs/models/components/uniswapbuyexactlytransactionresponse.md +29 -0
- package/docs/models/components/uniswapbuyexactlytransactionresponsetransaction.md +33 -0
- package/docs/models/components/uniswapbuyquoteinforesponse.md +19 -0
- package/docs/models/components/uniswapcheckinrangeresponse.md +17 -0
- package/docs/models/components/uniswapincreaseliquidityprovisionparams.md +27 -0
- package/docs/models/components/uniswapincreaseliquidityprovisionparamsamount0desired.md +19 -0
- package/docs/models/components/uniswapincreaseliquidityprovisionparamsamount0min.md +19 -0
- package/docs/models/components/uniswapincreaseliquidityprovisionparamsamount1desired.md +19 -0
- package/docs/models/components/uniswapincreaseliquidityprovisionparamsamount1min.md +19 -0
- package/docs/models/components/uniswapincreaseliquidityprovisionrequest.md +33 -0
- package/docs/models/components/uniswapincreaseliquidityprovisionrequestamount0desired.md +19 -0
- package/docs/models/components/uniswapincreaseliquidityprovisionrequestamount0min.md +19 -0
- package/docs/models/components/uniswapincreaseliquidityprovisionrequestamount1desired.md +19 -0
- package/docs/models/components/uniswapincreaseliquidityprovisionrequestamount1min.md +19 -0
- package/docs/models/components/uniswapincreaseliquidityprovisionrequestchain.md +15 -0
- package/docs/models/components/uniswaplppositionsinforesponse.md +17 -0
- package/docs/models/components/uniswapmintliquidityprovisionparams.md +36 -0
- package/docs/models/components/uniswapmintliquidityprovisionparamsamount0desired.md +19 -0
- package/docs/models/components/uniswapmintliquidityprovisionparamsamount0min.md +19 -0
- package/docs/models/components/uniswapmintliquidityprovisionparamsamount1desired.md +19 -0
- package/docs/models/components/uniswapmintliquidityprovisionparamsamount1min.md +19 -0
- package/docs/models/components/uniswapmintliquidityprovisionrequest.md +43 -0
- package/docs/models/components/uniswapmintliquidityprovisionrequestamount0desired.md +19 -0
- package/docs/models/components/uniswapmintliquidityprovisionrequestamount0min.md +19 -0
- package/docs/models/components/uniswapmintliquidityprovisionrequestamount1desired.md +19 -0
- package/docs/models/components/uniswapmintliquidityprovisionrequestamount1min.md +19 -0
- package/docs/models/components/uniswapmintliquidityprovisionrequestchain.md +15 -0
- package/docs/models/components/uniswappoolpriceresponse.md +23 -0
- package/docs/models/components/uniswappositionssolidityresponse.md +40 -0
- package/docs/models/components/uniswapsellexactlyparams.md +29 -0
- package/docs/models/components/uniswapsellexactlyparamsamountin.md +19 -0
- package/docs/models/components/uniswapsellexactlyrequest.md +33 -0
- package/docs/models/components/uniswapsellexactlyrequestamountin.md +19 -0
- package/docs/models/components/uniswapsellexactlyrequestchain.md +15 -0
- package/docs/models/components/uniswapsellexactlytransactionresponse.md +23 -0
- package/docs/models/components/uniswapsellexactlytransactionresponsetransaction.md +33 -0
- package/docs/models/components/uniswapsellquoteinforesponse.md +19 -0
- package/docs/models/components/uniswapwithdrawliquidityprovisionparams.md +26 -0
- package/docs/models/components/uniswapwithdrawliquidityprovisionparamspercentageforwithdrawal.md +19 -0
- package/docs/models/components/uniswapwithdrawliquidityprovisionrequest.md +25 -0
- package/docs/models/components/uniswapwithdrawliquidityprovisionrequestchain.md +15 -0
- package/docs/models/components/uniswapwithdrawliquidityprovisionrequestpercentageforwithdrawal.md +19 -0
- package/docs/models/components/unsignedmulticalltransaction.md +35 -0
- package/docs/models/components/unsignedtransaction.md +33 -0
- package/docs/models/components/unwrapwethparams.md +21 -0
- package/docs/models/components/unwrapwethparamsamount.md +19 -0
- package/docs/models/components/unwrapwethrequest.md +25 -0
- package/docs/models/components/unwrapwethrequestamount.md +19 -0
- package/docs/models/components/unwrapwethrequestchain.md +15 -0
- package/docs/models/components/usageascollateral.md +35 -0
- package/docs/models/components/useroperation.md +21 -0
- package/docs/models/components/useroperationresponse.md +21 -0
- package/docs/models/components/userposition.md +30 -0
- package/docs/models/components/userstate.md +27 -0
- package/docs/models/components/validationerror.md +23 -0
- package/docs/models/components/vault.md +47 -0
- package/docs/models/components/vaultdepositparams.md +22 -0
- package/docs/models/components/vaultdepositparamsamount.md +19 -0
- package/docs/models/components/vaultdepositrequest.md +26 -0
- package/docs/models/components/vaultdepositrequestamount.md +19 -0
- package/docs/models/components/vaultdepositrequestchain.md +15 -0
- package/docs/models/components/vaultgetvaultresponse.md +42 -0
- package/docs/models/components/vaultinfo.md +57 -0
- package/docs/models/components/vaultslistresponse.md +25 -0
- package/docs/models/components/vaultvenue.md +19 -0
- package/docs/models/components/vaultwithdrawparams.md +22 -0
- package/docs/models/components/vaultwithdrawrequest.md +26 -0
- package/docs/models/components/vaultwithdrawrequestchain.md +15 -0
- package/docs/models/components/venue.md +25 -0
- package/docs/models/components/weeklyapys.md +23 -0
- package/docs/models/components/wildcatgetmarketresponse.md +57 -0
- package/docs/models/components/withdraw.md +35 -0
- package/docs/models/components/wrapethparams.md +21 -0
- package/docs/models/components/wrapethparamsamount.md +19 -0
- package/docs/models/components/wrapethrequest.md +25 -0
- package/docs/models/components/wrapethrequestamount.md +19 -0
- package/docs/models/components/wrapethrequestchain.md +15 -0
- package/docs/models/components/yieldrange.md +19 -0
- package/docs/models/errors/httpvalidationerror.md +15 -0
- package/docs/models/errors/mintpreparenotfoundresponseerror.md +22 -0
- package/docs/models/operations/amountin.md +19 -0
- package/docs/models/operations/amountout.md +19 -0
- package/docs/models/operations/contract.md +19 -0
- package/docs/models/operations/contractenum.md +15 -0
- package/docs/models/operations/direction.md +17 -0
- package/docs/models/operations/response200v2cctpmint.md +38 -0
- package/docs/models/operations/responsev1transactionbundleraaveloop.md +34 -0
- package/docs/models/operations/v1aaveaavesupportedtokenschain.md +15 -0
- package/docs/models/operations/v1aaveaavesupportedtokensrequest.md +18 -0
- package/docs/models/operations/v1aaveavgratechain.md +15 -0
- package/docs/models/operations/v1aaveavgraterequest.md +22 -0
- package/docs/models/operations/v1aavehistoricaltransactionschain.md +15 -0
- package/docs/models/operations/v1aavehistoricaltransactionsrequest.md +23 -0
- package/docs/models/operations/v1aaveliquiditychangechain.md +15 -0
- package/docs/models/operations/v1aaveliquiditychangerequest.md +23 -0
- package/docs/models/operations/v1aaveratechain.md +15 -0
- package/docs/models/operations/v1aaveraterequest.md +20 -0
- package/docs/models/operations/v1aavereserveoverviewchain.md +15 -0
- package/docs/models/operations/v1aavereserveoverviewrequest.md +20 -0
- package/docs/models/operations/v1aavestdratechain.md +15 -0
- package/docs/models/operations/v1aavestdraterequest.md +22 -0
- package/docs/models/operations/v1aavetokenpricechain.md +15 -0
- package/docs/models/operations/v1aavetokenpricerequest.md +20 -0
- package/docs/models/operations/v1aaveuserpositionpertokenchain.md +15 -0
- package/docs/models/operations/v1aaveuserpositionpertokenrequest.md +22 -0
- package/docs/models/operations/v1aaveuserpositionsummarychain.md +15 -0
- package/docs/models/operations/v1aaveuserpositionsummaryrequest.md +20 -0
- package/docs/models/operations/v1aerodromeslipstreamliquidityprovisionpositionschain.md +15 -0
- package/docs/models/operations/v1aerodromeslipstreamliquidityprovisionpositionsrequest.md +19 -0
- package/docs/models/operations/v1aerodromeslipstreampoolpricechain.md +15 -0
- package/docs/models/operations/v1aerodromeslipstreampoolpricerequest.md +23 -0
- package/docs/models/operations/v1ethenavaultchain.md +15 -0
- package/docs/models/operations/v1ethenavaultrequest.md +20 -0
- package/docs/models/operations/v1genericallowancechain.md +15 -0
- package/docs/models/operations/v1genericallowancerequest.md +23 -0
- package/docs/models/operations/v1genericenschain.md +15 -0
- package/docs/models/operations/v1genericensrequest.md +19 -0
- package/docs/models/operations/v1genericportfoliochain.md +15 -0
- package/docs/models/operations/v1genericportfoliorequest.md +19 -0
- package/docs/models/operations/v1genericsupportedchainsrequest.md +17 -0
- package/docs/models/operations/v1morphomarketchain.md +15 -0
- package/docs/models/operations/v1morphomarketpositionchain.md +15 -0
- package/docs/models/operations/v1morphomarketpositionrequest.md +22 -0
- package/docs/models/operations/v1morphomarketrequest.md +20 -0
- package/docs/models/operations/v1morphomarketschain.md +15 -0
- package/docs/models/operations/v1morphomarketsrequest.md +21 -0
- package/docs/models/operations/v1morphouserpositionchain.md +15 -0
- package/docs/models/operations/v1morphouserpositionrequest.md +19 -0
- package/docs/models/operations/v1morphovaultchain.md +15 -0
- package/docs/models/operations/v1morphovaultrequest.md +22 -0
- package/docs/models/operations/v1morphovaultschain.md +15 -0
- package/docs/models/operations/v1morphovaultsrequest.md +19 -0
- package/docs/models/operations/v1pendlemarketchain.md +15 -0
- package/docs/models/operations/v1pendlemarketrequest.md +22 -0
- package/docs/models/operations/v1pendlemarketschain.md +15 -0
- package/docs/models/operations/v1pendlemarketsrequest.md +17 -0
- package/docs/models/operations/v1pendlepositionschain.md +15 -0
- package/docs/models/operations/v1pendlepositionsrequest.md +19 -0
- package/docs/models/operations/v1skypositionchain.md +15 -0
- package/docs/models/operations/v1skypositionrequest.md +19 -0
- package/docs/models/operations/v1tokenbalancechain.md +15 -0
- package/docs/models/operations/v1tokenbalancerequest.md +21 -0
- package/docs/models/operations/v1tokenlistchain.md +15 -0
- package/docs/models/operations/v1tokenlistrequest.md +17 -0
- package/docs/models/operations/v1tokenpricechain.md +15 -0
- package/docs/models/operations/v1tokenpricerequest.md +20 -0
- package/docs/models/operations/v1uniswapliquidityprovisioninrangechain.md +15 -0
- package/docs/models/operations/v1uniswapliquidityprovisioninrangerequest.md +19 -0
- package/docs/models/operations/v1uniswapliquidityprovisionpositionschain.md +15 -0
- package/docs/models/operations/v1uniswapliquidityprovisionpositionsrequest.md +19 -0
- package/docs/models/operations/v1uniswappoolpricechain.md +15 -0
- package/docs/models/operations/v1uniswappoolpricefeeenum.md +19 -0
- package/docs/models/operations/v1uniswappoolpricerequest.md +23 -0
- package/docs/models/operations/v1uniswapquotebuyexactlychain.md +15 -0
- package/docs/models/operations/v1uniswapquotebuyexactlyfeeenum.md +19 -0
- package/docs/models/operations/v1uniswapquotebuyexactlyrequest.md +25 -0
- package/docs/models/operations/v1uniswapquotesellexactlychain.md +15 -0
- package/docs/models/operations/v1uniswapquotesellexactlyfeeenum.md +19 -0
- package/docs/models/operations/v1uniswapquotesellexactlyrequest.md +25 -0
- package/docs/models/operations/v1vaultsvaultchain.md +15 -0
- package/docs/models/operations/v1vaultsvaultrequest.md +22 -0
- package/docs/models/operations/v1wildcatmarketchain.md +15 -0
- package/docs/models/operations/v1wildcatmarketrequest.md +22 -0
- package/docs/models/operations/v2cctpmintresponse.md +26 -0
- package/docs/models/operations/v2earnaavetokenratesrequest.md +17 -0
- package/docs/models/operations/v2earnpositionschain.md +15 -0
- package/docs/models/operations/v2earnpositionspositionidrequest.md +21 -0
- package/docs/models/operations/v2earnpositionsrequest.md +25 -0
- package/docs/models/operations/v2earnvaultschain.md +15 -0
- package/docs/models/operations/v2earnvaultsrequest.md +25 -0
- package/docs/sdks/aavev3/README.md +1247 -0
- package/docs/sdks/aerodromeslipstream/README.md +702 -0
- package/docs/sdks/bridge/README.md +222 -0
- package/docs/sdks/earn/README.md +696 -0
- package/docs/sdks/erc4626vaults/README.md +264 -0
- package/docs/sdks/ethena/README.md +357 -0
- package/docs/sdks/gassponsorship/README.md +296 -0
- package/docs/sdks/morpho/README.md +1066 -0
- package/docs/sdks/pendle/README.md +630 -0
- package/docs/sdks/sky/README.md +458 -0
- package/docs/sdks/smartaccount/README.md +106 -0
- package/docs/sdks/swap/README.md +100 -0
- package/docs/sdks/token/README.md +481 -0
- package/docs/sdks/transactionbundler/README.md +411 -0
- package/docs/sdks/uniswapv3/README.md +947 -0
- package/docs/sdks/universal/README.md +419 -0
- package/docs/sdks/wildcat/README.md +88 -0
- package/eslint.config.mjs +22 -0
- package/examples/README.md +31 -0
- package/examples/node_modules/@esbuild/linux-x64/README.md +3 -0
- package/examples/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/examples/node_modules/@types/node/LICENSE +21 -0
- package/examples/node_modules/@types/node/README.md +15 -0
- package/examples/node_modules/dotenv/CHANGELOG.md +520 -0
- package/examples/node_modules/dotenv/LICENSE +23 -0
- package/examples/node_modules/dotenv/README-es.md +411 -0
- package/examples/node_modules/dotenv/README.md +645 -0
- package/examples/node_modules/dotenv/SECURITY.md +1 -0
- package/examples/node_modules/esbuild/LICENSE.md +21 -0
- package/examples/node_modules/esbuild/README.md +3 -0
- package/examples/node_modules/esbuild/bin/esbuild +0 -0
- package/examples/node_modules/get-tsconfig/LICENSE +21 -0
- package/examples/node_modules/get-tsconfig/README.md +235 -0
- package/examples/node_modules/get-tsconfig/dist/index.cjs +7 -0
- package/examples/node_modules/get-tsconfig/dist/index.d.cts +2088 -0
- package/examples/node_modules/get-tsconfig/dist/index.d.mts +2088 -0
- package/examples/node_modules/get-tsconfig/dist/index.mjs +0 -0
- package/examples/node_modules/resolve-pkg-maps/LICENSE +21 -0
- package/examples/node_modules/resolve-pkg-maps/README.md +216 -0
- package/examples/node_modules/resolve-pkg-maps/dist/index.cjs +1 -0
- package/examples/node_modules/resolve-pkg-maps/dist/index.d.cts +11 -0
- package/examples/node_modules/resolve-pkg-maps/dist/index.d.mts +11 -0
- package/examples/node_modules/resolve-pkg-maps/dist/index.mjs +0 -0
- package/examples/node_modules/tsx/LICENSE +21 -0
- package/examples/node_modules/tsx/README.md +32 -0
- package/examples/node_modules/tsx/dist/cjs/api/index.cjs +1 -0
- package/examples/node_modules/tsx/dist/cjs/api/index.d.cts +35 -0
- package/examples/node_modules/tsx/dist/cjs/api/index.d.mts +35 -0
- package/examples/node_modules/tsx/dist/cjs/api/index.mjs +0 -0
- package/examples/node_modules/tsx/dist/cjs/index.cjs +1 -0
- package/examples/node_modules/tsx/dist/cjs/index.mjs +0 -0
- package/examples/node_modules/tsx/dist/cli.cjs +54 -0
- package/examples/node_modules/tsx/dist/cli.mjs +0 -0
- package/examples/node_modules/tsx/dist/client-D6NvIMSC.cjs +1 -0
- package/examples/node_modules/tsx/dist/esm/api/index.cjs +1 -0
- package/examples/node_modules/tsx/dist/esm/api/index.d.cts +35 -0
- package/examples/node_modules/tsx/dist/esm/api/index.d.mts +35 -0
- package/examples/node_modules/tsx/dist/esm/api/index.mjs +0 -0
- package/examples/node_modules/tsx/dist/esm/index.cjs +2 -0
- package/examples/node_modules/tsx/dist/esm/index.mjs +0 -0
- package/examples/node_modules/tsx/dist/get-pipe-path-BoR10qr8.cjs +1 -0
- package/examples/node_modules/tsx/dist/index-BWFBUo6r.cjs +1 -0
- package/examples/node_modules/tsx/dist/index-gckBtVBf.cjs +14 -0
- package/examples/node_modules/tsx/dist/lexer-DgIbo0BU.cjs +3 -0
- package/examples/node_modules/tsx/dist/loader.cjs +1 -0
- package/examples/node_modules/tsx/dist/loader.mjs +0 -0
- package/examples/node_modules/tsx/dist/node-features-roYmp9jK.cjs +1 -0
- package/examples/node_modules/tsx/dist/package-Dxt5kIHw.cjs +1 -0
- package/examples/node_modules/tsx/dist/patch-repl.cjs +1 -0
- package/examples/node_modules/tsx/dist/patch-repl.mjs +0 -0
- package/examples/node_modules/tsx/dist/preflight.cjs +1 -0
- package/examples/node_modules/tsx/dist/preflight.mjs +0 -0
- package/examples/node_modules/tsx/dist/register-2sWVXuRQ.cjs +1 -0
- package/examples/node_modules/tsx/dist/register-D46fvsV_.cjs +4 -0
- package/examples/node_modules/tsx/dist/repl.cjs +3 -0
- package/examples/node_modules/tsx/dist/repl.mjs +0 -0
- package/examples/node_modules/tsx/dist/require-D4F1Lv60.cjs +1 -0
- package/examples/node_modules/tsx/dist/suppress-warnings.cjs +1 -0
- package/examples/node_modules/tsx/dist/suppress-warnings.mjs +0 -0
- package/examples/node_modules/tsx/dist/temporary-directory-B83uKxJF.cjs +1 -0
- package/examples/node_modules/undici-types/LICENSE +21 -0
- package/examples/node_modules/undici-types/README.md +6 -0
- package/package.json +1 -1
- package/src/funcs/bridgeCctpBurn.ts +1 -1
- package/src/funcs/bridgeCctpMint.ts +2 -4
- package/src/lib/config.ts +2 -2
- package/src/sdk/bridge.ts +3 -5
- package/tsconfig.json +1 -1
- package/examples/node_modules/.package-lock.json +0 -159
|
@@ -0,0 +1,696 @@
|
|
|
1
|
+
# Earn
|
|
2
|
+
(*earn*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [earnPositions](#earnpositions) - List earn positions
|
|
9
|
+
* [earnPositionsPositionId](#earnpositionspositionid) - Get earn position
|
|
10
|
+
* [earnVaults](#earnvaults) - List vaults
|
|
11
|
+
* [earnAaveTokenRates](#earnaavetokenrates) - Get token rates on Aave
|
|
12
|
+
* [earnCreateAccount](#earncreateaccount) - Create earn account
|
|
13
|
+
* [earnTransfer](#earntransfer) - Transfer tokens to/from account
|
|
14
|
+
* [earnManage](#earnmanage) - Manage earn position
|
|
15
|
+
* [earnSwap](#earnswap) - Swap tokens within Earn Account
|
|
16
|
+
|
|
17
|
+
## earnPositions
|
|
18
|
+
|
|
19
|
+
This endpoint fetches all Compass Earn positions.
|
|
20
|
+
|
|
21
|
+
### Example Usage
|
|
22
|
+
|
|
23
|
+
<!-- UsageSnippet language="typescript" operationID="v2_earn_positions" method="get" path="/v2/earn/positions" -->
|
|
24
|
+
```typescript
|
|
25
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
26
|
+
|
|
27
|
+
const compassApiSDK = new CompassApiSDK({
|
|
28
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
async function run() {
|
|
32
|
+
const result = await compassApiSDK.earn.earnPositions({
|
|
33
|
+
offset: 0,
|
|
34
|
+
limit: 100,
|
|
35
|
+
chain: "base",
|
|
36
|
+
userAddress: "0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c",
|
|
37
|
+
days: 30,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
console.log(result);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
run();
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Standalone function
|
|
47
|
+
|
|
48
|
+
The standalone function version of this method:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
52
|
+
import { earnEarnPositions } from "@compass-labs/api-sdk/funcs/earnEarnPositions.js";
|
|
53
|
+
|
|
54
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
55
|
+
// You can create one instance of it to use across an application.
|
|
56
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
57
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
async function run() {
|
|
61
|
+
const res = await earnEarnPositions(compassApiSDK, {
|
|
62
|
+
offset: 0,
|
|
63
|
+
limit: 100,
|
|
64
|
+
chain: "base",
|
|
65
|
+
userAddress: "0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c",
|
|
66
|
+
days: 30,
|
|
67
|
+
});
|
|
68
|
+
if (res.ok) {
|
|
69
|
+
const { value: result } = res;
|
|
70
|
+
console.log(result);
|
|
71
|
+
} else {
|
|
72
|
+
console.log("earnEarnPositions failed:", res.error);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
run();
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Parameters
|
|
80
|
+
|
|
81
|
+
| Parameter | Type | Required | Description |
|
|
82
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
83
|
+
| `request` | [operations.V2EarnPositionsRequest](../../models/operations/v2earnpositionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
84
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
85
|
+
| `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. |
|
|
86
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
87
|
+
|
|
88
|
+
### Response
|
|
89
|
+
|
|
90
|
+
**Promise\<[components.EarnPositionsResponse](../../models/components/earnpositionsresponse.md)\>**
|
|
91
|
+
|
|
92
|
+
### Errors
|
|
93
|
+
|
|
94
|
+
| Error Type | Status Code | Content Type |
|
|
95
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
96
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
97
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
98
|
+
|
|
99
|
+
## earnPositionsPositionId
|
|
100
|
+
|
|
101
|
+
This endpoint fetches a single Compass Earn position by its encoded ID.
|
|
102
|
+
|
|
103
|
+
### Example Usage
|
|
104
|
+
|
|
105
|
+
<!-- UsageSnippet language="typescript" operationID="v2_earn_positions_{position_id}" method="get" path="/v2/earn/positions/{position_id}" -->
|
|
106
|
+
```typescript
|
|
107
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
108
|
+
|
|
109
|
+
const compassApiSDK = new CompassApiSDK({
|
|
110
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
async function run() {
|
|
114
|
+
const result = await compassApiSDK.earn.earnPositionsPositionId({
|
|
115
|
+
positionId: "<id>",
|
|
116
|
+
userAddress: "0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c",
|
|
117
|
+
days: 100,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
console.log(result);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
run();
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Standalone function
|
|
127
|
+
|
|
128
|
+
The standalone function version of this method:
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
132
|
+
import { earnEarnPositionsPositionId } from "@compass-labs/api-sdk/funcs/earnEarnPositionsPositionId.js";
|
|
133
|
+
|
|
134
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
135
|
+
// You can create one instance of it to use across an application.
|
|
136
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
137
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
async function run() {
|
|
141
|
+
const res = await earnEarnPositionsPositionId(compassApiSDK, {
|
|
142
|
+
positionId: "<id>",
|
|
143
|
+
userAddress: "0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c",
|
|
144
|
+
days: 100,
|
|
145
|
+
});
|
|
146
|
+
if (res.ok) {
|
|
147
|
+
const { value: result } = res;
|
|
148
|
+
console.log(result);
|
|
149
|
+
} else {
|
|
150
|
+
console.log("earnEarnPositionsPositionId failed:", res.error);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
run();
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Parameters
|
|
158
|
+
|
|
159
|
+
| Parameter | Type | Required | Description |
|
|
160
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
161
|
+
| `request` | [operations.V2EarnPositionsPositionIdRequest](../../models/operations/v2earnpositionspositionidrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
162
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
163
|
+
| `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. |
|
|
164
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
165
|
+
|
|
166
|
+
### Response
|
|
167
|
+
|
|
168
|
+
**Promise\<[components.EarnPositionResponse](../../models/components/earnpositionresponse.md)\>**
|
|
169
|
+
|
|
170
|
+
### Errors
|
|
171
|
+
|
|
172
|
+
| Error Type | Status Code | Content Type |
|
|
173
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
174
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
175
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
176
|
+
|
|
177
|
+
## earnVaults
|
|
178
|
+
|
|
179
|
+
This endpoint fetches a curated list of DeFi vaults.
|
|
180
|
+
|
|
181
|
+
### Example Usage
|
|
182
|
+
|
|
183
|
+
<!-- UsageSnippet language="typescript" operationID="v2_earn_vaults" method="get" path="/v2/earn/vaults" -->
|
|
184
|
+
```typescript
|
|
185
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
186
|
+
|
|
187
|
+
const compassApiSDK = new CompassApiSDK({
|
|
188
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
async function run() {
|
|
192
|
+
const result = await compassApiSDK.earn.earnVaults({
|
|
193
|
+
orderBy: "lifetime_return",
|
|
194
|
+
direction: "desc",
|
|
195
|
+
offset: 0,
|
|
196
|
+
limit: 50,
|
|
197
|
+
chain: "ethereum",
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
console.log(result);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
run();
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Standalone function
|
|
207
|
+
|
|
208
|
+
The standalone function version of this method:
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
212
|
+
import { earnEarnVaults } from "@compass-labs/api-sdk/funcs/earnEarnVaults.js";
|
|
213
|
+
|
|
214
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
215
|
+
// You can create one instance of it to use across an application.
|
|
216
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
217
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
async function run() {
|
|
221
|
+
const res = await earnEarnVaults(compassApiSDK, {
|
|
222
|
+
orderBy: "lifetime_return",
|
|
223
|
+
direction: "desc",
|
|
224
|
+
offset: 0,
|
|
225
|
+
limit: 50,
|
|
226
|
+
chain: "ethereum",
|
|
227
|
+
});
|
|
228
|
+
if (res.ok) {
|
|
229
|
+
const { value: result } = res;
|
|
230
|
+
console.log(result);
|
|
231
|
+
} else {
|
|
232
|
+
console.log("earnEarnVaults failed:", res.error);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
run();
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Parameters
|
|
240
|
+
|
|
241
|
+
| Parameter | Type | Required | Description |
|
|
242
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
243
|
+
| `request` | [operations.V2EarnVaultsRequest](../../models/operations/v2earnvaultsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
244
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
245
|
+
| `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. |
|
|
246
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
247
|
+
|
|
248
|
+
### Response
|
|
249
|
+
|
|
250
|
+
**Promise\<[components.VaultsListResponse](../../models/components/vaultslistresponse.md)\>**
|
|
251
|
+
|
|
252
|
+
### Errors
|
|
253
|
+
|
|
254
|
+
| Error Type | Status Code | Content Type |
|
|
255
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
256
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
257
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
258
|
+
|
|
259
|
+
## earnAaveTokenRates
|
|
260
|
+
|
|
261
|
+
This endpoint fetches token rates on Aave across Ethereum, Base, and Arbitrum.
|
|
262
|
+
|
|
263
|
+
### Example Usage
|
|
264
|
+
|
|
265
|
+
<!-- UsageSnippet language="typescript" operationID="v2_earn_aave_token_rates" method="get" path="/v2/earn/aave_token_rates" -->
|
|
266
|
+
```typescript
|
|
267
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
268
|
+
|
|
269
|
+
const compassApiSDK = new CompassApiSDK({
|
|
270
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
async function run() {
|
|
274
|
+
const result = await compassApiSDK.earn.earnAaveTokenRates({
|
|
275
|
+
token: "USDC",
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
console.log(result);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
run();
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Standalone function
|
|
285
|
+
|
|
286
|
+
The standalone function version of this method:
|
|
287
|
+
|
|
288
|
+
```typescript
|
|
289
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
290
|
+
import { earnEarnAaveTokenRates } from "@compass-labs/api-sdk/funcs/earnEarnAaveTokenRates.js";
|
|
291
|
+
|
|
292
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
293
|
+
// You can create one instance of it to use across an application.
|
|
294
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
295
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
async function run() {
|
|
299
|
+
const res = await earnEarnAaveTokenRates(compassApiSDK, {
|
|
300
|
+
token: "USDC",
|
|
301
|
+
});
|
|
302
|
+
if (res.ok) {
|
|
303
|
+
const { value: result } = res;
|
|
304
|
+
console.log(result);
|
|
305
|
+
} else {
|
|
306
|
+
console.log("earnEarnAaveTokenRates failed:", res.error);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
run();
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Parameters
|
|
314
|
+
|
|
315
|
+
| Parameter | Type | Required | Description |
|
|
316
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
317
|
+
| `request` | [operations.V2EarnAaveTokenRatesRequest](../../models/operations/v2earnaavetokenratesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
318
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
319
|
+
| `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. |
|
|
320
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
321
|
+
|
|
322
|
+
### Response
|
|
323
|
+
|
|
324
|
+
**Promise\<[components.AaveUsdcRatesResponse](../../models/components/aaveusdcratesresponse.md)\>**
|
|
325
|
+
|
|
326
|
+
### Errors
|
|
327
|
+
|
|
328
|
+
| Error Type | Status Code | Content Type |
|
|
329
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
330
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
331
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
332
|
+
|
|
333
|
+
## earnCreateAccount
|
|
334
|
+
|
|
335
|
+
Create an Earn Account.
|
|
336
|
+
|
|
337
|
+
Before creating Earn positions, the `owner` must create an Earn Account associated with their wallet address.
|
|
338
|
+
|
|
339
|
+
Only the `owner` has the authority to sign transactions for this account. This can be done in one of two ways:
|
|
340
|
+
|
|
341
|
+
1) **No gas-sponsorship:** The `owner` signs a transaction and submits it to the network for execution. The `owner` covers the cost of gas in this case.
|
|
342
|
+
|
|
343
|
+
2) **Gas-sponsorship:** The `owner` does an off-chain EIP-712 signature and submits this signature to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`). Here, another wallet address is set as `sender`. This wallet will sign, submit and cover the gas fees of the transaction.
|
|
344
|
+
|
|
345
|
+
The creation of an Earn Account itself can be a gas-sponsored transaction by setting the `sender` to the wallet which will sign and send the transaction.
|
|
346
|
+
|
|
347
|
+
### Example Usage
|
|
348
|
+
|
|
349
|
+
<!-- UsageSnippet language="typescript" operationID="v2_earn_create_account" method="post" path="/v2/earn/create_account" -->
|
|
350
|
+
```typescript
|
|
351
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
352
|
+
|
|
353
|
+
const compassApiSDK = new CompassApiSDK({
|
|
354
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
async function run() {
|
|
358
|
+
const result = await compassApiSDK.earn.earnCreateAccount({
|
|
359
|
+
chain: "base",
|
|
360
|
+
sender: "0x9a30797cA5467fBaA1D74574886FeC5F79ae407A",
|
|
361
|
+
owner: "0x9a30797cA5467fBaA1D74574886FeC5F79ae407A",
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
console.log(result);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
run();
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Standalone function
|
|
371
|
+
|
|
372
|
+
The standalone function version of this method:
|
|
373
|
+
|
|
374
|
+
```typescript
|
|
375
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
376
|
+
import { earnEarnCreateAccount } from "@compass-labs/api-sdk/funcs/earnEarnCreateAccount.js";
|
|
377
|
+
|
|
378
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
379
|
+
// You can create one instance of it to use across an application.
|
|
380
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
381
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
async function run() {
|
|
385
|
+
const res = await earnEarnCreateAccount(compassApiSDK, {
|
|
386
|
+
chain: "base",
|
|
387
|
+
sender: "0x9a30797cA5467fBaA1D74574886FeC5F79ae407A",
|
|
388
|
+
owner: "0x9a30797cA5467fBaA1D74574886FeC5F79ae407A",
|
|
389
|
+
});
|
|
390
|
+
if (res.ok) {
|
|
391
|
+
const { value: result } = res;
|
|
392
|
+
console.log(result);
|
|
393
|
+
} else {
|
|
394
|
+
console.log("earnEarnCreateAccount failed:", res.error);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
run();
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### Parameters
|
|
402
|
+
|
|
403
|
+
| Parameter | Type | Required | Description |
|
|
404
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
405
|
+
| `request` | [components.CreateAccountRequest](../../models/components/createaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
406
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
407
|
+
| `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. |
|
|
408
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
409
|
+
|
|
410
|
+
### Response
|
|
411
|
+
|
|
412
|
+
**Promise\<[components.CreateAccountResponse](../../models/components/createaccountresponse.md)\>**
|
|
413
|
+
|
|
414
|
+
### Errors
|
|
415
|
+
|
|
416
|
+
| Error Type | Status Code | Content Type |
|
|
417
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
418
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
419
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
420
|
+
|
|
421
|
+
## earnTransfer
|
|
422
|
+
|
|
423
|
+
Transfer tokens to and from an Earn Account.
|
|
424
|
+
|
|
425
|
+
If `DEPOSIT`'` is selected, tokens will be transferred from the `owner`'s wallet into their Earn Account.
|
|
426
|
+
|
|
427
|
+
If `WITHDRAW` is selected, tokens will be transferred from the `owner`'s Earn Account into their wallet.
|
|
428
|
+
|
|
429
|
+
If a gas-sponsored `DEPOSIT` transfer is desired for a given token, a one-time Permit2 allowance must be set before proceeding. This is common practice for many other applications and, for many `owner`s, this one-time allowance will already have been set for the token they would like to transfer.
|
|
430
|
+
Once the one-time allowance is set for a given token and `gas_sponsorship` is set to 'true', EIP-712 typed data will be returned and can be signed off-chain by the user. This signature can then be submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`) where a `sender` can be set for the transaction.
|
|
431
|
+
|
|
432
|
+
### Example Usage
|
|
433
|
+
|
|
434
|
+
<!-- UsageSnippet language="typescript" operationID="v2_earn_transfer" method="post" path="/v2/earn/transfer" -->
|
|
435
|
+
```typescript
|
|
436
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
437
|
+
|
|
438
|
+
const compassApiSDK = new CompassApiSDK({
|
|
439
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
async function run() {
|
|
443
|
+
const result = await compassApiSDK.earn.earnTransfer({
|
|
444
|
+
owner: "0xE4780eeB4D345576dE762573cEA0F269b3099adE",
|
|
445
|
+
chain: "base",
|
|
446
|
+
token: "USDC",
|
|
447
|
+
amount: "0.01",
|
|
448
|
+
action: "DEPOSIT",
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
console.log(result);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
run();
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### Standalone function
|
|
458
|
+
|
|
459
|
+
The standalone function version of this method:
|
|
460
|
+
|
|
461
|
+
```typescript
|
|
462
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
463
|
+
import { earnEarnTransfer } from "@compass-labs/api-sdk/funcs/earnEarnTransfer.js";
|
|
464
|
+
|
|
465
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
466
|
+
// You can create one instance of it to use across an application.
|
|
467
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
468
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
async function run() {
|
|
472
|
+
const res = await earnEarnTransfer(compassApiSDK, {
|
|
473
|
+
owner: "0xE4780eeB4D345576dE762573cEA0F269b3099adE",
|
|
474
|
+
chain: "base",
|
|
475
|
+
token: "USDC",
|
|
476
|
+
amount: "0.01",
|
|
477
|
+
action: "DEPOSIT",
|
|
478
|
+
});
|
|
479
|
+
if (res.ok) {
|
|
480
|
+
const { value: result } = res;
|
|
481
|
+
console.log(result);
|
|
482
|
+
} else {
|
|
483
|
+
console.log("earnEarnTransfer failed:", res.error);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
run();
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
### Parameters
|
|
491
|
+
|
|
492
|
+
| Parameter | Type | Required | Description |
|
|
493
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
494
|
+
| `request` | [components.EarnTransferRequest](../../models/components/earntransferrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
495
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
496
|
+
| `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. |
|
|
497
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
498
|
+
|
|
499
|
+
### Response
|
|
500
|
+
|
|
501
|
+
**Promise\<[components.EarnTransferResponse](../../models/components/earntransferresponse.md)\>**
|
|
502
|
+
|
|
503
|
+
### Errors
|
|
504
|
+
|
|
505
|
+
| Error Type | Status Code | Content Type |
|
|
506
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
507
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
508
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
509
|
+
|
|
510
|
+
## earnManage
|
|
511
|
+
|
|
512
|
+
Manage an Earn position for a given `owner`'s Earn Account.
|
|
513
|
+
|
|
514
|
+
The `owner` is the main wallet address that owns and controls the Earn Account. It is not the Earn Account address itself.
|
|
515
|
+
|
|
516
|
+
Venue Types:
|
|
517
|
+
- VAULTS
|
|
518
|
+
- AAVE
|
|
519
|
+
|
|
520
|
+
If `DEPOSIT` is selected for `action`, tokens will be deposited into the selected venue address from the Earn Account associated with the `owner` wallet.
|
|
521
|
+
|
|
522
|
+
If `WITHDRAW` is selected for `action`, tokens will be withdrawn from the selected venue address back into the Earn Account associated with the `owner` wallet.
|
|
523
|
+
|
|
524
|
+
A fee can be configured. This fee is deducted from the total `amount`. It can be expressed as a `FIXED` amount or a `PERCENTAGE` of `amount`.
|
|
525
|
+
|
|
526
|
+
The transaction can be gas-sponsored by an arbitrary wallet address which will sign, submit and pay the required gas for the transaction. If `gas_sponsorship` is set to `true`, EIP-712 typed data will be returned that must be signed by the `owner` and submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`) where the `sender` of the transaction can be set.
|
|
527
|
+
|
|
528
|
+
### Example Usage
|
|
529
|
+
|
|
530
|
+
<!-- UsageSnippet language="typescript" operationID="v2_earn_manage" method="post" path="/v2/earn/manage" -->
|
|
531
|
+
```typescript
|
|
532
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
533
|
+
|
|
534
|
+
const compassApiSDK = new CompassApiSDK({
|
|
535
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
async function run() {
|
|
539
|
+
const result = await compassApiSDK.earn.earnManage({
|
|
540
|
+
owner: "0xe5310C39a8A8f16E6126ee6B1006bf6eD58B3A49",
|
|
541
|
+
chain: "base",
|
|
542
|
+
venue: {
|
|
543
|
+
type: "VAULT",
|
|
544
|
+
vaultAddress: "0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A",
|
|
545
|
+
},
|
|
546
|
+
action: "WITHDRAW",
|
|
547
|
+
amount: "0.01",
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
console.log(result);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
run();
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
### Standalone function
|
|
557
|
+
|
|
558
|
+
The standalone function version of this method:
|
|
559
|
+
|
|
560
|
+
```typescript
|
|
561
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
562
|
+
import { earnEarnManage } from "@compass-labs/api-sdk/funcs/earnEarnManage.js";
|
|
563
|
+
|
|
564
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
565
|
+
// You can create one instance of it to use across an application.
|
|
566
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
567
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
async function run() {
|
|
571
|
+
const res = await earnEarnManage(compassApiSDK, {
|
|
572
|
+
owner: "0xe5310C39a8A8f16E6126ee6B1006bf6eD58B3A49",
|
|
573
|
+
chain: "base",
|
|
574
|
+
venue: {
|
|
575
|
+
type: "VAULT",
|
|
576
|
+
vaultAddress: "0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A",
|
|
577
|
+
},
|
|
578
|
+
action: "WITHDRAW",
|
|
579
|
+
amount: "0.01",
|
|
580
|
+
});
|
|
581
|
+
if (res.ok) {
|
|
582
|
+
const { value: result } = res;
|
|
583
|
+
console.log(result);
|
|
584
|
+
} else {
|
|
585
|
+
console.log("earnEarnManage failed:", res.error);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
run();
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
### Parameters
|
|
593
|
+
|
|
594
|
+
| Parameter | Type | Required | Description |
|
|
595
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
596
|
+
| `request` | [components.EarnManageRequest](../../models/components/earnmanagerequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
597
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
598
|
+
| `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. |
|
|
599
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
600
|
+
|
|
601
|
+
### Response
|
|
602
|
+
|
|
603
|
+
**Promise\<[components.EarnManageResponse](../../models/components/earnmanageresponse.md)\>**
|
|
604
|
+
|
|
605
|
+
### Errors
|
|
606
|
+
|
|
607
|
+
| Error Type | Status Code | Content Type |
|
|
608
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
609
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
610
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
611
|
+
|
|
612
|
+
## earnSwap
|
|
613
|
+
|
|
614
|
+
Swap tokens within an Earn Account.
|
|
615
|
+
|
|
616
|
+
### Example Usage
|
|
617
|
+
|
|
618
|
+
<!-- UsageSnippet language="typescript" operationID="v2_earn_swap" method="post" path="/v2/earn/swap" -->
|
|
619
|
+
```typescript
|
|
620
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
621
|
+
|
|
622
|
+
const compassApiSDK = new CompassApiSDK({
|
|
623
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
624
|
+
});
|
|
625
|
+
|
|
626
|
+
async function run() {
|
|
627
|
+
const result = await compassApiSDK.earn.earnSwap({
|
|
628
|
+
owner: "0xC1be8f91480648De355a45f3E2562811b4e2D3FF",
|
|
629
|
+
chain: "base",
|
|
630
|
+
tokenIn: "USDC",
|
|
631
|
+
tokenOut: "USDT",
|
|
632
|
+
amountIn: "0.01",
|
|
633
|
+
slippage: "0.5",
|
|
634
|
+
gasSponsorship: false,
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
console.log(result);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
run();
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
### Standalone function
|
|
644
|
+
|
|
645
|
+
The standalone function version of this method:
|
|
646
|
+
|
|
647
|
+
```typescript
|
|
648
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
649
|
+
import { earnEarnSwap } from "@compass-labs/api-sdk/funcs/earnEarnSwap.js";
|
|
650
|
+
|
|
651
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
652
|
+
// You can create one instance of it to use across an application.
|
|
653
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
654
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
async function run() {
|
|
658
|
+
const res = await earnEarnSwap(compassApiSDK, {
|
|
659
|
+
owner: "0xC1be8f91480648De355a45f3E2562811b4e2D3FF",
|
|
660
|
+
chain: "base",
|
|
661
|
+
tokenIn: "USDC",
|
|
662
|
+
tokenOut: "USDT",
|
|
663
|
+
amountIn: "0.01",
|
|
664
|
+
slippage: "0.5",
|
|
665
|
+
gasSponsorship: false,
|
|
666
|
+
});
|
|
667
|
+
if (res.ok) {
|
|
668
|
+
const { value: result } = res;
|
|
669
|
+
console.log(result);
|
|
670
|
+
} else {
|
|
671
|
+
console.log("earnEarnSwap failed:", res.error);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
run();
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
### Parameters
|
|
679
|
+
|
|
680
|
+
| Parameter | Type | Required | Description |
|
|
681
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
682
|
+
| `request` | [components.EarnSwapRequest](../../models/components/earnswaprequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
683
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
684
|
+
| `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. |
|
|
685
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
686
|
+
|
|
687
|
+
### Response
|
|
688
|
+
|
|
689
|
+
**Promise\<[components.EarnSwapResponse](../../models/components/earnswapresponse.md)\>**
|
|
690
|
+
|
|
691
|
+
### Errors
|
|
692
|
+
|
|
693
|
+
| Error Type | Status Code | Content Type |
|
|
694
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
695
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
696
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|