From 566503956d0ef96e7a1ddf7625007c7d50e4a5ed Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Wed, 26 Feb 2025 13:09:29 +0300 Subject: [PATCH] added pool_swap menu nodes --- handlers/local.go | 3 +++ services/registration/main.vis | 6 ++++-- services/registration/pool_swap | 2 ++ services/registration/pool_swap.vis | 8 ++++++++ services/registration/pool_swap_swa | 2 ++ services/registration/swap_from_list | 2 ++ services/registration/swap_from_list.vis | 7 +++++++ services/registration/swap_from_list_swa | 2 ++ services/registration/swap_to_list | 2 ++ services/registration/swap_to_list.vis | 7 +++++++ services/registration/swap_to_list_swa | 2 ++ 11 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 services/registration/pool_swap create mode 100644 services/registration/pool_swap.vis create mode 100644 services/registration/pool_swap_swa create mode 100644 services/registration/swap_from_list create mode 100644 services/registration/swap_from_list.vis create mode 100644 services/registration/swap_from_list_swa create mode 100644 services/registration/swap_to_list create mode 100644 services/registration/swap_to_list.vis create mode 100644 services/registration/swap_to_list_swa diff --git a/handlers/local.go b/handlers/local.go index 7d66c7d..d4b7eeb 100644 --- a/handlers/local.go +++ b/handlers/local.go @@ -124,6 +124,9 @@ func (ls *LocalHandlerService) GetHandler(accountService remote.AccountService) ls.DbRs.AddLocalFunc("set_back", appHandlers.SetBack) ls.DbRs.AddLocalFunc("show_blocked_account", appHandlers.ShowBlockedAccount) ls.DbRs.AddLocalFunc("clear_temporary_value", appHandlers.ClearTemporaryValue) + ls.DbRs.AddLocalFunc("get_pools", appHandlers.GetPools) + ls.DbRs.AddLocalFunc("swap_from_list", appHandlers.LoadSwapFromList) + ls.DbRs.AddLocalFunc("swap_to_list", appHandlers.LoadSwapToList) ls.first = appHandlers.Init return appHandlers, nil diff --git a/services/registration/main.vis b/services/registration/main.vis index 5996c97..d80acc9 100644 --- a/services/registration/main.vis +++ b/services/registration/main.vis @@ -9,13 +9,15 @@ RELOAD check_balance CATCH api_failure flag_api_call_error 1 MAP check_balance MOUT send 1 -MOUT vouchers 2 +MOUT swap 2 +MOUT vouchers 3 MOUT account 3 MOUT help 4 MOUT quit 9 HALT INCMP send 1 -INCMP my_vouchers 2 +INCMP pool_swap 2 +INCMP my_vouchers 3 INCMP my_account 3 INCMP help 4 INCMP quit 9 diff --git a/services/registration/pool_swap b/services/registration/pool_swap new file mode 100644 index 0000000..21d0739 --- /dev/null +++ b/services/registration/pool_swap @@ -0,0 +1,2 @@ +Enter number or pool symbol to swap from: +{{.get_pools}} \ No newline at end of file diff --git a/services/registration/pool_swap.vis b/services/registration/pool_swap.vis new file mode 100644 index 0000000..dd98b0d --- /dev/null +++ b/services/registration/pool_swap.vis @@ -0,0 +1,8 @@ +LOAD get_pools 100 +MAP get_pools +MOUT back 0 +MOUT quit 99 +HALT +INCMP _ 0 +INCMP quit 99 +INCMP swap_from_list * diff --git a/services/registration/pool_swap_swa b/services/registration/pool_swap_swa new file mode 100644 index 0000000..e12dc90 --- /dev/null +++ b/services/registration/pool_swap_swa @@ -0,0 +1,2 @@ +Chagua bwawa la sarafu la kubadilishana: +{{.get_pools}} \ No newline at end of file diff --git a/services/registration/swap_from_list b/services/registration/swap_from_list new file mode 100644 index 0000000..e0cc3d2 --- /dev/null +++ b/services/registration/swap_from_list @@ -0,0 +1,2 @@ +Select number or symbol to swap FROM: +{{.swap_from_list}} \ No newline at end of file diff --git a/services/registration/swap_from_list.vis b/services/registration/swap_from_list.vis new file mode 100644 index 0000000..e316e6e --- /dev/null +++ b/services/registration/swap_from_list.vis @@ -0,0 +1,7 @@ +LOAD swap_from_list 0 +CATCH _ flag_incorrect_pool 1 +MAP swap_from_list +MOUT back 0 +HALT +INCMP _ 0 +INCMP swap_to_list * diff --git a/services/registration/swap_from_list_swa b/services/registration/swap_from_list_swa new file mode 100644 index 0000000..ef716fd --- /dev/null +++ b/services/registration/swap_from_list_swa @@ -0,0 +1,2 @@ +Chagua nambari au ishara ya sarafu kubadilisha KUTOKA: +{{.swap_from_list}} \ No newline at end of file diff --git a/services/registration/swap_to_list b/services/registration/swap_to_list new file mode 100644 index 0000000..86f56c3 --- /dev/null +++ b/services/registration/swap_to_list @@ -0,0 +1,2 @@ +Select number or symbol to swap TO: +{{.swap_to_list}} \ No newline at end of file diff --git a/services/registration/swap_to_list.vis b/services/registration/swap_to_list.vis new file mode 100644 index 0000000..e420a69 --- /dev/null +++ b/services/registration/swap_to_list.vis @@ -0,0 +1,7 @@ +LOAD swap_to_list 0 +CATCH _ flag_incorrect_voucher 1 +MAP swap_to_list +MOUT back 0 +HALT +INCMP _ 0 +INCMP swap_limit * diff --git a/services/registration/swap_to_list_swa b/services/registration/swap_to_list_swa new file mode 100644 index 0000000..42da7d3 --- /dev/null +++ b/services/registration/swap_to_list_swa @@ -0,0 +1,2 @@ +Chagua nambari au ishara ya sarafu kubadilisha KWENDA: +{{.swap_to_list}} \ No newline at end of file