feat: 查看钱包优化,地址增加链上查询

This commit is contained in:
example
2026-09-28 21:11:08 +08:00
parent 5b677d4d1f
commit 8f7469cc4e
10 changed files with 313 additions and 88 deletions
+14 -4
View File
@@ -64,7 +64,10 @@ class EthDriver implements ChainDriver
if (is_string($hex) && bccomp($this->hexToDec($hex), '0', 0) > 0) {
return true;
}
} catch (\Throwable) {
} catch (\Throwable $e) {
if (ChainHttpTimeout::active()) {
throw $e;
}
// fall through to balances
}
@@ -72,7 +75,10 @@ class EthDriver implements ChainDriver
if (bccomp($this->getNativeBalance($address), '0', 18) > 0) {
return true;
}
} catch (\Throwable) {
} catch (\Throwable $e) {
if (ChainHttpTimeout::active()) {
throw $e;
}
// fall through to token
}
@@ -82,7 +88,11 @@ class EthDriver implements ChainDriver
if (bccomp($this->getTokenBalance($address, $contract), '0', 18) > 0) {
return true;
}
} catch (\Throwable) {
} catch (\Throwable $e) {
if (ChainHttpTimeout::active()) {
throw $e;
}
return false;
}
}
@@ -270,6 +280,6 @@ class EthDriver implements ChainDriver
private function http(): PendingRequest
{
return Http::connectTimeout(20)->timeout(120)->acceptJson()->asJson();
return ChainHttpTimeout::apply(Http::connectTimeout(20)->timeout(120)->acceptJson()->asJson());
}
}