feat: stats
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user