8000 feat: sdk/api bridgeV2 for SynapseRFQ [SYN-66] by ChiTimesChi · Pull Request #3588 · synapsecns/sanguine · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

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 14, 2025
Merged

Conversation

ChiTimesChi
Copy link
Collaborator
@ChiTimesChi ChiTimesChi commented Mar 10, 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

    • Launched an enhanced bridging service endpoint that retrieves detailed quotes for cross-chain token transfers with advanced parameter validations and improved error handling.
    • Expanded SDK operations to provide more informative swap quotes, refined fee and gas calculations, and streamlined route finalization for bridging transactions.
  • Documentation

    • Updated API specifications and client guides to reflect the new bridging endpoint and its parameters.

Copy link
vercel bot commented Mar 10, 2025

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

Name Status Preview Comments Updated (UTC)
sanguine ❌ Failed (Inspect) Mar 14, 2025 0:36am

Copy link
Contributor
coderabbitai bot commented Mar 10, 2025

Walkthrough

This PR introduces a new bridging endpoint (/bridge/v2) and extends support for bridge transactions across multiple components. In the REST API, a new controller and route are added with proper validation and swagger documentation. The SDK now supports bridge v2 through updated types, new methods, and updated method signatures, including fee, quote, and swap engine enhancements. Additionally, the Go client is updated to support the new bridge v2 API endpoint.

Changes

File(s) Change Summary
packages/rest-api/src/controllers/bridgeV2Controller.ts
packages/rest-api/src/routes/bridgeV2Route.ts
packages/rest-api/src/routes/index.ts
packages/rest-api/swagger.json
Added new REST API endpoint /bridge/v2 with a corresponding controller, complete with parameter validation, response formatting, and swagger documentation.
packages/sdk-router/src/gaszip/gasZipModuleSet.ts
packages/sdk-router/src/module/synapseModuleSet.ts
packages/sdk-router/src/module/types.ts
packages/sdk-router/src/operations/bridge.ts
packages/sdk-router/src/router/synapseCCTPRouterSet.ts
packages/sdk-router/src/router/synapseRouterSet.ts
packages/sdk-router/src/sdk.ts
packages/sdk-router/src/sir/synapseIntentRouterSet.ts
Introduced bridge v2 support by adding/updating types (e.g., BridgeTokenCandidate, BridgeRouteV2, BridgeQuoteV2), methods (getBridgeTokenCandidates, getBridgeRouteV2, finalizeBridgeQuoteV2), and new properties (e.g. isBridgeV2Supported). Also, added a new public property bridgeV2 in the SDK.
packages/sdk-router/src/rfq/fastBridgeRouterSet.ts
packages/sdk-router/src/rfq/quote.ts
Modified fee calculation logic and refactored destination and origin amount computations into separate helper functions.
packages/sdk-router/src/swap/engines/defaultEngine.ts
packages/sdk-router/src/swap/engines/kyberSwapEngine.ts
packages/sdk-router/src/swap/engines/liFiEngine.ts
packages/sdk-router/src/swap/engines/noOpEngine.ts
packages/sdk-router/src/swap/engines/paraSwapEngine.ts
packages/sdk-router/src/swap/engines/response.ts
packages/sdk-router/src/swap/models/index.ts
packages/sdk-router/src/swap/models/route.ts
packages/sdk-router/src/swap/models/steps.ts
packages/sdk-router/src/swap/swapEngineSet.ts
Enhanced swap engine quote responses by adding tokenIn, tokenOut, and amountIn details. Streamlined empty quote construction via getEmptyQuote and introduced new step manipulation functions (getLastStepZapData, setLastStepZapData, getMinFinalAmount, setMinFinalAmount) to simplify zap data handling.
contrib/restclient/client.gen.go Added new types, methods, and response parsing functions to support the GetBridgeV2 API endpoint, including the GetBridgeV2Params and GetBridgeV2Response structures.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant R as Express Router (/bridge/v2)
  participant C as bridgeV2Controller
  participant S as Synapse.bridgeV2 (SDK Operation)
  participant D as Data/Response Formatter

  U->>R: Send GET /bridge/v2 request with query params
  R->>C: Route request to bridgeV2Controller
  C->>C: Validate parameters (using express-validator)
  C->>S: Call Synapse.bridgeV2 with extracted parameters
  S-->>C: Return processed bridge quotes
  C->>D: Format the response (convert amounts, include callData)
  D-->>U: Send HTTP response (200/400/500)
Loading
sequenceDiagram
  participant App as SynapseSDK
  participant OP as bridgeV2 Operation
  participant V1 as _collectV1Quotes
  participant V2 as _collectV2Quotes
  participant Sort as Quote Sorter

  App->>OP: Invoke bridgeV2 with BridgeV2Parameters
  OP->>V1: Collect version 1 quotes
  OP->>V2: Collect version 2 quotes (using new methods)
  V1-->>OP: Return V1 quotes
  V2-->>OP: Return V2 quotes
  OP->>Sort: Combine & sort quotes by maxAmountOut
  Sort-->>OP: Sorted quote list
  OP-->>App: Return final bridge quotes
Loading

Possibly related PRs

Suggested labels

size/m, M-synapse-interface, go

Suggested reviewers

  • aureliusbtc
  • trajan0x

Poem

Oh, what a hop, what a leap,
New bridges built, our code runs deep.
Tokens now cross with a graceful bound,
Thanks to fresh logic newly found.
Hoppy changes in every byte,
A rabbit cheers with delight!
🐰✨

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 22a825b and 761fd51.

📒 Files selected for processing (4)
  • contrib/restclient/client.gen.go (8 hunks)
  • packages/rest-api/src/controllers/bridgeV2Controller.ts (1 hunks)
  • packages/rest-api/src/routes/bridgeV2Route.ts (1 hunks)
  • packages/rest-api/swagger.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/rest-api/src/controllers/bridgeV2Controller.ts
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Go Coverage (1.22.x, contrib/restclient)
  • GitHub Check: Go Generate (Module Changes) (contrib/restclient)
  • GitHub Check: Build (1.22.x)
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: changesets-integrity-checker
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (13)
packages/rest-api/swagger.json (1)

19-244: Well-structured OpenAPI specification for the new bridge/v2 endpoint.

The addition of the /bridge/v2 endpoint is thoroughly documented with clear parameter definitions, response structures, and examples. The specification correctly defines required and optional parameters with appropriate types and descriptions.

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

1-13: Appropriate imports for route implementation.

All necessary dependencies are imported, including Express, validation utilities, middleware, and controllers. The imports are well-organized with clear separation between external libraries and internal modules.


16-173: Comprehensive OpenAPI documentation in JSDoc format.

The JSDoc comments effectively mirror the OpenAPI specification in the swagger.json file, which helps maintain consistency between documentation and implementation. The documentation clearly describes the endpoint purpose, parameters, and response formats.


174-224: Well-implemented route definition with robust validation.

The route implementation includes:

  1. Proper middleware application for address normalization and checksum conversion
  2. Comprehensive validation rules for all parameters
  3. Intent support validation for the source chain
  4. Token validation including format and chain support checks
  5. Appropriate error handling via the showFirstValidationError middleware

The validation chain is thorough and covers all edge cases, including checking that the source chain supports intents which is a critical requirement.


185-186:

✅ Verification successful

Verify intent support implementation.

The validation checks that the source chain supports intents. Ensure that the INTENTS_SUPPORTED_CHAIN_IDS constant is properly maintained and updated when new chains add intent support.


🏁 Script executed:

#!/bin/bash
# Check how INTENTS_SUPPORTED_CHAIN_IDS is defined and used across the codebase

# Find the definition of INTENTS_SUPPORTED_CHAIN_IDS
echo "Checking INTENTS_SUPPORTED_CHAIN_IDS definition:"
rg "INTENTS_SUPPORTED_CHAIN_IDS\s*=" --type ts

# Check where it's imported and used
echo -e "\nChecking INTENTS_SUPPORTED_CHAIN_IDS imports and usages:"
rg "INTENTS_SUPPORTED_CHAIN_IDS" --type ts -A 1 -B 1

Length of output: 3316


Intent support validation verified.
The validation in bridgeV2Route.ts correctly uses the INTENTS_SUPPORTED_CHAIN_IDS constant—which is defined centrally (e.g., in the SDK package) and consistently imported in both the bridge and swap routes. No issues were identified in how intent support is implemented. Just ensure that any updates to supported chain IDs in the SDK are reflected across all dependent modules.


203-206:

❓ Verification inconclusive

Ensure token support validation accuracy.

The custom validator for token support on the destination chain relies on the isTokenSupportedOnChain utility. Make sure this function has adequate test coverage and is kept up-to-date with the latest supported tokens across all chains to prevent false negatives.


🏁 Script executed:

#!/bin/bash
# Check the implementation of isTokenSupportedOnChain utility

# Find the implementation
echo "Checking isTokenSupportedOnChain implementation:"
rg -A 10 "isTokenSupportedOnChain.*=" --type ts

# Check test coverage
echo -e "\nChecking test coverage for isTokenSupportedOnChain:"
rg "isTokenSupportedOnChain" --type test

Length of output: 1357


Action Required: Verify Token Support Test Coverage

  • The custom validator calls isTokenSupportedOnChain to ensure that the token is supported on the destination chain.
  • Please verify that the tests for isTokenSupportedOnChain in your test files cover various scenarios (e.g., different chain IDs, case insensitivity of token addresses, and edge cases where tokens are missing).
  • Additionally, double-check that the list of supported tokens (i.e., bridgeableTokens) is kept up-to-date to avoid potential false negatives.
contrib/restclient/client.gen.go (7)

174-199: Well-structured parameter definition for the new bridge v2 endpoint.

The new GetBridgeV2Params struct is well-defined with clear documentation for each field. I notice the Amount field is an int type compared to float32 in the v1 bridge endpoint, which appears to be an intentional change to use native token decimals.


459-460: Properly extending the interface with the new endpoint method.

The ClientInterface is correctly updated to include the new GetBridgeV2 method, maintaining consistent method signatures with other API endpoints.


595-605: Clean implementation of the client method.

This implementation of GetBridgeV2 follows the established pattern used throughout the client code, properly handling context, request creation, and error handling.


1147-1286: Request generator function follows existing patterns.

The NewGetBridgeV2Request function is implemented consistently with other request generators, handling URL parsing, query parameter formatting, and proper error handling throughout the process.


2879-2946: Well-structured response type definition.

The GetBridgeV2Response struct is properly defined with clear field documentation. The response structure reflects the expected JSON response from the API with appropriate fields for bridge module info, transaction data, and chain details.


4008-4016: Response handler function is correctly implemented.

This wrapper method for the bridge v2 endpoint properly handles the context and response parsing.


4421-4504: Thorough response parsing implementation.

The ParseGetBridgeV2Response function provides proper handling for different response status codes (200, 400, 500) and correctly unmarshals the JSON response into the appropriate Go structures.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.

Copy link
cloudflare-workers-and-pages bot commented Mar 10, 2025

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 761fd51
Status: ✅  Deploy successful!
Preview URL: https://6c9a66ad.sanguine-fe.pages.dev
Branch Preview URL: https://feat-sdk-bridge-v2.sanguine-fe.pages.dev

View logs

Copy link
codecov bot commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 13.45029% with 296 lines in your changes missing coverage. Please review.

Project coverage is 13.49299%. Comparing base (b1b07da) to head (761fd51).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
contrib/restclient/client.gen.go 0.00000% 204 Missing ⚠️
packages/sdk-router/src/operations/bridge.ts 8.69565% 42 Missing ⚠️
packages/sdk-router/src/rfq/fastBridgeRouterSet.ts 41.02564% 23 Missing ⚠️
packages/sdk-router/src/swap/models/steps.ts 43.75000% 9 Missing ⚠️
...kages/sdk-router/src/sir/synapseIntentRouterSet.ts 33.33333% 8 Missing ⚠️
packages/sdk-router/src/gaszip/gasZipModuleSet.ts 33.33333% 2 Missing ⚠️
...ages/sdk-router/src/router/synapseCCTPRouterSet.ts 50.00000% 2 Missing ⚠️
packages/sdk-router/src/router/synapseRouterSet.ts 66.66667% 2 Missing ⚠️
packages/sdk-router/src/swap/swapEngineSet.ts 33.33333% 2 Missing ⚠️
packages/sdk-router/src/module/synapseModuleSet.ts 0.00000% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@                 Coverage Diff                 @@
##              master       #3588         +/-   ##
===================================================
- Coverage   13.51931%   13.49299%   -0.02633%     
===================================================
  Files            320         321          +1     
  Lines          33123       33447        +324     
  Branches         186         203         +17     
===================================================
+ Hits            4478        4513         +35     
- Misses         28160       28449        +289     
  Partials         485         485                 
Flag Coverage Δ
packages 73.92036% <33.33333%> (-3.22938%) ⬇️
restclient 0.87159% <0.00000%> (-0.05492%) ⬇️

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
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: 1

🧹 Nitpick comments (21)
packages/sdk-router/src/swap/engines/response.ts (1)

64-66: Good enhancement of the API response.

Adding the tokenIn, tokenOut, and amountIn properties to the return object enhances the response with more context about the swap operation. This standardization provides a more consistent API across all swap engines.

One suggestion: Consider wrapping the BigNumber.from(input.amountIn) in a try/catch block to handle potential invalid input gracefully, since BigNumber.from() can throw if given invalid values.

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

96-101: Add missing error handling for division by zero.

The function might throw an error if quote.destAmount is zero, which could happen in edge cases.

export const getOriginAmount = (
  quote: FastBridgeQuote,
  destAmount: BigNumber
): BigNumber => {
+  if (quote.destAmount.isZero()) {
+    return Zero;
+  }
  return destAmount.mul(quote.maxOriginAmount).div(quote.destAmount)
}

Consider adding similar protection to getDestAmount for the case where quote.maxOriginAmount is zero.

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

99-123: Excellent addition of BridgeQuoteV2 with comprehensive documentation.

The new BridgeQuoteV2 type is well-documented with clear parameter descriptions and provides a more complete structure for bridge transaction quotes. The addition of the optional tx field is particularly useful as it can contain the populated transaction when an origin sender is provided.

Consider adding validation or utility functions for these new types to ensure data consistency when used across the application.

packages/rest-api/src/controllers/bridgeV2Controller.ts (4)

10-14: Add Express type annotations for better type safety

The controller function should have type annotations for request and response parameters to ensure type safety.

-export const bridgeV2Controller = async (req, res) => {
+import { Request, Response } from 'express'
+
+export const bridgeV2Controller = async (req: Request, res: Response) => {

36-39: Add validation for slippage input

The code converts slippage from percentage to basis points without validating that the input is a valid number, which could lead to NaN values if invalid input is provided.

    // Convert percentage slippage to bips
    const slippageBips = slippage
-      ? Number(slippage) * 100
+      ? isNaN(Number(slippage)) 
+        ? DEFAULT_SWAP_SLIPPAGE_BIPS 
+        : Number(slippage) * 100
      : DEFAULT_SWAP_SLIPPAGE_BIPS

55-69: Use object destructuring for cleaner quote mapping

The current implementation can be simplified using object destructuring to make the code more readable.

    const payload = allQuotes.map((quote) => {
+      const { tx, maxAmountOut, ...restOfQuote } = quote
      const callData =
-        destAddress && originUserAddress && quote.tx
+        destAddress && originUserAddress && tx
          ? {
-              ...quote.tx,
-              value: quote.tx.value.toString(),
+              ...tx,
+              value: tx.value.toString(),
            }
          : null
      return {
-        ...quote,
+        ...restOfQuote,
        callData,
-        maxAmountOutStr: quote.maxAmountOut.toString(),
+        maxAmountOutStr: maxAmountOut.toString(),
-        tx: undefined,
      }
    })

71-75: Improve log by including request method and path

Enhance the log information to include HTTP method and path for better traceability.

    logger.info(`Successful bridgeV2Controller response`, {
      payload,
      query: req.query,
+     method: req.method,
+     path: req.path,
    })
packages/sdk-router/src/sir/synapseIntentRouterSet.ts (1)

45-91: Consider Additional Validation.

While the logic ensures originRoute.steps meets the minimum requirements, consider adding a defensive check if originRoute.steps is empty or bridgeRoute.zapData is malformed to avoid unexpected runtime errors. Providing warning logs in such cases may also help debugging.

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

19-259: Comprehensive New Endpoint Documentation.

The new /bridge/v2 endpoint parameters and response schemas are detailed. Consider adding a mini usage snippet (e.g., a cURL example) to quickly illustrate how a typical request might look in practice, which can aid developer adoption.

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

131-214: Potential Route Duplication.

While duplicates are removed for token candidates, duplicate final routes from multiple modules might still slip through. Consider filtering them before returning to avoid confusion in the final results.

packages/sdk-router/src/router/synapseCCTPRouterSet.ts (2)

18-18: Consider toggling this flag based on configuration.
Currently, isBridgeV2Supported is set to false. If future development enables a BridgeV2 flow, ensure this flag can be updated or overridden appropriately.


50-52: Return valid token candidates or reference future implementation.
Currently, this method returns an empty array, indicating a placeholder. If there are known candidate tokens, returning them would help the consumer of this method.

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

185-234: Ensure correct boundary checks and meaningful error messages.
The validation looks solid. For clarity, verify that error messages map accurately to each validator’s condition. Also, consider a default value or fallback for slippage instead of requiring the user to supply it.

packages/sdk-router/src/router/synapseRouterSet.ts (3)

27-27: Check future toggle of Bridge V2 support.
Similar to other modules, ensure this property is updated if full BridgeV2 support is eventually introduced.


68-70: Empty return suggests a placeholder implementation.
Confirm whether the method will eventually load valid candidates from a known source or if an empty array is the final intended behavior.


72-76: BridgeRouteV2 not implemented.
Throwing an error is acceptable until V2 routes are officially supported, but track this to avoid confusion for future maintainers.

Do you want me to open an issue or help prepare a stub for partial BridgeV2 support?

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

37-37: Short TTL for cached quotes
A 10-second TTL may be too brief if quotes remain valid longer, potentially leading to frequent cache misses. Consider refining this value based on expected quote validity.


56-58: Initializing NodeCache
Using stdTTL from the static class property is a clean approach. In case of request spikes or partial failures of getAllQuotes, consider fallback or retry logic to ensure robustness.


92-109: Implementing getBridgeTokenCandidates
Using a Map keyed by marshallTicker(quote.ticker) to handle duplicates is concise. If token addresses might appear with varied casing or alternate metadata, consider normalizing them before mapping.


111-157: Implementing getBridgeRouteV2
This method neatly calculates protocol fees, filters quotes, and picks the highest final amount. However, line 119's error message refers to “FastBridge V1,” which may be confusing in a V2 context.


353-367: Caching logic within getCachedAllQuotes
This approach avoids repetitive remote calls and ensures quick responses. Consider handling exceptions from getAllQuotes to prevent caching invalid results.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 890774b and b9d2e07.

📒 Files selected for processing (24)
  • packages/rest-api/src/controllers/bridgeV2Controller.ts (1 hunks)
  • packages/rest-api/src/routes/bridgeV2Route.ts (1 hunks)
  • packages/rest-api/src/routes/index.ts (2 hunks)
  • packages/rest-api/swagger.json (1 hunks)
  • packages/sdk-router/src/gaszip/gasZipModuleSet.ts (3 hunks)
  • packages/sdk-router/src/module/synapseModuleSet.ts (4 hunks)
  • packages/sdk-router/src/module/types.ts (2 hunks)
  • packages/sdk-router/src/operations/bridge.ts (2 hunks)
  • packages/sdk-router/src/rfq/fastBridgeRouterSet.ts (7 hunks)
  • packages/sdk-router/src/rfq/quote.ts (1 hunks)
  • packages/sdk-router/src/router/synapseCCTPRouterSet.ts (4 hunks)
  • packages/sdk-router/src/router/synapseRouterSet.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/engines/defaultEngine.ts (1 hunks)
  • packages/sdk-router/src/swap/engines/kyberSwapEngine.ts (3 hunks)
  • packages/sdk-router/src/swap/engines/liFiEngine.ts (3 hunks)
  • packages/sdk-router/src/swap/engines/noOpEngine.ts (1 hunks)
  • packages/sdk-router/src/swap/engines/paraSwapEngine.ts (3 hunks)
  • packages/sdk-router/src/swap/engines/response.ts (1 hunks)
  • packages/sdk-router/src/swap/models/index.ts (1 hunks)
  • packages/sdk-router/src/swap/models/route.ts (2 hunks)
  • packages/sdk-router/src/swap/models/steps.ts (1 hunks)
  • packages/sdk-router/src/swap/swapEngineSet.ts (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: changesets-integrity-checker
  • GitHub Check: test
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (71)
packages/sdk-router/src/sdk.ts (1)

68-68: Successfully added bridgeV2 operation.

The new bridgeV2 property is correctly placed among the other bridge operations, maintaining consistent code organization. This addition properly exposes the new bridge operation from the operations module.

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

3-3:

✅ Verification successful

LGTM - steps module export added.

This addition correctly exports all the functionality from the 'steps' module, making the step-related functions available to consumers of the models package.


🏁 Script executed:

#!/bin/bash
# Check for potential export naming conflicts with existing modules
rg -A 0 -e "export (const|function|class|interface|type|enum)" --glob "*.ts" packages/sdk-router/src/swap/models/steps.ts
echo "Comparing with existing exports from other modules:"
rg -A 0 -e "export (const|function|class|interface|type|enum)" --glob "*.ts" packages/sdk-router/src/swap/models/{priority,route,swapEngine}.ts

Length of output: 1511


LGTM – Steps module export correctly exposes functions without n 8000 aming conflicts.

  • Verified that the exports from packages/sdk-router/src/swap/models/steps.ts (i.e., getLastStepZapData, setLastStepZapData, getMinFinalAmount, and setMinFinalAmount) are unique.
  • Confirmed there are no naming conflicts with exports from priority.ts, route.ts, or swapEngine.ts.
packages/rest-api/src/routes/index.ts (2)

9-9: Import added for new bridgeV2Route.

The import statement is correctly added, maintaining alphabetical ordering with other bridge-related imports.


28-28:

✅ Verification successful

New bridgeV2 route registered correctly.

The route is properly registered under the path /bridge/v2, consistent with API versioning patterns. The placement in the router configuration maintains the logical grouping with other bridge-related routes.


🏁 Script executed:

#!/bin/bash
# Verify the implementation of the bridgeV2Route
echo "Checking the implementation of bridgeV2Route:"
cat packages/rest-api/src/routes/bridgeV2Route.ts

echo -e "\nChecking the controller implementation:"
cat packages/rest-api/src/controllers/bridgeV2Controller.ts

Length of output: 11429


BridgeV2 Route Registration Verified

After reviewing the implementation, the new /bridge/v2 route is correctly registered in packages/rest-api/src/routes/index.ts and properly wired to its dedicated route and controller. Both the route (bridgeV2Route) and its controller (bridgeV2Controller) exhibit the expected validations, error handling, and API response schema that align with our versioning practices and coding standards.

  • Route Registration:
    • router.use('/bridge/v2', bridgeV2Route) in packages/rest-api/src/routes/index.ts correctly places the endpoint under the intended API version.
  • Implementation Details:
    • The route file (packages/rest-api/src/routes/bridgeV2Route.ts) correctly sets up the necessary middlewares (e.g., input validation, normalization, checksum) and integrates the controller.
    • The controller (packages/rest-api/src/controllers/bridgeV2Controller.ts) properly validates inputs, handles errors, and formats the response as expected.

The reviewed code meets the requirements and no further changes are necessary.

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

6-6: Imports updated for cleaner code structure.

The imports have been reorganized to replace the zap data encoding/decoding functions with slippage-related functions and to add the new setMinFinalAmount function. This reflects the shift in implementation approach.

Also applies to: 19-19


107-110: Improved route finalization with cleaner implementation.

The previous implementation likely decoded and re-encoded zap data to apply slippage. This new approach using setMinFinalAmount is more direct and maintainable, avoiding unnecessary encoding/decoding steps while achieving the same result.

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

91-93: Enhanced quote return structure with additional context.

Adding tokenIn, tokenOut, and amountIn (as BigNumber) to the return object provides more complete context about the swap operation. This allows consumers of this API to have all relevant information without needing to track input parameters separately.

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

25-27: Consistent quote return structure across engines.

Adding the same fields (tokenIn, tokenOut, and amountIn) as in DefaultEngine ensures consistency across all engine implementations, making the API more predictable and easier to use.

packages/sdk-router/src/rfq/quote.ts (2)

81-81: Refactored to use new helper function.

Replaced inline calculation with a call to the new getDestAmount function, improving code readability and maintainability.


89-94: New utility function for destination amount calculation.

This function extracts the destination amount calculation logic into a reusable function, which is good for maintainability. The calculation uses proportional scaling based on the quote rates.

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

16-16: Good refactoring by adding getEmptyQuote function import.

This change improves code reusability and maintainability by centralizing the initialization of empty quote objects.


69-69: Good refactoring using getEmptyQuote instead of hardcoded values.

Using the getEmptyQuote function with spread operator reduces code duplication and ensures consistent empty quote initialization across different engines.


129-132: Valuable enhancement to the quote response by adding token details.

Adding tokenIn, tokenOut, and amountIn to the returned quote enriches the API response with important context that consumers might need. This makes the quote more self-contained and reduces the need for consumers to track these values separately.

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

12-12: Good refactoring by adding getEmptyQuote function import.

This change improves code reusability and maintainability by centralizing the initialization of empty quote objects.


67-67: Good refactoring using getEmptyQuote instead of hardcoded values.

Using the getEmptyQuote function with spread operator reduces code duplication and ensures consistent empty quote initialization across different engines.


135-137: Valuable enhancement to the quote response by adding token details.

Adding tokenIn, tokenOut, and amountIn to the returned quote enriches the API response with important context that consumers might need. This makes the quote more self-contained and reduces the need for consumers to track these values separately.

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

9-9: Good refactoring by adding getEmptyQuote function import.

This change improves code reusability and maintainability by centralizing the initialization of empty quote objects.


45-45: Good refactoring using getEmptyQuote instead of manually defining empty quotes.

Using the getEmptyQuote function simplifies code and ensures consistent empty quote initialization across different engines. Note that unlike other engines, this implementation uses direct assignment without spread operator since there are no additional properties.


86-88: Valuable enhancement to the quote response by adding token details.

Adding tokenIn, tokenOut, and amountIn to the returned quote enriches the API response with important context that consumers might need. This makes the quote more self-contained and reduces the need for consumers to track these values separately.

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

1-1: Good addition of PopulatedTransaction import.

Adding this import supports the new BridgeQuoteV2 type which includes an optional tx property of type PopulatedTransaction.


85-90: Well-designed type definition for BridgeTokenCandidate.

This new type provides a clear structure for representing token pairs across different chains in bridge operations, with properties for both origin and destination chain IDs and token addresses.


92-97: Well-structured BridgeRouteV2 type definition.

This type enhances the bridge route information with clearer token candidate specification and additional properties like minOriginAmount, destAmountOut, and optional zapData. The structure allows for more detailed route information compared to the original BridgeRoute type.

packages/sdk-router/src/swap/models/steps.ts (4)

7-12: Well-implemented utility function for retrieving zap data

This utility function correctly retrieves the zap data from the last step and includes proper error handling for empty arrays.


14-23: LGTM: Clean implementation of zap data setter

The function provides a clean way to update the last step's zap data while maintaining proper error handling for edge cases.


25-27: Well-designed helper with null handling

Good use of the nullish coalescing operator to provide a default value when minFinalAmount is not present in the zap data.


29-37: LGTM: Composable utility that preserves existing data

This function nicely builds upon the other utilities and correctly preserves existing zap data while updating only the minFinalAmount property.

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

41-53: LGTM: Clear API call with well-structured parameters

The call to Synapse.bridgeV2 is well-structured with all required parameters mapped correctly from the request.


77-85: LGTM: Comprehensive error handling

The error handling is well-implemented with detailed logging that includes the query parameters, error message, and stack trace.

packages/sdk-router/src/gaszip/gasZipModuleSet.ts (4)

7-8: LGTM: Appropriate type imports

The imports for BridgeRouteV2 and BridgeTokenCandidate types are correctly added to support the new functionality.


27-27: LGTM: Clear feature support indication

The isBridgeV2Supported property with an explanatory comment clearly indicates that this module doesn't support Bridge V2 functionality.


70-72: LGTM: Placeholder method implementation

The empty array return is appropriate for a placeholder implementation where the functionality is not supported.


74-78: LGTM: Clear error message for unsupported functionality

The method correctly throws an error with a clear message indicating that the functionality is not supported by this module.

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

10-12: LGTM: Useful extension of SwapEngineQuote type

The addition of tokenIn, tokenOut, and amountIn properties to the SwapEngineQuote type enhances its information content and usability.


24-27: LGTM: Properly initialized default values

The empty quote correctly initializes the new properties with appropriate default values.


33-33: LGTM: Simplified implementation using spread operator

The use of the spread operator to incorporate all properties from getEmptyQuote is a clean and maintainable approach.

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

4-4: Confirmed Imports.

Importing Zero and MaxUint256 from @ethersproject/constants is appropriate for the new bridging logic.


13-18: Swap Utility Imports Look Good.

The newly imported functions (getMinFinalAmount, setMinFinalAmount, etc.) are consistent with the bridging logic.


21-22: Confirmed Additional Imports.

Bringing in BridgeQuoteV2, BridgeRouteV2, and deadline utilities aligns with the expanded bridging features.


24-24: Constant Definition Approved.

FULL_BALANCE = MaxUint256 is a clear expression of using the maximum possible token amount.

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

2-2: Dependency Confirmation.

Importing utils from 'ethers' is appropriate here for address normalization and other helpers.


12-18: Clearer Type Differentiation.

Introducing BridgeQuoteV2 for versioned bridging is well-organized. Make sure all references consistently distinguish between BridgeQuote and BridgeQuoteV2 to avoid confusion.


19-29: Thorough Parameter Documentation.

The JSDoc for BridgeV2Parameters is comprehensive and helps clarify each option for end users.


30-40: Verify Downstream Deadline Handling.

deadline is typed as a plain number here, while certain downstream operations may require BigNumber. Verify that subsequent logic always converts or handles the numeric deadline appropriately.


42-59: Parallel V1 and V2 Quote Collection.

Combining both sets of quotes and returning them sorted is efficient. Ensure that if _collectV2Quotes encounters errors for certain modules, partial failures don’t break the entire response.


61-129: Slippage & Deadline Application.

Applying slippage and deadlines to each quote is straightforward. This approach keeps the transformations uniform across all bridging routes.

packages/sdk-router/src/router/synapseCCTPRouterSet.ts (3)

7-7: No concerns with the new imports.
They align well with the added methods below and maintain consistency across the codebase.


37-38: Validate router address resolution for robustness.
The call to .chainGasAmount() assumes a valid router on destChainId. Confirm whether there’s an earlier validation step to guarantee the router exists, or add a safety check here.


54-58: BridgeRouteV2 is not supported — confirm intended behavior.
Throwing an error is fine, but ensure that this is the desired outcome in all scenarios where BridgeV2 functionality is invoked.

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

1-13: Import statements look fine.
They correctly bring in dependencies for Express, validation, and custom utilities.


16-183: OpenAPI documentation is comprehensive.
The summary, parameter definitions, and response schemas appear consistent. This thorough documentation will help consumers understand the endpoint usage.


236-236: Export statement is straightforward.
No issues identified with exporting the router as default.

packages/sdk-router/src/router/synapseRouterSet.ts (2)

8-8: No issues with the updated import.
The reimported interfaces match the new functionality provided in the file.


46-57: Validate token type logic before returning gas drop.
If destBridgeToken is missing or invalid, a short-circuit to Zero might be safest. Also, look out for performance overhead from router.getBridgeTokenType().

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

5-5: Use of NodeCache for ephemeral quote caching
Importing node-cache facilitates in-memory caching of quotes. This approach can significantly reduce redundant data fetching.


20-23: New type imports for bridging
The addition of BridgeTokenCandidate, BridgeRouteV2, GetBridgeTokenCandidatesParameters, and GetBridgeRouteV2Parameters helps align the module interface with Bridge V2 requirements.


27-28: Utility imports for bridging
These newly added imports (calculateDeadline, applyQuote, and getOriginAmount) support bridging calculations and time constraints.


30-33: Consistent use of utility imports
Including getAllQuotes, isSameAddress, and encodeZapData is well-structured for bridging logic.


41-41: Explicitly flagging Bridge V2 support
Setting isBridgeV2Supported to true clarifies this router set’s readiness for V2 bridging logic.


50-50: Class-level cache reference
Defining quotesCache as a private property ensures centralized access to cached data across multiple methods.


88-88: Simplified getGasDropAmount returning Zero
While returning Zero may suffice for now, revisit if future expansions require dynamic gas incentives on different routes.


382-382: Switch to cached retrieval
Calling this.getCachedAllQuotes() instead of getAllQuotes() marks a solid optimization for performance and scalability.

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

6-13: Expanded import of bridging types
Bringing in BridgeQuote, BridgeQuoteV2, BridgeRoute, etc. ensures a more versatile module definition for advanced bridging scenarios.


17-17: Slippage type import
Importing Slippage supports flexible bridging computations that account for dynamic pricing or volatility.


19-24: Definition of GetBridgeTokenCandidatesParameters
Defining this parameter type clarifies input structure for retrieving token candidates, boosting type safety.


26-33: Definition of GetBridgeRouteV2Parameters
Adding optional fields for sender, recipient, and slippage ensures that routing can accommodate varied use cases.


38-38: Bridge V2 capability
The new abstract isBridgeV2Supported property highlights whether derived classes implement the V2 bridging logic.


119-122: Abstract getBridgeTokenCandidates method
Enforcing a consistent interface for retrieving token candidates encourages reliability and uniformity across modules.


123-125: Abstract getBridgeRouteV2 method
This contract clarifies how bridging routes are determined, consolidating logic for next-generation bridging.


159-159: Refactoring getGasDropAmount signature
Switching from a BridgeRoute parameter to (destChainId, destBridgeToken) enhances clarity and reduces coupling, but verify all caller sites have been updated accordingly.

Also applies to: 164-166, 168-171


259-262: Applying updated getGasDropAmount signature
Using the new parameters in finalizeBridgeRoute ensures consistency throughout the bridging flow.


267-282: New finalizeBridgeQuoteV2 method
Incorporating a unique ID, estimated time, and a computed gas drop amount provides a comprehensive final quote object for advanced bridging.

Comment on lines +422 to +460
private async getBridgeZapData(
bridgeToken: BridgeTokenCandidate,
destAmountOut: BigNumber,
originSender?: string,
destRecipient?: string
): Promise<string | undefined> {
if (
destAmountOut.isZero() ||
!originSender ||
!destRecipient ||
isSameAddress(originSender, USER_SIMULATED_ADDRESS) ||
isSameAddress(destRecipient, USER_SIMULATED_ADDRESS)
) {
return undefined
}
const bridgeParams: IFastBridge.BridgeParamsStruct = {
dstChainId: bridgeToken.destChainId,
sender: originSender,
to: destRecipient,
originToken: bridgeToken.originToken,
destToken: bridgeToken.destToken,
// Will be set in encodeZapData below
originAmount: 0,
destAmount: destAmountOut,
sendChainGas: false,
deadline: calculateDeadline(this.getDefaultPeriods().destPeriod),
}
const fastBridge = await this.getFastBridgeRouter(
bridgeToken.originChainId
).getFastBridgeContract()
const fastBridgeCalldata = (
await fastBridge.populateTransaction.bridge(bridgeParams)
).data
return encodeZapData({
target: fastBridge.address,
payload: fastBridgeCalldata,
amountPosition: 4 + 32 * 5,
})
}
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

Implementation of getBridgeZapData
The checks for zero amounts and user-simulated addresses are well-placed. For additional resilience, consider validating addresses and gracefully handling any potential contract call errors.

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: 0

🧹 Nitpick comments (8)
packages/sdk-router/README.md (1)

15-15: Fix markdown linting issue with bare URL

The static analysis tool flagged a markdown linting issue (MD034) with the bare URL. In markdown, it's better to use links with descriptive text.

-| RFQ_API_URL | URL for the RFQ API | https://rfq-api.omnirpc.io |
+| RFQ_API_URL | URL for the RFQ API | `https://rfq-api.omnirpc.io` |

Alternatively, you could use a markdown link format:

-| RFQ_API_URL | URL for the RFQ API | https://rfq-api.omnirpc.io |
+| RFQ_API_URL | URL for the RFQ API | [https://rfq-api.omnirpc.io](https://rfq-api.omnirpc.io) |
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

15-15: Bare URL used
null

(MD034, no-bare-urls)

packages/synapse-interface/CHANGELOG.md (1)

17-20: Ensure Consistent Heading Levels

The changelog uses inconsistent heading levels between version entries. For example, the [0.43.1] version header on line 6 is set as an H2 (##), while the [0.43.0] header on line 17 is an H1 (#). This inconsistency causes the subsequent section heading "### Features" (line 20) to trigger a markdown lint warning (expected an H2 but found an H3). To fix this you should update the [0.43.0] entry to also use an H2. This change will ensure that all version entries are at the same level and that sub-headings under each version increment by one level only.

-# [0.43.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.42.7...@synapsecns/synapse-interface@0.43.0) (2025-03-11)
+## [0.43.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.42.7...@synapsecns/synapse-interface@0.43.0) (2025-03-11)
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

20-20: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

packages/widget/package.json (1)

71-71: Dependency Update for @synapsecns/sdk-router
The dependency has been updated from ^0.14.0 to ^0.15.0. Please confirm that this change is compatible with the widget package and does not introduce breaking changes downstream.

packages/rest-api/package.json (1)

25-25: Dependency Upgrade Check
The dependency on @synapsecns/sdk-router is now set to ^0.15.0. It is important to verify that the new version does not disrupt any of the API endpoints or internal integrations.

packages/synapse-interface/package.json (1)

44-44: Dependency Update in Interface Package
The dependency "@synapsecns/sdk-router" is now updated to ^0.15.0. Please check that this change integrates smoothly with the existing code and that no compatibility issues arise.

packages/rest-api/README.md (1)

10-18: Addition of Environment Variables Documentation
The new "Environment Variables" section clearly documents the RFQ_API_URL and RFQ_INDEXER_URL along with their descriptions and default values. This is a significant improvement for users configuring the REST API. Additionally, consider wrapping bare URLs in link syntax or angle brackets if your markdown style guide advises against bare URLs.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

16-16: Bare URL used
null

(MD034, no-bare-urls)


17-17: Bare URL used
null

(MD034, no-bare-urls)

packages/synapse-interface/components/StateManagedBridge/BridgeExchangeRateInfo.tsx (2)

68-68: Add null/undefined checks for destructured properties

The destructuring now includes originTokenForQuote and destTokenForQuote instead of bridgeModuleName, which aligns with the BridgeV2 changes. However, these properties could potentially be undefined when the bridge quote is being loaded or reset.

- bridgeQuote: { exchangeRate, originTokenForQuote, destTokenForQuote },
+ bridgeQuote: { exchangeRate, originTokenForQuote = null, destTokenForQuote = null },

70-71: Consider adding null/undefined safety to token type comparison

The new areSameAssets constant is a good addition to determine if slippage calculation is applicable. However, it assumes both tokens are always defined, which might not be the case during loading states.

- const areSameAssets =
-   originTokenForQuote?.swapableType === destTokenForQuote?.swapableType
+ const areSameAssets =
+   originTokenForQuote?.swapableType !== undefined && 
+   destTokenForQuote?.swapableType !== undefined &&
+   originTokenForQuote?.swapableType === destTokenForQuote?.swapableType
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b9d2e07 and 22a825b.

📒 Files selected for processing (26)
  • packages/sdk-router/src/rfq/fastBridgeRouterSet.ts (1 hunks)
  • packages/sdk-router/src/rfq/fastBridgeRouterSet.ts (2 hunks)
  • packages/sdk-router/src/rfq/fastBridgeRouterSet.ts (1 hunks)
  • packages/sdk-router/src/rfq/fastBridgeRouterSet.ts (3 hunks)
  • packages/sdk-router/src/rfq/fastBridgeRouterSet.ts (3 hunks)
  • packages/sdk-router/src/rfq/fastBridgeRouterSet.ts (5 hunks)
  • packages/rest-api/CHANGELOG.md (1 hunks)
  • packages/rest-api/README.md (1 hunks)
  • packages/rest-api/package.json (2 hunks)
  • packages/rest-api/src/constants/bridgeMap.ts (1 hunks)
  • packages/rest-api/src/tests/destinationTokensRoute.test.ts (1 hunks)
  • packages/rest-api/src/utils/isGatewayRoute.ts (2 hunks)
  • packages/sdk-router/CHANGELOG.md (1 hunks)
  • packages/sdk-router/README.md (1 hunks)
  • packages/sdk-router/package.json (1 hunks)
  • packages/sdk-router/src/constants/chainIds.ts (3 hunks)
  • packages/sdk-router/src/constants/medianTime.ts (1 hunks)
  • packages/sdk-router/src/rfq/api.ts (2 hunks)
  • packages/sdk-router/src/rfq/fastBridgeRouterSet.ts (1 hunks)
  • packages/synapse-interface/CHANGELOG.md (1 hunks)
  • packages/synapse-interface/components/StateManagedBridge/BridgeExchangeRateInfo.tsx (1 hunks)
  • packages/synapse-interface/constants/bridgeMap.ts (1 hunks)
  • packages/synapse-interface/package.json (2 hunks)
  • packages/synapse-interface/scripts/generateMaps.js (1 hunks)
  • packages/widget/CHANGELOG.md (1 hunks)
  • packages/widget/package.json (2 hunks)
✅ Files skipped from review due to trivial changes (3)
  • packages/sdk-router/package.json
  • packages/synapse-interface/scripts/generateMaps.js
  • packages/widget/CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/sdk-router/src/rfq/fastBridgeRouterSet.ts
  • packages/sdk-router/src/rfq/fastBridgeRouterSet.ts
  • packages/sdk-router/src/rfq/fastBridgeRouterSet.ts
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
packages/rest-api/README.md

16-16: Bare URL used
null

(MD034, no-bare-urls)


17-17: Bare URL used
null

(MD034, no-bare-urls)

packages/sdk-router/README.md

15-15: Bare URL used
null

(MD034, no-bare-urls)

packages/synapse-interface/CHANGELOG.md

20-20: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (27)
packages/rest-api/src/constants/bridgeMap.ts (1)

946-947: Added RFQ bridging options for HYPE token, looks good!

The changes to add 'RFQ.ETH' and 'RFQ.USDC' to both the origin and destination arrays for the HYPE token align with the BridgeV2 implementation. This enhances the token's bridging capabilities to support the new RFQ functionality.

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

60-60: Added HYPEREVM to MEDIAN_TIME_RFQ with 15 seconds median time

The addition of HYPEREVM chain to the MEDIAN_TIME_RFQ constant with a 15-second median time is consistent with other recently added chains.

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

11-11: Added HYPEREVM chain ID definition

The HYPEREVM chain has been properly defined with ID 999 in the SupportedChainId enum.


39-39: Added HYPEREVM to unsupported bridge chains

HYPEREVM is correctly added to UNSUPPORTED_BRIDGE_CHAIN_IDS, indicating SynapseBridge is not deployed on this chain.


94-94:

❓ Verification inconclusive

Added HYPEREVM to RFQ supported chains

HYPEREVM has been added to RFQ_SUPPORTED_CHAIN_IDS, making it available for FastBridge operations.

Recommendation: Consid A93C er also adding HYPEREVM to INTENTS_SUPPORTED_CHAIN_IDS if swap operations should be supported on this chain.


🏁 Script executed:

#!/bin/bash
# Check if HYPEREVM should be added to INTENTS_SUPPORTED_CHAIN_IDS
echo "Current INTENTS_SUPPORTED_CHAIN_IDS configuration:"
cat packages/sdk-router/src/constants/chainIds.ts | grep -A15 "INTENTS_SUPPORTED_CHAIN_IDS"
echo ""
echo "Checking if RFQ chains usually align with INTENTS chains..."
rg "RFQ_SUPPORTED_CHAIN_IDS|INTENTS_SUPPORTED_CHAIN_IDS" ./packages/sdk-router/src

Length of output: 1686


HYPEREVM Added to RFQ Supported Chains – Verify INTENTS Inclusion if Needed

HYPEREVM has been successfully added to RFQ_SUPPORTED_CHAIN_IDS, enabling its use for FastBridge operations. However, the current configuration of INTENTS_SUPPORTED_CHAIN_IDS (located in packages/sdk-router/src/constants/chainIds.ts) does not include HYPEREVM.

  • Location: packages/sdk-router/src/constants/chainIds.ts
  • Current INTENTS Configuration:
    export const INTENTS_SUPPORTED_CHAIN_IDS: number[] = [
      SupportedChainId.ARBITRUM,
      SupportedChainId.BASE,
      SupportedChainId.BERACHAIN,
      SupportedChainId.BLAST,
      SupportedChainId.BSC,
      SupportedChainId.ETH,
      SupportedChainId.LINEA,
      SupportedChainId.OPTIMISM,
      SupportedChainId.SCROLL,
      SupportedChainId.UNICHAIN,
      SupportedChainId.WORLDCHAIN,
    ].filter((chainId) => !PAUSED_CHAIN_IDS.includes(chainId))

Recommendation:
If swap operations on HYPEREVM are intended, please consider also adding HYPEREVM to INTENTS_SUPPORTED_CHAIN_IDS to ensure consistency between supported operations across chains.

packages/rest-api/src/utils/isGatewayRoute.ts (3)

3-6: Good implementation of environment variable configuration

Adding environment variables with sensible defaults for the RFQ API and Indexer URLs improves configuration flexibility, following the twelve-factor app methodology. This approach allows for easier deployment across different environments without code changes.


32-32: LGTM: Good refactoring of hardcoded values

Using the environment variable-based constant instead of a hardcoded URL improves maintainability.


37-37: LGTM: Good refactoring of hardcoded values

Using the environment variable-based constant instead of a hardcoded URL improves maintainability.

packages/sdk-router/README.md (1)

9-15: Great addition of environment variables documentation

Adding documentation for the environment variables is helpful for SDK users, making the configuration options clear and accessible.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

15-15: Bare URL used
null

(MD034, no-bare-urls)

packages/widget/package.json (1)

4-4: Version Bump Update
The version number has been successfully updated to "0.9.19". Please verify that this version bump is consistently applied across release notes and any documentation references.

packages/rest-api/package.json (1)

3-3: Version Bump for REST API Package
The package version has been updated to "1.11.0", aligning with the new feature enhancements. Ensure that any consumers of this package are aware of the version change and the potential related updates.

packages/synapse-interface/package.json (1)

3-3: Interface Package Version Update
The version number has been updated to "0.43.1". Ensure this version bump is properly documented and that any dependent modules are updated accordingly.

packages/rest-api/CHANGELOG.md (1)

6-12: Changelog Entry for Version 1.11.0
The changelog now includes a detailed entry for version 1.11.0, notably covering the new SDK chains feature ([SYN-45]) along with the corresponding commit and issue references. This thorough documentation will help users and maintainers track changes effectively.

packages/sdk-router/CHANGELOG.md (2)

6-7: New Version Entry for 0.15.0 Added

The new version entry is correctly formatted—it includes the compare URL, proper version tag, and release date as outlined by changelog conventions. This addition aligns with best practices for documenting release changes.


9-11: Feature Section for SDK New Chains is Clear and Informative

The feature description for the new SDK chains clearly lists the issue reference ([SYN-45]), the GitHub issue ([#3535]), and the commit hash ([6e956a3]). It also notes that the entry closes issue [#3537]. This detailed information is very useful for tracking the change history and impact of the update.

packages/rest-api/src/tests/destinationTokensRoute.test.ts (1)

65-65: Test updated to reflect increased token count.

The test expectation has been correctly updated to check for 9 destination tokens instead of 8, which aligns with the introduction of the new BridgeV2 functionality that likely adds one more token option for the given input parameters.

packages/synapse-interface/constants/bridgeMap.ts (1)

946-947:

✅ Verification successful

Expanded origin and destination options for HYPE symbol.

The changes enhance the HYPE token's bridging capabilities by adding RFQ.ETH and RFQ.USDC as both origin and destination options, which makes it consistent with the BridgeV2 functionality being introduced in this PR.

Let's verify if these are the only changes needed to the BRIDGE_MAP or if similar updates are needed for other tokens:


🏁 Script executed:

#!/bin/bash
# Search for other potential places where RFQ.ETH and RFQ.USDC might need to be added

# Check ETH symbol entries in BRIDGE_MAP for consistency
echo "Checking ETH entries in BRIDGE_MAP:"
rg "symbol: 'ETH'" -A 5 packages/synapse-interface/constants/bridgeMap.ts

# Check for other symbols that might need similar updates
echo "\nChecking for existing RFQ.ETH usage:"
rg "'RFQ.ETH'" packages/synapse-interface/constants/bridgeMap.ts | grep -v HYPE

echo "\nChecking for existing RFQ.USDC usage:"
rg "'RFQ.USDC'" packages/synapse-interface/constants/bridgeMap.ts | grep -v HYPE

Length of output: 5807


Verification Confirmed: HYPE Token Mapping Update is Correct

The changes to the HYPE token—adding both RFQ.ETH and RFQ.USDC to the origin and destination arrays—are consistent with the extended BridgeV2 functionality. The shell output confirms that while other tokens (like those with symbol ETH or CCTP.USDC) use different bridging options (e.g., including nETH), no similar updates are required elsewhere in the BRIDGE_MAP.

• HYPE’s updated entry now properly reflects the new bridging options.
• Other tokens continue to use their intended mapping (for instance, ETH tokens still use nETH where applicable).

No additional updates are needed in the BRIDGE_MAP.

packages/synapse-interface/components/StateManagedBridge/BridgeExchangeRateInfo.tsx (2)

78-78: LGTM - Improved condition logic for displaying slippage

The updated condition correctly uses the new areSameAssets check instead of relying on bridgeModuleName. This is a more direct and accurate approach to determine when slippage information should be displayed.


87-98:

❓ Verification inconclusive

Verify if bridgeModuleName is still needed in Router component

While the Slippage component no longer destructures bridgeModuleName from bridgeQuote, the Router component still relies on it. This suggests there might be an inconsistency or that bridgeModuleName is still available in the bridgeQuote object despite the BridgeV2 changes.


🏁 Script executed:

#!/bin/bash
# Check if bridgeModuleName is still part of the bridgeQuote object in the codebase

# Look for the definition of the bridgeQuote type
echo "Looking for bridgeQuote type definition..."
rg -A 10 -B 10 "type.*BridgeQuote" --type=typescript

# Look for usages of bridgeModuleName
echo "Looking for usages of bridgeModuleName..."
rg "bridgeModuleName" --type=typescript

Length of output: 352


Ensure Consistent Use of bridgeModuleName Across Components

It appears that the Router component still reads the bridgeModuleName value from the bridgeQuote state. However, our initial search for the bridgeQuote type and for usages of bridgeModuleName did not return any results due to file type filtering issues. This means we haven’t conclusively verified whether the property is still part of the bridgeQuote type or if its usage in Router is intentional under the BridgeV2 changes.

Please confirm that:

  • The bridgeQuote object still includes a valid bridgeModuleName property in its type definition.
  • The Router component’s reliance on bridgeModuleName is intentional given the recent changes (especially the removal in the Slippage component).

If both points are verified to be correct, no changes are needed; otherwise, update the Router component (or state definition) accordingly.

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

77-79:

✅ Verification successful

Confirm the removal of route-based gas drop logic.
By removing the parameter and always returning zero, you’ve effectively disabled any prior rebate or per-route logic. Please verify that all upstream callers expecting route-based offsets or rebates have been updated and that this change won't disrupt existing flows.

Below is a script to help ensure there are no remaining references to the old signature:


🏁 Script executed:

#!/bin/bash
# Searching for calls to the old getGasDropAmount() signature with parameters
ast-grep --pattern $'getGasDropAmount($_)' --json

Length of output: 53


Confirmed: Route-based gas drop logic has been successfully removed.
The verification script found no references to the old getGasDropAmount() signature, which indicates that upstream callers expecting route-based offsets or rebates have been updated accordingly.

packages/sdk-router/src/rfq/api.ts (7)

3-3: Import statement for ticker marshalling looks good.
No issues with adding this import; it's used appropriately below for creating quote keys.


10-11: Environment variable usage is straightforward.
Defining CUSTOM_API_URL as an override with a default fallback is clear. Remember to ensure the environment value is sanitized and not user-provided directly.


15-24: Documentation and implementation for getApiEndpoints are concise.
The logic of returning both endpoints when distinct is a solid approach to avoid duplicates.


26-61: Robust approach to fetching quotes from a single endpoint.
Timeout handling, logging, and error catching are well-implemented. Consider adding logic to distinguish different error statuses if needed.


63-71: Unique key generation is clear.
Combining relayer address and ticker ensures no collisions.


73-95: Merging quotes by most recent timestamp is efficient.
Using a map is effective for deduplication, and preserving the latest quote is a sensible approach.


97-112: Parallel fetching and merging of all quotes is well-structured.
Returning an empty list on failures gracefully handles unrecoverable errors. The approach looks good.

ChiTimesChi and others added 2 commits March 14, 2025 12:26
- 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>
- 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>
@github-actions github-actions bot added the go Pull requests that update Go code label Mar 14, 2025
@ChiTimesChi ChiTimesChi merged commit 5f56502 into master Mar 14, 2025
38 of 39 checks passed
@ChiTimesChi ChiTimesChi deleted the feat/sdk-bridge-v2 branch March 14, 2025 12:43
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