Example #1
0
func fctbalance(addr string) error {
	if Utility.IsValidAddress(addr) && strings.HasPrefix(addr, "EC") {
		fmt.Println("Not a valid Entry Credit Address")
		return fmt.Errorf("Not a valid Entry Credit Address")
	}

	if b, err := factom.FctBalance(addr); err != nil {
		fmt.Println("Address undefined or invalid: " + err.Error())
		return err
	} else {
		fmt.Println("Balance of ", addr, " = ", fct.ConvertDecimal(uint64(b)))
	}

	return nil
}
Example #2
0
func GetAddressInformationFromFactom(address string) error {
	ecBalance, err := factom.ECBalance(address)
	if err != nil {
		fmt.Printf("GetAddressInformationFromFactom 1 - %v\n", err)
	} else {
		fmt.Printf("ECBalance - %v\n", ecBalance)
	}
	fctBalance, err := factom.FctBalance(address)
	if err != nil {
		fmt.Printf("GetAddressInformationFromFactom 2 - %v\n", err)
	} else {
		fmt.Printf("FctBalance - %v\n", fctBalance)
	}

	return nil
}