<?php

namespace App\DTO;

class SwapTransactionDTO
{
    public int $coinId;
    public string $coinSymbol;
    public int $swapToCoinId;
    public string $swapToCoinSymbol;
    public int $walletId;
    public int $swapWalletId;
    public float $amount;

    public function __construct(array $data)
    {
        $this->coinId = hash_to_id($data['coin_id']) ?? 0;
        $this->coinSymbol = $data['coin_symbol'] ?? '';
        $this->swapToCoinId = $data['recipient_wallet_id'] ?? 0;
        $this->swapToCoinSymbol = $data['swap_to_coin_symbol'] ?? '';
        $this->walletId = $data['wallet_id'] ?? 0;
        $this->swapWalletId = $data['swap_wallet_id'] ?? 0;
        $this->amount = $data['amount'] ?? 0;
    }
}
