@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,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 repay.
|
|
14
|
+
*/
|
|
15
|
+
export type CreditRepayParamsAmount = number | string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Repay debt to Aave via Credit Account.
|
|
19
|
+
*/
|
|
20
|
+
export type CreditRepayParams = {
|
|
21
|
+
actionType: "CREDIT_REPAY";
|
|
22
|
+
/**
|
|
23
|
+
* Token to repay to Aave.
|
|
24
|
+
*/
|
|
25
|
+
token: string;
|
|
26
|
+
/**
|
|
27
|
+
* Amount in token units to repay.
|
|
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 CreditRepayParamsAmount$Outbound = number | string;
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const CreditRepayParamsAmount$outboundSchema: z.ZodType<
|
|
45
|
+
CreditRepayParamsAmount$Outbound,
|
|
46
|
+
z.ZodTypeDef,
|
|
47
|
+
CreditRepayParamsAmount
|
|
48
|
+
> = z.union([z.number(), z.string()]);
|
|
49
|
+
|
|
50
|
+
export function creditRepayParamsAmountToJSON(
|
|
51
|
+
creditRepayParamsAmount: CreditRepayParamsAmount,
|
|
52
|
+
): string {
|
|
53
|
+
return JSON.stringify(
|
|
54
|
+
CreditRepayParamsAmount$outboundSchema.parse(creditRepayParamsAmount),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export type CreditRepayParams$Outbound = {
|
|
60
|
+
action_type: "CREDIT_REPAY";
|
|
61
|
+
token: string;
|
|
62
|
+
amount: number | string;
|
|
63
|
+
interest_rate_mode?: string | undefined;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const CreditRepayParams$outboundSchema: z.ZodType<
|
|
68
|
+
CreditRepayParams$Outbound,
|
|
69
|
+
z.ZodTypeDef,
|
|
70
|
+
CreditRepayParams
|
|
71
|
+
> = z.object({
|
|
72
|
+
actionType: z.literal("CREDIT_REPAY"),
|
|
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 creditRepayParamsToJSON(
|
|
84
|
+
creditRepayParams: CreditRepayParams,
|
|
85
|
+
): string {
|
|
86
|
+
return JSON.stringify(
|
|
87
|
+
CreditRepayParams$outboundSchema.parse(creditRepayParams),
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
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 repay_token to repay (in token units, not wei).
|
|
15
|
+
*/
|
|
16
|
+
export type RepayAmount = number | string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Amount of collateral to withdraw (in token units, not wei).
|
|
20
|
+
*/
|
|
21
|
+
export type WithdrawAmount = 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 CreditRepayRequestSlippage = number | string;
|
|
27
|
+
|
|
28
|
+
export type CreditRepayRequest = {
|
|
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
|
+
* The borrowed asset to repay (e.g. WETH). Must match the debt position's token.
|
|
39
|
+
*/
|
|
40
|
+
repayToken: string;
|
|
41
|
+
/**
|
|
42
|
+
* Amount of repay_token to repay (in token units, not wei).
|
|
43
|
+
*/
|
|
44
|
+
repayAmount: number | string;
|
|
45
|
+
/**
|
|
46
|
+
* On AAVE there are 2 different interest modes.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
*
|
|
50
|
+
* A stable (but typically higher rate), or a variable rate.
|
|
51
|
+
*/
|
|
52
|
+
interestRateMode?: InterestRateMode | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Collateral token to withdraw from Aave after repaying debt.
|
|
55
|
+
*/
|
|
56
|
+
withdrawToken: string;
|
|
57
|
+
/**
|
|
58
|
+
* Amount of collateral to withdraw (in token units, not wei).
|
|
59
|
+
*/
|
|
60
|
+
withdrawAmount: number | string;
|
|
61
|
+
/**
|
|
62
|
+
* Desired output token. If different from withdraw_token, a swap is performed after withdrawal. If None, the withdrawn collateral is kept as-is.
|
|
63
|
+
*/
|
|
64
|
+
tokenOut?: string | null | 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 repay bundle will first pull repay_token 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 RepayAmount$Outbound = number | string;
|
|
89
|
+
|
|
90
|
+
/** @internal */
|
|
91
|
+
export const RepayAmount$outboundSchema: z.ZodType<
|
|
92
|
+
RepayAmount$Outbound,
|
|
93
|
+
z.ZodTypeDef,
|
|
94
|
+
RepayAmount
|
|
95
|
+
> = z.union([z.number(), z.string()]);
|
|
96
|
+
|
|
97
|
+
export function repayAmountToJSON(repayAmount: RepayAmount): string {
|
|
98
|
+
return JSON.stringify(RepayAmount$outboundSchema.parse(repayAmount));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** @internal */
|
|
102
|
+
export type WithdrawAmount$Outbound = number | string;
|
|
103
|
+
|
|
104
|
+
/** @internal */
|
|
105
|
+
export const WithdrawAmount$outboundSchema: z.ZodType<
|
|
106
|
+
WithdrawAmount$Outbound,
|
|
107
|
+
z.ZodTypeDef,
|
|
108
|
+
WithdrawAmount
|
|
109
|
+
> = z.union([z.number(), z.string()]);
|
|
110
|
+
|
|
111
|
+
export function withdrawAmountToJSON(withdrawAmount: WithdrawAmount): string {
|
|
112
|
+
return JSON.stringify(WithdrawAmount$outboundSchema.parse(withdrawAmount));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** @internal */
|
|
116
|
+
export type CreditRepayRequestSlippage$Outbound = number | string;
|
|
117
|
+
|
|
118
|
+
/** @internal */
|
|
119
|
+
export const CreditRepayRequestSlippage$outboundSchema: z.ZodType<
|
|
120
|
+
CreditRepayRequestSlippage$Outbound,
|
|
121
|
+
z.ZodTypeDef,
|
|
122
|
+
CreditRepayRequestSlippage
|
|
123
|
+
> = z.union([z.number(), z.string()]);
|
|
124
|
+
|
|
125
|
+
export function creditRepayRequestSlippageToJSON(
|
|
126
|
+
creditRepayRequestSlippage: CreditRepayRequestSlippage,
|
|
127
|
+
): string {
|
|
128
|
+
return JSON.stringify(
|
|
129
|
+
CreditRepayRequestSlippage$outboundSchema.parse(creditRepayRequestSlippage),
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** @internal */
|
|
134
|
+
export type CreditRepayRequest$Outbound = {
|
|
135
|
+
owner: string;
|
|
136
|
+
chain: string;
|
|
137
|
+
repay_token: string;
|
|
138
|
+
repay_amount: number | string;
|
|
139
|
+
interest_rate_mode?: string | undefined;
|
|
140
|
+
withdraw_token: string;
|
|
141
|
+
withdraw_amount: number | string;
|
|
142
|
+
token_out?: string | null | undefined;
|
|
143
|
+
slippage?: number | string | undefined;
|
|
144
|
+
gas_sponsorship?: boolean | undefined;
|
|
145
|
+
permit2_signature?: string | null | undefined;
|
|
146
|
+
permit2_nonce?: number | null | undefined;
|
|
147
|
+
permit2_deadline?: number | null | undefined;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/** @internal */
|
|
151
|
+
export const CreditRepayRequest$outboundSchema: z.ZodType<
|
|
152
|
+
CreditRepayRequest$Outbound,
|
|
153
|
+
z.ZodTypeDef,
|
|
154
|
+
CreditRepayRequest
|
|
155
|
+
> = z.object({
|
|
156
|
+
owner: z.string(),
|
|
157
|
+
chain: Chain$outboundSchema,
|
|
158
|
+
repayToken: z.string(),
|
|
159
|
+
repayAmount: z.union([z.number(), z.string()]),
|
|
160
|
+
interestRateMode: InterestRateMode$outboundSchema.optional(),
|
|
161
|
+
withdrawToken: z.string(),
|
|
162
|
+
withdrawAmount: z.union([z.number(), z.string()]),
|
|
163
|
+
tokenOut: z.nullable(z.string()).optional(),
|
|
164
|
+
slippage: z.union([z.number(), z.string()]).optional(),
|
|
165
|
+
gasSponsorship: z.boolean().optional(),
|
|
166
|
+
permit2Signature: z.nullable(z.string()).optional(),
|
|
167
|
+
permit2Nonce: z.nullable(z.number().int()).optional(),
|
|
168
|
+
permit2Deadline: z.nullable(z.number().int()).optional(),
|
|
169
|
+
}).transform((v) => {
|
|
170
|
+
return remap$(v, {
|
|
171
|
+
repayToken: "repay_token",
|
|
172
|
+
repayAmount: "repay_amount",
|
|
173
|
+
interestRateMode: "interest_rate_mode",
|
|
174
|
+
withdrawToken: "withdraw_token",
|
|
175
|
+
withdrawAmount: "withdraw_amount",
|
|
176
|
+
tokenOut: "token_out",
|
|
177
|
+
gasSponsorship: "gas_sponsorship",
|
|
178
|
+
permit2Signature: "permit2_signature",
|
|
179
|
+
permit2Nonce: "permit2_nonce",
|
|
180
|
+
permit2Deadline: "permit2_deadline",
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
export function creditRepayRequestToJSON(
|
|
185
|
+
creditRepayRequest: CreditRepayRequest,
|
|
186
|
+
): string {
|
|
187
|
+
return JSON.stringify(
|
|
188
|
+
CreditRepayRequest$outboundSchema.parse(creditRepayRequest),
|
|
189
|
+
);
|
|
190
|
+
}
|
|
@@ -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 CreditRepayResponse = {
|
|
20
|
+
/**
|
|
21
|
+
* Unsigned transaction to execute the repay 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 token_out received from swap. Only present when token_out differs from withdraw_token.
|
|
30
|
+
*/
|
|
31
|
+
estimatedTokenOutAmount?: string | null | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const CreditRepayResponse$inboundSchema: z.ZodType<
|
|
36
|
+
CreditRepayResponse,
|
|
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_token_out_amount: z.nullable(z.string()).optional(),
|
|
44
|
+
}).transform((v) => {
|
|
45
|
+
return remap$(v, {
|
|
46
|
+
"eip_712": "eip712",
|
|
47
|
+
"estimated_token_out_amount": "estimatedTokenOutAmount",
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export function creditRepayResponseFromJSON(
|
|
52
|
+
jsonString: string,
|
|
53
|
+
): SafeParseResult<CreditRepayResponse, SDKValidationError> {
|
|
54
|
+
return safeParse(
|
|
55
|
+
jsonString,
|
|
56
|
+
(x) => CreditRepayResponse$inboundSchema.parse(JSON.parse(x)),
|
|
57
|
+
`Failed to parse 'CreditRepayResponse' from JSON`,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Amount in token units to supply.
|
|
10
|
+
*/
|
|
11
|
+
export type CreditSupplyParamsAmount = number | string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Supply collateral to Aave via Credit Account.
|
|
15
|
+
*/
|
|
16
|
+
export type CreditSupplyParams = {
|
|
17
|
+
actionType: "CREDIT_SUPPLY";
|
|
18
|
+
/**
|
|
19
|
+
* Collateral token to supply to Aave.
|
|
20
|
+
*/
|
|
21
|
+
token: string;
|
|
22
|
+
/**
|
|
23
|
+
* Amount in token units to supply.
|
|
24
|
+
*/
|
|
25
|
+
amount: number | string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type CreditSupplyParamsAmount$Outbound = number | string;
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const CreditSupplyParamsAmount$outboundSchema: z.ZodType<
|
|
33
|
+
CreditSupplyParamsAmount$Outbound,
|
|
34
|
+
z.ZodTypeDef,
|
|
35
|
+
CreditSupplyParamsAmount
|
|
36
|
+
> = z.union([z.number(), z.string()]);
|
|
37
|
+
|
|
38
|
+
export function creditSupplyParamsAmountToJSON(
|
|
39
|
+
creditSupplyParamsAmount: CreditSupplyParamsAmount,
|
|
40
|
+
): string {
|
|
41
|
+
return JSON.stringify(
|
|
42
|
+
CreditSupplyParamsAmount$outboundSchema.parse(creditSupplyParamsAmount),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** @internal */
|
|
47
|
+
export type CreditSupplyParams$Outbound = {
|
|
48
|
+
action_type: "CREDIT_SUPPLY";
|
|
49
|
+
token: string;
|
|
50
|
+
amount: number | string;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/** @internal */
|
|
54
|
+
export const CreditSupplyParams$outboundSchema: z.ZodType<
|
|
55
|
+
CreditSupplyParams$Outbound,
|
|
56
|
+
z.ZodTypeDef,
|
|
57
|
+
CreditSupplyParams
|
|
58
|
+
> = z.object({
|
|
59
|
+
actionType: z.literal("CREDIT_SUPPLY"),
|
|
60
|
+
token: z.string(),
|
|
61
|
+
amount: z.union([z.number(), z.string()]),
|
|
62
|
+
}).transform((v) => {
|
|
63
|
+
return remap$(v, {
|
|
64
|
+
actionType: "action_type",
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export function creditSupplyParamsToJSON(
|
|
69
|
+
creditSupplyParams: CreditSupplyParams,
|
|
70
|
+
): string {
|
|
71
|
+
return JSON.stringify(
|
|
72
|
+
CreditSupplyParams$outboundSchema.parse(creditSupplyParams),
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { Chain, Chain$outboundSchema } from "./chain.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The amount of tokens to transfer (in token units, not wei).
|
|
10
|
+
*/
|
|
11
|
+
export type CreditTransferRequestAmount = number | string;
|
|
12
|
+
|
|
13
|
+
export type CreditTransferRequest = {
|
|
14
|
+
/**
|
|
15
|
+
* The owner's wallet address (EOA).
|
|
16
|
+
*/
|
|
17
|
+
owner: string;
|
|
18
|
+
/**
|
|
19
|
+
* The chain to use.
|
|
20
|
+
*/
|
|
21
|
+
chain: Chain;
|
|
22
|
+
/**
|
|
23
|
+
* The token to transfer from the EOA to the Credit Account.
|
|
24
|
+
*/
|
|
25
|
+
token: string;
|
|
26
|
+
/**
|
|
27
|
+
* The amount of tokens to transfer (in token units, not wei).
|
|
28
|
+
*/
|
|
29
|
+
amount: number | string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export type CreditTransferRequestAmount$Outbound = number | string;
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const CreditTransferRequestAmount$outboundSchema: z.ZodType<
|
|
37
|
+
CreditTransferRequestAmount$Outbound,
|
|
38
|
+
z.ZodTypeDef,
|
|
39
|
+
CreditTransferRequestAmount
|
|
40
|
+
> = z.union([z.number(), z.string()]);
|
|
41
|
+
|
|
42
|
+
export function creditTransferRequestAmountToJSON(
|
|
43
|
+
creditTransferRequestAmount: CreditTransferRequestAmount,
|
|
44
|
+
): string {
|
|
45
|
+
return JSON.stringify(
|
|
46
|
+
CreditTransferRequestAmount$outboundSchema.parse(
|
|
47
|
+
creditTransferRequestAmount,
|
|
48
|
+
),
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export type CreditTransferRequest$Outbound = {
|
|
54
|
+
owner: string;
|
|
55
|
+
chain: string;
|
|
56
|
+
token: string;
|
|
57
|
+
amount: number | string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const CreditTransferRequest$outboundSchema: z.ZodType<
|
|
62
|
+
CreditTransferRequest$Outbound,
|
|
63
|
+
z.ZodTypeDef,
|
|
64
|
+
CreditTransferRequest
|
|
65
|
+
> = z.object({
|
|
66
|
+
owner: z.string(),
|
|
67
|
+
chain: Chain$outboundSchema,
|
|
68
|
+
token: z.string(),
|
|
69
|
+
amount: z.union([z.number(), z.string()]),
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export function creditTransferRequestToJSON(
|
|
73
|
+
creditTransferRequest: CreditTransferRequest,
|
|
74
|
+
): string {
|
|
75
|
+
return JSON.stringify(
|
|
76
|
+
CreditTransferRequest$outboundSchema.parse(creditTransferRequest),
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
Permit2TypedDataOutput,
|
|
12
|
+
Permit2TypedDataOutput$inboundSchema,
|
|
13
|
+
} from "./permit2typeddataoutput.js";
|
|
14
|
+
|
|
15
|
+
export type CreditTransferResponse = {
|
|
16
|
+
eip712: Permit2TypedDataOutput;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const CreditTransferResponse$inboundSchema: z.ZodType<
|
|
21
|
+
CreditTransferResponse,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
unknown
|
|
24
|
+
> = z.object({
|
|
25
|
+
eip_712: Permit2TypedDataOutput$inboundSchema,
|
|
26
|
+
}).transform((v) => {
|
|
27
|
+
return remap$(v, {
|
|
28
|
+
"eip_712": "eip712",
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export function creditTransferResponseFromJSON(
|
|
33
|
+
jsonString: string,
|
|
34
|
+
): SafeParseResult<CreditTransferResponse, SDKValidationError> {
|
|
35
|
+
return safeParse(
|
|
36
|
+
jsonString,
|
|
37
|
+
(x) => CreditTransferResponse$inboundSchema.parse(JSON.parse(x)),
|
|
38
|
+
`Failed to parse 'CreditTransferResponse' from JSON`,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import {
|
|
7
|
+
CreditBorrowParams,
|
|
8
|
+
CreditBorrowParams$Outbound,
|
|
9
|
+
CreditBorrowParams$outboundSchema,
|
|
10
|
+
} from "./creditborrowparams.js";
|
|
11
|
+
import {
|
|
12
|
+
CreditRepayParams,
|
|
13
|
+
CreditRepayParams$Outbound,
|
|
14
|
+
CreditRepayParams$outboundSchema,
|
|
15
|
+
} from "./creditrepayparams.js";
|
|
16
|
+
import {
|
|
17
|
+
CreditSupplyParams,
|
|
18
|
+
CreditSupplyParams$Outbound,
|
|
19
|
+
CreditSupplyParams$outboundSchema,
|
|
20
|
+
} from "./creditsupplyparams.js";
|
|
21
|
+
import {
|
|
22
|
+
CreditWithdrawParams,
|
|
23
|
+
CreditWithdrawParams$Outbound,
|
|
24
|
+
CreditWithdrawParams$outboundSchema,
|
|
25
|
+
} from "./creditwithdrawparams.js";
|
|
26
|
+
import {
|
|
27
|
+
EarnSwapParams,
|
|
28
|
+
EarnSwapParams$Outbound,
|
|
29
|
+
EarnSwapParams$outboundSchema,
|
|
30
|
+
} from "./earnswapparams.js";
|
|
31
|
+
import {
|
|
32
|
+
EarnTransferFromEOAParams,
|
|
33
|
+
EarnTransferFromEOAParams$Outbound,
|
|
34
|
+
EarnTransferFromEOAParams$outboundSchema,
|
|
35
|
+
} from "./earntransferfromeoaparams.js";
|
|
36
|
+
import {
|
|
37
|
+
EarnTransferToEOAParams,
|
|
38
|
+
EarnTransferToEOAParams$Outbound,
|
|
39
|
+
EarnTransferToEOAParams$outboundSchema,
|
|
40
|
+
} from "./earntransfertoeoaparams.js";
|
|
41
|
+
|
|
42
|
+
export type CreditUserOperationBody =
|
|
43
|
+
| CreditBorrowParams
|
|
44
|
+
| CreditRepayParams
|
|
45
|
+
| CreditSupplyParams
|
|
46
|
+
| CreditWithdrawParams
|
|
47
|
+
| EarnSwapParams
|
|
48
|
+
| EarnTransferFromEOAParams
|
|
49
|
+
| EarnTransferToEOAParams;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A single operation in a credit bundle.
|
|
53
|
+
*/
|
|
54
|
+
export type CreditUserOperation = {
|
|
55
|
+
body:
|
|
56
|
+
| CreditBorrowParams
|
|
57
|
+
| CreditRepayParams
|
|
58
|
+
| CreditSupplyParams
|
|
59
|
+
| CreditWithdrawParams
|
|
60
|
+
| EarnSwapParams
|
|
61
|
+
| EarnTransferFromEOAParams
|
|
62
|
+
| EarnTransferToEOAParams;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** @internal */
|
|
66
|
+
export type CreditUserOperationBody$Outbound =
|
|
67
|
+
| CreditBorrowParams$Outbound
|
|
68
|
+
| CreditRepayParams$Outbound
|
|
69
|
+
| CreditSupplyParams$Outbound
|
|
70
|
+
| CreditWithdrawParams$Outbound
|
|
71
|
+
| EarnSwapParams$Outbound
|
|
72
|
+
| EarnTransferFromEOAParams$Outbound
|
|
73
|
+
| EarnTransferToEOAParams$Outbound;
|
|
74
|
+
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const CreditUserOperationBody$outboundSchema: z.ZodType<
|
|
77
|
+
CreditUserOperationBody$Outbound,
|
|
78
|
+
z.ZodTypeDef,
|
|
79
|
+
CreditUserOperationBody
|
|
80
|
+
> = z.union([
|
|
81
|
+
CreditBorrowParams$outboundSchema,
|
|
82
|
+
CreditRepayParams$outboundSchema,
|
|
83
|
+
CreditSupplyParams$outboundSchema,
|
|
84
|
+
CreditWithdrawParams$outboundSchema,
|
|
85
|
+
EarnSwapParams$outboundSchema,
|
|
86
|
+
EarnTransferFromEOAParams$outboundSchema,
|
|
87
|
+
EarnTransferToEOAParams$outboundSchema,
|
|
88
|
+
]);
|
|
89
|
+
|
|
90
|
+
export function creditUserOperationBodyToJSON(
|
|
91
|
+
creditUserOperationBody: CreditUserOperationBody,
|
|
92
|
+
): string {
|
|
93
|
+
return JSON.stringify(
|
|
94
|
+
CreditUserOperationBody$outboundSchema.parse(creditUserOperationBody),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** @internal */
|
|
99
|
+
export type CreditUserOperation$Outbound = {
|
|
100
|
+
body:
|
|
101
|
+
| CreditBorrowParams$Outbound
|
|
102
|
+
| CreditRepayParams$Outbound
|
|
103
|
+
| CreditSupplyParams$Outbound
|
|
104
|
+
| CreditWithdrawParams$Outbound
|
|
105
|
+
| EarnSwapParams$Outbound
|
|
106
|
+
| EarnTransferFromEOAParams$Outbound
|
|
107
|
+
| EarnTransferToEOAParams$Outbound;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/** @internal */
|
|
111
|
+
export const CreditUserOperation$outboundSchema: z.ZodType<
|
|
112
|
+
CreditUserOperation$Outbound,
|
|
113
|
+
z.ZodTypeDef,
|
|
114
|
+
CreditUserOperation
|
|
115
|
+
> = z.object({
|
|
116
|
+
body: z.union([
|
|
117
|
+
CreditBorrowParams$outboundSchema,
|
|
118
|
+
CreditRepayParams$outboundSchema,
|
|
119
|
+
CreditSupplyParams$outboundSchema,
|
|
120
|
+
CreditWithdrawParams$outboundSchema,
|
|
121
|
+
EarnSwapParams$outboundSchema,
|
|
122
|
+
EarnTransferFromEOAParams$outboundSchema,
|
|
123
|
+
EarnTransferToEOAParams$outboundSchema,
|
|
124
|
+
]),
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
export function creditUserOperationToJSON(
|
|
128
|
+
creditUserOperation: CreditUserOperation,
|
|
129
|
+
): string {
|
|
130
|
+
return JSON.stringify(
|
|
131
|
+
CreditUserOperation$outboundSchema.parse(creditUserOperation),
|
|
132
|
+
);
|
|
133
|
+
}
|