@compass-labs/api-sdk 2.2.19 → 2.2.20-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/codeSamples_typescript.yaml +36 -0
- package/dist/commonjs/funcs/creditCreditBorrow.d.ts +25 -0
- package/dist/commonjs/funcs/creditCreditBorrow.d.ts.map +1 -0
- package/dist/commonjs/funcs/creditCreditBorrow.js +125 -0
- package/dist/commonjs/funcs/creditCreditBorrow.js.map +1 -0
- package/dist/commonjs/funcs/creditCreditBundle.d.ts +21 -0
- package/dist/commonjs/funcs/creditCreditBundle.d.ts.map +1 -0
- package/dist/commonjs/funcs/creditCreditBundle.js +121 -0
- package/dist/commonjs/funcs/creditCreditBundle.js.map +1 -0
- package/dist/commonjs/funcs/creditCreditCreateAccount.d.ts +26 -0
- package/dist/commonjs/funcs/creditCreditCreateAccount.d.ts.map +1 -0
- package/dist/commonjs/funcs/creditCreditCreateAccount.js +126 -0
- package/dist/commonjs/funcs/creditCreditCreateAccount.js.map +1 -0
- package/dist/commonjs/funcs/creditCreditPositions.d.ts +22 -0
- package/dist/commonjs/funcs/creditCreditPositions.d.ts.map +1 -0
- package/dist/commonjs/funcs/creditCreditPositions.js +126 -0
- package/dist/commonjs/funcs/creditCreditPositions.js.map +1 -0
- package/dist/commonjs/funcs/creditCreditRepay.d.ts +26 -0
- package/dist/commonjs/funcs/creditCreditRepay.d.ts.map +1 -0
- package/dist/commonjs/funcs/creditCreditRepay.js +126 -0
- package/dist/commonjs/funcs/creditCreditRepay.js.map +1 -0
- package/dist/commonjs/funcs/creditCreditTransfer.d.ts +27 -0
- package/dist/commonjs/funcs/creditCreditTransfer.d.ts.map +1 -0
- package/dist/commonjs/funcs/creditCreditTransfer.js +127 -0
- package/dist/commonjs/funcs/creditCreditTransfer.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/accountsummary.d.ts +40 -0
- package/dist/commonjs/models/components/accountsummary.d.ts.map +1 -0
- package/dist/commonjs/models/components/accountsummary.js +66 -0
- package/dist/commonjs/models/components/accountsummary.js.map +1 -0
- package/dist/commonjs/models/components/borrowabletoken.d.ts +28 -0
- package/dist/commonjs/models/components/borrowabletoken.d.ts.map +1 -0
- package/dist/commonjs/models/components/borrowabletoken.js +59 -0
- package/dist/commonjs/models/components/borrowabletoken.js.map +1 -0
- package/dist/commonjs/models/components/collateralposition.d.ts +53 -0
- package/dist/commonjs/models/components/collateralposition.d.ts.map +1 -0
- package/dist/commonjs/models/components/collateralposition.js +71 -0
- package/dist/commonjs/models/components/collateralposition.js.map +1 -0
- package/dist/commonjs/models/components/createcreditaccountrequest.d.ts +39 -0
- package/dist/commonjs/models/components/createcreditaccountrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/createcreditaccountrequest.js +64 -0
- package/dist/commonjs/models/components/createcreditaccountrequest.js.map +1 -0
- package/dist/commonjs/models/components/createcreditaccountresponse.d.ts +21 -0
- package/dist/commonjs/models/components/createcreditaccountresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/createcreditaccountresponse.js +57 -0
- package/dist/commonjs/models/components/createcreditaccountresponse.js.map +1 -0
- package/dist/commonjs/models/components/creditborrowparams.d.ts +44 -0
- package/dist/commonjs/models/components/creditborrowparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditborrowparams.js +65 -0
- package/dist/commonjs/models/components/creditborrowparams.js.map +1 -0
- package/dist/commonjs/models/components/creditborrowrequest.d.ts +108 -0
- package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditborrowrequest.js +95 -0
- package/dist/commonjs/models/components/creditborrowrequest.js.map +1 -0
- package/dist/commonjs/models/components/creditborrowresponse.d.ts +23 -0
- package/dist/commonjs/models/components/creditborrowresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditborrowresponse.js +61 -0
- package/dist/commonjs/models/components/creditborrowresponse.js.map +1 -0
- package/dist/commonjs/models/components/creditbundlerequest.d.ts +35 -0
- package/dist/commonjs/models/components/creditbundlerequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditbundlerequest.js +59 -0
- package/dist/commonjs/models/components/creditbundlerequest.js.map +1 -0
- package/dist/commonjs/models/components/creditbundleresponse.d.ts +23 -0
- package/dist/commonjs/models/components/creditbundleresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditbundleresponse.js +61 -0
- package/dist/commonjs/models/components/creditbundleresponse.js.map +1 -0
- package/dist/commonjs/models/components/creditevent.d.ts +53 -0
- package/dist/commonjs/models/components/creditevent.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditevent.js +76 -0
- package/dist/commonjs/models/components/creditevent.js.map +1 -0
- package/dist/commonjs/models/components/creditpositionsresponse.d.ts +36 -0
- package/dist/commonjs/models/components/creditpositionsresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditpositionsresponse.js +67 -0
- package/dist/commonjs/models/components/creditpositionsresponse.js.map +1 -0
- package/dist/commonjs/models/components/creditrepayparams.d.ts +44 -0
- package/dist/commonjs/models/components/creditrepayparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditrepayparams.js +65 -0
- package/dist/commonjs/models/components/creditrepayparams.js.map +1 -0
- package/dist/commonjs/models/components/creditrepayrequest.d.ts +108 -0
- package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditrepayrequest.js +95 -0
- package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -0
- package/dist/commonjs/models/components/creditrepayresponse.d.ts +23 -0
- package/dist/commonjs/models/components/creditrepayresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditrepayresponse.js +61 -0
- package/dist/commonjs/models/components/creditrepayresponse.js.map +1 -0
- package/dist/commonjs/models/components/creditsupplyparams.d.ts +34 -0
- package/dist/commonjs/models/components/creditsupplyparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditsupplyparams.js +62 -0
- package/dist/commonjs/models/components/creditsupplyparams.js.map +1 -0
- package/dist/commonjs/models/components/credittransferrequest.d.ts +40 -0
- package/dist/commonjs/models/components/credittransferrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/credittransferrequest.js +59 -0
- package/dist/commonjs/models/components/credittransferrequest.js.map +1 -0
- package/dist/commonjs/models/components/credittransferresponse.d.ts +11 -0
- package/dist/commonjs/models/components/credittransferresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/credittransferresponse.js +56 -0
- package/dist/commonjs/models/components/credittransferresponse.js.map +1 -0
- package/dist/commonjs/models/components/credituseroperation.d.ts +28 -0
- package/dist/commonjs/models/components/credituseroperation.d.ts.map +1 -0
- package/dist/commonjs/models/components/credituseroperation.js +78 -0
- package/dist/commonjs/models/components/credituseroperation.js.map +1 -0
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts +34 -0
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditwithdrawparams.js +62 -0
- package/dist/commonjs/models/components/creditwithdrawparams.js.map +1 -0
- package/dist/commonjs/models/components/debtposition.d.ts +49 -0
- package/dist/commonjs/models/components/debtposition.d.ts.map +1 -0
- package/dist/commonjs/models/components/debtposition.js +69 -0
- package/dist/commonjs/models/components/debtposition.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +21 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +21 -0
- package/dist/commonjs/models/components/index.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/v2creditpositions.d.ts +26 -0
- package/dist/commonjs/models/operations/v2creditpositions.d.ts.map +1 -0
- package/dist/commonjs/models/operations/v2creditpositions.js +57 -0
- package/dist/commonjs/models/operations/v2creditpositions.js.map +1 -0
- package/dist/commonjs/sdk/credit.d.ts +86 -0
- package/dist/commonjs/sdk/credit.d.ts.map +1 -0
- package/dist/commonjs/sdk/credit.js +110 -0
- package/dist/commonjs/sdk/credit.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/creditCreditBorrow.d.ts +25 -0
- package/dist/esm/funcs/creditCreditBorrow.d.ts.map +1 -0
- package/dist/esm/funcs/creditCreditBorrow.js +89 -0
- package/dist/esm/funcs/creditCreditBorrow.js.map +1 -0
- package/dist/esm/funcs/creditCreditBundle.d.ts +21 -0
- package/dist/esm/funcs/creditCreditBundle.d.ts.map +1 -0
- package/dist/esm/funcs/creditCreditBundle.js +85 -0
- package/dist/esm/funcs/creditCreditBundle.js.map +1 -0
- package/dist/esm/funcs/creditCreditCreateAccount.d.ts +26 -0
- package/dist/esm/funcs/creditCreditCreateAccount.d.ts.map +1 -0
- package/dist/esm/funcs/creditCreditCreateAccount.js +90 -0
- package/dist/esm/funcs/creditCreditCreateAccount.js.map +1 -0
- package/dist/esm/funcs/creditCreditPositions.d.ts +22 -0
- package/dist/esm/funcs/creditCreditPositions.d.ts.map +1 -0
- package/dist/esm/funcs/creditCreditPositions.js +90 -0
- package/dist/esm/funcs/creditCreditPositions.js.map +1 -0
- package/dist/esm/funcs/creditCreditRepay.d.ts +26 -0
- package/dist/esm/funcs/creditCreditRepay.d.ts.map +1 -0
- package/dist/esm/funcs/creditCreditRepay.js +90 -0
- package/dist/esm/funcs/creditCreditRepay.js.map +1 -0
- package/dist/esm/funcs/creditCreditTransfer.d.ts +27 -0
- package/dist/esm/funcs/creditCreditTransfer.d.ts.map +1 -0
- package/dist/esm/funcs/creditCreditTransfer.js +91 -0
- package/dist/esm/funcs/creditCreditTransfer.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/accountsummary.d.ts +40 -0
- package/dist/esm/models/components/accountsummary.d.ts.map +1 -0
- package/dist/esm/models/components/accountsummary.js +29 -0
- package/dist/esm/models/components/accountsummary.js.map +1 -0
- package/dist/esm/models/components/borrowabletoken.d.ts +28 -0
- package/dist/esm/models/components/borrowabletoken.d.ts.map +1 -0
- package/dist/esm/models/components/borrowabletoken.js +22 -0
- package/dist/esm/models/components/borrowabletoken.js.map +1 -0
- package/dist/esm/models/components/collateralposition.d.ts +53 -0
- package/dist/esm/models/components/collateralposition.d.ts.map +1 -0
- package/dist/esm/models/components/collateralposition.js +34 -0
- package/dist/esm/models/components/collateralposition.js.map +1 -0
- package/dist/esm/models/components/createcreditaccountrequest.d.ts +39 -0
- package/dist/esm/models/components/createcreditaccountrequest.d.ts.map +1 -0
- package/dist/esm/models/components/createcreditaccountrequest.js +27 -0
- package/dist/esm/models/components/createcreditaccountrequest.js.map +1 -0
- package/dist/esm/models/components/createcreditaccountresponse.d.ts +21 -0
- package/dist/esm/models/components/createcreditaccountresponse.d.ts.map +1 -0
- package/dist/esm/models/components/createcreditaccountresponse.js +20 -0
- package/dist/esm/models/components/createcreditaccountresponse.js.map +1 -0
- package/dist/esm/models/components/creditborrowparams.d.ts +44 -0
- package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -0
- package/dist/esm/models/components/creditborrowparams.js +27 -0
- package/dist/esm/models/components/creditborrowparams.js.map +1 -0
- package/dist/esm/models/components/creditborrowrequest.d.ts +108 -0
- package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -0
- package/dist/esm/models/components/creditborrowrequest.js +55 -0
- package/dist/esm/models/components/creditborrowrequest.js.map +1 -0
- package/dist/esm/models/components/creditborrowresponse.d.ts +23 -0
- package/dist/esm/models/components/creditborrowresponse.d.ts.map +1 -0
- package/dist/esm/models/components/creditborrowresponse.js +24 -0
- package/dist/esm/models/components/creditborrowresponse.js.map +1 -0
- package/dist/esm/models/components/creditbundlerequest.d.ts +35 -0
- package/dist/esm/models/components/creditbundlerequest.d.ts.map +1 -0
- package/dist/esm/models/components/creditbundlerequest.js +22 -0
- package/dist/esm/models/components/creditbundlerequest.js.map +1 -0
- package/dist/esm/models/components/creditbundleresponse.d.ts +23 -0
- package/dist/esm/models/components/creditbundleresponse.d.ts.map +1 -0
- package/dist/esm/models/components/creditbundleresponse.js +24 -0
- package/dist/esm/models/components/creditbundleresponse.js.map +1 -0
- package/dist/esm/models/components/creditevent.d.ts +53 -0
- package/dist/esm/models/components/creditevent.d.ts.map +1 -0
- package/dist/esm/models/components/creditevent.js +39 -0
- package/dist/esm/models/components/creditevent.js.map +1 -0
- package/dist/esm/models/components/creditpositionsresponse.d.ts +36 -0
- package/dist/esm/models/components/creditpositionsresponse.d.ts.map +1 -0
- package/dist/esm/models/components/creditpositionsresponse.js +30 -0
- package/dist/esm/models/components/creditpositionsresponse.js.map +1 -0
- package/dist/esm/models/components/creditrepayparams.d.ts +44 -0
- package/dist/esm/models/components/creditrepayparams.d.ts.map +1 -0
- package/dist/esm/models/components/creditrepayparams.js +27 -0
- package/dist/esm/models/components/creditrepayparams.js.map +1 -0
- package/dist/esm/models/components/creditrepayrequest.d.ts +108 -0
- package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -0
- package/dist/esm/models/components/creditrepayrequest.js +55 -0
- package/dist/esm/models/components/creditrepayrequest.js.map +1 -0
- package/dist/esm/models/components/creditrepayresponse.d.ts +23 -0
- package/dist/esm/models/components/creditrepayresponse.d.ts.map +1 -0
- package/dist/esm/models/components/creditrepayresponse.js +24 -0
- package/dist/esm/models/components/creditrepayresponse.js.map +1 -0
- package/dist/esm/models/components/creditsupplyparams.d.ts +34 -0
- package/dist/esm/models/components/creditsupplyparams.d.ts.map +1 -0
- package/dist/esm/models/components/creditsupplyparams.js +24 -0
- package/dist/esm/models/components/creditsupplyparams.js.map +1 -0
- package/dist/esm/models/components/credittransferrequest.d.ts +40 -0
- package/dist/esm/models/components/credittransferrequest.d.ts.map +1 -0
- package/dist/esm/models/components/credittransferrequest.js +21 -0
- package/dist/esm/models/components/credittransferrequest.js.map +1 -0
- package/dist/esm/models/components/credittransferresponse.d.ts +11 -0
- package/dist/esm/models/components/credittransferresponse.d.ts.map +1 -0
- package/dist/esm/models/components/credittransferresponse.js +19 -0
- package/dist/esm/models/components/credittransferresponse.js.map +1 -0
- package/dist/esm/models/components/credituseroperation.d.ts +28 -0
- package/dist/esm/models/components/credituseroperation.d.ts.map +1 -0
- package/dist/esm/models/components/credituseroperation.js +40 -0
- package/dist/esm/models/components/credituseroperation.js.map +1 -0
- package/dist/esm/models/components/creditwithdrawparams.d.ts +34 -0
- package/dist/esm/models/components/creditwithdrawparams.d.ts.map +1 -0
- package/dist/esm/models/components/creditwithdrawparams.js +24 -0
- package/dist/esm/models/components/creditwithdrawparams.js.map +1 -0
- package/dist/esm/models/components/debtposition.d.ts +49 -0
- package/dist/esm/models/components/debtposition.d.ts.map +1 -0
- package/dist/esm/models/components/debtposition.js +32 -0
- package/dist/esm/models/components/debtposition.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +21 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +21 -0
- package/dist/esm/models/components/index.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/v2creditpositions.d.ts +26 -0
- package/dist/esm/models/operations/v2creditpositions.d.ts.map +1 -0
- package/dist/esm/models/operations/v2creditpositions.js +20 -0
- package/dist/esm/models/operations/v2creditpositions.js.map +1 -0
- package/dist/esm/sdk/credit.d.ts +86 -0
- package/dist/esm/sdk/credit.d.ts.map +1 -0
- package/dist/esm/sdk/credit.js +106 -0
- package/dist/esm/sdk/credit.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/models/components/accountsummary.md +30 -0
- package/docs/models/components/borrowabletoken.md +25 -0
- package/docs/models/components/borrowamount.md +19 -0
- package/docs/models/components/collateralposition.md +31 -0
- package/docs/models/components/createcreditaccountrequest.md +24 -0
- package/docs/models/components/createcreditaccountrequestchain.md +15 -0
- package/docs/models/components/createcreditaccountresponse.md +31 -0
- package/docs/models/components/creditborrowparams.md +24 -0
- package/docs/models/components/creditborrowparamsamount.md +19 -0
- package/docs/models/components/creditborrowrequest.md +38 -0
- package/docs/models/components/creditborrowrequestamountin.md +19 -0
- package/docs/models/components/creditborrowrequestslippage.md +19 -0
- package/docs/models/components/creditborrowresponse.md +17 -0
- package/docs/models/components/creditbundlerequest.md +25 -0
- package/docs/models/components/creditbundleresponse.md +19 -0
- package/docs/models/components/creditevent.md +29 -0
- package/docs/models/components/creditpositionsresponse.md +33 -0
- package/docs/models/components/creditrepayparams.md +24 -0
- package/docs/models/components/creditrepayparamsamount.md +19 -0
- package/docs/models/components/creditrepayrequest.md +37 -0
- package/docs/models/components/creditrepayrequestslippage.md +19 -0
- package/docs/models/components/creditrepayresponse.md +17 -0
- package/docs/models/components/creditsupplyparams.md +23 -0
- package/docs/models/components/creditsupplyparamsamount.md +19 -0
- package/docs/models/components/credittransferrequest.md +23 -0
- package/docs/models/components/credittransferrequestamount.md +19 -0
- package/docs/models/components/credittransferresponse.md +75 -0
- package/docs/models/components/credituseroperation.md +23 -0
- package/docs/models/components/credituseroperationbody.md +80 -0
- package/docs/models/components/creditwithdrawparams.md +23 -0
- package/docs/models/components/creditwithdrawparamsamount.md +19 -0
- package/docs/models/components/debtposition.md +30 -0
- package/docs/models/components/eventtype.md +17 -0
- package/docs/models/components/repayamount.md +19 -0
- package/docs/models/components/withdrawamount.md +19 -0
- package/docs/models/operations/v2creditpositionschain.md +15 -0
- package/docs/models/operations/v2creditpositionsrequest.md +19 -0
- package/docs/sdks/credit/README.md +562 -0
- package/package.json +1 -1
- package/src/funcs/creditCreditBorrow.ts +176 -0
- package/src/funcs/creditCreditBundle.ts +172 -0
- package/src/funcs/creditCreditCreateAccount.ts +178 -0
- package/src/funcs/creditCreditPositions.ts +178 -0
- package/src/funcs/creditCreditRepay.ts +177 -0
- package/src/funcs/creditCreditTransfer.ts +178 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/accountsummary.ts +77 -0
- package/src/models/components/borrowabletoken.ts +58 -0
- package/src/models/components/collateralposition.ts +94 -0
- package/src/models/components/createcreditaccountrequest.ts +72 -0
- package/src/models/components/createcreditaccountresponse.ts +51 -0
- package/src/models/components/creditborrowparams.ts +89 -0
- package/src/models/components/creditborrowrequest.ts +198 -0
- package/src/models/components/creditborrowresponse.ts +59 -0
- package/src/models/components/creditbundlerequest.ts +66 -0
- package/src/models/components/creditbundleresponse.ts +59 -0
- package/src/models/components/creditevent.ts +92 -0
- package/src/models/components/creditpositionsresponse.ts +79 -0
- package/src/models/components/creditrepayparams.ts +89 -0
- package/src/models/components/creditrepayrequest.ts +190 -0
- package/src/models/components/creditrepayresponse.ts +59 -0
- package/src/models/components/creditsupplyparams.ts +74 -0
- package/src/models/components/credittransferrequest.ts +78 -0
- package/src/models/components/credittransferresponse.ts +40 -0
- package/src/models/components/credituseroperation.ts +133 -0
- package/src/models/components/creditwithdrawparams.ts +74 -0
- package/src/models/components/debtposition.ts +88 -0
- package/src/models/components/index.ts +21 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/v2creditpositions.ts +50 -0
- package/src/sdk/credit.ts +156 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
UnsignedTransaction,
|
|
12
|
+
UnsignedTransaction$inboundSchema,
|
|
13
|
+
} from "./unsignedtransaction.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Response containing unsigned transaction to create compass Credit account.
|
|
17
|
+
*/
|
|
18
|
+
export type CreateCreditAccountResponse = {
|
|
19
|
+
/**
|
|
20
|
+
* Transaction to create compass credit account
|
|
21
|
+
*/
|
|
22
|
+
transaction: UnsignedTransaction | null;
|
|
23
|
+
/**
|
|
24
|
+
* Predicted address of the compass credit account that will be deployed
|
|
25
|
+
*/
|
|
26
|
+
creditAccountAddress: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const CreateCreditAccountResponse$inboundSchema: z.ZodType<
|
|
31
|
+
CreateCreditAccountResponse,
|
|
32
|
+
z.ZodTypeDef,
|
|
33
|
+
unknown
|
|
34
|
+
> = z.object({
|
|
35
|
+
transaction: z.nullable(UnsignedTransaction$inboundSchema),
|
|
36
|
+
credit_account_address: z.string(),
|
|
37
|
+
}).transform((v) => {
|
|
38
|
+
return remap$(v, {
|
|
39
|
+
"credit_account_address": "creditAccountAddress",
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export function createCreditAccountResponseFromJSON(
|
|
44
|
+
jsonString: string,
|
|
45
|
+
): SafeParseResult<CreateCreditAccountResponse, SDKValidationError> {
|
|
46
|
+
return safeParse(
|
|
47
|
+
jsonString,
|
|
48
|
+
(x) => CreateCreditAccountResponse$inboundSchema.parse(JSON.parse(x)),
|
|
49
|
+
`Failed to parse 'CreateCreditAccountResponse' from JSON`,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
InterestRateMode,
|
|
9
|
+
InterestRateMode$outboundSchema,
|
|
10
|
+
} from "./interestratemode.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Amount in token units to borrow.
|
|
14
|
+
*/
|
|
15
|
+
export type CreditBorrowParamsAmount = number | string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Borrow from Aave via Credit Account.
|
|
19
|
+
*/
|
|
20
|
+
export type CreditBorrowParams = {
|
|
21
|
+
actionType: "CREDIT_BORROW";
|
|
22
|
+
/**
|
|
23
|
+
* Token to borrow from Aave.
|
|
24
|
+
*/
|
|
25
|
+
token: string;
|
|
26
|
+
/**
|
|
27
|
+
* Amount in token units to borrow.
|
|
28
|
+
*/
|
|
29
|
+
amount: number | string;
|
|
30
|
+
/**
|
|
31
|
+
* On AAVE there are 2 different interest modes.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
*
|
|
35
|
+
* A stable (but typically higher rate), or a variable rate.
|
|
36
|
+
*/
|
|
37
|
+
interestRateMode?: InterestRateMode | undefined;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export type CreditBorrowParamsAmount$Outbound = number | string;
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const CreditBorrowParamsAmount$outboundSchema: z.ZodType<
|
|
45
|
+
CreditBorrowParamsAmount$Outbound,
|
|
46
|
+
z.ZodTypeDef,
|
|
47
|
+
CreditBorrowParamsAmount
|
|
48
|
+
> = z.union([z.number(), z.string()]);
|
|
49
|
+
|
|
50
|
+
export function creditBorrowParamsAmountToJSON(
|
|
51
|
+
creditBorrowParamsAmount: CreditBorrowParamsAmount,
|
|
52
|
+
): string {
|
|
53
|
+
return JSON.stringify(
|
|
54
|
+
CreditBorrowParamsAmount$outboundSchema.parse(creditBorrowParamsAmount),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export type CreditBorrowParams$Outbound = {
|
|
60
|
+
action_type: "CREDIT_BORROW";
|
|
61
|
+
token: string;
|
|
62
|
+
amount: number | string;
|
|
63
|
+
interest_rate_mode?: string | undefined;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const CreditBorrowParams$outboundSchema: z.ZodType<
|
|
68
|
+
CreditBorrowParams$Outbound,
|
|
69
|
+
z.ZodTypeDef,
|
|
70
|
+
CreditBorrowParams
|
|
71
|
+
> = z.object({
|
|
72
|
+
actionType: z.literal("CREDIT_BORROW"),
|
|
73
|
+
token: z.string(),
|
|
74
|
+
amount: z.union([z.number(), z.string()]),
|
|
75
|
+
interestRateMode: InterestRateMode$outboundSchema.optional(),
|
|
76
|
+
}).transform((v) => {
|
|
77
|
+
return remap$(v, {
|
|
78
|
+
actionType: "action_type",
|
|
79
|
+
interestRateMode: "interest_rate_mode",
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export function creditBorrowParamsToJSON(
|
|
84
|
+
creditBorrowParams: CreditBorrowParams,
|
|
85
|
+
): string {
|
|
86
|
+
return JSON.stringify(
|
|
87
|
+
CreditBorrowParams$outboundSchema.parse(creditBorrowParams),
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { Chain, Chain$outboundSchema } from "./chain.js";
|
|
8
|
+
import {
|
|
9
|
+
InterestRateMode,
|
|
10
|
+
InterestRateMode$outboundSchema,
|
|
11
|
+
} from "./interestratemode.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Amount of token_in to use (in token units, not wei).
|
|
15
|
+
*/
|
|
16
|
+
export type CreditBorrowRequestAmountIn = number | string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Amount to borrow (in token units, not wei).
|
|
20
|
+
*/
|
|
21
|
+
export type BorrowAmount = number | string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%). Only used when a swap is needed.
|
|
25
|
+
*/
|
|
26
|
+
export type CreditBorrowRequestSlippage = number | string;
|
|
27
|
+
|
|
28
|
+
export type CreditBorrowRequest = {
|
|
29
|
+
/**
|
|
30
|
+
* The address that owns the Credit Account.
|
|
31
|
+
*/
|
|
32
|
+
owner: string;
|
|
33
|
+
/**
|
|
34
|
+
* The chain to use.
|
|
35
|
+
*/
|
|
36
|
+
chain: Chain;
|
|
37
|
+
/**
|
|
38
|
+
* Token currently held in the Credit Account to use as input. If the same as collateral_token, no swap is performed.
|
|
39
|
+
*/
|
|
40
|
+
tokenIn: string;
|
|
41
|
+
/**
|
|
42
|
+
* Amount of token_in to use (in token units, not wei).
|
|
43
|
+
*/
|
|
44
|
+
amountIn: number | string;
|
|
45
|
+
/**
|
|
46
|
+
* Aave reserve token to supply as collateral.
|
|
47
|
+
*/
|
|
48
|
+
collateralToken: string;
|
|
49
|
+
/**
|
|
50
|
+
* Asset to borrow from Aave.
|
|
51
|
+
*/
|
|
52
|
+
borrowToken: string;
|
|
53
|
+
/**
|
|
54
|
+
* Amount to borrow (in token units, not wei).
|
|
55
|
+
*/
|
|
56
|
+
borrowAmount: number | string;
|
|
57
|
+
/**
|
|
58
|
+
* On AAVE there are 2 different interest modes.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
*
|
|
62
|
+
* A stable (but typically higher rate), or a variable rate.
|
|
63
|
+
*/
|
|
64
|
+
interestRateMode?: InterestRateMode | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%). Only used when a swap is needed.
|
|
67
|
+
*/
|
|
68
|
+
slippage?: number | string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* If true, returns EIP-712 signature data instead of an unsigned transaction.
|
|
71
|
+
*/
|
|
72
|
+
gasSponsorship?: boolean | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* The EOA owner's signature of the Permit2 PermitTransferFrom typed data. When provided, the borrow bundle will first pull token_in from the owner's EOA into the Credit Account via Permit2. Obtain by calling /v2/credit/transfer and signing the returned EIP-712 data.
|
|
75
|
+
*/
|
|
76
|
+
permit2Signature?: string | null | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* The nonce used in the Permit2 signature (from the signed typed data).
|
|
79
|
+
*/
|
|
80
|
+
permit2Nonce?: number | null | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* The deadline timestamp used in the Permit2 signature (from the signed typed data).
|
|
83
|
+
*/
|
|
84
|
+
permit2Deadline?: number | null | undefined;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** @internal */
|
|
88
|
+
export type CreditBorrowRequestAmountIn$Outbound = number | string;
|
|
89
|
+
|
|
90
|
+
/** @internal */
|
|
91
|
+
export const CreditBorrowRequestAmountIn$outboundSchema: z.ZodType<
|
|
92
|
+
CreditBorrowRequestAmountIn$Outbound,
|
|
93
|
+
z.ZodTypeDef,
|
|
94
|
+
CreditBorrowRequestAmountIn
|
|
95
|
+
> = z.union([z.number(), z.string()]);
|
|
96
|
+
|
|
97
|
+
export function creditBorrowRequestAmountInToJSON(
|
|
98
|
+
creditBorrowRequestAmountIn: CreditBorrowRequestAmountIn,
|
|
99
|
+
): string {
|
|
100
|
+
return JSON.stringify(
|
|
101
|
+
CreditBorrowRequestAmountIn$outboundSchema.parse(
|
|
102
|
+
creditBorrowRequestAmountIn,
|
|
103
|
+
),
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** @internal */
|
|
108
|
+
export type BorrowAmount$Outbound = number | string;
|
|
109
|
+
|
|
110
|
+
/** @internal */
|
|
111
|
+
export const BorrowAmount$outboundSchema: z.ZodType<
|
|
112
|
+
BorrowAmount$Outbound,
|
|
113
|
+
z.ZodTypeDef,
|
|
114
|
+
BorrowAmount
|
|
115
|
+
> = z.union([z.number(), z.string()]);
|
|
116
|
+
|
|
117
|
+
export function borrowAmountToJSON(borrowAmount: BorrowAmount): string {
|
|
118
|
+
return JSON.stringify(BorrowAmount$outboundSchema.parse(borrowAmount));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** @internal */
|
|
122
|
+
export type CreditBorrowRequestSlippage$Outbound = number | string;
|
|
123
|
+
|
|
124
|
+
/** @internal */
|
|
125
|
+
export const CreditBorrowRequestSlippage$outboundSchema: z.ZodType<
|
|
126
|
+
CreditBorrowRequestSlippage$Outbound,
|
|
127
|
+
z.ZodTypeDef,
|
|
128
|
+
CreditBorrowRequestSlippage
|
|
129
|
+
> = z.union([z.number(), z.string()]);
|
|
130
|
+
|
|
131
|
+
export function creditBorrowRequestSlippageToJSON(
|
|
132
|
+
creditBorrowRequestSlippage: CreditBorrowRequestSlippage,
|
|
133
|
+
): string {
|
|
134
|
+
return JSON.stringify(
|
|
135
|
+
CreditBorrowRequestSlippage$outboundSchema.parse(
|
|
136
|
+
creditBorrowRequestSlippage,
|
|
137
|
+
),
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** @internal */
|
|
142
|
+
export type CreditBorrowRequest$Outbound = {
|
|
143
|
+
owner: string;
|
|
144
|
+
chain: string;
|
|
145
|
+
token_in: string;
|
|
146
|
+
amount_in: number | string;
|
|
147
|
+
collateral_token: string;
|
|
148
|
+
borrow_token: string;
|
|
149
|
+
borrow_amount: number | string;
|
|
150
|
+
interest_rate_mode?: string | undefined;
|
|
151
|
+
slippage?: number | string | undefined;
|
|
152
|
+
gas_sponsorship?: boolean | undefined;
|
|
153
|
+
permit2_signature?: string | null | undefined;
|
|
154
|
+
permit2_nonce?: number | null | undefined;
|
|
155
|
+
permit2_deadline?: number | null | undefined;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
/** @internal */
|
|
159
|
+
export const CreditBorrowRequest$outboundSchema: z.ZodType<
|
|
160
|
+
CreditBorrowRequest$Outbound,
|
|
161
|
+
z.ZodTypeDef,
|
|
162
|
+
CreditBorrowRequest
|
|
163
|
+
> = z.object({
|
|
164
|
+
owner: z.string(),
|
|
165
|
+
chain: Chain$outboundSchema,
|
|
166
|
+
tokenIn: z.string(),
|
|
167
|
+
amountIn: z.union([z.number(), z.string()]),
|
|
168
|
+
collateralToken: z.string(),
|
|
169
|
+
borrowToken: z.string(),
|
|
170
|
+
borrowAmount: z.union([z.number(), z.string()]),
|
|
171
|
+
interestRateMode: InterestRateMode$outboundSchema.optional(),
|
|
172
|
+
slippage: z.union([z.number(), z.string()]).optional(),
|
|
173
|
+
gasSponsorship: z.boolean().optional(),
|
|
174
|
+
permit2Signature: z.nullable(z.string()).optional(),
|
|
175
|
+
permit2Nonce: z.nullable(z.number().int()).optional(),
|
|
176
|
+
permit2Deadline: z.nullable(z.number().int()).optional(),
|
|
177
|
+
}).transform((v) => {
|
|
178
|
+
return remap$(v, {
|
|
179
|
+
tokenIn: "token_in",
|
|
180
|
+
amountIn: "amount_in",
|
|
181
|
+
collateralToken: "collateral_token",
|
|
182
|
+
borrowToken: "borrow_token",
|
|
183
|
+
borrowAmount: "borrow_amount",
|
|
184
|
+
interestRateMode: "interest_rate_mode",
|
|
185
|
+
gasSponsorship: "gas_sponsorship",
|
|
186
|
+
permit2Signature: "permit2_signature",
|
|
187
|
+
permit2Nonce: "permit2_nonce",
|
|
188
|
+
permit2Deadline: "permit2_deadline",
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
export function creditBorrowRequestToJSON(
|
|
193
|
+
creditBorrowRequest: CreditBorrowRequest,
|
|
194
|
+
): string {
|
|
195
|
+
return JSON.stringify(
|
|
196
|
+
CreditBorrowRequest$outboundSchema.parse(creditBorrowRequest),
|
|
197
|
+
);
|
|
198
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
BatchedSafeOperationsResponseOutput,
|
|
12
|
+
BatchedSafeOperationsResponseOutput$inboundSchema,
|
|
13
|
+
} from "./batchedsafeoperationsresponseoutput.js";
|
|
14
|
+
import {
|
|
15
|
+
UnsignedTransaction,
|
|
16
|
+
UnsignedTransaction$inboundSchema,
|
|
17
|
+
} from "./unsignedtransaction.js";
|
|
18
|
+
|
|
19
|
+
export type CreditBorrowResponse = {
|
|
20
|
+
/**
|
|
21
|
+
* Unsigned transaction to execute the borrow bundle. Present when gas_sponsorship is false.
|
|
22
|
+
*/
|
|
23
|
+
transaction?: UnsignedTransaction | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship is true.
|
|
26
|
+
*/
|
|
27
|
+
eip712?: BatchedSafeOperationsResponseOutput | null | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Estimated amount of collateral token received from swap. Only present when token_in differs from collateral_token.
|
|
30
|
+
*/
|
|
31
|
+
estimatedCollateralAmount?: string | null | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const CreditBorrowResponse$inboundSchema: z.ZodType<
|
|
36
|
+
CreditBorrowResponse,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
unknown
|
|
39
|
+
> = z.object({
|
|
40
|
+
transaction: z.nullable(UnsignedTransaction$inboundSchema).optional(),
|
|
41
|
+
eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema)
|
|
42
|
+
.optional(),
|
|
43
|
+
estimated_collateral_amount: z.nullable(z.string()).optional(),
|
|
44
|
+
}).transform((v) => {
|
|
45
|
+
return remap$(v, {
|
|
46
|
+
"eip_712": "eip712",
|
|
47
|
+
"estimated_collateral_amount": "estimatedCollateralAmount",
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export function creditBorrowResponseFromJSON(
|
|
52
|
+
jsonString: string,
|
|
53
|
+
): SafeParseResult<CreditBorrowResponse, SDKValidationError> {
|
|
54
|
+
return safeParse(
|
|
55
|
+
jsonString,
|
|
56
|
+
(x) => CreditBorrowResponse$inboundSchema.parse(JSON.parse(x)),
|
|
57
|
+
`Failed to parse 'CreditBorrowResponse' from JSON`,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { Chain, Chain$outboundSchema } from "./chain.js";
|
|
8
|
+
import {
|
|
9
|
+
CreditUserOperation,
|
|
10
|
+
CreditUserOperation$Outbound,
|
|
11
|
+
CreditUserOperation$outboundSchema,
|
|
12
|
+
} from "./credituseroperation.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Request to execute multiple credit actions in a single atomic transaction.
|
|
16
|
+
*/
|
|
17
|
+
export type CreditBundleRequest = {
|
|
18
|
+
/**
|
|
19
|
+
* The owner's wallet address that controls the Credit Account.
|
|
20
|
+
*/
|
|
21
|
+
owner: string;
|
|
22
|
+
/**
|
|
23
|
+
* The chain to use.
|
|
24
|
+
*/
|
|
25
|
+
chain: Chain;
|
|
26
|
+
/**
|
|
27
|
+
* List of actions to bundle. Actions are executed in order.
|
|
28
|
+
*/
|
|
29
|
+
actions: Array<CreditUserOperation>;
|
|
30
|
+
/**
|
|
31
|
+
* If true, returns EIP-712 typed data for gas-sponsored execution.
|
|
32
|
+
*/
|
|
33
|
+
gasSponsorship?: boolean | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export type CreditBundleRequest$Outbound = {
|
|
38
|
+
owner: string;
|
|
39
|
+
chain: string;
|
|
40
|
+
actions: Array<CreditUserOperation$Outbound>;
|
|
41
|
+
gas_sponsorship?: boolean | undefined;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const CreditBundleRequest$outboundSchema: z.ZodType<
|
|
46
|
+
CreditBundleRequest$Outbound,
|
|
47
|
+
z.ZodTypeDef,
|
|
48
|
+
CreditBundleRequest
|
|
49
|
+
> = z.object({
|
|
50
|
+
owner: z.string(),
|
|
51
|
+
chain: Chain$outboundSchema,
|
|
52
|
+
actions: z.array(CreditUserOperation$outboundSchema),
|
|
53
|
+
gasSponsorship: z.boolean().optional(),
|
|
54
|
+
}).transform((v) => {
|
|
55
|
+
return remap$(v, {
|
|
56
|
+
gasSponsorship: "gas_sponsorship",
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export function creditBundleRequestToJSON(
|
|
61
|
+
creditBundleRequest: CreditBundleRequest,
|
|
62
|
+
): string {
|
|
63
|
+
return JSON.stringify(
|
|
64
|
+
CreditBundleRequest$outboundSchema.parse(creditBundleRequest),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
BatchedSafeOperationsResponseOutput,
|
|
12
|
+
BatchedSafeOperationsResponseOutput$inboundSchema,
|
|
13
|
+
} from "./batchedsafeoperationsresponseoutput.js";
|
|
14
|
+
import {
|
|
15
|
+
UnsignedTransaction,
|
|
16
|
+
UnsignedTransaction$inboundSchema,
|
|
17
|
+
} from "./unsignedtransaction.js";
|
|
18
|
+
|
|
19
|
+
export type CreditBundleResponse = {
|
|
20
|
+
/**
|
|
21
|
+
* Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false.
|
|
22
|
+
*/
|
|
23
|
+
transaction?: UnsignedTransaction | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true. Owner must sign and submit to /gas_sponsorship/prepare.
|
|
26
|
+
*/
|
|
27
|
+
eip712?: BatchedSafeOperationsResponseOutput | null | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Number of individual transactions bundled in this execution.
|
|
30
|
+
*/
|
|
31
|
+
actionsCount: number;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const CreditBundleResponse$inboundSchema: z.ZodType<
|
|
36
|
+
CreditBundleResponse,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
unknown
|
|
39
|
+
> = z.object({
|
|
40
|
+
transaction: z.nullable(UnsignedTransaction$inboundSchema).optional(),
|
|
41
|
+
eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema)
|
|
42
|
+
.optional(),
|
|
43
|
+
actions_count: z.number().int(),
|
|
44
|
+
}).transform((v) => {
|
|
45
|
+
return remap$(v, {
|
|
46
|
+
"eip_712": "eip712",
|
|
47
|
+
"actions_count": "actionsCount",
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export function creditBundleResponseFromJSON(
|
|
52
|
+
jsonString: string,
|
|
53
|
+
): SafeParseResult<CreditBundleResponse, SDKValidationError> {
|
|
54
|
+
return safeParse(
|
|
55
|
+
jsonString,
|
|
56
|
+
(x) => CreditBundleResponse$inboundSchema.parse(JSON.parse(x)),
|
|
57
|
+
`Failed to parse 'CreditBundleResponse' from JSON`,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Type of credit event.
|
|
14
|
+
*/
|
|
15
|
+
export const EventType = {
|
|
16
|
+
Supply: "supply",
|
|
17
|
+
Withdraw: "withdraw",
|
|
18
|
+
Borrow: "borrow",
|
|
19
|
+
Repay: "repay",
|
|
20
|
+
Liquidation: "liquidation",
|
|
21
|
+
} as const;
|
|
22
|
+
/**
|
|
23
|
+
* Type of credit event.
|
|
24
|
+
*/
|
|
25
|
+
export type EventType = ClosedEnum<typeof EventType>;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A single historical event in a credit position.
|
|
29
|
+
*/
|
|
30
|
+
export type CreditEvent = {
|
|
31
|
+
/**
|
|
32
|
+
* Type of credit event.
|
|
33
|
+
*/
|
|
34
|
+
eventType: EventType;
|
|
35
|
+
/**
|
|
36
|
+
* Block number when the event occurred
|
|
37
|
+
*/
|
|
38
|
+
blockNumber: number;
|
|
39
|
+
/**
|
|
40
|
+
* Timestamp when the event occurred
|
|
41
|
+
*/
|
|
42
|
+
blockTimestamp: Date;
|
|
43
|
+
/**
|
|
44
|
+
* Transaction hash of the event
|
|
45
|
+
*/
|
|
46
|
+
transactionHash: string;
|
|
47
|
+
/**
|
|
48
|
+
* Amount involved in the event
|
|
49
|
+
*/
|
|
50
|
+
amount: string;
|
|
51
|
+
/**
|
|
52
|
+
* Symbol of the token
|
|
53
|
+
*/
|
|
54
|
+
symbol: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const EventType$inboundSchema: z.ZodNativeEnum<typeof EventType> = z
|
|
59
|
+
.nativeEnum(EventType);
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const CreditEvent$inboundSchema: z.ZodType<
|
|
63
|
+
CreditEvent,
|
|
64
|
+
z.ZodTypeDef,
|
|
65
|
+
unknown
|
|
66
|
+
> = z.object({
|
|
67
|
+
event_type: EventType$inboundSchema,
|
|
68
|
+
block_number: z.number().int(),
|
|
69
|
+
block_timestamp: z.string().datetime({ offset: true }).transform(v =>
|
|
70
|
+
new Date(v)
|
|
71
|
+
),
|
|
72
|
+
transaction_hash: z.string(),
|
|
73
|
+
amount: z.string(),
|
|
74
|
+
symbol: z.string(),
|
|
75
|
+
}).transform((v) => {
|
|
76
|
+
return remap$(v, {
|
|
77
|
+
"event_type": "eventType",
|
|
78
|
+
"block_number": "blockNumber",
|
|
79
|
+
"block_timestamp": "blockTimestamp",
|
|
80
|
+
"transaction_hash": "transactionHash",
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export function creditEventFromJSON(
|
|
85
|
+
jsonString: string,
|
|
86
|
+
): SafeParseResult<CreditEvent, SDKValidationError> {
|
|
87
|
+
return safeParse(
|
|
88
|
+
jsonString,
|
|
89
|
+
(x) => CreditEvent$inboundSchema.parse(JSON.parse(x)),
|
|
90
|
+
`Failed to parse 'CreditEvent' from JSON`,
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
AccountSummary,
|
|
12
|
+
AccountSummary$inboundSchema,
|
|
13
|
+
} from "./accountsummary.js";
|
|
14
|
+
import {
|
|
15
|
+
BorrowableToken,
|
|
16
|
+
BorrowableToken$inboundSchema,
|
|
17
|
+
} from "./borrowabletoken.js";
|
|
18
|
+
import {
|
|
19
|
+
CollateralPosition,
|
|
20
|
+
CollateralPosition$inboundSchema,
|
|
21
|
+
} from "./collateralposition.js";
|
|
22
|
+
import { DebtPosition, DebtPosition$inboundSchema } from "./debtposition.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Credit account positions response with per-reserve positions and account summary.
|
|
26
|
+
*/
|
|
27
|
+
export type CreditPositionsResponse = {
|
|
28
|
+
/**
|
|
29
|
+
* All collateral positions, one per reserve.
|
|
30
|
+
*/
|
|
31
|
+
collateralPositions?: Array<CollateralPosition> | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* All debt positions, one per reserve.
|
|
34
|
+
*/
|
|
35
|
+
debtPositions?: Array<DebtPosition> | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Aave account-level summary from getUserAccountData().
|
|
38
|
+
*/
|
|
39
|
+
accountSummary: AccountSummary;
|
|
40
|
+
/**
|
|
41
|
+
* All tokens available for borrowing with max amounts based on current collateral.
|
|
42
|
+
*/
|
|
43
|
+
borrowableTokens?: Array<BorrowableToken> | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Net position value in USD (total collateral - total debt). Null if prices unavailable.
|
|
46
|
+
*/
|
|
47
|
+
totalUsdValue?: string | null | undefined;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
export const CreditPositionsResponse$inboundSchema: z.ZodType<
|
|
52
|
+
CreditPositionsResponse,
|
|
53
|
+
z.ZodTypeDef,
|
|
54
|
+
unknown
|
|
55
|
+
> = z.object({
|
|
56
|
+
collateral_positions: z.array(CollateralPosition$inboundSchema).optional(),
|
|
57
|
+
debt_positions: z.array(DebtPosition$inboundSchema).optional(),
|
|
58
|
+
account_summary: AccountSummary$inboundSchema,
|
|
59
|
+
borrowable_tokens: z.array(BorrowableToken$inboundSchema).optional(),
|
|
60
|
+
total_usd_value: z.nullable(z.string()).optional(),
|
|
61
|
+
}).transform((v) => {
|
|
62
|
+
return remap$(v, {
|
|
63
|
+
"collateral_positions": "collateralPositions",
|
|
64
|
+
"debt_positions": "debtPositions",
|
|
65
|
+
"account_summary": "accountSummary",
|
|
66
|
+
"borrowable_tokens": "borrowableTokens",
|
|
67
|
+
"total_usd_value": "totalUsdValue",
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export function creditPositionsResponseFromJSON(
|
|
72
|
+
jsonString: string,
|
|
73
|
+
): SafeParseResult<CreditPositionsResponse, SDKValidationError> {
|
|
74
|
+
return safeParse(
|
|
75
|
+
jsonString,
|
|
76
|
+
(x) => CreditPositionsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
77
|
+
`Failed to parse 'CreditPositionsResponse' from JSON`,
|
|
78
|
+
);
|
|
79
|
+
}
|