Issue proper explorer URLs

This commit is contained in:
Craig Everett 2025-04-30 17:39:26 +09:00
parent 58a58c693f
commit 57a81e7f3f
13 changed files with 55 additions and 26 deletions

View File

@ -3,7 +3,8 @@
{registered,[]},
{included_applications,[]},
{applications,[stdlib,kernel,sasl,ssl]},
{vsn,"0.5.6"},
{modules,[gajudesk,gd_con,gd_grids,gd_gui,gd_jt,gd_key_master,
gd_sup,gd_v,gd_v_devman,gd_v_netman,gd_v_wallman]},
{vsn,"0.6.0"},
{modules,[gajudesk,gd_con,gd_grids,gd_gui,gd_jt,
gd_sophia_editor,gd_sup,gd_v,gd_v_devman,gd_v_netman,
gd_v_wallman]},
{mod,{gajudesk,[]}}]}.

View File

@ -3,7 +3,7 @@
%%% @end
-module(gajudesk).
-vsn("0.5.6").
-vsn("0.6.0").
-behavior(application).
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <info@qpq.swiss>").

View File

@ -3,7 +3,7 @@
%%% @end
-module(gd_con).
-vsn("0.5.6").
-vsn("0.6.0").
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <info@qpq.swiss>").
-license("GPL-3.0-or-later").
@ -11,7 +11,7 @@
-behavior(gen_server).
-export([show_ui/1,
open_wallet/2, close_wallet/0, new_wallet/3, import_wallet/3, drop_wallet/2,
selected/1,
selected/1, network/0,
password/2,
refresh/0,
nonce/1, spend/1, chain/1, grids/1, sign_mess/1, sign_tx/1, sign_call/3, dry_run/2,
@ -112,6 +112,13 @@ selected(Index) ->
gen_server:cast(?MODULE, {selected, Index}).
-spec network() -> {ok, NetworkID} | none
when NetworkID :: binary().
network() ->
gen_server:call(?MODULE, network).
-spec password(Old, New) -> ok
when Old :: none | string(),
New :: none | string().
@ -353,6 +360,9 @@ handle_call(list_keys, _, State) ->
handle_call({nonce, ID}, _, State) ->
Response = do_nonce(ID),
{reply, Response, State};
handle_call(network, _, State) ->
Response = do_network(State),
{reply, Response, State};
handle_call({save, Module, Prefs}, _, State) ->
NewState = do_save(Module, Prefs, State),
{reply, ok, NewState};
@ -785,6 +795,12 @@ do_nonce(ID) ->
hz:next_nonce(ID).
do_network(#s{wallet = none}) ->
none;
do_network(#s{wallet = #wallet{chain_id = ChainID}}) ->
{ok, ChainID}.
%%% State Operations

View File

@ -37,7 +37,7 @@
%%% @end
-module(gd_grids).
-vsn("0.5.6").
-vsn("0.6.0").
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <info@qpq.swiss>").
-license("GPL-3.0-or-later").

View File

@ -3,7 +3,7 @@
%%% @end
-module(gd_gui).
-vsn("0.5.6").
-vsn("0.6.0").
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <info@qpq.swiss>").
-license("GPL-3.0-or-later").
@ -691,15 +691,27 @@ copy_to_clipboard(String) ->
end.
www(State = #s{id = {_, #w{wx = ID_T}}}) ->
String = wxStaticText:getLabel(ID_T),
URL = unicode:characters_to_list(["https://aescan.io/accounts/", String]),
ok =
case wx_misc:launchDefaultBrowser(URL) of
true -> log(info, "Opened in browser: ~ts", [URL]);
false -> log(info, "Failed to open browser: ~ts", [URL])
end,
State.
www(State = #s{id = {_, #w{wx = ID_T}}, j = J}) ->
case wxStaticText:getLabel(ID_T) of
"" ->
ok = handle_troubling(State, J("No key selected.")),
State;
ID ->
ok = www2(State, ID),
State
end.
www2(State = #s{j = J}, AccountID) ->
case gd_con:network() of
{ok, ChainID} ->
URL = unicode:characters_to_list(["https://", ChainID, ".gajumaru.io/account/", AccountID]),
case wx_misc:launchDefaultBrowser(URL) of
true -> log(info, "Opened in browser: ~ts", [URL]);
false -> log(info, "Failed to open browser: ~ts", [URL])
end;
none ->
handle_troubling(State, J("No chain assigned."))
end.
spend(State = #s{accounts = []}) ->

View File

@ -15,7 +15,7 @@
%%% translation library is retained).
-module(gd_jt).
-vsn("0.5.6").
-vsn("0.6.0").
-export([read_translations/1, j/2, oneshot_j/2]).

View File

@ -1,5 +1,5 @@
-module(gd_sophia_editor).
-vsn("0.5.6").
-vsn("0.6.0").
-export([new/1, update/2,
get_text/1, set_text/2]).

View File

@ -12,7 +12,7 @@
%%% @end
-module(gd_sup).
-vsn("0.5.6").
-vsn("0.6.0").
-behaviour(supervisor).
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <info@qpq.swiss>").

View File

@ -1,5 +1,5 @@
-module(gd_v).
-vsn("0.5.6").
-vsn("0.6.0").
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <info@qpq.swiss>").
-license("GPL-3.0-or-later").

View File

@ -1,5 +1,5 @@
-module(gd_v_devman).
-vsn("0.5.6").
-vsn("0.6.0").
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <info@qpq.swiss>").
-license("GPL-3.0-or-later").

View File

@ -1,5 +1,5 @@
-module(gd_v_netman).
-vsn("0.5.6").
-vsn("0.6.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("QPQ AG <info@qpq.swiss>").
-license("GPL-3.0-or-later").

View File

@ -1,5 +1,5 @@
-module(gd_v_wallman).
-vsn("0.5.6").
-vsn("0.6.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("QPQ AG <info@qpq.swiss>").
-license("GPL-3.0-or-later").

View File

@ -1,10 +1,10 @@
{name,"GajuDesk"}.
{type,gui}.
{modules,[]}.
{author,"Craig Everett"}.
{prefix,"gd"}.
{desc,"A desktop client for the Gajumaru network of blockchain networks"}.
{package_id,{"otpr","gajudesk",{0,5,6}}}.
{author,"Craig Everett"}.
{package_id,{"otpr","gajudesk",{0,6,0}}}.
{deps,[{"otpr","hakuzaru",{0,6,1}},
{"otpr","eblake2",{1,0,1}},
{"otpr","base58",{0,1,1}},