Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fear(widget): Adds Linea #2983

Merged
merged 1 commit into from
Aug 6, 2024
Merged

fear(widget): Adds Linea #2983

merged 1 commit into from
Aug 6, 2024

Conversation

abtestingalpha
Copy link
Collaborator

@abtestingalpha abtestingalpha commented Aug 6, 2024

Summary by CodeRabbit

  • New Features

    • Upgraded the @synapsecns/widget dependency to a newer version, enhancing overall functionality.
    • Expanded token support by adding new entries for USDC, USDT, ETH, and WETH, improving bridge capabilities.
    • Introduced compatibility with the LINEA blockchain for USDC and ETH, allowing cross-chain transactions.
  • Bug Fixes

    • Updated existing token configurations for better clarity and functionality.

@abtestingalpha abtestingalpha changed the title Adds Linea fear(widget): Adds Linea Aug 6, 2024
Copy link
Contributor

coderabbitai bot commented Aug 6, 2024

Walkthrough

The recent updates enhance the @synapsecns/widget package by upgrading its dependency version and expanding the token bridge functionality. Key additions include new token mappings for USDC, USDT, ETH, and WETH, improvements in bridgeable tokens to support the LINEA blockchain, and the introduction of a new chain constant, LINEA, enriching the overall application capabilities.

Changes

File Change Summary
.../widget/examples/with-next/package.json Updated @synapsecns/widget version from ^0.1.0 to ^0.6.3.
.../widget/examples/with-react/package.json Updated @synapsecns/widget version from 0.1.0 to 0.6.3.
.../widget/src/constants/bridgeMap.ts Expanded BRIDGE_MAP with new token entries (USDC, USDT, ETH, WETH) and updated existing configurations.
.../widget/src/constants/bridgeable.ts Added support for LINEA blockchain for USDC and ETH in BridgeableToken constants.
.../widget/src/constants/chains.ts Introduced new LINEA constant with blockchain properties and included it in the CHAINS object.

Poem

In fields of code where rabbits hop,
New tokens bloom, and features swap.
With LINEA's grace, we leap and play,
Enhancing bridges in a joyful way!
So let us cheer for upgrades bright,
The future's here, and it's a delight! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This pull request adds support for the Linea blockchain to the Synapse widget, expanding its compatibility with different blockchain ecosystems.

  • Added Linea chain configuration in /packages/widget/src/constants/chains.ts with network details and RPC URLs
  • Updated BRIDGE_MAP in /packages/widget/src/constants/bridgeMap.ts to include Linea token information (USDC, USDT, ETH, WETH)
  • Modified /packages/widget/src/constants/bridgeable.ts to add USDC and ETH token addresses for Linea
  • Upgraded @synapsecns/widget package from version 0.1.0 to 0.6.3 in both Next.js and React example projects

5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

Comment on lines +450 to +452
primary: 'https://rpc.linea.build',
fallback: 'https://linea.blockpi.network/v1/rpc/public',
},
Copy link

Choose a reason for hiding this comment

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

style: Consider using HTTPS for both primary and fallback RPC URLs for enhanced security

Copy link

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 31ecd9b
Status: ✅  Deploy successful!
Preview URL: https://915fb409.sanguine-fe.pages.dev
Branch Preview URL: https://widget-adds-linea.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: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ef9ec3f and 31ecd9b.

Files selected for processing (5)
  • packages/widget/examples/with-next/package.json (1 hunks)
  • packages/widget/examples/with-react/package.json (1 hunks)
  • packages/widget/src/constants/bridgeMap.ts (5 hunks)
  • packages/widget/src/constants/bridgeable.ts (4 hunks)
  • packages/widget/src/constants/chains.ts (2 hunks)
Additional comments not posted (17)
packages/widget/examples/with-next/package.json (1)

12-12: Verify the impact of upgrading @synapsecns/widget to ^0.6.3.

The version upgrade from ^0.1.0 to ^0.6.3 may include new features, bug fixes, or breaking changes. Ensure that the application is tested thoroughly with this new version to avoid any unexpected issues.

packages/widget/examples/with-react/package.json (1)

6-6: Verify the impact of upgrading @synapsecns/widget to 0.6.3.

The version upgrade from 0.1.0 to 0.6.3 may include new features, bug fixes, or breaking changes. Ensure that the application is tested thoroughly with this new version to avoid any unexpected issues.

packages/widget/src/constants/chains.ts (2)

446-465: LGTM! Ensure the new LINEA constant is correctly integrated.

The addition of the LINEA constant follows the pattern of other chain constants and seems well-structured.


489-489: Verify the integration of the LINEA constant in the codebase.

Ensure that the new LINEA constant is correctly integrated and does not introduce any issues.

Verification successful

The LINEA constant is correctly integrated in the codebase.

The LINEA constant is consistently referenced across multiple files, indicating proper integration. Here are some key locations:

  • packages/widget/src/constants/chains.ts
  • packages/widget/src/constants/bridgeable.ts
  • packages/sdk-router/src/constants/chainIds.ts
  • packages/synapse-constants/constants/tokens/bridgeable.ts
  • packages/synapse-constants/constants/chains/master.ts
  • packages/synapse-constants/constants/chains/index.ts
  • packages/sdk-router/src/constants/medianTime.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of the LINEA constant in the codebase.

# Test: Search for the usage of the LINEA constant. Expect: Correct integration without issues.
rg --type typescript -A 5 $'LINEA'

Length of output: 68


Script:

#!/bin/bash
# Description: Verify the integration of the LINEA constant in the codebase.

# Test: Search for the usage of the LINEA constant in TypeScript files.
rg 'LINEA' --glob '*.ts' -A 5

Length of output: 8367

packages/widget/src/constants/bridgeable.ts (4)

439-439: Added support for LINEA blockchain for USDC token.

The address 0x176211869cA2b568f2A7D4EE941E073a821EE1ff and decimals 6 for the LINEA blockchain have been correctly added.


456-456: Confirmed decimal value for LINEA blockchain for USDC token.

The decimal value 6 for the LINEA blockchain has been correctly added and is consistent with other entries.


807-807: Added support for LINEA blockchain for ETH token.

The address ZeroAddress and decimals 18 for the LINEA blockchain have been correctly added.


819-819: Confirmed decimal value for LINEA blockchain for ETH token.

The decimal value 18 for the LINEA blockchain has been correctly added and is consistent with other entries.

packages/widget/src/constants/bridgeMap.ts (9)

1797-1803: Verify the address and consistency for the new USDC entry.

The new entry for USDC appears correct, but please verify the address 0x176211869cA2b568f2A7D4EE941E073a821EE1ff and ensure consistency with other entries.


1804-1810: Verify the address and consistency for the new USDT entry.

The new entry for USDT appears correct, but please verify the address 0xA219439258ca9da29E9Cc4cE5596924745e12B93 and ensure consistency with other entries.


1811-1817: Verify the address and consistency for the new ETH entry.

The new entry for ETH appears correct, but please verify the address 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE and ensure consistency with other entries.


1818-1824: Verify the address and consistency for the new WETH entry.

The new entry for WETH appears correct, but please verify the address 0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f and ensure consistency with other entries.


Line range hint 1844-1848:
Verify the changes and consistency for the updated WETH entry.

The updated entry for WETH appears correct, but please verify the changes to the origin field and ensure consistency with other entries.


1861-1862: Verify the changes and consistency for the updated ETH entry.

The updated entry for ETH appears correct, but please verify the changes to the origin and destination fields and ensure consistency with other entries.


1871-1872: Verify the changes and consistency for the updated nETH entry.

The updated entry for nETH appears correct, but please verify the changes to the origin field and ensure consistency with other entries.


1901-1906: Verify the address and consistency for the new USDT entry.

The new entry for USDT appears correct, but please verify the address 0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df and ensure consistency with other entries.


1881-1886: Verify the address and consistency for the new USDC entry.

The new entry for USDC appears correct, but please verify the address 0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4 and ensure consistency with other entries.

Copy link

codecov bot commented Aug 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 25.71722%. Comparing base (e84f0f6) to head (31ecd9b).
Report is 24 commits behind head on master.

Additional details and impacted files
@@                 Coverage Diff                 @@
##              master       #2983         +/-   ##
===================================================
+ Coverage   25.70802%   25.71722%   +0.00919%     
===================================================
  Files            771         771                 
  Lines          55613       55562         -51     
  Branches          80          82          +2     
===================================================
- Hits           14297       14289          -8     
+ Misses         39830       39788         -42     
+ Partials        1486        1485          -1     
Flag Coverage Δ
packages 90.55118% <ø> (+0.06555%) ⬆️

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.

Copy link

codecov bot commented Aug 6, 2024

Bundle Report

Changes will decrease total bundle size by 7.17MB ⬇️

Bundle name Size Change
widget-esm-cjs 278.13kB 2.88kB ⬆️
synapse-interface-server-cjs 1.38MB 683 bytes ⬆️
sdk-router-@synapsecns/sdk-router-cjs 526.89kB 4.95kB ⬆️
synapse-interface-edge-server-array-push 83 bytes 0 bytes
sdk-router-@synapsecns/sdk-router-esm 254.83kB 2.51kB ⬆️
widget-cjs-esm 276.17kB 276.17kB ⬆️
synapse-interface-client-array-push (removed) 7.46MB ⬇️

@abtestingalpha abtestingalpha merged commit 353aafc into master Aug 6, 2024
18 checks passed
@abtestingalpha abtestingalpha deleted the widget/adds-linea branch August 6, 2024 15:30
@coderabbitai coderabbitai bot mentioned this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant