Skip to content

Add Squid for Cosmos sdk chains#1793

Open
0xh3rman wants to merge 8 commits intomainfrom
cosmos-sign-swap
Open

Add Squid for Cosmos sdk chains#1793
0xh3rman wants to merge 8 commits intomainfrom
cosmos-sign-swap

Conversation

@0xh3rman
Copy link
Contributor

No description provided.

Add Decodable models (CosmosExecuteContractValue, CosmosCoinData, CosmosExecuteContractData) to parse execute contract JSON payloads and implement signSwap(in:privateKey:) in CosmosSigner. The new method decodes swap data, builds a CosmosMessage.wasmExecuteContractGeneric (setting sender, contract, executeMsg and mapping funds to CosmosAmount), and calls the existing sign(...) flow to produce a signed transaction string (preserving the memo).
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces support for Squid as a new swap provider, specifically targeting Cosmos SDK chains. It involves extending the SwapProvider enumeration, integrating associated UI assets, and modifying the core signing mechanism to correctly handle Cosmos-specific swap transactions, thereby enhancing the application's interoperability and swap capabilities.

Highlights

  • New Swap Provider: Added 'Squid' as a new SwapProvider option, expanding the available decentralized exchange integrations.
  • Cosmos Chain Signing Logic: Implemented specific signing logic within the Signer to correctly handle swap operations for Cosmos SDK chains, ensuring compatibility and proper transaction processing.
  • UI Asset Integration: Integrated the necessary UI assets, including an SVG icon and its asset catalog configuration, for the new 'Squid' swap provider.
  • Dependency Cleanup: Removed an unnecessary Keystore import from CosmosSigner.swift, streamlining dependencies.
  • Subproject Update: Updated the core subproject to a newer commit, reflecting upstream changes or improvements.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Packages/Primitives/Sources/SwapProvider.swift
    • Added squid as a new case to the SwapProvider enum.
  • Packages/PrimitivesComponents/Sources/Extensions/SwapProviderType+Gemstone.swift
    • Mapped the squid SwapProvider case to its corresponding image asset.
  • Packages/Signer/Sources/Chains/CosmosSigner.swift
    • Removed the Keystore import.
  • Packages/Signer/Sources/Signer.swift
    • Introduced conditional logic to use ChainSigner for Cosmos chain swap operations.
  • Packages/Style/Sources/Images.swift
    • Added a static property for the squid swap provider image.
  • Packages/Style/Sources/Resources/Assets.xcassets/swap_providers/squid.imageset/Contents.json
    • Added asset catalog configuration for the squid SVG image.
  • Packages/Style/Sources/Resources/Assets.xcassets/swap_providers/squid.imageset/squid.svg
    • Added the SVG icon for the squid swap provider.
  • core
    • Updated the subproject commit hash.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for the Squid swap provider, particularly for Cosmos SDK chains. The changes include adding the new provider to enums, including necessary image assets, and updating the transaction signing logic. My review includes a suggestion to refactor the signing logic for better code organization and maintainability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants