package foundation.omni.rest;

import org.bitcoinj.core.Address;

import java.util.HashMap;

/**
 * Balances for all currencies for a list of addresses
 */
public class OmniJBalances extends HashMap<Address, WalletAddressBalance> {
}

@@ -24,16 +24,122 @@
 .rest;%0A%0A
+import foundation.omni.CurrencyID;%0Aimport foundation.omni.OmniValue;%0Aimport foundation.omni.PropertyType;%0A
 import o
@@ -164,16 +164,16 @@
 ddress;%0A
-
 %0Aimport 
@@ -190,16 +190,38 @@
 HashMap;
+%0Aimport java.util.Map;
 %0A%0A/**%0A *
@@ -277,16 +277,16 @@
 ses%0A */%0A
-
 public c
@@ -352,11 +352,612 @@
 lance%3E %7B
+%0A%0A    /**%0A     * @param propertyID propertyId to count%0A     * @param type  PropertyType of CurrencyID%0A     * @return count of all currency/property of specified type%0A     */%0A    public OmniValue countCurrency(CurrencyID propertyID, PropertyType type) %7B%0A        final OmniValue zero = OmniValue.of(0, type);%0A        return entrySet().stream()%0A                .flatMap(entry -%3E entry.getValue().entrySet().stream())%0A                .filter(entry -%3E entry.getKey().equals(propertyID))%0A                .map(Map.Entry::getValue)%0A                .reduce(OmniValue::plus)%0A                .orElse(zero);%0A    %7D
 %0A%7D%0A

Add countCurrency method to OmniJBalances