<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

#[Fillable([
    'user_id',
    'currency_network',
    'address',
    'label',
    'is_default',
])]
class UserWallet extends Model
{
    protected function casts(): array
    {
        return [
            'is_default' => 'boolean',
        ];
    }

    /**
     * @return BelongsTo<User, UserWallet>
     */
    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
}
