support pay-to-identifier.

This commit is contained in:
fiatjaf
2021-08-10 07:25:51 -03:00
parent 2bcc01d640
commit a019d29b9b
4 changed files with 97 additions and 50 deletions
+7
View File
@@ -0,0 +1,7 @@
from bech32 import bech32_decode, convertbits
def decode(lnurl: str) -> str:
hrp, data = bech32_decode(lnurl)
bech32_data = convertbits(data, 5, 8, False)
return bytes(bech32_data).decode("utf-8")