Balance.fromData constructor

Balance.fromData(
  1. Map<String, dynamic> data,
  2. String address
)

Implementation

factory Balance.fromData(Map<String, dynamic> data, String address) {
  return Balance(
      address: address,
      polys: const PolyAmountConverter()
          .fromJson(data['Balances']['Polys'] as String),
      arbits: const ArbitAmountConverter()
          .fromJson(data['Balances']['Arbits'] as String),
      assets: (data['Boxes']['AssetBox'] as List<dynamic>)
          .map((box) => const AssetAmountConverter()
              .fromJson(box as Map<String, dynamic>))
          .toList());
}