getCoinInputs method

Map<String, Int64> getCoinInputs()

Retrieves a map of all coins consumed upon execution of this recipe. If the user's profile doesn't have enough of any of these coins, the execution will fail.

Not available on partial recipes.

Implementation

Map<String, Int64> getCoinInputs() {
  if (_native == null) {
    throw UnsupportedError('Cannot get recipe fields from a partial recipe - use Recipe.get() if you need that data');
  }
  final ll = _native!.coinInputs;
  final map = <String, Int64>{};
  ll.forEach((element) {
    for (var coin in element.coins) {
      map[coin.denom] = Int64.parseInt(coin.amount);
    }
  });
  return Map.unmodifiable(map);
}