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 token command to check any ERC20 balance, transfer ERC20 #25

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Pratham-19
Copy link

Implementing

  • Check any token balance
  • Transfer any ERC20 token
  1. Check balance
  • Check any ERC20 token balance by default using the stored balance else can also provide address using
    rsk-cli token balance --contract <address> --address (optional) -t

image

  • Added contract validation
    image
  1. Transfer token

in progress...

@Pratham-19 Pratham-19 marked this pull request as draft November 24, 2024 13:05
@chrisarevalodev
Copy link
Collaborator

chrisarevalodev commented Nov 26, 2024

Hey @Pratham-19!

I’m really impressed with your improvements to the CLI—they look fantastic. I have a few comments about your implementation that are critical to address before we can merge your PR.

I’ve already tested it, and it works well! However, there are some aspects of the implementation that don’t align with the existing CLI structure and the plans outlined for upcoming features in our backlog.

Specifically, you created a new program called token in the bin/index.ts file, where you can call both balance and transfer commands for custom tokens. While this is a great addition, there are already existing commands named balance and transfer. The goal is to update these commands so that users can execute them as follows:

  • Balance Command: Run rsk-cli balance or rsk-cli balance --testnet. Using inquirer and ora, the CLI should prompt the user to choose between rBTC, RIF, USD RIF, DoC, or a custom token. If the user selects custom, the CLI should then ask for the contract address using inquirer.

  • Transfer Command: Similarly, run rsk-cli transfer or rsk-cli transfer --testnet. Here too, the CLI should prompt the user to specify the token type (rBTC, RIF, etc.) or provide a contract address for custom tokens and also the amount to be transferred.

For reference, there is a very similar implementation using inquirer and ora in the contract command, which you may find helpful as a guide.

Thanks again for your hard work! You’re doing an amazing job. If you have any questions or need further clarification, feel free to reach out.

@Pratham-19
Copy link
Author

Thanks for your comment @chrisarevalodev

I got the requirements, I'll revamp my code and add inquirer and ora for the same

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