Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(synapse-interface): upgrade wagmi, viem, rainbowkit to support smartwallet #2674

Merged
merged 5 commits into from
Jun 5, 2024

Conversation

bigboydiamonds
Copy link
Collaborator

@bigboydiamonds bigboydiamonds commented Jun 5, 2024

Summary by CodeRabbit

  • New Features

    • Improved contract interaction by introducing new parameter types for various token and liquidity pool functions.
  • Chores

    • Updated dependencies to the latest versions for better performance and security.
    • Updated Node.js version to v18.18.0 for improved compatibility and stability.

14a3800acde5bc56f9f7664d2cc6a421a3982cc1: synapse-interface preview link

Copy link
Contributor

coderabbitai bot commented Jun 5, 2024

Walkthrough

This update involves version bumps for several dependencies in the package.json file of packages/synapse-interface, specifically for @rainbow-me/rainbowkit, viem, and wagmi. Additionally, the Node.js version is updated in .nvmrc. In various TypeScript files under packages/synapse-interface/actions, the SimulateContractParameters type is introduced and applied to function calls involving contract simulations to enhance type safety.

Changes

File Path Change Summary
packages/synapse-interface/package.json Updated versions of @rainbow-me/rainbowkit, viem, and wagmi.
.nvmrc Updated Node.js version from v18.17.0 to v18.18.0.
.../actions/approveErc20Token.ts Introduced SimulateContractParameters type and used it in writeContract function call.
.../actions/harvestLpPool.ts Added SimulateContractParameters type and used it in simulateContract function call.
.../actions/stakeLpToken.ts Added SimulateContractParameters type and used it in simulateContract function call.
.../actions/swapPoolAddLiquidity.ts Added SimulateContractParameters type and used it in simulateContract function call.
.../actions/swapPoolRemoveLiquidity.ts Added SimulateContractParameters type and used it in simulateContract function call.
.../actions/swapPoolRemoveLiquidityOneToken.ts Added SimulateContractParameters type and used it in simulateContract function call.
.../actions/unstakeLpToken.ts Added SimulateContractParameters type and used it in simulateContract function call.

Poem

In the world of code, updates bloom,
New versions rise, dispelling gloom.
With SimulateContractParameters in the mix,
Our functions gain type-safe tricks.
Node.js steps up a notch,
As we watch our code take flight,
In the digital night. 🌙


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 Configration 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

cloudflare-workers-and-pages bot commented Jun 5, 2024

Deploying sanguine with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0f519de
Status: ✅  Deploy successful!
Preview URL: https://2e0656ae.sanguine.pages.dev
Branch Preview URL: https://fe-coinbase-smart-wallet.sanguine.pages.dev

View logs

Copy link

cloudflare-workers-and-pages bot commented Jun 5, 2024

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0f519de
Status:🚫  Build failed.

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 edb67ff and 40352d7.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/*.lock
Files selected for processing (1)
  • packages/synapse-interface/package.json (2 hunks)
Additional comments not posted (3)
packages/synapse-interface/package.json (3)

32-32: Version update for @rainbow-me/rainbowkit looks good. Ensure compatibility with new features.


74-74: Version update for wagmi looks good. Ensure all blockchain interactions are tested thoroughly.


73-73: Version update for viem looks good. Recommend thorough testing of dependent features.

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 40352d7 and 5936376.

Files selected for processing (1)
  • packages/synapse-interface/package.json (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/synapse-interface/package.json

@github-actions github-actions bot added size/m and removed size/l labels Jun 5, 2024
Copy link

codecov bot commented Jun 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 39.90228%. Comparing base (ebcc94c) to head (0f519de).
Report is 3 commits behind head on master.

Additional details and impacted files
@@                 Coverage Diff                 @@
##              master       #2674         +/-   ##
===================================================
+ Coverage   39.89549%   39.90228%   +0.00678%     
===================================================
  Files            180         180                 
  Lines          14736       14736                 
  Branches          80          80                 
===================================================
+ Hits            5879        5880          +1     
  Misses          8093        8093                 
+ Partials         764         763          -1     
Flag Coverage Δ
packages 90.57540% <ø> (+0.09920%) ⬆️

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
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 5936376 and 0f519de.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/*.lock
Files selected for processing (9)
  • .nvmrc (1 hunks)
  • packages/synapse-interface/actions/approveErc20Token.ts (2 hunks)
  • packages/synapse-interface/actions/harvestLpPool.ts (2 hunks)
  • packages/synapse-interface/actions/stakeLpToken.ts (2 hunks)
  • packages/synapse-interface/actions/swapPoolAddLiquidity.ts (2 hunks)
  • packages/synapse-interface/actions/swapPoolRemoveLiquidity.ts (2 hunks)
  • packages/synapse-interface/actions/swapPoolRemoveLiquidityOneToken.ts (2 hunks)
  • packages/synapse-interface/actions/unstakeLpToken.ts (2 hunks)
  • packages/synapse-interface/package.json (4 hunks)
Files skipped from review due to trivial changes (1)
  • .nvmrc
Files skipped from review as they are similar to previous changes (1)
  • packages/synapse-interface/package.json
Additional comments not posted (10)
packages/synapse-interface/actions/harvestLpPool.ts (1)

2-2: Integration of SimulateContractParameters looks correct and enhances type safety.

Also applies to: 29-29

Verification successful

The type SimulateContractParameters is defined locally within each file in the packages/synapse-interface/actions/ directory, ensuring correct usage without the need for imports.

  • packages/synapse-interface/actions/unstakeLpToken.ts
  • packages/synapse-interface/actions/swapPoolRemoveLiquidity.ts
  • packages/synapse-interface/actions/stakeLpToken.ts
  • packages/synapse-interface/actions/harvestLpPool.ts
  • packages/synapse-interface/actions/approveErc20Token.ts
  • packages/synapse-interface/actions/swapPoolRemoveLiquidityOneToken.ts
  • packages/synapse-interface/actions/swapPoolAddLiquidity.ts
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify integration with updated libraries.

# Test: Search for any errors or warnings related to the new type usage.
rg --type typescript $'SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 120



Script:

#!/bin/bash
# Description: Verify integration with updated libraries.

# Test: Search for any errors or warnings related to the new type usage.
rg --type ts 'SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 1382



Script:

#!/bin/bash
# Description: Verify the definition and import of `SimulateContractParameters`.

# Test: Search for the definition of `SimulateContractParameters`.
rg 'type SimulateContractParameters' --files-with-matches

# Test: Search for the import of `SimulateContractParameters`.
rg 'import.*SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 540



Script:

#!/bin/bash
# Description: Verify if `SimulateContractParameters` is defined locally in each file or if it should be imported.

# Test: Search for the definition of `SimulateContractParameters` within each file.
rg 'type SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 722

packages/synapse-interface/actions/stakeLpToken.ts (1)

2-2: Consistent use of SimulateContractParameters across different actions ensures uniformity and type safety.

Also applies to: 31-31

Verification successful

The search results indicate that the SimulateContractParameters type is consistently used across multiple files within the packages/synapse-interface/actions/ directory. This suggests that the integration of this type is uniform and likely correct.

Files where SimulateContractParameters is used:

  • unstakeLpToken.ts
  • swapPoolRemoveLiquidityOneToken.ts
  • swapPoolRemoveLiquidity.ts
  • stakeLpToken.ts
  • swapPoolAddLiquidity.ts
  • approveErc20Token.ts
  • harvestLpPool.ts

Consistent use of SimulateContractParameters across different actions ensures uniformity and type safety.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify integration with updated libraries.

# Test: Search for any errors or warnings related to the new type usage.
rg --type typescript $'SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 120



Script:

#!/bin/bash
# Description: Verify integration with updated libraries.

# Test: Search for any errors or warnings related to the new type usage.
rg --type ts 'SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 1382

packages/synapse-interface/actions/unstakeLpToken.ts (1)

2-2: Type casting with SimulateContractParameters is correctly applied, ensuring type safety.

Also applies to: 31-31

Verification successful

The type SimulateContractParameters is consistently used across multiple files within the packages/synapse-interface/actions/ directory, including unstakeLpToken.ts. This indicates that the type integration is uniform and there are no immediate errors or warnings related to its usage.

  • packages/synapse-interface/actions/unstakeLpToken.ts
  • packages/synapse-interface/actions/swapPoolRemoveLiquidityOneToken.ts
  • packages/synapse-interface/actions/swapPoolRemoveLiquidity.ts
  • packages/synapse-interface/actions/swapPoolAddLiquidity.ts
  • packages/synapse-interface/actions/stakeLpToken.ts
  • packages/synapse-interface/actions/harvestLpPool.ts
  • packages/synapse-interface/actions/approveErc20Token.ts
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify integration with updated libraries.

# Test: Search for any errors or warnings related to the new type usage.
rg --type typescript $'SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 120



Script:

#!/bin/bash
# Description: Verify integration with updated libraries.

# Test: Search for any errors or warnings related to the new type usage.
rg --type ts 'SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 1382

packages/synapse-interface/actions/approveErc20Token.ts (1)

2-2: Proper use of SimulateContractParameters for type safety in ERC20 token approval.

Also applies to: 40-40

Verification successful

The integration of SimulateContractParameters appears consistent across multiple files within the packages/synapse-interface/actions/ directory. The type is used in various action files without any apparent errors or warnings.

  • packages/synapse-interface/actions/unstakeLpToken.ts
  • packages/synapse-interface/actions/swapPoolRemoveLiquidityOneToken.ts
  • packages/synapse-interface/actions/swapPoolRemoveLiquidity.ts
  • packages/synapse-interface/actions/stakeLpToken.ts
  • packages/synapse-interface/actions/approveErc20Token.ts
  • packages/synapse-interface/actions/harvestLpPool.ts
  • packages/synapse-interface/actions/swapPoolAddLiquidity.ts
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify integration with updated libraries.

# Test: Search for any errors or warnings related to the new type usage.
rg --type typescript $'SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 120



Script:

#!/bin/bash
# Description: Verify integration with updated libraries.

# Test: Search for any errors or warnings related to the new type usage.
rg --type ts 'SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 1382

packages/synapse-interface/actions/swapPoolAddLiquidity.ts (1)

2-2: Correct application of SimulateContractParameters in liquidity addition actions enhances type safety.

Also applies to: 46-49

Verification successful

The integration of SimulateContractParameters appears consistent across multiple action files, including swapPoolAddLiquidity.ts. No errors or warnings were found related to the new type usage.

  • swapPoolAddLiquidity.ts correctly uses SimulateContractParameters.
  • Other files such as unstakeLpToken.ts, swapPoolRemoveLiquidityOneToken.ts, and stakeLpToken.ts also use SimulateContractParameters consistently.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify integration with updated libraries.

# Test: Search for any errors or warnings related to the new type usage.
rg --type typescript $'SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 120



Script:

#!/bin/bash
# Description: Verify integration with updated libraries.

# Test: Search for any errors or warnings related to the new type usage.
rg --type ts 'SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 1382

packages/synapse-interface/actions/swapPoolRemoveLiquidity.ts (1)

3-3: Consistent and correct use of SimulateContractParameters in liquidity removal actions ensures type safety.

Also applies to: 46-46

Verification successful

The search results indicate that the SimulateContractParameters type is consistently used across multiple action files, including swapPoolRemoveLiquidity.ts. This suggests that the integration of this type is uniform and likely correct.

  • swapPoolRemoveLiquidity.ts
  • unstakeLpToken.ts
  • swapPoolRemoveLiquidityOneToken.ts
  • stakeLpToken.ts
  • approveErc20Token.ts
  • swapPoolAddLiquidity.ts
  • harvestLpPool.ts

Given this consistency, it appears that the use of SimulateContractParameters is well-integrated across the codebase.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify integration with updated libraries.

# Test: Search for any errors or warnings related to the new type usage.
rg --type typescript $'SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 120



Script:

#!/bin/bash
# Description: Verify integration with updated libraries.

# Test: Search for any errors or warnings related to the new type usage.
rg --type ts 'SimulateContractParameters' packages/synapse-interface/actions/

Length of output: 1382

packages/synapse-interface/actions/swapPoolRemoveLiquidityOneToken.ts (4)

2-2: Import of SimulateContractParameters correctly added.


Line range hint 9-9: Function signature and parameters are correctly defined for blockchain interactions.


47-47: Correct use of SimulateContractParameters for type safety in blockchain operations.


47-47: Return statement is appropriate for the blockchain write operation.

@bigboydiamonds bigboydiamonds merged commit ab26028 into master Jun 5, 2024
42 checks passed
@bigboydiamonds bigboydiamonds deleted the fe/coinbase-smart-wallet branch June 5, 2024 20:01
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.

2 participants