mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
eth token balance fix
This commit is contained in:
parent
28f8fdc233
commit
b8fcc98ac6
1 changed files with 2 additions and 3 deletions
|
@ -10,7 +10,6 @@
|
|||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:decimal/decimal.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:stackwallet/dto/ethereum/eth_token_tx_dto.dart';
|
||||
import 'package:stackwallet/dto/ethereum/eth_token_tx_extra_dto.dart';
|
||||
|
@ -431,10 +430,10 @@ abstract class EthereumAPI {
|
|||
final map = json["data"].first as Map;
|
||||
|
||||
final balance =
|
||||
Decimal.tryParse(map["balance"].toString()) ?? Decimal.zero;
|
||||
BigInt.tryParse(map["units"].toString()) ?? BigInt.zero;
|
||||
|
||||
return EthereumResponse(
|
||||
Amount.fromDecimal(balance, fractionDigits: map["decimals"] as int),
|
||||
Amount(rawValue: balance, fractionDigits: map["decimals"] as int),
|
||||
null,
|
||||
);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue