@@ -206,13 +206,17 @@ class LightsparkCoroutinesClient private constructor(
206
206
* @param memo Optional memo to include in the invoice.
207
207
* @param type The type of invoice to create. Defaults to [InvoiceType.STANDARD].
208
208
* @param expirySecs The number of seconds until the invoice expires. Defaults to 1 day.
209
+ * @param paymentHash Optional payment hash to include in the invoice.
210
+ * @param preimageNonce Optional preimage nonce to include in the invoice.
209
211
*/
210
212
suspend fun createInvoice (
211
213
nodeId : String ,
212
214
amountMsats : Long ,
213
215
memo : String? = null,
214
216
type : InvoiceType = InvoiceType .STANDARD ,
215
217
expirySecs : Int? = null,
218
+ paymentHash : String? = null,
219
+ preimageNonce : String? = null,
216
220
): Invoice {
217
221
requireValidAuth()
218
222
return executeQuery(
@@ -224,6 +228,8 @@ class LightsparkCoroutinesClient private constructor(
224
228
memo?.let { add(" memo" , memo) }
225
229
add(" type" , serializerFormat.encodeToJsonElement(type))
226
230
expirySecs?.let { add(" expirySecs" , expirySecs) }
231
+ paymentHash?.let { add(" paymentHash" , paymentHash) }
232
+ preimageNonce?.let { add(" preimageNonce" , preimageNonce) }
227
233
},
228
234
) {
229
235
val invoiceJson =
@@ -244,12 +250,16 @@ class LightsparkCoroutinesClient private constructor(
244
250
* @param metadata The LNURL metadata payload field from the initial payreq response. This will be hashed and
245
251
* present in the h-tag (SHA256 purpose of payment) of the resulting Bolt 11 invoice.
246
252
* @param expirySecs The number of seconds until the invoice expires. Defaults to 1 day.
253
+ * @param paymentHash Optional payment hash to include in the invoice.
254
+ * @param preimageNonce Optional preimage nonce to include in the invoice.
247
255
*/
248
256
suspend fun createLnurlInvoice (
249
257
nodeId : String ,
250
258
amountMsats : Long ,
251
259
metadata : String ,
252
260
expirySecs : Int? = null,
261
+ paymentHash : String? = null,
262
+ preimageNonce : String? = null,
253
263
): Invoice {
254
264
requireValidAuth()
255
265
@@ -265,6 +275,8 @@ class LightsparkCoroutinesClient private constructor(
265
275
add(" amountMsats" , amountMsats)
266
276
add(" metadataHash" , metadataHash)
267
277
expirySecs?.let { add(" expirySecs" , expirySecs) }
278
+ paymentHash?.let { add(" paymentHash" , paymentHash) }
279
+ preimageNonce?.let { add(" preimageNonce" , preimageNonce) }
268
280
},
269
281
) {
270
282
val invoiceJson =
@@ -288,6 +300,8 @@ class LightsparkCoroutinesClient private constructor(
288
300
* @param signingPrivateKey The receiver's signing private key. Used to hash the receiver identifier.
289
301
* @param receiverIdentifier Optional identifier of the receiver. If provided, this will be hashed using a
290
302
* monthly-rotated seed and used for anonymized analysis.
303
+ * @param paymentHash Optional payment hash to include in the invoice.
304
+ * @param preimageNonce Optional preimage nonce to include in the invoice.
291
305
*/
292
306
@Throws(IllegalArgumentException ::class )
293
307
suspend fun createUmaInvoice (
@@ -297,6 +311,8 @@ class LightsparkCoroutinesClient private constructor(
297
311
expirySecs : Int? = null,
298
312
signingPrivateKey : ByteArray? = null,
299
313
receiverIdentifier : String? = null,
314
+ paymentHash : String? = null,
315
+ preimageNonce : String? = null,
300
316
): Invoice {
301
317
requireValidAuth()
302
318
@@ -320,6 +336,8 @@ class LightsparkCoroutinesClient private constructor(
320
336
add(" metadataHash" , metadataHash)
321
337
expirySecs?.let { add(" expirySecs" , expirySecs) }
322
338
receiverHash?.let { add(" receiverHash" , receiverHash) }
339
+ paymentHash?.let { add(" paymentHash" , paymentHash) }
340
+ preimageNonce?.let { add(" preimageNonce" , preimageNonce) }
323
341
},
324
342
) {
325
343
val invoiceJson =
0 commit comments