-
Notifications
You must be signed in to change notification settings - Fork 1
updating thr dev #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updating thr dev #34
Conversation
fix: Update source path in deployment workflow to include all files
fix: Update file source patterns in deployment workflow to include hi…
…trip components option
…sats Add /convert command
* Add thousand separators for satoshi amounts * Refactor error logger formatting * add plus sign option for FormatSats
* fix: add sat formattings * fix: more missed templates * fix: more missed templates * fix: more missed templates
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||||
PR Type
Enhancement, Bug fix, Documentation
Description
• Centralized satoshi formatting: Added new
utils.FormatSats()function with thousands separators and proper unit handling ("sat" vs "sats")• Comprehensive formatting implementation: Updated all payment-related messages across Telegram handlers, API endpoints, and LNURL functionality to use formatted amounts
• New convert command: Added
/convertcommand for satoshi to fiat (USD/LKR) conversion with proper formatting• Translation updates: Updated all language files to use string format specifiers (
%s) instead of integer (%d) for amount display• Deployment refactoring: Changed build process from GitHub Actions to server-side execution
• Bug fix: Corrected log format specifier in database migration from
%dto%sfor user ID• Documentation: Added convert command documentation and BotFather configuration
• Testing utilities: Added API payment testing script with HMAC authentication
Changes walkthrough 📝
31 files
api_approval.go
Replace hardcoded satoshi formatting with utils.FormatSats in APIapprovalinternal/telegram/api_approval.go
• Added import for
internal/utilspackage• Replaced hardcoded satoshi
formatting with
utils.FormatSats()function calls• Updated error
messages, log messages, and notification messages to use formatted
satoshi display
• Modified approval request messages to show formatted
amounts with proper units
send.go
Implement formatted satoshi display in API send functionalityinternal/api/send.go
• Added import for
internal/utilspackage• Updated API error messages
to use
utils.FormatSats()for amount formatting• Modified
insufficient balance error messages to display formatted satoshi
amounts
• Updated approval threshold messages and notification
messages with formatted amounts
error_logger.go
Refactor error logging to use centralized satoshi formattinginternal/telegram/error_logger.go
• Added import for
internal/utilspackage• Removed local
formatSats()function implementation
• Updated payment and transaction error
logging to use
utils.FormatSats()• Modified error message formatting
to use centralized formatting function
shop.go
Apply formatted satoshi display to shop functionalityinternal/telegram/shop.go
• Added import for
internal/utilspackage• Updated shop item price
display to use
utils.FormatSats()• Modified purchase confirmation and
transaction messages with formatted amounts
• Updated log messages to
display formatted satoshi values
groups.go
Implement formatted amounts in group ticket functionalityinternal/telegram/groups.go
• Added import for
internal/utilspackage• Updated group ticket
invoice messages to use
utils.FormatSats()• Modified group creation
messages to display formatted ticket prices
• Applied formatting to
commission and payment notification messages
amounts.go
Format amount ranges and validation messagesinternal/telegram/amounts.go
• Added import for
internal/utilspackage• Updated amount range
validation messages to use
utils.FormatSats()• Modified user prompts
for amount entry to display formatted ranges
• Applied formatting to
error messages for invalid amount ranges
shop_helpers.go
Format shop item prices and purchase buttonsinternal/telegram/shop_helpers.go
• Added import for
internal/utilspackage• Updated shop item buy
button text to use
utils.FormatSats()• Modified purchase confirmation
menu to display formatted prices
• Applied formatting to shop item
display text
number_format.go
Add centralized satoshi formatting utility functioninternal/utils/number_format.go
• Added new
FormatSats()function for formatting satoshi amounts withthousands separators
• Implemented support for optional plus sign
display for positive amounts
• Added proper singular/plural unit
handling ("sat" vs "sats")
• Improved code formatting and structure
for existing
FormatFloatWithCommas()functiontooltip.go
Format tip amounts in tooltip messagesinternal/telegram/tooltip.go
• Added import for
internal/utilspackage• Updated tip tooltip
messages to use
utils.FormatSats()• Modified tip amount display in
tooltip messages
• Applied formatting to new tooltip creation messages
inline_send.go
Apply LKR formatting to inline send messagesinternal/telegram/inline_send.go
• Updated inline send messages to use
thirdparty.FormatSatsWithLKR()instead of raw amounts
• Modified acceptance and notification messages
to display formatted amounts
• Applied consistent formatting to sender
and receiver confirmation messages
balance.go
Format balance display with proper satoshi formattinginternal/telegram/balance.go
• Updated balance display message to use
utils.FormatSats()• Modified
log message to show formatted balance amounts
• Applied formatting to
balance handler output
inline_receive.go
Apply LKR formatting to inline receive functionalityinternal/telegram/inline_receive.go
• Updated inline receive messages to use
thirdparty.FormatSatsWithLKR()• Modified acceptance and notification
messages with formatted amounts
• Applied consistent LKR formatting to
receiver and sender messages
lnurl-pay.go
Format LNURL pay amount validation messagesinternal/telegram/lnurl-pay.go
• Added import for
internal/utilspackage• Updated LNURL pay amount
range validation messages to use
utils.FormatSats()• Modified error
messages to display formatted amount ranges
lnurl-withdraw.go
Format LNURL withdraw amount validation messagesinternal/telegram/lnurl-withdraw.go
• Added import for
internal/utilspackage• Updated LNURL withdraw
amount range validation to use
utils.FormatSats()• Modified error
messages to display formatted withdrawal limits
faucet.go
Format faucet amounts and summary displayinternal/telegram/faucet.go
• Added import for
internal/utilspackage• Updated faucet summary
display to use
utils.FormatSats()• Modified faucet capacity and
remaining amount messages with formatting
convertsats.go
Add new satoshi to fiat conversion commandinternal/telegram/convertsats.go
• New file implementing satoshi to fiat conversion functionality
•
Added
/convertcommand handler for converting sats to USD and LKR•
Implemented input validation and error handling for conversion amounts
• Used
utils.FormatSats()andutils.FormatFloatWithCommas()fordisplay formatting
ticket.go
Format ticket payment amounts in group functionalityinternal/telegram/ticket.go
• Added import for
internal/utilspackage• Updated ticket payment
requirement message to use
utils.FormatSats()• Modified group join
payment notification with formatted amounts
tipjar.go
Format tipjar amounts and summary displayinternal/telegram/tipjar.go
• Added import for
internal/utilspackage• Updated tipjar summary
display to use
utils.FormatSats()• Modified tipjar capacity and
collected amount messages with formatting
lnurl.go
Format LNURL payment validation error messagesinternal/lnurl/lnurl.go
• Added import for
internal/utilspackage• Updated LNURL payment
amount validation error messages to use
utils.FormatSats()• Modified
out-of-bounds error messages to display formatted amount ranges
transactions.go
Format transaction amounts and fees in transaction historyinternal/telegram/transactions.go
• Added import for
internal/utilspackage• Updated transaction list
display to use
utils.FormatSats()with plus sign for amounts•
Modified fee display in transaction history with formatted amounts
pending_transactions.go
Format amounts in admin pending transaction notificationsinternal/api/admin/pending_transactions.go
• Added import for
internal/utilspackage• Updated admin notification
messages to use
utils.FormatSats()• Modified pending transaction
execution notifications with formatted amounts
webhook.go
Format webhook invoice amounts in notificationsinternal/lnbits/webhook/webhook.go
• Added import for
internal/utilspackage• Updated webhook invoice
received message to use
utils.FormatSats()• Modified fallback
notification message with formatted amounts
lkrsats.go
Format LKR to satoshi conversion resultsinternal/telegram/lkrsats.go
• Added import for
internal/utilspackage• Updated LKR to satoshi
conversion result message to use formatted functions
• Applied
utils.FormatFloatWithCommas()andutils.FormatSats()to conversionoutput
buttons.go
Format balance display in main menu buttonsinternal/telegram/buttons.go
• Updated main menu balance button to use
thirdparty.FormatSatsWithLKR()• Modified balance display in main menu
with LKR formatting
handler.go
Register new convert command handlerinternal/telegram/handler.go
• Added new
/convertcommand endpoint configuration• Registered
satToFiatHandlerfor the convert command• Applied standard
interceptors for private chat, localization, and logging
coingecko.go
Integrate centralized formatting in LKR display functioninternal/thirdparty/coingecko.go
• Updated
FormatSatsWithLKR()function to useutils.FormatSats()•
Modified fallback formatting to use centralized formatting function
•
Applied consistent formatting to LKR value display
pl.toml
Update Polish translations for formatted amount displaytranslations/pl.toml
• Updated Polish translation strings to use
%sformat specifiersinstead of
%d• Modified amount-related messages to support formatted
string display
• Applied consistent formatting placeholders across all
amount references
cs.toml
Update Czech translations for formatted amount displaytranslations/cs.toml
• Updated Czech translation strings to use
%sformat specifiersinstead of
%d• Modified amount-related messages to support formatted
string display
• Applied consistent formatting placeholders across all
amount references
fi.toml
Update Finnish translations for formatted amount displaytranslations/fi.toml
• Updated Finnish translation strings to use
%sformat specifiersinstead of
%d• Modified amount-related messages to support formatted
string display
• Applied consistent formatting placeholders across all
amount references
de.toml
Update German translations for formatted amount displaytranslations/de.toml
• Updated German translation strings to use
%sformat specifiersinstead of
%d• Modified amount-related messages to support formatted
string display
• Added new
convertSatsResultMessagetranslation forsatoshi conversion
en.toml
Update English translations for formatted amount displaytranslations/en.toml
• Updated English translation strings to use
%sformat specifiersinstead of
%d• Modified amount-related messages to support formatted
string display
• Added new
convertSatsResultMessagetranslation forsatoshi to fiat conversion
1 files
migrations.go
Fix log format specifier in database migrationinternal/database/migrations.go
• Fixed log message format specifier from
%dto%sfor user ID•
Corrected string formatting in migration log output
1 files
test_pay_api.sh
Add API payment testing scripttest_pay_api.sh
• New shell script for testing API payment functionality
• Implements
HMAC signature generation for API authentication
• Provides example
curl command for testing payment endpoints
2 files
build-deploy.yml
Refactor deployment to build application on server.github/workflows/build-deploy.yml
• Moved application build process from GitHub Actions to server-side
execution
• Updated deployment workflow to transfer source code
instead of pre-built binary
• Modified deployment steps to build
application on target server
botfather-setcommands.txt
Add convert command to BotFather configurationbotfather-setcommands.txt
• Added new
convertcommand definition for BotFather configuration•
Included description for satoshi to fiat conversion functionality
9 files
config.yaml.example
Minor formatting fix in config exampleconfig.yaml.example
• Removed trailing newline from configuration file
• Minor formatting
adjustment to file ending
ru.toml
Update Russian translation amount formatting from integer to stringtranslations/ru.toml
• Changed format specifiers from
%dto%sfor amount display inbalance, tip, send, invoice, and faucet messages
• Updated currency
amount formatting to use string placeholders instead of integer
formatting
• Modified range validation messages to use string
formatting for min/max values
• Applied consistent string formatting
across all payment-related message templates
es.toml
Update Spanish translation amount formatting from integer to stringtranslations/es.toml
• Changed format specifiers from
%dto%sfor amount display inbalance, tip, send, invoice, and faucet messages
• Updated currency
amount formatting to use string placeholders instead of integer
formatting
• Modified range validation messages to use string
formatting for min/max values
• Added new
convertSatsResultMessageforsat to fiat conversion display
pt-br.toml
Update Portuguese (Brazil) translation amount formatting from integerto stringtranslations/pt-br.toml
• Changed format specifiers from
%dto%sfor amount display inbalance, tip, send, invoice, and faucet messages
• Updated currency
amount formatting to use string placeholders instead of integer
formatting
• Modified range validation messages to use string
formatting for min/max values
• Applied consistent string formatting
across all payment-related message templates
it.toml
Update Italian translation amount formatting from integer to stringtranslations/it.toml
• Changed format specifiers from
%dto%sfor amount display inbalance, tip, send, invoice, and faucet messages
• Updated currency
amount formatting to use string placeholders instead of integer
formatting
• Modified range validation messages to use string
formatting for min/max values
• Added new
convertSatsResultMessageforsat to fiat conversion display
id.toml
Update Indonesian translation amount formatting from integer to stringtranslations/id.toml
• Changed format specifiers from
%dto%sfor amount display inbalance, tip, send, invoice, and faucet messages
• Updated currency
amount formatting to use string placeholders instead of integer
formatting
• Modified range validation messages to use string
formatting for min/max values
• Applied consistent string formatting
across all payment-related message templates
tr.toml
Update Turkish translation amount formatting from integer to stringtranslations/tr.toml
• Changed format specifiers from
%dto%sfor amount display inbalance, tip, send, invoice, and faucet messages
• Updated currency
amount formatting to use string placeholders instead of integer
formatting
• Modified range validation messages to use string
formatting for min/max values
• Applied consistent string formatting
across all payment-related message templates
nl.toml
Update Dutch translation amount formatting from integer to stringtranslations/nl.toml
• Changed format specifiers from
%dto%sfor amount display inbalance, tip, send, invoice, and faucet messages
• Updated currency
amount formatting to use string placeholders instead of integer
formatting
• Modified range validation messages to use string
formatting for min/max values
• Added new
convertSatsResultMessageforsat to fiat conversion display
fr.toml
Update French translation amount formatting from integer to stringtranslations/fr.toml
• Changed format specifiers from
%dto%sfor amount display inbalance, tip, send, invoice, and faucet messages
• Updated currency
amount formatting to use string placeholders instead of integer
formatting
• Modified range validation messages to use string
formatting for min/max values
• Applied consistent string formatting
across all payment-related message templates
1 files
README.md
Document new convert command in READMEREADME.md
• Added documentation for new
/convertcommand• Updated command list
to include satoshi to fiat conversion functionality
1 files