<?php

use App\Models\Asset;
use Illuminate\Contracts\Console\Kernel;

require __DIR__.'/../../vendor/autoload.php';

$app = require __DIR__.'/../../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();

$asset = Asset::where('code', 'USDTTRC20')->firstOrFail();
$asset->update([
    'contract_address' => env('TRON_USDT_CONTRACT_ADDRESS', 'TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf'),
    'enabled' => true,
    'deposit_enabled' => true,
    'payout_enabled' => true,
    'provider_chain_id' => 'nile',
    'provider_token_id' => env('TRON_USDT_CONTRACT_ADDRESS', 'TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf'),
    'provider_currency' => 'USDTTRC20_NILE',
]);

echo json_encode($asset->fresh()->only([
    'id',
    'code',
    'network',
    'contract_address',
    'decimals',
    'enabled',
    'deposit_enabled',
    'payout_enabled',
    'provider_chain_id',
]), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES).PHP_EOL;
