Skip to content

Commit a4e3773

Browse files
cdeckerrustyrussell
authored andcommitted
pyln: Add wrapper for the keysend command
1 parent b529117 commit a4e3773

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

contrib/pyln-client/pyln/client/lightning.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,3 +1353,26 @@ def getsharedsecret(self, point, **kwargs):
13531353
}
13541354
payload.update({k: v for k, v in kwargs.items()})
13551355
return self.call("getsharedsecret", payload)
1356+
1357+
def keysend(self, destination, msatoshi, label=None, maxfeepercent=None,
1358+
retry_for=None, maxdelay=None, exemptfee=None,
1359+
extratlvs=None):
1360+
"""
1361+
"""
1362+
1363+
if extra_tlvs is not None and not isinstance(extra_tlvs, dict):
1364+
raise ValueErrr(
1365+
"extra_tlvs is not a dictionary with integer keys and hexadecimal values"
1366+
)
1367+
1368+
payload = {
1369+
"destination": destination,
1370+
"msatoshi": msatoshi,
1371+
"label": label,
1372+
"maxfeepercent": maxfeepercent,
1373+
"retry_for": retry_for,
1374+
"maxdelay": maxdelay,
1375+
"exemptfee": exemptfee,
1376+
"extratlvs": extratlvs,
1377+
}
1378+
return self.call("keysend", payload)

0 commit comments

Comments
 (0)