neo-go icon indicating copy to clipboard operation
neo-go copied to clipboard

cli: Allow to get balance by script hash only

Open cthulhu-rider opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

I'm always frustrated when i cannot get balance by script hash only using Neo Go CLI. This info is public, accessible over Neo RPC, but wallet is required:

$ neo-go wallet nep17 balance --token GAS -a NSrcuBX2mLspBwXaagz2fC9dqGu2W7YwDV -r http://localhost:30333
bad wallet: wallet path is mandatory and should be passed using (--wallet, -w) flags or via wallet config using --wallet-config flag

Describe the solution you'd like

do not require -w flag in the command reading balance and leave:

$ neo-go wallet nep17 balance --token GAS -a NSrcuBX2mLspBwXaagz2fC9dqGu2W7YwDV -r http://localhost:30333
Account NSrcuBX2mLspBwXaagz2fC9dqGu2W7YwDV
GAS: GasToken (d2a4cff31913016155e38e474a2c06d08be276cf)
	Amount : 194.0491845
	Updated: 3605

Describe alternatives you've considered

wallet command assumes working with wallets. So, taking into account

$ neo-go query -h
NAME:
   neo-go query - Query data from RPC node

and that data is requested over RPC, then

$ neo-go query nep17 balance <address>

could be good also

cthulhu-rider avatar Dec 20 '23 15:12 cthulhu-rider