@compass-labs/api-sdk 2.2.76-rc.0 → 2.2.76-rc.1

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.
Files changed (166) hide show
  1. package/README.md +5 -3
  2. package/codeSamples_typescript.yaml +6 -0
  3. package/dist/commonjs/funcs/creditCreditMorphoMarkets.d.ts +24 -0
  4. package/dist/commonjs/funcs/creditCreditMorphoMarkets.d.ts.map +1 -0
  5. package/dist/commonjs/funcs/creditCreditMorphoMarkets.js +128 -0
  6. package/dist/commonjs/funcs/creditCreditMorphoMarkets.js.map +1 -0
  7. package/dist/commonjs/models/components/accountsummary.d.ts +4 -0
  8. package/dist/commonjs/models/components/accountsummary.d.ts.map +1 -1
  9. package/dist/commonjs/models/components/accountsummary.js.map +1 -1
  10. package/dist/commonjs/models/components/collateralposition.d.ts +12 -0
  11. package/dist/commonjs/models/components/collateralposition.d.ts.map +1 -1
  12. package/dist/commonjs/models/components/collateralposition.js +4 -0
  13. package/dist/commonjs/models/components/collateralposition.js.map +1 -1
  14. package/dist/commonjs/models/components/creditborrowparams.d.ts +4 -0
  15. package/dist/commonjs/models/components/creditborrowparams.d.ts.map +1 -1
  16. package/dist/commonjs/models/components/creditborrowparams.js.map +1 -1
  17. package/dist/commonjs/models/components/creditborrowrequest.d.ts +4 -0
  18. package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -1
  19. package/dist/commonjs/models/components/creditborrowrequest.js.map +1 -1
  20. package/dist/commonjs/models/components/creditenablecollateralparams.d.ts +4 -0
  21. package/dist/commonjs/models/components/creditenablecollateralparams.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/creditenablecollateralparams.js.map +1 -1
  23. package/dist/commonjs/models/components/creditprotocol.d.ts +9 -0
  24. package/dist/commonjs/models/components/creditprotocol.d.ts.map +1 -1
  25. package/dist/commonjs/models/components/creditprotocol.js +5 -0
  26. package/dist/commonjs/models/components/creditprotocol.js.map +1 -1
  27. package/dist/commonjs/models/components/creditrepayparams.d.ts +4 -0
  28. package/dist/commonjs/models/components/creditrepayparams.d.ts.map +1 -1
  29. package/dist/commonjs/models/components/creditrepayparams.js.map +1 -1
  30. package/dist/commonjs/models/components/creditrepayrequest.d.ts +4 -0
  31. package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -1
  32. package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -1
  33. package/dist/commonjs/models/components/creditsupplyparams.d.ts +4 -0
  34. package/dist/commonjs/models/components/creditsupplyparams.d.ts.map +1 -1
  35. package/dist/commonjs/models/components/creditsupplyparams.js.map +1 -1
  36. package/dist/commonjs/models/components/creditwithdrawparams.d.ts +4 -0
  37. package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/creditwithdrawparams.js.map +1 -1
  39. package/dist/commonjs/models/components/debtposition.d.ts +12 -0
  40. package/dist/commonjs/models/components/debtposition.d.ts.map +1 -1
  41. package/dist/commonjs/models/components/debtposition.js +4 -0
  42. package/dist/commonjs/models/components/debtposition.js.map +1 -1
  43. package/dist/commonjs/models/components/index.d.ts +2 -0
  44. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  45. package/dist/commonjs/models/components/index.js +2 -0
  46. package/dist/commonjs/models/components/index.js.map +1 -1
  47. package/dist/commonjs/models/components/morpholendingmarket.d.ts +80 -0
  48. package/dist/commonjs/models/components/morpholendingmarket.d.ts.map +1 -0
  49. package/dist/commonjs/models/components/morpholendingmarket.js +82 -0
  50. package/dist/commonjs/models/components/morpholendingmarket.js.map +1 -0
  51. package/dist/commonjs/models/components/morphomarketsresponse.d.ts +21 -0
  52. package/dist/commonjs/models/components/morphomarketsresponse.d.ts.map +1 -0
  53. package/dist/commonjs/models/components/morphomarketsresponse.js +52 -0
  54. package/dist/commonjs/models/components/morphomarketsresponse.js.map +1 -0
  55. package/dist/commonjs/models/operations/index.d.ts +1 -0
  56. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  57. package/dist/commonjs/models/operations/index.js +1 -0
  58. package/dist/commonjs/models/operations/index.js.map +1 -1
  59. package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts +22 -0
  60. package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts.map +1 -0
  61. package/dist/commonjs/models/operations/v2creditmorphomarkets.js +57 -0
  62. package/dist/commonjs/models/operations/v2creditmorphomarkets.js.map +1 -0
  63. package/dist/commonjs/sdk/credit.d.ts +12 -0
  64. package/dist/commonjs/sdk/credit.d.ts.map +1 -1
  65. package/dist/commonjs/sdk/credit.js +15 -0
  66. package/dist/commonjs/sdk/credit.js.map +1 -1
  67. package/dist/esm/funcs/creditCreditMorphoMarkets.d.ts +24 -0
  68. package/dist/esm/funcs/creditCreditMorphoMarkets.d.ts.map +1 -0
  69. package/dist/esm/funcs/creditCreditMorphoMarkets.js +92 -0
  70. package/dist/esm/funcs/creditCreditMorphoMarkets.js.map +1 -0
  71. package/dist/esm/models/components/accountsummary.d.ts +4 -0
  72. package/dist/esm/models/components/accountsummary.d.ts.map +1 -1
  73. package/dist/esm/models/components/accountsummary.js.map +1 -1
  74. package/dist/esm/models/components/collateralposition.d.ts +12 -0
  75. package/dist/esm/models/components/collateralposition.d.ts.map +1 -1
  76. package/dist/esm/models/components/collateralposition.js +4 -0
  77. package/dist/esm/models/components/collateralposition.js.map +1 -1
  78. package/dist/esm/models/components/creditborrowparams.d.ts +4 -0
  79. package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -1
  80. package/dist/esm/models/components/creditborrowparams.js.map +1 -1
  81. package/dist/esm/models/components/creditborrowrequest.d.ts +4 -0
  82. package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
  83. package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
  84. package/dist/esm/models/components/creditenablecollateralparams.d.ts +4 -0
  85. package/dist/esm/models/components/creditenablecollateralparams.d.ts.map +1 -1
  86. package/dist/esm/models/components/creditenablecollateralparams.js.map +1 -1
  87. package/dist/esm/models/components/creditprotocol.d.ts +9 -0
  88. package/dist/esm/models/components/creditprotocol.d.ts.map +1 -1
  89. package/dist/esm/models/components/creditprotocol.js +5 -0
  90. package/dist/esm/models/components/creditprotocol.js.map +1 -1
  91. package/dist/esm/models/components/creditrepayparams.d.ts +4 -0
  92. package/dist/esm/models/components/creditrepayparams.d.ts.map +1 -1
  93. package/dist/esm/models/components/creditrepayparams.js.map +1 -1
  94. package/dist/esm/models/components/creditrepayrequest.d.ts +4 -0
  95. package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
  96. package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
  97. package/dist/esm/models/components/creditsupplyparams.d.ts +4 -0
  98. package/dist/esm/models/components/creditsupplyparams.d.ts.map +1 -1
  99. package/dist/esm/models/components/creditsupplyparams.js.map +1 -1
  100. package/dist/esm/models/components/creditwithdrawparams.d.ts +4 -0
  101. package/dist/esm/models/components/creditwithdrawparams.d.ts.map +1 -1
  102. package/dist/esm/models/components/creditwithdrawparams.js.map +1 -1
  103. package/dist/esm/models/components/debtposition.d.ts +12 -0
  104. package/dist/esm/models/components/debtposition.d.ts.map +1 -1
  105. package/dist/esm/models/components/debtposition.js +4 -0
  106. package/dist/esm/models/components/debtposition.js.map +1 -1
  107. package/dist/esm/models/components/index.d.ts +2 -0
  108. package/dist/esm/models/components/index.d.ts.map +1 -1
  109. package/dist/esm/models/components/index.js +2 -0
  110. package/dist/esm/models/components/index.js.map +1 -1
  111. package/dist/esm/models/components/morpholendingmarket.d.ts +80 -0
  112. package/dist/esm/models/components/morpholendingmarket.d.ts.map +1 -0
  113. package/dist/esm/models/components/morpholendingmarket.js +45 -0
  114. package/dist/esm/models/components/morpholendingmarket.js.map +1 -0
  115. package/dist/esm/models/components/morphomarketsresponse.d.ts +21 -0
  116. package/dist/esm/models/components/morphomarketsresponse.d.ts.map +1 -0
  117. package/dist/esm/models/components/morphomarketsresponse.js +15 -0
  118. package/dist/esm/models/components/morphomarketsresponse.js.map +1 -0
  119. package/dist/esm/models/operations/index.d.ts +1 -0
  120. package/dist/esm/models/operations/index.d.ts.map +1 -1
  121. package/dist/esm/models/operations/index.js +1 -0
  122. package/dist/esm/models/operations/index.js.map +1 -1
  123. package/dist/esm/models/operations/v2creditmorphomarkets.d.ts +22 -0
  124. package/dist/esm/models/operations/v2creditmorphomarkets.d.ts.map +1 -0
  125. package/dist/esm/models/operations/v2creditmorphomarkets.js +20 -0
  126. package/dist/esm/models/operations/v2creditmorphomarkets.js.map +1 -0
  127. package/dist/esm/sdk/credit.d.ts +12 -0
  128. package/dist/esm/sdk/credit.d.ts.map +1 -1
  129. package/dist/esm/sdk/credit.js +15 -0
  130. package/dist/esm/sdk/credit.js.map +1 -1
  131. package/docs/models/components/accountsummary.md +10 -10
  132. package/docs/models/components/collateralposition.md +16 -14
  133. package/docs/models/components/creditborrowparams.md +9 -9
  134. package/docs/models/components/creditborrowrequest.md +19 -19
  135. package/docs/models/components/creditenablecollateralparams.md +6 -6
  136. package/docs/models/components/creditprotocol.md +5 -1
  137. package/docs/models/components/creditrepayparams.md +8 -8
  138. package/docs/models/components/creditrepayrequest.md +18 -18
  139. package/docs/models/components/creditsupplyparams.md +7 -7
  140. package/docs/models/components/creditwithdrawparams.md +7 -7
  141. package/docs/models/components/debtposition.md +15 -13
  142. package/docs/models/components/morpholendingmarket.md +49 -0
  143. package/docs/models/components/morphomarketsresponse.md +21 -0
  144. package/docs/models/operations/v2creditmorphomarketschain.md +15 -0
  145. package/docs/models/operations/v2creditmorphomarketsrequest.md +17 -0
  146. package/docs/sdks/credit/README.md +80 -0
  147. package/openapi_prepped_for_speakeasy.json +250 -2
  148. package/package.json +1 -1
  149. package/src/funcs/creditCreditMorphoMarkets.ts +182 -0
  150. package/src/models/components/accountsummary.ts +4 -0
  151. package/src/models/components/collateralposition.ts +16 -0
  152. package/src/models/components/creditborrowparams.ts +4 -0
  153. package/src/models/components/creditborrowrequest.ts +4 -0
  154. package/src/models/components/creditenablecollateralparams.ts +4 -0
  155. package/src/models/components/creditprotocol.ts +9 -0
  156. package/src/models/components/creditrepayparams.ts +4 -0
  157. package/src/models/components/creditrepayrequest.ts +4 -0
  158. package/src/models/components/creditsupplyparams.ts +4 -0
  159. package/src/models/components/creditwithdrawparams.ts +4 -0
  160. package/src/models/components/debtposition.ts +16 -0
  161. package/src/models/components/index.ts +2 -0
  162. package/src/models/components/morpholendingmarket.ts +133 -0
  163. package/src/models/components/morphomarketsresponse.ts +46 -0
  164. package/src/models/operations/index.ts +1 -0
  165. package/src/models/operations/v2creditmorphomarkets.ts +49 -0
  166. package/src/sdk/credit.ts +23 -0
@@ -6058,6 +6058,57 @@
6058
6058
  "x-speakeasy-name-override": "credit_euler_markets"
6059
6059
  }
6060
6060
  },
6061
+ "/v2/credit/morpho_markets": {
6062
+ "get": {
6063
+ "tags": [
6064
+ "Credit"
6065
+ ],
6066
+ "summary": "List curated Morpho markets",
6067
+ "description": "List curated Morpho Blue lending markets for a chain.\n\nMorpho Blue is permissionless, so credit actions identify a market by its\nbytes32 market id. This returns the curated market set with live LLTV,\nsupply/borrow APY, utilization, and available liquidity -- read on-chain per\nrequest -- so callers know which market_id to use and what it currently costs.",
6068
+ "operationId": "v2_credit_morpho_markets",
6069
+ "parameters": [
6070
+ {
6071
+ "name": "chain",
6072
+ "in": "query",
6073
+ "required": true,
6074
+ "schema": {
6075
+ "type": "string",
6076
+ "enum": [
6077
+ "arbitrum",
6078
+ "base",
6079
+ "ethereum",
6080
+ "tempo"
6081
+ ],
6082
+ "title": "Chain",
6083
+ "example": "ethereum"
6084
+ }
6085
+ }
6086
+ ],
6087
+ "responses": {
6088
+ "200": {
6089
+ "description": "Successful Response",
6090
+ "content": {
6091
+ "application/json": {
6092
+ "schema": {
6093
+ "$ref": "#/components/schemas/MorphoMarketsResponse"
6094
+ }
6095
+ }
6096
+ }
6097
+ },
6098
+ "422": {
6099
+ "description": "Validation Error",
6100
+ "content": {
6101
+ "application/json": {
6102
+ "schema": {
6103
+ "$ref": "#/components/schemas/HTTPValidationError"
6104
+ }
6105
+ }
6106
+ }
6107
+ }
6108
+ },
6109
+ "x-speakeasy-name-override": "credit_morpho_markets"
6110
+ }
6111
+ },
6061
6112
  "/v2/credit/create_account": {
6062
6113
  "post": {
6063
6114
  "tags": [
@@ -11670,6 +11721,30 @@
11670
11721
  "title": "Vault",
11671
11722
  "description": "Euler only: the EVK collateral vault holding this position."
11672
11723
  },
11724
+ "market_id": {
11725
+ "anyOf": [
11726
+ {
11727
+ "type": "string"
11728
+ },
11729
+ {
11730
+ "type": "null"
11731
+ }
11732
+ ],
11733
+ "title": "Market Id",
11734
+ "description": "Morpho only: the bytes32 id of the isolated market holding this position."
11735
+ },
11736
+ "is_pure_supply": {
11737
+ "anyOf": [
11738
+ {
11739
+ "type": "boolean"
11740
+ },
11741
+ {
11742
+ "type": "null"
11743
+ }
11744
+ ],
11745
+ "title": "Is Pure Supply",
11746
+ "description": "Morpho only: true when this is a loan-asset supply position (earning supply APY) rather than collateral backing borrows."
11747
+ },
11673
11748
  "amount_supplied": {
11674
11749
  "anyOf": [
11675
11750
  {
@@ -12672,10 +12747,11 @@
12672
12747
  "type": "string",
12673
12748
  "enum": [
12674
12749
  "AAVE",
12675
- "EULER"
12750
+ "EULER",
12751
+ "MORPHO"
12676
12752
  ],
12677
12753
  "title": "CreditProtocol",
12678
- "description": "Which lending protocol a credit action targets.\n\n``AAVE`` is the default so existing callers (which never send a ``protocol``\nfield) keep hitting the unchanged Aave code path. ``EULER`` opts in to the\nEuler V2 path, where the market is identified by EVK vault address(es)."
12754
+ "description": "Which lending protocol a credit action targets.\n\n``AAVE`` is the default so existing callers (which never send a ``protocol``\nfield) keep hitting the unchanged Aave code path. ``EULER`` opts in to the\nEuler V2 path, where the market is identified by EVK vault address(es).\n``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is\ncurrently read-only: positions and market discovery only \u2014 transaction\nbuilders land with the looping work (COM-7106/7107/7108), so transact\nendpoints reject it with a 422."
12679
12755
  },
12680
12756
  "CreditRepayParams": {
12681
12757
  "properties": {
@@ -13314,6 +13390,30 @@
13314
13390
  "title": "Vault",
13315
13391
  "description": "Euler only: the EVK borrow vault this debt is owed to."
13316
13392
  },
13393
+ "market_id": {
13394
+ "anyOf": [
13395
+ {
13396
+ "type": "string"
13397
+ },
13398
+ {
13399
+ "type": "null"
13400
+ }
13401
+ ],
13402
+ "title": "Market Id",
13403
+ "description": "Morpho only: the bytes32 id of the isolated market this debt is owed to."
13404
+ },
13405
+ "health_factor": {
13406
+ "anyOf": [
13407
+ {
13408
+ "type": "string"
13409
+ },
13410
+ {
13411
+ "type": "null"
13412
+ }
13413
+ ],
13414
+ "title": "Health Factor",
13415
+ "description": "Morpho only: this market's health factor (markets are isolated, so health is per market \u2014 below 1 the position is liquidatable). Null for other protocols and when the oracle read fails."
13416
+ },
13317
13417
  "amount_borrowed": {
13318
13418
  "anyOf": [
13319
13419
  {
@@ -17657,6 +17757,130 @@
17657
17757
  ],
17658
17758
  "title": "MorphoGetVaultsResponse"
17659
17759
  },
17760
+ "MorphoLendingMarket": {
17761
+ "properties": {
17762
+ "market_id": {
17763
+ "type": "string",
17764
+ "title": "Market Id",
17765
+ "description": "Morpho Blue market id \u2014 the bytes32 keccak of the market's (loanToken, collateralToken, oracle, irm, lltv) tuple. Pass this to the Morpho credit actions to identify the market."
17766
+ },
17767
+ "loan_token": {
17768
+ "type": "string",
17769
+ "title": "Loan Token",
17770
+ "description": "Token that is supplied and borrowed in this market."
17771
+ },
17772
+ "loan_token_symbol": {
17773
+ "type": "string",
17774
+ "title": "Loan Token Symbol",
17775
+ "description": "Symbol of the loan token (e.g. USDC)."
17776
+ },
17777
+ "loan_token_decimals": {
17778
+ "type": "integer",
17779
+ "title": "Loan Token Decimals",
17780
+ "description": "Decimals of the loan token."
17781
+ },
17782
+ "collateral_token": {
17783
+ "type": "string",
17784
+ "title": "Collateral Token",
17785
+ "description": "Token accepted as collateral in this market."
17786
+ },
17787
+ "collateral_token_symbol": {
17788
+ "type": "string",
17789
+ "title": "Collateral Token Symbol",
17790
+ "description": "Symbol of the collateral token (e.g. wstETH)."
17791
+ },
17792
+ "collateral_token_decimals": {
17793
+ "type": "integer",
17794
+ "title": "Collateral Token Decimals",
17795
+ "description": "Decimals of the collateral token."
17796
+ },
17797
+ "oracle": {
17798
+ "type": "string",
17799
+ "title": "Oracle",
17800
+ "description": "Oracle pricing the collateral in loan-token terms for this market."
17801
+ },
17802
+ "irm": {
17803
+ "type": "string",
17804
+ "title": "Irm",
17805
+ "description": "Interest rate model contract of this market."
17806
+ },
17807
+ "lltv": {
17808
+ "type": "string",
17809
+ "title": "Lltv",
17810
+ "description": "Liquidation loan-to-value in percentage (e.g. 86 means a position is liquidatable once debt exceeds 86% of collateral value)."
17811
+ },
17812
+ "supply_apy": {
17813
+ "anyOf": [
17814
+ {
17815
+ "type": "string"
17816
+ },
17817
+ {
17818
+ "type": "null"
17819
+ }
17820
+ ],
17821
+ "title": "Supply Apy",
17822
+ "description": "Current supply APY for lending the loan token, in percentage (e.g. 3.5 means 3.5%). Null if the rate is unavailable."
17823
+ },
17824
+ "borrow_apy": {
17825
+ "anyOf": [
17826
+ {
17827
+ "type": "string"
17828
+ },
17829
+ {
17830
+ "type": "null"
17831
+ }
17832
+ ],
17833
+ "title": "Borrow Apy",
17834
+ "description": "Current borrow APY for the loan token, in percentage (e.g. 5.25 means 5.25%). Null if the rate is unavailable."
17835
+ },
17836
+ "utilization": {
17837
+ "type": "string",
17838
+ "title": "Utilization",
17839
+ "description": "Borrowed share of supplied assets, in percentage 0-100."
17840
+ },
17841
+ "total_supply_assets": {
17842
+ "type": "string",
17843
+ "title": "Total Supply Assets",
17844
+ "description": "Total loan tokens supplied to the market, in token units."
17845
+ },
17846
+ "total_borrow_assets": {
17847
+ "type": "string",
17848
+ "title": "Total Borrow Assets",
17849
+ "description": "Total loan tokens borrowed from the market, in token units."
17850
+ },
17851
+ "available_liquidity": {
17852
+ "type": "string",
17853
+ "title": "Available Liquidity",
17854
+ "description": "Loan tokens available to borrow or withdraw (supplied - borrowed), in token units."
17855
+ },
17856
+ "fee": {
17857
+ "type": "string",
17858
+ "title": "Fee",
17859
+ "description": "Protocol fee taken from interest, in percentage of interest (e.g. 0 means no fee)."
17860
+ }
17861
+ },
17862
+ "additionalProperties": false,
17863
+ "type": "object",
17864
+ "required": [
17865
+ "market_id",
17866
+ "loan_token",
17867
+ "loan_token_symbol",
17868
+ "loan_token_decimals",
17869
+ "collateral_token",
17870
+ "collateral_token_symbol",
17871
+ "collateral_token_decimals",
17872
+ "oracle",
17873
+ "irm",
17874
+ "lltv",
17875
+ "utilization",
17876
+ "total_supply_assets",
17877
+ "total_borrow_assets",
17878
+ "available_liquidity",
17879
+ "fee"
17880
+ ],
17881
+ "title": "MorphoLendingMarket",
17882
+ "description": "A Morpho Blue lending market: one isolated (collateral, loan) pair."
17883
+ },
17660
17884
  "MorphoMarket": {
17661
17885
  "properties": {
17662
17886
  "uniqueKey": {
@@ -17707,6 +17931,30 @@
17707
17931
  ],
17708
17932
  "title": "MorphoMarket"
17709
17933
  },
17934
+ "MorphoMarketsResponse": {
17935
+ "properties": {
17936
+ "morpho": {
17937
+ "type": "string",
17938
+ "title": "Morpho",
17939
+ "description": "Morpho Blue singleton contract the markets were read from."
17940
+ },
17941
+ "markets": {
17942
+ "items": {
17943
+ "$ref": "#/components/schemas/MorphoLendingMarket"
17944
+ },
17945
+ "type": "array",
17946
+ "title": "Markets",
17947
+ "description": "Curated lending markets with live LLTV, APYs, utilization, and liquidity.",
17948
+ "example": []
17949
+ }
17950
+ },
17951
+ "type": "object",
17952
+ "required": [
17953
+ "morpho"
17954
+ ],
17955
+ "title": "MorphoMarketsResponse",
17956
+ "description": "Curated Morpho Blue lending markets, read on-chain per request."
17957
+ },
17710
17958
  "MorphoRepayParams": {
17711
17959
  "properties": {
17712
17960
  "action_type": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-labs/api-sdk",
3
- "version": "2.2.76-rc.0",
3
+ "version": "2.2.76-rc.1",
4
4
  "author": "royalnine",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -0,0 +1,182 @@
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 { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import { CompassAPISDKError } from "../models/errors/compassapisdkerror.js";
16
+ import {
17
+ ConnectionError,
18
+ InvalidRequestError,
19
+ RequestAbortedError,
20
+ RequestTimeoutError,
21
+ UnexpectedClientError,
22
+ } from "../models/errors/httpclienterrors.js";
23
+ import * as errors from "../models/errors/index.js";
24
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * List curated Morpho markets
32
+ *
33
+ * @remarks
34
+ * List curated Morpho Blue lending markets for a chain.
35
+ *
36
+ * Morpho Blue is permissionless, so credit actions identify a market by its
37
+ * bytes32 market id. This returns the curated market set with live LLTV,
38
+ * supply/borrow APY, utilization, and available liquidity -- read on-chain per
39
+ * request -- so callers know which market_id to use and what it currently costs.
40
+ */
41
+ export function creditCreditMorphoMarkets(
42
+ client: CompassApiSDKCore,
43
+ request: operations.V2CreditMorphoMarketsRequest,
44
+ options?: RequestOptions,
45
+ ): APIPromise<
46
+ Result<
47
+ components.MorphoMarketsResponse,
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: operations.V2CreditMorphoMarketsRequest,
69
+ options?: RequestOptions,
70
+ ): Promise<
71
+ [
72
+ Result<
73
+ components.MorphoMarketsResponse,
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) =>
90
+ operations.V2CreditMorphoMarketsRequest$outboundSchema.parse(value),
91
+ "Input validation failed",
92
+ );
93
+ if (!parsed.ok) {
94
+ return [parsed, { status: "invalid" }];
95
+ }
96
+ const payload = parsed.value;
97
+ const body = null;
98
+
99
+ const path = pathToFunc("/v2/credit/morpho_markets")();
100
+
101
+ const query = encodeFormQuery({
102
+ "chain": payload.chain,
103
+ });
104
+
105
+ const headers = new Headers(compactMap({
106
+ Accept: "application/json",
107
+ }));
108
+
109
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
110
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
111
+ const requestSecurity = resolveGlobalSecurity(securityInput);
112
+
113
+ const context = {
114
+ options: client._options,
115
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
116
+ operationID: "v2_credit_morpho_markets",
117
+ oAuth2Scopes: null,
118
+
119
+ resolvedSecurity: requestSecurity,
120
+
121
+ securitySource: client._options.apiKeyAuth,
122
+ retryConfig: options?.retries
123
+ || client._options.retryConfig
124
+ || { strategy: "none" },
125
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
126
+ };
127
+
128
+ const requestRes = client._createRequest(context, {
129
+ security: requestSecurity,
130
+ method: "GET",
131
+ baseURL: options?.serverURL,
132
+ path: path,
133
+ headers: headers,
134
+ query: query,
135
+ body: body,
136
+ userAgent: client._options.userAgent,
137
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
138
+ }, options);
139
+ if (!requestRes.ok) {
140
+ return [requestRes, { status: "invalid" }];
141
+ }
142
+ const req = requestRes.value;
143
+
144
+ const doResult = await client._do(req, {
145
+ context,
146
+ isErrorStatusCode: (statusCode: number) =>
147
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
148
+ retryConfig: context.retryConfig,
149
+ retryCodes: context.retryCodes,
150
+ });
151
+ if (!doResult.ok) {
152
+ return [doResult, { status: "request-error", request: req }];
153
+ }
154
+ const response = doResult.value;
155
+
156
+ const responseFields = {
157
+ HttpMeta: { Response: response, Request: req },
158
+ };
159
+
160
+ const [result] = await M.match<
161
+ components.MorphoMarketsResponse,
162
+ | errors.HTTPValidationError
163
+ | CompassAPISDKError
164
+ | ResponseValidationError
165
+ | ConnectionError
166
+ | RequestAbortedError
167
+ | RequestTimeoutError
168
+ | InvalidRequestError
169
+ | UnexpectedClientError
170
+ | SDKValidationError
171
+ >(
172
+ M.json(200, components.MorphoMarketsResponse$inboundSchema),
173
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
174
+ M.fail("4XX"),
175
+ M.fail("5XX"),
176
+ )(response, req, { extraFields: responseFields });
177
+ if (!result.ok) {
178
+ return [result, { status: "complete", request: req, response }];
179
+ }
180
+
181
+ return [result, { status: "complete", request: req, response }];
182
+ }
@@ -30,6 +30,10 @@ export type AccountSummary = {
30
30
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
31
31
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
32
32
  * Euler V2 path, where the market is identified by EVK vault address(es).
33
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
34
+ * currently read-only: positions and market discovery only — transaction
35
+ * builders land with the looping work (COM-7106/7107/7108), so transact
36
+ * endpoints reject it with a 422.
33
37
  */
34
38
  protocol?: CreditProtocol | undefined;
35
39
  /**
@@ -33,12 +33,24 @@ export type CollateralPosition = {
33
33
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
34
34
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
35
35
  * Euler V2 path, where the market is identified by EVK vault address(es).
36
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
37
+ * currently read-only: positions and market discovery only — transaction
38
+ * builders land with the looping work (COM-7106/7107/7108), so transact
39
+ * endpoints reject it with a 422.
36
40
  */
37
41
  protocol?: CreditProtocol | undefined;
38
42
  /**
39
43
  * Euler only: the EVK collateral vault holding this position.
40
44
  */
41
45
  vault?: string | null | undefined;
46
+ /**
47
+ * Morpho only: the bytes32 id of the isolated market holding this position.
48
+ */
49
+ marketId?: string | null | undefined;
50
+ /**
51
+ * Morpho only: true when this is a loan-asset supply position (earning supply APY) rather than collateral backing borrows.
52
+ */
53
+ isPureSupply?: boolean | null | undefined;
42
54
  /**
43
55
  * Current on-chain collateral balance (the vault's underlying asset for Euler).
44
56
  */
@@ -83,6 +95,8 @@ export const CollateralPosition$inboundSchema: z.ZodType<
83
95
  symbol: z.string(),
84
96
  protocol: CreditProtocol$inboundSchema.optional(),
85
97
  vault: z.nullable(z.string()).optional(),
98
+ market_id: z.nullable(z.string()).optional(),
99
+ is_pure_supply: z.nullable(z.boolean()).optional(),
86
100
  amount_supplied: z.nullable(z.string()),
87
101
  usd_value: z.nullable(z.string()).optional(),
88
102
  supply_apy: z.nullable(z.string()).optional(),
@@ -93,6 +107,8 @@ export const CollateralPosition$inboundSchema: z.ZodType<
93
107
  events: z.array(CreditEvent$inboundSchema).optional(),
94
108
  }).transform((v) => {
95
109
  return remap$(v, {
110
+ "market_id": "marketId",
111
+ "is_pure_supply": "isPureSupply",
96
112
  "amount_supplied": "amountSupplied",
97
113
  "usd_value": "usdValue",
98
114
  "supply_apy": "supplyApy",
@@ -56,6 +56,10 @@ export type CreditBorrowParams = {
56
56
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
57
57
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
58
58
  * Euler V2 path, where the market is identified by EVK vault address(es).
59
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
60
+ * currently read-only: positions and market discovery only — transaction
61
+ * builders land with the looping work (COM-7106/7107/7108), so transact
62
+ * endpoints reject it with a 422.
59
63
  */
60
64
  protocol?: CreditProtocol | undefined;
61
65
  /**
@@ -51,6 +51,10 @@ export type CreditBorrowRequest = {
51
51
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
52
52
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
53
53
  * Euler V2 path, where the market is identified by EVK vault address(es).
54
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
55
+ * currently read-only: positions and market discovery only — transaction
56
+ * builders land with the looping work (COM-7106/7107/7108), so transact
57
+ * endpoints reject it with a 422.
54
58
  */
55
59
  protocol?: CreditProtocol | undefined;
56
60
  /**
@@ -31,6 +31,10 @@ export type CreditEnableCollateralParams = {
31
31
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
32
32
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
33
33
  * Euler V2 path, where the market is identified by EVK vault address(es).
34
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
35
+ * currently read-only: positions and market discovery only — transaction
36
+ * builders land with the looping work (COM-7106/7107/7108), so transact
37
+ * endpoints reject it with a 422.
34
38
  */
35
39
  protocol?: CreditProtocol | undefined;
36
40
  /**
@@ -13,10 +13,15 @@ import { ClosedEnum } from "../../types/enums.js";
13
13
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
14
14
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
15
15
  * Euler V2 path, where the market is identified by EVK vault address(es).
16
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
17
+ * currently read-only: positions and market discovery only — transaction
18
+ * builders land with the looping work (COM-7106/7107/7108), so transact
19
+ * endpoints reject it with a 422.
16
20
  */
17
21
  export const CreditProtocol = {
18
22
  Aave: "AAVE",
19
23
  Euler: "EULER",
24
+ Morpho: "MORPHO",
20
25
  } as const;
21
26
  /**
22
27
  * Which lending protocol a credit action targets.
@@ -26,6 +31,10 @@ export const CreditProtocol = {
26
31
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
27
32
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
28
33
  * Euler V2 path, where the market is identified by EVK vault address(es).
34
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
35
+ * currently read-only: positions and market discovery only — transaction
36
+ * builders land with the looping work (COM-7106/7107/7108), so transact
37
+ * endpoints reject it with a 422.
29
38
  */
30
39
  export type CreditProtocol = ClosedEnum<typeof CreditProtocol>;
31
40
 
@@ -47,6 +47,10 @@ export type CreditRepayParams = {
47
47
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
48
48
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
49
49
  * Euler V2 path, where the market is identified by EVK vault address(es).
50
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
51
+ * currently read-only: positions and market discovery only — transaction
52
+ * builders land with the looping work (COM-7106/7107/7108), so transact
53
+ * endpoints reject it with a 422.
50
54
  */
51
55
  protocol?: CreditProtocol | undefined;
52
56
  /**
@@ -46,6 +46,10 @@ export type CreditRepayRequest = {
46
46
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
47
47
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
48
48
  * Euler V2 path, where the market is identified by EVK vault address(es).
49
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
50
+ * currently read-only: positions and market discovery only — transaction
51
+ * builders land with the looping work (COM-7106/7107/7108), so transact
52
+ * endpoints reject it with a 422.
49
53
  */
50
54
  protocol?: CreditProtocol | undefined;
51
55
  /**
@@ -35,6 +35,10 @@ export type CreditSupplyParams = {
35
35
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
36
36
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
37
37
  * Euler V2 path, where the market is identified by EVK vault address(es).
38
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
39
+ * currently read-only: positions and market discovery only — transaction
40
+ * builders land with the looping work (COM-7106/7107/7108), so transact
41
+ * endpoints reject it with a 422.
38
42
  */
39
43
  protocol?: CreditProtocol | undefined;
40
44
  /**
@@ -35,6 +35,10 @@ export type CreditWithdrawParams = {
35
35
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
36
36
  * field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
37
37
  * Euler V2 path, where the market is identified by EVK vault address(es).
38
+ * ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
39
+ * currently read-only: positions and market discovery only — transaction
40
+ * builders land with the looping work (COM-7106/7107/7108), so transact
41
+ * endpoints reject it with a 422.
38
42
  */
39
43
  protocol?: CreditProtocol | undefined;
40
44
  /**