@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,177 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { CompassApiSDKCore } from "../core.js";
|
|
6
|
-
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import * as components from "../models/components/index.js";
|
|
14
|
-
import { CompassAPISDKError } from "../models/errors/compassapisdkerror.js";
|
|
15
|
-
import {
|
|
16
|
-
ConnectionError,
|
|
17
|
-
InvalidRequestError,
|
|
18
|
-
RequestAbortedError,
|
|
19
|
-
RequestTimeoutError,
|
|
20
|
-
UnexpectedClientError,
|
|
21
|
-
} from "../models/errors/httpclienterrors.js";
|
|
22
|
-
import * as errors from "../models/errors/index.js";
|
|
23
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
-
import { Result } from "../types/fp.js";
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Repay debt and withdraw collateral
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* Repay an Aave debt and withdraw collateral from a Credit Account.
|
|
33
|
-
*
|
|
34
|
-
* Bundles repayment, collateral withdrawal, and an optional swap into a single atomic Safe transaction.
|
|
35
|
-
*
|
|
36
|
-
* - If `token_out` is None or equals `withdraw_token`, the withdrawn collateral is kept as-is.
|
|
37
|
-
* - If `token_out` differs from `withdraw_token`, a swap is performed after withdrawal via 1inch.
|
|
38
|
-
*
|
|
39
|
-
* The Credit Account must already have a borrow position created via `/v2/credit/borrow`.
|
|
40
|
-
* The repay_token must be available in the Credit Account (or pulled from EOA via Permit2).
|
|
41
|
-
*/
|
|
42
|
-
export function creditCreditRepay(
|
|
43
|
-
client: CompassApiSDKCore,
|
|
44
|
-
request: components.CreditRepayRequest,
|
|
45
|
-
options?: RequestOptions,
|
|
46
|
-
): APIPromise<
|
|
47
|
-
Result<
|
|
48
|
-
components.CreditRepayResponse,
|
|
49
|
-
| errors.HTTPValidationError
|
|
50
|
-
| CompassAPISDKError
|
|
51
|
-
| ResponseValidationError
|
|
52
|
-
| ConnectionError
|
|
53
|
-
| RequestAbortedError
|
|
54
|
-
| RequestTimeoutError
|
|
55
|
-
| InvalidRequestError
|
|
56
|
-
| UnexpectedClientError
|
|
57
|
-
| SDKValidationError
|
|
58
|
-
>
|
|
59
|
-
> {
|
|
60
|
-
return new APIPromise($do(
|
|
61
|
-
client,
|
|
62
|
-
request,
|
|
63
|
-
options,
|
|
64
|
-
));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async function $do(
|
|
68
|
-
client: CompassApiSDKCore,
|
|
69
|
-
request: components.CreditRepayRequest,
|
|
70
|
-
options?: RequestOptions,
|
|
71
|
-
): Promise<
|
|
72
|
-
[
|
|
73
|
-
Result<
|
|
74
|
-
components.CreditRepayResponse,
|
|
75
|
-
| errors.HTTPValidationError
|
|
76
|
-
| CompassAPISDKError
|
|
77
|
-
| ResponseValidationError
|
|
78
|
-
| ConnectionError
|
|
79
|
-
| RequestAbortedError
|
|
80
|
-
| RequestTimeoutError
|
|
81
|
-
| InvalidRequestError
|
|
82
|
-
| UnexpectedClientError
|
|
83
|
-
| SDKValidationError
|
|
84
|
-
>,
|
|
85
|
-
APICall,
|
|
86
|
-
]
|
|
87
|
-
> {
|
|
88
|
-
const parsed = safeParse(
|
|
89
|
-
request,
|
|
90
|
-
(value) => components.CreditRepayRequest$outboundSchema.parse(value),
|
|
91
|
-
"Input validation failed",
|
|
92
|
-
);
|
|
93
|
-
if (!parsed.ok) {
|
|
94
|
-
return [parsed, { status: "invalid" }];
|
|
95
|
-
}
|
|
96
|
-
const payload = parsed.value;
|
|
97
|
-
const body = encodeJSON("body", payload, { explode: true });
|
|
98
|
-
|
|
99
|
-
const path = pathToFunc("/v2/credit/repay")();
|
|
100
|
-
|
|
101
|
-
const headers = new Headers(compactMap({
|
|
102
|
-
"Content-Type": "application/json",
|
|
103
|
-
Accept: "application/json",
|
|
104
|
-
}));
|
|
105
|
-
|
|
106
|
-
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
107
|
-
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
108
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
109
|
-
|
|
110
|
-
const context = {
|
|
111
|
-
options: client._options,
|
|
112
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
|
-
operationID: "v2_credit_repay",
|
|
114
|
-
oAuth2Scopes: null,
|
|
115
|
-
|
|
116
|
-
resolvedSecurity: requestSecurity,
|
|
117
|
-
|
|
118
|
-
securitySource: client._options.apiKeyAuth,
|
|
119
|
-
retryConfig: options?.retries
|
|
120
|
-
|| client._options.retryConfig
|
|
121
|
-
|| { strategy: "none" },
|
|
122
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const requestRes = client._createRequest(context, {
|
|
126
|
-
security: requestSecurity,
|
|
127
|
-
method: "POST",
|
|
128
|
-
baseURL: options?.serverURL,
|
|
129
|
-
path: path,
|
|
130
|
-
headers: headers,
|
|
131
|
-
body: body,
|
|
132
|
-
userAgent: client._options.userAgent,
|
|
133
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
134
|
-
}, options);
|
|
135
|
-
if (!requestRes.ok) {
|
|
136
|
-
return [requestRes, { status: "invalid" }];
|
|
137
|
-
}
|
|
138
|
-
const req = requestRes.value;
|
|
139
|
-
|
|
140
|
-
const doResult = await client._do(req, {
|
|
141
|
-
context,
|
|
142
|
-
errorCodes: ["422", "4XX", "5XX"],
|
|
143
|
-
retryConfig: context.retryConfig,
|
|
144
|
-
retryCodes: context.retryCodes,
|
|
145
|
-
});
|
|
146
|
-
if (!doResult.ok) {
|
|
147
|
-
return [doResult, { status: "request-error", request: req }];
|
|
148
|
-
}
|
|
149
|
-
const response = doResult.value;
|
|
150
|
-
|
|
151
|
-
const responseFields = {
|
|
152
|
-
HttpMeta: { Response: response, Request: req },
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
const [result] = await M.match<
|
|
156
|
-
components.CreditRepayResponse,
|
|
157
|
-
| errors.HTTPValidationError
|
|
158
|
-
| CompassAPISDKError
|
|
159
|
-
| ResponseValidationError
|
|
160
|
-
| ConnectionError
|
|
161
|
-
| RequestAbortedError
|
|
162
|
-
| RequestTimeoutError
|
|
163
|
-
| InvalidRequestError
|
|
164
|
-
| UnexpectedClientError
|
|
165
|
-
| SDKValidationError
|
|
166
|
-
>(
|
|
167
|
-
M.json(200, components.CreditRepayResponse$inboundSchema),
|
|
168
|
-
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
169
|
-
M.fail("4XX"),
|
|
170
|
-
M.fail("5XX"),
|
|
171
|
-
)(response, req, { extraFields: responseFields });
|
|
172
|
-
if (!result.ok) {
|
|
173
|
-
return [result, { status: "complete", request: req, response }];
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
return [result, { status: "complete", request: req, response }];
|
|
177
|
-
}
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { CompassApiSDKCore } from "../core.js";
|
|
6
|
-
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import * as components from "../models/components/index.js";
|
|
14
|
-
import { CompassAPISDKError } from "../models/errors/compassapisdkerror.js";
|
|
15
|
-
import {
|
|
16
|
-
ConnectionError,
|
|
17
|
-
InvalidRequestError,
|
|
18
|
-
RequestAbortedError,
|
|
19
|
-
RequestTimeoutError,
|
|
20
|
-
UnexpectedClientError,
|
|
21
|
-
} from "../models/errors/httpclienterrors.js";
|
|
22
|
-
import * as errors from "../models/errors/index.js";
|
|
23
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
-
import { Result } from "../types/fp.js";
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Get Permit2 signature data for Credit Account transfer
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* Generate Permit2 EIP-712 typed data for transferring tokens from the owner's EOA
|
|
33
|
-
* to a Credit Account.
|
|
34
|
-
*
|
|
35
|
-
* The owner signs the returned EIP-712 data, then includes the signature in a `/v2/credit/borrow`
|
|
36
|
-
* or `/v2/credit/repay` request to atomically pull tokens from their EOA as part of the bundle.
|
|
37
|
-
*
|
|
38
|
-
* **Flow:**
|
|
39
|
-
* 1. Call this endpoint to get the Permit2 typed data
|
|
40
|
-
* 2. Sign the typed data with the owner's wallet
|
|
41
|
-
* 3. Call `/v2/credit/borrow` or `/v2/credit/repay` with the `permit2_signature`, `permit2_nonce`, and `permit2_deadline` fields
|
|
42
|
-
*/
|
|
43
|
-
export function creditCreditTransfer(
|
|
44
|
-
client: CompassApiSDKCore,
|
|
45
|
-
request: components.CreditTransferRequest,
|
|
46
|
-
options?: RequestOptions,
|
|
47
|
-
): APIPromise<
|
|
48
|
-
Result<
|
|
49
|
-
components.CreditTransferResponse,
|
|
50
|
-
| errors.HTTPValidationError
|
|
51
|
-
| CompassAPISDKError
|
|
52
|
-
| ResponseValidationError
|
|
53
|
-
| ConnectionError
|
|
54
|
-
| RequestAbortedError
|
|
55
|
-
| RequestTimeoutError
|
|
56
|
-
| InvalidRequestError
|
|
57
|
-
| UnexpectedClientError
|
|
58
|
-
| SDKValidationError
|
|
59
|
-
>
|
|
60
|
-
> {
|
|
61
|
-
return new APIPromise($do(
|
|
62
|
-
client,
|
|
63
|
-
request,
|
|
64
|
-
options,
|
|
65
|
-
));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
async function $do(
|
|
69
|
-
client: CompassApiSDKCore,
|
|
70
|
-
request: components.CreditTransferRequest,
|
|
71
|
-
options?: RequestOptions,
|
|
72
|
-
): Promise<
|
|
73
|
-
[
|
|
74
|
-
Result<
|
|
75
|
-
components.CreditTransferResponse,
|
|
76
|
-
| errors.HTTPValidationError
|
|
77
|
-
| CompassAPISDKError
|
|
78
|
-
| ResponseValidationError
|
|
79
|
-
| ConnectionError
|
|
80
|
-
| RequestAbortedError
|
|
81
|
-
| RequestTimeoutError
|
|
82
|
-
| InvalidRequestError
|
|
83
|
-
| UnexpectedClientError
|
|
84
|
-
| SDKValidationError
|
|
85
|
-
>,
|
|
86
|
-
APICall,
|
|
87
|
-
]
|
|
88
|
-
> {
|
|
89
|
-
const parsed = safeParse(
|
|
90
|
-
request,
|
|
91
|
-
(value) => components.CreditTransferRequest$outboundSchema.parse(value),
|
|
92
|
-
"Input validation failed",
|
|
93
|
-
);
|
|
94
|
-
if (!parsed.ok) {
|
|
95
|
-
return [parsed, { status: "invalid" }];
|
|
96
|
-
}
|
|
97
|
-
const payload = parsed.value;
|
|
98
|
-
const body = encodeJSON("body", payload, { explode: true });
|
|
99
|
-
|
|
100
|
-
const path = pathToFunc("/v2/credit/transfer")();
|
|
101
|
-
|
|
102
|
-
const headers = new Headers(compactMap({
|
|
103
|
-
"Content-Type": "application/json",
|
|
104
|
-
Accept: "application/json",
|
|
105
|
-
}));
|
|
106
|
-
|
|
107
|
-
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
108
|
-
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
109
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
110
|
-
|
|
111
|
-
const context = {
|
|
112
|
-
options: client._options,
|
|
113
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
114
|
-
operationID: "v2_credit_transfer",
|
|
115
|
-
oAuth2Scopes: null,
|
|
116
|
-
|
|
117
|
-
resolvedSecurity: requestSecurity,
|
|
118
|
-
|
|
119
|
-
securitySource: client._options.apiKeyAuth,
|
|
120
|
-
retryConfig: options?.retries
|
|
121
|
-
|| client._options.retryConfig
|
|
122
|
-
|| { strategy: "none" },
|
|
123
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const requestRes = client._createRequest(context, {
|
|
127
|
-
security: requestSecurity,
|
|
128
|
-
method: "POST",
|
|
129
|
-
baseURL: options?.serverURL,
|
|
130
|
-
path: path,
|
|
131
|
-
headers: headers,
|
|
132
|
-
body: body,
|
|
133
|
-
userAgent: client._options.userAgent,
|
|
134
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
135
|
-
}, options);
|
|
136
|
-
if (!requestRes.ok) {
|
|
137
|
-
return [requestRes, { status: "invalid" }];
|
|
138
|
-
}
|
|
139
|
-
const req = requestRes.value;
|
|
140
|
-
|
|
141
|
-
const doResult = await client._do(req, {
|
|
142
|
-
context,
|
|
143
|
-
errorCodes: ["422", "4XX", "5XX"],
|
|
144
|
-
retryConfig: context.retryConfig,
|
|
145
|
-
retryCodes: context.retryCodes,
|
|
146
|
-
});
|
|
147
|
-
if (!doResult.ok) {
|
|
148
|
-
return [doResult, { status: "request-error", request: req }];
|
|
149
|
-
}
|
|
150
|
-
const response = doResult.value;
|
|
151
|
-
|
|
152
|
-
const responseFields = {
|
|
153
|
-
HttpMeta: { Response: response, Request: req },
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
const [result] = await M.match<
|
|
157
|
-
components.CreditTransferResponse,
|
|
158
|
-
| errors.HTTPValidationError
|
|
159
|
-
| CompassAPISDKError
|
|
160
|
-
| ResponseValidationError
|
|
161
|
-
| ConnectionError
|
|
162
|
-
| RequestAbortedError
|
|
163
|
-
| RequestTimeoutError
|
|
164
|
-
| InvalidRequestError
|
|
165
|
-
| UnexpectedClientError
|
|
166
|
-
| SDKValidationError
|
|
167
|
-
>(
|
|
168
|
-
M.json(200, components.CreditTransferResponse$inboundSchema),
|
|
169
|
-
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
170
|
-
M.fail("4XX"),
|
|
171
|
-
M.fail("5XX"),
|
|
172
|
-
)(response, req, { extraFields: responseFields });
|
|
173
|
-
if (!result.ok) {
|
|
174
|
-
return [result, { status: "complete", request: req, response }];
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return [result, { status: "complete", request: req, response }];
|
|
178
|
-
}
|
|
@@ -1,77 +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
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Aave account-level summary from getUserAccountData().
|
|
13
|
-
*/
|
|
14
|
-
export type AccountSummary = {
|
|
15
|
-
/**
|
|
16
|
-
* Health factor. Above 1 is safe; below 1 risks liquidation.
|
|
17
|
-
*/
|
|
18
|
-
healthFactor: string;
|
|
19
|
-
/**
|
|
20
|
-
* Total collateral value in USD.
|
|
21
|
-
*/
|
|
22
|
-
totalCollateralUsd: string;
|
|
23
|
-
/**
|
|
24
|
-
* Total debt value in USD.
|
|
25
|
-
*/
|
|
26
|
-
totalDebtUsd: string;
|
|
27
|
-
/**
|
|
28
|
-
* Available borrow capacity in USD.
|
|
29
|
-
*/
|
|
30
|
-
availableBorrowsUsd: string;
|
|
31
|
-
/**
|
|
32
|
-
* Current loan-to-value ratio.
|
|
33
|
-
*/
|
|
34
|
-
ltv: string;
|
|
35
|
-
/**
|
|
36
|
-
* E-Mode category ID. 0 = disabled. E-Mode gives higher LTV when collateral and debt are price-correlated (e.g. stablecoin-to-stablecoin or ETH-to-ETH-derivative).
|
|
37
|
-
*/
|
|
38
|
-
emodeCategoryId?: number | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* Human-readable E-Mode category name (e.g. 'Stablecoins', 'ETH correlated'). Null when E-Mode is disabled (category 0).
|
|
41
|
-
*/
|
|
42
|
-
emodeLabel?: string | null | undefined;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/** @internal */
|
|
46
|
-
export const AccountSummary$inboundSchema: z.ZodType<
|
|
47
|
-
AccountSummary,
|
|
48
|
-
z.ZodTypeDef,
|
|
49
|
-
unknown
|
|
50
|
-
> = z.object({
|
|
51
|
-
health_factor: z.string(),
|
|
52
|
-
total_collateral_usd: z.string(),
|
|
53
|
-
total_debt_usd: z.string(),
|
|
54
|
-
available_borrows_usd: z.string(),
|
|
55
|
-
ltv: z.string(),
|
|
56
|
-
emode_category_id: z.number().int().optional(),
|
|
57
|
-
emode_label: z.nullable(z.string()).optional(),
|
|
58
|
-
}).transform((v) => {
|
|
59
|
-
return remap$(v, {
|
|
60
|
-
"health_factor": "healthFactor",
|
|
61
|
-
"total_collateral_usd": "totalCollateralUsd",
|
|
62
|
-
"total_debt_usd": "totalDebtUsd",
|
|
63
|
-
"available_borrows_usd": "availableBorrowsUsd",
|
|
64
|
-
"emode_category_id": "emodeCategoryId",
|
|
65
|
-
"emode_label": "emodeLabel",
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
export function accountSummaryFromJSON(
|
|
70
|
-
jsonString: string,
|
|
71
|
-
): SafeParseResult<AccountSummary, SDKValidationError> {
|
|
72
|
-
return safeParse(
|
|
73
|
-
jsonString,
|
|
74
|
-
(x) => AccountSummary$inboundSchema.parse(JSON.parse(x)),
|
|
75
|
-
`Failed to parse 'AccountSummary' from JSON`,
|
|
76
|
-
);
|
|
77
|
-
}
|
|
@@ -1,94 +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 collateral position.
|
|
14
|
-
*/
|
|
15
|
-
export type CollateralPosition = {
|
|
16
|
-
/**
|
|
17
|
-
* Address of the collateral token.
|
|
18
|
-
*/
|
|
19
|
-
token: string;
|
|
20
|
-
/**
|
|
21
|
-
* Symbol of the collateral token (e.g. USDC).
|
|
22
|
-
*/
|
|
23
|
-
symbol: string;
|
|
24
|
-
/**
|
|
25
|
-
* Current on-chain aToken balance for the collateral.
|
|
26
|
-
*/
|
|
27
|
-
amountSupplied: string | null;
|
|
28
|
-
/**
|
|
29
|
-
* Collateral value in USD.
|
|
30
|
-
*/
|
|
31
|
-
usdValue?: string | null | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Current supply APY in percentage (e.g. 4.5 means 4.5%).
|
|
34
|
-
*/
|
|
35
|
-
supplyApy?: string | null | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Total collateral deposited over all time.
|
|
38
|
-
*/
|
|
39
|
-
totalDeposited?: string | null | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Total collateral withdrawn over all time.
|
|
42
|
-
*/
|
|
43
|
-
totalWithdrawn?: string | null | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Interest earned on collateral: on_chain_balance + total_withdrawn - total_deposited.
|
|
46
|
-
*/
|
|
47
|
-
interestEarned?: string | null | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Maximum loan-to-value ratio for this collateral in percentage (e.g. 80 means 80%).
|
|
50
|
-
*/
|
|
51
|
-
maxLtv?: string | null | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* All historical events for this collateral reserve.
|
|
54
|
-
*/
|
|
55
|
-
events?: Array<CreditEvent> | undefined;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/** @internal */
|
|
59
|
-
export const CollateralPosition$inboundSchema: z.ZodType<
|
|
60
|
-
CollateralPosition,
|
|
61
|
-
z.ZodTypeDef,
|
|
62
|
-
unknown
|
|
63
|
-
> = z.object({
|
|
64
|
-
token: z.string(),
|
|
65
|
-
symbol: z.string(),
|
|
66
|
-
amount_supplied: z.nullable(z.string()),
|
|
67
|
-
usd_value: z.nullable(z.string()).optional(),
|
|
68
|
-
supply_apy: z.nullable(z.string()).optional(),
|
|
69
|
-
total_deposited: z.nullable(z.string()).optional(),
|
|
70
|
-
total_withdrawn: z.nullable(z.string()).optional(),
|
|
71
|
-
interest_earned: z.nullable(z.string()).optional(),
|
|
72
|
-
max_ltv: z.nullable(z.string()).optional(),
|
|
73
|
-
events: z.array(CreditEvent$inboundSchema).optional(),
|
|
74
|
-
}).transform((v) => {
|
|
75
|
-
return remap$(v, {
|
|
76
|
-
"amount_supplied": "amountSupplied",
|
|
77
|
-
"usd_value": "usdValue",
|
|
78
|
-
"supply_apy": "supplyApy",
|
|
79
|
-
"total_deposited": "totalDeposited",
|
|
80
|
-
"total_withdrawn": "totalWithdrawn",
|
|
81
|
-
"interest_earned": "interestEarned",
|
|
82
|
-
"max_ltv": "maxLtv",
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
export function collateralPositionFromJSON(
|
|
87
|
-
jsonString: string,
|
|
88
|
-
): SafeParseResult<CollateralPosition, SDKValidationError> {
|
|
89
|
-
return safeParse(
|
|
90
|
-
jsonString,
|
|
91
|
-
(x) => CollateralPosition$inboundSchema.parse(JSON.parse(x)),
|
|
92
|
-
`Failed to parse 'CollateralPosition' from JSON`,
|
|
93
|
-
);
|
|
94
|
-
}
|
|
@@ -1,72 +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 { ClosedEnum } from "../../types/enums.js";
|
|
8
|
-
|
|
9
|
-
export const CreateCreditAccountRequestChain = {
|
|
10
|
-
Arbitrum: "arbitrum",
|
|
11
|
-
Base: "base",
|
|
12
|
-
Ethereum: "ethereum",
|
|
13
|
-
} as const;
|
|
14
|
-
export type CreateCreditAccountRequestChain = ClosedEnum<
|
|
15
|
-
typeof CreateCreditAccountRequestChain
|
|
16
|
-
>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Request to create a compass credit account.
|
|
20
|
-
*/
|
|
21
|
-
export type CreateCreditAccountRequest = {
|
|
22
|
-
chain: CreateCreditAccountRequestChain;
|
|
23
|
-
/**
|
|
24
|
-
* The address of the transaction sender.
|
|
25
|
-
*/
|
|
26
|
-
sender: string;
|
|
27
|
-
/**
|
|
28
|
-
* Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
29
|
-
*/
|
|
30
|
-
estimateGas?: boolean | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* The address that will own and control the compass credit account
|
|
33
|
-
*/
|
|
34
|
-
owner: string;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/** @internal */
|
|
38
|
-
export const CreateCreditAccountRequestChain$outboundSchema: z.ZodNativeEnum<
|
|
39
|
-
typeof CreateCreditAccountRequestChain
|
|
40
|
-
> = z.nativeEnum(CreateCreditAccountRequestChain);
|
|
41
|
-
|
|
42
|
-
/** @internal */
|
|
43
|
-
export type CreateCreditAccountRequest$Outbound = {
|
|
44
|
-
chain: string;
|
|
45
|
-
sender: string;
|
|
46
|
-
estimate_gas?: boolean | undefined;
|
|
47
|
-
owner: string;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
/** @internal */
|
|
51
|
-
export const CreateCreditAccountRequest$outboundSchema: z.ZodType<
|
|
52
|
-
CreateCreditAccountRequest$Outbound,
|
|
53
|
-
z.ZodTypeDef,
|
|
54
|
-
CreateCreditAccountRequest
|
|
55
|
-
> = z.object({
|
|
56
|
-
chain: CreateCreditAccountRequestChain$outboundSchema,
|
|
57
|
-
sender: z.string(),
|
|
58
|
-
estimateGas: z.boolean().optional(),
|
|
59
|
-
owner: z.string(),
|
|
60
|
-
}).transform((v) => {
|
|
61
|
-
return remap$(v, {
|
|
62
|
-
estimateGas: "estimate_gas",
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
export function createCreditAccountRequestToJSON(
|
|
67
|
-
createCreditAccountRequest: CreateCreditAccountRequest,
|
|
68
|
-
): string {
|
|
69
|
-
return JSON.stringify(
|
|
70
|
-
CreateCreditAccountRequest$outboundSchema.parse(createCreditAccountRequest),
|
|
71
|
-
);
|
|
72
|
-
}
|
|
@@ -1,51 +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 {
|
|
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
|
-
}
|