@compass-labs/api-sdk 2.2.18-rc.2 → 2.2.18
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 +1 -16
- package/codeSamples_typescript.yaml +0 -36
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/index.d.ts +0 -20
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +0 -20
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +0 -1
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +0 -1
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/sdk/sdk.d.ts +0 -3
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +0 -4
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/index.d.ts +0 -20
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +0 -20
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +0 -1
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +0 -1
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/sdk/sdk.d.ts +0 -3
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +0 -4
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/index.ts +0 -20
- package/src/models/operations/index.ts +0 -1
- package/src/sdk/sdk.ts +0 -6
- package/dist/commonjs/funcs/creditCreditBorrow.d.ts +0 -25
- package/dist/commonjs/funcs/creditCreditBorrow.d.ts.map +0 -1
- package/dist/commonjs/funcs/creditCreditBorrow.js +0 -125
- package/dist/commonjs/funcs/creditCreditBorrow.js.map +0 -1
- package/dist/commonjs/funcs/creditCreditBundle.d.ts +0 -21
- package/dist/commonjs/funcs/creditCreditBundle.d.ts.map +0 -1
- package/dist/commonjs/funcs/creditCreditBundle.js +0 -121
- package/dist/commonjs/funcs/creditCreditBundle.js.map +0 -1
- package/dist/commonjs/funcs/creditCreditCreateAccount.d.ts +0 -26
- package/dist/commonjs/funcs/creditCreditCreateAccount.d.ts.map +0 -1
- package/dist/commonjs/funcs/creditCreditCreateAccount.js +0 -126
- package/dist/commonjs/funcs/creditCreditCreateAccount.js.map +0 -1
- package/dist/commonjs/funcs/creditCreditPositions.d.ts +0 -22
- package/dist/commonjs/funcs/creditCreditPositions.d.ts.map +0 -1
- package/dist/commonjs/funcs/creditCreditPositions.js +0 -126
- package/dist/commonjs/funcs/creditCreditPositions.js.map +0 -1
- package/dist/commonjs/funcs/creditCreditRepay.d.ts +0 -26
- package/dist/commonjs/funcs/creditCreditRepay.d.ts.map +0 -1
- package/dist/commonjs/funcs/creditCreditRepay.js +0 -126
- package/dist/commonjs/funcs/creditCreditRepay.js.map +0 -1
- package/dist/commonjs/funcs/creditCreditTransfer.d.ts +0 -27
- package/dist/commonjs/funcs/creditCreditTransfer.d.ts.map +0 -1
- package/dist/commonjs/funcs/creditCreditTransfer.js +0 -127
- package/dist/commonjs/funcs/creditCreditTransfer.js.map +0 -1
- package/dist/commonjs/models/components/accountsummary.d.ts +0 -40
- package/dist/commonjs/models/components/accountsummary.d.ts.map +0 -1
- package/dist/commonjs/models/components/accountsummary.js +0 -66
- package/dist/commonjs/models/components/accountsummary.js.map +0 -1
- package/dist/commonjs/models/components/collateralposition.d.ts +0 -53
- package/dist/commonjs/models/components/collateralposition.d.ts.map +0 -1
- package/dist/commonjs/models/components/collateralposition.js +0 -71
- package/dist/commonjs/models/components/collateralposition.js.map +0 -1
- package/dist/commonjs/models/components/createcreditaccountrequest.d.ts +0 -39
- package/dist/commonjs/models/components/createcreditaccountrequest.d.ts.map +0 -1
- package/dist/commonjs/models/components/createcreditaccountrequest.js +0 -64
- package/dist/commonjs/models/components/createcreditaccountrequest.js.map +0 -1
- package/dist/commonjs/models/components/createcreditaccountresponse.d.ts +0 -21
- package/dist/commonjs/models/components/createcreditaccountresponse.d.ts.map +0 -1
- package/dist/commonjs/models/components/createcreditaccountresponse.js +0 -57
- package/dist/commonjs/models/components/createcreditaccountresponse.js.map +0 -1
- package/dist/commonjs/models/components/creditborrowparams.d.ts +0 -44
- package/dist/commonjs/models/components/creditborrowparams.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditborrowparams.js +0 -65
- package/dist/commonjs/models/components/creditborrowparams.js.map +0 -1
- package/dist/commonjs/models/components/creditborrowrequest.d.ts +0 -108
- package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditborrowrequest.js +0 -95
- package/dist/commonjs/models/components/creditborrowrequest.js.map +0 -1
- package/dist/commonjs/models/components/creditborrowresponse.d.ts +0 -23
- package/dist/commonjs/models/components/creditborrowresponse.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditborrowresponse.js +0 -61
- package/dist/commonjs/models/components/creditborrowresponse.js.map +0 -1
- package/dist/commonjs/models/components/creditbundlerequest.d.ts +0 -35
- package/dist/commonjs/models/components/creditbundlerequest.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditbundlerequest.js +0 -59
- package/dist/commonjs/models/components/creditbundlerequest.js.map +0 -1
- package/dist/commonjs/models/components/creditbundleresponse.d.ts +0 -23
- package/dist/commonjs/models/components/creditbundleresponse.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditbundleresponse.js +0 -61
- package/dist/commonjs/models/components/creditbundleresponse.js.map +0 -1
- package/dist/commonjs/models/components/creditevent.d.ts +0 -53
- package/dist/commonjs/models/components/creditevent.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditevent.js +0 -76
- package/dist/commonjs/models/components/creditevent.js.map +0 -1
- package/dist/commonjs/models/components/creditpositionsresponse.d.ts +0 -31
- package/dist/commonjs/models/components/creditpositionsresponse.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditpositionsresponse.js +0 -64
- package/dist/commonjs/models/components/creditpositionsresponse.js.map +0 -1
- package/dist/commonjs/models/components/creditrepayparams.d.ts +0 -44
- package/dist/commonjs/models/components/creditrepayparams.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditrepayparams.js +0 -65
- package/dist/commonjs/models/components/creditrepayparams.js.map +0 -1
- package/dist/commonjs/models/components/creditrepayrequest.d.ts +0 -108
- package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditrepayrequest.js +0 -95
- package/dist/commonjs/models/components/creditrepayrequest.js.map +0 -1
- package/dist/commonjs/models/components/creditrepayresponse.d.ts +0 -23
- package/dist/commonjs/models/components/creditrepayresponse.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditrepayresponse.js +0 -61
- package/dist/commonjs/models/components/creditrepayresponse.js.map +0 -1
- package/dist/commonjs/models/components/creditsupplyparams.d.ts +0 -34
- package/dist/commonjs/models/components/creditsupplyparams.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditsupplyparams.js +0 -62
- package/dist/commonjs/models/components/creditsupplyparams.js.map +0 -1
- package/dist/commonjs/models/components/credittransferrequest.d.ts +0 -40
- package/dist/commonjs/models/components/credittransferrequest.d.ts.map +0 -1
- package/dist/commonjs/models/components/credittransferrequest.js +0 -59
- package/dist/commonjs/models/components/credittransferrequest.js.map +0 -1
- package/dist/commonjs/models/components/credittransferresponse.d.ts +0 -11
- package/dist/commonjs/models/components/credittransferresponse.d.ts.map +0 -1
- package/dist/commonjs/models/components/credittransferresponse.js +0 -56
- package/dist/commonjs/models/components/credittransferresponse.js.map +0 -1
- package/dist/commonjs/models/components/credituseroperation.d.ts +0 -28
- package/dist/commonjs/models/components/credituseroperation.d.ts.map +0 -1
- package/dist/commonjs/models/components/credituseroperation.js +0 -78
- package/dist/commonjs/models/components/credituseroperation.js.map +0 -1
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts +0 -34
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditwithdrawparams.js +0 -62
- package/dist/commonjs/models/components/creditwithdrawparams.js.map +0 -1
- package/dist/commonjs/models/components/debtposition.d.ts +0 -49
- package/dist/commonjs/models/components/debtposition.d.ts.map +0 -1
- package/dist/commonjs/models/components/debtposition.js +0 -69
- package/dist/commonjs/models/components/debtposition.js.map +0 -1
- package/dist/commonjs/models/operations/v2creditpositions.d.ts +0 -26
- package/dist/commonjs/models/operations/v2creditpositions.d.ts.map +0 -1
- package/dist/commonjs/models/operations/v2creditpositions.js +0 -57
- package/dist/commonjs/models/operations/v2creditpositions.js.map +0 -1
- package/dist/commonjs/sdk/credit.d.ts +0 -86
- package/dist/commonjs/sdk/credit.d.ts.map +0 -1
- package/dist/commonjs/sdk/credit.js +0 -110
- package/dist/commonjs/sdk/credit.js.map +0 -1
- package/dist/esm/funcs/creditCreditBorrow.d.ts +0 -25
- package/dist/esm/funcs/creditCreditBorrow.d.ts.map +0 -1
- package/dist/esm/funcs/creditCreditBorrow.js +0 -89
- package/dist/esm/funcs/creditCreditBorrow.js.map +0 -1
- package/dist/esm/funcs/creditCreditBundle.d.ts +0 -21
- package/dist/esm/funcs/creditCreditBundle.d.ts.map +0 -1
- package/dist/esm/funcs/creditCreditBundle.js +0 -85
- package/dist/esm/funcs/creditCreditBundle.js.map +0 -1
- package/dist/esm/funcs/creditCreditCreateAccount.d.ts +0 -26
- package/dist/esm/funcs/creditCreditCreateAccount.d.ts.map +0 -1
- package/dist/esm/funcs/creditCreditCreateAccount.js +0 -90
- package/dist/esm/funcs/creditCreditCreateAccount.js.map +0 -1
- package/dist/esm/funcs/creditCreditPositions.d.ts +0 -22
- package/dist/esm/funcs/creditCreditPositions.d.ts.map +0 -1
- package/dist/esm/funcs/creditCreditPositions.js +0 -90
- package/dist/esm/funcs/creditCreditPositions.js.map +0 -1
- package/dist/esm/funcs/creditCreditRepay.d.ts +0 -26
- package/dist/esm/funcs/creditCreditRepay.d.ts.map +0 -1
- package/dist/esm/funcs/creditCreditRepay.js +0 -90
- package/dist/esm/funcs/creditCreditRepay.js.map +0 -1
- package/dist/esm/funcs/creditCreditTransfer.d.ts +0 -27
- package/dist/esm/funcs/creditCreditTransfer.d.ts.map +0 -1
- package/dist/esm/funcs/creditCreditTransfer.js +0 -91
- package/dist/esm/funcs/creditCreditTransfer.js.map +0 -1
- package/dist/esm/models/components/accountsummary.d.ts +0 -40
- package/dist/esm/models/components/accountsummary.d.ts.map +0 -1
- package/dist/esm/models/components/accountsummary.js +0 -29
- package/dist/esm/models/components/accountsummary.js.map +0 -1
- package/dist/esm/models/components/collateralposition.d.ts +0 -53
- package/dist/esm/models/components/collateralposition.d.ts.map +0 -1
- package/dist/esm/models/components/collateralposition.js +0 -34
- package/dist/esm/models/components/collateralposition.js.map +0 -1
- package/dist/esm/models/components/createcreditaccountrequest.d.ts +0 -39
- package/dist/esm/models/components/createcreditaccountrequest.d.ts.map +0 -1
- package/dist/esm/models/components/createcreditaccountrequest.js +0 -27
- package/dist/esm/models/components/createcreditaccountrequest.js.map +0 -1
- package/dist/esm/models/components/createcreditaccountresponse.d.ts +0 -21
- package/dist/esm/models/components/createcreditaccountresponse.d.ts.map +0 -1
- package/dist/esm/models/components/createcreditaccountresponse.js +0 -20
- package/dist/esm/models/components/createcreditaccountresponse.js.map +0 -1
- package/dist/esm/models/components/creditborrowparams.d.ts +0 -44
- package/dist/esm/models/components/creditborrowparams.d.ts.map +0 -1
- package/dist/esm/models/components/creditborrowparams.js +0 -27
- package/dist/esm/models/components/creditborrowparams.js.map +0 -1
- package/dist/esm/models/components/creditborrowrequest.d.ts +0 -108
- package/dist/esm/models/components/creditborrowrequest.d.ts.map +0 -1
- package/dist/esm/models/components/creditborrowrequest.js +0 -55
- package/dist/esm/models/components/creditborrowrequest.js.map +0 -1
- package/dist/esm/models/components/creditborrowresponse.d.ts +0 -23
- package/dist/esm/models/components/creditborrowresponse.d.ts.map +0 -1
- package/dist/esm/models/components/creditborrowresponse.js +0 -24
- package/dist/esm/models/components/creditborrowresponse.js.map +0 -1
- package/dist/esm/models/components/creditbundlerequest.d.ts +0 -35
- package/dist/esm/models/components/creditbundlerequest.d.ts.map +0 -1
- package/dist/esm/models/components/creditbundlerequest.js +0 -22
- package/dist/esm/models/components/creditbundlerequest.js.map +0 -1
- package/dist/esm/models/components/creditbundleresponse.d.ts +0 -23
- package/dist/esm/models/components/creditbundleresponse.d.ts.map +0 -1
- package/dist/esm/models/components/creditbundleresponse.js +0 -24
- package/dist/esm/models/components/creditbundleresponse.js.map +0 -1
- package/dist/esm/models/components/creditevent.d.ts +0 -53
- package/dist/esm/models/components/creditevent.d.ts.map +0 -1
- package/dist/esm/models/components/creditevent.js +0 -39
- package/dist/esm/models/components/creditevent.js.map +0 -1
- package/dist/esm/models/components/creditpositionsresponse.d.ts +0 -31
- package/dist/esm/models/components/creditpositionsresponse.d.ts.map +0 -1
- package/dist/esm/models/components/creditpositionsresponse.js +0 -27
- package/dist/esm/models/components/creditpositionsresponse.js.map +0 -1
- package/dist/esm/models/components/creditrepayparams.d.ts +0 -44
- package/dist/esm/models/components/creditrepayparams.d.ts.map +0 -1
- package/dist/esm/models/components/creditrepayparams.js +0 -27
- package/dist/esm/models/components/creditrepayparams.js.map +0 -1
- package/dist/esm/models/components/creditrepayrequest.d.ts +0 -108
- package/dist/esm/models/components/creditrepayrequest.d.ts.map +0 -1
- package/dist/esm/models/components/creditrepayrequest.js +0 -55
- package/dist/esm/models/components/creditrepayrequest.js.map +0 -1
- package/dist/esm/models/components/creditrepayresponse.d.ts +0 -23
- package/dist/esm/models/components/creditrepayresponse.d.ts.map +0 -1
- package/dist/esm/models/components/creditrepayresponse.js +0 -24
- package/dist/esm/models/components/creditrepayresponse.js.map +0 -1
- package/dist/esm/models/components/creditsupplyparams.d.ts +0 -34
- package/dist/esm/models/components/creditsupplyparams.d.ts.map +0 -1
- package/dist/esm/models/components/creditsupplyparams.js +0 -24
- package/dist/esm/models/components/creditsupplyparams.js.map +0 -1
- package/dist/esm/models/components/credittransferrequest.d.ts +0 -40
- package/dist/esm/models/components/credittransferrequest.d.ts.map +0 -1
- package/dist/esm/models/components/credittransferrequest.js +0 -21
- package/dist/esm/models/components/credittransferrequest.js.map +0 -1
- package/dist/esm/models/components/credittransferresponse.d.ts +0 -11
- package/dist/esm/models/components/credittransferresponse.d.ts.map +0 -1
- package/dist/esm/models/components/credittransferresponse.js +0 -19
- package/dist/esm/models/components/credittransferresponse.js.map +0 -1
- package/dist/esm/models/components/credituseroperation.d.ts +0 -28
- package/dist/esm/models/components/credituseroperation.d.ts.map +0 -1
- package/dist/esm/models/components/credituseroperation.js +0 -40
- package/dist/esm/models/components/credituseroperation.js.map +0 -1
- package/dist/esm/models/components/creditwithdrawparams.d.ts +0 -34
- package/dist/esm/models/components/creditwithdrawparams.d.ts.map +0 -1
- package/dist/esm/models/components/creditwithdrawparams.js +0 -24
- package/dist/esm/models/components/creditwithdrawparams.js.map +0 -1
- package/dist/esm/models/components/debtposition.d.ts +0 -49
- package/dist/esm/models/components/debtposition.d.ts.map +0 -1
- package/dist/esm/models/components/debtposition.js +0 -32
- package/dist/esm/models/components/debtposition.js.map +0 -1
- package/dist/esm/models/operations/v2creditpositions.d.ts +0 -26
- package/dist/esm/models/operations/v2creditpositions.d.ts.map +0 -1
- package/dist/esm/models/operations/v2creditpositions.js +0 -20
- package/dist/esm/models/operations/v2creditpositions.js.map +0 -1
- package/dist/esm/sdk/credit.d.ts +0 -86
- package/dist/esm/sdk/credit.d.ts.map +0 -1
- package/dist/esm/sdk/credit.js +0 -106
- package/dist/esm/sdk/credit.js.map +0 -1
- package/docs/models/components/accountsummary.md +0 -30
- package/docs/models/components/borrowamount.md +0 -19
- package/docs/models/components/collateralposition.md +0 -31
- package/docs/models/components/createcreditaccountrequest.md +0 -24
- package/docs/models/components/createcreditaccountrequestchain.md +0 -15
- package/docs/models/components/createcreditaccountresponse.md +0 -31
- package/docs/models/components/creditborrowparams.md +0 -24
- package/docs/models/components/creditborrowparamsamount.md +0 -19
- package/docs/models/components/creditborrowrequest.md +0 -38
- package/docs/models/components/creditborrowrequestamountin.md +0 -19
- package/docs/models/components/creditborrowrequestslippage.md +0 -19
- package/docs/models/components/creditborrowresponse.md +0 -17
- package/docs/models/components/creditbundlerequest.md +0 -25
- package/docs/models/components/creditbundleresponse.md +0 -19
- package/docs/models/components/creditevent.md +0 -29
- package/docs/models/components/creditpositionsresponse.md +0 -31
- package/docs/models/components/creditrepayparams.md +0 -24
- package/docs/models/components/creditrepayparamsamount.md +0 -19
- package/docs/models/components/creditrepayrequest.md +0 -37
- package/docs/models/components/creditrepayrequestslippage.md +0 -19
- package/docs/models/components/creditrepayresponse.md +0 -17
- package/docs/models/components/creditsupplyparams.md +0 -23
- package/docs/models/components/creditsupplyparamsamount.md +0 -19
- package/docs/models/components/credittransferrequest.md +0 -23
- package/docs/models/components/credittransferrequestamount.md +0 -19
- package/docs/models/components/credittransferresponse.md +0 -75
- package/docs/models/components/credituseroperation.md +0 -23
- package/docs/models/components/credituseroperationbody.md +0 -80
- package/docs/models/components/creditwithdrawparams.md +0 -23
- package/docs/models/components/creditwithdrawparamsamount.md +0 -19
- package/docs/models/components/debtposition.md +0 -30
- package/docs/models/components/eventtype.md +0 -17
- package/docs/models/components/repayamount.md +0 -19
- package/docs/models/components/withdrawamount.md +0 -19
- package/docs/models/operations/v2creditpositionschain.md +0 -15
- package/docs/models/operations/v2creditpositionsrequest.md +0 -19
- package/docs/sdks/credit/README.md +0 -562
- package/src/funcs/creditCreditBorrow.ts +0 -176
- package/src/funcs/creditCreditBundle.ts +0 -172
- package/src/funcs/creditCreditCreateAccount.ts +0 -178
- package/src/funcs/creditCreditPositions.ts +0 -178
- package/src/funcs/creditCreditRepay.ts +0 -177
- package/src/funcs/creditCreditTransfer.ts +0 -178
- package/src/models/components/accountsummary.ts +0 -77
- package/src/models/components/collateralposition.ts +0 -94
- package/src/models/components/createcreditaccountrequest.ts +0 -72
- package/src/models/components/createcreditaccountresponse.ts +0 -51
- package/src/models/components/creditborrowparams.ts +0 -89
- package/src/models/components/creditborrowrequest.ts +0 -198
- package/src/models/components/creditborrowresponse.ts +0 -59
- package/src/models/components/creditbundlerequest.ts +0 -66
- package/src/models/components/creditbundleresponse.ts +0 -59
- package/src/models/components/creditevent.ts +0 -92
- package/src/models/components/creditpositionsresponse.ts +0 -69
- package/src/models/components/creditrepayparams.ts +0 -89
- package/src/models/components/creditrepayrequest.ts +0 -190
- package/src/models/components/creditrepayresponse.ts +0 -59
- package/src/models/components/creditsupplyparams.ts +0 -74
- package/src/models/components/credittransferrequest.ts +0 -78
- package/src/models/components/credittransferresponse.ts +0 -40
- package/src/models/components/credituseroperation.ts +0 -133
- package/src/models/components/creditwithdrawparams.ts +0 -74
- package/src/models/components/debtposition.ts +0 -88
- package/src/models/operations/v2creditpositions.ts +0 -50
- package/src/sdk/credit.ts +0 -156
|
@@ -1,74 +0,0 @@
|
|
|
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 withdraw.
|
|
10
|
-
*/
|
|
11
|
-
export type CreditWithdrawParamsAmount = number | string;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Withdraw collateral from Aave via Credit Account.
|
|
15
|
-
*/
|
|
16
|
-
export type CreditWithdrawParams = {
|
|
17
|
-
actionType: "CREDIT_WITHDRAW";
|
|
18
|
-
/**
|
|
19
|
-
* Collateral token to withdraw from Aave.
|
|
20
|
-
*/
|
|
21
|
-
token: string;
|
|
22
|
-
/**
|
|
23
|
-
* Amount in token units to withdraw.
|
|
24
|
-
*/
|
|
25
|
-
amount: number | string;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** @internal */
|
|
29
|
-
export type CreditWithdrawParamsAmount$Outbound = number | string;
|
|
30
|
-
|
|
31
|
-
/** @internal */
|
|
32
|
-
export const CreditWithdrawParamsAmount$outboundSchema: z.ZodType<
|
|
33
|
-
CreditWithdrawParamsAmount$Outbound,
|
|
34
|
-
z.ZodTypeDef,
|
|
35
|
-
CreditWithdrawParamsAmount
|
|
36
|
-
> = z.union([z.number(), z.string()]);
|
|
37
|
-
|
|
38
|
-
export function creditWithdrawParamsAmountToJSON(
|
|
39
|
-
creditWithdrawParamsAmount: CreditWithdrawParamsAmount,
|
|
40
|
-
): string {
|
|
41
|
-
return JSON.stringify(
|
|
42
|
-
CreditWithdrawParamsAmount$outboundSchema.parse(creditWithdrawParamsAmount),
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** @internal */
|
|
47
|
-
export type CreditWithdrawParams$Outbound = {
|
|
48
|
-
action_type: "CREDIT_WITHDRAW";
|
|
49
|
-
token: string;
|
|
50
|
-
amount: number | string;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/** @internal */
|
|
54
|
-
export const CreditWithdrawParams$outboundSchema: z.ZodType<
|
|
55
|
-
CreditWithdrawParams$Outbound,
|
|
56
|
-
z.ZodTypeDef,
|
|
57
|
-
CreditWithdrawParams
|
|
58
|
-
> = z.object({
|
|
59
|
-
actionType: z.literal("CREDIT_WITHDRAW"),
|
|
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 creditWithdrawParamsToJSON(
|
|
69
|
-
creditWithdrawParams: CreditWithdrawParams,
|
|
70
|
-
): string {
|
|
71
|
-
return JSON.stringify(
|
|
72
|
-
CreditWithdrawParams$outboundSchema.parse(creditWithdrawParams),
|
|
73
|
-
);
|
|
74
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
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 { CreditEvent, CreditEvent$inboundSchema } from "./creditevent.js";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* A per-reserve debt position.
|
|
14
|
-
*/
|
|
15
|
-
export type DebtPosition = {
|
|
16
|
-
/**
|
|
17
|
-
* Address of the borrow token.
|
|
18
|
-
*/
|
|
19
|
-
token: string;
|
|
20
|
-
/**
|
|
21
|
-
* Symbol of the borrow token (e.g. WETH).
|
|
22
|
-
*/
|
|
23
|
-
symbol: string;
|
|
24
|
-
/**
|
|
25
|
-
* Current on-chain variable debt balance.
|
|
26
|
-
*/
|
|
27
|
-
amountBorrowed: string | null;
|
|
28
|
-
/**
|
|
29
|
-
* Debt value in USD.
|
|
30
|
-
*/
|
|
31
|
-
usdValue?: string | null | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Current borrow APY in percentage (e.g. 4.5 means 4.5%).
|
|
34
|
-
*/
|
|
35
|
-
borrowApy?: string | null | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Total amount borrowed across all borrow events.
|
|
38
|
-
*/
|
|
39
|
-
totalBorrowed?: string | null | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Total amount repaid across all repay events.
|
|
42
|
-
*/
|
|
43
|
-
totalRepaid?: string | null | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Interest paid on debt: on_chain_balance + total_repaid - total_borrowed.
|
|
46
|
-
*/
|
|
47
|
-
interestPaid?: string | null | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* All historical events for this debt reserve.
|
|
50
|
-
*/
|
|
51
|
-
events?: Array<CreditEvent> | undefined;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/** @internal */
|
|
55
|
-
export const DebtPosition$inboundSchema: z.ZodType<
|
|
56
|
-
DebtPosition,
|
|
57
|
-
z.ZodTypeDef,
|
|
58
|
-
unknown
|
|
59
|
-
> = z.object({
|
|
60
|
-
token: z.string(),
|
|
61
|
-
symbol: z.string(),
|
|
62
|
-
amount_borrowed: z.nullable(z.string()),
|
|
63
|
-
usd_value: z.nullable(z.string()).optional(),
|
|
64
|
-
borrow_apy: z.nullable(z.string()).optional(),
|
|
65
|
-
total_borrowed: z.nullable(z.string()).optional(),
|
|
66
|
-
total_repaid: z.nullable(z.string()).optional(),
|
|
67
|
-
interest_paid: z.nullable(z.string()).optional(),
|
|
68
|
-
events: z.array(CreditEvent$inboundSchema).optional(),
|
|
69
|
-
}).transform((v) => {
|
|
70
|
-
return remap$(v, {
|
|
71
|
-
"amount_borrowed": "amountBorrowed",
|
|
72
|
-
"usd_value": "usdValue",
|
|
73
|
-
"borrow_apy": "borrowApy",
|
|
74
|
-
"total_borrowed": "totalBorrowed",
|
|
75
|
-
"total_repaid": "totalRepaid",
|
|
76
|
-
"interest_paid": "interestPaid",
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
export function debtPositionFromJSON(
|
|
81
|
-
jsonString: string,
|
|
82
|
-
): SafeParseResult<DebtPosition, SDKValidationError> {
|
|
83
|
-
return safeParse(
|
|
84
|
-
jsonString,
|
|
85
|
-
(x) => DebtPosition$inboundSchema.parse(JSON.parse(x)),
|
|
86
|
-
`Failed to parse 'DebtPosition' from JSON`,
|
|
87
|
-
);
|
|
88
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
-
|
|
8
|
-
export const V2CreditPositionsChain = {
|
|
9
|
-
Arbitrum: "arbitrum",
|
|
10
|
-
Base: "base",
|
|
11
|
-
Ethereum: "ethereum",
|
|
12
|
-
} as const;
|
|
13
|
-
export type V2CreditPositionsChain = ClosedEnum<typeof V2CreditPositionsChain>;
|
|
14
|
-
|
|
15
|
-
export type V2CreditPositionsRequest = {
|
|
16
|
-
chain: V2CreditPositionsChain;
|
|
17
|
-
/**
|
|
18
|
-
* The address of the owner of the credit account to get positions for.
|
|
19
|
-
*/
|
|
20
|
-
owner: string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/** @internal */
|
|
24
|
-
export const V2CreditPositionsChain$outboundSchema: z.ZodNativeEnum<
|
|
25
|
-
typeof V2CreditPositionsChain
|
|
26
|
-
> = z.nativeEnum(V2CreditPositionsChain);
|
|
27
|
-
|
|
28
|
-
/** @internal */
|
|
29
|
-
export type V2CreditPositionsRequest$Outbound = {
|
|
30
|
-
chain: string;
|
|
31
|
-
owner: string;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/** @internal */
|
|
35
|
-
export const V2CreditPositionsRequest$outboundSchema: z.ZodType<
|
|
36
|
-
V2CreditPositionsRequest$Outbound,
|
|
37
|
-
z.ZodTypeDef,
|
|
38
|
-
V2CreditPositionsRequest
|
|
39
|
-
> = z.object({
|
|
40
|
-
chain: V2CreditPositionsChain$outboundSchema,
|
|
41
|
-
owner: z.string(),
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
export function v2CreditPositionsRequestToJSON(
|
|
45
|
-
v2CreditPositionsRequest: V2CreditPositionsRequest,
|
|
46
|
-
): string {
|
|
47
|
-
return JSON.stringify(
|
|
48
|
-
V2CreditPositionsRequest$outboundSchema.parse(v2CreditPositionsRequest),
|
|
49
|
-
);
|
|
50
|
-
}
|
package/src/sdk/credit.ts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { creditCreditBorrow } from "../funcs/creditCreditBorrow.js";
|
|
6
|
-
import { creditCreditBundle } from "../funcs/creditCreditBundle.js";
|
|
7
|
-
import { creditCreditCreateAccount } from "../funcs/creditCreditCreateAccount.js";
|
|
8
|
-
import { creditCreditPositions } from "../funcs/creditCreditPositions.js";
|
|
9
|
-
import { creditCreditRepay } from "../funcs/creditCreditRepay.js";
|
|
10
|
-
import { creditCreditTransfer } from "../funcs/creditCreditTransfer.js";
|
|
11
|
-
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
12
|
-
import * as components from "../models/components/index.js";
|
|
13
|
-
import * as operations from "../models/operations/index.js";
|
|
14
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
15
|
-
|
|
16
|
-
export class Credit extends ClientSDK {
|
|
17
|
-
/**
|
|
18
|
-
* List credit positions
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* List all Credit positions for a given owner.
|
|
22
|
-
*
|
|
23
|
-
* Returns a unified list of positions (collateral and debt) and an account summary
|
|
24
|
-
* with health factor and LTV. Each position includes event history.
|
|
25
|
-
*/
|
|
26
|
-
async creditPositions(
|
|
27
|
-
request: operations.V2CreditPositionsRequest,
|
|
28
|
-
options?: RequestOptions,
|
|
29
|
-
): Promise<components.CreditPositionsResponse> {
|
|
30
|
-
return unwrapAsync(creditCreditPositions(
|
|
31
|
-
this,
|
|
32
|
-
request,
|
|
33
|
-
options,
|
|
34
|
-
));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Create credit account
|
|
39
|
-
*
|
|
40
|
-
* @remarks
|
|
41
|
-
* Create a Credit Account for a wallet address.
|
|
42
|
-
*
|
|
43
|
-
* Before using credit features, the owner must create a Credit Account. Each wallet address has one Credit Account per chain.
|
|
44
|
-
*
|
|
45
|
-
* Returns an unsigned transaction to create the account. The `sender` signs and broadcasts this transaction.
|
|
46
|
-
*
|
|
47
|
-
* **If owner pays gas:** Set `sender` to the owner's address.
|
|
48
|
-
*
|
|
49
|
-
* **If someone else pays gas:** Set `sender` to the wallet that will sign and broadcast the transaction on behalf of the owner.
|
|
50
|
-
*/
|
|
51
|
-
async creditCreateAccount(
|
|
52
|
-
request: components.CreateCreditAccountRequest,
|
|
53
|
-
options?: RequestOptions,
|
|
54
|
-
): Promise<components.CreateCreditAccountResponse> {
|
|
55
|
-
return unwrapAsync(creditCreditCreateAccount(
|
|
56
|
-
this,
|
|
57
|
-
request,
|
|
58
|
-
options,
|
|
59
|
-
));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Borrow against collateral
|
|
64
|
-
*
|
|
65
|
-
* @remarks
|
|
66
|
-
* Borrow an asset from Aave using a Credit Account.
|
|
67
|
-
*
|
|
68
|
-
* Bundles an optional swap, collateral supply, and borrow into a single atomic Safe transaction.
|
|
69
|
-
*
|
|
70
|
-
* - If `token_in` equals `collateral_token`, the tokens are supplied directly as collateral.
|
|
71
|
-
* - If `token_in` differs from `collateral_token`, a swap is performed first via 1inch.
|
|
72
|
-
*
|
|
73
|
-
* The Credit Account must already be created via `/v2/credit/create_account` and funded with `token_in`.
|
|
74
|
-
*/
|
|
75
|
-
async creditBorrow(
|
|
76
|
-
request: components.CreditBorrowRequest,
|
|
77
|
-
options?: RequestOptions,
|
|
78
|
-
): Promise<components.CreditBorrowResponse> {
|
|
79
|
-
return unwrapAsync(creditCreditBorrow(
|
|
80
|
-
this,
|
|
81
|
-
request,
|
|
82
|
-
options,
|
|
83
|
-
));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Get Permit2 signature data for Credit Account transfer
|
|
88
|
-
*
|
|
89
|
-
* @remarks
|
|
90
|
-
* Generate Permit2 EIP-712 typed data for transferring tokens from the owner's EOA
|
|
91
|
-
* to a Credit Account.
|
|
92
|
-
*
|
|
93
|
-
* The owner signs the returned EIP-712 data, then includes the signature in a `/v2/credit/borrow`
|
|
94
|
-
* or `/v2/credit/repay` request to atomically pull tokens from their EOA as part of the bundle.
|
|
95
|
-
*
|
|
96
|
-
* **Flow:**
|
|
97
|
-
* 1. Call this endpoint to get the Permit2 typed data
|
|
98
|
-
* 2. Sign the typed data with the owner's wallet
|
|
99
|
-
* 3. Call `/v2/credit/borrow` or `/v2/credit/repay` with the `permit2_signature`, `permit2_nonce`, and `permit2_deadline` fields
|
|
100
|
-
*/
|
|
101
|
-
async creditTransfer(
|
|
102
|
-
request: components.CreditTransferRequest,
|
|
103
|
-
options?: RequestOptions,
|
|
104
|
-
): Promise<components.CreditTransferResponse> {
|
|
105
|
-
return unwrapAsync(creditCreditTransfer(
|
|
106
|
-
this,
|
|
107
|
-
request,
|
|
108
|
-
options,
|
|
109
|
-
));
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Repay debt and withdraw collateral
|
|
114
|
-
*
|
|
115
|
-
* @remarks
|
|
116
|
-
* Repay an Aave debt and withdraw collateral from a Credit Account.
|
|
117
|
-
*
|
|
118
|
-
* Bundles repayment, collateral withdrawal, and an optional swap into a single atomic Safe transaction.
|
|
119
|
-
*
|
|
120
|
-
* - If `token_out` is None or equals `withdraw_token`, the withdrawn collateral is kept as-is.
|
|
121
|
-
* - If `token_out` differs from `withdraw_token`, a swap is performed after withdrawal via 1inch.
|
|
122
|
-
*
|
|
123
|
-
* The Credit Account must already have a borrow position created via `/v2/credit/borrow`.
|
|
124
|
-
* The repay_token must be available in the Credit Account (or pulled from EOA via Permit2).
|
|
125
|
-
*/
|
|
126
|
-
async creditRepay(
|
|
127
|
-
request: components.CreditRepayRequest,
|
|
128
|
-
options?: RequestOptions,
|
|
129
|
-
): Promise<components.CreditRepayResponse> {
|
|
130
|
-
return unwrapAsync(creditCreditRepay(
|
|
131
|
-
this,
|
|
132
|
-
request,
|
|
133
|
-
options,
|
|
134
|
-
));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Execute multiple credit actions atomically
|
|
139
|
-
*
|
|
140
|
-
* @remarks
|
|
141
|
-
* Compose individual credit operations (supply, withdraw, borrow, repay, swap, transfer)
|
|
142
|
-
* into a single atomic Safe transaction.
|
|
143
|
-
*
|
|
144
|
-
* The Credit Account must already be created via `/v2/credit/create_account`.
|
|
145
|
-
*/
|
|
146
|
-
async creditBundle(
|
|
147
|
-
request: components.CreditBundleRequest,
|
|
148
|
-
options?: RequestOptions,
|
|
149
|
-
): Promise<components.CreditBundleResponse> {
|
|
150
|
-
return unwrapAsync(creditCreditBundle(
|
|
151
|
-
this,
|
|
152
|
-
request,
|
|
153
|
-
options,
|
|
154
|
-
));
|
|
155
|
-
}
|
|
156
|
-
}
|