Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
can now also specify paths in access_key, secret, passphrase
Browse files Browse the repository at this point in the history
lollerfirst committed Aug 12, 2024
1 parent d6f424e commit fed9d0b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cashu/lightning/lnmarkets.py
Original file line number Diff line number Diff line change
@@ -59,6 +59,17 @@ def __init__(self, unit: Unit, **kwargs):
if not passphrase:
raise Exception("No API passphrase provided")

# You can specify paths instead
if os.path.exists(access_key):
with open(access_key, "r") as f:
access_key = f.read()
if os.path.exists(secret):
with open(secret, "r") as f:
secret = f.read()
if os.path.exists(passphrase):
with open(passphrase, "r") as f:
passphrase = f.read()

self.secret = secret
self.headers: Dict[str, Union[str, int]] = {
"LNM-ACCESS-KEY": access_key,

0 comments on commit fed9d0b

Please sign in to comment.