File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1515 PrivateFormat ,
1616 PublicFormat ,
1717)
18+
1819from lightspark .exceptions import LightsparkException
1920from lightspark .objects .Account import Account
2021from lightspark .objects .Account import from_json as Account_from_json
@@ -187,6 +188,27 @@ def create_invoice(
187188
188189 return Invoice_from_json (self ._requester , json ["create_invoice" ]["invoice" ])
189190
191+ def create_hold_invoice (
192+ self ,
193+ node_id : str ,
194+ amount_msats : int ,
195+ memo : Optional [str ] = None ,
196+ payment_hash : Optional [str ] = None ,
197+ expiry_secs : Optional [int ] = None ,
198+ ) -> Invoice :
199+ logger .info ("Creating an invoice for node %s." , node_id )
200+ variables = {
201+ "amount_msats" : amount_msats ,
202+ "node_id" : node_id ,
203+ "payment_hash" : payment_hash ,
204+ "memo" : memo ,
205+ }
206+ if expiry_secs is not None :
207+ variables ["expiry_secs" ] = expiry_secs
208+ json = self ._requester .execute_graphql (CREATE_INVOICE_MUTATION , variables )
209+
210+ return Invoice_from_json (self ._requester , json ["create_invoice" ]["invoice" ])
211+
190212 def create_lnurl_invoice (
191213 self ,
192214 node_id : str ,
You can’t perform that action at this time.
0 commit comments