ensure that any stable coin can be sent to Mpesa without a swap
Some checks are pending
release / docker (push) Waiting to run

This commit is contained in:
Alfred Kamanda 2026-02-25 14:40:16 +03:00
parent 0d92872d90
commit 1a9dd64dd6
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -380,6 +380,19 @@ func (h *MenuHandlers) MaxAmount(ctx context.Context, sym string, input []byte)
return res, err
}
// Case for M-Pesa
// if the recipient is Mpesa (address), check if the sender's voucher is a stable coin
recipientAddress, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_RECIPIENT)
if err != nil {
logg.ErrorCtxf(ctx, "Failed to read recipient's address", "error", err)
return res, err
}
if string(recipientAddress) == config.DefaultMpesaAddress() && isStableVoucher(string(activeAddress)) {
res.FlagReset = append(res.FlagReset, flag_swap_transaction)
res.Content = l.Get("Maximum amount: %s %s\nEnter amount:", formattedBalance, string(activeSym))
return res, nil
}
if string(swapToVoucher.TokenAddress) == string(activeAddress) {
// recipient has active token same as selected token → normal transaction
transactionType = []byte("normal")