Compare commits
3 Commits
v1.4.6-rc.
...
debt-menu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c16c39f289
|
||
|
|
185ff0dc45
|
||
|
|
45ccefe1fe
|
@@ -160,7 +160,7 @@ func (h *MenuHandlers) CalculateCreditAndDebt(ctx context.Context, sym string, i
|
||||
|
||||
scaledCredit := "0"
|
||||
|
||||
// 1️. Find first stable voucher in POOL (for swap target)
|
||||
// 1. Find first stable voucher in POOL (for swap target)
|
||||
var firstPoolStable *dataserviceapi.TokenHoldings
|
||||
for i := range swappableVouchers {
|
||||
if isStableVoucher(swappableVouchers[i].TokenAddress) {
|
||||
@@ -169,7 +169,7 @@ func (h *MenuHandlers) CalculateCreditAndDebt(ctx context.Context, sym string, i
|
||||
}
|
||||
}
|
||||
|
||||
// 2️. If pool has a stable, get swap quote
|
||||
// 2. If pool has a stable, get swap quote
|
||||
if firstPoolStable != nil {
|
||||
finalAmountStr, err := store.ParseAndScaleAmount(
|
||||
string(activeBal),
|
||||
@@ -194,7 +194,7 @@ func (h *MenuHandlers) CalculateCreditAndDebt(ctx context.Context, sym string, i
|
||||
scaledCredit = store.AddDecimalStrings(scaledCredit, finalQuote)
|
||||
}
|
||||
|
||||
// 3️. Add ALL wallet stable balances (from FetchVouchers)
|
||||
// 3. Add ALL wallet stable balances (from FetchVouchers)
|
||||
for _, v := range allVouchers {
|
||||
if isStableVoucher(v.TokenAddress) {
|
||||
scaled := store.ScaleDownBalance(v.Balance, v.TokenDecimals)
|
||||
|
||||
@@ -535,7 +535,7 @@ func (h *MenuHandlers) SendMpesaMinLimit(ctx context.Context, sym string, input
|
||||
kshFormatted, _ := store.TruncateDecimalString(ksh, 0)
|
||||
|
||||
res.Content = l.Get(
|
||||
"Enter the amount of credit to receive: (Minimum %s Ksh)\n",
|
||||
"Enter the amount of credit to deposit: (Minimum %s Ksh)\n",
|
||||
kshFormatted,
|
||||
)
|
||||
|
||||
@@ -607,7 +607,7 @@ func (h *MenuHandlers) SendMpesaPreview(ctx context.Context, sym string, input [
|
||||
defaultAsset := config.DefaultMpesaAsset()
|
||||
|
||||
res.Content = l.Get(
|
||||
"You will get a prompt for your M-Pesa PIN shortly to send %s ksh and receive ~ %s %s",
|
||||
"You will get a prompt for your Mpesa PIN shortly to send %s ksh and receive ~ %s %s",
|
||||
inputStr, estimateFormatted, defaultAsset,
|
||||
)
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ func (h *MenuHandlers) ConfirmDebtRemoval(ctx context.Context, sym string, input
|
||||
}
|
||||
|
||||
res.Content = l.Get(
|
||||
"Please confirm that you will use %s %s to remove your debt of %s %s\n",
|
||||
"Please confirm that you will use %s %s to remove your debt of %s %s\nEnter your PIN:",
|
||||
inputStr, payDebtVoucher.TokenSymbol, qouteStr, string(activeSym),
|
||||
)
|
||||
|
||||
|
||||
@@ -175,6 +175,10 @@ func (h *MenuHandlers) SwapMaxLimit(ctx context.Context, sym string, input []byt
|
||||
return res, nil
|
||||
}
|
||||
|
||||
code := codeFromCtx(ctx)
|
||||
l := gotext.NewLocale(translationDir, code)
|
||||
l.AddDomain("default")
|
||||
|
||||
userStore := h.userdataStore
|
||||
metadata, err := store.GetSwapToVoucherData(ctx, userStore, sessionId, inputStr)
|
||||
if err != nil {
|
||||
@@ -235,7 +239,7 @@ func (h *MenuHandlers) SwapMaxLimit(ctx context.Context, sym string, input []byt
|
||||
return res, err
|
||||
}
|
||||
|
||||
res.Content = fmt.Sprintf(
|
||||
res.Content = l.Get(
|
||||
"Maximum: %s %s\n\nEnter amount of %s to swap for %s:",
|
||||
maxStr, swapData.ActiveSwapFromSym, swapData.ActiveSwapFromSym, swapData.ActiveSwapToSym,
|
||||
)
|
||||
@@ -323,8 +327,8 @@ func (h *MenuHandlers) SwapPreview(ctx context.Context, sym string, input []byte
|
||||
// Format to 2 decimal places
|
||||
qouteStr, _ := store.TruncateDecimalString(string(quoteAmountStr), 2)
|
||||
|
||||
res.Content = fmt.Sprintf(
|
||||
"You will swap:\n%s %s for %s %s:",
|
||||
res.Content = l.Get(
|
||||
"You will swap %s %s for %s %s:",
|
||||
inputStr, swapData.ActiveSwapFromSym, qouteStr, swapData.ActiveSwapToSym,
|
||||
)
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
{{.confirm_debt_removal}}
|
||||
Enter your PIN:
|
||||
{{.confirm_debt_removal}}
|
||||
@@ -59,7 +59,7 @@ msgid "Enter the amount of M-Pesa to get: (Max %s Ksh)\n"
|
||||
msgstr "Weka kiasi cha M-Pesa cha kupata: (Kikomo %s Ksh)\n"
|
||||
|
||||
msgid "You are sending %s %s in order to receive ~ %s ksh"
|
||||
msgstr "Unatuma ~ %s %s ili upoke %s ksh"
|
||||
msgstr "Unatuma ~ %s %s ili upokee %s ksh"
|
||||
|
||||
msgid "Your request has been sent. Please await confirmation"
|
||||
msgstr "Ombi lako limetumwa. Tafadhali subiri"
|
||||
@@ -67,8 +67,8 @@ msgstr "Ombi lako limetumwa. Tafadhali subiri"
|
||||
msgid "Enter the amount of M-Pesa to send: (Minimum %s Ksh)\n"
|
||||
msgstr "Weka kiasi cha M-Pesa cha kutuma: (Kima cha chini %s Ksh)\n"
|
||||
|
||||
msgid "You will get a prompt for your M-Pesa PIN shortly to send %s ksh and receive ~ %s cUSD"
|
||||
msgstr "Utapokea kidokezo cha PIN yako ya M-Pesa hivi karibuni kutuma %s ksh na kupokea ~ %s cUSD"
|
||||
msgid "You will get a prompt for your Mpesa PIN shortly to send %s ksh and receive ~ %s %s"
|
||||
msgstr "Utapokea kidokezo cha PIN yako ya Mpesa hivi karibuni kutuma %s ksh na kupokea ~ %s %s"
|
||||
|
||||
msgid "Your request has been sent. Thank you for using Sarafu"
|
||||
msgstr "Ombi lako limetumwa. Asante kwa kutumia huduma ya Sarafu"
|
||||
@@ -76,7 +76,7 @@ msgstr "Ombi lako limetumwa. Asante kwa kutumia huduma ya Sarafu"
|
||||
msgid "You can remove a max of %s %s from '%s' pool\nEnter amount of %s:(Max: %s)"
|
||||
msgstr "Unaweza kuondoa kiwango cha juu cha %s %s kutoka kwenye '%s'\n\nWeka kiwango cha %s:(Kikomo: %s)"
|
||||
|
||||
msgid "Please confirm that you will use %s %s to remove your debt of %s %s\n"
|
||||
msgid "Please confirm that you will use %s %s to remove your debt of %s %s\nEnter your PIN:"
|
||||
msgstr "Tafadhali thibitisha kwamba utatumia %s %s kulipa deni lako la %s %s.\nWeka PIN yako:"
|
||||
|
||||
msgid "Your active voucher %s is already set"
|
||||
@@ -95,4 +95,19 @@ msgid "%s will receive %s %s from %s"
|
||||
msgstr %s atapokea %s %s kutoka kwa %s"
|
||||
|
||||
msgid "You need another voucher to proceed. Only found %s."
|
||||
msgstr "Unahitaji kua na sarafu nyingine. Tumepata tu %s."
|
||||
msgstr "Unahitaji kua na sarafu nyingine. Tumepata tu %s."
|
||||
|
||||
msgid "Maximum: %s %s\n\nEnter amount of %s to swap for %s:"
|
||||
msgstr "Kikimo: %s %s\n\nWeka kiasi cha %s kitakacho badilishwa kua %s:"
|
||||
|
||||
msgid "You will swap %s %s for %s %s:"
|
||||
msgstr "Utabadilisha %s %s kua %s %s:"
|
||||
|
||||
msgid "Your request has been sent. You will receive an SMS when your debt of %s %s has been removed from %s."
|
||||
msgstr "Ombi lako limetumwa. Utapokea ujumbe wakati deni lako la %s %s litatolewa kwa %s."
|
||||
|
||||
msgid "Enter the amount of Mpesa to withdraw: (Min: Ksh %s, Max %s Ksh)\n"
|
||||
msgstr "Weka kiasi cha Mpesa utakacho toa: (Min: Ksh %s, Max %s Ksh)\n"
|
||||
|
||||
msgid "Enter the amount of credit to deposit: (Minimum %s Ksh)\n"
|
||||
msgstr "Weka kiasi utakacho weka (Kima cha chini: %s Ksh)\n"
|
||||
@@ -1 +1 @@
|
||||
{{.get_paydebt_voucher_list}}
|
||||
{{.get_paydebt_voucher_list}}
|
||||
@@ -1 +0,0 @@
|
||||
{{.calculate_max_pay_debt}}
|
||||
@@ -1,3 +1,2 @@
|
||||
{{.send_mpesa_preview}}
|
||||
|
||||
Please enter your account PIN to confirm:
|
||||
Enter your PIN to confirm:
|
||||
@@ -1,3 +1,2 @@
|
||||
{{.send_mpesa_preview}}
|
||||
|
||||
Tafadhali weka PIN ya akaunti yako kudhibitisha:
|
||||
Weka PIN yako kudhibitisha:
|
||||
@@ -12,7 +12,7 @@ INCMP > 88
|
||||
INCMP < 98
|
||||
INCMP _ 0
|
||||
INCMP quit 99
|
||||
LOAD swap_max_limit 64
|
||||
LOAD swap_max_limit 138
|
||||
RELOAD swap_max_limit
|
||||
CATCH api_failure flag_api_call_error 1
|
||||
CATCH . flag_incorrect_voucher 1
|
||||
|
||||
Reference in New Issue
Block a user