lnurlp: accept comments, USD prices, min/max ranges.

This commit is contained in:
fiatjaf
2020-10-22 15:58:15 -03:00
parent 2552fd8fc9
commit 2863653261
10 changed files with 495 additions and 322 deletions
+13
View File
@@ -33,3 +33,16 @@ def m002_webhooks_and_success_actions(db):
);
"""
)
def m003_min_max_comment_fiat(db):
"""
Support for min/max amounts, comments and fiat prices that get
converted automatically to satoshis based on some API.
"""
db.execute("ALTER TABLE pay_links ADD COLUMN currency TEXT;") # null = satoshis
db.execute("ALTER TABLE pay_links ADD COLUMN comment_chars INTEGER DEFAULT 0;")
db.execute("ALTER TABLE pay_links RENAME COLUMN amount TO min;")
db.execute("ALTER TABLE pay_links ADD COLUMN max INTEGER;")
db.execute("UPDATE pay_links SET max = min;")
db.execute("DROP TABLE invoices")