Skip to content

Commit

Permalink
chore: merge staging into master (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarnsley authored Feb 15, 2024
2 parents c55f5b9 + 2b7e406 commit a2e3d55
Show file tree
Hide file tree
Showing 31 changed files with 257 additions and 472 deletions.
51 changes: 0 additions & 51 deletions app/Console/Commands/CacheCurrenciesHistory.php

This file was deleted.

1 change: 0 additions & 1 deletion app/Console/Commands/CacheDevelopmentData.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function handle(): void
'explorer:cache-prices',
'explorer:cache-volume',
'explorer:cache-currencies-data',
'explorer:cache-currencies-history --no-delay',
'explorer:cache-delegate-aggregates',
'explorer:cache-delegate-performance',
'explorer:cache-delegate-productivity',
Expand Down
33 changes: 33 additions & 0 deletions app/Console/Commands/CacheDevelopmentPricing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

declare(strict_types=1);

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;

final class CacheDevelopmentPricing extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'explorer:cache-development-pricing';

/**
* The console command description.
*
* @var string|null
*/
protected $description = 'Cache all pricing commands';

public function handle(): void
{
collect([
'explorer:cache-currencies-data',
'explorer:cache-prices',
])->map(fn (string $command) => Artisan::call($command));
}
}
2 changes: 1 addition & 1 deletion app/Console/Commands/CachePrices.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function handle(
}

if ($periodPrices->isEmpty()) {
break 2;
continue;
}

$crypto->setPrices($currency.'.'.$period, $periodPrices);
Expand Down
3 changes: 0 additions & 3 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use App\Console\Commands\CacheAnnualStatistics;
use App\Console\Commands\CacheBlocks;
use App\Console\Commands\CacheCurrenciesData;
use App\Console\Commands\CacheCurrenciesHistory;
use App\Console\Commands\CacheDelegateAggregates;
use App\Console\Commands\CacheDelegatePerformance;
use App\Console\Commands\CacheDelegateProductivity;
Expand Down Expand Up @@ -57,8 +56,6 @@ protected function schedule(Schedule $schedule)

$schedule->command(CacheCurrenciesData::class)->everyMinute()->withoutOverlapping();

$schedule->command(CacheCurrenciesHistory::class)->hourly();

$schedule->command(CacheVolume::class)->hourly();

$schedule->command(CacheDelegateWallets::class)->everyTenMinutes();
Expand Down
11 changes: 10 additions & 1 deletion app/DTO/Statistics/MarketDataPriceStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ public function yearHigh(): ?string
*/
private function formatCurrency($value): string
{
return NumberFormatter::currencyWithDecimals($value, Settings::currency(), 2);
return NumberFormatter::currencyWithDecimals($value, Settings::currency(), $this->decimals());
}

private function decimals(): int
{
if (NumberFormatter::isFiat(Settings::currency())) {
return 2;
}

return 8;
}
}
12 changes: 10 additions & 2 deletions app/Http/Livewire/Navbar/PriceTicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,16 @@ public function mount(): void

public function setValues(): void
{
$this->isAvailable = (new NetworkStatusBlockCache())->getIsAvailable(Network::currency(), Settings::currency());
$this->to = Settings::currency();
$cache = new NetworkStatusBlockCache();
foreach (config('currencies') as $currency) {
if (! $cache->getIsAvailable(Network::currency(), $currency['currency'])) {
continue;
}

$this->isAvailable = true;
}

$this->to = Settings::currency();

$this->dispatchBrowserEvent('has-loaded-price-data');
}
Expand Down
49 changes: 0 additions & 49 deletions app/Jobs/CacheCurrenciesHistory.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/Services/Cache/NetworkStatusBlockCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,12 @@
use App\Contracts\Cache as Contract;
use App\Services\Cache\Concerns\ManagesCache;
use Illuminate\Cache\TaggedCache;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Cache;

final class NetworkStatusBlockCache implements Contract
{
use ManagesCache;

public function getHistoricalHourly(string $source, string $target): ?Collection
{
return $this->get(sprintf('historical-hourly/%s/%s', $source, $target));
}

public function setHistoricalHourly(string $source, string $target, ?Collection $historical): ?Collection
{
$this->put(sprintf('historical-hourly/%s/%s', $source, $target), $historical);

return $historical;
}

public function getPrice(string $source, string $target): ?float
{
$price = $this->get(sprintf('price/%s/%s', $source, $target));
Expand Down
1 change: 0 additions & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ php artisan explorer:cache-transactions
php artisan explorer:cache-prices
php artisan explorer:cache-volume
php artisan explorer:cache-currencies-data
php artisan explorer:cache-currencies-history --no-delay
php artisan explorer:cache-delegate-aggregates
php artisan explorer:cache-delegate-performance
php artisan explorer:cache-delegate-productivity
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"production": "mix --production"
},
"devDependencies": {
"alpinejs": "^3.13.3",
"alpinejs": "^3.13.5",
"autoprefixer": "10.4.5",
"body-scroll-lock": "^4.0.0-beta.0",
"chart.js": "^3.9.1",
Expand Down Expand Up @@ -41,6 +41,6 @@
"autoprefixer": "10.4.5"
},
"dependencies": {
"axios": "^1.6.5"
"axios": "^1.6.7"
}
}
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<file>./app/Http/Kernel.php</file>
<!-- Application Code -->
<directory suffix=".php">./app/Console/Commands/CacheDevelopmentData.php</directory>
<directory suffix=".php">./app/Console/Commands/CacheDevelopmentPricing.php</directory>
<directory suffix=".php">./app/Facades</directory>
<directory suffix=".php">./app/Models/Scopes</directory>
</exclude>
Expand Down
4 changes: 2 additions & 2 deletions public/css/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/vendor.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"/js/app.js": "/js/app.js?id=d0cd079a4a6094e4dd4bcaf3627e1512",
"/js/app.js": "/js/app.js?id=a7c3057b59b1b30039dc4f5d3a5d62d9",
"/js/chart-tooltip.js": "/js/chart-tooltip.js?id=b74d64d41a6d6165abc8a5196bf704ca",
"/js/clipboard.js": "/js/clipboard.js?id=80d900f861e2aacb0e23e914068d0de9",
"/js/manifest.js": "/js/manifest.js?id=bf375adc4a6d48ff1f208128c5b5b26f",
"/css/app.css": "/css/app.css?id=2cc803a0c1e3d8098caa68ac62e31eb3",
"/js/vendor.js": "/js/vendor.js?id=a8afaf722d5b57af63b4a780cd61d61e",
"/css/app.css": "/css/app.css?id=31573c3fab41e440131dffd412305b32",
"/js/vendor.js": "/js/vendor.js?id=a72f85e73ae564de132d90e38f26c9a6",
"/images/delegates/header-bg-dark.svg": "/images/delegates/header-bg-dark.svg?id=0fc9d2cfbec09d702832f3bd81fae169",
"/images/delegates/header-bg-dim.svg": "/images/delegates/header-bg-dim.svg?id=48500cc7f16e42f8f0f07af07b76dead",
"/images/delegates/header-bg-mobile-dark.svg": "/images/delegates/header-bg-mobile-dark.svg?id=a60884230a85d1b8bb5f35e9a65f81cc",
Expand Down
84 changes: 42 additions & 42 deletions resources/lang/en/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,48 @@
declare(strict_types=1);

return [
'ardent' => 'Ardent',
'address' => 'Address',
'beta_uppercase' => 'BETA',
'optional' => 'Optional',
'or' => 'or',
'arkscan' => 'ARKScan',
'scan' => 'Scan',
'height' => 'Height',
'network' => 'Network',
'current_supply' => 'Current Supply',
'not_available' => 'Not Available',
'price' => 'Price',
'market_cap' => 'Market Cap',
'verified_address' => 'Verified Address',
'exchange' => 'Exchange',
'reload' => 'Reload',
'confirmed' => 'Confirmed',
'see_all' => 'See all',
'wallet_not_found' => '<span class="bg-theme-warning-100">:0</span> has no balance. <br/> <span class="text-base font-normal">Return to this page after the address has received a transaction.</span>',
'fiat_excluding_itself' => 'Excluding :amount sent to itself',
'more_details' => 'For more :transactionType details',
'learn_more' => 'Learn more',
'confirmations' => ':count Confirmation|:count Confirmations',
'confirmations_only' => 'Confirmations',
'market_data_by' => 'Market Data by',
'arkvault' => 'ARKVault',
'select_theme' => 'Select Theme',
'select_network' => 'Select Network',
'na' => 'N/A',
'all' => 'All',
'overview' => 'Overview',
'view' => 'View',
'coming_soon' => 'Coming Soon',
'select_all' => 'Select All',
'success' => 'Success',
'information' => 'Information',
'error' => 'Error',
'warning' => 'Warning',
'custom' => 'Custom',
'x_of_y' => ':0 of :1',
'filter' => 'Filter',
'now' => 'Now',
'ardent' => 'Ardent',
'address' => 'Address',
'beta_uppercase' => 'BETA',
'optional' => 'Optional',
'or' => 'or',
'arkscan' => 'ARKScan',
'scan' => 'Scan',
'height' => 'Height',
'network' => 'Network',
'current_supply' => 'Current Supply',
'not_available' => 'Not Available',
'price' => 'Price',
'market_cap' => 'Market Cap',
'verified_address' => 'Verified Address',
'exchange' => 'Exchange',
'reload' => 'Reload',
'confirmed' => 'Confirmed',
'see_all' => 'See all',
'wallet_not_found' => '<span class="bg-theme-warning-100">:0</span> has no balance. <br/> <span class="text-base font-normal">Return to this page after the address has received a transaction.</span>',
'fiat_excluding_self' => 'Excluding :amount sent to self',
'more_details' => 'For more :transactionType details',
'learn_more' => 'Learn more',
'confirmations' => ':count Confirmation|:count Confirmations',
'confirmations_only' => 'Confirmations',
'market_data_by' => 'Market Data by',
'arkvault' => 'ARKVault',
'select_theme' => 'Select Theme',
'select_network' => 'Select Network',
'na' => 'N/A',
'all' => 'All',
'overview' => 'Overview',
'view' => 'View',
'coming_soon' => 'Coming Soon',
'select_all' => 'Select All',
'success' => 'Success',
'information' => 'Information',
'error' => 'Error',
'warning' => 'Warning',
'custom' => 'Custom',
'x_of_y' => ':0 of :1',
'filter' => 'Filter',
'now' => 'Now',

'navbar' => [
'search_placeholder' => 'Address / Tx ID / Block ID',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
'contract' => 'Contract',
'multiple' => 'Multiple',
'address' => 'Address',
'return' => 'Return',

'amount_no_currency' => 'Amount',

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<span {{ $attributes->merge(['class' => $class]) }}>
@if($amountForItself !== null && $amountForItself > 0)
<span class="fiat-hint" data-tippy-content="{{ trans('general.fiat_excluding_itself', [
<span class="fiat-hint" data-tippy-content="{{ trans('general.fiat_excluding_self', [
'amount' => ExplorerNumberFormatter::currency($amountForItself, Network::currency())
]) }}">
<x-ark-icon name="hint-small" size="xs" />
Expand Down
Loading

0 comments on commit a2e3d55

Please sign in to comment.