Skip to content

Commit

Permalink
pyln: Add wrapper for the keysend command
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker committed Jun 21, 2021
1 parent 6425bae commit 62e1e0e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions contrib/pyln-client/pyln/client/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -1353,3 +1353,26 @@ def getsharedsecret(self, point, **kwargs):
}
payload.update({k: v for k, v in kwargs.items()})
return self.call("getsharedsecret", payload)

def keysend(self, destination, msatoshi, label=None, maxfeepercent=None,
retry_for=None, maxdelay=None, exemptfee=None,
extratlvs=None):
"""
"""

if extra_tlvs is not None and not isinstance(extra_tlvs, dict):
raise ValueErrr(
"extra_tlvs is not a dictionary with integer keys and hexadecimal values"
)

payload = {
"destination": destination,
"msatoshi": msatoshi,
"label": label,
"maxfeepercent": maxfeepercent,
"retry_for": retry_for,
"maxdelay": maxdelay,
"exemptfee": exemptfee,
"extratlvs": extratlvs,
}
return self.call("keysend", payload)

0 comments on commit 62e1e0e

Please sign in to comment.