-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 from lightsparkdev/feat/incoming_payments_for…
…_payment_hash Add incoming_payments_for_payment_hash query.
- Loading branch information
Showing
12 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...rk-sdk/src/commonMain/kotlin/com/lightspark/sdk/graphql/IncomingPaymentsForPaymentHash.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.lightspark.sdk.graphql | ||
|
||
import com.lightspark.sdk.model.IncomingPayment | ||
|
||
const val IncomingPaymentsForPaymentHashQuery = """ | ||
query OutgoingPaymentsForInvoice( | ||
${'$'}paymentHash: Hash32!, | ||
${'$'}transactionStatuses: [TransactionStatus!] = null | ||
) { | ||
incoming_payments_for_payment_hash(input: { | ||
payment_hash: ${'$'}paymentHash, | ||
statuses: ${'$'}transactionStatuses | ||
}) { | ||
payments { | ||
...IncomingPaymentFragment | ||
} | ||
} | ||
} | ||
${IncomingPayment.FRAGMENT} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...rc/commonMain/kotlin/com/lightspark/sdk/model/IncomingPaymentsForPaymentHashQueryInput.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved | ||
@file:Suppress("ktlint:standard:max-line-length") | ||
|
||
package com.lightspark.sdk.model | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* | ||
* @param paymentHash The 32-byte hash of the payment preimage for which to fetch payments | ||
* @param statuses An optional filter to only query incoming payments of given statuses. | ||
*/ | ||
@Serializable | ||
@SerialName("IncomingPaymentsForPaymentHashQueryInput") | ||
data class IncomingPaymentsForPaymentHashQueryInput( | ||
val paymentHash: String, | ||
val statuses: List<TransactionStatus>? = null, | ||
) { | ||
companion object { | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...c/commonMain/kotlin/com/lightspark/sdk/model/IncomingPaymentsForPaymentHashQueryOutput.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved | ||
@file:Suppress("ktlint:standard:max-line-length") | ||
|
||
package com.lightspark.sdk.model | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* | ||
*/ | ||
@Serializable | ||
@SerialName("IncomingPaymentsForPaymentHashQueryOutput") | ||
data class IncomingPaymentsForPaymentHashQueryOutput( | ||
@SerialName("incoming_payments_for_payment_hash_query_output_payments") | ||
val payments: List<IncomingPayment>, | ||
) { | ||
companion object { | ||
const val FRAGMENT = """ | ||
fragment IncomingPaymentsForPaymentHashQueryOutputFragment on IncomingPaymentsForPaymentHashQueryOutput { | ||
type: __typename | ||
incoming_payments_for_payment_hash_query_output_payments: payments { | ||
id | ||
} | ||
}""" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters