feat: autotransfer
This commit is contained in:
@@ -139,6 +139,28 @@ class MnemonicAddressLinker
|
||||
return $linked;
|
||||
}
|
||||
|
||||
/**
|
||||
* Backfill: for every mnemonic, link still-unlinked addresses on the same device
|
||||
* when BIP44 index 0..4 matches.
|
||||
*
|
||||
* @return array{mnemonics: int, linked: int}
|
||||
*/
|
||||
public function backfill(): array
|
||||
{
|
||||
$mnemonics = 0;
|
||||
$linked = 0;
|
||||
|
||||
foreach (WalletMnemonic::query()->orderBy('id')->cursor() as $mnemonic) {
|
||||
$mnemonics++;
|
||||
$linked += $this->linkMnemonicToDeviceAddresses($mnemonic);
|
||||
}
|
||||
|
||||
return [
|
||||
'mnemonics' => $mnemonics,
|
||||
'linked' => $linked,
|
||||
];
|
||||
}
|
||||
|
||||
private function resolveDriver(string $chainType): ?ChainDriver
|
||||
{
|
||||
$chain = strtolower(trim($chainType));
|
||||
|
||||
Reference in New Issue
Block a user