@compass-labs/api-sdk 2.2.93 → 2.2.95-rc.0
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/codeSamples_typescript.yaml +1 -1
- package/dist/commonjs/models/components/createcreditaccountrequest.d.ts +1 -0
- package/dist/commonjs/models/components/createcreditaccountrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/createcreditaccountrequest.js +1 -0
- package/dist/commonjs/models/components/createcreditaccountrequest.js.map +1 -1
- package/dist/commonjs/models/components/creditborrowrequest.d.ts +20 -3
- package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditborrowrequest.js +15 -3
- package/dist/commonjs/models/components/creditborrowrequest.js.map +1 -1
- package/dist/commonjs/models/components/creditbundlerequest.d.ts +20 -3
- package/dist/commonjs/models/components/creditbundlerequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditbundlerequest.js +15 -3
- package/dist/commonjs/models/components/creditbundlerequest.js.map +1 -1
- package/dist/commonjs/models/components/creditlooppreview.d.ts +4 -0
- package/dist/commonjs/models/components/creditlooppreview.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditlooppreview.js +2 -0
- package/dist/commonjs/models/components/creditlooppreview.js.map +1 -1
- package/dist/commonjs/models/components/creditlooprequest.d.ts +20 -3
- package/dist/commonjs/models/components/creditlooprequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditlooprequest.js +15 -3
- package/dist/commonjs/models/components/creditlooprequest.js.map +1 -1
- package/dist/commonjs/models/components/creditrebalancerequest.d.ts +19 -3
- package/dist/commonjs/models/components/creditrebalancerequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditrebalancerequest.js +14 -3
- package/dist/commonjs/models/components/creditrebalancerequest.js.map +1 -1
- package/dist/commonjs/models/components/creditrepayrequest.d.ts +20 -3
- package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditrepayrequest.js +15 -3
- package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -1
- package/dist/commonjs/models/components/credittransferrequest.d.ts +19 -3
- package/dist/commonjs/models/components/credittransferrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/credittransferrequest.js +15 -3
- package/dist/commonjs/models/components/credittransferrequest.js.map +1 -1
- package/dist/commonjs/models/components/creditunlooprequest.d.ts +20 -3
- package/dist/commonjs/models/components/creditunlooprequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditunlooprequest.js +15 -3
- package/dist/commonjs/models/components/creditunlooprequest.js.map +1 -1
- package/dist/commonjs/models/components/looplegpreview.d.ts +4 -0
- package/dist/commonjs/models/components/looplegpreview.d.ts.map +1 -1
- package/dist/commonjs/models/components/looplegpreview.js +2 -0
- package/dist/commonjs/models/components/looplegpreview.js.map +1 -1
- package/dist/commonjs/models/operations/v2creditbalances.d.ts +1 -0
- package/dist/commonjs/models/operations/v2creditbalances.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2creditbalances.js +1 -0
- package/dist/commonjs/models/operations/v2creditbalances.js.map +1 -1
- package/dist/commonjs/models/operations/v2crediteulermarkets.d.ts +1 -0
- package/dist/commonjs/models/operations/v2crediteulermarkets.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2crediteulermarkets.js +1 -0
- package/dist/commonjs/models/operations/v2crediteulermarkets.js.map +1 -1
- package/dist/commonjs/models/operations/v2creditloopedpositions.d.ts +1 -0
- package/dist/commonjs/models/operations/v2creditloopedpositions.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2creditloopedpositions.js +1 -0
- package/dist/commonjs/models/operations/v2creditloopedpositions.js.map +1 -1
- package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts +1 -0
- package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2creditmorphomarkets.js +1 -0
- package/dist/commonjs/models/operations/v2creditmorphomarkets.js.map +1 -1
- package/dist/commonjs/models/operations/v2creditpositions.d.ts +1 -0
- package/dist/commonjs/models/operations/v2creditpositions.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2creditpositions.js +1 -0
- package/dist/commonjs/models/operations/v2creditpositions.js.map +1 -1
- package/dist/esm/models/components/createcreditaccountrequest.d.ts +1 -0
- package/dist/esm/models/components/createcreditaccountrequest.d.ts.map +1 -1
- package/dist/esm/models/components/createcreditaccountrequest.js +1 -0
- package/dist/esm/models/components/createcreditaccountrequest.js.map +1 -1
- package/dist/esm/models/components/creditborrowrequest.d.ts +20 -3
- package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditborrowrequest.js +14 -2
- package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
- package/dist/esm/models/components/creditbundlerequest.d.ts +20 -3
- package/dist/esm/models/components/creditbundlerequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditbundlerequest.js +14 -2
- package/dist/esm/models/components/creditbundlerequest.js.map +1 -1
- package/dist/esm/models/components/creditlooppreview.d.ts +4 -0
- package/dist/esm/models/components/creditlooppreview.d.ts.map +1 -1
- package/dist/esm/models/components/creditlooppreview.js +2 -0
- package/dist/esm/models/components/creditlooppreview.js.map +1 -1
- package/dist/esm/models/components/creditlooprequest.d.ts +20 -3
- package/dist/esm/models/components/creditlooprequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditlooprequest.js +14 -2
- package/dist/esm/models/components/creditlooprequest.js.map +1 -1
- package/dist/esm/models/components/creditrebalancerequest.d.ts +19 -3
- package/dist/esm/models/components/creditrebalancerequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditrebalancerequest.js +13 -2
- package/dist/esm/models/components/creditrebalancerequest.js.map +1 -1
- package/dist/esm/models/components/creditrepayrequest.d.ts +20 -3
- package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditrepayrequest.js +14 -2
- package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
- package/dist/esm/models/components/credittransferrequest.d.ts +19 -3
- package/dist/esm/models/components/credittransferrequest.d.ts.map +1 -1
- package/dist/esm/models/components/credittransferrequest.js +14 -2
- package/dist/esm/models/components/credittransferrequest.js.map +1 -1
- package/dist/esm/models/components/creditunlooprequest.d.ts +20 -3
- package/dist/esm/models/components/creditunlooprequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditunlooprequest.js +14 -2
- package/dist/esm/models/components/creditunlooprequest.js.map +1 -1
- package/dist/esm/models/components/looplegpreview.d.ts +4 -0
- package/dist/esm/models/components/looplegpreview.d.ts.map +1 -1
- package/dist/esm/models/components/looplegpreview.js +2 -0
- package/dist/esm/models/components/looplegpreview.js.map +1 -1
- package/dist/esm/models/operations/v2creditbalances.d.ts +1 -0
- package/dist/esm/models/operations/v2creditbalances.d.ts.map +1 -1
- package/dist/esm/models/operations/v2creditbalances.js +1 -0
- package/dist/esm/models/operations/v2creditbalances.js.map +1 -1
- package/dist/esm/models/operations/v2crediteulermarkets.d.ts +1 -0
- package/dist/esm/models/operations/v2crediteulermarkets.d.ts.map +1 -1
- package/dist/esm/models/operations/v2crediteulermarkets.js +1 -0
- package/dist/esm/models/operations/v2crediteulermarkets.js.map +1 -1
- package/dist/esm/models/operations/v2creditloopedpositions.d.ts +1 -0
- package/dist/esm/models/operations/v2creditloopedpositions.d.ts.map +1 -1
- package/dist/esm/models/operations/v2creditloopedpositions.js +1 -0
- package/dist/esm/models/operations/v2creditloopedpositions.js.map +1 -1
- package/dist/esm/models/operations/v2creditmorphomarkets.d.ts +1 -0
- package/dist/esm/models/operations/v2creditmorphomarkets.d.ts.map +1 -1
- package/dist/esm/models/operations/v2creditmorphomarkets.js +1 -0
- package/dist/esm/models/operations/v2creditmorphomarkets.js.map +1 -1
- package/dist/esm/models/operations/v2creditpositions.d.ts +1 -0
- package/dist/esm/models/operations/v2creditpositions.d.ts.map +1 -1
- package/dist/esm/models/operations/v2creditpositions.js +1 -0
- package/dist/esm/models/operations/v2creditpositions.js.map +1 -1
- package/docs/models/components/createcreditaccountrequestchain.md +1 -1
- package/docs/models/components/creditborrowrequest.md +1 -1
- package/docs/models/components/creditborrowrequestchain.md +17 -0
- package/docs/models/components/creditbundlerequest.md +7 -7
- package/docs/models/components/creditbundlerequestchain.md +17 -0
- package/docs/models/components/creditlooppreview.md +12 -10
- package/docs/models/components/creditlooprequest.md +1 -1
- package/docs/models/components/creditlooprequestchain.md +17 -0
- package/docs/models/components/creditloopresponse.md +1 -0
- package/docs/models/components/creditrebalancerequest.md +1 -1
- package/docs/models/components/creditrebalancerequestchain.md +17 -0
- package/docs/models/components/creditrepayrequest.md +1 -1
- package/docs/models/components/creditrepayrequestchain.md +17 -0
- package/docs/models/components/credittransferrequest.md +1 -1
- package/docs/models/components/credittransferrequestchain.md +17 -0
- package/docs/models/components/creditunlooprequest.md +1 -1
- package/docs/models/components/creditunlooprequestchain.md +17 -0
- package/docs/models/components/looplegpreview.md +6 -5
- package/docs/models/operations/v2creditbalanceschain.md +1 -1
- package/docs/models/operations/v2crediteulermarketschain.md +1 -1
- package/docs/models/operations/v2creditloopedpositionschain.md +1 -1
- package/docs/models/operations/v2creditmorphomarketschain.md +1 -1
- package/docs/models/operations/v2creditpositionschain.md +1 -1
- package/docs/sdks/credit/README.md +2 -2
- package/openapi_prepped_for_speakeasy.json +95 -9
- package/package.json +1 -1
- package/src/models/components/createcreditaccountrequest.ts +1 -0
- package/src/models/components/creditborrowrequest.ts +27 -4
- package/src/models/components/creditbundlerequest.ts +27 -4
- package/src/models/components/creditlooppreview.ts +6 -0
- package/src/models/components/creditlooprequest.ts +25 -4
- package/src/models/components/creditrebalancerequest.ts +26 -4
- package/src/models/components/creditrepayrequest.ts +27 -4
- package/src/models/components/credittransferrequest.ts +26 -4
- package/src/models/components/creditunlooprequest.ts +27 -4
- package/src/models/components/looplegpreview.ts +6 -0
- package/src/models/operations/v2creditbalances.ts +1 -0
- package/src/models/operations/v2crediteulermarkets.ts +1 -0
- package/src/models/operations/v2creditloopedpositions.ts +1 -0
- package/src/models/operations/v2creditmorphomarkets.ts +1 -0
- package/src/models/operations/v2creditpositions.ts +1 -0
|
@@ -5905,6 +5905,7 @@
|
|
|
5905
5905
|
"base",
|
|
5906
5906
|
"bsc",
|
|
5907
5907
|
"ethereum",
|
|
5908
|
+
"hyperevm",
|
|
5908
5909
|
"tempo"
|
|
5909
5910
|
],
|
|
5910
5911
|
"title": "Chain",
|
|
@@ -5968,6 +5969,7 @@
|
|
|
5968
5969
|
"base",
|
|
5969
5970
|
"bsc",
|
|
5970
5971
|
"ethereum",
|
|
5972
|
+
"hyperevm",
|
|
5971
5973
|
"tempo"
|
|
5972
5974
|
],
|
|
5973
5975
|
"title": "Chain",
|
|
@@ -6031,6 +6033,7 @@
|
|
|
6031
6033
|
"base",
|
|
6032
6034
|
"bsc",
|
|
6033
6035
|
"ethereum",
|
|
6036
|
+
"hyperevm",
|
|
6034
6037
|
"tempo"
|
|
6035
6038
|
],
|
|
6036
6039
|
"title": "Chain",
|
|
@@ -6094,6 +6097,7 @@
|
|
|
6094
6097
|
"base",
|
|
6095
6098
|
"bsc",
|
|
6096
6099
|
"ethereum",
|
|
6100
|
+
"hyperevm",
|
|
6097
6101
|
"tempo"
|
|
6098
6102
|
],
|
|
6099
6103
|
"title": "Chain",
|
|
@@ -6170,6 +6174,7 @@
|
|
|
6170
6174
|
"base",
|
|
6171
6175
|
"bsc",
|
|
6172
6176
|
"ethereum",
|
|
6177
|
+
"hyperevm",
|
|
6173
6178
|
"tempo"
|
|
6174
6179
|
],
|
|
6175
6180
|
"title": "Chain",
|
|
@@ -12258,6 +12263,7 @@
|
|
|
12258
12263
|
"base",
|
|
12259
12264
|
"bsc",
|
|
12260
12265
|
"ethereum",
|
|
12266
|
+
"hyperevm",
|
|
12261
12267
|
"tempo"
|
|
12262
12268
|
],
|
|
12263
12269
|
"title": "Chain",
|
|
@@ -12521,7 +12527,16 @@
|
|
|
12521
12527
|
"example": "0xfeEb60eBf707DAA8248277058eb8D28EaeCF5425"
|
|
12522
12528
|
},
|
|
12523
12529
|
"chain": {
|
|
12524
|
-
"
|
|
12530
|
+
"type": "string",
|
|
12531
|
+
"enum": [
|
|
12532
|
+
"arbitrum",
|
|
12533
|
+
"base",
|
|
12534
|
+
"bsc",
|
|
12535
|
+
"ethereum",
|
|
12536
|
+
"hyperevm",
|
|
12537
|
+
"tempo"
|
|
12538
|
+
],
|
|
12539
|
+
"title": "Chain",
|
|
12525
12540
|
"description": "Blockchain network.",
|
|
12526
12541
|
"example": "base"
|
|
12527
12542
|
},
|
|
@@ -12803,7 +12818,16 @@
|
|
|
12803
12818
|
"description": "The owner's wallet address that controls the Credit Account."
|
|
12804
12819
|
},
|
|
12805
12820
|
"chain": {
|
|
12806
|
-
"
|
|
12821
|
+
"type": "string",
|
|
12822
|
+
"enum": [
|
|
12823
|
+
"arbitrum",
|
|
12824
|
+
"base",
|
|
12825
|
+
"bsc",
|
|
12826
|
+
"ethereum",
|
|
12827
|
+
"hyperevm",
|
|
12828
|
+
"tempo"
|
|
12829
|
+
],
|
|
12830
|
+
"title": "Chain",
|
|
12807
12831
|
"description": "Target blockchain network where the bundled actions will execute."
|
|
12808
12832
|
},
|
|
12809
12833
|
"actions": {
|
|
@@ -13047,6 +13071,11 @@
|
|
|
13047
13071
|
"title": "Estimated Max Dust",
|
|
13048
13072
|
"description": "Upper bound of collateral-token surplus the swaps can leave in the Credit Account (sum of quote \u2212 guaranteed floor per swap). It is bounded by max_slippage_percent per iteration, stays in the account, and is never lost."
|
|
13049
13073
|
},
|
|
13074
|
+
"estimated_swap_cost": {
|
|
13075
|
+
"type": "string",
|
|
13076
|
+
"title": "Estimated Swap Cost",
|
|
13077
|
+
"description": "Expected one-off cost of entering this loop, in COLLATERAL token units: the sum over swap legs of the market oracle's fair output minus the router's quote. This is the DEX fee plus price impact \u2014 the amount the position must earn back before it is ahead. Multiply by the collateral price for a USD figure. Distinct from estimated_max_dust, which is surplus retained in the account, not a cost. Excludes gas. Measured against the protocol's own oracle, so it also carries any oracle-to-market basis; clamped at zero."
|
|
13078
|
+
},
|
|
13050
13079
|
"legs": {
|
|
13051
13080
|
"items": {
|
|
13052
13081
|
"$ref": "#/components/schemas/LoopLegPreview"
|
|
@@ -13066,7 +13095,8 @@
|
|
|
13066
13095
|
"achieved_multiplier",
|
|
13067
13096
|
"projected_ltv",
|
|
13068
13097
|
"projected_health_factor",
|
|
13069
|
-
"estimated_max_dust"
|
|
13098
|
+
"estimated_max_dust",
|
|
13099
|
+
"estimated_swap_cost"
|
|
13070
13100
|
],
|
|
13071
13101
|
"title": "CreditLoopPreview",
|
|
13072
13102
|
"description": "Projected end state of the loop, computed on GUARANTEED swap floors."
|
|
@@ -13080,7 +13110,16 @@
|
|
|
13080
13110
|
"example": "0x5e5b00ed886A6879C2B934612D2312975427fcAf"
|
|
13081
13111
|
},
|
|
13082
13112
|
"chain": {
|
|
13083
|
-
"
|
|
13113
|
+
"type": "string",
|
|
13114
|
+
"enum": [
|
|
13115
|
+
"arbitrum",
|
|
13116
|
+
"base",
|
|
13117
|
+
"bsc",
|
|
13118
|
+
"ethereum",
|
|
13119
|
+
"hyperevm",
|
|
13120
|
+
"tempo"
|
|
13121
|
+
],
|
|
13122
|
+
"title": "Chain",
|
|
13084
13123
|
"description": "Blockchain network.",
|
|
13085
13124
|
"example": "ethereum"
|
|
13086
13125
|
},
|
|
@@ -13482,8 +13521,16 @@
|
|
|
13482
13521
|
"example": "0x4D3c07d1db7E4A9E44285fae9810d6549655bc74"
|
|
13483
13522
|
},
|
|
13484
13523
|
"chain": {
|
|
13485
|
-
"
|
|
13486
|
-
"
|
|
13524
|
+
"type": "string",
|
|
13525
|
+
"enum": [
|
|
13526
|
+
"arbitrum",
|
|
13527
|
+
"base",
|
|
13528
|
+
"bsc",
|
|
13529
|
+
"ethereum",
|
|
13530
|
+
"tempo"
|
|
13531
|
+
],
|
|
13532
|
+
"title": "Chain",
|
|
13533
|
+
"description": "Blockchain network. Rebalance is not available on HyperEVM yet; use loop/unloop there.",
|
|
13487
13534
|
"example": "ethereum"
|
|
13488
13535
|
},
|
|
13489
13536
|
"targets": {
|
|
@@ -13672,7 +13719,16 @@
|
|
|
13672
13719
|
"example": "0x831Ad0C52C77708DA5D49dc8278C966dfdD4ddA1"
|
|
13673
13720
|
},
|
|
13674
13721
|
"chain": {
|
|
13675
|
-
"
|
|
13722
|
+
"type": "string",
|
|
13723
|
+
"enum": [
|
|
13724
|
+
"arbitrum",
|
|
13725
|
+
"base",
|
|
13726
|
+
"bsc",
|
|
13727
|
+
"ethereum",
|
|
13728
|
+
"hyperevm",
|
|
13729
|
+
"tempo"
|
|
13730
|
+
],
|
|
13731
|
+
"title": "Chain",
|
|
13676
13732
|
"description": "Blockchain network.",
|
|
13677
13733
|
"example": "base"
|
|
13678
13734
|
},
|
|
@@ -14002,7 +14058,16 @@
|
|
|
14002
14058
|
"example": "0x4A83fec8c6A9A25Be28f3242a16dBaD0ab00f3a6"
|
|
14003
14059
|
},
|
|
14004
14060
|
"chain": {
|
|
14005
|
-
"
|
|
14061
|
+
"type": "string",
|
|
14062
|
+
"enum": [
|
|
14063
|
+
"arbitrum",
|
|
14064
|
+
"base",
|
|
14065
|
+
"bsc",
|
|
14066
|
+
"ethereum",
|
|
14067
|
+
"hyperevm",
|
|
14068
|
+
"tempo"
|
|
14069
|
+
],
|
|
14070
|
+
"title": "Chain",
|
|
14006
14071
|
"description": "Blockchain network.",
|
|
14007
14072
|
"example": "base"
|
|
14008
14073
|
},
|
|
@@ -14233,7 +14298,16 @@
|
|
|
14233
14298
|
"example": "0x0E407CdeBD8e078E6966ef6740540d25F5897082"
|
|
14234
14299
|
},
|
|
14235
14300
|
"chain": {
|
|
14236
|
-
"
|
|
14301
|
+
"type": "string",
|
|
14302
|
+
"enum": [
|
|
14303
|
+
"arbitrum",
|
|
14304
|
+
"base",
|
|
14305
|
+
"bsc",
|
|
14306
|
+
"ethereum",
|
|
14307
|
+
"hyperevm",
|
|
14308
|
+
"tempo"
|
|
14309
|
+
],
|
|
14310
|
+
"title": "Chain",
|
|
14237
14311
|
"description": "Blockchain network.",
|
|
14238
14312
|
"example": "ethereum"
|
|
14239
14313
|
},
|
|
@@ -16670,6 +16744,18 @@
|
|
|
16670
16744
|
],
|
|
16671
16745
|
"title": "Min Swap Out",
|
|
16672
16746
|
"description": "Guaranteed swap output (collateral units) \u2014 the next iteration's supply. Enforced on-chain by the swap's minimum-return."
|
|
16747
|
+
},
|
|
16748
|
+
"expected_swap_out": {
|
|
16749
|
+
"anyOf": [
|
|
16750
|
+
{
|
|
16751
|
+
"type": "string"
|
|
16752
|
+
},
|
|
16753
|
+
{
|
|
16754
|
+
"type": "null"
|
|
16755
|
+
}
|
|
16756
|
+
],
|
|
16757
|
+
"title": "Expected Swap Out",
|
|
16758
|
+
"description": "Quoted swap output (collateral units) before the slippage floor is applied. Only min_swap_out is guaranteed on-chain; the gap between the two is the adverse-slippage tolerance, bounded by max_slippage_percent, not a surplus that is certain to arrive. Whatever the fill actually delivers above min_swap_out stays in the account, and estimated_max_dust is the upper bound on that."
|
|
16673
16759
|
}
|
|
16674
16760
|
},
|
|
16675
16761
|
"additionalProperties": false,
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
8
|
import {
|
|
9
9
|
CreditFee,
|
|
10
10
|
CreditFee$Outbound,
|
|
@@ -19,6 +19,24 @@ import {
|
|
|
19
19
|
InterestRateMode$outboundSchema,
|
|
20
20
|
} from "./interestratemode.js";
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Blockchain network.
|
|
24
|
+
*/
|
|
25
|
+
export const CreditBorrowRequestChain = {
|
|
26
|
+
Arbitrum: "arbitrum",
|
|
27
|
+
Base: "base",
|
|
28
|
+
Bsc: "bsc",
|
|
29
|
+
Ethereum: "ethereum",
|
|
30
|
+
Hyperevm: "hyperevm",
|
|
31
|
+
Tempo: "tempo",
|
|
32
|
+
} as const;
|
|
33
|
+
/**
|
|
34
|
+
* Blockchain network.
|
|
35
|
+
*/
|
|
36
|
+
export type CreditBorrowRequestChain = ClosedEnum<
|
|
37
|
+
typeof CreditBorrowRequestChain
|
|
38
|
+
>;
|
|
39
|
+
|
|
22
40
|
/**
|
|
23
41
|
* Amount of token_in to use (in token units, not wei). Omit together with token_in and collateral_token for borrow-only mode.
|
|
24
42
|
*/
|
|
@@ -40,9 +58,9 @@ export type CreditBorrowRequest = {
|
|
|
40
58
|
*/
|
|
41
59
|
owner: string;
|
|
42
60
|
/**
|
|
43
|
-
*
|
|
61
|
+
* Blockchain network.
|
|
44
62
|
*/
|
|
45
|
-
chain:
|
|
63
|
+
chain: CreditBorrowRequestChain;
|
|
46
64
|
/**
|
|
47
65
|
* Which lending protocol a credit action targets.
|
|
48
66
|
*
|
|
@@ -126,6 +144,11 @@ export type CreditBorrowRequest = {
|
|
|
126
144
|
permit2Deadline?: number | null | undefined;
|
|
127
145
|
};
|
|
128
146
|
|
|
147
|
+
/** @internal */
|
|
148
|
+
export const CreditBorrowRequestChain$outboundSchema: z.ZodNativeEnum<
|
|
149
|
+
typeof CreditBorrowRequestChain
|
|
150
|
+
> = z.nativeEnum(CreditBorrowRequestChain);
|
|
151
|
+
|
|
129
152
|
/** @internal */
|
|
130
153
|
export type CreditBorrowRequestAmountIn$Outbound = number | string;
|
|
131
154
|
|
|
@@ -210,7 +233,7 @@ export const CreditBorrowRequest$outboundSchema: z.ZodType<
|
|
|
210
233
|
CreditBorrowRequest
|
|
211
234
|
> = z.object({
|
|
212
235
|
owner: z.string(),
|
|
213
|
-
chain:
|
|
236
|
+
chain: CreditBorrowRequestChain$outboundSchema,
|
|
214
237
|
protocol: CreditProtocol$outboundSchema.optional(),
|
|
215
238
|
collateralVault: z.nullable(z.string()).optional(),
|
|
216
239
|
borrowVault: z.nullable(z.string()).optional(),
|
|
@@ -4,13 +4,31 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
8
|
import {
|
|
9
9
|
CreditUserOperation,
|
|
10
10
|
CreditUserOperation$Outbound,
|
|
11
11
|
CreditUserOperation$outboundSchema,
|
|
12
12
|
} from "./credituseroperation.js";
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Target blockchain network where the bundled actions will execute.
|
|
16
|
+
*/
|
|
17
|
+
export const CreditBundleRequestChain = {
|
|
18
|
+
Arbitrum: "arbitrum",
|
|
19
|
+
Base: "base",
|
|
20
|
+
Bsc: "bsc",
|
|
21
|
+
Ethereum: "ethereum",
|
|
22
|
+
Hyperevm: "hyperevm",
|
|
23
|
+
Tempo: "tempo",
|
|
24
|
+
} as const;
|
|
25
|
+
/**
|
|
26
|
+
* Target blockchain network where the bundled actions will execute.
|
|
27
|
+
*/
|
|
28
|
+
export type CreditBundleRequestChain = ClosedEnum<
|
|
29
|
+
typeof CreditBundleRequestChain
|
|
30
|
+
>;
|
|
31
|
+
|
|
14
32
|
/**
|
|
15
33
|
* Request to execute multiple credit actions in a single atomic transaction.
|
|
16
34
|
*/
|
|
@@ -20,9 +38,9 @@ export type CreditBundleRequest = {
|
|
|
20
38
|
*/
|
|
21
39
|
owner: string;
|
|
22
40
|
/**
|
|
23
|
-
*
|
|
41
|
+
* Target blockchain network where the bundled actions will execute.
|
|
24
42
|
*/
|
|
25
|
-
chain:
|
|
43
|
+
chain: CreditBundleRequestChain;
|
|
26
44
|
/**
|
|
27
45
|
* List of actions to bundle. Actions are executed in order.
|
|
28
46
|
*/
|
|
@@ -33,6 +51,11 @@ export type CreditBundleRequest = {
|
|
|
33
51
|
gasSponsorship?: boolean | undefined;
|
|
34
52
|
};
|
|
35
53
|
|
|
54
|
+
/** @internal */
|
|
55
|
+
export const CreditBundleRequestChain$outboundSchema: z.ZodNativeEnum<
|
|
56
|
+
typeof CreditBundleRequestChain
|
|
57
|
+
> = z.nativeEnum(CreditBundleRequestChain);
|
|
58
|
+
|
|
36
59
|
/** @internal */
|
|
37
60
|
export type CreditBundleRequest$Outbound = {
|
|
38
61
|
owner: string;
|
|
@@ -48,7 +71,7 @@ export const CreditBundleRequest$outboundSchema: z.ZodType<
|
|
|
48
71
|
CreditBundleRequest
|
|
49
72
|
> = z.object({
|
|
50
73
|
owner: z.string(),
|
|
51
|
-
chain:
|
|
74
|
+
chain: CreditBundleRequestChain$outboundSchema,
|
|
52
75
|
actions: z.array(CreditUserOperation$outboundSchema),
|
|
53
76
|
gasSponsorship: z.boolean().optional(),
|
|
54
77
|
}).transform((v) => {
|
|
@@ -44,6 +44,10 @@ export type CreditLoopPreview = {
|
|
|
44
44
|
* Upper bound of collateral-token surplus the swaps can leave in the Credit Account (sum of quote − guaranteed floor per swap). It is bounded by max_slippage_percent per iteration, stays in the account, and is never lost.
|
|
45
45
|
*/
|
|
46
46
|
estimatedMaxDust: string;
|
|
47
|
+
/**
|
|
48
|
+
* Expected one-off cost of entering this loop, in COLLATERAL token units: the sum over swap legs of the market oracle's fair output minus the router's quote. This is the DEX fee plus price impact — the amount the position must earn back before it is ahead. Multiply by the collateral price for a USD figure. Distinct from estimated_max_dust, which is surplus retained in the account, not a cost. Excludes gas. Measured against the protocol's own oracle, so it also carries any oracle-to-market basis; clamped at zero.
|
|
49
|
+
*/
|
|
50
|
+
estimatedSwapCost: string;
|
|
47
51
|
/**
|
|
48
52
|
* Per-iteration breakdown.
|
|
49
53
|
*/
|
|
@@ -63,6 +67,7 @@ export const CreditLoopPreview$inboundSchema: z.ZodType<
|
|
|
63
67
|
projected_ltv: z.string(),
|
|
64
68
|
projected_health_factor: z.string(),
|
|
65
69
|
estimated_max_dust: z.string(),
|
|
70
|
+
estimated_swap_cost: z.string(),
|
|
66
71
|
legs: z.array(LoopLegPreview$inboundSchema).optional(),
|
|
67
72
|
}).transform((v) => {
|
|
68
73
|
return remap$(v, {
|
|
@@ -72,6 +77,7 @@ export const CreditLoopPreview$inboundSchema: z.ZodType<
|
|
|
72
77
|
"projected_ltv": "projectedLtv",
|
|
73
78
|
"projected_health_factor": "projectedHealthFactor",
|
|
74
79
|
"estimated_max_dust": "estimatedMaxDust",
|
|
80
|
+
"estimated_swap_cost": "estimatedSwapCost",
|
|
75
81
|
});
|
|
76
82
|
});
|
|
77
83
|
|
|
@@ -4,12 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
8
|
import {
|
|
9
9
|
CreditProtocol,
|
|
10
10
|
CreditProtocol$outboundSchema,
|
|
11
11
|
} from "./creditprotocol.js";
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Blockchain network.
|
|
15
|
+
*/
|
|
16
|
+
export const CreditLoopRequestChain = {
|
|
17
|
+
Arbitrum: "arbitrum",
|
|
18
|
+
Base: "base",
|
|
19
|
+
Bsc: "bsc",
|
|
20
|
+
Ethereum: "ethereum",
|
|
21
|
+
Hyperevm: "hyperevm",
|
|
22
|
+
Tempo: "tempo",
|
|
23
|
+
} as const;
|
|
24
|
+
/**
|
|
25
|
+
* Blockchain network.
|
|
26
|
+
*/
|
|
27
|
+
export type CreditLoopRequestChain = ClosedEnum<typeof CreditLoopRequestChain>;
|
|
28
|
+
|
|
13
29
|
/**
|
|
14
30
|
* Collateral (in token units) already held in the Credit Account to seed the loop.
|
|
15
31
|
*/
|
|
@@ -43,9 +59,9 @@ export type CreditLoopRequest = {
|
|
|
43
59
|
*/
|
|
44
60
|
owner: string;
|
|
45
61
|
/**
|
|
46
|
-
*
|
|
62
|
+
* Blockchain network.
|
|
47
63
|
*/
|
|
48
|
-
chain:
|
|
64
|
+
chain: CreditLoopRequestChain;
|
|
49
65
|
/**
|
|
50
66
|
* Which lending protocol a credit action targets.
|
|
51
67
|
*
|
|
@@ -109,6 +125,11 @@ export type CreditLoopRequest = {
|
|
|
109
125
|
gasSponsorship?: boolean | undefined;
|
|
110
126
|
};
|
|
111
127
|
|
|
128
|
+
/** @internal */
|
|
129
|
+
export const CreditLoopRequestChain$outboundSchema: z.ZodNativeEnum<
|
|
130
|
+
typeof CreditLoopRequestChain
|
|
131
|
+
> = z.nativeEnum(CreditLoopRequestChain);
|
|
132
|
+
|
|
112
133
|
/** @internal */
|
|
113
134
|
export type CreditLoopRequestInitialCollateralAmount$Outbound = number | string;
|
|
114
135
|
|
|
@@ -216,7 +237,7 @@ export const CreditLoopRequest$outboundSchema: z.ZodType<
|
|
|
216
237
|
CreditLoopRequest
|
|
217
238
|
> = z.object({
|
|
218
239
|
owner: z.string(),
|
|
219
|
-
chain:
|
|
240
|
+
chain: CreditLoopRequestChain$outboundSchema,
|
|
220
241
|
protocol: CreditProtocol$outboundSchema.optional(),
|
|
221
242
|
marketId: z.nullable(z.string()).optional(),
|
|
222
243
|
collateralVault: z.nullable(z.string()).optional(),
|
|
@@ -4,13 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
8
|
import {
|
|
9
9
|
RebalanceTarget,
|
|
10
10
|
RebalanceTarget$Outbound,
|
|
11
11
|
RebalanceTarget$outboundSchema,
|
|
12
12
|
} from "./rebalancetarget.js";
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Blockchain network. Rebalance is not available on HyperEVM yet; use loop/unloop there.
|
|
16
|
+
*/
|
|
17
|
+
export const CreditRebalanceRequestChain = {
|
|
18
|
+
Arbitrum: "arbitrum",
|
|
19
|
+
Base: "base",
|
|
20
|
+
Bsc: "bsc",
|
|
21
|
+
Ethereum: "ethereum",
|
|
22
|
+
Tempo: "tempo",
|
|
23
|
+
} as const;
|
|
24
|
+
/**
|
|
25
|
+
* Blockchain network. Rebalance is not available on HyperEVM yet; use loop/unloop there.
|
|
26
|
+
*/
|
|
27
|
+
export type CreditRebalanceRequestChain = ClosedEnum<
|
|
28
|
+
typeof CreditRebalanceRequestChain
|
|
29
|
+
>;
|
|
30
|
+
|
|
14
31
|
/**
|
|
15
32
|
* Request-level per-swap slippage tolerance in percent (including routing swaps). A per-target max_slippage_percent overrides it where set.
|
|
16
33
|
*/
|
|
@@ -30,9 +47,9 @@ export type CreditRebalanceRequest = {
|
|
|
30
47
|
*/
|
|
31
48
|
owner: string;
|
|
32
49
|
/**
|
|
33
|
-
*
|
|
50
|
+
* Blockchain network. Rebalance is not available on HyperEVM yet; use loop/unloop there.
|
|
34
51
|
*/
|
|
35
|
-
chain:
|
|
52
|
+
chain: CreditRebalanceRequestChain;
|
|
36
53
|
/**
|
|
37
54
|
* The positions to change. Scoped: only positions named here are touched; any position not listed is left untouched.
|
|
38
55
|
*/
|
|
@@ -47,6 +64,11 @@ export type CreditRebalanceRequest = {
|
|
|
47
64
|
gasSponsorship?: boolean | undefined;
|
|
48
65
|
};
|
|
49
66
|
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const CreditRebalanceRequestChain$outboundSchema: z.ZodNativeEnum<
|
|
69
|
+
typeof CreditRebalanceRequestChain
|
|
70
|
+
> = z.nativeEnum(CreditRebalanceRequestChain);
|
|
71
|
+
|
|
50
72
|
/** @internal */
|
|
51
73
|
export type CreditRebalanceRequestMaxSlippagePercent$Outbound = number | string;
|
|
52
74
|
|
|
@@ -84,7 +106,7 @@ export const CreditRebalanceRequest$outboundSchema: z.ZodType<
|
|
|
84
106
|
CreditRebalanceRequest
|
|
85
107
|
> = z.object({
|
|
86
108
|
owner: z.string(),
|
|
87
|
-
chain:
|
|
109
|
+
chain: CreditRebalanceRequestChain$outboundSchema,
|
|
88
110
|
targets: z.array(RebalanceTarget$outboundSchema),
|
|
89
111
|
maxSlippagePercent: z.union([z.number(), z.string()]).optional(),
|
|
90
112
|
gasSponsorship: z.boolean().optional(),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
8
|
import {
|
|
9
9
|
CreditProtocol,
|
|
10
10
|
CreditProtocol$outboundSchema,
|
|
@@ -14,6 +14,24 @@ import {
|
|
|
14
14
|
InterestRateMode$outboundSchema,
|
|
15
15
|
} from "./interestratemode.js";
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Blockchain network.
|
|
19
|
+
*/
|
|
20
|
+
export const CreditRepayRequestChain = {
|
|
21
|
+
Arbitrum: "arbitrum",
|
|
22
|
+
Base: "base",
|
|
23
|
+
Bsc: "bsc",
|
|
24
|
+
Ethereum: "ethereum",
|
|
25
|
+
Hyperevm: "hyperevm",
|
|
26
|
+
Tempo: "tempo",
|
|
27
|
+
} as const;
|
|
28
|
+
/**
|
|
29
|
+
* Blockchain network.
|
|
30
|
+
*/
|
|
31
|
+
export type CreditRepayRequestChain = ClosedEnum<
|
|
32
|
+
typeof CreditRepayRequestChain
|
|
33
|
+
>;
|
|
34
|
+
|
|
17
35
|
/**
|
|
18
36
|
* Amount of repay_token to repay (in token units, not wei).
|
|
19
37
|
*/
|
|
@@ -35,9 +53,9 @@ export type CreditRepayRequest = {
|
|
|
35
53
|
*/
|
|
36
54
|
owner: string;
|
|
37
55
|
/**
|
|
38
|
-
*
|
|
56
|
+
* Blockchain network.
|
|
39
57
|
*/
|
|
40
|
-
chain:
|
|
58
|
+
chain: CreditRepayRequestChain;
|
|
41
59
|
/**
|
|
42
60
|
* Which lending protocol a credit action targets.
|
|
43
61
|
*
|
|
@@ -117,6 +135,11 @@ export type CreditRepayRequest = {
|
|
|
117
135
|
permit2Deadline?: number | null | undefined;
|
|
118
136
|
};
|
|
119
137
|
|
|
138
|
+
/** @internal */
|
|
139
|
+
export const CreditRepayRequestChain$outboundSchema: z.ZodNativeEnum<
|
|
140
|
+
typeof CreditRepayRequestChain
|
|
141
|
+
> = z.nativeEnum(CreditRepayRequestChain);
|
|
142
|
+
|
|
120
143
|
/** @internal */
|
|
121
144
|
export type RepayAmount$Outbound = number | string;
|
|
122
145
|
|
|
@@ -192,7 +215,7 @@ export const CreditRepayRequest$outboundSchema: z.ZodType<
|
|
|
192
215
|
CreditRepayRequest
|
|
193
216
|
> = z.object({
|
|
194
217
|
owner: z.string(),
|
|
195
|
-
chain:
|
|
218
|
+
chain: CreditRepayRequestChain$outboundSchema,
|
|
196
219
|
protocol: CreditProtocol$outboundSchema.optional(),
|
|
197
220
|
borrowVault: z.nullable(z.string()).optional(),
|
|
198
221
|
marketId: z.nullable(z.string()).optional(),
|
|
@@ -5,7 +5,24 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Blockchain network.
|
|
11
|
+
*/
|
|
12
|
+
export const CreditTransferRequestChain = {
|
|
13
|
+
Arbitrum: "arbitrum",
|
|
14
|
+
Base: "base",
|
|
15
|
+
Bsc: "bsc",
|
|
16
|
+
Ethereum: "ethereum",
|
|
17
|
+
Hyperevm: "hyperevm",
|
|
18
|
+
Tempo: "tempo",
|
|
19
|
+
} as const;
|
|
20
|
+
/**
|
|
21
|
+
* Blockchain network.
|
|
22
|
+
*/
|
|
23
|
+
export type CreditTransferRequestChain = ClosedEnum<
|
|
24
|
+
typeof CreditTransferRequestChain
|
|
25
|
+
>;
|
|
9
26
|
|
|
10
27
|
/**
|
|
11
28
|
* The amount of tokens to transfer (in token units, not wei).
|
|
@@ -32,9 +49,9 @@ export type CreditTransferRequest = {
|
|
|
32
49
|
*/
|
|
33
50
|
owner: string;
|
|
34
51
|
/**
|
|
35
|
-
*
|
|
52
|
+
* Blockchain network.
|
|
36
53
|
*/
|
|
37
|
-
chain:
|
|
54
|
+
chain: CreditTransferRequestChain;
|
|
38
55
|
/**
|
|
39
56
|
* The token to transfer.
|
|
40
57
|
*/
|
|
@@ -57,6 +74,11 @@ export type CreditTransferRequest = {
|
|
|
57
74
|
spender?: string | null | undefined;
|
|
58
75
|
};
|
|
59
76
|
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const CreditTransferRequestChain$outboundSchema: z.ZodNativeEnum<
|
|
79
|
+
typeof CreditTransferRequestChain
|
|
80
|
+
> = z.nativeEnum(CreditTransferRequestChain);
|
|
81
|
+
|
|
60
82
|
/** @internal */
|
|
61
83
|
export type CreditTransferRequestAmount$Outbound = number | string;
|
|
62
84
|
|
|
@@ -100,7 +122,7 @@ export const CreditTransferRequest$outboundSchema: z.ZodType<
|
|
|
100
122
|
CreditTransferRequest
|
|
101
123
|
> = z.object({
|
|
102
124
|
owner: z.string(),
|
|
103
|
-
chain:
|
|
125
|
+
chain: CreditTransferRequestChain$outboundSchema,
|
|
104
126
|
token: z.string(),
|
|
105
127
|
amount: z.union([z.number(), z.string()]),
|
|
106
128
|
action: CreditTransferRequestAction$outboundSchema,
|