From 2d8333b89a815f6610e4d6d3d759ee29a130b3e3 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Tue, 20 May 2025 10:19:46 +0300 Subject: [PATCH 1/4] add the new env variables --- .env.example | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.env.example b/.env.example index 7287e7c..bae96b5 100644 --- a/.env.example +++ b/.env.example @@ -21,3 +21,10 @@ LANGUAGES=eng, swa #Alias search domains ALIAS_SEARCH_DOMAINS=sarafu.local, sarafu.eth + +#Pool swap +DEFAULT_POOL_NAME="Kenya ROLA Pool" +DEFAULT_POOL_SYMBOL=ROLA +DEFAULT_POOL_CONTRACT_ADDRESS=0x48a953cA5cf5298bc6f6Af3C608351f537AAcb9e +DEFAULT_LIMITER_ADDRESS= +DEFAULT_VOUCHER_REGISTRY= From cf237c592ae7b5305a585c1223e265ccdbb6039d Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Tue, 20 May 2025 10:25:27 +0300 Subject: [PATCH 2/4] add the pool variables to the config --- config/config.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 863e418..9e8412e 100644 --- a/config/config.go +++ b/config/config.go @@ -25,7 +25,7 @@ const ( defaultSSHHost string = "127.0.0.1" defaultSSHPort uint = 7122 defaultHTTPHost string = "127.0.0.1" - defaultHTTPPort uint = 7123 + defaultHTTPPort uint = 7123 defaultDomain = "sarafu.local" ) @@ -52,7 +52,6 @@ func SearchDomains() []string { return ParsedDomains } - func Language() string { return viseconfig.DefaultLanguage } @@ -76,3 +75,15 @@ func PortSSH() uint { func ATEndpoint() string { return env.GetEnv("AT_ENDPOINT", "/") } + +func DefaultPoolAddress() string { + return env.GetEnv("DEFAULT_POOL_CONTRACT_ADDRESS", "") +} + +func DefaultPoolName() string { + return env.GetEnv("DEFAULT_POOL_NAME", "") +} + +func DefaultPoolSymbol() string { + return env.GetEnv("DEFAULT_POOL_SYMBOL", "") +} From 5d8fee470a7aa34c73efdfc6d0c67230ec867086 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Tue, 20 May 2025 10:26:01 +0300 Subject: [PATCH 3/4] use the default pool variables --- handlers/application/menuhandler.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/handlers/application/menuhandler.go b/handlers/application/menuhandler.go index 40abbe5..65fd259 100644 --- a/handlers/application/menuhandler.go +++ b/handlers/application/menuhandler.go @@ -2738,9 +2738,9 @@ func (h *MenuHandlers) LoadSwapToList(ctx context.Context, sym string, input []b } defaultPool := dataserviceapi.PoolDetails{ - PoolName: "Kenya ROLA Pool", - PoolSymbol: "ROLA", - PoolContractAdrress: "0x48a953cA5cf5298bc6f6Af3C608351f537AAcb9e", + PoolName: config.DefaultPoolName(), + PoolSymbol: config.DefaultPoolSymbol(), + PoolContractAdrress: config.DefaultPoolAddress(), LimiterAddress: "", VoucherRegistry: "", } @@ -2765,8 +2765,9 @@ func (h *MenuHandlers) LoadSwapToList(ctx context.Context, sym string, input []b if !r.CanSwapFrom { res.FlagSet = append(res.FlagSet, flag_incorrect_voucher) res.Content = l.Get( - "%s is not in the KENYA ROLA POOL. Please update your voucher and try again.", + "%s is not in %s. Please update your voucher and try again.", activeSym, + config.DefaultPoolName(), ) return res, nil } From d3ad3b2db6d82c4cba275a219c022b6f642a8b3a Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Tue, 20 May 2025 10:26:28 +0300 Subject: [PATCH 4/4] update the template and remove hardcoded values --- services/registration/locale/swa/default.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/registration/locale/swa/default.po b/services/registration/locale/swa/default.po index 5e5d456..fbd92fb 100644 --- a/services/registration/locale/swa/default.po +++ b/services/registration/locale/swa/default.po @@ -37,5 +37,5 @@ msgstr "Ombi lako limetumwa. Utapokea SMS wakati %s %s yako itakapobadilishwa ku msgid "%s balance: %s\n" msgstr "%s salio: %s\n" -msgid "%s is not in the KENYA ROLA POOL. Please update your voucher and try again." -msgstr "%s haipo kwenye BWAWA LA KENYA ROLA. Tafadhali badilisha sarafu yako na ujaribu tena." \ No newline at end of file +msgid "%s is not in %s. Please update your voucher and try again." +msgstr "%s haipo kwenye %s. Tafadhali badilisha sarafu yako na ujaribu tena." \ No newline at end of file