// Returns how many rai is owned and how many have not
// yet been received by all accounts in wallet.
// If threshold > 0, returns wallet accounts balances more or equal to threshold (>= v8.1).
Returns how many rai is owned and how many have not
yet been received by all accounts in wallet.
If threshold > 0, returns wallet accounts balances more or equal to threshold (>= v8.1).
// Returns how many rai is owned and how many have not // yet been received by all accounts in wallet . // If threshold > 0 returns wallet accounts balances more or equal to threshold ( > = v8 . 1 ) .
func WalletBalances(wallet string, threshold int) (map[string]map[string]string, error) {
	payload := map[string]interface{}{
		"wallet": wallet,
	}
	if threshold > 0 {
		payload["threshold"] = threshold
	}
	raw, err := client.call("wallet_balances", payload)
	if err != nil {
		return nil, err
	}
	var r map[string]map[string]map[string]string
	if err = json.Unmarshal(raw, &r); err != nil {
		return nil, err
	}
	balances, ok := r["balances"]
	if !ok {
		return nil, errors.New("Response of accounts_balances is empty")
	}
	return balances, nil
}
func WalletBalances ( wallet string , threshold int ) ( map [ string ] map [ string ] string , error ) { payload := map [ string ] interface { } { " " : wallet , } if threshold > 0 { payload [ " " ] = threshold } raw , err := client . call ( " " , payload ) if err != nil { return nil , err } var r map [ string ] map [ string ] map [ string ] string if err = json . Unmarshal ( raw , & r ) ; err != nil { return nil , err } balances , ok := r [ " " ] if ! ok { return nil , errors . New ( " " ) } return balances , nil }
Returns how many rai is owned and how many have not
yet been received by all accounts in wallet.
Returns how many rai is owned and how many have not yet been received by all accounts in wallet .