near / near-cli

General purpose command line tools for interacting with NEAR Protocol
https://docs.near.org
MIT License
193 stars 94 forks source link

Bring back `repl` command #1097

Open mikedotexe opened 7 months ago

mikedotexe commented 7 months ago

There are quite a few useful things you can do with the repl, particularly with regards to utilities like formatting NEAR and getting public keys from private keys.

Would be great to undelete that command if it's possible

gagdiez commented 7 months ago

hey @mikedotexe , I hear you, and I see the use cases. What if we add the command:

near convert [--yoctoToNear] [--nearToYocto] [--secretKeyToPublic]

This way, the code would be compact, and super safe.

Having a whole JS interpreter in the command line is a bit of an overkill, and if I remember correctly, it adds lot of code and logic (+ multiple dependencies) to maintain.

I can add it back, but right now I am aiming for "maintainable" code - since apparently I am the only maintainer - more than "UX at any cost". If by just having a simple convert we can survive, I would strongly prefer that.

Let me know what you think

gagdiez commented 7 months ago

@mikedotexe what do you think of this:

near convert --yocto <number>

# Yocto: <> NEAR: <>
near convert --near <float>

# Yocto: <> NEAR <>
near convert --privateKey <>

# Public:
# Private:
# Phrase
near convert --secretKey <>

# Public:
# Private:
# Phrase