mempool weather added

This commit is contained in:
HolgerHatGarKeineNode
2023-03-31 17:51:47 +02:00
parent 3913f6f59f
commit c801d28446
5 changed files with 176 additions and 150 deletions

View File

@@ -45,6 +45,6 @@ class Test extends Command
'temperature' => 1
]);
cache()->put('mempool-weather', $result['choices'][0]['text'], now()->addMinutes(60));
echo $result['choices'][0]['text'];
}
}

View File

@@ -10,12 +10,6 @@ use Livewire\Component;
class MempoolWeather extends Component
{
public string $weather = '';
public $fastestFee;
public $halfHourFee;
public $hourFee;
public $economyFee;
public $minimumFee;
public $changed;
public function mount()
@@ -26,13 +20,6 @@ class MempoolWeather extends Component
Artisan::call(CacheRecommendedFees::class);
$this->weather = cache()->get('mempool-weather');
}
$result = Http::get('https://mempool.space/api/v1/fees/recommended');
$result = $result->json();
$this->fastestFee = $result['fastestFee'];
$this->halfHourFee = $result['halfHourFee'];
$this->hourFee = $result['hourFee'];
$this->economyFee = $result['economyFee'];
$this->minimumFee = $result['minimumFee'];
$this->changed = cache()->get('mempool-weather-changed');
}