@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,176 +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
|
-
* Borrow against collateral
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* Borrow an asset from Aave using a Credit Account.
|
|
33
|
-
*
|
|
34
|
-
* Bundles an optional swap, collateral supply, and borrow into a single atomic Safe transaction.
|
|
35
|
-
*
|
|
36
|
-
* - If `token_in` equals `collateral_token`, the tokens are supplied directly as collateral.
|
|
37
|
-
* - If `token_in` differs from `collateral_token`, a swap is performed first via 1inch.
|
|
38
|
-
*
|
|
39
|
-
* The Credit Account must already be created via `/v2/credit/create_account` and funded with `token_in`.
|
|
40
|
-
*/
|
|
41
|
-
export function creditCreditBorrow(
|
|
42
|
-
client: CompassApiSDKCore,
|
|
43
|
-
request: components.CreditBorrowRequest,
|
|
44
|
-
options?: RequestOptions,
|
|
45
|
-
): APIPromise<
|
|
46
|
-
Result<
|
|
47
|
-
components.CreditBorrowResponse,
|
|
48
|
-
| errors.HTTPValidationError
|
|
49
|
-
| CompassAPISDKError
|
|
50
|
-
| ResponseValidationError
|
|
51
|
-
| ConnectionError
|
|
52
|
-
| RequestAbortedError
|
|
53
|
-
| RequestTimeoutError
|
|
54
|
-
| InvalidRequestError
|
|
55
|
-
| UnexpectedClientError
|
|
56
|
-
| SDKValidationError
|
|
57
|
-
>
|
|
58
|
-
> {
|
|
59
|
-
return new APIPromise($do(
|
|
60
|
-
client,
|
|
61
|
-
request,
|
|
62
|
-
options,
|
|
63
|
-
));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async function $do(
|
|
67
|
-
client: CompassApiSDKCore,
|
|
68
|
-
request: components.CreditBorrowRequest,
|
|
69
|
-
options?: RequestOptions,
|
|
70
|
-
): Promise<
|
|
71
|
-
[
|
|
72
|
-
Result<
|
|
73
|
-
components.CreditBorrowResponse,
|
|
74
|
-
| errors.HTTPValidationError
|
|
75
|
-
| CompassAPISDKError
|
|
76
|
-
| ResponseValidationError
|
|
77
|
-
| ConnectionError
|
|
78
|
-
| RequestAbortedError
|
|
79
|
-
| RequestTimeoutError
|
|
80
|
-
| InvalidRequestError
|
|
81
|
-
| UnexpectedClientError
|
|
82
|
-
| SDKValidationError
|
|
83
|
-
>,
|
|
84
|
-
APICall,
|
|
85
|
-
]
|
|
86
|
-
> {
|
|
87
|
-
const parsed = safeParse(
|
|
88
|
-
request,
|
|
89
|
-
(value) => components.CreditBorrowRequest$outboundSchema.parse(value),
|
|
90
|
-
"Input validation failed",
|
|
91
|
-
);
|
|
92
|
-
if (!parsed.ok) {
|
|
93
|
-
return [parsed, { status: "invalid" }];
|
|
94
|
-
}
|
|
95
|
-
const payload = parsed.value;
|
|
96
|
-
const body = encodeJSON("body", payload, { explode: true });
|
|
97
|
-
|
|
98
|
-
const path = pathToFunc("/v2/credit/borrow")();
|
|
99
|
-
|
|
100
|
-
const headers = new Headers(compactMap({
|
|
101
|
-
"Content-Type": "application/json",
|
|
102
|
-
Accept: "application/json",
|
|
103
|
-
}));
|
|
104
|
-
|
|
105
|
-
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
106
|
-
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
107
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
108
|
-
|
|
109
|
-
const context = {
|
|
110
|
-
options: client._options,
|
|
111
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
112
|
-
operationID: "v2_credit_borrow",
|
|
113
|
-
oAuth2Scopes: null,
|
|
114
|
-
|
|
115
|
-
resolvedSecurity: requestSecurity,
|
|
116
|
-
|
|
117
|
-
securitySource: client._options.apiKeyAuth,
|
|
118
|
-
retryConfig: options?.retries
|
|
119
|
-
|| client._options.retryConfig
|
|
120
|
-
|| { strategy: "none" },
|
|
121
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const requestRes = client._createRequest(context, {
|
|
125
|
-
security: requestSecurity,
|
|
126
|
-
method: "POST",
|
|
127
|
-
baseURL: options?.serverURL,
|
|
128
|
-
path: path,
|
|
129
|
-
headers: headers,
|
|
130
|
-
body: body,
|
|
131
|
-
userAgent: client._options.userAgent,
|
|
132
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
133
|
-
}, options);
|
|
134
|
-
if (!requestRes.ok) {
|
|
135
|
-
return [requestRes, { status: "invalid" }];
|
|
136
|
-
}
|
|
137
|
-
const req = requestRes.value;
|
|
138
|
-
|
|
139
|
-
const doResult = await client._do(req, {
|
|
140
|
-
context,
|
|
141
|
-
errorCodes: ["422", "4XX", "5XX"],
|
|
142
|
-
retryConfig: context.retryConfig,
|
|
143
|
-
retryCodes: context.retryCodes,
|
|
144
|
-
});
|
|
145
|
-
if (!doResult.ok) {
|
|
146
|
-
return [doResult, { status: "request-error", request: req }];
|
|
147
|
-
}
|
|
148
|
-
const response = doResult.value;
|
|
149
|
-
|
|
150
|
-
const responseFields = {
|
|
151
|
-
HttpMeta: { Response: response, Request: req },
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
const [result] = await M.match<
|
|
155
|
-
components.CreditBorrowResponse,
|
|
156
|
-
| errors.HTTPValidationError
|
|
157
|
-
| CompassAPISDKError
|
|
158
|
-
| ResponseValidationError
|
|
159
|
-
| ConnectionError
|
|
160
|
-
| RequestAbortedError
|
|
161
|
-
| RequestTimeoutError
|
|
162
|
-
| InvalidRequestError
|
|
163
|
-
| UnexpectedClientError
|
|
164
|
-
| SDKValidationError
|
|
165
|
-
>(
|
|
166
|
-
M.json(200, components.CreditBorrowResponse$inboundSchema),
|
|
167
|
-
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
168
|
-
M.fail("4XX"),
|
|
169
|
-
M.fail("5XX"),
|
|
170
|
-
)(response, req, { extraFields: responseFields });
|
|
171
|
-
if (!result.ok) {
|
|
172
|
-
return [result, { status: "complete", request: req, response }];
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return [result, { status: "complete", request: req, response }];
|
|
176
|
-
}
|
|
@@ -1,172 +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
|
-
* Execute multiple credit actions atomically
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* Compose individual credit operations (supply, withdraw, borrow, repay, swap, transfer)
|
|
33
|
-
* into a single atomic Safe transaction.
|
|
34
|
-
*
|
|
35
|
-
* The Credit Account must already be created via `/v2/credit/create_account`.
|
|
36
|
-
*/
|
|
37
|
-
export function creditCreditBundle(
|
|
38
|
-
client: CompassApiSDKCore,
|
|
39
|
-
request: components.CreditBundleRequest,
|
|
40
|
-
options?: RequestOptions,
|
|
41
|
-
): APIPromise<
|
|
42
|
-
Result<
|
|
43
|
-
components.CreditBundleResponse,
|
|
44
|
-
| errors.HTTPValidationError
|
|
45
|
-
| CompassAPISDKError
|
|
46
|
-
| ResponseValidationError
|
|
47
|
-
| ConnectionError
|
|
48
|
-
| RequestAbortedError
|
|
49
|
-
| RequestTimeoutError
|
|
50
|
-
| InvalidRequestError
|
|
51
|
-
| UnexpectedClientError
|
|
52
|
-
| SDKValidationError
|
|
53
|
-
>
|
|
54
|
-
> {
|
|
55
|
-
return new APIPromise($do(
|
|
56
|
-
client,
|
|
57
|
-
request,
|
|
58
|
-
options,
|
|
59
|
-
));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async function $do(
|
|
63
|
-
client: CompassApiSDKCore,
|
|
64
|
-
request: components.CreditBundleRequest,
|
|
65
|
-
options?: RequestOptions,
|
|
66
|
-
): Promise<
|
|
67
|
-
[
|
|
68
|
-
Result<
|
|
69
|
-
components.CreditBundleResponse,
|
|
70
|
-
| errors.HTTPValidationError
|
|
71
|
-
| CompassAPISDKError
|
|
72
|
-
| ResponseValidationError
|
|
73
|
-
| ConnectionError
|
|
74
|
-
| RequestAbortedError
|
|
75
|
-
| RequestTimeoutError
|
|
76
|
-
| InvalidRequestError
|
|
77
|
-
| UnexpectedClientError
|
|
78
|
-
| SDKValidationError
|
|
79
|
-
>,
|
|
80
|
-
APICall,
|
|
81
|
-
]
|
|
82
|
-
> {
|
|
83
|
-
const parsed = safeParse(
|
|
84
|
-
request,
|
|
85
|
-
(value) => components.CreditBundleRequest$outboundSchema.parse(value),
|
|
86
|
-
"Input validation failed",
|
|
87
|
-
);
|
|
88
|
-
if (!parsed.ok) {
|
|
89
|
-
return [parsed, { status: "invalid" }];
|
|
90
|
-
}
|
|
91
|
-
const payload = parsed.value;
|
|
92
|
-
const body = encodeJSON("body", payload, { explode: true });
|
|
93
|
-
|
|
94
|
-
const path = pathToFunc("/v2/credit/bundle")();
|
|
95
|
-
|
|
96
|
-
const headers = new Headers(compactMap({
|
|
97
|
-
"Content-Type": "application/json",
|
|
98
|
-
Accept: "application/json",
|
|
99
|
-
}));
|
|
100
|
-
|
|
101
|
-
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
102
|
-
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
103
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
104
|
-
|
|
105
|
-
const context = {
|
|
106
|
-
options: client._options,
|
|
107
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
108
|
-
operationID: "v2_credit_bundle",
|
|
109
|
-
oAuth2Scopes: null,
|
|
110
|
-
|
|
111
|
-
resolvedSecurity: requestSecurity,
|
|
112
|
-
|
|
113
|
-
securitySource: client._options.apiKeyAuth,
|
|
114
|
-
retryConfig: options?.retries
|
|
115
|
-
|| client._options.retryConfig
|
|
116
|
-
|| { strategy: "none" },
|
|
117
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const requestRes = client._createRequest(context, {
|
|
121
|
-
security: requestSecurity,
|
|
122
|
-
method: "POST",
|
|
123
|
-
baseURL: options?.serverURL,
|
|
124
|
-
path: path,
|
|
125
|
-
headers: headers,
|
|
126
|
-
body: body,
|
|
127
|
-
userAgent: client._options.userAgent,
|
|
128
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
129
|
-
}, options);
|
|
130
|
-
if (!requestRes.ok) {
|
|
131
|
-
return [requestRes, { status: "invalid" }];
|
|
132
|
-
}
|
|
133
|
-
const req = requestRes.value;
|
|
134
|
-
|
|
135
|
-
const doResult = await client._do(req, {
|
|
136
|
-
context,
|
|
137
|
-
errorCodes: ["422", "4XX", "5XX"],
|
|
138
|
-
retryConfig: context.retryConfig,
|
|
139
|
-
retryCodes: context.retryCodes,
|
|
140
|
-
});
|
|
141
|
-
if (!doResult.ok) {
|
|
142
|
-
return [doResult, { status: "request-error", request: req }];
|
|
143
|
-
}
|
|
144
|
-
const response = doResult.value;
|
|
145
|
-
|
|
146
|
-
const responseFields = {
|
|
147
|
-
HttpMeta: { Response: response, Request: req },
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
const [result] = await M.match<
|
|
151
|
-
components.CreditBundleResponse,
|
|
152
|
-
| errors.HTTPValidationError
|
|
153
|
-
| CompassAPISDKError
|
|
154
|
-
| ResponseValidationError
|
|
155
|
-
| ConnectionError
|
|
156
|
-
| RequestAbortedError
|
|
157
|
-
| RequestTimeoutError
|
|
158
|
-
| InvalidRequestError
|
|
159
|
-
| UnexpectedClientError
|
|
160
|
-
| SDKValidationError
|
|
161
|
-
>(
|
|
162
|
-
M.json(200, components.CreditBundleResponse$inboundSchema),
|
|
163
|
-
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
164
|
-
M.fail("4XX"),
|
|
165
|
-
M.fail("5XX"),
|
|
166
|
-
)(response, req, { extraFields: responseFields });
|
|
167
|
-
if (!result.ok) {
|
|
168
|
-
return [result, { status: "complete", request: req, response }];
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return [result, { status: "complete", request: req, response }];
|
|
172
|
-
}
|
|
@@ -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
|
-
* Create credit account
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* Create a Credit Account for a wallet address.
|
|
33
|
-
*
|
|
34
|
-
* Before using credit features, the owner must create a Credit Account. Each wallet address has one Credit Account per chain.
|
|
35
|
-
*
|
|
36
|
-
* Returns an unsigned transaction to create the account. The `sender` signs and broadcasts this transaction.
|
|
37
|
-
*
|
|
38
|
-
* **If owner pays gas:** Set `sender` to the owner's address.
|
|
39
|
-
*
|
|
40
|
-
* **If someone else pays gas:** Set `sender` to the wallet that will sign and broadcast the transaction on behalf of the owner.
|
|
41
|
-
*/
|
|
42
|
-
export function creditCreditCreateAccount(
|
|
43
|
-
client: CompassApiSDKCore,
|
|
44
|
-
request: components.CreateCreditAccountRequest,
|
|
45
|
-
options?: RequestOptions,
|
|
46
|
-
): APIPromise<
|
|
47
|
-
Result<
|
|
48
|
-
components.CreateCreditAccountResponse,
|
|
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.CreateCreditAccountRequest,
|
|
70
|
-
options?: RequestOptions,
|
|
71
|
-
): Promise<
|
|
72
|
-
[
|
|
73
|
-
Result<
|
|
74
|
-
components.CreateCreditAccountResponse,
|
|
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) =>
|
|
91
|
-
components.CreateCreditAccountRequest$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/create_account")();
|
|
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_create_account",
|
|
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.CreateCreditAccountResponse,
|
|
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.CreateCreditAccountResponse$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,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 { encodeFormQuery } 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 * as operations from "../models/operations/index.js";
|
|
26
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
-
import { Result } from "../types/fp.js";
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* List credit positions
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* List all Credit positions for a given owner.
|
|
34
|
-
*
|
|
35
|
-
* Returns a unified list of positions (collateral and debt) and an account summary
|
|
36
|
-
* with health factor and LTV. Each position includes event history.
|
|
37
|
-
*/
|
|
38
|
-
export function creditCreditPositions(
|
|
39
|
-
client: CompassApiSDKCore,
|
|
40
|
-
request: operations.V2CreditPositionsRequest,
|
|
41
|
-
options?: RequestOptions,
|
|
42
|
-
): APIPromise<
|
|
43
|
-
Result<
|
|
44
|
-
components.CreditPositionsResponse,
|
|
45
|
-
| errors.HTTPValidationError
|
|
46
|
-
| CompassAPISDKError
|
|
47
|
-
| ResponseValidationError
|
|
48
|
-
| ConnectionError
|
|
49
|
-
| RequestAbortedError
|
|
50
|
-
| RequestTimeoutError
|
|
51
|
-
| InvalidRequestError
|
|
52
|
-
| UnexpectedClientError
|
|
53
|
-
| SDKValidationError
|
|
54
|
-
>
|
|
55
|
-
> {
|
|
56
|
-
return new APIPromise($do(
|
|
57
|
-
client,
|
|
58
|
-
request,
|
|
59
|
-
options,
|
|
60
|
-
));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
async function $do(
|
|
64
|
-
client: CompassApiSDKCore,
|
|
65
|
-
request: operations.V2CreditPositionsRequest,
|
|
66
|
-
options?: RequestOptions,
|
|
67
|
-
): Promise<
|
|
68
|
-
[
|
|
69
|
-
Result<
|
|
70
|
-
components.CreditPositionsResponse,
|
|
71
|
-
| errors.HTTPValidationError
|
|
72
|
-
| CompassAPISDKError
|
|
73
|
-
| ResponseValidationError
|
|
74
|
-
| ConnectionError
|
|
75
|
-
| RequestAbortedError
|
|
76
|
-
| RequestTimeoutError
|
|
77
|
-
| InvalidRequestError
|
|
78
|
-
| UnexpectedClientError
|
|
79
|
-
| SDKValidationError
|
|
80
|
-
>,
|
|
81
|
-
APICall,
|
|
82
|
-
]
|
|
83
|
-
> {
|
|
84
|
-
const parsed = safeParse(
|
|
85
|
-
request,
|
|
86
|
-
(value) => operations.V2CreditPositionsRequest$outboundSchema.parse(value),
|
|
87
|
-
"Input validation failed",
|
|
88
|
-
);
|
|
89
|
-
if (!parsed.ok) {
|
|
90
|
-
return [parsed, { status: "invalid" }];
|
|
91
|
-
}
|
|
92
|
-
const payload = parsed.value;
|
|
93
|
-
const body = null;
|
|
94
|
-
|
|
95
|
-
const path = pathToFunc("/v2/credit/positions")();
|
|
96
|
-
|
|
97
|
-
const query = encodeFormQuery({
|
|
98
|
-
"chain": payload.chain,
|
|
99
|
-
"owner": payload.owner,
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
const headers = new Headers(compactMap({
|
|
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_positions",
|
|
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: "GET",
|
|
128
|
-
baseURL: options?.serverURL,
|
|
129
|
-
path: path,
|
|
130
|
-
headers: headers,
|
|
131
|
-
query: query,
|
|
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.CreditPositionsResponse,
|
|
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.CreditPositionsResponse$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
|
-
}
|