CoinZcoin.php 733 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

namespace App\Coin;

use App\Deposit;
use App\Project;
use Illuminate\Console\Command;

use Monero\WalletCommon;
use Monero\WalletZcoin;

class CoinZcoin implements Coin
{
    public function newWallet() : WalletCommon
    {
        return new WalletZcoin();
    }

    public function onNotifyGetTransactions(Command $command, WalletCommon $wallet)
    {
xiphon's avatar
xiphon committed
21
        return $wallet->scanIncomingTransfers()->each(function ($tx) {
22
23
24
25
26
27
28
29
30
31
32
33
            $project = Project::where('address', $tx->address)->first();
            if ($project) {
                $tx->subaddr_index = $project->subaddr_index;
            }
        });
    }

    public function subaddrIndex($addressDetails, $project)
    {
        return $project->id;
    }
}