Skip to content

Commit 1583e74

Browse files
authored
fix: borrow quote example (#189)
1 parent 67b18ad commit 1583e74

File tree

79 files changed

+8194
-118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+8194
-118
lines changed

docs/docs/02-Stash/03-get-the-borrow-quote-for-a-liquidity-transaction-based-on-the-input-data.api.mdx

Lines changed: 73 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "This endpoint calculates the borrow quote for a liquidity transact
55
sidebar_label: "Borrow Quote API"
66
hide_title: true
77
hide_table_of_contents: true
8-
api: eJzNVktv2zgQ/isETynAWEXRveiWtEERYNHudrOnIAdaHEtsKZIhh04MQ/99MaTkqI6aNlkUqA+2TM3jmwe/mT1XEJugPWpnec2vOh0ZWOWdtsgaaZpkJEJk2AFbuxDcHbtNDoFtXGCSGX2btNK4YxikjbIhO4Jp25iktG3neo2LKFiA26QDKKatT1i5hD6hYNIqplKQpL/ignsZZA8IIfL6en+E8q/g0DXOMCt7YCewaleCnTXBxfiKC65JxkvsuOAkQf9GDS74BIDXGBIIHpsOesnrPcedJ9mIQduWD4M49vt3jlya1gWNXc9IYXJ/cS8bvLQ5mPz8KUf2HTzZ1f/C8h4iapvzxT4C3rnwlV2+ZycuC0gjmIKNTAYjQ5fLYEepTXB9PiDvEJGtndodcN4mCLsHoKMSX8CmLUILgQ/DTYkEIp47tSORxlkEi/QovTe6yUCrL5Gw75+IcxBHcZ71LlmkGEobLWTt/jS+caduC8E4qabzgQSjdzZCJE9vXr+mn2+t/5OaBmLcJGN2LAAGDVtQ33Q6Fz8fjQ/OQ0BdPCqJC6fF9jsXcSF+wadLsPhyijz32ZMSpfsWO2mWv+s5mpnvY0+P7N6Iya5bf4EGH9nNsS9IkdzbpUqcS3VoSJWACq7tVho9MgVzgfU6RiKVGTm8vDiwTu1iCiEEF36cuWJgEv9OqH8shXppEYKVhkUIWwisWPitIxkER9kSF/M/J8onyXL17mSwZLjmnzyU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Qvf3a0KU7elRiycrmxDRNsfQ/lO3XwI+3X7ng8/blpTAZHbGwpqYJ6walCY4K9TrsbbkCvaxgSbKNSvr8BWhqNXM=
99
sidebar_class_name: "get api-method"
1010
custom_edit_url: null
1111
---
@@ -54,42 +54,65 @@ See the [Request Final Borrow Quote example payload](/Stash/use-stash#3-request-
5454
description:
5555
"destChainID must use capid format from our configuration <br />-eip155:8453(Base),<br />-eip155:10 (Optimism),<br />-eip155:42161 (Arbitrum)",
5656
in: "path",
57-
name: "destChainId",
57+
name: "chain",
5858
required: true,
59-
schema: { type: "string" },
59+
schema: { type: "string", example: "eip155:8453" },
6060
},
6161
{
6262
description: "Protocol name - across, mayan",
6363
in: "path",
6464
name: "protocol",
6565
required: true,
66-
schema: { type: "string" },
66+
schema: { type: "string", example: "mayan" },
6767
},
6868
{
6969
description:
7070
"Quote algorithm type: <br /><br /> ExactInput - Request will consider the amount as (input amount - borrow costs) <br /><br /> ExactOutput - Request will consider the amount as (output amount + borrow costs) ",
7171
in: "path",
7272
name: "type",
7373
required: true,
74-
schema: { type: "string" },
75-
},
76-
{
77-
description:
78-
"Destination Network ID (optional, defaults to the network from the request body)",
79-
in: "query",
80-
name: "network",
81-
schema: { type: "integer" },
74+
schema: { type: "string", example: "ExactOutput" },
8275
},
8376
]}
8477
></ParamsDetails>
8578

8679
<RequestSchema
8780
title={"Body"}
8881
body={{
89-
content: { "application/json": { schema: { type: "string" } } },
90-
description: "Amount to borrow",
82+
content: {
83+
"application/json": {
84+
schema: {
85+
properties: {
86+
amount: {
87+
description:
88+
"amount of tokens for which we are requesting borrow quote (in the smallest denomination)",
89+
example: "49805421",
90+
type: "string",
91+
},
92+
exclusive_fill: {
93+
description: "boolean representing if you have exclusivity to fill this quote",
94+
example: false,
95+
type: "boolean",
96+
},
97+
network: {
98+
description: "caip formated network id",
99+
example: "eip155:1",
100+
type: "string",
101+
},
102+
token: {
103+
description: "token address (hex)",
104+
example: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
105+
type: "string",
106+
format: "hex",
107+
},
108+
},
109+
required: ["amount", "exclusive_fill", "network", "token"],
110+
type: "object",
111+
},
112+
},
113+
},
114+
description: "Borrow quote request payload",
91115
required: true,
92-
"x-s2o-overloaded": true,
93116
}}
94117
></RequestSchema>
95118

@@ -98,7 +121,7 @@ See the [Request Final Borrow Quote example payload](/Stash/use-stash#3-request-
98121
label={undefined}
99122
responses={{
100123
"200": {
101-
description: "Successfully retrieved borrow quote",
124+
description: 'Successfully retrieved borrow quote".',
102125
content: {
103126
"application/json": {
104127
schema: {
@@ -107,10 +130,39 @@ See the [Request Final Borrow Quote example payload](/Stash/use-stash#3-request-
107130
properties: {
108131
borrowCost: { type: "string" },
109132
duration: { type: "string" },
133+
liquidityPool: { type: "string" },
134+
repaymentChain: {
135+
enum: [1, 42161, 10, 137, 8453, 43114, 100, 8333, 11155111, 1993, 19934, 84532],
136+
format: "int32",
137+
type: "integer",
138+
"x-enum-varnames": [
139+
"Ethereum",
140+
"Arbitrum",
141+
"Optimism",
142+
"Polygon",
143+
"Base",
144+
"Avalanche",
145+
"Gnosis",
146+
"B3",
147+
"Sepolia",
148+
"B3Sepolia",
149+
"B4Sepolia",
150+
"BaseSepolia",
151+
],
152+
},
153+
repaymentRecipient: { type: "string" },
110154
requiredInput: { type: "string" },
111155
requiredOutput: { type: "string" },
112156
},
113-
required: ["borrowCost", "duration", "requiredInput", "requiredOutput"],
157+
required: [
158+
"borrowCost",
159+
"duration",
160+
"liquidityPool",
161+
"repaymentChain",
162+
"repaymentRecipient",
163+
"requiredInput",
164+
"requiredOutput",
165+
],
114166
type: "object",
115167
},
116168
},
@@ -121,30 +173,30 @@ See the [Request Final Borrow Quote example payload](/Stash/use-stash#3-request-
121173
},
122174
},
123175
"400": {
124-
description: "Bad request due to invalid input or missing parameters",
176+
description: 'Bad request due to invalid input or missing parameters".',
125177
content: {
126178
"application/json": {
127179
schema: {
128180
properties: {
129181
debug: { type: "string" },
130182
error: { type: "string" },
131183
},
132-
required: ["debug", "error"],
184+
required: ["error"],
133185
type: "object",
134186
},
135187
},
136188
},
137189
},
138190
"500": {
139-
description: "Internal server error",
191+
description: 'Internal server error".',
140192
content: {
141193
"application/json": {
142194
schema: {
143195
properties: {
144196
debug: { type: "string" },
145197
error: { type: "string" },
146198
},
147-
required: ["debug", "error"],
199+
required: ["error"],
148200
type: "object",
149201
},
150202
},

docs/docusaurus.config.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,33 @@ const config: Config = {
136136
theme: prismThemes.github,
137137
darkTheme: prismThemes.dracula,
138138
},
139+
languageTabs: [
140+
{
141+
language: "curl",
142+
highlight: "bash",
143+
logoClass: "curl",
144+
},
145+
{
146+
language: "go",
147+
highlight: "go",
148+
logoClass: "go",
149+
},
150+
{
151+
language: "javascript",
152+
highlight: "javascript",
153+
logoClass: "javascript",
154+
},
155+
{
156+
language: "csharp",
157+
highlight: "csharp",
158+
logoClass: "csharp",
159+
},
160+
{
161+
language: "java",
162+
highlight: "java",
163+
logoClass: "java",
164+
},
165+
],
139166
} satisfies Preset.ThemeConfig,
140167
plugins: [
141168
[

docs/src/api/generated/stash/get-the-borrow-cost-for-a-liquidity-transaction.api.mdx renamed to docs/src/api/generated/stash/get-signing-authorization-for-a-liquidity-transaction.api.mdx

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
id: get-the-borrow-cost-for-a-liquidity-transaction
3-
title: "Get the borrow cost for a liquidity transaction"
4-
description: "Get the borrow cost for a liquidity transaction"
5-
sidebar_label: "Get the borrow cost for a liquidity transaction"
2+
id: get-signing-authorization-for-a-liquidity-transaction
3+
title: "Get signing authorization for a liquidity transaction"
4+
description: "This endpoint returns signed authorization for a liquidity transaction"
5+
sidebar_label: "Get signing authorization for a liquidity transaction"
66
hide_title: true
77
hide_table_of_contents: true
8-
api: eJzNVk2P2zgM/SsCTy2gGRdF9+Jbpyi6xRZ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z/EvbsTDYe9fRF1yyTve1TUGftL2WFA+frhJUzjfvHpvZAvBRrgGmwzTp3KkCZHejboD1wzQiG12Kb8/Ac2uDZw=
99
sidebar_class_name: "get api-method"
1010
custom_edit_url: null
1111
---
@@ -21,16 +21,18 @@ import Heading from "@theme/Heading";
2121
<Heading
2222
as={"h1"}
2323
className={"openapi__heading"}
24-
children={"Get the borrow cost for a liquidity transaction"}
24+
children={"Get signing authorization for a liquidity transaction"}
2525
></Heading>
2626

2727
<MethodEndpoint
2828
method={"get"}
29-
path={"/liquidity/protocol/{protocol}/deposit/{txHash}/request"}
29+
path={
30+
"/liquidity/chain/{chainId}/protocol/{protocol}/deposit/{txHash}/request"
31+
}
3032
context={"endpoint"}
3133
></MethodEndpoint>
3234

33-
Get the borrow cost for a liquidity transaction
35+
This endpoint returns signed authorization for a liquidity transaction
3436

3537
<Heading
3638
id={"request"}
@@ -55,6 +57,13 @@ Get the borrow cost for a liquidity transaction
5557
required: true,
5658
schema: { type: "string" },
5759
},
60+
{
61+
description: "Destination chain caip id",
62+
in: "path",
63+
name: "chain",
64+
required: true,
65+
schema: { type: "string" },
66+
},
5867
]}
5968
></ParamsDetails>
6069

@@ -80,12 +89,19 @@ Get the borrow cost for a liquidity transaction
8089
description:
8190
"Borrow cost structure with a big.Int represented as string",
8291
properties: {
92+
borrowAmount: { type: "string" },
8393
borrowCost: { type: "string" },
8494
liquidityPool: { type: "string" },
8595
nonce: { type: "string" },
8696
signature: { type: "string" },
8797
},
88-
required: ["borrowCost", "liquidityPool", "nonce", "signature"],
98+
required: [
99+
"borrowAmount",
100+
"borrowCost",
101+
"liquidityPool",
102+
"nonce",
103+
"signature",
104+
],
89105
type: "object",
90106
},
91107
},
@@ -100,7 +116,7 @@ Get the borrow cost for a liquidity transaction
100116
debug: { type: "string" },
101117
error: { type: "string" },
102118
},
103-
required: ["debug", "error"],
119+
required: ["error"],
104120
type: "object",
105121
},
106122
},
@@ -115,7 +131,7 @@ Get the borrow cost for a liquidity transaction
115131
debug: { type: "string" },
116132
error: { type: "string" },
117133
},
118-
required: ["debug", "error"],
134+
required: ["error"],
119135
type: "object",
120136
},
121137
},

0 commit comments

Comments
 (0)