CoinMonero.php 616 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
<?php

namespace App\Coin;

use Illuminate\Console\Command;

use Monero\WalletCommon;
use Monero\WalletOld;

class CoinMonero implements Coin
{
    public function newWallet() : WalletCommon
    {
        return new WalletOld();
    }

    public function onNotifyGetTransactions(Command $command, WalletCommon $wallet)
    {
        $min_height = $command->argument('height') ?? Deposit::max('block_received');
        return $wallet->scanIncomingTransfers(max($min_height, 50) - 50);
    }

    public function subaddrIndex($addressDetails, $project)
    {
        return $addressDetails['subaddr_index'];
    }
}