Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: arkconnect navbar button #799

Merged
merged 40 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cea1263
js
alexbarnsley Mar 19, 2024
be86b16
add to navbar
alexbarnsley Mar 19, 2024
d1b078a
truncate middle of address
alexbarnsley Mar 19, 2024
decca60
chore: update public
alexbarnsley Mar 19, 2024
7b524bf
Merge remote-tracking branch 'origin/develop' into feat/arkconnect-na…
alexbarnsley Mar 19, 2024
160464c
style: resolve style guide violations
alexbarnsley Mar 19, 2024
ef826b5
style: resolve style guide violations
ItsANameToo Mar 19, 2024
520e82c
style: resolve style guide violations
ItsANameToo Mar 19, 2024
be486a6
add clipboard to all pages
alexbarnsley Mar 20, 2024
757ef5f
mobile state
alexbarnsley Mar 20, 2024
2f128a2
chore: update public
alexbarnsley Mar 20, 2024
f25859c
style: resolve style guide violations
alexbarnsley Mar 20, 2024
23e80f9
.env property
alexbarnsley Mar 20, 2024
71d8bb1
refactor: monitor delegate missing icon (#800)
alexbarnsley Mar 21, 2024
2687949
truncate middle on mobile
alexbarnsley Mar 21, 2024
6c84e89
update styling for mobile when disconnected
alexbarnsley Mar 21, 2024
50dfc66
chore: update public
alexbarnsley Mar 21, 2024
2665897
style: resolve style guide violations
alexbarnsley Mar 21, 2024
37c0af6
style: resolve style guide violations
ItsANameToo Mar 21, 2024
3aa0184
wip
alexbarnsley Mar 21, 2024
886034b
style: resolve style guide violations
alexbarnsley Mar 21, 2024
5d13ad7
Merge remote-tracking branch 'origin/develop' into feat/arkconnect-na…
alexbarnsley Mar 21, 2024
d40e913
chore: update foundation dependency
alexbarnsley Mar 21, 2024
70faf87
style: resolve style guide violations
alexbarnsley Mar 21, 2024
6402d18
on extension load event
alexbarnsley Mar 21, 2024
9614b0d
disable button until loaded
alexbarnsley Mar 21, 2024
d31624b
Merge branch 'feat/arkconnect-navbar-button' of github.com:ArdentHQ/a…
alexbarnsley Mar 21, 2024
0c15f30
style: resolve style guide violations
alexbarnsley Mar 21, 2024
5877375
move x-cloak to child element
alexbarnsley Mar 21, 2024
73296e2
Merge branch 'feat/arkconnect-navbar-button' of github.com:ArdentHQ/a…
alexbarnsley Mar 21, 2024
35bf40d
remove old clipboard js
alexbarnsley Mar 21, 2024
d704bed
chore: stanley
alexbarnsley Mar 21, 2024
f34073a
further updates
alexbarnsley Mar 25, 2024
39fad31
chore: update public
alexbarnsley Mar 25, 2024
8d9c03f
style: resolve style guide violations
alexbarnsley Mar 25, 2024
24e15bf
handle locked state
alexbarnsley Mar 25, 2024
b656021
chore: update public
alexbarnsley Mar 25, 2024
0769734
Merge branch 'feat/arkconnect-navbar-button' of github.com:ArdentHQ/a…
alexbarnsley Mar 25, 2024
6213678
catch exceptions for locked wallet
alexbarnsley Mar 25, 2024
9d59f84
chore: update public
alexbarnsley Mar 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ ARKSCAN_PRODUCTIVITY_WARNING=99.8
ARKSCAN_PAGINATION_PER_PAGE=25

MIX_NOTIFICATIONS_DISABLED=false

ARKCONNECT_ENABLED=false
2 changes: 1 addition & 1 deletion app/Console/Commands/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class ImportCommand extends LaravelScoutImportCommand
/**
* Execute the console command.
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @param Dispatcher $events
* @return void
*/
public function handle(Dispatcher $events)
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class User extends Authenticatable
/**
* The accessors to append to the model's array form.
*
* @var array
* @var array<int, string>
*/
protected $appends = [
'profile_photo_url',
Expand Down
57 changes: 57 additions & 0 deletions app/ViewModels/Concerns/Wallet/CanForge.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@

namespace App\ViewModels\Concerns\Wallet;

use App\Actions\CacheNetworkHeight;
use App\Facades\Rounds;
use App\Services\Cache\DelegateCache;
use App\Services\Cache\WalletCache;
use Carbon\Carbon;
use Carbon\CarbonInterval;
use Illuminate\Support\Arr;

trait CanForge
Expand Down Expand Up @@ -117,8 +120,62 @@ public function missedBlocks(): int
return (new WalletCache())->getMissedBlocks($publicKey);
}

public function blocksSinceLastForged(): ?int
{
$lastBlock = $this->lastBlock();
if ($lastBlock === null) {
return null;
}

$height = CacheNetworkHeight::execute();

return $height - $lastBlock['height'];
}

public function durationSinceLastForged(): ?string
{
$lastBlock = $this->lastBlock();
if ($lastBlock === null) {
return null;
}

$difference = CarbonInterval::instance(Carbon::parse($lastBlock['timestamp'])->diff());
$difference->ceilMinutes();
if ($difference->totalHours < 1) {
return trans('general.time.minutes_short', ['minutes' => $difference->minutes]);
}

if ($difference->totalHours >= 1 && $difference->totalDays < 1) {
if ($difference->minutes === 0) {
return trans('general.time.hours_short', ['hours' => $difference->hours]);
}

return trans('general.time.hours_minutes_short', [
'hours' => $difference->hours,
'minutes' => $difference->minutes,
]);
}

return trans('general.time.more_than_a_day');
}

public function currentSlot(): array
{
return Rounds::delegates()->firstWhere('publicKey', $this->publicKey());
}

private function lastBlock(): ?array
{
$publicKey = $this->publicKey();
if (is_null($publicKey)) {
return null;
}

$lastBlock = (new WalletCache())->getLastBlock($publicKey);
if ($lastBlock === []) {
return null;
}

return $lastBlock;
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"ext-gmp": "*",
"ardenthq/arkvault-url": "^1.1",
"arkecosystem/crypto": "^1.8",
"arkecosystem/foundation": "^13.32",
"arkecosystem/foundation": "^13.35",
"blade-ui-kit/blade-icons": "^1.5",
"brick/math": "^0.11",
"danharrin/livewire-rate-limiting": "1.1.0",
Expand Down
Loading
Loading