func BankCommand(store *wallet.Store) cli.Command {
	bankExecutor := func(args []string) error {
		walletFile, err := wallet.ReadWallet()
		if err != nil {
			return err
		}
		if len(walletFile) == 0 {
			fmt.Println("No credentials in wallet.")
			return nil
		}
		for _, key := range walletFile {
			pubKey := key.PublicKey
			if len(args) == 1 || args[1] != "full" {
				pubKey = pubKey[:6]
			}
			fmt.Printf("Public key %x:", pubKey)
			if currencies, ok := store.WalletStore[util.ToBytes(key.PublicKey)]; ok {
				fmt.Print("\n")
				for currency, amount := range currencies {
					fmt.Printf("  - %s: %s\n", currency, amount)
				}
			} else {
				fmt.Print(" no currency\n")
			}
		}
		return nil
	}

	return cli.CreateCommand("bank", "Display the current balance in each of the local wallets", bankExecutor, nil)
}
// BankCommand creates the bank command, returning to the
// user the current balance of all their local wallets
//
// syntax: bank [full]
BankCommand creates the bank command, returning to the
user the current balance of all their local wallets

bank [full]
// BankCommand creates the bank command returning to the // user the current balance of all their local wallets // // syntax : bank [ full ]
func BankCommand(store *wallet.Store) cli.Command {
	bankExecutor := func(args []string) error {
		walletFile, err := wallet.ReadWallet()
		if err != nil {
			return err
		}
		if len(walletFile) == 0 {
			fmt.Println("No credentials in wallet.")
			return nil
		}
		for _, key := range walletFile {
			pubKey := key.PublicKey
			if len(args) == 1 || args[1] != "full" {
				pubKey = pubKey[:6]
			}
			fmt.Printf("Public key %x:", pubKey)
			if currencies, ok := store.WalletStore[util.ToBytes(key.PublicKey)]; ok {
				fmt.Print("\n")
				for currency, amount := range currencies {
					fmt.Printf("  - %s: %s\n", currency, amount)
				}
			} else {
				fmt.Print(" no currency\n")
			}
		}
		return nil
	}
	return cli.CreateCommand("bank", "Display the current balance in each of the local wallets", bankExecutor, nil)
}
func BankCommand ( store * wallet . Store ) cli . Command { bankExecutor := func ( args [ ] string ) error { walletFile , err := wallet . ReadWallet ( ) if err != nil { return err } if len ( walletFile ) == 0 { fmt . Println ( " " ) return nil } for _ , key := range walletFile { pubKey := key . PublicKey if len ( args ) == 1 || args [ 1 ] != " " { pubKey = pubKey [ : 6 ] } fmt . Printf ( " " , pubKey ) if currencies , ok := store . WalletStore [ util . ToBytes ( key . PublicKey ) ] ; ok { fmt . Print ( " \n " ) for currency , amount := range currencies { fmt . Printf ( " \n " , currency , amount ) } } else { fmt . Print ( " \n " ) } } return nil } return cli . CreateCommand ( " " , " " , bankExecutor , nil ) }
BankCommand creates the bank command, returning to the
user the current balance of all their local wallets
BankCommand creates the bank command returning to the user the current balance of all their local wallets