8000 feat(rest-api,sdk-router): intent endpoint [SYN-77] by ChiTimesChi · Pull Request #3613 · synapsecns/sanguine · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(rest-api,sdk-router): intent endpoint [SYN-77] #3613

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

Merged
merged 14 commits into from
Mar 21, 2025

Conversation

ChiTimesChi
Copy link
Collaborator
@ChiTimesChi ChiTimesChi commented Mar 21, 2025

Description
A clear and concise description of the features you're adding in this pull request.

Additional context
Add any other context about the problem you're solving.

Metadata

  • Fixes #[Link to Issue]

Summary by CodeRabbit

  • New Features
    • Introduced a new API endpoint and SDK functionality for retrieving intent quotes for token transfers across chains.
    • Enhanced responses to support multiple module names, offering greater flexibility in quote details.
  • Documentation
    • Updated API specifications and examples to reflect the new module naming and endpoint structures.
  • Refactor
    • Streamlined swap engine naming and improved chain validation to aid smoother transaction processing.

Copy link
vercel bot commented Mar 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sanguine ❌ Failed (Inspect) Mar 21, 2025 6:01pm

Copy link
Contributor
coderabbitai bot commented Mar 21, 2025

Walkthrough

The changes add a new API endpoint for retrieving intent quotes for token transfers. On the client side, a new type and methods (e.g., GetIntent and its response parser) are introduced. The REST API now includes an intent controller and route with parameter validation, detailed OpenAPI documentation updates (renaming properties such as moduleName to moduleNames), and a new endpoint in the Swagger spec. Additional SDK enhancements include utility functions for chain ID validations, refined type definitions (e.g., introducing IntentStep), updated bridge and swap operations, and renaming of engine identifiers.

Changes

File(s) Change Summary
contrib/restclient/client.gen.go Added new GetIntentParams type, client methods (GetIntent, GetIntentWithResponse), new GetIntentResponse type, and a response parser function.
packages/rest-api/src/controllers/intentController.ts
packages/rest-api/src/routes/intentRoute.ts
packages/rest-api/src/routes/index.ts
Introduced a new intent controller and route to handle /intent requests with input validation and error handling; updated router configuration.
packages/rest-api/src/routes/bridgeV2Route.ts
packages/rest-api/src/routes/swapV2Route.ts
packages/rest-api/swagger.json
Modified OpenAPI documentation by replacing moduleName (string) with moduleNames (array of strings) and updated corresponding response examples.
packages/sdk-router/src/constants/chainIds.ts
packages/sdk-router/src/constants/medianTime.ts
packages/sdk-router/src/module/query.ts
Added new utility functions (isChainIdSupported, areIntentsSupported) and a new constant (MEDIAN_TIME_BLOCK); introduced a swap query detection helper.
packages/sdk-router/src/module/synapseModuleSet.ts
packages/sdk-router/src/module/types.ts
Updated types and documentation: made toToken optional, added allowMultipleTxs, replaced singular moduleName with moduleNames, and added new type IntentStep.
packages/sdk-router/src/operations/bridge.ts
packages/sdk-router/src/operations/intent.ts
packages/sdk-router/src/operations/swap.ts
packages/sdk-router/src/operations/index.ts
Enhanced bridge operations by introducing an internal parameter for transaction handling (allowMultipleTxs), added new intent operations to generate quotes (with same-chain and cross-chain flows), and exported intent functionalities.
packages/sdk-router/src/sdk.ts
packages/sdk-router/src/sir/synapseIntentRouterSet.ts
Added a new public property intent to the SDK and modified intent router set to build and return multiple module names.
packages/sdk-router/src/swap/core/__tests__/engineID.test.ts
packages/sdk-router/src/swap/core/engineID.ts
packages/sdk-router/src/swap/engines/defaultPoolsEngine.ts
packages/sdk-router/src/swap/engines/index.ts
packages/sdk-router/src/swap/models/priority.ts
packages/sdk-router/src/swap/swapEngineSet.ts
Renamed engine identifiers from Default to DefaultPools across tests, enum, engine classes, exports, and priority mappings to harmonize the naming convention.
packages/sdk-router/src/constants/addresses.ts Removed an outdated TODO comment regarding staging to production deployment.
packages/sdk-router/src/rfq/fastBridgeRouterSet.ts Updated method signatures and added error handling for validating chain IDs and modules, and made the tokenOut parameter optional in quote collection.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client Application
    participant RC as REST Client (GetIntent)
    participant HTTP as HTTP Transport
    participant Parser as Response Parser
    Client->>RC: Call GetIntent(ctx, params)
    RC->>HTTP: Construct request with NewGetIntentRequest
    HTTP-->>RC: Return HTTP response
    RC->>Parser: Invoke ParseGetIntentResponse
    Parser-->>RC: Return parsed GetIntentResponse
    RC-->>Client: Deliver GetIntentResponse
Loading
sequenceDiagram
    participant U as API User
    participant ER as Express Router (/intent)
    participant IC as IntentController
    participant SDK as SynapseSDK.intent()
    participant OPS as Intent Operations (_getSameChainIntentQuotes / _getCrossChainIntentQuotes)
    
    U->>ER: GET /intent with query params
    ER->>IC: Forward request to controller
    IC->>SDK: Call intent method with validated parameters
    SDK->>OPS: Determine same-chain or cross-chain flow
    OPS-->>SDK: Return sorted intent quotes
    SDK-->>IC: Return quotes to controller
    IC-->>ER: Send JSON response with intent quotes
    ER-->>U: HTTP response with intent quotes
Loading

Possibly related PRs

Poem

I'm a rabbit with a joyful beat,
Hopping through code with nimble feet,
Intent quotes and routes now shine bright,
With engines renamed and futures in sight,
ASCII carrots and bugs now flee,
Celebrating these changes in pure glee!
🥕🐰 Happy coding, let ideas run free!

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@gith
8000
ub-actions github-actions bot added go Pull requests that update Go code Sol Typescript size/l labels Mar 21, 2025
@ChiTimesChi ChiTimesChi changed the title feat(rest-api,sdk-router): intent endpoint feat(rest-api,sdk-router): intent endpoint [SYN-77] Mar 21, 2025
Copy link
codecov bot commented Mar 21, 2025

Codecov Report

Attention: Patch coverage is 7.07965% with 315 lines in your changes missing coverage. Please review.

Project coverage is 12.79437%. Comparing base (a60de09) to head (02b8196).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
contrib/restclient/client.gen.go 0.00000% 258 Missing ⚠️
packages/sdk-router/src/operations/intent.ts 22.58065% 24 Missing ⚠️
packages/sdk-router/src/operations/bridge.ts 21.05263% 15 Missing ⚠️
packages/sdk-router/src/rfq/fastBridgeRouterSet.ts 0.00000% 10 Missing ⚠️
packages/sdk-router/src/constants/chainIds.ts 50.00000% 2 Missing ⚠️
packages/sdk-router/src/module/query.ts 33.33333% 2 Missing ⚠️
packages/sdk-router/src/operations/swap.ts 33.33333% 2 Missing ⚠️
...kages/sdk-router/src/sir/synapseIntentRouterSet.ts 0.00000% 2 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##              master       #3613         +/-   ##
===================================================
- Coverage   12.87099%   12.79437%   -0.07663%     
===================================================
  Files            304         305          +1     
  Lines          33222       33546        +324     
  Branches         179         200         +21     
===================================================
+ Hits            4276        4292         +16     
- Misses         28461       28769        +308     
  Partials         485         485                 
Flag Coverage Δ
packages 69.16772% <29.62963%> (-2.13836%) ⬇️
restclient 0.80257% <0.00000%> (-0.05851%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 02b8196
Status: ✅  Deploy successful!
Preview URL: https://2432547d.sanguine-fe.pages.dev
Branch Preview URL: https://feat-intent-endpoint.sanguine-fe.pages.dev

View logs

Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (1)
packages/sdk-router/src/swap/engines/defaultPoolsEngine.ts (1)

107-107: 🛠️ Refactor suggestion

Error log still references old engine name

The error log message still references "DefaultEngine" despite the class being renamed to "DefaultPoolsEngine".

-      logger.error({ quote }, 'DefaultEngine: unexpected quote')
+      logger.error({ quote }, 'DefaultPoolsEngine: unexpected quote')
🧹 Nitpick comments (19)
packages/sdk-router/src/module/query.ts (1)

171-174: Add JSDoc comments and implement test coverage.

The new isSwapQuery function lacks JSDoc comments that would make it consistent with other functions in this file. Additionally, static analysis indicates that line 173 is not covered by unit tests.

+/**
+ * Determines if the query is a swap query.
+ *
+ * @param query - The query to check.
+ * @returns True if the query is a swap query, false otherwise.
+ */
export const isSwapQuery = (query: Query): boolean => {
  const adapterAddress = query.swapAdapter ?? query.routerAdapter
  return adapterAddress !== AddressZero
}
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 173-173: packages/sdk-router/src/module/query.ts#L173
Added line #L173 was not covered by tests

packages/sdk-router/src/operations/swap.ts (3)

38-39: Added new fields to SwapQuoteV2
Introducing estimatedTime and moduleNames allows the code to track multiple modules and approximate execution duration. Ensure clarity on whether estimatedTime represents seconds or another time unit.


73-75: Return empty quote for unsupported chains
This gracefully short-circuits the logic for chains that don't support intents. Consider returning an explicit error or indicating the chain is unsupported if that’s more transparent to callers.


126-127: Use chain-specific median block time
estimatedTime is assigned from MEDIAN_TIME_BLOCK[params.chainId]. If partial-second values are expected, clarify or convert it into a more standard measure (e.g., rounding to an integer).

packages/rest-api/src/controllers/intentController.ts (2)

16-37: Parameter extraction from req.query
De-structuring query parameters is clear. Consider adding further type checks or fallback defaults for optional fields when necessary.


77-91: Logging and error handling
Comprehensive logging ensures traceability. The 500 status code with a generic error message is standard practice, though consider returning a more descriptive error if feasible.

contrib/restclient/client.gen.go (8)

273-301: Add coverage for newly introduced parameters
GetIntentParams is a new struct, yet the static analyzer reports no test coverage for these lines. Please consider creating or extending test cases (for example, verifying how optional fields like AllowMultipleTxs and Slippage are handled).

Would you like me to draft a sample test function asserting correct query parameter serialization?


760-770: Consider status code checks
Currently, this client method returns the raw HTTP response without inspecting status codes. For better resiliency, you could check for 4xx/5xx codes and handle errors accordingly.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 760-769: contrib/restclient/client.gen.go#L760-L769
Added lines #L760 - L769 were not covered by tests


3124-3125: Clarify when multiple modules are used
Renaming from a singular to moduleNames indicates multi-module support. Please highlight this in your API docs or release notes so consumers know to expect arrays instead of single strings.


3676-3680: Guard against nil HTTPResponse
Although Status() delegates to HTTPResponse.Status, adding a fallback for a nil response could prevent potential panics.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 3676-3680: contrib/restclient/client.gen.go#L3676-L3680
Added lines #L3676 - L3680 were not covered by tests


3684-3688: Default code fallback
Similar to Status(), consider returning a safe default (e.g., 0) in StatusCode() if HTTPResponse is nil, ensuring consistent behavior.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 3684-3688: contrib/restclient/client.gen.go#L3684-L3688
Added lines #L3684 - L3688 were not covered by tests


4124-4125: Reflect multiple modules in documentation
With ModuleNames now treated as an array, confirm that the consumer docs and any clients can handle multiple module names gracefully.


4462-4467: Check all response outcomes
GetIntentWithResponse covers the happy path, but ensure 4xx/5xx results are also surfaced or handled. This can help callers avoid silent failures.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 4462-4467: contrib/restclient/client.gen.go#L4462-L4467
Added lines #L4462 - L4467 were not covered by tests


5417-5539: Add catch-all for unexpected statuses
ParseGetIntentResponse does a good job of checking known statuses. For better maintainability, a catch-all or default branch can help detect unrecognized error codes more gracefully.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 5417-5422: contrib/restclient/client.gen.go#L5417-L5422
Added lines #L5417 - L5422 were not covered by tests


[warning] 5424-5510: contrib/restclient/client.gen.go#L5424-L5510
Added lines #L5424 - L5510 were not covered by tests


[warning] 5512-5524: contrib/restclient/client.gen.go#L5512-L5524
Added lines #L5512 - L5524 were not covered by tests


[warning] 5526-5533: contrib/restclient/client.gen.go#L5526-L5533
Added lines #L5526 - L5533 were not covered by tests


[warning] 5537-5537: contrib/restclient/client.gen.go#L5537
Added line #L5537 was not covered by tests

packages/sdk-router/src/operations/intent.ts (5)

5-10: Consider centralizing import paths.

Having multiple imports referencing various internal folders (../module, ../sdk, ../swap, ./bridge, ./swap, ../utils) is acceptable, but you may want to consider centralizing or organizing imports and exports in a dedicated index barrel file for improved readability and maintainability.


12-23: Add validation checks on user inputs.

IntentParameters includes optional fields like fromSender, toRecipient, slippage, deadline, and allowMultipleTxs. If these fields are critical for certain workflow behaviors, consider adding internal validations (e.g., checking if slippage is a reasonable percentage, verifying that deadline is in the future, etc.) to prevent invalid or malicious parameters.


25-36: Provide clarity on expectedTime measurement.

In IntentQuote, the estimatedTime field is included but not fully documented. It would be helpful to indicate what this time measurement represents (e.g., seconds or milliseconds) to avoid confusion for consumers of this SDK.


47-87: Add more robust handling for zero or undefined quotes.

_getSameChainIntentQuotes currently returns an empty array if swapQuote is falsy or expectedToAmount.isZero(). This prevents generating invalid quotes, which is good. However, consider logging or counting how often these scenarios arise, especially if a zero-amount quote might indicate unexpected behavior in upstream logic (e.g., insufficient liquidity).


160-161: Double-check aggregated time calculation.

estimatedTime: bridgeQuote.estimatedTime + swapQuote.estimatedTime is a simple sum of two times. This is okay as a rough total. However, transit times may be non-linear or have overlap. Consider clarifying or refining the timing model if more accurate or separate time calculations are needed.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7f6c7e and 02b8196.

📒 Files selected for processing (26)
  • contrib/restclient/client.gen.go (12 hunks)
  • packages/rest-api/src/controllers/intentController.ts (1 hunks)
  • packages/rest-api/src/routes/bridgeV2Route.ts (2 hunks)
  • packages/rest-api/src/routes/index.ts (1 hunks)
  • packages/rest-api/src/routes/intentRoute.ts (1 hunks)
  • packages/rest-api/src/routes/swapV2Route.ts (2 hunks)
  • packages/rest-api/swagger.json (5 hunks)
  • packages/sdk-router/src/constants/addresses.ts (0 hunks)
  • packages/sdk-router/src/constants/chainIds.ts (1 hunks)
  • packages/sdk-router/src/constants/medianTime.ts (1 hunks)
  • packages/sdk-router/src/module/query.ts (1 hunks)
  • packages/sdk-router/src/module/synapseModuleSet.ts (3 hunks)
  • packages/sdk-router/src/module/types.ts (2 hunks)
  • packages/sdk-router/src/operations/bridge.ts (7 hunks)
  • packages/sdk-router/src/operations/index.ts (1 hunks)
  • packages/sdk-router/src/operations/intent.ts (1 hunks)
  • packages/sdk-router/src/operations/swap.ts (5 hunks)
  • packages/sdk-router/src/rfq/fastBridgeRouterSet.ts (4 hunks)
  • packages/sdk-router/src/sdk.ts (1 hunks)
  • packages/sdk-router/src/sir/synapseIntentRouterSet.ts (3 hunks)
  • packages/sdk-router/src/swap/core/__tests__/engineID.test.ts (1 hunks)
  • packages/sdk-router/src/swap/core/engineID.ts (1 hunks)
  • packages/sdk-router/src/swap/engines/defaultPoolsEngine.ts (3 hunks)
  • packages/sdk-router/src/swap/engines/index.ts (1 hunks)
  • packages/sdk-router/src/swap/models/priority.ts (1 hunks)
  • packages/sdk-router/src/swap/swapEngineSet.ts (2 hunks)
💤 Files with no reviewable changes (1)
  • packages/sdk-router/src/constants/addresses.ts
🧰 Additional context used
🧬 Code Definitions (6)
packages/sdk-router/src/swap/core/__tests__/engineID.test.ts (1)
packages/sdk-router/src/swap/core/engineID.ts (1) (1)
  • validateEngineID (10-12)
packages/sdk-router/src/constants/chainIds.ts (1)
packages/rest-api/src/constants/index.ts (1) (1)
  • INTENTS_SUPPORTED_CHAIN_IDS (3-3)
packages/sdk-router/src/operations/swap.ts (2)
packages/sdk-router/src/constants/chainIds.ts (1) (1)
  • areIntentsSupported (136-138)
packages/sdk-router/src/constants/medianTime.ts (1) (1)
  • MEDIAN_TIME_BLOCK (7-34)
packages/sdk-router/src/module/synapseModuleSet.ts (3)
packages/sdk-router/src/module/types.ts (2) (2)
  • BridgeTokenCandidate (85-90)
  • BridgeRouteV2 (92-99)
packages/sdk-router/src/swap/core/slippage.ts (1) (1)
  • Slippage (4-7)
packages/sdk-router/src/operations/bridge.ts (1) (1)
  • bridgeQuote (350-374)
packages/sdk-router/src/operations/bridge.ts (5)
packages/sdk-router/src/utils/types.ts (1) (1)
  • Prettify (24-26)
packages/sdk-router/src/sdk.ts (1) (1)
  • SynapseSDK (101-101)
packages/sdk-router/src/module/types.ts (1) (1)
  • BridgeQuoteV2 (115-129)
packages/sdk-router/src/constants/chainIds.ts (2) (2)
  • isChainIdSupported (130-134)
  • areIntentsSupported (136-138)
packages/sdk-router/src/module/query.ts (1) (1)
  • isSwapQuery (171-174)
packages/sdk-router/src/swap/swapEngineSet.ts (1)
packages/sdk-router/src/swap/engines/defaultPoolsEngine.ts (1) (1)
  • DefaultPoolsEngine (22-112)
🪛 GitHub Check: codecov/patch
packages/sdk-router/src/module/query.ts

[warning] 173-173: packages/sdk-router/src/module/query.ts#L173
Added line #L173 was not covered by tests

packages/sdk-router/src/constants/chainIds.ts

[warning] 138-138: packages/sdk-router/src/constants/chainIds.ts#L138
Added line #L138 was not covered by tests

packages/sdk-router/src/operations/bridge.ts

[warning] 57-57: packages/sdk-router/src/operations/bridge.ts#L57
Added line #L57 was not covered by tests


[warning] 88-88: packages/sdk-router/src/operations/bridge.ts#L88
Added line #L88 was not covered by tests

contrib/restclient/client.gen.go

[warning] 760-769: contrib/restclient/client.gen.go#L760-L769
Added lines #L760 - L769 were not covered by tests


[warning] 1840-1846: contrib/restclient/client.gen.go#L1840-L1846
Added lines #L1840 - L1846 were not covered by tests


[warning] 1848-1851: contrib/restclient/client.gen.go#L1848-L1851
Added lines #L1848 - L1851 were not covered by tests


[warning] 1853-1856: contrib/restclient/client.gen.go#L1853-L1856
Added lines #L1853 - L1856 were not covered by tests


[warning] 1858-1869: contrib/restclient/client.gen.go#L1858-L1869
Added lines #L1858 - L1869 were not covered by tests


[warning] 1873-1881: contrib/restclient/client.gen.go#L1873-L1881
Added lines #L1873 - L1881 were not covered by tests


[warning] 1885-1893: contrib/restclient/client.gen.go#L1885-L1893
Added lines #L1885 - L1893 were not covered by tests


[warning] 1897-1907: contrib/restclient/client.gen.go#L1897-L1907
Added lines #L1897 - L1907 were not covered by tests


[warning] 1913-1921: contrib/restclient/client.gen.go#L1913-L1921
Added lines #L1913 - L1921 were not covered by tests


[warning] 1925-1933: contrib/restclient/client.gen.go#L1925-L1933
Added lines #L1925 - L1933 were not covered by tests


[warning] 1937-1947: contrib/restclient/client.gen.go#L1937-L1947
Added lines #L1937 - L1947 were not covered by tests


[warning] 1953-1963: contrib/restclient/client.gen.go#L1953-L1963
Added lines #L1953 - L1963 were not covered by tests


[warning] 1969-1979: contrib/restclient/client.gen.go#L1969-L1979
Added lines #L1969 - L1979 were not covered by tests


[warning] 1985-1985: contrib/restclient/client.gen.go#L1985
Added line #L1985 was not covered by tests


[warning] 1988-1991: contrib/restclient/client.gen.go#L1988-L1991
Added lines #L1988 - L1991 were not covered by tests


[warning] 1993-1993: contrib/restclient/client.gen.go#L1993
Added line #L1993 was not covered by tests


[warning] 3676-3680: contrib/restclient/client.gen.go#L3676-L3680
Added lines #L3676 - L3680 were not covered by tests


[warning] 3684-3688: contrib/restclient/client.gen.go#L3684-L3688
Added lines #L3684 - L3688 were not covered by tests


[warning] 4462-4467: contrib/restclient/client.gen.go#L4462-L4467
Added lines #L4462 - L4467 were not covered by tests


[warning] 4837-4838: contrib/restclient/client.gen.go#L4837-L4838
Added lines #L4837 - L4838 were not covered by tests


[warning] 5417-5422: contrib/restclient/client.gen.go#L5417-L5422
Added lines #L5417 - L5422 were not covered by tests


[warning] 5424-5510: contrib/restclient/client.gen.go#L5424-L5510
Added lines #L5424 - L5510 were not covered by tests


[warning] 5512-5524: contrib/restclient/client.gen.go#L5512-L5524
Added lines #L5512 - L5524 were not covered by tests


[warning] 5526-5533: contrib/restclient/client.gen.go#L5526-L5533
Added lines #L5526 - L5533 were not covered by tests


[warning] 5537-5537: contrib/restclient/client.gen.go#L5537
Added line #L5537 was not covered by tests


[warning] 6108-6109: contrib/restclient/client.gen.go#L6108-L6109
Added lines #L6108 - L6109 were not covered by tests

🪛 Gitleaks (8.21.2)
packages/rest-api/swagger.json

1642-1642: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1645-1645: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1652-1652: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1655-1655: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (66)
packages/sdk-router/src/swap/models/priority.ts (1)

21-21: Engine ID key updated in priority configuration

The engine priority configuration has been updated to use the renamed EngineID.DefaultPools key instead of EngineID.Default, while maintaining the same priority value. This ensures that the priority system continues to work correctly with the renamed engine.

packages/sdk-router/src/swap/swapEngineSet.ts (2)

8-8: Import statement correctly updated to reflect engine rename

The import statement has been appropriately updated to reference DefaultPoolsEngine which aligns with the class name changes in the codebase.


54-54: Class instantiation updated to match renamed engine

The engine instantiation has been correctly updated to use DefaultPoolsEngine instead of DefaultEngine, maintaining consistency with the renamed class.

packages/sdk-router/src/swap/engines/defaultPoolsEngine.ts (3)

22-22: Class name updated from DefaultEngine to DefaultPoolsEngine

The class has been appropriately renamed to better reflect its purpose of working with pools.


25-25: Engine ID updated to match new name

The engine ID has been correctly updated from EngineID.Default to EngineID.DefaultPools to maintain consistency with the class rename.


35-35: References to static interface updated

References to the static previewerInterface have been properly updated to use the new class name.

Also applies to: 52-53

packages/sdk-router/src/swap/core/engineID.ts (1)

4-4:

✅ Verification successful

Rename enum value for clarity

Renaming Default to DefaultPools provides more descriptive naming that better indicates the purpose of this engine ID. This is a good improvement for code readability and maintainability.


🏁 Script executed:

#!/bin/bash
# Verify that all references to the old enum value have been updated
echo "Checking for any remaining references to EngineID.Default that might have been missed..."
rg "EngineID\.Default" --type ts

Length of output: 652


Enum Value Renaming Verified – No Remaining References to EngineID.Default

The renaming change from Default to DefaultPools has been successfully propagated throughout the codebase. All occurrences now correctly reference EngineID.DefaultPools (as verified in the following files):

  • packages/sdk-router/src/swap/models/priority.ts
  • packages/sdk-router/src/swap/engines/defaultPoolsEngine.ts
  • packages/sdk-router/src/operations/bridge.ts
  • packages/sdk-router/src/swap/core/__tests__/engineID.test.ts

This improvement enhances code readability and maintainability.

packages/sdk-router/src/swap/core/__tests__/engineID.test.ts (1)

7-7: Correctly updated test case for renamed enum value

The test case has been properly updated to validate the renamed enum value EngineID.DefaultPools instead of the previous value. This change maintains test coverage while aligning with the enum update.

packages/sdk-router/src/swap/engines/index.ts (1)

1-1:

✅ Verification successful

Updated export path for renamed module

The export path has been correctly updated to point to the renamed module ./defaultPoolsEngine instead of the previous ./defaultEngine. This ensures consistent renaming throughout the codebase.


🏁 Script executed:

#!/bin/bash
# Verify that the defaultPoolsEngine.ts file exists and defaultEngine.ts is either removed or renamed
echo "Checking for the existence of the new and old engine files..."
find packages/sdk-router/src/swap/engines -name "defaultPoolsEngine.ts" -o -name "defaultEngine.ts"

# Check if there are any imports referring to the old file path
echo "Checking for any imports still referring to the old file path..."
rg "from ['\"]\.{1,2}/.*defaultEngine['\"]" --type ts

Length of output: 488


Export Path Verification Complete

The updated export path now correctly references the renamed module alongside the confirmed existence of packages/sdk-router/src/swap/engines/defaultPoolsEngine.ts. No references to the old module (defaultEngine) were detected in the TypeScript imports.

  • Verified that defaultPoolsEngine.ts exists.
  • Confirmed that no file or import paths reference defaultEngine.
packages/sdk-router/src/operations/index.ts (1)

2-2: LGTM!

This addition exports the new intent functionality, making it accessible as part of the public API.

packages/rest-api/src/routes/index.ts (1)

18-18: LGTM!

The import and route integration for the new intent endpoint follow the established pattern in the codebase.

Also applies to: 23-23

packages/sdk-router/src/constants/medianTime.ts (1)

3-34: LGTM!

The new constant is well-documented and provides comprehensive coverage of block production times across all supported chains, which will help in providing accurate time estimates for operations.

packages/sdk-router/src/sdk.ts (1)

66-66: Addition of intent property looks good.

The new property follows the existing pattern of exposing operations directly from the SDK class. This is consistent with other public properties like bridge, bridgeV2, etc.

packages/rest-api/src/routes/swapV2Route.ts (2)

89-93: OpenAPI documentation updates look good.

The change from moduleName (singular) to moduleNames (array of strings) in the documentation properly reflects that multiple swap modules can be used for a quote.


117-117: Example value update is consistent with the property change.

The example has been updated to show moduleNames as an array with a single value "DefaultPools", which aligns with the schema definition change.

packages/sdk-router/src/constants/chainIds.ts (1)

130-134: Utility function addition looks good.

The isChainIdSupported function provides a useful type predicate to verify if a chainId is supported, checking both the inclusion in SupportedChainId enum and ensuring it's not in the paused list.

packages/rest-api/src/routes/bridgeV2Route.ts (2)

111-115: OpenAPI documentation updates for bridge endpoint look good.

The change from moduleName to moduleNames as an array type is consistent with the updates in the swap endpoint documentation and improves the API by supporting multiple modules per quote.


144-144: Example value update is consistent with the schema change.

The example has been updated to show moduleNames as an array with a value of ["SynapseRFQ"], which properly aligns with the schema definition.

packages/sdk-router/src/sir/synapseIntentRouterSet.ts (3)

57-57: Initialize array for multiple modules
This adds support for collecting the names of multiple modules. Good improvement for multi-module bridging.


66-66: Verify usage of engineName
If there’s any possibility that originSwapRoute.engineName is undefined, consider guarding this push operation. Otherwise, this approach is well-structured.


97-97: Replacing moduleName with moduleNames
Switching to an array fosters extensibility for bridging or swapping across multiple modules. This aligns with the new approach across the codebase.

packages/sdk-router/src/operations/swap.ts (2)

7-7: Imports for chain support checks
Importing areIntentsSupported and MEDIAN_TIME_BLOCK broadens functionality for chain-specific features.


63-64: Initialize empty arrays in fallback
Using an empty array for moduleNames and zero for estimatedTime ensures consistent object shape for uninitialized quotes.

packages/rest-api/src/controllers/intentController.ts (3)

1-9: Initial imports
Imports for express-validator, Synapse, and logging are well-structured. The usage of constants and utility functions indicates a well-organized approach.


11-15: Validation error handling
Returning a 400 with errors.array() is a clear pattern. Good approach to early-exit on invalid requests.


39-76: Converting slippage to basis points & calling Synapse.intent
This logic is straightforward and reuses known constants (DEFAULT_SWAP_SLIPPAGE_BIPS, SLIPPAGE_BIPS_DENOMINATOR). All bigger request parameters are passed to Synapse.intent. The BigNumber to string conversion and JSON response are well-handled.

packages/rest-api/src/routes/intentRoute.ts (5)

1-4: Importing express and express-validator
Essential for route definitions and request validation.


5-10: Middleware and services
Includes the required middlewares like checksumAddresses and normalizeNativeTokenAddress, ensuring addresses are validated and normalized. This is a good practice for consistent address handling.


14-197: OpenAPI documentation
Providing a comprehensive doc block describing the endpoint, parameters, and example responses ensures clarity for integrators.


238-296: GET /intent route
The combined validation checks for chain IDs, token addresses, slippage, and optional fields. This thorough approach significantly reduces invalid calls. Great job integrating with showFirstValidationError.


298-299: Named Export for router
Exporting as the default simplifies usage in index.ts. This is consistent with typical Express router design.

packages/sdk-router/src/module/synapseModuleSet.ts (4)

19-32: Documentation improvements and parameter update for getBridgeTokenCandidates

Good work adding JSDoc comments to clearly document the GetBridgeTokenCandidatesParameters type. Making toToken optional is a sensible enhancement that allows for more flexible use cases where the destination token isn't known upfront.


34-54: Comprehensive documentation and support for multi-transaction bridges

The added JSDoc comments for GetBridgeRouteV2Parameters are clear and informative. The new allowMultipleTxs parameter is a valuable addition that provides flexibility for complex bridging scenarios.


304-317: Updated moduleNames handling in finalizeBridgeQuoteV2

The function now collects multiple module names in an array rather than using a single module name. This aligns with the change to BridgeQuoteV2 type in types.ts.


140-161:

❓ Verification inconclusive

Updated documentation and return type change for getBridgeRouteV2

The function now returns Promise<BridgeRouteV2 | undefined> instead of just Promise<BridgeRouteV2>. This is a meaningful API change that allows the method to signal when no valid route is found.

This change to the return type is a potentially breaking change. Please ensure that all consumers of this API handle the case where undefined is returned.


🏁 Script executed:

#!/bin/bash
# Check for places where getBridgeRouteV2 is called and might not handle undefined
rg "getBridgeRouteV2\(" --type=ts -A 5 -B 5 | grep -v "undefined" | grep -e "=" -e "return"

Length of output: 459


Action Required: Verify Handling of Undefined in getBridgeRouteV2 Consumers

The updated documentation now correctly reflects that getBridgeRouteV2 returns a Promise<BridgeRouteV2 | undefined>, signaling the possibility of a missing route. However, our grep search indicates that several consumers (e.g., in packages/sdk-router/src/operations/bridge.ts) invoke this API without an explicit check for an undefined result. Additionally, other modules such as those in the router sets are returning fallback empty arrays, which may not be sufficient handling.

  • Review the consumer in packages/sdk-router/src/operations/bridge.ts to ensure that it properly tests for an undefined return before proceeding.
  • Double-check similar patterns in modules like synapseRouterSet.ts, gasZipModuleSet.ts, and synapseCCTPRouterSet.ts to verify that the potential absence of a route is handled correctly.

Please verify and update the usage across the codebase as needed to ensure robust handling of the new return type.

packages/sdk-router/src/module/types.ts (2)

101-129: Updated BridgeQuoteV2 type with moduleNames and additional properties

The changes to BridgeQuoteV2:

  1. Replace moduleName: string with moduleNames: string[] to support multiple modules
  2. Add gasDropAmount: BigNumber
  3. Add optional tx?: PopulatedTransaction

These changes enhance the flexibility of the bridge quote system while maintaining clear documentation.


131-160: New IntentStep type for atomic intent operations

The introduction of the IntentStep type is well-structured and thoroughly documented. This type appears to be a key component for the new intent endpoint mentioned in the PR title.

Some observations:

  • It shares several fields with BridgeQuoteV2 but is structured to represent a single atomic operation
  • The design supports both cross-chain (different fromChainId and toChainId) and same-chain operations
  • The inclusion of moduleNames as an array aligns with the updates to BridgeQuoteV2
contrib/restclient/client.gen.go (5)

521-523: Interface method looks consistent
The newly added GetIntent method is aligned with other client methods. Ensure that all downstream users are updated to call this method where necessary.


1840-1994: Query parameter builder
NewGetIntentRequest accurately maps struct fields to query parameters. No significant issues found.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 1840-1846: contrib/restclient/client.gen.go#L1840-L1846
Added lines #L1840 - L1846 were not covered by tests


[warning] 1848-1851: contrib/restclient/client.gen.go#L1848-L1851
Added lines #L1848 - L1851 were not covered by tests


[warning] 1853-1856: contrib/restclient/client.gen.go#L1853-L1856
Added lines #L1853 - L1856 were not covered by tests


[warning] 1858-1869: contrib/restclient/client.gen.go#L1858-L1869
Added lines #L1858 - L1869 were not covered by tests


[warning] 1873-1881: contrib/restclient/client.gen.go#L1873-L1881
Added lines #L1873 - L1881 were not covered by tests


[warning] 1885-1893: contrib/restclient/client.gen.go#L1885-L1893
Added lines #L1885 - L1893 were not covered by tests


[warning] 1897-1907: contrib/restclient/client.gen.go#L1897-L1907
Added lines #L1897 - L1907 were not covered by tests


[warning] 1913-1921: contrib/restclient/client.gen.go#L1913-L1921
Added lines #L1913 - L1921 were not covered by tests


[warning] 1925-1933: contrib/restclient/client.gen.go#L1925-L1933
Added lines #L1925 - L1933 were not covered by tests


[warning] 1937-1947: contrib/restclient/client.gen.go#L1937-L1947
Added lines #L1937 - L1947 were not covered by tests


[warning] 1953-1963: contrib/restclient/client.gen.go#L1953-L1963
Added lines #L1953 - L1963 were not covered by tests


[warning] 1969-1979: contrib/restclient/client.gen.go#L1969-L1979
Added lines #L1969 - L1979 were not covered by tests


[warning] 1985-1985: contrib/restclient/client.gen.go#L1985
Added line #L1985 was not covered by tests


[warning] 1988-1991: contrib/restclient/client.gen.go#L1988-L1991
Added lines #L1988 - L1991 were not covered by tests


[warning] 1993-1993: contrib/restclient/client.gen.go#L1993
Added line #L1993 was not covered by tests


3583-3673: Enhance coverage for response parsing
GetIntentResponse appears to have no direct tests. Consider adding test scenarios for 200, 400, and 500 responses to verify correct parsing of fields like Steps and MinToAmount.


4837-4838: Ensure robust parsing of ModuleNames
Within parseGetBridgeV2Response, confirm it safely handles an empty list or absent property (in case moduleNames is not returned by the server).

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 4837-4838: contrib/restclient/client.gen.go#L4837-L4838
Added lines #L4837 - L4838 were not covered by tests


6108-6109: Handle ModuleNames arrays
When parsing ModuleNames in parseGetSwapV2Response, confirm that multiple swap modules or an empty list are processed without issue.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 6108-6109: contrib/restclient/client.gen.go#L6108-L6109
Added lines #L6108 - L6109 were not covered by tests

packages/rest-api/swagger.json (3)

147-153: Support for multiple modules
This change from a single "moduleName" property to "moduleNames" allows specifying multiple modules for a given quote, which is more flexible and extensible.


1427-1736: Add test coverage for the new /intent endpoint
A new endpoint has been introduced for retrieving intent quotes. Please consider adding test coverage (integration or unit tests) to verify parameter validation, error handling, and response correctness. This helps ensure reliable behavior and detect regressions early.

🧰 Tools
🪛 Gitleaks (8.21.2)

1642-1642: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1645-1645: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1652-1652: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1655-1655: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


2006-2012: Transition to an array-based module listing
Renaming "moduleName" to "moduleNames" is aligned with the multi-module approach observed in other parts of the codebase. This change looks consistent and well-structured.

packages/sdk-router/src/rfq/fastBridgeRouterSet.ts (5)

98-100: Graceful fallback for unsupported chains
Returning an empty array when either chain is not supported prevents errors and makes the function more robust.


123-130: Validation ensures both chains are supported for bridging
These checks confirm that the router modules exist on both the origin and destination chains, and also enforce single-transaction flows if multipleTxs is disallowed.


156-158: Early exit on zero expected amount
Returning undefined if expectedToAmount is zero is a logical way to handle routes that won’t yield any usable tokens on the destination chain.


404-405: Optional final token parameter
Making tokenOut optional here matches scenarios where multi-step transactions or flexible output tokens are allowed. No concerns identified.


409-421: Improved filtering with isSameAddress
The use of isSameAddress for comparing FastBridge addresses and optional tokens ensures case-insensitive and format-agnostic checks. This promotes correctness across chain addresses.

packages/sdk-router/src/operations/bridge.ts (14)

4-4: Imported chain ID checks
Adding areIntentsSupported and isChainIdSupported provides consistent validation mechanisms for bridging flows.


11-11: Importing isSwapQuery
Including isSwapQuery broadens the code’s ability to differentiate swap-based routes from direct bridging operations.


14-20: Additional swap-related imports
Bringing in new swap types and constants (e.g., EngineID, RouteInput) lays the groundwork for more cohesive bridging and swapping integrations.


21-21: Utility import for Prettify
Using Prettify<T> helps maintain type clarity in the new bridging parameters.


48-50: New BridgeV2InternalParameters
Extending BridgeV2Parameters with an optional allowMultipleTxs accommodates more complex bridging scenarios.


55-58: Add test coverage for _bridgeV2Internal usage
Line 57 is flagged for lacking coverage. Consider adding a test case covering this scenario, ensuring that allowMultipleTxs is enforced as intended.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 57-57: packages/sdk-router/src/operations/bridge.ts#L57
Added line #L57 was not covered by tests


60-63: Internal bridging function
_bridgeV2Internal centralizes bridging logic while supporting multi-transaction flows. This separation of concerns is a good design choice.


84-89: Check if both chains are supported
The fallback returning an empty list if fromChainId or toChainId is unsupported is correct. Also note line 88 is missing unit test coverage; embedding a test ensures reliability.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 88-88: packages/sdk-router/src/operations/bridge.ts#L88
Added line #L88 was not covered by tests


126-129: Dynamically append swap module
Conditionally adding the swap engine name for origin query fosters more flexible route creation.


165-171: Intents must be supported on fromChain
Verifying areIntentsSupported for the origin chain and isChainIdSupported for the destination chain avoids invalid bridging attempts.


182-182: Conditionally unset toToken
By assigning toToken = undefined when multiple transactions are permitted, the logic can compile multi-step routes freely.


238-239: Propagating multi-tx option
Forwarding allowMultipleTxs into the bridging route ensures the final bridging step respects multi-tx constraints.


241-243: Safe return on missing route
Opting out early when the bridge route is undefined prevents further processing on invalid flows.


245-250: Ensuring final token match
If allowMultipleTxs is false, verifying the final token matches params.toToken helps enforce single-step bridging integrity.

packages/sdk-router/src/operations/intent.ts (2)

38-45: Validate cross-chain vs. same-chain decision logic.

Using params.fromChainId === params.toChainId to decide which function to call is straightforward. However, consider the scenario in which the chain IDs match but the swap logic still needs bridging (unusual, but theoretically possible). If you anticipate that scenario, add an additional check or documentation clarifying that bridging is strictly disabled for same-chain quotes.


85-85: Address TODO on returning multiple quotes.

The comment “// TODO: do we need to return multiple quotes?” suggests uncertainty about whether multiple swap routes should be presented. If there's a valid use case for returning multiple same-chain quotes to the caller, consider implementing that logic or removing the comment once you've finalized your design choice.

Comment on lines +136 to +138
export const areIntentsSupported = (
chainId: number
): chainId is SupportedChainId => INTENTS_SUPPORTED_CHAIN_IDS.includes(chainId)
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

Add test coverage for the areIntentsSupported function.

The function looks well-implemented, but static analysis shows it lacks test coverage. Consider adding unit tests to ensure proper behavior across different chainId values.


🏁 Script executed:

#!/bin/bash
# Check if there are tests for the areIntentsSupported function
grep -r "areIntentsSupported" --include="*.test.ts" --include="*.spec.ts" .

Length of output: 75


ACTION REQUIRED: Add Unit Tests for areIntentsSupported

The function in packages/sdk-router/src/constants/chainIds.ts currently has no test coverage. Automated search for tests (using patterns in *.test.ts and *.spec.ts files) did not yield any results. Please add unit tests that verify:

  • It returns true for chain IDs that are included in the INTENTS_SUPPORTED_CHAIN_IDS array.
  • It returns false for chain IDs that are not included.

This will help ensure the function behaves correctly across different input scenarios.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 138-138: packages/sdk-router/src/constants/chainIds.ts#L138
Added line #L138 was not covered by tests

Comment on lines +89 to +171
6D40
async function _getCrossChainIntentQuotes(
this: SynapseSDK,
params: IntentParameters
): Promise<IntentQuote[]> {
// First, collect V2 quotes into either the requested token (can fallback to the bridge token if not available).
const toRecipient = params.toRecipient || params.fromSender
const bridgeQuotes = await _bridgeV2Internal.call(this, {
fromChainId: params.fromChainId,
toChainId: params.toChainId,
fromToken: params.fromToken,
toToken: params.toToken,
fromAmount: params.fromAmount,
fromSender: params.fromSender,
toRecipient,
slippage: params.slippage,
deadline: params.deadline,
allowMultipleTxs: params.allowMultipleTxs,
})

// Then, iterate over the quotes and add the swap step, if needed.
const intentQuotes: IntentQuote[][] = await Promise.all(
bridgeQuotes.map(async (bridgeQuote) => {
const id = uuidv7()
const intentCommon = {
fromChainId: params.fromChainId,
fromToken: params.fromToken,
fromAmount: BigNumber.from(params.fromAmount),
toChainId: params.toChainId,
}
const bridgeStep: IntentStep = {
...intentCommon,
toToken: bridgeQuote.toToken,
expectedToAmount: bridgeQuote.expectedToAmount,
minToAmount: bridgeQuote.minToAmount,
routerAddress: bridgeQuote.routerAddress,
estimatedTime: bridgeQuote.estimatedTime,
moduleNames: bridgeQuote.moduleNames,
gasDropAmount: bridgeQuote.gasDropAmount,
tx: bridgeQuote.tx,
}
// Check if the token out is the same as the requested token out.
if (isSameAddress(params.toToken, bridgeQuote.toToken)) {
const intentQuote: IntentQuote = {
id,
...intentCommon,
toToken: params.toToken,
expectedToAmount: bridgeQuote.expectedToAmount,
minToAmount: bridgeQuote.minToAmount,
estimatedTime: bridgeQuote.estimatedTime,
steps: [bridgeStep],
}
return [intentQuote]
}
// Otherwise we need to find a swap quote between the bridge token and the requested token out on the destination chain.
const swapQuotes = await _getSameChainIntentQuotes.call(this, {
fromChainId: params.toChainId,
fromToken: bridgeQuote.toToken,
fromAmount: bridgeQuote.expectedToAmount,
fromSender: toRecipient,
toChainId: params.toChainId,
toToken: params.toToken,
toRecipient,
slippage: params.slippage,
})
return swapQuotes.map((swapQuote) => {
const intentQuote: IntentQuote = {
id,
...intentCommon,
toToken: params.toToken,
expectedToAmount: swapQuote.expectedToAmount,
minToAmount: swapQuote.minToAmount,
estimatedTime: bridgeQuote.estimatedTime + swapQuote.estimatedTime,
steps: [bridgeStep, ...swapQuote.steps],
}
return intentQuote
})
})
)
// Flatten the quotes and sort them by expectedToAmount in descending order
return intentQuotes
.flat()
.sort((a, b) => (a.expectedToAmount.gte(b.expectedToAmount) ? -1 : 1))
}
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

Ensure error handling for partial or failed cross-chain steps.

When bridging and then swapping cross-chain, _getCrossChainIntentQuotes handles each quote via Promise.all(). If an individual quote unexpectedly fails (e.g., RPC error, liquidity error), it returns an empty sub-array or short-circuits. You might want to consider graceful error recovery or logging for each failure scenario, helping you or end users debug issues in bridging or swapping flows.

@ChiTimesChi ChiTimesChi merged commit f2616f1 into master Mar 21, 2025
37 of 39 checks passed
@ChiTimesChi ChiTimesChi deleted the feat/intent-endpoint branch March 21, 2025 19:56
Copy link
codecov bot commented Mar 21, 2025

Bundle Report

Changes will increase total bundle size by 305.44kB (0.95%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sdk-router-@synapsecns/sdk-router-esm 366.33kB 20.9kB (6.05%) ⬆️
sdk-router-@synapsecns/sdk-router-cjs 164.63kB 6.72kB (4.26%) ⬆️
widget-esm-cjs 277.82kB 277.82kB (100%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: explorer-ui-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
server/middleware-*.js -4.0kB 36 bytes -99.11%
server/middleware-*.js 4.0kB 4.03kB 11102.78% ⚠️
view changes for bundle: sdk-router-@synapsecns/sdk-router-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
sdk-router.esm.js 20.9kB 366.33kB 6.05% ⚠️

Files in sdk-router.esm.js:

  • ./src/operations/index.ts → Total Size: 0 bytes

  • ./src/module/types.ts → Total Size: 523 bytes

  • ./src/swap/models/priority.ts → Total Size: 1.68kB

  • ./src/swap/core/engineID.ts → Total Size: 361 bytes

  • ./src/swap/swapEngineSet.ts → Total Size: 6.49kB

  • ./src/module/query.ts → Total Size: 5.08kB

  • ./src/constants/addresses.ts → Total Size: 4.65kB

  • ./src/constants/medianTime.ts → Total Size: 4.2kB

  • ./src/swap/engines/defaultPoolsEngine.ts → Total Size: 4.94kB

  • ./src/swap/engines/index.ts → Total Size: 0 bytes

  • ./src/operations/intent.ts → Total Size: 8.11kB

  • ./src/sdk.ts → Total Size: 2.55kB

  • ./src/operations/bridge.ts → Total Size: 31.96kB

  • ./src/module/synapseModuleSet.ts → Total Size: 8.07kB

  • ./src/sir/synapseIntentRouterSet.ts → Total Size: 7.26kB

  • ./src/operations/swap.ts → Total Size: 8.1kB

  • ./src/rfq/fastBridgeRouterSet.ts → Total Size: 22.9kB

  • ./src/constants/chainIds.ts → Total Size: 5.06kB

view changes for bundle: sdk-router-@synapsecns/sdk-router-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
sdk-router.cjs.production.min.js 6.72kB 164.63kB 4.26%

Files in sdk-router.cjs.production.min.js:

  • ./src/constants/chainIds.ts → Total Size: 5.45kB

  • ./src/swap/engines/index.ts → Total Size: 0 bytes

  • ./src/module/query.ts → Total Size: 4.66kB

  • ./src/operations/bridge.ts → Total Size: 31.75kB

  • ./src/constants/addresses.ts → Total Size: 4.74kB

  • ./src/swap/swapEngineSet.ts → Total Size: 6.44kB

  • ./src/swap/core/engineID.ts → Total Size: 361 bytes

  • ./src/rfq/fastBridgeRouterSet.ts → Total Size: 22.89kB

  • ./src/constants/medianTime.ts → Total Size: 4.72kB

  • ./src/module/types.ts → Total Size: 523 bytes

  • ./src/operations/intent.ts → Total Size: 8.14kB

  • ./src/operations/index.ts → Total Size: 0 bytes

  • ./src/operations/swap.ts → Total Size: 8.15kB

  • ./src/sdk.ts → Total Size: 2.44kB

  • ./src/sir/synapseIntentRouterSet.ts → Total Size: 7.31kB

  • ./src/swap/engines/defaultPoolsEngine.ts → Total Size: 4.78kB

  • ./src/swap/models/priority.ts → Total Size: 1.7kB

  • ./src/module/synapseModuleSet.ts → Total Size: 7.99kB

ChiTimesChi added a commit that referenced this pull request May 5, 2025
* Ft/ponder ix hyp evm (#3571)

* add hyperevm to ponder ix

* addtl hypevm chain config

---------

Co-authored-by: parodime <noreply@protochainresearch.com>

* Publish

 - @synapsecns/rfq-indexer-api@1.1.0
 - @synapsecns/rfq-indexer@0.0.7

* ponder ix - set hyperEVM block range to 50

* fix: hyperEVM block range

* ponder ix - alter hype start block

* Fix multi-architecture build for Hyperliquid Node Image (#3574)

* hl docker image

* fix(workflow): move date tag creation to separate step in hyperliquid workflow

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>

* fix(workflow): remove load flag and use local image for tagging in hyperliquid workflow

* fix(workflow): use build-push-action for date tagging in hyperliquid workflow

* feat(workflow): add multi-architecture support and mainnet image build for hyperliquid

* fix(workflow): update hyperliquid workflow to use local Dockerfile for better multi-arch support

* fix(hyperliquid): update binary URL paths to match node documentation

* fix(hyperliquid): temporarily skip GPG verification due to inconsistent path issues

* fix(hyperliquid): always use Testnet binary since Mainnet binary is not publicly accessible

* fix(hyperliquid): use correct URL for Mainnet binary

---------

Co-authored-by: Trajan0x <trajan0x@users.noreply.github.com>

* feat: Swap Engines [SYN-29] [SYN-35] (#3563)

* feat: SIR binding, StepParams, ZapData encoding

* feat: engine quote/route structs

* feat: slippage utils

* feat: no-op engine

* feat: add Default Engine

* feat: Kyber, Li.FI engines

* feat: paraSwap module

* feat: SwapEngineSet

* feat: add SwapEngineSet to SDK

* feat: Synapse Intent Router

* feat: expose swapV2

* feat: add swapV2 controller

* feat: add swapV2 route

* fix: null behaviour consistent with bridge route

* fix: remove originUserAddress for swapV2

* feat: swapV2 to use native amounts (wei)

* fix: swap/v2 route

* fix: tests

* feat: add production contracts

* chore: reorder KyberSwap chains, add bnerachain

* feat: expand list of supported chains for /swap/v2

* refactor: use named paramters for swapV2

* fix: set default slippage to 0.5%; stringify tx.value

* chore: generate docs

* Publish

 - @synapsecns/rest-api@1.10.0
 - @synapsecns/sdk-router@0.13.0
 - @synapsecns/synapse-interface@0.42.6
 - @synapsecns/widget@0.9.17
 - @synapsecns/rfq-indexer@0.0.8

* fix: mockCallRevert internal revert (#3575)

* Publish

 - @synapsecns/contracts-rfq@0.16.2

* feat(contracts-rfq): deploy SIR [SYN-29] (#3573)

* fix: adjust comment for #3467

* chore: mainnet -> ethereum

* feat: update deploy scripts, prepare create2 salts

* chore: add deployments from new chains

* chore: add chain IDs to foundry.toml

* chore: add utility scripts

* deploy: SIR and periphery on 12 chains

* deploy: SIR at 0x512000...000512 address

* fix: update SIR address

* Publish

 - @synapsecns/contracts-rfq@0.17.0
 - @synapsecns/rest-api@1.10.1
 - @synapsecns/sdk-router@0.14.0
 - @synapsecns/synapse-interface@0.42.7
 - @synapsecns/widget@0.9.18

* feat: SDK new chains [SYN-45] (#3535)

* feat: add HyperEVM to sdk-router

* feat: use staging RFQ API [REVERT LATER]

* feat: add HYPE-USDC, HYPE-ETHto the bridge map

* fix: add HYPE, HyperEVM to rest-api

* feat: update rest-api bridge map

* chore: add envs for api urls (#3537)

Co-authored-by: Trajan0x <trajan0x@users.noreply.github.com>

* chore: make prod RFQ API the default value

* feat: support multiple RFQ APIs

* fix: don't report negative bridge fee for RFQ

* test: adjus the amount of token pairs for USDC

---------

Co-authored-by: trajan0x <83933037+trajan0x@users.noreply.github.com>
Co-authored-by: Trajan0x <trajan0x@users.noreply.github.com>

* Publish

 - @synapsecns/rest-api@1.11.0
 - @synapsecns/sdk-router@0.15.0
 - @synapsecns/synapse-interface@0.43.0
 - @synapsecns/widget@0.9.19

* fix: hide slippage between different type of assets for now [SYN-39] (#3590)

* Publish

 - @synapsecns/synapse-interface@0.43.1

* Support Swap V2 endpoint on Synapse REST client (#3593)

* fix(rest-api): swap v2 errors (#3594)

* fix: check if tx is defined

* chore: correct endpoint name in error

* Publish

 - @synapsecns/rest-api@1.11.1

* feat: sdk/api bridgeV2 for SynapseRFQ [SYN-66] (#3588)

* feat: scaffold bridgeV2

* feat: complete bridgeV2, scaffold module impls

* feat: airdrop amount in bridgeV2

* feat: bridgeV2 for SynapseRFQ

* fix: add more info to SwapEngine quotes, type assertions

* feat: /bridge/v2

* chore: generate docs

* refactor: steps params manipulation

* feat: cap origin slippage

* feat: cache getAllQuotes calls

* fix(rest-api): improve bridge v2 response format

- Replace BigNumber response objects with string values
- Rename maxAmountOutStr to maxAmountOut for cleaner API
- Update swagger documentation to reflect changes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat(restclient): add bridge v2 endpoint support

- Add GetBridgeV2 and related parameters to REST client
- Update type definitions for bridge v2 response format
- Synchronize with recent bridge v2 API changes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>

* [DI-48] fix: replace vulnerable tj-actions actions with dorny/paths-filter (#3595)

Replace all tj-actions actions (changed-files, verify-changed-files, branch-names) with
secure alternatives to mitigate the security vulnerability. Used dorny/paths-filter for
file checking and bash scripts for branch name detection.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>

Co-authored-by: Trajan0x <trajan0x@users.noreply.github.com>

* chore(rest-api): edit README to trigger republish (#3597)

* Publish

 - @synapsecns/rest-api@1.12.0

* chore(sdk-router): edit README to trigger republish (#3598)

* Publish

 - @synapsecns/rest-api@1.12.1
 - @synapsecns/sdk-router@0.16.0
 - @synapsecns/synapse-interface@0.43.2
 - @synapsecns/widget@0.9.20

* chore(sdk-router): cleanup types, remove unused utilities (#3600)

* feat: add Prettify utility type for better IDE type display

Adds a Prettify<T> utility type that improves how types are displayed in the IDE:
- Applied to union types to show all properties
- Applied to Partial/Required patterns to show complete property set
- Applied to complex types with optional properties

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore(sdk-router): apply Prettify to complex types

- Add Prettify utility type to intersection types and type modifiers
- Create PartialZapDataV1 type for better reusability
- Update function signatures to use new type definitions
- Improve IDE display of complex types

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore(sdk-router): remove unused entity files and utils

Removed deprecated entity files and utility functions that are no longer needed in the SDK router package. These files were likely imported from another SDK and are not currently being used.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(sdk-router): centralize utilities through utils/index.ts

- Modified utils/index.ts to use export * from each utility module
- Updated all imports to reference the centralized utils module instead of individual utility files
- This change makes the codebase more maintainable and easier to refactor

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore(sdk-router): enforce alphabetical ordering of imports

- Added alphabetical ordering rule to ESLint configuration
- Auto-fixed imports order in all files to comply with the new rule
- This enforces a consistent import style throughout the codebase

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(sdk-router): replace BigintIsh with ethers' BigNumberish

Replace all occurrences of custom BigintIsh type with the standard BigNumberish from ethers.js.
This standardizes the codebase by using established types from the core library.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>

* Publish

 - @synapsecns/rest-api@1.12.2
 - @synapsecns/sdk-router@0.16.1
 - @synapsecns/synapse-interface@0.43.3
 - @synapsecns/widget@0.9.21

* fix(rest-api,sdk-router): `/bridge/v2` and `swap/v2` endpoint standardisation [SYN-77] (#3602)

* refactor: consistent params naming in swap/bridge V2

* feat: enrich SwapQuoteV2

* feat: enrich BridgeQuoteV2

* feat: update V2 endpoints in rest-api

* chore: update the swagger docs

* refactor: id ordering

* chore: regenerate restclient

* chore: fix example router address in `/swap/v2` response

* fix: add swap module name, same token swaps

* fix: unify swap/bridge module names in V2 only

* chore: unified "module name" in rest-api

* fix: remove string cast

* fix: SDK tests

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Publish

 - @synapsecns/rest-api@1.12.3
 - @synapsecns/sdk-router@0.16.2
 - @synapsecns/synapse-interface@0.43.4
 - @synapsecns/widget@0.9.22

* chore(sdk-router): cleanup logging, engine priorities (#3610)

* refactor: clean up engine priorities

* chore: remove execution time logging

* fix: adjust engine priorities

* Publish

 - @synapsecns/rest-api@1.12.4
 - @synapsecns/sdk-router@0.16.3
 - @synapsecns/synapse-interface@0.43.5
 - @synapsecns/widget@0.9.23

* feat(rest-api,sdk-router): intent endpoint [SYN-77] (#3613)

* feat: scaffold `intent` function

* feat: scaffold multiple txs in bridgeV2

* feat: optional `tokenOut` in bridge token candidate search

* feat: allow multiple txs in `bridgeV2`

* feat: single-chain swap intents

* feat: cross-chain intents

* feat: expose `/intent` endpoint

* chore: generate swagger

* fix: report all module names within the intent step

* chore: rename into "default pools" engine

* chore: update swagger, regenerate client

* fix: prevent errors on unsupported RFQ routes in V2 endpoints

* fix: block times, supported intent chains

* fix: fromAmount string

* Publish

 - @synapsecns/rest-api@1.13.0
 - @synapsecns/sdk-router@0.17.0
 - @synapsecns/synapse-interface@0.43.6
 - @synapsecns/widget@0.9.24

* fix(sdk-router): export intent types (#3620)

* fix: export intent types

* fix: export bridge types

* fix: export swap types

* fix: imports in tests

* Publish

 - @synapsecns/rest-api@1.13.1
 - @synapsecns/sdk-router@0.17.1
 - @synapsecns/synapse-interface@0.43.7
 - @synapsecns/widget@0.9.25

* upgrading to reference cortex much more

* adding new links etc

* Publish

 - @synapsecns/bridge-docs@0.6.7
 - @synapsecns/explorer-ui@0.5.15
 - @synapsecns/synapse-interface@0.43.8
 - @synapsecns/widget@0.9.26

* fix(sdk-router): exported slippage type (#3634)

* fix: use slippagePercentage in exported types

* fix: use slippage percentage in rest-api

* Publish

 - @synapsecns/rest-api@1.13.2
 - @synapsecns/sdk-router@0.17.2
 - @synapsecns/synapse-interface@0.43.9
 - @synapsecns/widget@0.9.27

* fix(sdk-router, rest-api): stringify BigNumber in exported V2 types [SYN-77] (#3636)

* fix: stringify BigNumber in exported V2 types

* fix: update bridge modules

* fix: update V2 operations

* fix: update rest-api

* Publish

 - @synapsecns/rest-api@1.13.3
 - @synapsecns/sdk-router@0.17.3
 - @synapsecns/synapse-interface@0.43.10
 - @synapsecns/widget@0.9.28

* Update bl

* fix(sdk-router): restrict `fromAmount` to `string` in the exported intent parameters (#3645)

* chore: fix existing documentation

* fix: restrict fromAmount type to string in exported parameters

* Publish

 - @synapsecns/rest-api@1.13.4
 - @synapsecns/sdk-router@0.17.4
 - @synapsecns/synapse-interface@0.43.11
 - @synapsecns/widget@0.9.29

* fix(sdk-router): add decimals to intent steps (#3646)

* refactor: isolate token decimals retrieval

* fix: add decimal metadata to each intent step

* fix: make tokenMetadataFetcher optional

* Publish

 - @synapsecns/rest-api@1.13.5
 - @synapsecns/sdk-router@0.17.5
 - @synapsecns/synapse-interface@0.43.12
 - @synapsecns/widget@0.9.30

* fix(sdk-router): add `HYPEREVM` to intents supported chains

* chore: small change to publish 9abecbe (#3648)

* Publish

 - @synapsecns/rest-api@1.13.6
 - @synapsecns/sdk-router@0.17.6
 - @synapsecns/synapse-interface@0.43.13
 - @synapsecns/widget@0.9.31

* fix(sdk-router): swap engine improvements, remove cap on RFQ origin slippage (#3652)

* fix: exclude RFQ sources on KyberSwap

* fix: paraSwap partner, LiFi timing strategy

* feat: use FBI for Route V2 zap data

* fix: make minToAmount requied in SwapEngineRoute

* fix: don't cap origin slippage

* fix: don't use interceptor without origin swaps

* Publish

 - @synapsecns/rest-api@1.13.7
 - @synapsecns/sdk-router@0.17.7
 - @synapsecns/synapse-interface@0.43.14
 - @synapsecns/widget@0.9.32

* removing old routes and tokens

* Publish

 - @synapsecns/bridge-docs@0.6.8

* Adding hyperevm to the explorer (#3647)

* adding hyperevm [goreleaser]

* updating chart color

* fixing pricing issues [goreleaser]

* fix for native tokens [goreleaser]

* fixing bera weth [goreleaser]

* removing all old fetcher changes

* [goreleaser]

* lint

---------

Co-authored-by: parodime <jordan@protochainresearch.com>

* Publish

 - @synapsecns/explorer-ui@0.5.16

* adding hyperevm to constants

* Publish

 - @synapsecns/bridge-docs@0.6.9
 - @synapsecns/explorer-ui@0.5.17
 - @synapsecns/rest-api@1.13.8
 - @synapsecns/synapse-constants@1.8.10

* Deprecate and remove go restclient module [SYN-88] (#3658)



---------

Co-authored-by: Trajan0x <trajan0x@users.noreply.github.com>

* SYN-86 Delete Old exporters and remove unused code (#3656)



Co-authored-by: Trajan0x <trajan0x@users.noreply.github.com>

* SYN-87 Remove SignOz functionality from opbot (#3657)

* SYN-87 Remove SignOz functionality from opbot

- Removed SignOz client and package
- Removed SignOz configuration fields
- Removed traceCommand dependent on SignOz
- Updated README to remove SignOz references
- Added CLAUDE.md for automated operations
- Fixed formatting and ensured code builds correctly

* update go.work.sum

* Fix goimports formatting issues for linting

* [goreleaser]

* nuke signoz example [goreleaser]

---------

Co-authored-by: Trajan0x <trajan0x@users.noreply.github.com>

* feat(contracts-rfq): fast bridge interceptor [SYN-84] (#3649)

* feat: scaffold FastBridgeInterceptor

* test: add coverage

* feat: implement interceptor

* test: different decimals ratio

* docs: improve FastBridgeInterceptor documentation

- Add clear NatSpec documentation to both implementation and interface
- Focus user documentation on integration aspects
- Clarify contract behavior and edge cases
- Follow Solidity documentation standards
- Fix typo in interface documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: fix lint

* refactor: relabel percentage vars

* build: deploy Interceptor on supported mainnets

---------

Co-authored-by: Claude <noreply@anthropic.com>

* Publish

 - @synapsecns/contracts-rfq@0.18.0

* feat(contracts-rfq): sir new deployments (#3662)

* build: add new chains to config

* chore: deploy on avax and polygon

* Publish

 - @synapsecns/contracts-rfq@0.19.0

* fix(sdk-router): address utils, URLs in constructor, ParaSwap surplus (#3660)

* fix: `handleNativeToken` non-checksummed address, reorganize

* fix: export address utils

* refactor: handleParams

* test: ensure that 0xEE is working with integrations

* feat: pass paraswap surplus to user

* feat: allow passing URLs in SDK constructor

* fix: use Gas.Zip contract deposit

* fix: types

* feat: intents with gas.zip

* build: add sdk:stream script

* feat: add Avax, Ploygon to intents chain ids

* refactor: chainProviders init logic

* fix: enforce gas.zip min/max usd value

* Publish

 - @synapsecns/rest-api@1.13.9
 - @synapsecns/sdk-router@0.17.8
 - @synapsecns/synapse-interface@0.43.15
 - @synapsecns/widget@0.9.33

* fix(sdk-router): faster intent quotes, time logging, Paraswap surplus [SYN-97] (#3672)

* fix: make logExecutionTime more generic

* chore: add execition time logging

* fix: paraswap surplus

* fix: use longer cache for RFQ available tokens, shorter cache for quotes

* feat: getFastestQuote

* chore: remove old getBestQuote

* fix: timeouts

* chore: fix incorrect comments

* fix: make logging work with minimised package

* fix: prevent unhandled rejections in quote processing

- Improve _getFastestQuote to properly handle all promises even when returning early
- Use Promise.allSettled in the background to ensure all rejections are caught
- Maintain fast response time while avoiding unhandled promise rejections

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: ensure timing is logged even when methods throw errors

- Wrap method execution in try/finally to log execution time in all cases
- Ensure original errors are propagated properly
- Simplify code with direct return in try block

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: ensure consistent cache keys in FastBridgeRouterSet

- Fix cache key inconsistency in getAllQuotes method
- Ensure cache keys match between get and set operations
- Use enum values directly in cache key construction

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: variable shadowing

---------

Co-authored-by: Claude <noreply@anthropic.com>

* Publish

 - @synapsecns/rest-api@1.13.10
 - @synapsecns/sdk-router@0.17.9
 - @synapsecns/synapse-interface@0.43.16
 - @synapsecns/widget@0.9.34

* fix(sdk-router): gas.zip block height (#3675)

* feat: add latest block endpoint

* fix: don't use gas.zip quotes for stale chains

* fix: getBlock error cases

* fix: safer API data manipulation

* Publish

 - @synapsecns/rest-api@1.13.11
 - @synapsecns/sdk-router@0.17.10
 - @synapsecns/synapse-interface@0.43.17
 - @synapsecns/widget@0.9.35

---------

Co-authored-by: parodime <jordan@protochainresearch.com>
Co-authored-by: parodime <noreply@protochainresearch.com>
Co-authored-by: parodime <parodime@users.noreply.github.com>
Co-authored-by: trajan0x <83933037+trajan0x@users.noreply.github.com>
Co-authored-by: Trajan0x <trajan0x@users.noreply.github.com>
Co-authored-by: ChiTimesChi <ChiTimesChi@users.noreply.github.com>
Co-authored-by: vro <168573323+golangisfun123@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: defi-moses <jakedinero@protonmail.com>
Co-authored-by: Moses <103143573+Defi-Moses@users.noreply.github.com>
Co-authored-by: Defi-Moses <Defi-Moses@users.noreply.github.com>
Co-authored-by: aureliusbtc <82057759+aureliusbtc@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code size/l Sol Typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0