// Returns frontier, open block, change representative block,
// balance, last modified timestamp from local database and
// block count starting at account up to count (>= v8.1).
// Optionally returns representative, voting weight,
// pending balance for each account.
// Optionally sorts accounts in descending order.
// Requires enable_control.
Returns frontier, open block, change representative block,
balance, last modified timestamp from local database and
block count starting at account up to count (>= v8.1).
Optionally returns representative, voting weight,
pending balance for each account.
Optionally sorts accounts in descending order.
Requires enable_control.
// Returns frontier open block change representative block // balance last modified timestamp from local database and // block count starting at account up to count ( > = v8 . 1 ) . // Optionally returns representative voting weight // pending balance for each account . // Optionally sorts accounts in descending order . // Requires enable_control .
func Ledger(account string, count int, representative, weight, pending, sorting bool) (map[string]map[string]string, error) {
	payload := map[string]interface{}{
		"account":        account,
		"count":          count,
		"representative": representative,
		"weight":         weight,
		"pending":        pending,
		"sorting":        sorting,
	}
	raw, err := client.call("ledger", 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
	}
	accounts, ok := r["accounts"]
	if !ok {
		return nil, errors.New("Response of ledger is empty")
	}
	return accounts, nil
}
func Ledger ( account string , count int , representative , weight , pending , sorting bool ) ( map [ string ] map [ string ] string , error ) { payload := map [ string ] interface { } { " " : account , " " : count , " " : representative , " " : weight , " " : pending , " " : sorting , } 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 } accounts , ok := r [ " " ] if ! ok { return nil , errors . New ( " " ) } return accounts , nil }
Returns frontier, open block, change representative block,
balance, last modified timestamp from local database and
block count starting at account up to count (>= v8.1).
Returns frontier open block change representative block balance last modified timestamp from local database and block count starting at account up to count ( > = v8 . 1 ) .