Skip to content
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

Wallet limits: max balance, daily max withdraw, transactions per sec #2223

Merged
merged 21 commits into from
Feb 9, 2024

Conversation

callebtc
Copy link
Collaborator

@callebtc callebtc commented Jan 29, 2024

New .env variable LNBITS_MAX_WALLET_BALANCE_SAT can limit the maximum balance for each wallet and throw an error if the wallet attempts to create a new invoice.

Example: LNBITS_MAX_WALLET_BALANCE_SAT=1000000

=============UPDATE==============

Legacy banks, exchanges, anything dealing with money have wallet limits, so adding a few more optional wallet limits seems like a good security tool.

Added daily max limit and transactions per second.

image

Copy link

codecov bot commented Jan 29, 2024

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (5edb845) 59.26% compared to head (4cfdcbd) 59.25%.
Report is 1 commits behind head on dev.

Files Patch % Lines
lnbits/core/services.py 51.61% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2223      +/-   ##
==========================================
- Coverage   59.26%   59.25%   -0.02%     
==========================================
  Files          60       60              
  Lines        8992     9026      +34     
==========================================
+ Hits         5329     5348      +19     
- Misses       3663     3678      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@prusnak prusnak added this to the 0.12.0 milestone Jan 30, 2024
@dni dni changed the title Add wallet max balance feat: wallet max balance Feb 5, 2024
@dni dni requested review from prusnak, arcbtc and dni February 5, 2024 07:48
dni

This comment was marked as resolved.

@callebtc
Copy link
Collaborator Author

callebtc commented Feb 5, 2024

it should be editable on the admin ui aswell

@arcbtc wanted to implement that in this PR

@dni dni modified the milestones: 0.12.0, 0.12.1 Feb 5, 2024
@arcbtc arcbtc changed the title feat: wallet max balance WIP feat: wallet max balance Feb 7, 2024
@arcbtc arcbtc marked this pull request as draft February 7, 2024 00:30
@arcbtc arcbtc marked this pull request as ready for review February 7, 2024 10:07
@arcbtc arcbtc changed the title WIP feat: wallet max balance Wallet limits: max balance, daily max withdraw, transactions per sec Feb 7, 2024
Copy link
Member

@arcbtc arcbtc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LFG!

@motorina0 motorina0 self-requested a review February 8, 2024 13:27
package.json Outdated Show resolved Hide resolved
@motorina0 motorina0 merged commit d9d2d59 into dev Feb 9, 2024
22 checks passed
@motorina0 motorina0 deleted the add-wallet-max-balance branch February 9, 2024 15:25
@dni dni modified the milestones: 0.12.2, 0.12.1 Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants