func (w *WalletRPC) GetBalance(args []string) {
	if len(args) != 1 {
		w.errln("Usage: getbalance <address>")
		return
	}

	if !address.ValidateAddress(args[0]) {
		w.errf("Invalid address: %s\n", args[0])
		return
	}

	addr := address.Address(args[0])

	w.printf("Getting balance of %s...\n", addr)

	bal, err := w.w.GetBalance(addr)
	if err != nil {
		w.errf("Error getting balance: %s\n", err)
		return
	}

	w.printf("Balance of %s is %d\n", addr, bal)
}
// GetBalance gets the balance of an address
GetBalance gets the balance of an address
// GetBalance gets the balance of an address
func (w *WalletRPC) GetBalance(args []string) {
	if len(args) != 1 {
		w.errln("Usage: getbalance <address>")
		return
	}
	if !address.ValidateAddress(args[0]) {
		w.errf("Invalid address: %s\n", args[0])
		return
	}
	addr := address.Address(args[0])
	w.printf("Getting balance of %s...\n", addr)
	bal, err := w.w.GetBalance(addr)
	if err != nil {
		w.errf("Error getting balance: %s\n", err)
		return
	}
	w.printf("Balance of %s is %d\n", addr, bal)
}
func ( w * WalletRPC ) GetBalance ( args [ ] string ) { if len ( args ) != 1 { w . errln ( " " ) return } if ! address . ValidateAddress ( args [ 0 ] ) { w . errf ( " \n " , args [ 0 ] ) return } addr := address . Address ( args [ 0 ] ) w . printf ( " \n " , addr ) bal , err := w . w . GetBalance ( addr ) if err != nil { w . errf ( " \n " , err ) return } w . printf ( " \n " , addr , bal ) }
GetBalance gets the balance of an address
GetBalance gets the balance of an address