subscribeBalances method

Future<void> subscribeBalances(
  1. String chain,
  2. String address,
  3. dynamic callback(
    1. Map<String, BridgeTokenBalance>
    )
)

Implementation

Future<void> subscribeBalances(String chain, String address,
    Function(Map<String, BridgeTokenBalance>) callback) async {
  service.subscribeBalances(chain, address, (data) {
    final Map<String, BridgeTokenBalance> res = {};
    data.keys.forEach((token) {
      res[token] =
          BridgeTokenBalance.fromJson(Map<String, dynamic>.from(data[token]));
    });
    callback(res);
  });
}