mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
lnaddr: make it possible to use lnaddr to decode arbitrary invoices on the cmd line
This commit is contained in:
parent
9256472485
commit
762d8be84f
1 changed files with 7 additions and 0 deletions
|
@ -402,3 +402,10 @@ class SerializableKey:
|
||||||
self.pubkey = pubkey
|
self.pubkey = pubkey
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
return self.pubkey.get_public_key_bytes(True)
|
return self.pubkey.get_public_key_bytes(True)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
# run using
|
||||||
|
# python3 -m electrum.lnaddr <invoice> <expected hrp>
|
||||||
|
# python3 -m electrum.lnaddr lntb1n1pdlcakepp5e7rn0knl0gm46qqp9eqdsza2c942d8pjqnwa5903n39zu28sgk3sdq423jhxapqv3hkuct5d9hkucqp2rzjqwyx8nu2hygyvgc02cwdtvuxe0lcxz06qt3lpsldzcdr46my5epmj9vk9sqqqlcqqqqqqqlgqqqqqqgqjqdhnmkgahfaynuhe9md8k49xhxuatnv6jckfmsjq8maxta2l0trh5sdrqlyjlwutdnpd5gwmdnyytsl9q0dj6g08jacvthtpeg383k0sq542rz2 tb1n
|
||||||
|
import sys
|
||||||
|
print(lndecode(sys.argv[1], expected_hrp=sys.argv[2]))
|
||||||
|
|
Loading…
Add table
Reference in a new issue