diff --git a/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/Account.kt b/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/Account.kt index af287b6c..596c978b 100644 --- a/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/Account.kt +++ b/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/Account.kt @@ -721,13 +721,15 @@ query FetchAccountToChannelsConnection(${'$'}bitcoin_network: BitcoinNetwork!, $ lightningNodeId: String? = null, statuses: List? = null, excludeFailures: TransactionFailures? = null, + maxAmount: CurrencyAmountInput? = null, + minAmount: CurrencyAmountInput? = null, ): Query { return Query( queryPayload = """ -query FetchAccountToTransactionsConnection(${'$'}first: Int, ${'$'}after: String, ${'$'}types: [TransactionType!], ${'$'}after_date: DateTime, ${'$'}before_date: DateTime, ${'$'}bitcoin_network: BitcoinNetwork, ${'$'}lightning_node_id: ID, ${'$'}statuses: [TransactionStatus!], ${'$'}exclude_failures: TransactionFailures) { +query FetchAccountToTransactionsConnection(${'$'}first: Int, ${'$'}after: String, ${'$'}types: [TransactionType!], ${'$'}after_date: DateTime, ${'$'}before_date: DateTime, ${'$'}bitcoin_network: BitcoinNetwork, ${'$'}lightning_node_id: ID, ${'$'}statuses: [TransactionStatus!], ${'$'}exclude_failures: TransactionFailures, ${'$'}max_amount: CurrencyAmountInput, ${'$'}min_amount: CurrencyAmountInput) { current_account { ... on Account { - transactions(, first: ${'$'}first, after: ${'$'}after, types: ${'$'}types, after_date: ${'$'}after_date, before_date: ${'$'}before_date, bitcoin_network: ${'$'}bitcoin_network, lightning_node_id: ${'$'}lightning_node_id, statuses: ${'$'}statuses, exclude_failures: ${'$'}exclude_failures) { + transactions(, first: ${'$'}first, after: ${'$'}after, types: ${'$'}types, after_date: ${'$'}after_date, before_date: ${'$'}before_date, bitcoin_network: ${'$'}bitcoin_network, lightning_node_id: ${'$'}lightning_node_id, statuses: ${'$'}statuses, exclude_failures: ${'$'}exclude_failures, max_amount: ${'$'}max_amount, min_amount: ${'$'}min_amount) { type: __typename account_to_transactions_connection_count: count account_to_transactions_connection_page_info: page_info { @@ -1326,6 +1328,8 @@ query FetchAccountToTransactionsConnection(${'$'}first: Int, ${'$'}after: String add("lightning_node_id", lightningNodeId) add("statuses", statuses) add("exclude_failures", excludeFailures) + add("max_amount", maxAmount) + add("min_amount", minAmount) } ) { val connection = @@ -1342,13 +1346,15 @@ query FetchAccountToTransactionsConnection(${'$'}first: Int, ${'$'}after: String beforeDate: Instant? = null, bitcoinNetwork: BitcoinNetwork? = null, lightningNodeId: String? = null, + maxAmount: CurrencyAmountInput? = null, + minAmount: CurrencyAmountInput? = null, ): Query { return Query( queryPayload = """ -query FetchAccountToPaymentRequestsConnection(${'$'}first: Int, ${'$'}after: String, ${'$'}after_date: DateTime, ${'$'}before_date: DateTime, ${'$'}bitcoin_network: BitcoinNetwork, ${'$'}lightning_node_id: ID) { +query FetchAccountToPaymentRequestsConnection(${'$'}first: Int, ${'$'}after: String, ${'$'}after_date: DateTime, ${'$'}before_date: DateTime, ${'$'}bitcoin_network: BitcoinNetwork, ${'$'}lightning_node_id: ID, ${'$'}max_amount: CurrencyAmountInput, ${'$'}min_amount: CurrencyAmountInput) { current_account { ... on Account { - payment_requests(, first: ${'$'}first, after: ${'$'}after, after_date: ${'$'}after_date, before_date: ${'$'}before_date, bitcoin_network: ${'$'}bitcoin_network, lightning_node_id: ${'$'}lightning_node_id) { + payment_requests(, first: ${'$'}first, after: ${'$'}after, after_date: ${'$'}after_date, before_date: ${'$'}before_date, bitcoin_network: ${'$'}bitcoin_network, lightning_node_id: ${'$'}lightning_node_id, max_amount: ${'$'}max_amount, min_amount: ${'$'}min_amount) { type: __typename account_to_payment_requests_connection_count: count account_to_payment_requests_connection_page_info: page_info { @@ -1681,6 +1687,8 @@ query FetchAccountToPaymentRequestsConnection(${'$'}first: Int, ${'$'}after: Str add("before_date", beforeDate) add("bitcoin_network", bitcoinNetwork) add("lightning_node_id", lightningNodeId) + add("max_amount", maxAmount) + add("min_amount", minAmount) } ) { val connection = @@ -1701,13 +1709,15 @@ query FetchAccountToPaymentRequestsConnection(${'$'}first: Int, ${'$'}after: Str idempotencyKeys: List? = null, afterDate: Instant? = null, beforeDate: Instant? = null, + maxAmount: CurrencyAmountInput? = null, + minAmount: CurrencyAmountInput? = null, ): Query { return Query( queryPayload = """ -query FetchAccountToWithdrawalRequestsConnection(${'$'}first: Int, ${'$'}after: String, ${'$'}bitcoin_networks: [BitcoinNetwork!], ${'$'}statuses: [WithdrawalRequestStatus!], ${'$'}node_ids: [ID!], ${'$'}idempotency_keys: [String!], ${'$'}after_date: DateTime, ${'$'}before_date: DateTime) { +query FetchAccountToWithdrawalRequestsConnection(${'$'}first: Int, ${'$'}after: String, ${'$'}bitcoin_networks: [BitcoinNetwork!], ${'$'}statuses: [WithdrawalRequestStatus!], ${'$'}node_ids: [ID!], ${'$'}idempotency_keys: [String!], ${'$'}after_date: DateTime, ${'$'}before_date: DateTime, ${'$'}max_amount: CurrencyAmountInput, ${'$'}min_amount: CurrencyAmountInput) { current_account { ... on Account { - withdrawal_requests(, first: ${'$'}first, after: ${'$'}after, bitcoin_networks: ${'$'}bitcoin_networks, statuses: ${'$'}statuses, node_ids: ${'$'}node_ids, idempotency_keys: ${'$'}idempotency_keys, after_date: ${'$'}after_date, before_date: ${'$'}before_date) { + withdrawal_requests(, first: ${'$'}first, after: ${'$'}after, bitcoin_networks: ${'$'}bitcoin_networks, statuses: ${'$'}statuses, node_ids: ${'$'}node_ids, idempotency_keys: ${'$'}idempotency_keys, after_date: ${'$'}after_date, before_date: ${'$'}before_date, max_amount: ${'$'}max_amount, min_amount: ${'$'}min_amount) { type: __typename account_to_withdrawal_requests_connection_count: count account_to_withdrawal_requests_connection_page_info: page_info { @@ -1786,6 +1796,8 @@ query FetchAccountToWithdrawalRequestsConnection(${'$'}first: Int, ${'$'}after: add("idempotency_keys", idempotencyKeys) add("after_date", afterDate) add("before_date", beforeDate) + add("max_amount", maxAmount) + add("min_amount", minAmount) } ) { val connection = diff --git a/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/CreateTestModeInvoiceInput.kt b/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/CreateTestModeInvoiceInput.kt index e2937994..dea46a1d 100644 --- a/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/CreateTestModeInvoiceInput.kt +++ b/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/CreateTestModeInvoiceInput.kt @@ -8,6 +8,10 @@ import kotlinx.serialization.Serializable /** * + * @param localNodeId The local node from which to create the invoice. + * @param amountMsats The amount for which the invoice should be created, in millisatoshis. Setting the amount to 0 will allow the payer to specify an amount. + * @param memo An optional memo to include in the invoice. + * @param invoiceType The type of invoice to create. */ @Serializable @SerialName("CreateTestModeInvoiceInput") diff --git a/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/CurrencyAmountInput.kt b/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/CurrencyAmountInput.kt new file mode 100644 index 00000000..6c4f836c --- /dev/null +++ b/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/CurrencyAmountInput.kt @@ -0,0 +1,20 @@ +// 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("CurrencyAmountInput") +data class CurrencyAmountInput( + val value: Long, + val unit: CurrencyUnit, +) { + companion object { + } +} diff --git a/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/PayTestModeInvoiceInput.kt b/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/PayTestModeInvoiceInput.kt new file mode 100644 index 00000000..185a2f76 --- /dev/null +++ b/lightspark-sdk/src/commonMain/kotlin/com/lightspark/sdk/model/PayTestModeInvoiceInput.kt @@ -0,0 +1,32 @@ +// 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 nodeId The node from where you want to send the payment. + * @param encodedInvoice The invoice you want to pay (as defined by the BOLT11 standard). + * @param timeoutSecs The timeout in seconds that we will try to make the payment. + * @param maximumFeesMsats The maximum amount of fees that you want to pay for this payment to be sent, expressed in msats. + * @param failureReason The failure reason to trigger for the payment. If not set, pay_invoice will be called. + * @param amountMsats The amount you will pay for this invoice, expressed in msats. It should ONLY be set when the invoice amount is zero. + * @param idempotencyKey The idempotency key of the request. The same result will be returned for the same idempotency key. + */ +@Serializable +@SerialName("PayTestModeInvoiceInput") +data class PayTestModeInvoiceInput( + val nodeId: String, + val encodedInvoice: String, + val timeoutSecs: Int, + val maximumFeesMsats: Long, + val failureReason: PaymentFailureReason? = null, + val amountMsats: Long? = null, + val idempotencyKey: String? = null, +) { + companion object { + } +}