@compass-labs/api-sdk 1.0.4 → 1.0.6
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 +11 -0
- package/bin/mcp-server.js +2824 -1896
- package/bin/mcp-server.js.map +37 -19
- package/dist/commonjs/funcs/aaveV3AaveHistoricalTransactions.d.ts +4 -0
- package/dist/commonjs/funcs/aaveV3AaveHistoricalTransactions.d.ts.map +1 -1
- package/dist/commonjs/funcs/aaveV3AaveHistoricalTransactions.js +4 -0
- package/dist/commonjs/funcs/aaveV3AaveHistoricalTransactions.js.map +1 -1
- package/dist/commonjs/funcs/ethenaEthenaDeposit.d.ts +27 -0
- package/dist/commonjs/funcs/ethenaEthenaDeposit.d.ts.map +1 -0
- package/dist/commonjs/funcs/ethenaEthenaDeposit.js +127 -0
- package/dist/commonjs/funcs/ethenaEthenaDeposit.js.map +1 -0
- package/dist/commonjs/funcs/ethenaEthenaRequest.d.ts +34 -0
- package/dist/commonjs/funcs/ethenaEthenaRequest.d.ts.map +1 -0
- package/dist/commonjs/funcs/ethenaEthenaRequest.js +134 -0
- package/dist/commonjs/funcs/ethenaEthenaRequest.js.map +1 -0
- package/dist/commonjs/funcs/ethenaEthenaVault.d.ts +16 -0
- package/dist/commonjs/funcs/ethenaEthenaVault.d.ts.map +1 -0
- package/dist/commonjs/funcs/ethenaEthenaVault.js +121 -0
- package/dist/commonjs/funcs/ethenaEthenaVault.js.map +1 -0
- package/dist/commonjs/funcs/ethenaEthenaWithdraw.d.ts +29 -0
- package/dist/commonjs/funcs/ethenaEthenaWithdraw.d.ts.map +1 -0
- package/dist/commonjs/funcs/ethenaEthenaWithdraw.js +129 -0
- package/dist/commonjs/funcs/ethenaEthenaWithdraw.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- 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 +9 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/aaveV3AaveHistoricalTransactions.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools/aaveV3AaveHistoricalTransactions.js +5 -1
- package/dist/commonjs/mcp-server/tools/aaveV3AaveHistoricalTransactions.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/ethenaEthenaDeposit.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaDeposit.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaDeposit.js +74 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaDeposit.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaRequest.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaRequest.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaRequest.js +81 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaRequest.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaVault.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaVault.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaVault.js +62 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaVault.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaWithdraw.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaWithdraw.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaWithdraw.js +76 -0
- package/dist/commonjs/mcp-server/tools/ethenaEthenaWithdraw.js.map +1 -0
- package/dist/commonjs/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.d.ts +10 -4
- package/dist/commonjs/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.d.ts.map +1 -1
- package/dist/commonjs/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.js +8 -6
- package/dist/commonjs/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.js.map +1 -1
- package/dist/commonjs/models/components/cooldownposition.d.ts +66 -0
- package/dist/commonjs/models/components/cooldownposition.d.ts.map +1 -0
- package/dist/commonjs/models/components/cooldownposition.js +115 -0
- package/dist/commonjs/models/components/cooldownposition.js.map +1 -0
- package/dist/commonjs/models/components/ethenadepositparams.d.ts +63 -0
- package/dist/commonjs/models/components/ethenadepositparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/ethenadepositparams.js +105 -0
- package/dist/commonjs/models/components/ethenadepositparams.js.map +1 -0
- package/dist/commonjs/models/components/ethenadepositrequest.d.ts +93 -0
- package/dist/commonjs/models/components/ethenadepositrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/ethenadepositrequest.js +127 -0
- package/dist/commonjs/models/components/ethenadepositrequest.js.map +1 -0
- package/dist/commonjs/models/components/ethenagetvaultresponse.d.ts +80 -0
- package/dist/commonjs/models/components/ethenagetvaultresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/ethenagetvaultresponse.js +114 -0
- package/dist/commonjs/models/components/ethenagetvaultresponse.js.map +1 -0
- package/dist/commonjs/models/components/ethenarequesttowithdrawparams.d.ts +34 -0
- package/dist/commonjs/models/components/ethenarequesttowithdrawparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/ethenarequesttowithdrawparams.js +80 -0
- package/dist/commonjs/models/components/ethenarequesttowithdrawparams.js.map +1 -0
- package/dist/commonjs/models/components/ethenarequesttowithdrawrequest.d.ts +64 -0
- package/dist/commonjs/models/components/ethenarequesttowithdrawrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/ethenarequesttowithdrawrequest.js +102 -0
- package/dist/commonjs/models/components/ethenarequesttowithdrawrequest.js.map +1 -0
- package/dist/commonjs/models/components/ethenarequesttowithdrawtransactionresponse.d.ts +64 -0
- package/dist/commonjs/models/components/ethenarequesttowithdrawtransactionresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/ethenarequesttowithdrawtransactionresponse.js +122 -0
- package/dist/commonjs/models/components/ethenarequesttowithdrawtransactionresponse.js.map +1 -0
- package/dist/commonjs/models/components/ethenawithdrawparams.d.ts +39 -0
- package/dist/commonjs/models/components/ethenawithdrawparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/ethenawithdrawparams.js +82 -0
- package/dist/commonjs/models/components/ethenawithdrawparams.js.map +1 -0
- package/dist/commonjs/models/components/ethenawithdrawrequest.d.ts +69 -0
- package/dist/commonjs/models/components/ethenawithdrawrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/ethenawithdrawrequest.js +104 -0
- package/dist/commonjs/models/components/ethenawithdrawrequest.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +10 -1
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +10 -1
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/setallowanceparams.d.ts +3 -0
- package/dist/commonjs/models/components/setallowanceparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/setallowanceparams.js +1 -0
- package/dist/commonjs/models/components/setallowanceparams.js.map +1 -1
- package/dist/commonjs/models/components/setallowancerequest.d.ts +3 -0
- package/dist/commonjs/models/components/setallowancerequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/setallowancerequest.js +1 -0
- package/dist/commonjs/models/components/setallowancerequest.js.map +1 -1
- package/dist/commonjs/models/components/underlyingtoken.d.ts +35 -0
- package/dist/commonjs/models/components/underlyingtoken.d.ts.map +1 -0
- package/dist/commonjs/models/components/underlyingtoken.js +75 -0
- package/dist/commonjs/models/components/underlyingtoken.js.map +1 -0
- package/dist/commonjs/models/components/useroperation.d.ts +27 -0
- package/dist/commonjs/models/components/useroperation.d.ts.map +1 -1
- package/dist/commonjs/models/components/useroperation.js +27 -0
- package/dist/commonjs/models/components/useroperation.js.map +1 -1
- package/dist/commonjs/models/components/vaultgetvaultresponse.d.ts +3 -3
- package/dist/commonjs/models/components/vaultgetvaultresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/vaultgetvaultresponse.js +5 -3
- package/dist/commonjs/models/components/vaultgetvaultresponse.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/v1ethenavault.d.ts +62 -0
- package/dist/commonjs/models/operations/v1ethenavault.d.ts.map +1 -0
- package/dist/commonjs/models/operations/v1ethenavault.js +100 -0
- package/dist/commonjs/models/operations/v1ethenavault.js.map +1 -0
- package/dist/commonjs/models/operations/v1genericallowance.d.ts +3 -0
- package/dist/commonjs/models/operations/v1genericallowance.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v1genericallowance.js +1 -0
- package/dist/commonjs/models/operations/v1genericallowance.js.map +1 -1
- package/dist/commonjs/sdk/aavev3.d.ts +4 -0
- package/dist/commonjs/sdk/aavev3.d.ts.map +1 -1
- package/dist/commonjs/sdk/aavev3.js +4 -0
- package/dist/commonjs/sdk/aavev3.js.map +1 -1
- package/dist/commonjs/sdk/ethena.d.ts +67 -0
- package/dist/commonjs/sdk/ethena.d.ts.map +1 -0
- package/dist/commonjs/sdk/ethena.js +85 -0
- package/dist/commonjs/sdk/ethena.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/aaveV3AaveHistoricalTransactions.d.ts +4 -0
- package/dist/esm/funcs/aaveV3AaveHistoricalTransactions.d.ts.map +1 -1
- package/dist/esm/funcs/aaveV3AaveHistoricalTransactions.js +4 -0
- package/dist/esm/funcs/aaveV3AaveHistoricalTransactions.js.map +1 -1
- package/dist/esm/funcs/ethenaEthenaDeposit.d.ts +27 -0
- package/dist/esm/funcs/ethenaEthenaDeposit.d.ts.map +1 -0
- package/dist/esm/funcs/ethenaEthenaDeposit.js +91 -0
- package/dist/esm/funcs/ethenaEthenaDeposit.js.map +1 -0
- package/dist/esm/funcs/ethenaEthenaRequest.d.ts +34 -0
- package/dist/esm/funcs/ethenaEthenaRequest.d.ts.map +1 -0
- package/dist/esm/funcs/ethenaEthenaRequest.js +98 -0
- package/dist/esm/funcs/ethenaEthenaRequest.js.map +1 -0
- package/dist/esm/funcs/ethenaEthenaVault.d.ts +16 -0
- package/dist/esm/funcs/ethenaEthenaVault.d.ts.map +1 -0
- package/dist/esm/funcs/ethenaEthenaVault.js +85 -0
- package/dist/esm/funcs/ethenaEthenaVault.js.map +1 -0
- package/dist/esm/funcs/ethenaEthenaWithdraw.d.ts +29 -0
- package/dist/esm/funcs/ethenaEthenaWithdraw.d.ts.map +1 -0
- package/dist/esm/funcs/ethenaEthenaWithdraw.js +93 -0
- package/dist/esm/funcs/ethenaEthenaWithdraw.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- 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 +9 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/aaveV3AaveHistoricalTransactions.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools/aaveV3AaveHistoricalTransactions.js +5 -1
- package/dist/esm/mcp-server/tools/aaveV3AaveHistoricalTransactions.js.map +1 -1
- package/dist/esm/mcp-server/tools/ethenaEthenaDeposit.d.ts +8 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaDeposit.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaDeposit.js +38 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaDeposit.js.map +1 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaRequest.d.ts +8 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaRequest.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaRequest.js +45 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaRequest.js.map +1 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaVault.d.ts +8 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaVault.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaVault.js +26 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaVault.js.map +1 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaWithdraw.d.ts +8 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaWithdraw.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaWithdraw.js +40 -0
- package/dist/esm/mcp-server/tools/ethenaEthenaWithdraw.js.map +1 -0
- package/dist/esm/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.d.ts +10 -4
- package/dist/esm/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.d.ts.map +1 -1
- package/dist/esm/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.js +8 -6
- package/dist/esm/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.js.map +1 -1
- package/dist/esm/models/components/cooldownposition.d.ts +66 -0
- package/dist/esm/models/components/cooldownposition.d.ts.map +1 -0
- package/dist/esm/models/components/cooldownposition.js +75 -0
- package/dist/esm/models/components/cooldownposition.js.map +1 -0
- package/dist/esm/models/components/ethenadepositparams.d.ts +63 -0
- package/dist/esm/models/components/ethenadepositparams.d.ts.map +1 -0
- package/dist/esm/models/components/ethenadepositparams.js +65 -0
- package/dist/esm/models/components/ethenadepositparams.js.map +1 -0
- package/dist/esm/models/components/ethenadepositrequest.d.ts +93 -0
- package/dist/esm/models/components/ethenadepositrequest.d.ts.map +1 -0
- package/dist/esm/models/components/ethenadepositrequest.js +87 -0
- package/dist/esm/models/components/ethenadepositrequest.js.map +1 -0
- package/dist/esm/models/components/ethenagetvaultresponse.d.ts +80 -0
- package/dist/esm/models/components/ethenagetvaultresponse.d.ts.map +1 -0
- package/dist/esm/models/components/ethenagetvaultresponse.js +76 -0
- package/dist/esm/models/components/ethenagetvaultresponse.js.map +1 -0
- package/dist/esm/models/components/ethenarequesttowithdrawparams.d.ts +34 -0
- package/dist/esm/models/components/ethenarequesttowithdrawparams.d.ts.map +1 -0
- package/dist/esm/models/components/ethenarequesttowithdrawparams.js +42 -0
- package/dist/esm/models/components/ethenarequesttowithdrawparams.js.map +1 -0
- package/dist/esm/models/components/ethenarequesttowithdrawrequest.d.ts +64 -0
- package/dist/esm/models/components/ethenarequesttowithdrawrequest.d.ts.map +1 -0
- package/dist/esm/models/components/ethenarequesttowithdrawrequest.js +64 -0
- package/dist/esm/models/components/ethenarequesttowithdrawrequest.js.map +1 -0
- package/dist/esm/models/components/ethenarequesttowithdrawtransactionresponse.d.ts +64 -0
- package/dist/esm/models/components/ethenarequesttowithdrawtransactionresponse.d.ts.map +1 -0
- package/dist/esm/models/components/ethenarequesttowithdrawtransactionresponse.js +82 -0
- package/dist/esm/models/components/ethenarequesttowithdrawtransactionresponse.js.map +1 -0
- package/dist/esm/models/components/ethenawithdrawparams.d.ts +39 -0
- package/dist/esm/models/components/ethenawithdrawparams.d.ts.map +1 -0
- package/dist/esm/models/components/ethenawithdrawparams.js +44 -0
- package/dist/esm/models/components/ethenawithdrawparams.js.map +1 -0
- package/dist/esm/models/components/ethenawithdrawrequest.d.ts +69 -0
- package/dist/esm/models/components/ethenawithdrawrequest.d.ts.map +1 -0
- package/dist/esm/models/components/ethenawithdrawrequest.js +66 -0
- package/dist/esm/models/components/ethenawithdrawrequest.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +10 -1
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +10 -1
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/setallowanceparams.d.ts +3 -0
- package/dist/esm/models/components/setallowanceparams.d.ts.map +1 -1
- package/dist/esm/models/components/setallowanceparams.js +1 -0
- package/dist/esm/models/components/setallowanceparams.js.map +1 -1
- package/dist/esm/models/components/setallowancerequest.d.ts +3 -0
- package/dist/esm/models/components/setallowancerequest.d.ts.map +1 -1
- package/dist/esm/models/components/setallowancerequest.js +1 -0
- package/dist/esm/models/components/setallowancerequest.js.map +1 -1
- package/dist/esm/models/components/underlyingtoken.d.ts +35 -0
- package/dist/esm/models/components/underlyingtoken.d.ts.map +1 -0
- package/dist/esm/models/components/underlyingtoken.js +37 -0
- package/dist/esm/models/components/underlyingtoken.js.map +1 -0
- package/dist/esm/models/components/useroperation.d.ts +27 -0
- package/dist/esm/models/components/useroperation.d.ts.map +1 -1
- package/dist/esm/models/components/useroperation.js +27 -0
- package/dist/esm/models/components/useroperation.js.map +1 -1
- package/dist/esm/models/components/vaultgetvaultresponse.d.ts +3 -3
- package/dist/esm/models/components/vaultgetvaultresponse.d.ts.map +1 -1
- package/dist/esm/models/components/vaultgetvaultresponse.js +5 -3
- package/dist/esm/models/components/vaultgetvaultresponse.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/v1ethenavault.d.ts +62 -0
- package/dist/esm/models/operations/v1ethenavault.d.ts.map +1 -0
- package/dist/esm/models/operations/v1ethenavault.js +62 -0
- package/dist/esm/models/operations/v1ethenavault.js.map +1 -0
- package/dist/esm/models/operations/v1genericallowance.d.ts +3 -0
- package/dist/esm/models/operations/v1genericallowance.d.ts.map +1 -1
- package/dist/esm/models/operations/v1genericallowance.js +1 -0
- package/dist/esm/models/operations/v1genericallowance.js.map +1 -1
- package/dist/esm/sdk/aavev3.d.ts +4 -0
- package/dist/esm/sdk/aavev3.d.ts.map +1 -1
- package/dist/esm/sdk/aavev3.js +4 -0
- package/dist/esm/sdk/aavev3.js.map +1 -1
- package/dist/esm/sdk/ethena.d.ts +67 -0
- package/dist/esm/sdk/ethena.d.ts.map +1 -0
- package/dist/esm/sdk/ethena.js +81 -0
- package/dist/esm/sdk/ethena.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/sdks/aavev3/README.md +4 -0
- package/docs/sdks/ethena/README.md +354 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/aaveV3AaveHistoricalTransactions.ts +4 -0
- package/src/funcs/ethenaEthenaDeposit.ts +178 -0
- package/src/funcs/ethenaEthenaRequest.ts +189 -0
- package/src/funcs/ethenaEthenaVault.ts +173 -0
- package/src/funcs/ethenaEthenaWithdraw.ts +180 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +9 -1
- package/src/mcp-server/tools/aaveV3AaveHistoricalTransactions.ts +5 -1
- package/src/mcp-server/tools/ethenaEthenaDeposit.ts +47 -0
- package/src/mcp-server/tools/ethenaEthenaRequest.ts +54 -0
- package/src/mcp-server/tools/ethenaEthenaVault.ts +35 -0
- package/src/mcp-server/tools/ethenaEthenaWithdraw.ts +49 -0
- package/src/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.ts +18 -10
- package/src/models/components/cooldownposition.ts +151 -0
- package/src/models/components/ethenadepositparams.ts +142 -0
- package/src/models/components/ethenadepositrequest.ts +182 -0
- package/src/models/components/ethenagetvaultresponse.ts +188 -0
- package/src/models/components/ethenarequesttowithdrawparams.ts +88 -0
- package/src/models/components/ethenarequesttowithdrawrequest.ts +130 -0
- package/src/models/components/ethenarequesttowithdrawtransactionresponse.ts +208 -0
- package/src/models/components/ethenawithdrawparams.ts +89 -0
- package/src/models/components/ethenawithdrawrequest.ts +129 -0
- package/src/models/components/index.ts +10 -1
- package/src/models/components/setallowanceparams.ts +1 -0
- package/src/models/components/setallowancerequest.ts +1 -0
- package/src/models/components/underlyingtoken.ts +76 -0
- package/src/models/components/useroperation.ts +96 -0
- package/src/models/components/vaultgetvaultresponse.ts +12 -10
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/v1ethenavault.ts +116 -0
- package/src/models/operations/v1genericallowance.ts +1 -0
- package/src/sdk/aavev3.ts +4 -0
- package/src/sdk/ethena.ts +115 -0
- package/src/sdk/sdk.ts +6 -0
- package/dist/commonjs/models/components/compassapibackendmodelsvaultsreadresponsevaultasset.d.ts +0 -35
- package/dist/commonjs/models/components/compassapibackendmodelsvaultsreadresponsevaultasset.d.ts.map +0 -1
- package/dist/commonjs/models/components/compassapibackendmodelsvaultsreadresponsevaultasset.js +0 -75
- package/dist/commonjs/models/components/compassapibackendmodelsvaultsreadresponsevaultasset.js.map +0 -1
- package/dist/esm/models/components/compassapibackendmodelsvaultsreadresponsevaultasset.d.ts +0 -35
- package/dist/esm/models/components/compassapibackendmodelsvaultsreadresponsevaultasset.d.ts.map +0 -1
- package/dist/esm/models/components/compassapibackendmodelsvaultsreadresponsevaultasset.js +0 -37
- package/dist/esm/models/components/compassapibackendmodelsvaultsreadresponsevaultasset.js.map +0 -1
- package/src/models/components/compassapibackendmodelsvaultsreadresponsevaultasset.ts +0 -92
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
# Ethena
|
|
2
|
+
(*ethena*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [ethenaVault](#ethenavault) - Get Vault & User Position
|
|
9
|
+
* [ethenaDeposit](#ethenadeposit) - Deposit USDe
|
|
10
|
+
* [ethenaWithdraw](#ethenawithdraw) - Withdraw USDe
|
|
11
|
+
* [ethenaRequest](#ethenarequest) - Request to Withdraw USDe
|
|
12
|
+
|
|
13
|
+
## ethenaVault
|
|
14
|
+
|
|
15
|
+
Get Vault & User Position
|
|
16
|
+
|
|
17
|
+
### Example Usage
|
|
18
|
+
|
|
19
|
+
<!-- UsageSnippet language="typescript" operationID="v1_ethena_vault" method="get" path="/v1/ethena/vault" -->
|
|
20
|
+
```typescript
|
|
21
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
22
|
+
|
|
23
|
+
const compassApiSDK = new CompassApiSDK({
|
|
24
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
async function run() {
|
|
28
|
+
const result = await compassApiSDK.ethena.ethenaVault({});
|
|
29
|
+
|
|
30
|
+
console.log(result);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
run();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Standalone function
|
|
37
|
+
|
|
38
|
+
The standalone function version of this method:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
42
|
+
import { ethenaEthenaVault } from "@compass-labs/api-sdk/funcs/ethenaEthenaVault.js";
|
|
43
|
+
|
|
44
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
45
|
+
// You can create one instance of it to use across an application.
|
|
46
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
47
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
async function run() {
|
|
51
|
+
const res = await ethenaEthenaVault(compassApiSDK, {});
|
|
52
|
+
if (res.ok) {
|
|
53
|
+
const { value: result } = res;
|
|
54
|
+
console.log(result);
|
|
55
|
+
} else {
|
|
56
|
+
console.log("ethenaEthenaVault failed:", res.error);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
run();
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Parameters
|
|
64
|
+
|
|
65
|
+
| Parameter | Type | Required | Description |
|
|
66
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
67
|
+
| `request` | [operations.V1EthenaVaultRequest](../../models/operations/v1ethenavaultrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
68
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
69
|
+
| `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. |
|
|
70
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
71
|
+
|
|
72
|
+
### Response
|
|
73
|
+
|
|
74
|
+
**Promise\<[components.EthenaGetVaultResponse](../../models/components/ethenagetvaultresponse.md)\>**
|
|
75
|
+
|
|
76
|
+
### Errors
|
|
77
|
+
|
|
78
|
+
| Error Type | Status Code | Content Type |
|
|
79
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
80
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
81
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
82
|
+
|
|
83
|
+
## ethenaDeposit
|
|
84
|
+
|
|
85
|
+
Deposit USDe into a Ethena's Vault to earn passive yield.
|
|
86
|
+
|
|
87
|
+
The shares of a deposit are respresented as sUSDe.
|
|
88
|
+
<Info>
|
|
89
|
+
**Required Allowances**
|
|
90
|
+
|
|
91
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
92
|
+
|
|
93
|
+
- `EthenaVault`
|
|
94
|
+
</Info>
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
### Example Usage
|
|
98
|
+
|
|
99
|
+
<!-- UsageSnippet language="typescript" operationID="v1_ethena_deposit" method="post" path="/v1/ethena/deposit" -->
|
|
100
|
+
```typescript
|
|
101
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
102
|
+
|
|
103
|
+
const compassApiSDK = new CompassApiSDK({
|
|
104
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
async function run() {
|
|
108
|
+
const result = await compassApiSDK.ethena.ethenaDeposit({
|
|
109
|
+
amount: 1.5,
|
|
110
|
+
chain: "ethereum",
|
|
111
|
+
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
console.log(result);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
run();
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Standalone function
|
|
121
|
+
|
|
122
|
+
The standalone function version of this method:
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
126
|
+
import { ethenaEthenaDeposit } from "@compass-labs/api-sdk/funcs/ethenaEthenaDeposit.js";
|
|
127
|
+
|
|
128
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
129
|
+
// You can create one instance of it to use across an application.
|
|
130
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
131
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
async function run() {
|
|
135
|
+
const res = await ethenaEthenaDeposit(compassApiSDK, {
|
|
136
|
+
amount: 1.5,
|
|
137
|
+
chain: "ethereum",
|
|
138
|
+
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
139
|
+
});
|
|
140
|
+
if (res.ok) {
|
|
141
|
+
const { value: result } = res;
|
|
142
|
+
console.log(result);
|
|
143
|
+
} else {
|
|
144
|
+
console.log("ethenaEthenaDeposit failed:", res.error);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
run();
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Parameters
|
|
152
|
+
|
|
153
|
+
| Parameter | Type | Required | Description |
|
|
154
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
155
|
+
| `request` | [components.EthenaDepositRequest](../../models/components/ethenadepositrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
156
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
157
|
+
| `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. |
|
|
158
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
159
|
+
|
|
160
|
+
### Response
|
|
161
|
+
|
|
162
|
+
**Promise\<[components.TransactionResponse](../../models/components/transactionresponse.md)\>**
|
|
163
|
+
|
|
164
|
+
### Errors
|
|
165
|
+
|
|
166
|
+
| Error Type | Status Code | Content Type |
|
|
167
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
168
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
169
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
170
|
+
|
|
171
|
+
## ethenaWithdraw
|
|
172
|
+
|
|
173
|
+
Withdraw deposited USDe from Ethena's vault and cease earning passive yield.
|
|
174
|
+
|
|
175
|
+
The passive yield earned on USDe deposits is represented by the increased value of
|
|
176
|
+
the shares received (sUSDe) upon depositing USDe. Trade in these shares in exchange
|
|
177
|
+
for the intial USDe deposited and any accrued yield since depositing.
|
|
178
|
+
<Info>
|
|
179
|
+
**Required Allowances**
|
|
180
|
+
|
|
181
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
182
|
+
|
|
183
|
+
- `EthenaVault`
|
|
184
|
+
</Info>
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
### Example Usage
|
|
188
|
+
|
|
189
|
+
<!-- UsageSnippet language="typescript" operationID="v1_ethena_withdraw" method="post" path="/v1/ethena/withdraw" -->
|
|
190
|
+
```typescript
|
|
191
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
192
|
+
|
|
193
|
+
const compassApiSDK = new CompassApiSDK({
|
|
194
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
async function run() {
|
|
198
|
+
const result = await compassApiSDK.ethena.ethenaWithdraw({
|
|
199
|
+
amount: 1.5,
|
|
200
|
+
chain: "ethereum",
|
|
201
|
+
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
console.log(result);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
run();
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Standalone function
|
|
211
|
+
|
|
212
|
+
The standalone function version of this method:
|
|
213
|
+
|
|
214
|
+
```typescript
|
|
215
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
216
|
+
import { ethenaEthenaWithdraw } from "@compass-labs/api-sdk/funcs/ethenaEthenaWithdraw.js";
|
|
217
|
+
|
|
218
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
219
|
+
// You can create one instance of it to use across an application.
|
|
220
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
221
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
async function run() {
|
|
225
|
+
const res = await ethenaEthenaWithdraw(compassApiSDK, {
|
|
226
|
+
amount: 1.5,
|
|
227
|
+
chain: "ethereum",
|
|
228
|
+
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
229
|
+
});
|
|
230
|
+
if (res.ok) {
|
|
231
|
+
const { value: result } = res;
|
|
232
|
+
console.log(result);
|
|
233
|
+
} else {
|
|
234
|
+
console.log("ethenaEthenaWithdraw failed:", res.error);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
run();
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Parameters
|
|
242
|
+
|
|
243
|
+
| Parameter | Type | Required | Description |
|
|
244
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
245
|
+
| `request` | [components.EthenaWithdrawRequest](../../models/components/ethenawithdrawrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
246
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
247
|
+
| `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. |
|
|
248
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
249
|
+
|
|
250
|
+
### Response
|
|
251
|
+
|
|
252
|
+
**Promise\<[components.TransactionResponse](../../models/components/transactionresponse.md)\>**
|
|
253
|
+
|
|
254
|
+
### Errors
|
|
255
|
+
|
|
256
|
+
| Error Type | Status Code | Content Type |
|
|
257
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
258
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
259
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
260
|
+
|
|
261
|
+
## ethenaRequest
|
|
262
|
+
|
|
263
|
+
Request to withdraw deposited USDe from Ethena's vault.
|
|
264
|
+
|
|
265
|
+
The Ethena vault requires a cooldown period. Once a request to withdraw a specified
|
|
266
|
+
amount of USDe has been submitted, the alloted cooldown period must pass before the
|
|
267
|
+
withdraw USDe transaction can be submitted.
|
|
268
|
+
|
|
269
|
+
If an additional amount of USDe is requested to be withdrawn anytime before
|
|
270
|
+
withdrawing the originally requested amount, the cooldown period restarts.
|
|
271
|
+
|
|
272
|
+
Yield is not earned on USDe while in its cooldown period.
|
|
273
|
+
<Info>
|
|
274
|
+
**Required Allowances**
|
|
275
|
+
|
|
276
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
277
|
+
|
|
278
|
+
- `EthenaVault`
|
|
279
|
+
</Info>
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
### Example Usage
|
|
283
|
+
|
|
284
|
+
<!-- UsageSnippet language="typescript" operationID="v1_ethena_request" method="post" path="/v1/ethena/request" -->
|
|
285
|
+
```typescript
|
|
286
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
287
|
+
|
|
288
|
+
const compassApiSDK = new CompassApiSDK({
|
|
289
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
async function run() {
|
|
293
|
+
const result = await compassApiSDK.ethena.ethenaRequest({
|
|
294
|
+
amount: 1.5,
|
|
295
|
+
chain: "ethereum",
|
|
296
|
+
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
console.log(result);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
run();
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Standalone function
|
|
306
|
+
|
|
307
|
+
The standalone function version of this method:
|
|
308
|
+
|
|
309
|
+
```typescript
|
|
310
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
311
|
+
import { ethenaEthenaRequest } from "@compass-labs/api-sdk/funcs/ethenaEthenaRequest.js";
|
|
312
|
+
|
|
313
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
314
|
+
// You can create one instance of it to use across an application.
|
|
315
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
316
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
async function run() {
|
|
320
|
+
const res = await ethenaEthenaRequest(compassApiSDK, {
|
|
321
|
+
amount: 1.5,
|
|
322
|
+
chain: "ethereum",
|
|
323
|
+
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
324
|
+
});
|
|
325
|
+
if (res.ok) {
|
|
326
|
+
const { value: result } = res;
|
|
327
|
+
console.log(result);
|
|
328
|
+
} else {
|
|
329
|
+
console.log("ethenaEthenaRequest failed:", res.error);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
run();
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Parameters
|
|
337
|
+
|
|
338
|
+
| Parameter | Type | Required | Description |
|
|
339
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
340
|
+
| `request` | [components.EthenaRequestToWithdrawRequest](../../models/components/ethenarequesttowithdrawrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
341
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
342
|
+
| `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. |
|
|
343
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
344
|
+
|
|
345
|
+
### Response
|
|
346
|
+
|
|
347
|
+
**Promise\<[components.EthenaRequestToWithdrawTransactionResponse](../../models/components/ethenarequesttowithdrawtransactionresponse.md)\>**
|
|
348
|
+
|
|
349
|
+
### Errors
|
|
350
|
+
|
|
351
|
+
| Error Type | Status Code | Content Type |
|
|
352
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
353
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
354
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -36,6 +36,10 @@ import { Result } from "../types/fp.js";
|
|
|
36
36
|
* repayments. Each transaction includes details such as the token, amount, timestamp,
|
|
37
37
|
* and transaction type. This provides a comprehensive view of the user's historical
|
|
38
38
|
* activity within the AAVE protocol.
|
|
39
|
+
*
|
|
40
|
+
* ⚠️ Data comes from the official Aave subgraph (
|
|
41
|
+
* https://github.com/aave/protocol-subgraphs)
|
|
42
|
+
* and thus this particular endpoint may be less reliable than our other endpoints. ⚠️
|
|
39
43
|
*/
|
|
40
44
|
export function aaveV3AaveHistoricalTransactions(
|
|
41
45
|
client: CompassApiSDKCore,
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CompassApiSDKCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import { CompassAPISDKError } from "../models/errors/compassapisdkerror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Deposit USDe
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Deposit USDe into a Ethena's Vault to earn passive yield.
|
|
33
|
+
*
|
|
34
|
+
* The shares of a deposit are respresented as sUSDe.
|
|
35
|
+
* <Info>
|
|
36
|
+
* **Required Allowances**
|
|
37
|
+
*
|
|
38
|
+
* In order to make this transaction, token allowances need to be set for the following contracts.
|
|
39
|
+
*
|
|
40
|
+
* - `EthenaVault`
|
|
41
|
+
* </Info>
|
|
42
|
+
*/
|
|
43
|
+
export function ethenaEthenaDeposit(
|
|
44
|
+
client: CompassApiSDKCore,
|
|
45
|
+
request: components.EthenaDepositRequest,
|
|
46
|
+
options?: RequestOptions,
|
|
47
|
+
): APIPromise<
|
|
48
|
+
Result<
|
|
49
|
+
components.TransactionResponse,
|
|
50
|
+
| errors.HTTPValidationError
|
|
51
|
+
| CompassAPISDKError
|
|
52
|
+
| ResponseValidationError
|
|
53
|
+
| ConnectionError
|
|
54
|
+
| RequestAbortedError
|
|
55
|
+
| RequestTimeoutError
|
|
56
|
+
| InvalidRequestError
|
|
57
|
+
| UnexpectedClientError
|
|
58
|
+
| SDKValidationError
|
|
59
|
+
>
|
|
60
|
+
> {
|
|
61
|
+
return new APIPromise($do(
|
|
62
|
+
client,
|
|
63
|
+
request,
|
|
64
|
+
options,
|
|
65
|
+
));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function $do(
|
|
69
|
+
client: CompassApiSDKCore,
|
|
70
|
+
request: components.EthenaDepositRequest,
|
|
71
|
+
options?: RequestOptions,
|
|
72
|
+
): Promise<
|
|
73
|
+
[
|
|
74
|
+
Result<
|
|
75
|
+
components.TransactionResponse,
|
|
76
|
+
| errors.HTTPValidationError
|
|
77
|
+
| CompassAPISDKError
|
|
78
|
+
| ResponseValidationError
|
|
79
|
+
| ConnectionError
|
|
80
|
+
| RequestAbortedError
|
|
81
|
+
| RequestTimeoutError
|
|
82
|
+
| InvalidRequestError
|
|
83
|
+
| UnexpectedClientError
|
|
84
|
+
| SDKValidationError
|
|
85
|
+
>,
|
|
86
|
+
APICall,
|
|
87
|
+
]
|
|
88
|
+
> {
|
|
89
|
+
const parsed = safeParse(
|
|
90
|
+
request,
|
|
91
|
+
(value) => components.EthenaDepositRequest$outboundSchema.parse(value),
|
|
92
|
+
"Input validation failed",
|
|
93
|
+
);
|
|
94
|
+
if (!parsed.ok) {
|
|
95
|
+
return [parsed, { status: "invalid" }];
|
|
96
|
+
}
|
|
97
|
+
const payload = parsed.value;
|
|
98
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
99
|
+
|
|
100
|
+
const path = pathToFunc("/v1/ethena/deposit")();
|
|
101
|
+
|
|
102
|
+
const headers = new Headers(compactMap({
|
|
103
|
+
"Content-Type": "application/json",
|
|
104
|
+
Accept: "application/json",
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
108
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
109
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
110
|
+
|
|
111
|
+
const context = {
|
|
112
|
+
options: client._options,
|
|
113
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
114
|
+
operationID: "v1_ethena_deposit",
|
|
115
|
+
oAuth2Scopes: [],
|
|
116
|
+
|
|
117
|
+
resolvedSecurity: requestSecurity,
|
|
118
|
+
|
|
119
|
+
securitySource: client._options.apiKeyAuth,
|
|
120
|
+
retryConfig: options?.retries
|
|
121
|
+
|| client._options.retryConfig
|
|
122
|
+
|| { strategy: "none" },
|
|
123
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const requestRes = client._createRequest(context, {
|
|
127
|
+
security: requestSecurity,
|
|
128
|
+
method: "POST",
|
|
129
|
+
baseURL: options?.serverURL,
|
|
130
|
+
path: path,
|
|
131
|
+
headers: headers,
|
|
132
|
+
body: body,
|
|
133
|
+
userAgent: client._options.userAgent,
|
|
134
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
135
|
+
}, options);
|
|
136
|
+
if (!requestRes.ok) {
|
|
137
|
+
return [requestRes, { status: "invalid" }];
|
|
138
|
+
}
|
|
139
|
+
const req = requestRes.value;
|
|
140
|
+
|
|
141
|
+
const doResult = await client._do(req, {
|
|
142
|
+
context,
|
|
143
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
144
|
+
retryConfig: context.retryConfig,
|
|
145
|
+
retryCodes: context.retryCodes,
|
|
146
|
+
});
|
|
147
|
+
if (!doResult.ok) {
|
|
148
|
+
return [doResult, { status: "request-error", request: req }];
|
|
149
|
+
}
|
|
150
|
+
const response = doResult.value;
|
|
151
|
+
|
|
152
|
+
const responseFields = {
|
|
153
|
+
HttpMeta: { Response: response, Request: req },
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const [result] = await M.match<
|
|
157
|
+
components.TransactionResponse,
|
|
158
|
+
| errors.HTTPValidationError
|
|
159
|
+
| CompassAPISDKError
|
|
160
|
+
| ResponseValidationError
|
|
161
|
+
| ConnectionError
|
|
162
|
+
| RequestAbortedError
|
|
163
|
+
| RequestTimeoutError
|
|
164
|
+
| InvalidRequestError
|
|
165
|
+
| UnexpectedClientError
|
|
166
|
+
| SDKValidationError
|
|
167
|
+
>(
|
|
168
|
+
M.json(200, components.TransactionResponse$inboundSchema),
|
|
169
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
170
|
+
M.fail("4XX"),
|
|
171
|
+
M.fail("5XX"),
|
|
172
|
+
)(response, req, { extraFields: responseFields });
|
|
173
|
+
if (!result.ok) {
|
|
174
|
+
return [result, { status: "complete", request: req, response }];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return [result, { status: "complete", request: req, response }];
|
|
178
|
+
}
|