From 361d3a8095cca7655c2485bd40bc1722dd811bab Mon Sep 17 00:00:00 2001
From: julian <julian@cypherstack.com>
Date: Fri, 24 Mar 2023 08:37:47 -0600
Subject: [PATCH] get token info fix

---
 lib/services/ethereum/ethereum_api.dart | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/services/ethereum/ethereum_api.dart b/lib/services/ethereum/ethereum_api.dart
index f09f641ea..89543fde8 100644
--- a/lib/services/ethereum/ethereum_api.dart
+++ b/lib/services/ethereum/ethereum_api.dart
@@ -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(