mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-09 12:19:24 +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 {
|
try {
|
||||||
final response = await client.get(
|
final response = await client.get(
|
||||||
url: Uri.parse(
|
url: Uri.parse(
|
||||||
"$stackBaseServer/tokens?addrs=$contractAddress&parts=all",
|
// "$stackBaseServer/tokens?addrs=$contractAddress&parts=all",
|
||||||
|
"$stackBaseServer/names?terms=$contractAddress",
|
||||||
),
|
),
|
||||||
proxyInfo: Prefs.instance.useTor
|
proxyInfo: Prefs.instance.useTor
|
||||||
? TorService.sharedInstance.getProxyInfo()
|
? TorService.sharedInstance.getProxyInfo()
|
||||||
|
@ -621,6 +622,10 @@ abstract class EthereumAPI {
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
final json = jsonDecode(response.body) as Map;
|
final json = jsonDecode(response.body) as Map;
|
||||||
if (json["data"] is List) {
|
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);
|
final map = Map<String, dynamic>.from(json["data"].first as Map);
|
||||||
EthContract? token;
|
EthContract? token;
|
||||||
if (map["isErc20"] == true) {
|
if (map["isErc20"] == true) {
|
||||||
|
|
Loading…
Reference in a new issue