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/add hmstr #339

Merged
merged 5 commits into from
Sep 26, 2024
Merged

Feat/add hmstr #339

merged 5 commits into from
Sep 26, 2024

Conversation

haunv3
Copy link
Contributor

@haunv3 haunv3 commented Sep 26, 2024

Summary by CodeRabbit

  • New Features
    • Updated package version to 1.1.20.
    • Introduced new token icons: PepeIcon and HamsterIcon.
    • Added support for a new coin, HMSTR, with associated metadata and image.
  • Bug Fixes
    • Expanded the recognized CoinGecko IDs to include "hamster-kombat".

Copy link

coderabbitai bot commented Sep 26, 2024

Walkthrough

This pull request introduces several updates to the @oraichain/oraidex-common package. The version is incremented from 1.1.19 to 1.1.20. New constants for token icons, PepeIcon and HamsterIcon, are added, along with their corresponding entries in the tokensIcon array. Additionally, a new constant HMSTR_ORAICHAIN_DENOM is defined, and the network.ts file is updated to include a new coin configuration for "hamster-kombat".

Changes

File Path Change Summary
packages/oraidex-common/package.json Updated version from 1.1.19 to 1.1.20.
packages/oraidex-common/src/config/chainInfosWithIcon.ts Added PepeIcon and HamsterIcon constants; updated tokensIcon array with new entries.
packages/oraidex-common/src/constant.ts Added new constant HMSTR_ORAICHAIN_DENOM for ORAI chain denominations.
packages/oraidex-common/src/network.ts Imported HMSTR_ORAICHAIN_DENOM; updated CoinGeckoId type; added new coin configuration for "hamster-kombat".

Possibly related PRs

Suggested reviewers

  • trungbach
  • quangdz1704
  • meomeocoj

🐰 In the code where tokens play,
New icons hop in, bright as day!
With Hamster and Pepe joining the fun,
Together they shine, a web of one.
Version updated, constants anew,
A joyful leap, for me and you! 🌟


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

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

@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

🧹 Outside diff range and nitpick comments (2)
packages/oraidex-common/src/config/chainInfosWithIcon.ts (1)

23-24: LGTM! Consider using HTTPS URLs for consistency.

The addition of PepeIcon and HamsterIcon constants is consistent with the existing code structure. However, for improved security and consistency with other icon URLs in the file, consider using HTTPS URLs instead of HTTP.

Consider updating the URLs to use HTTPS:

-const PepeIcon = "http://assets.coingecko.com/coins/images/29850/standard/pepe-token.jpeg?1696528776";
-const HamsterIcon = "http://assets.coingecko.com/coins/images/39102/standard/hamster-removebg-preview.png?1720514486";
+const PepeIcon = "https://assets.coingecko.com/coins/images/29850/standard/pepe-token.jpeg?1696528776";
+const HamsterIcon = "https://assets.coingecko.com/coins/images/39102/standard/hamster-removebg-preview.png?1720514486";
packages/oraidex-common/src/network.ts (1)

530-536: New currency entry added for HMSTR token

A new entry has been added to the oraichainNetwork configuration for the HMSTR token. Let's review each property:

  1. coinDenom: "HMSTR" - This is the display denomination of the token.
  2. coinMinimalDenom: Uses the imported HMSTR_ORAICHAIN_DENOM constant.
  3. coinDecimals: 9 - This specifies the number of decimal places for the token.
  4. coinGeckoId: "hamster-kombat" - This matches the newly added CoinGeckoId.
  5. coinImageUrl: Points to an image on CoinGecko, which is consistent with other tokens.

The structure and properties of this new entry are consistent with other token entries in the configuration.

However, I have one suggestion to improve consistency:

Consider adding a bridgeTo property to the HMSTR token configuration, similar to other tokens in this list. This property indicates which networks the token can be bridged to. If HMSTR is not meant to be bridged, you can omit this property, but it would be good to confirm this intention.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between bf80b56 and b4f2fc7.

📒 Files selected for processing (4)
  • packages/oraidex-common/package.json (1 hunks)
  • packages/oraidex-common/src/config/chainInfosWithIcon.ts (2 hunks)
  • packages/oraidex-common/src/constant.ts (1 hunks)
  • packages/oraidex-common/src/network.ts (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/oraidex-common/package.json
🔇 Additional comments (6)
packages/oraidex-common/src/config/chainInfosWithIcon.ts (1)

129-138: LGTM! Verify CoinGecko IDs for accuracy.

The new entries for Pepe and Hamster tokens in the tokensIcon array are structurally consistent with existing entries.

To ensure the accuracy of the CoinGecko IDs, please run the following verification script:

This script will help confirm that the CoinGecko IDs are correct and return the expected token information.

✅ Verification successful

CoinGecko IDs Verified Successfully

The CoinGecko IDs "pepe" and "hamster-kombat" are valid and return the expected token information.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence and accuracy of the new CoinGecko IDs

# Test: Check if the CoinGecko IDs exist and return valid data
for id in "pepe" "hamster-kombat"; do
  echo "Checking $id..."
  curl -s "https://api.coingecko.com/api/v3/coins/$id" | jq '.id, .symbol, .name'
  echo "------------------------"
done

Length of output: 526

packages/oraidex-common/src/constant.ts (2)

Line range hint 1-103: Summary: New token constant added successfully

The addition of the HMSTR_ORAICHAIN_DENOM constant is the only change in this file. It follows the existing patterns and conventions for token denomination constants in the Oraichain ecosystem.

To ensure smooth integration:

  1. Verify if any updates are needed in other parts of the codebase where token denominations are used.
  2. Consider updating any relevant documentation or configuration files that list supported tokens.
  3. If applicable, ensure that any token-related UI components or selectors are updated to include this new token.

103-103: LGTM. Verify usage of the new constant across the codebase.

The addition of HMSTR_ORAICHAIN_DENOM constant is consistent with the existing code style and naming conventions. It appears to represent a new token denomination for the Oraichain ecosystem.

To ensure proper integration, please run the following script to check for any existing references to this token and verify if any updates are needed in other parts of the codebase:

✅ Verification successful

HMSTR_ORAICHAIN_DENOM Usage Verified

The HMSTR_ORAICHAIN_DENOM constant is properly referenced in the following files:

  • packages/oraidex-common/src/constant.ts
  • packages/oraidex-common/src/network.ts

No issues found with its integration across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for potential usages or references to the new HMSTR token.

# Test: Search for "HMSTR" string in all files. Expect: Occurrences related to the new token.
rg --type-add 'code:*.{js,ts,tsx,json}' --type code -i 'HMSTR'

# Test: Search for patterns similar to other token usage. Expect: Places where the new constant might need to be added.
rg --type-add 'code:*.{js,ts,tsx,json}' --type code 'ORAICHAIN_DENOM'

Length of output: 7694

packages/oraidex-common/src/network.ts (3)

62-63: New constant imported: HMSTR_ORAICHAIN_DENOM

The new constant HMSTR_ORAICHAIN_DENOM has been imported from the constant file. This is consistent with how other token denominations are imported in this file.


124-125: New CoinGeckoId added: "hamster-kombat"

The CoinGeckoId type has been updated to include "hamster-kombat". This addition is consistent with the existing pattern and allows the new token to be recognized by the system.


Line range hint 1-1120: Summary: HMSTR token integration looks good

The changes to add support for the HMSTR (Hamster Kombat) token to the Oraichain network have been implemented correctly and consistently with the existing code structure. The new token has been properly integrated into the necessary type definitions and network configurations.

The only minor suggestion is to consider adding a bridgeTo property to the HMSTR token configuration if applicable, to maintain consistency with other token entries.

Overall, these changes enhance the network's capability to handle transactions involving the new HMSTR token.

@haunv3 haunv3 merged commit 6cfdced into main Sep 26, 2024
3 of 4 checks passed
@haunv3 haunv3 deleted the feat/add-hmstr branch September 26, 2024 09:15
This was referenced Sep 26, 2024
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.

3 participants