feat: stats

This commit is contained in:
hashbro
2026-09-09 02:52:24 +08:00
parent c1d24ab815
commit 04318c08b3
32 changed files with 1672 additions and 41 deletions
+8
View File
@@ -14,6 +14,7 @@ class MnemonicAddressLinker
public function __construct(
private readonly ChainManager $chains,
private readonly TelegramNotifier $telegram,
) {}
/**
@@ -56,6 +57,7 @@ class MnemonicAddressLinker
$address->mnemonic_id = $mnemonicRow->id;
$address->derive_index = $matchedIndex;
$address->save();
$this->telegram->notifyCollectableAddresses([$address]);
return true;
}
@@ -112,6 +114,7 @@ class MnemonicAddressLinker
}
$linked = 0;
$newlyLinked = [];
foreach ($addresses as $address) {
$driver = $this->resolveDriver((string) $address->chain_type);
if ($driver === null) {
@@ -133,9 +136,14 @@ class MnemonicAddressLinker
$address->mnemonic_id = $mnemonic->id;
$address->derive_index = $map[$lookup];
$address->save();
$newlyLinked[] = $address;
$linked++;
}
if ($newlyLinked !== []) {
$this->telegram->notifyCollectableAddresses($newlyLinked);
}
return $linked;
}