mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-02 03:06:29 +00:00
get token info fix
This commit is contained in:
parent
af2c674809
commit
361d3a8095
1 changed files with 4 additions and 4 deletions
|
@ -370,9 +370,9 @@ abstract class EthereumAPI {
|
|||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final json = jsonDecode(response.body);
|
||||
if (json["message"] == "OK") {
|
||||
final map = Map<String, dynamic>.from(json["result"] as Map);
|
||||
final json = jsonDecode(response.body) as Map;
|
||||
if (json["data"] is List) {
|
||||
final map = Map<String, dynamic>.from(json["data"].first as Map);
|
||||
EthContract? token;
|
||||
if (map["isErc20"] == true) {
|
||||
token = EthContract(
|
||||
|
@ -400,7 +400,7 @@ abstract class EthereumAPI {
|
|||
null,
|
||||
);
|
||||
} else {
|
||||
throw EthApiException(json["message"] as String);
|
||||
throw EthApiException(response.body);
|
||||
}
|
||||
} else {
|
||||
throw EthApiException(
|
||||
|
|
Loading…
Reference in a new issue