Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/fb v2 docs [SLT-476] #3402

Merged
merged 30 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0c5f4aa
WIP - index.md
parodime Nov 15, 2024
b0d480f
WIP - index.md
parodime Nov 15, 2024
d550bda
markup tweaks
parodime Nov 15, 2024
a7ff26a
WIP
parodime Nov 15, 2024
3e8a2f3
Add active quoting websocket docs (#3396)
dwasse Nov 16, 2024
b58347a
WIP - endpoint relabels
parodime Nov 16, 2024
f1d1096
WIP - overhaul content & restruct
parodime Nov 18, 2024
a5efffe
WIP
parodime Nov 18, 2024
943dfca
WIP
parodime Nov 19, 2024
e410e78
WIP
parodime Nov 19, 2024
f029c30
ref link tweaks
parodime Nov 19, 2024
d431bd9
final draft
parodime Nov 19, 2024
5e6fa9b
+quoteId, exclu, and PH for zaps
parodime Nov 19, 2024
ccdff29
spell fix
parodime Nov 19, 2024
4f82733
+multicall link, typo fixes
parodime Nov 20, 2024
5d67690
proper cspell fix
parodime Nov 20, 2024
0fd739b
broken links
parodime Nov 20, 2024
aef5ab3
missing links
parodime Nov 22, 2024
c6715e9
Canceler role summary expand. various fixes/tweaks
parodime Nov 22, 2024
6fba9ec
+Exclusivity section - linked by Bridging and Relaying sections
parodime Nov 22, 2024
d094a7d
active quote rephrase
parodime Nov 22, 2024
7fdf0ef
v2 func relabel
parodime Nov 25, 2024
1b5f039
remove zaps [temp]
trajan0x Nov 30, 2024
72d3d1e
Revert "remove zaps [temp]"
trajan0x Nov 30, 2024
c68478b
Reapply "remove zaps [temp]"
trajan0x Nov 30, 2024
d560457
Merge branch 'master' into feat/FbV2-docs
trajan0x Nov 30, 2024
928c01c
bridgev2
trajan0x Nov 30, 2024
37e1f33
add docs
trajan0x Nov 30, 2024
7691857
sqlite
trajan0x Nov 30, 2024
21c6c5e
Revert "sqlite"
trajan0x Nov 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
"ofac",
"omnirpc",
"opaciyt",
"permissionless",
"permissioned",
"permissionlessly",
"persistor",
"popperjs",
Expand Down
2 changes: 1 addition & 1 deletion docs/bridge/docs/01-About/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Synapse Router automatically determines the appropriate router for each Bridge t

* **[Synapse Router](/docs/Routers/Synapse-Router)** – Returns and executes quotes for supported interchain transactions.
* **[CCTP](/docs/Routers/CCTP)** – Native router for USDC transactions.
* **[RFQ](/docs/Routers/RFQ)** – Relayers bid for the right to provide immediate delivery.
* **[RFQ](/docs/RFQ)** – Relayers bid for the right to provide immediate delivery.

<figure id="flowGroup">
<figure>
Expand Down
2 changes: 1 addition & 1 deletion docs/bridge/docs/02-Bridge/01-SDK.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Use `bridgeQuote` to request a Bridge transaction

Returns an array all possible bridge quotes, with the first item in the array being the cheapest route.

Quotes are returned from various Bridge "types" such as [CCTP](/docs/Routers/CCTP) or [RFQ](/docs/Routers/RFQ). More information is available on the [Synapse Router](/docs/Routers/Synapse-Router) page, or [SynapseCNS](https://github.com/synapsecns/sdk-router) Github repository.
Quotes are returned from various Bridge "types" such as [CCTP](/docs/Routers/CCTP) or [RFQ](/docs/RFQ). More information is available on the [Synapse Router](/docs/Routers/Synapse-Router) page, or [SynapseCNS](https://github.com/synapsecns/sdk-router) Github repository.

## Examples

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
---
id: get-open-quote-requests
title: "Get open quote requests"
description: "Get all open quote requests that are currently in Received or Pending status."
sidebar_label: "Get open quote requests"
hide_title: true
hide_table_of_contents: true
api: eJytU01v2zAM/SsCz8pS7OhbD0MxDNiKfWGAERiMxNpqbUmh6LSG4f8+SE2WtvB22kkA+UQ+Pj7OYCkZdlFc8FDBDYnCvlchkleHMQgppsNISZKSDkUhkzIjM3npJ+W8+kqG3JGsCqxuyVvnW5UEZUzvQANTisEnSlDN8P7qKj+vO375BBo6QktcQL8219FtfhKnkn8Lv779qE5J9Xkc9sRqo74RKRtMUneB1RCYlPN3ATQk09GAuYpMkaCCJOx8C8uyaDDBC3nJWYyxdwZzj+19eu57+euEhsItcojE4p7HMUwoZBuUlQY685bGdOh84+wLhPNCLfEfiIQH8qsV6Ck6LqSaR+dteFyvEti1zjc4hNGvUzkh/k3mBPo7nTERN2gtU0prkupzJOzvyQhcAsiMUxa9gLBNUNVQ3JVgp2Eg6YKFCloS0BBROqhgmz3YFFRz9iBoKJvN6gcvaPK8uaaTPjcCDcezcyATiCHJgGUejwOdHL7ibtCvjTZf7PHfj+KkitCTbGOPzhd1uS8WK8PXsDb8TkMXkuT0PO8x0Q/ulyWHDyPxBFW903BEdrjPatS75XxZUNUzPNCUD8gYilnmI/ZjWc5b7y8vV3Lz4Tssy28PxXQw
sidebar_class_name: "get api-method"
custom_edit_url: null
---

import ApiTabs from "@theme/ApiTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import Heading from "@theme/Heading";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";

<Heading
as={"h1"}
className={"openapi__heading"}
children={"Get open quote requests"}
>
</Heading>

<MethodEndpoint
method={"get"}
path={"/open_quote_requests"}
context={"endpoint"}
>

</MethodEndpoint>



Get all open quote requests that are currently in Received or Pending status.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance the endpoint description

The current description is minimal. Consider adding:

  • Authentication requirements
  • Rate limiting information
  • Available query parameters for filtering/pagination

Example enhancement:

-Get all open quote requests that are currently in Received or Pending status.
+Get all open quote requests that are currently in Received or Pending status. This endpoint requires authentication and is rate-limited to X requests per minute. Use query parameters like `status`, `limit`, and `offset` to filter and paginate results.

Committable suggestion skipped: line range outside the PR's diff.


<div>
<div>
<ApiTabs
label={undefined}
id={undefined}
>
<TabItem
label={"200"}
value={"200"}
>
<div>


OK


</div><details
style={{"textAlign":"left","marginBottom":"1rem"}}
className={"openapi-markdown__details"}
data-collapsed={true}
open={false}
>
<summary
style={{}}
>
<strong>
Response Headers
</strong>
</summary><ul
style={{"marginLeft":"1rem"}}
>
<li
className={"schemaItem"}
>
<summary
style={{}}
>
<strong>
X-Api-Version
</strong><span
style={{"opacity":"0.6"}}
>
string
</span>
</summary><div>
<div
style={{"marginTop":".5rem","marginBottom":".5rem"}}
>


API Version Number - See docs for more info


</div>
</div>
</li>
</ul>
</details><div>
<MimeTabs
className={"openapi-tabs__mime"}
schemaType={"response"}
>
<TabItem
label={"application/json"}
value={"application/json"}
>
<SchemaTabs
className={"openapi-tabs__schema"}
>
<TabItem
label={"Schema"}
value={"Schema"}
>
<details
style={{}}
className={"openapi-markdown__details response"}
data-collapsed={false}
open={true}
>
<summary
style={{}}
className={"openapi-markdown__details-summary-response"}
>
<strong>
Schema
</strong>
</summary><div
style={{"textAlign":"left","marginLeft":"1rem"}}
>

</div><ul
style={{"marginLeft":"1rem"}}
>
<li>
<div
style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}
>
Array [
</div>
</li><SchemaItem
collapsible={false}
name={"created_at"}
required={false}
schemaName={"string"}
qualifierMessage={undefined}
schema={{"type":"string"}}
>

</SchemaItem><SchemaItem
collapsible={false}
name={"dest_chain_id"}
required={false}
schemaName={"integer"}
qualifierMessage={undefined}
schema={{"type":"integer"}}
>

</SchemaItem><SchemaItem
collapsible={false}
name={"dest_token"}
required={false}
schemaName={"string"}
qualifierMessage={undefined}
schema={{"type":"string"}}
>

</SchemaItem><SchemaItem
collapsible={false}
name={"expiration_window"}
required={false}
schemaName={"integer"}
qualifierMessage={undefined}
schema={{"type":"integer"}}
>

</SchemaItem><SchemaItem
collapsible={false}
name={"origin_amount"}
required={false}
schemaName={"string"}
qualifierMessage={undefined}
schema={{"type":"string"}}
>

</SchemaItem><SchemaItem
collapsible={false}
name={"origin_chain_id"}
required={false}
schemaName={"integer"}
qualifierMessage={undefined}
schema={{"type":"integer"}}
>

</SchemaItem><SchemaItem
collapsible={false}
name={"origin_token"}
required={false}
schemaName={"string"}
qualifierMessage={undefined}
schema={{"type":"string"}}
>

</SchemaItem><SchemaItem
collapsible={false}
name={"user_address"}
required={false}
schemaName={"string"}
qualifierMessage={undefined}
schema={{"type":"string"}}
>

</SchemaItem><li>
<div
style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}
>
]
</div>
</li>
</ul>
Comment on lines +144 to +223
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Based on the codebase analysis, I can now provide a final response:

Required fields should be marked as required in the API documentation

The API documentation should mark the following fields as required (required=true) as they are essential for the quote request functionality:

  • origin_chain_id
  • origin_token
  • dest_chain_id
  • dest_token
  • created_at

This is evidenced by:

  • The FastBridgeQuoteAPI type in the codebase showing these fields being used without optional markers
  • The API implementation in packages/sdk-router/src/rfq/api.ts expecting these fields to be present
  • Test cases in packages/sdk-router/src/rfq/api.test.ts always including these fields in the test data
🔗 Analysis chain

Review required fields in the response schema

The response schema marks all fields as optional (required=false). Please verify if some fields should be marked as required, especially essential fields like:

  • created_at
  • origin_chain_id
  • origin_token
  • origin_amount
  • user_address

Let me check the actual implementations to verify if these fields are required.


Let me try a different approach to find the type definitions.


Let me try one more search to find the quote request definitions.


Let me check the actual API implementation file.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for field usage in the codebase
# Look for references to these fields in related files
rg -l "created_at|origin_chain_id|origin_token|origin_amount|user_address" --type ts --type js

Length of output: 266


Script:

#!/bin/bash
# Check the quote type definitions and usage
ast-grep --pattern 'interface $_Quote {
  $$$
}'

# Also check the actual API implementation
ast-grep --pattern 'type $_QuoteRequest = {
  $$$
}'

Length of output: 105


Script:

#!/bin/bash
# Search for type definitions in the quote-related files we found earlier
rg -A 20 "type.*Quote|interface.*Quote" packages/sdk-router/src/rfq/quote.ts

# Also check the API implementation
rg -A 20 "type.*QuoteRequest|interface.*QuoteRequest" packages/sdk-router/src/rfq/api.test.ts

Length of output: 904


Script:

#!/bin/bash
# Search for quote request related content in the files
rg -A 10 "QuoteRequest|getOpenQuoteRequests" packages/sdk-router/src/rfq/quote.ts packages/sdk-router/src/rfq/api.test.ts

# Also check the API implementation file
cat packages/sdk-router/src/rfq/api.test.ts

Length of output: 3500


Script:

#!/bin/bash
# Check the API implementation
cat packages/sdk-router/src/rfq/api.ts

# Also search for any OpenQuoteRequest type definitions
rg -A 10 "OpenQuoteRequest" --type ts

Length of output: 1533

</details>
</TabItem><TabItem
label={"Example (from schema)"}
value={"Example (from schema)"}
>
<ResponseSamples
responseExample={"[\n {\n \"created_at\": \"string\",\n \"dest_chain_id\": 0,\n \"dest_token\": \"string\",\n \"expiration_window\": 0,\n \"origin_amount\": \"string\",\n \"origin_chain_id\": 0,\n \"origin_token\": \"string\",\n \"user_address\": \"string\"\n }\n]"}
language={"json"}
>

</ResponseSamples>
</TabItem>
</SchemaTabs>
</TabItem>
</MimeTabs>
</div>
</TabItem>
</ApiTabs>
</div>
</div>

Loading
Loading