mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-22 19:39:22 +00:00
eth token api endpoint update
This commit is contained in:
parent
fd8ca3edf8
commit
780a34b7dc
1 changed files with 6 additions and 1 deletions
|
@ -611,7 +611,8 @@ abstract class EthereumAPI {
|
|||
try {
|
||||
final response = await client.get(
|
||||
url: Uri.parse(
|
||||
"$stackBaseServer/tokens?addrs=$contractAddress&parts=all",
|
||||
// "$stackBaseServer/tokens?addrs=$contractAddress&parts=all",
|
||||
"$stackBaseServer/names?terms=$contractAddress",
|
||||
),
|
||||
proxyInfo: Prefs.instance.useTor
|
||||
? TorService.sharedInstance.getProxyInfo()
|
||||
|
@ -621,6 +622,10 @@ abstract class EthereumAPI {
|
|||
if (response.code == 200) {
|
||||
final json = jsonDecode(response.body) as Map;
|
||||
if (json["data"] is List) {
|
||||
if ((json["data"] as List).isEmpty) {
|
||||
throw EthApiException("Unknown token");
|
||||
}
|
||||
|
||||
final map = Map<String, dynamic>.from(json["data"].first as Map);
|
||||
EthContract? token;
|
||||
if (map["isErc20"] == true) {
|
||||
|
|
Loading…
Reference in a new issue