@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,15 +0,0 @@
|
|
|
1
|
-
# V2CreditPositionsChain
|
|
2
|
-
|
|
3
|
-
## Example Usage
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
import { V2CreditPositionsChain } from "@compass-labs/api-sdk/models/operations";
|
|
7
|
-
|
|
8
|
-
let value: V2CreditPositionsChain = "base";
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Values
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
"arbitrum" | "base" | "ethereum"
|
|
15
|
-
```
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# V2CreditPositionsRequest
|
|
2
|
-
|
|
3
|
-
## Example Usage
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
import { V2CreditPositionsRequest } from "@compass-labs/api-sdk/models/operations";
|
|
7
|
-
|
|
8
|
-
let value: V2CreditPositionsRequest = {
|
|
9
|
-
chain: "base",
|
|
10
|
-
owner: "0x01E62835dd7F52173546A325294762143eE4a882",
|
|
11
|
-
};
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Fields
|
|
15
|
-
|
|
16
|
-
| Field | Type | Required | Description | Example |
|
|
17
|
-
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
18
|
-
| `chain` | [operations.V2CreditPositionsChain](../../models/operations/v2creditpositionschain.md) | :heavy_check_mark: | N/A | base |
|
|
19
|
-
| `owner` | *string* | :heavy_check_mark: | The address of the owner of the credit account to get positions for. | 0x01E62835dd7F52173546A325294762143eE4a882 |
|
|
@@ -1,562 +0,0 @@
|
|
|
1
|
-
# Credit
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
### Available Operations
|
|
6
|
-
|
|
7
|
-
* [creditPositions](#creditpositions) - List credit positions
|
|
8
|
-
* [creditCreateAccount](#creditcreateaccount) - Create credit account
|
|
9
|
-
* [creditBorrow](#creditborrow) - Borrow against collateral
|
|
10
|
-
* [creditTransfer](#credittransfer) - Get Permit2 signature data for Credit Account transfer
|
|
11
|
-
* [creditRepay](#creditrepay) - Repay debt and withdraw collateral
|
|
12
|
-
* [creditBundle](#creditbundle) - Execute multiple credit actions atomically
|
|
13
|
-
|
|
14
|
-
## creditPositions
|
|
15
|
-
|
|
16
|
-
List all Credit positions for a given owner.
|
|
17
|
-
|
|
18
|
-
Returns a unified list of positions (collateral and debt) and an account summary
|
|
19
|
-
with health factor and LTV. Each position includes event history.
|
|
20
|
-
|
|
21
|
-
### Example Usage
|
|
22
|
-
|
|
23
|
-
<!-- UsageSnippet language="typescript" operationID="v2_credit_positions" method="get" path="/v2/credit/positions" -->
|
|
24
|
-
```typescript
|
|
25
|
-
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
26
|
-
|
|
27
|
-
const compassApiSDK = new CompassApiSDK({
|
|
28
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
async function run() {
|
|
32
|
-
const result = await compassApiSDK.credit.creditPositions({
|
|
33
|
-
chain: "base",
|
|
34
|
-
owner: "0x01E62835dd7F52173546A325294762143eE4a882",
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
console.log(result);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
run();
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Standalone function
|
|
44
|
-
|
|
45
|
-
The standalone function version of this method:
|
|
46
|
-
|
|
47
|
-
```typescript
|
|
48
|
-
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
49
|
-
import { creditCreditPositions } from "@compass-labs/api-sdk/funcs/creditCreditPositions.js";
|
|
50
|
-
|
|
51
|
-
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
52
|
-
// You can create one instance of it to use across an application.
|
|
53
|
-
const compassApiSDK = new CompassApiSDKCore({
|
|
54
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
async function run() {
|
|
58
|
-
const res = await creditCreditPositions(compassApiSDK, {
|
|
59
|
-
chain: "base",
|
|
60
|
-
owner: "0x01E62835dd7F52173546A325294762143eE4a882",
|
|
61
|
-
});
|
|
62
|
-
if (res.ok) {
|
|
63
|
-
const { value: result } = res;
|
|
64
|
-
console.log(result);
|
|
65
|
-
} else {
|
|
66
|
-
console.log("creditCreditPositions failed:", res.error);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
run();
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Parameters
|
|
74
|
-
|
|
75
|
-
| Parameter | Type | Required | Description |
|
|
76
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
77
|
-
| `request` | [operations.V2CreditPositionsRequest](../../models/operations/v2creditpositionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
78
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
79
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
80
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
81
|
-
|
|
82
|
-
### Response
|
|
83
|
-
|
|
84
|
-
**Promise\<[components.CreditPositionsResponse](../../models/components/creditpositionsresponse.md)\>**
|
|
85
|
-
|
|
86
|
-
### Errors
|
|
87
|
-
|
|
88
|
-
| Error Type | Status Code | Content Type |
|
|
89
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
90
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
91
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
92
|
-
|
|
93
|
-
## creditCreateAccount
|
|
94
|
-
|
|
95
|
-
Create a Credit Account for a wallet address.
|
|
96
|
-
|
|
97
|
-
Before using credit features, the owner must create a Credit Account. Each wallet address has one Credit Account per chain.
|
|
98
|
-
|
|
99
|
-
Returns an unsigned transaction to create the account. The `sender` signs and broadcasts this transaction.
|
|
100
|
-
|
|
101
|
-
**If owner pays gas:** Set `sender` to the owner's address.
|
|
102
|
-
|
|
103
|
-
**If someone else pays gas:** Set `sender` to the wallet that will sign and broadcast the transaction on behalf of the owner.
|
|
104
|
-
|
|
105
|
-
### Example Usage
|
|
106
|
-
|
|
107
|
-
<!-- UsageSnippet language="typescript" operationID="v2_credit_create_account" method="post" path="/v2/credit/create_account" -->
|
|
108
|
-
```typescript
|
|
109
|
-
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
110
|
-
|
|
111
|
-
const compassApiSDK = new CompassApiSDK({
|
|
112
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
async function run() {
|
|
116
|
-
const result = await compassApiSDK.credit.creditCreateAccount({
|
|
117
|
-
chain: "base",
|
|
118
|
-
sender: "0xc98949522db2eE403d6c75E91DDEe875a824bB10",
|
|
119
|
-
owner: "0xc98949522db2eE403d6c75E91DDEe875a824bB10",
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
console.log(result);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
run();
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Standalone function
|
|
129
|
-
|
|
130
|
-
The standalone function version of this method:
|
|
131
|
-
|
|
132
|
-
```typescript
|
|
133
|
-
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
134
|
-
import { creditCreditCreateAccount } from "@compass-labs/api-sdk/funcs/creditCreditCreateAccount.js";
|
|
135
|
-
|
|
136
|
-
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
137
|
-
// You can create one instance of it to use across an application.
|
|
138
|
-
const compassApiSDK = new CompassApiSDKCore({
|
|
139
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
async function run() {
|
|
143
|
-
const res = await creditCreditCreateAccount(compassApiSDK, {
|
|
144
|
-
chain: "base",
|
|
145
|
-
sender: "0xc98949522db2eE403d6c75E91DDEe875a824bB10",
|
|
146
|
-
owner: "0xc98949522db2eE403d6c75E91DDEe875a824bB10",
|
|
147
|
-
});
|
|
148
|
-
if (res.ok) {
|
|
149
|
-
const { value: result } = res;
|
|
150
|
-
console.log(result);
|
|
151
|
-
} else {
|
|
152
|
-
console.log("creditCreditCreateAccount failed:", res.error);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
run();
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### Parameters
|
|
160
|
-
|
|
161
|
-
| Parameter | Type | Required | Description |
|
|
162
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
163
|
-
| `request` | [components.CreateCreditAccountRequest](../../models/components/createcreditaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
164
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
165
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
166
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
167
|
-
|
|
168
|
-
### Response
|
|
169
|
-
|
|
170
|
-
**Promise\<[components.CreateCreditAccountResponse](../../models/components/createcreditaccountresponse.md)\>**
|
|
171
|
-
|
|
172
|
-
### Errors
|
|
173
|
-
|
|
174
|
-
| Error Type | Status Code | Content Type |
|
|
175
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
176
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
177
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
178
|
-
|
|
179
|
-
## creditBorrow
|
|
180
|
-
|
|
181
|
-
Borrow an asset from Aave using a Credit Account.
|
|
182
|
-
|
|
183
|
-
Bundles an optional swap, collateral supply, and borrow into a single atomic Safe transaction.
|
|
184
|
-
|
|
185
|
-
- If `token_in` equals `collateral_token`, the tokens are supplied directly as collateral.
|
|
186
|
-
- If `token_in` differs from `collateral_token`, a swap is performed first via 1inch.
|
|
187
|
-
|
|
188
|
-
The Credit Account must already be created via `/v2/credit/create_account` and funded with `token_in`.
|
|
189
|
-
|
|
190
|
-
### Example Usage
|
|
191
|
-
|
|
192
|
-
<!-- UsageSnippet language="typescript" operationID="v2_credit_borrow" method="post" path="/v2/credit/borrow" -->
|
|
193
|
-
```typescript
|
|
194
|
-
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
195
|
-
|
|
196
|
-
const compassApiSDK = new CompassApiSDK({
|
|
197
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
async function run() {
|
|
201
|
-
const result = await compassApiSDK.credit.creditBorrow({
|
|
202
|
-
owner: "0xfeEb60eBf707DAA8248277058eb8D28EaeCF5425",
|
|
203
|
-
chain: "base",
|
|
204
|
-
tokenIn: "USDC",
|
|
205
|
-
amountIn: 100,
|
|
206
|
-
collateralToken: "USDC",
|
|
207
|
-
borrowToken: "WETH",
|
|
208
|
-
borrowAmount: 0.01,
|
|
209
|
-
interestRateMode: "variable",
|
|
210
|
-
slippage: 0.5,
|
|
211
|
-
gasSponsorship: false,
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
console.log(result);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
run();
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### Standalone function
|
|
221
|
-
|
|
222
|
-
The standalone function version of this method:
|
|
223
|
-
|
|
224
|
-
```typescript
|
|
225
|
-
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
226
|
-
import { creditCreditBorrow } from "@compass-labs/api-sdk/funcs/creditCreditBorrow.js";
|
|
227
|
-
|
|
228
|
-
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
229
|
-
// You can create one instance of it to use across an application.
|
|
230
|
-
const compassApiSDK = new CompassApiSDKCore({
|
|
231
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
async function run() {
|
|
235
|
-
const res = await creditCreditBorrow(compassApiSDK, {
|
|
236
|
-
owner: "0xfeEb60eBf707DAA8248277058eb8D28EaeCF5425",
|
|
237
|
-
chain: "base",
|
|
238
|
-
tokenIn: "USDC",
|
|
239
|
-
amountIn: 100,
|
|
240
|
-
collateralToken: "USDC",
|
|
241
|
-
borrowToken: "WETH",
|
|
242
|
-
borrowAmount: 0.01,
|
|
243
|
-
interestRateMode: "variable",
|
|
244
|
-
slippage: 0.5,
|
|
245
|
-
gasSponsorship: false,
|
|
246
|
-
});
|
|
247
|
-
if (res.ok) {
|
|
248
|
-
const { value: result } = res;
|
|
249
|
-
console.log(result);
|
|
250
|
-
} else {
|
|
251
|
-
console.log("creditCreditBorrow failed:", res.error);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
run();
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
### Parameters
|
|
259
|
-
|
|
260
|
-
| Parameter | Type | Required | Description |
|
|
261
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
262
|
-
| `request` | [components.CreditBorrowRequest](../../models/components/creditborrowrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
263
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
264
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
265
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
266
|
-
|
|
267
|
-
### Response
|
|
268
|
-
|
|
269
|
-
**Promise\<[components.CreditBorrowResponse](../../models/components/creditborrowresponse.md)\>**
|
|
270
|
-
|
|
271
|
-
### Errors
|
|
272
|
-
|
|
273
|
-
| Error Type | Status Code | Content Type |
|
|
274
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
275
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
276
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
277
|
-
|
|
278
|
-
## creditTransfer
|
|
279
|
-
|
|
280
|
-
Generate Permit2 EIP-712 typed data for transferring tokens from the owner's EOA
|
|
281
|
-
to a Credit Account.
|
|
282
|
-
|
|
283
|
-
The owner signs the returned EIP-712 data, then includes the signature in a `/v2/credit/borrow`
|
|
284
|
-
or `/v2/credit/repay` request to atomically pull tokens from their EOA as part of the bundle.
|
|
285
|
-
|
|
286
|
-
**Flow:**
|
|
287
|
-
1. Call this endpoint to get the Permit2 typed data
|
|
288
|
-
2. Sign the typed data with the owner's wallet
|
|
289
|
-
3. Call `/v2/credit/borrow` or `/v2/credit/repay` with the `permit2_signature`, `permit2_nonce`, and `permit2_deadline` fields
|
|
290
|
-
|
|
291
|
-
### Example Usage
|
|
292
|
-
|
|
293
|
-
<!-- UsageSnippet language="typescript" operationID="v2_credit_transfer" method="post" path="/v2/credit/transfer" -->
|
|
294
|
-
```typescript
|
|
295
|
-
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
296
|
-
|
|
297
|
-
const compassApiSDK = new CompassApiSDK({
|
|
298
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
async function run() {
|
|
302
|
-
const result = await compassApiSDK.credit.creditTransfer({
|
|
303
|
-
owner: "0x4A83fec8c6A9A25Be28f3242a16dBaD0ab00f3a6",
|
|
304
|
-
chain: "base",
|
|
305
|
-
token: "USDC",
|
|
306
|
-
amount: 100,
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
console.log(result);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
run();
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
### Standalone function
|
|
316
|
-
|
|
317
|
-
The standalone function version of this method:
|
|
318
|
-
|
|
319
|
-
```typescript
|
|
320
|
-
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
321
|
-
import { creditCreditTransfer } from "@compass-labs/api-sdk/funcs/creditCreditTransfer.js";
|
|
322
|
-
|
|
323
|
-
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
324
|
-
// You can create one instance of it to use across an application.
|
|
325
|
-
const compassApiSDK = new CompassApiSDKCore({
|
|
326
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
async function run() {
|
|
330
|
-
const res = await creditCreditTransfer(compassApiSDK, {
|
|
331
|
-
owner: "0x4A83fec8c6A9A25Be28f3242a16dBaD0ab00f3a6",
|
|
332
|
-
chain: "base",
|
|
333
|
-
token: "USDC",
|
|
334
|
-
amount: 100,
|
|
335
|
-
});
|
|
336
|
-
if (res.ok) {
|
|
337
|
-
const { value: result } = res;
|
|
338
|
-
console.log(result);
|
|
339
|
-
} else {
|
|
340
|
-
console.log("creditCreditTransfer failed:", res.error);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
run();
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
### Parameters
|
|
348
|
-
|
|
349
|
-
| Parameter | Type | Required | Description |
|
|
350
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
351
|
-
| `request` | [components.CreditTransferRequest](../../models/components/credittransferrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
352
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
353
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
354
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
355
|
-
|
|
356
|
-
### Response
|
|
357
|
-
|
|
358
|
-
**Promise\<[components.CreditTransferResponse](../../models/components/credittransferresponse.md)\>**
|
|
359
|
-
|
|
360
|
-
### Errors
|
|
361
|
-
|
|
362
|
-
| Error Type | Status Code | Content Type |
|
|
363
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
364
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
365
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
366
|
-
|
|
367
|
-
## creditRepay
|
|
368
|
-
|
|
369
|
-
Repay an Aave debt and withdraw collateral from a Credit Account.
|
|
370
|
-
|
|
371
|
-
Bundles repayment, collateral withdrawal, and an optional swap into a single atomic Safe transaction.
|
|
372
|
-
|
|
373
|
-
- If `token_out` is None or equals `withdraw_token`, the withdrawn collateral is kept as-is.
|
|
374
|
-
- If `token_out` differs from `withdraw_token`, a swap is performed after withdrawal via 1inch.
|
|
375
|
-
|
|
376
|
-
The Credit Account must already have a borrow position created via `/v2/credit/borrow`.
|
|
377
|
-
The repay_token must be available in the Credit Account (or pulled from EOA via Permit2).
|
|
378
|
-
|
|
379
|
-
### Example Usage
|
|
380
|
-
|
|
381
|
-
<!-- UsageSnippet language="typescript" operationID="v2_credit_repay" method="post" path="/v2/credit/repay" -->
|
|
382
|
-
```typescript
|
|
383
|
-
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
384
|
-
|
|
385
|
-
const compassApiSDK = new CompassApiSDK({
|
|
386
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
async function run() {
|
|
390
|
-
const result = await compassApiSDK.credit.creditRepay({
|
|
391
|
-
owner: "0x831Ad0C52C77708DA5D49dc8278C966dfdD4ddA1",
|
|
392
|
-
chain: "base",
|
|
393
|
-
repayToken: "WETH",
|
|
394
|
-
repayAmount: 0.01,
|
|
395
|
-
interestRateMode: "variable",
|
|
396
|
-
withdrawToken: "USDC",
|
|
397
|
-
withdrawAmount: 100,
|
|
398
|
-
slippage: 0.5,
|
|
399
|
-
gasSponsorship: false,
|
|
400
|
-
});
|
|
401
|
-
|
|
402
|
-
console.log(result);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
run();
|
|
406
|
-
```
|
|
407
|
-
|
|
408
|
-
### Standalone function
|
|
409
|
-
|
|
410
|
-
The standalone function version of this method:
|
|
411
|
-
|
|
412
|
-
```typescript
|
|
413
|
-
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
414
|
-
import { creditCreditRepay } from "@compass-labs/api-sdk/funcs/creditCreditRepay.js";
|
|
415
|
-
|
|
416
|
-
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
417
|
-
// You can create one instance of it to use across an application.
|
|
418
|
-
const compassApiSDK = new CompassApiSDKCore({
|
|
419
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
420
|
-
});
|
|
421
|
-
|
|
422
|
-
async function run() {
|
|
423
|
-
const res = await creditCreditRepay(compassApiSDK, {
|
|
424
|
-
owner: "0x831Ad0C52C77708DA5D49dc8278C966dfdD4ddA1",
|
|
425
|
-
chain: "base",
|
|
426
|
-
repayToken: "WETH",
|
|
427
|
-
repayAmount: 0.01,
|
|
428
|
-
interestRateMode: "variable",
|
|
429
|
-
withdrawToken: "USDC",
|
|
430
|
-
withdrawAmount: 100,
|
|
431
|
-
slippage: 0.5,
|
|
432
|
-
gasSponsorship: false,
|
|
433
|
-
});
|
|
434
|
-
if (res.ok) {
|
|
435
|
-
const { value: result } = res;
|
|
436
|
-
console.log(result);
|
|
437
|
-
} else {
|
|
438
|
-
console.log("creditCreditRepay failed:", res.error);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
run();
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
### Parameters
|
|
446
|
-
|
|
447
|
-
| Parameter | Type | Required | Description |
|
|
448
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
449
|
-
| `request` | [components.CreditRepayRequest](../../models/components/creditrepayrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
450
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
451
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
452
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
453
|
-
|
|
454
|
-
### Response
|
|
455
|
-
|
|
456
|
-
**Promise\<[components.CreditRepayResponse](../../models/components/creditrepayresponse.md)\>**
|
|
457
|
-
|
|
458
|
-
### Errors
|
|
459
|
-
|
|
460
|
-
| Error Type | Status Code | Content Type |
|
|
461
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
462
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
463
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
464
|
-
|
|
465
|
-
## creditBundle
|
|
466
|
-
|
|
467
|
-
Compose individual credit operations (supply, withdraw, borrow, repay, swap, transfer)
|
|
468
|
-
into a single atomic Safe transaction.
|
|
469
|
-
|
|
470
|
-
The Credit Account must already be created via `/v2/credit/create_account`.
|
|
471
|
-
|
|
472
|
-
### Example Usage
|
|
473
|
-
|
|
474
|
-
<!-- UsageSnippet language="typescript" operationID="v2_credit_bundle" method="post" path="/v2/credit/bundle" -->
|
|
475
|
-
```typescript
|
|
476
|
-
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
477
|
-
|
|
478
|
-
const compassApiSDK = new CompassApiSDK({
|
|
479
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
480
|
-
});
|
|
481
|
-
|
|
482
|
-
async function run() {
|
|
483
|
-
const result = await compassApiSDK.credit.creditBundle({
|
|
484
|
-
owner: "<value>",
|
|
485
|
-
chain: "arbitrum",
|
|
486
|
-
actions: [
|
|
487
|
-
{
|
|
488
|
-
body: {
|
|
489
|
-
actionType: "V2_TRANSFER_TO_EOA",
|
|
490
|
-
token: "<value>",
|
|
491
|
-
amount: "709.93",
|
|
492
|
-
},
|
|
493
|
-
},
|
|
494
|
-
],
|
|
495
|
-
gasSponsorship: false,
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
console.log(result);
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
run();
|
|
502
|
-
```
|
|
503
|
-
|
|
504
|
-
### Standalone function
|
|
505
|
-
|
|
506
|
-
The standalone function version of this method:
|
|
507
|
-
|
|
508
|
-
```typescript
|
|
509
|
-
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
510
|
-
import { creditCreditBundle } from "@compass-labs/api-sdk/funcs/creditCreditBundle.js";
|
|
511
|
-
|
|
512
|
-
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
513
|
-
// You can create one instance of it to use across an application.
|
|
514
|
-
const compassApiSDK = new CompassApiSDKCore({
|
|
515
|
-
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
516
|
-
});
|
|
517
|
-
|
|
518
|
-
async function run() {
|
|
519
|
-
const res = await creditCreditBundle(compassApiSDK, {
|
|
520
|
-
owner: "<value>",
|
|
521
|
-
chain: "arbitrum",
|
|
522
|
-
actions: [
|
|
523
|
-
{
|
|
524
|
-
body: {
|
|
525
|
-
actionType: "V2_TRANSFER_TO_EOA",
|
|
526
|
-
token: "<value>",
|
|
527
|
-
amount: "709.93",
|
|
528
|
-
},
|
|
529
|
-
},
|
|
530
|
-
],
|
|
531
|
-
gasSponsorship: false,
|
|
532
|
-
});
|
|
533
|
-
if (res.ok) {
|
|
534
|
-
const { value: result } = res;
|
|
535
|
-
console.log(result);
|
|
536
|
-
} else {
|
|
537
|
-
console.log("creditCreditBundle failed:", res.error);
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
run();
|
|
542
|
-
```
|
|
543
|
-
|
|
544
|
-
### Parameters
|
|
545
|
-
|
|
546
|
-
| Parameter | Type | Required | Description |
|
|
547
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
548
|
-
| `request` | [components.CreditBundleRequest](../../models/components/creditbundlerequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
549
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
550
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
551
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
552
|
-
|
|
553
|
-
### Response
|
|
554
|
-
|
|
555
|
-
**Promise\<[components.CreditBundleResponse](../../models/components/creditbundleresponse.md)\>**
|
|
556
|
-
|
|
557
|
-
### Errors
|
|
558
|
-
|
|
559
|
-
| Error Type | Status Code | Content Type |
|
|
560
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
561
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
562
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|