From 57f661cb428006d7e0cef14cfe61f056ee37c8ea Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Tue, 14 Jan 2025 14:10:15 -0800 Subject: [PATCH] Updating graphql objects in go-sdk --- objects/account.go | 31 +++++---- objects/account_to_nodes_connection.go | 2 - .../account_to_payment_requests_connection.go | 2 - objects/account_to_transactions_connection.go | 2 - objects/all_entities.go | 4 ++ objects/audit_log_actor.go | 5 -- objects/bitcoin_network.go | 1 + objects/cancel_invoice_output.go | 2 - objects/channel.go | 8 +-- objects/channel_closing_transaction.go | 6 +- objects/channel_opening_transaction.go | 6 +- objects/channel_snapshot.go | 6 +- objects/channel_status.go | 1 + objects/claim_uma_invitation_output.go | 2 - ...m_uma_invitation_with_incentives_output.go | 2 - objects/compliance_provider.go | 1 + objects/connection.go | 5 -- ...reate_invitation_with_incentives_output.go | 2 - objects/create_invoice_output.go | 2 - objects/create_node_wallet_address_output.go | 2 - objects/create_offer_input.go | 14 ++++ objects/create_offer_output.go | 17 +++++ objects/create_test_mode_invoice_input.go | 5 ++ objects/create_test_mode_paymentoutput.go | 2 - objects/create_uma_invitation_output.go | 2 - objects/currency_amount_input.go | 8 +++ objects/currency_unit.go | 1 + objects/daily_liquidity_forecast.go | 2 - objects/delete_api_token_output.go | 2 - objects/deposit.go | 6 +- objects/entity.go | 12 ++-- objects/fail_htlcs_output.go | 2 - objects/graph_node.go | 7 +- objects/hop.go | 6 +- objects/htlc_attempt_failure_code.go | 1 + objects/incentives_ineligibility_reason.go | 1 + objects/incentives_status.go | 1 + objects/incoming_payment.go | 8 +-- objects/incoming_payment_attempt.go | 6 +- objects/incoming_payment_attempt_status.go | 1 + objects/invoice_data.go | 5 +- objects/invoice_for_payment_hash_output.go | 2 - objects/invoice_type.go | 1 + objects/lightning_payment_direction.go | 1 + objects/lightning_transaction.go | 5 -- objects/lightspark_node.go | 7 -- objects/lightspark_node_owner.go | 5 -- objects/lightspark_node_status.go | 1 + ...to_daily_liquidity_forecasts_connection.go | 2 - objects/lightspark_node_with_o_s_k.go | 8 +-- .../lightspark_node_with_remote_signing.go | 8 +-- objects/node.go | 5 -- objects/node_address_type.go | 1 + objects/offer.go | 69 +++++++++++++++++++ objects/on_chain_fee_target.go | 1 + objects/on_chain_transaction.go | 5 -- objects/outgoing_payment.go | 8 +-- objects/outgoing_payment_attempt.go | 8 +-- objects/outgoing_payment_attempt_status.go | 1 + ...oing_payment_for_idempotency_key_output.go | 2 - objects/pay_invoice_output.go | 2 - objects/pay_test_mode_invoice_input.go | 26 +++++++ objects/payment_direction.go | 1 + objects/payment_failure_reason.go | 1 + objects/payment_request.go | 5 -- objects/payment_request_data.go | 5 -- objects/payment_request_status.go | 1 + objects/permission.go | 1 + objects/region_code.go | 1 + objects/register_payment_output.go | 2 - ...se_channel_per_commitment_secret_output.go | 2 - objects/release_payment_preimage_output.go | 2 - objects/remote_signing_sub_event_type.go | 1 + objects/request_initiator.go | 1 + objects/request_withdrawal_output.go | 2 - objects/risk_rating.go | 1 + objects/routing_transaction.go | 6 +- objects/routing_transaction_failure_reason.go | 1 + objects/send_payment_output.go | 2 - objects/set_invoice_payment_hash_output.go | 2 - objects/sign_invoice_output.go | 2 - objects/signable_payload.go | 6 +- objects/signable_payload_status.go | 1 + objects/transaction.go | 6 +- objects/transaction_status.go | 1 + objects/transaction_type.go | 1 + ...ate_channel_per_commitment_point_output.go | 2 - objects/update_node_shared_secret_output.go | 2 - objects/wallet.go | 8 +-- objects/wallet_status.go | 1 + .../wallet_to_payment_requests_connection.go | 2 - objects/wallet_to_transactions_connection.go | 2 - objects/webhook_event_type.go | 1 + objects/withdrawal.go | 6 +- objects/withdrawal_mode.go | 1 + objects/withdrawal_request.go | 8 +-- objects/withdrawal_request_status.go | 1 + 97 files changed, 216 insertions(+), 241 deletions(-) create mode 100644 objects/create_offer_input.go create mode 100644 objects/create_offer_output.go create mode 100644 objects/currency_amount_input.go create mode 100644 objects/offer.go create mode 100644 objects/pay_test_mode_invoice_input.go diff --git a/objects/account.go b/objects/account.go index 85ca4a1..2d90f0d 100644 --- a/objects/account.go +++ b/objects/account.go @@ -1,12 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "time" - - "github.com/lightsparkdev/go-sdk/requester" -) +import "time" // Account This is an object representing the connected Lightspark account. You can retrieve this object to see your account information and objects tied to your account. type Account struct { @@ -734,11 +729,11 @@ func (obj Account) GetChannels(requester *requester.Requester, bitcoinNetwork Bi return result, nil } -func (obj Account) GetTransactions(requester *requester.Requester, first *int64, after *string, types *[]TransactionType, afterDate *time.Time, beforeDate *time.Time, bitcoinNetwork *BitcoinNetwork, lightningNodeId *string, statuses *[]TransactionStatus, excludeFailures *TransactionFailures) (*AccountToTransactionsConnection, error) { - query := `query FetchAccountToTransactionsConnection($entity_id: ID!, $first: Int, $after: String, $types: [TransactionType!], $after_date: DateTime, $before_date: DateTime, $bitcoin_network: BitcoinNetwork, $lightning_node_id: ID, $statuses: [TransactionStatus!], $exclude_failures: TransactionFailures) { +func (obj Account) GetTransactions(requester *requester.Requester, first *int64, after *string, types *[]TransactionType, afterDate *time.Time, beforeDate *time.Time, bitcoinNetwork *BitcoinNetwork, lightningNodeId *string, statuses *[]TransactionStatus, excludeFailures *TransactionFailures, maxAmount *CurrencyAmountInput, minAmount *CurrencyAmountInput) (*AccountToTransactionsConnection, error) { + query := `query FetchAccountToTransactionsConnection($entity_id: ID!, $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) { entity(id: $entity_id) { ... 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) { __typename account_to_transactions_connection_count: count account_to_transactions_connection_page_info: page_info { @@ -1337,6 +1332,8 @@ func (obj Account) GetTransactions(requester *requester.Requester, first *int64, "lightning_node_id": lightningNodeId, "statuses": statuses, "exclude_failures": excludeFailures, + "max_amount": maxAmount, + "min_amount": minAmount, } response, err := requester.ExecuteGraphql(query, variables, nil) @@ -1351,11 +1348,11 @@ func (obj Account) GetTransactions(requester *requester.Requester, first *int64, return result, nil } -func (obj Account) GetPaymentRequests(requester *requester.Requester, first *int64, after *string, afterDate *time.Time, beforeDate *time.Time, bitcoinNetwork *BitcoinNetwork, lightningNodeId *string) (*AccountToPaymentRequestsConnection, error) { - query := `query FetchAccountToPaymentRequestsConnection($entity_id: ID!, $first: Int, $after: String, $after_date: DateTime, $before_date: DateTime, $bitcoin_network: BitcoinNetwork, $lightning_node_id: ID) { +func (obj Account) GetPaymentRequests(requester *requester.Requester, first *int64, after *string, afterDate *time.Time, beforeDate *time.Time, bitcoinNetwork *BitcoinNetwork, lightningNodeId *string, maxAmount *CurrencyAmountInput, minAmount *CurrencyAmountInput) (*AccountToPaymentRequestsConnection, error) { + query := `query FetchAccountToPaymentRequestsConnection($entity_id: ID!, $first: Int, $after: String, $after_date: DateTime, $before_date: DateTime, $bitcoin_network: BitcoinNetwork, $lightning_node_id: ID, $max_amount: CurrencyAmountInput, $min_amount: CurrencyAmountInput) { entity(id: $entity_id) { ... 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) { __typename account_to_payment_requests_connection_count: count account_to_payment_requests_connection_page_info: page_info { @@ -1688,6 +1685,8 @@ func (obj Account) GetPaymentRequests(requester *requester.Requester, first *int "before_date": beforeDate, "bitcoin_network": bitcoinNetwork, "lightning_node_id": lightningNodeId, + "max_amount": maxAmount, + "min_amount": minAmount, } response, err := requester.ExecuteGraphql(query, variables, nil) @@ -1702,11 +1701,11 @@ func (obj Account) GetPaymentRequests(requester *requester.Requester, first *int return result, nil } -func (obj Account) GetWithdrawalRequests(requester *requester.Requester, first *int64, after *string, bitcoinNetworks *[]BitcoinNetwork, statuses *[]WithdrawalRequestStatus, nodeIds *[]string, idempotencyKeys *[]string, afterDate *time.Time, beforeDate *time.Time) (*AccountToWithdrawalRequestsConnection, error) { - query := `query FetchAccountToWithdrawalRequestsConnection($entity_id: ID!, $first: Int, $after: String, $bitcoin_networks: [BitcoinNetwork!], $statuses: [WithdrawalRequestStatus!], $node_ids: [ID!], $idempotency_keys: [String!], $after_date: DateTime, $before_date: DateTime) { +func (obj Account) GetWithdrawalRequests(requester *requester.Requester, first *int64, after *string, bitcoinNetworks *[]BitcoinNetwork, statuses *[]WithdrawalRequestStatus, nodeIds *[]string, idempotencyKeys *[]string, afterDate *time.Time, beforeDate *time.Time, maxAmount *CurrencyAmountInput, minAmount *CurrencyAmountInput) (*AccountToWithdrawalRequestsConnection, error) { + query := `query FetchAccountToWithdrawalRequestsConnection($entity_id: ID!, $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) { entity(id: $entity_id) { ... 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) { __typename account_to_withdrawal_requests_connection_count: count account_to_withdrawal_requests_connection_page_info: page_info { @@ -1785,6 +1784,8 @@ func (obj Account) GetWithdrawalRequests(requester *requester.Requester, first * "idempotency_keys": idempotencyKeys, "after_date": afterDate, "before_date": beforeDate, + "max_amount": maxAmount, + "min_amount": minAmount, } response, err := requester.ExecuteGraphql(query, variables, nil) diff --git a/objects/account_to_nodes_connection.go b/objects/account_to_nodes_connection.go index 167fe55..805d706 100644 --- a/objects/account_to_nodes_connection.go +++ b/objects/account_to_nodes_connection.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "encoding/json" - // AccountToNodesConnection A connection between an account and the nodes it manages. type AccountToNodesConnection struct { diff --git a/objects/account_to_payment_requests_connection.go b/objects/account_to_payment_requests_connection.go index 7636a3e..c404c1b 100644 --- a/objects/account_to_payment_requests_connection.go +++ b/objects/account_to_payment_requests_connection.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "encoding/json" - type AccountToPaymentRequestsConnection struct { // Count The total count of objects in this connection, using the current filters. It is different from the number of objects returned in the current page (in the `entities` field). diff --git a/objects/account_to_transactions_connection.go b/objects/account_to_transactions_connection.go index a60d3d2..b53966f 100644 --- a/objects/account_to_transactions_connection.go +++ b/objects/account_to_transactions_connection.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "encoding/json" - type AccountToTransactionsConnection struct { // Count The total count of objects in this connection, using the current filters. It is different from the number of objects returned in the current page (in the `entities` field). diff --git a/objects/all_entities.go b/objects/all_entities.go index 6c41829..c3ceba0 100644 --- a/objects/all_entities.go +++ b/objects/all_entities.go @@ -47,6 +47,9 @@ const ( ... on LightsparkNodeWithRemoteSigning { ...LightsparkNodeWithRemoteSigningFragment } + ... on Offer { + ...OfferFragment + } ... on OutgoingPayment { ...OutgoingPaymentFragment } @@ -90,6 +93,7 @@ const ( InvoiceFragment + LightsparkNodeWithOSKFragment + LightsparkNodeWithRemoteSigningFragment + + OfferFragment + OutgoingPaymentFragment + OutgoingPaymentAttemptFragment + RoutingTransactionFragment + diff --git a/objects/audit_log_actor.go b/objects/audit_log_actor.go index 4737d44..f80c461 100644 --- a/objects/audit_log_actor.go +++ b/objects/audit_log_actor.go @@ -1,11 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "fmt" -) - // AuditLogActor Audit log actor who called the GraphQL mutation type AuditLogActor interface { Entity diff --git a/objects/bitcoin_network.go b/objects/bitcoin_network.go index ba13e68..ec0eb0b 100644 --- a/objects/bitcoin_network.go +++ b/objects/bitcoin_network.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // BitcoinNetwork This is an enum identifying a particular Bitcoin Network. diff --git a/objects/cancel_invoice_output.go b/objects/cancel_invoice_output.go index ec7d798..d95aee2 100644 --- a/objects/cancel_invoice_output.go +++ b/objects/cancel_invoice_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - // CancelInvoiceOutput The Invoice that was cancelled. If the invoice was already cancelled, the same invoice is returned. type CancelInvoiceOutput struct { Invoice types.EntityWrapper `json:"cancel_invoice_output_invoice"` diff --git a/objects/channel.go b/objects/channel.go index 03f666f..50d2c63 100644 --- a/objects/channel.go +++ b/objects/channel.go @@ -1,13 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "time" - - "github.com/lightsparkdev/go-sdk/requester" - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // Channel This is an object representing a channel on the Lightning Network. You can retrieve this object to get detailed information on a specific Lightning Network channel. type Channel struct { diff --git a/objects/channel_closing_transaction.go b/objects/channel_closing_transaction.go index ef333ff..721b1ef 100644 --- a/objects/channel_closing_transaction.go +++ b/objects/channel_closing_transaction.go @@ -1,11 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "time" - - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // ChannelClosingTransaction This is an object representing a transaction which closes a channel on the Lightning Network. This operation allocates balances back to the local and remote nodes. type ChannelClosingTransaction struct { diff --git a/objects/channel_opening_transaction.go b/objects/channel_opening_transaction.go index 45a9aaa..2ea2ef2 100644 --- a/objects/channel_opening_transaction.go +++ b/objects/channel_opening_transaction.go @@ -1,11 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "time" - - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // ChannelOpeningTransaction This is an object representing a transaction which opens a channel on the Lightning Network. This object occurs only for channels funded by the local Lightspark node. type ChannelOpeningTransaction struct { diff --git a/objects/channel_snapshot.go b/objects/channel_snapshot.go index b15b264..4a85717 100644 --- a/objects/channel_snapshot.go +++ b/objects/channel_snapshot.go @@ -1,11 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "time" - - "github.com/lightsparkdev/go-sdk/types" -) +import "time" type ChannelSnapshot struct { diff --git a/objects/channel_status.go b/objects/channel_status.go index 92c04be..841d3c9 100644 --- a/objects/channel_status.go +++ b/objects/channel_status.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // ChannelStatus This is an enum representing the status of a channel on the Lightning Network. diff --git a/objects/claim_uma_invitation_output.go b/objects/claim_uma_invitation_output.go index 1bc18ce..dbb0532 100644 --- a/objects/claim_uma_invitation_output.go +++ b/objects/claim_uma_invitation_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type ClaimUmaInvitationOutput struct { // Invitation An UMA.ME invitation object. diff --git a/objects/claim_uma_invitation_with_incentives_output.go b/objects/claim_uma_invitation_with_incentives_output.go index cb5f105..8b85852 100644 --- a/objects/claim_uma_invitation_with_incentives_output.go +++ b/objects/claim_uma_invitation_with_incentives_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type ClaimUmaInvitationWithIncentivesOutput struct { // Invitation An UMA.ME invitation object. diff --git a/objects/compliance_provider.go b/objects/compliance_provider.go index 5969128..0cf606c 100644 --- a/objects/compliance_provider.go +++ b/objects/compliance_provider.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // ComplianceProvider This is an enum identifying a type of compliance provider. diff --git a/objects/connection.go b/objects/connection.go index caa7291..195d928 100644 --- a/objects/connection.go +++ b/objects/connection.go @@ -1,11 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "fmt" -) - type Connection interface { // GetCount The total count of objects in this connection, using the current filters. It is different from the number of objects returned in the current page (in the `entities` field). diff --git a/objects/create_invitation_with_incentives_output.go b/objects/create_invitation_with_incentives_output.go index 3f41795..4cea852 100644 --- a/objects/create_invitation_with_incentives_output.go +++ b/objects/create_invitation_with_incentives_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type CreateInvitationWithIncentivesOutput struct { // Invitation The created invitation in the form of a string identifier. diff --git a/objects/create_invoice_output.go b/objects/create_invoice_output.go index 89d9eee..03bb252 100644 --- a/objects/create_invoice_output.go +++ b/objects/create_invoice_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type CreateInvoiceOutput struct { Invoice types.EntityWrapper `json:"create_invoice_output_invoice"` } diff --git a/objects/create_node_wallet_address_output.go b/objects/create_node_wallet_address_output.go index f6f686c..0cf1bc1 100644 --- a/objects/create_node_wallet_address_output.go +++ b/objects/create_node_wallet_address_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type CreateNodeWalletAddressOutput struct { Node types.EntityWrapper `json:"create_node_wallet_address_output_node"` diff --git a/objects/create_offer_input.go b/objects/create_offer_input.go new file mode 100644 index 0000000..6a90b25 --- /dev/null +++ b/objects/create_offer_input.go @@ -0,0 +1,14 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved +package objects + +type CreateOfferInput struct { + + // NodeId The node from which to create the offer. + NodeId string `json:"create_offer_input_node_id"` + + // AmountMsats The amount for which the offer should be created, in millisatoshis. Setting the amount to 0 will allow the payer to specify an amount. + AmountMsats *int64 `json:"create_offer_input_amount_msats"` + + // Description A short description of the offer. + Description *string `json:"create_offer_input_description"` +} diff --git a/objects/create_offer_output.go b/objects/create_offer_output.go new file mode 100644 index 0000000..03e0b7e --- /dev/null +++ b/objects/create_offer_output.go @@ -0,0 +1,17 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved +package objects + +type CreateOfferOutput struct { + Offer types.EntityWrapper `json:"create_offer_output_offer"` +} + +const ( + CreateOfferOutputFragment = ` +fragment CreateOfferOutputFragment on CreateOfferOutput { + __typename + create_offer_output_offer: offer { + id + } +} +` +) diff --git a/objects/create_test_mode_invoice_input.go b/objects/create_test_mode_invoice_input.go index 3b1e8a1..3400427 100644 --- a/objects/create_test_mode_invoice_input.go +++ b/objects/create_test_mode_invoice_input.go @@ -2,11 +2,16 @@ package objects type CreateTestModeInvoiceInput struct { + + // LocalNodeId The local node from which to create the invoice. LocalNodeId string `json:"create_test_mode_invoice_input_local_node_id"` + // 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. AmountMsats int64 `json:"create_test_mode_invoice_input_amount_msats"` + // Memo An optional memo to include in the invoice. Memo *string `json:"create_test_mode_invoice_input_memo"` + // InvoiceType The type of invoice to create. InvoiceType *InvoiceType `json:"create_test_mode_invoice_input_invoice_type"` } diff --git a/objects/create_test_mode_paymentoutput.go b/objects/create_test_mode_paymentoutput.go index 2ef4688..ae5d9ae 100644 --- a/objects/create_test_mode_paymentoutput.go +++ b/objects/create_test_mode_paymentoutput.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - // CreateTestModePaymentoutput This is an object identifying the output of a test mode payment. This object can be used to retrieve the associated payment made from a Test Mode Payment call. type CreateTestModePaymentoutput struct { diff --git a/objects/create_uma_invitation_output.go b/objects/create_uma_invitation_output.go index 0872546..a5cd421 100644 --- a/objects/create_uma_invitation_output.go +++ b/objects/create_uma_invitation_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type CreateUmaInvitationOutput struct { // Invitation The created invitation in the form of a string identifier. diff --git a/objects/currency_amount_input.go b/objects/currency_amount_input.go new file mode 100644 index 0000000..1a99f9c --- /dev/null +++ b/objects/currency_amount_input.go @@ -0,0 +1,8 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved +package objects + +type CurrencyAmountInput struct { + Value int64 `json:"currency_amount_input_value"` + + Unit CurrencyUnit `json:"currency_amount_input_unit"` +} diff --git a/objects/currency_unit.go b/objects/currency_unit.go index b4010d6..caf6967 100644 --- a/objects/currency_unit.go +++ b/objects/currency_unit.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // CurrencyUnit This enum identifies the unit of currency associated with a CurrencyAmount. diff --git a/objects/daily_liquidity_forecast.go b/objects/daily_liquidity_forecast.go index cc03611..9800171 100644 --- a/objects/daily_liquidity_forecast.go +++ b/objects/daily_liquidity_forecast.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type DailyLiquidityForecast struct { // Date The date for which this forecast was generated. diff --git a/objects/delete_api_token_output.go b/objects/delete_api_token_output.go index 58698b4..641f02b 100644 --- a/objects/delete_api_token_output.go +++ b/objects/delete_api_token_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type DeleteApiTokenOutput struct { Account types.EntityWrapper `json:"delete_api_token_output_account"` } diff --git a/objects/deposit.go b/objects/deposit.go index dc99d9c..6df86ae 100644 --- a/objects/deposit.go +++ b/objects/deposit.go @@ -1,11 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "time" - - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // Deposit This object represents a Deposit made to a Lightspark node wallet. This operation occurs for any L1 funding transaction to the wallet. You can retrieve this object to receive detailed information about the deposit. type Deposit struct { diff --git a/objects/entity.go b/objects/entity.go index d9ca8b1..449dbfd 100644 --- a/objects/entity.go +++ b/objects/entity.go @@ -1,11 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "fmt" - "time" -) +import "time" // Entity This interface is used by all the entities in the Lightspark system. It defines a few core fields that are available everywhere. Any object that implements this interface can be queried using the `entity` query and its ID. type Entity interface { @@ -118,6 +114,12 @@ func EntityUnmarshal(data map[string]interface{}) (Entity, error) { return nil, err } return lightsparkNodeWithRemoteSigning, nil + case "Offer": + var offer Offer + if err := json.Unmarshal(dataJSON, &offer); err != nil { + return nil, err + } + return offer, nil case "OutgoingPayment": var outgoingPayment OutgoingPayment if err := json.Unmarshal(dataJSON, &outgoingPayment); err != nil { diff --git a/objects/fail_htlcs_output.go b/objects/fail_htlcs_output.go index 93b6980..3b561d8 100644 --- a/objects/fail_htlcs_output.go +++ b/objects/fail_htlcs_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type FailHtlcsOutput struct { Invoice types.EntityWrapper `json:"fail_htlcs_output_invoice"` } diff --git a/objects/graph_node.go b/objects/graph_node.go index e4dfe6c..fdd6fc7 100644 --- a/objects/graph_node.go +++ b/objects/graph_node.go @@ -1,12 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "time" - - "github.com/lightsparkdev/go-sdk/requester" -) +import "time" // GraphNode This object represents a node that exists on the Lightning Network, including nodes not managed by Lightspark. You can retrieve this object to get publicly available information about any node on the Lightning Network. type GraphNode struct { diff --git a/objects/hop.go b/objects/hop.go index c88d7ce..c01ea9f 100644 --- a/objects/hop.go +++ b/objects/hop.go @@ -1,11 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "time" - - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // Hop This object represents a specific node that existed on a particular payment route. You can retrieve this object to get information about a node on a particular payment path and all payment-relevant information for that node. type Hop struct { diff --git a/objects/htlc_attempt_failure_code.go b/objects/htlc_attempt_failure_code.go index d714a4a..d41036c 100644 --- a/objects/htlc_attempt_failure_code.go +++ b/objects/htlc_attempt_failure_code.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // HtlcAttemptFailureCode This is an enum representing a particular reason why an htlc sent over the Lightning Network may have failed. diff --git a/objects/incentives_ineligibility_reason.go b/objects/incentives_ineligibility_reason.go index 90a1c7b..382f4db 100644 --- a/objects/incentives_ineligibility_reason.go +++ b/objects/incentives_ineligibility_reason.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // IncentivesIneligibilityReason Describes the reason for an invitation to not be eligible for incentives. diff --git a/objects/incentives_status.go b/objects/incentives_status.go index 2461d45..4100077 100644 --- a/objects/incentives_status.go +++ b/objects/incentives_status.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // IncentivesStatus Describes the status of the incentives for this invitation. diff --git a/objects/incoming_payment.go b/objects/incoming_payment.go index b816231..90b899c 100644 --- a/objects/incoming_payment.go +++ b/objects/incoming_payment.go @@ -1,13 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "time" - - "github.com/lightsparkdev/go-sdk/requester" - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // IncomingPayment This object represents any payment sent to a Lightspark node on the Lightning Network. You can retrieve this object to receive payment related information about a specific payment received by a Lightspark node. type IncomingPayment struct { diff --git a/objects/incoming_payment_attempt.go b/objects/incoming_payment_attempt.go index e5c8e31..0b864a1 100644 --- a/objects/incoming_payment_attempt.go +++ b/objects/incoming_payment_attempt.go @@ -1,11 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "time" - - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // IncomingPaymentAttempt This object represents any attempted payment sent to a Lightspark node on the Lightning Network. You can retrieve this object to receive payment related information about a specific incoming payment attempt. type IncomingPaymentAttempt struct { diff --git a/objects/incoming_payment_attempt_status.go b/objects/incoming_payment_attempt_status.go index 1820bd8..3ad1ed6 100644 --- a/objects/incoming_payment_attempt_status.go +++ b/objects/incoming_payment_attempt_status.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // IncomingPaymentAttemptStatus This is an enum that enumerates all potential statuses for an incoming payment attempt. diff --git a/objects/invoice_data.go b/objects/invoice_data.go index f3f78c1..259da44 100644 --- a/objects/invoice_data.go +++ b/objects/invoice_data.go @@ -1,10 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "time" -) +import "time" // InvoiceData This object represents the data associated with a BOLT #11 invoice. You can retrieve this object to receive the relevant data associated with a specific invoice. type InvoiceData struct { diff --git a/objects/invoice_for_payment_hash_output.go b/objects/invoice_for_payment_hash_output.go index 07ec4ae..a28cc99 100644 --- a/objects/invoice_for_payment_hash_output.go +++ b/objects/invoice_for_payment_hash_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type InvoiceForPaymentHashOutput struct { Invoice *types.EntityWrapper `json:"invoice_for_payment_hash_output_invoice"` } diff --git a/objects/invoice_type.go b/objects/invoice_type.go index c851380..22220bb 100644 --- a/objects/invoice_type.go +++ b/objects/invoice_type.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // InvoiceType This is an enum for potential invoice types. diff --git a/objects/lightning_payment_direction.go b/objects/lightning_payment_direction.go index e6bba5f..706efb5 100644 --- a/objects/lightning_payment_direction.go +++ b/objects/lightning_payment_direction.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // LightningPaymentDirection This is an enum identifying the payment direction. diff --git a/objects/lightning_transaction.go b/objects/lightning_transaction.go index 7598ec9..c7f3c2e 100644 --- a/objects/lightning_transaction.go +++ b/objects/lightning_transaction.go @@ -1,11 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "fmt" -) - // LightningTransaction This is an object representing a transaction made over the Lightning Network. You can retrieve this object to receive information about a specific transaction made over Lightning for a Lightspark node. type LightningTransaction interface { Transaction diff --git a/objects/lightspark_node.go b/objects/lightspark_node.go index 9ae9ff9..548da6e 100644 --- a/objects/lightspark_node.go +++ b/objects/lightspark_node.go @@ -1,13 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "fmt" - - "github.com/lightsparkdev/go-sdk/types" -) - // LightsparkNode This is an object representing a node managed by Lightspark and owned by the current connected account. This object contains information about the node’s configuration, state, and metadata. type LightsparkNode interface { Node diff --git a/objects/lightspark_node_owner.go b/objects/lightspark_node_owner.go index 6d66090..c0bdecf 100644 --- a/objects/lightspark_node_owner.go +++ b/objects/lightspark_node_owner.go @@ -1,11 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "fmt" -) - // LightsparkNodeOwner This is an object representing the owner of a LightsparkNode. type LightsparkNodeOwner interface { Entity diff --git a/objects/lightspark_node_status.go b/objects/lightspark_node_status.go index 012ef38..f37fbc1 100644 --- a/objects/lightspark_node_status.go +++ b/objects/lightspark_node_status.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) type LightsparkNodeStatus int diff --git a/objects/lightspark_node_to_daily_liquidity_forecasts_connection.go b/objects/lightspark_node_to_daily_liquidity_forecasts_connection.go index 4c85c52..b7cdf6f 100644 --- a/objects/lightspark_node_to_daily_liquidity_forecasts_connection.go +++ b/objects/lightspark_node_to_daily_liquidity_forecasts_connection.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type LightsparkNodeToDailyLiquidityForecastsConnection struct { FromDate types.Date `json:"lightspark_node_to_daily_liquidity_forecasts_connection_from_date"` diff --git a/objects/lightspark_node_with_o_s_k.go b/objects/lightspark_node_with_o_s_k.go index 15a66cb..425f0f9 100644 --- a/objects/lightspark_node_with_o_s_k.go +++ b/objects/lightspark_node_with_o_s_k.go @@ -1,13 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "time" - - "github.com/lightsparkdev/go-sdk/requester" - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // LightsparkNodeWithOSK This is a Lightspark node with OSK. type LightsparkNodeWithOSK struct { diff --git a/objects/lightspark_node_with_remote_signing.go b/objects/lightspark_node_with_remote_signing.go index 1774431..73fa657 100644 --- a/objects/lightspark_node_with_remote_signing.go +++ b/objects/lightspark_node_with_remote_signing.go @@ -1,13 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "time" - - "github.com/lightsparkdev/go-sdk/requester" - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // LightsparkNodeWithRemoteSigning This is a Lightspark node with remote signing. type LightsparkNodeWithRemoteSigning struct { diff --git a/objects/node.go b/objects/node.go index b2680d4..145ca92 100644 --- a/objects/node.go +++ b/objects/node.go @@ -1,11 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "fmt" -) - // Node This object is an interface representing a Lightning Node on the Lightning Network, and could either be a Lightspark node or a node managed by a third party. type Node interface { Entity diff --git a/objects/node_address_type.go b/objects/node_address_type.go index 4bae658..0e1a0a0 100644 --- a/objects/node_address_type.go +++ b/objects/node_address_type.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // NodeAddressType This is an enum of the potential types of addresses that a node on the Lightning Network can have. diff --git a/objects/offer.go b/objects/offer.go new file mode 100644 index 0000000..8e0665a --- /dev/null +++ b/objects/offer.go @@ -0,0 +1,69 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved +package objects + +import "time" + +// Offer This object represents a BOLT #12 offer (https://github.com/lightning/bolts/blob/master/12-offer-encoding.md) created by a Lightspark Node. You can retrieve this object to receive relevant payment information for a specific offer generated by a Lightspark node. +type Offer struct { + + // Id The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque string. + Id string `json:"offer_id"` + + // CreatedAt The date and time when the entity was first created. + CreatedAt time.Time `json:"offer_created_at"` + + // UpdatedAt The date and time when the entity was last updated. + UpdatedAt time.Time `json:"offer_updated_at"` + + // EncodedOffer The BOLT12 encoded offer. Starts with 'lno'. + EncodedOffer string `json:"offer_encoded_offer"` + + // Amount The amount of the offer. If null, the payer chooses the amount. + Amount *CurrencyAmount `json:"offer_amount"` + + // Description The description of the offer. + Description *string `json:"offer_description"` + + // Typename The typename of the object + Typename string `json:"__typename"` +} + +const ( + OfferFragment = ` +fragment OfferFragment on Offer { + __typename + offer_id: id + offer_created_at: created_at + offer_updated_at: updated_at + offer_encoded_offer: encoded_offer + offer_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + offer_description: description +} +` +) + +// GetId The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque string. +func (obj Offer) GetId() string { + return obj.Id +} + +// GetCreatedAt The date and time when the entity was first created. +func (obj Offer) GetCreatedAt() time.Time { + return obj.CreatedAt +} + +// GetUpdatedAt The date and time when the entity was last updated. +func (obj Offer) GetUpdatedAt() time.Time { + return obj.UpdatedAt +} + +func (obj Offer) GetTypename() string { + return obj.Typename +} diff --git a/objects/on_chain_fee_target.go b/objects/on_chain_fee_target.go index 2db01b0..a00c424 100644 --- a/objects/on_chain_fee_target.go +++ b/objects/on_chain_fee_target.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) type OnChainFeeTarget int diff --git a/objects/on_chain_transaction.go b/objects/on_chain_transaction.go index ec53a5b..3e2010b 100644 --- a/objects/on_chain_transaction.go +++ b/objects/on_chain_transaction.go @@ -1,11 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "fmt" -) - // OnChainTransaction This object represents an L1 transaction that occurred on the Bitcoin Network. You can retrieve this object to receive information about a specific on-chain transaction made on the Lightning Network associated with your Lightspark Node. type OnChainTransaction interface { Transaction diff --git a/objects/outgoing_payment.go b/objects/outgoing_payment.go index 2818219..df13cbe 100644 --- a/objects/outgoing_payment.go +++ b/objects/outgoing_payment.go @@ -1,13 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "time" - - "github.com/lightsparkdev/go-sdk/requester" - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // OutgoingPayment This object represents a Lightning Network payment sent from a Lightspark Node. You can retrieve this object to receive payment related information about any payment sent from your Lightspark Node on the Lightning Network. type OutgoingPayment struct { diff --git a/objects/outgoing_payment_attempt.go b/objects/outgoing_payment_attempt.go index b1c8711..3b27ebb 100644 --- a/objects/outgoing_payment_attempt.go +++ b/objects/outgoing_payment_attempt.go @@ -1,13 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "time" - - "github.com/lightsparkdev/go-sdk/requester" - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // OutgoingPaymentAttempt This object represents an attempted Lightning Network payment sent from a Lightspark Node. You can retrieve this object to receive payment related information about any payment attempt sent from your Lightspark Node on the Lightning Network, including any potential reasons the payment may have failed. type OutgoingPaymentAttempt struct { diff --git a/objects/outgoing_payment_attempt_status.go b/objects/outgoing_payment_attempt_status.go index bea956b..b4fc699 100644 --- a/objects/outgoing_payment_attempt_status.go +++ b/objects/outgoing_payment_attempt_status.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // OutgoingPaymentAttemptStatus This is an enum of all potential statuses of a payment attempt made from a Lightspark Node. diff --git a/objects/outgoing_payment_for_idempotency_key_output.go b/objects/outgoing_payment_for_idempotency_key_output.go index 40c1e6c..4bbe267 100644 --- a/objects/outgoing_payment_for_idempotency_key_output.go +++ b/objects/outgoing_payment_for_idempotency_key_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type OutgoingPaymentForIdempotencyKeyOutput struct { Payment *types.EntityWrapper `json:"outgoing_payment_for_idempotency_key_output_payment"` } diff --git a/objects/pay_invoice_output.go b/objects/pay_invoice_output.go index 8edbd5d..04d78ee 100644 --- a/objects/pay_invoice_output.go +++ b/objects/pay_invoice_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type PayInvoiceOutput struct { // Payment The payment that has been sent. diff --git a/objects/pay_test_mode_invoice_input.go b/objects/pay_test_mode_invoice_input.go new file mode 100644 index 0000000..ff00632 --- /dev/null +++ b/objects/pay_test_mode_invoice_input.go @@ -0,0 +1,26 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved +package objects + +type PayTestModeInvoiceInput struct { + + // NodeId The node from where you want to send the payment. + NodeId string `json:"pay_test_mode_invoice_input_node_id"` + + // EncodedInvoice The invoice you want to pay (as defined by the BOLT11 standard). + EncodedInvoice string `json:"pay_test_mode_invoice_input_encoded_invoice"` + + // TimeoutSecs The timeout in seconds that we will try to make the payment. + TimeoutSecs int64 `json:"pay_test_mode_invoice_input_timeout_secs"` + + // MaximumFeesMsats The maximum amount of fees that you want to pay for this payment to be sent, expressed in msats. + MaximumFeesMsats int64 `json:"pay_test_mode_invoice_input_maximum_fees_msats"` + + // FailureReason The failure reason to trigger for the payment. If not set, pay_invoice will be called. + FailureReason *PaymentFailureReason `json:"pay_test_mode_invoice_input_failure_reason"` + + // AmountMsats The amount you will pay for this invoice, expressed in msats. It should ONLY be set when the invoice amount is zero. + AmountMsats *int64 `json:"pay_test_mode_invoice_input_amount_msats"` + + // IdempotencyKey The idempotency key of the request. The same result will be returned for the same idempotency key. + IdempotencyKey *string `json:"pay_test_mode_invoice_input_idempotency_key"` +} diff --git a/objects/payment_direction.go b/objects/payment_direction.go index 126df09..edad89a 100644 --- a/objects/payment_direction.go +++ b/objects/payment_direction.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // PaymentDirection This is an enum indicating the direction of the payment. diff --git a/objects/payment_failure_reason.go b/objects/payment_failure_reason.go index 5ad4850..61c5321 100644 --- a/objects/payment_failure_reason.go +++ b/objects/payment_failure_reason.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // PaymentFailureReason This is an enum of the potential reasons why an OutgoingPayment sent from a Lightspark Node may have failed. diff --git a/objects/payment_request.go b/objects/payment_request.go index 5dd294c..0e1f720 100644 --- a/objects/payment_request.go +++ b/objects/payment_request.go @@ -1,11 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "fmt" -) - // PaymentRequest This object contains information related to a payment request generated or received by a LightsparkNode. You can retrieve this object to receive payment information about a specific invoice. type PaymentRequest interface { Entity diff --git a/objects/payment_request_data.go b/objects/payment_request_data.go index 54ecfa8..049a8fe 100644 --- a/objects/payment_request_data.go +++ b/objects/payment_request_data.go @@ -1,11 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "fmt" -) - // PaymentRequestData This object is an interface of a payment request on the Lightning Network (i.e., a Lightning Invoice). It contains data related to parsing the payment details of a Lightning Invoice. type PaymentRequestData interface { GetEncodedPaymentRequest() string diff --git a/objects/payment_request_status.go b/objects/payment_request_status.go index 4c82933..3db2cf1 100644 --- a/objects/payment_request_status.go +++ b/objects/payment_request_status.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // PaymentRequestStatus This is an enum of the potential states that a payment request on the Lightning Network can take. diff --git a/objects/permission.go b/objects/permission.go index 90a3315..3221e6e 100644 --- a/objects/permission.go +++ b/objects/permission.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // Permission This is an enum of the potential permissions that a Lightspark user can have in regards to account management. diff --git a/objects/region_code.go b/objects/region_code.go index 040bf46..09c473c 100644 --- a/objects/region_code.go +++ b/objects/region_code.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // RegionCode The alpha-2 representation of a country, as defined by the ISO 3166-1 standard. diff --git a/objects/register_payment_output.go b/objects/register_payment_output.go index 74dc0ed..35f5204 100644 --- a/objects/register_payment_output.go +++ b/objects/register_payment_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type RegisterPaymentOutput struct { Payment types.EntityWrapper `json:"register_payment_output_payment"` } diff --git a/objects/release_channel_per_commitment_secret_output.go b/objects/release_channel_per_commitment_secret_output.go index 797d1bc..b3302dd 100644 --- a/objects/release_channel_per_commitment_secret_output.go +++ b/objects/release_channel_per_commitment_secret_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type ReleaseChannelPerCommitmentSecretOutput struct { // Channel The channel object after the per-commitment secret release operation. diff --git a/objects/release_payment_preimage_output.go b/objects/release_payment_preimage_output.go index ff3b4f0..cfebe85 100644 --- a/objects/release_payment_preimage_output.go +++ b/objects/release_payment_preimage_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type ReleasePaymentPreimageOutput struct { // Invoice The invoice of the transaction. diff --git a/objects/remote_signing_sub_event_type.go b/objects/remote_signing_sub_event_type.go index fe1af1c..fab5a87 100644 --- a/objects/remote_signing_sub_event_type.go +++ b/objects/remote_signing_sub_event_type.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // RemoteSigningSubEventType This is an enum of the potential sub-event types for Remote Signing webook events. diff --git a/objects/request_initiator.go b/objects/request_initiator.go index 5aa66f7..e52bc98 100644 --- a/objects/request_initiator.go +++ b/objects/request_initiator.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) type RequestInitiator int diff --git a/objects/request_withdrawal_output.go b/objects/request_withdrawal_output.go index 700fd43..4aaafc0 100644 --- a/objects/request_withdrawal_output.go +++ b/objects/request_withdrawal_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type RequestWithdrawalOutput struct { // Request The request that is created for this withdrawal. diff --git a/objects/risk_rating.go b/objects/risk_rating.go index 79a785b..59aa4d5 100644 --- a/objects/risk_rating.go +++ b/objects/risk_rating.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // RiskRating This is an enum of the potential risk ratings related to a transaction made over the Lightning Network. These risk ratings are returned from the CryptoSanctionScreeningProvider. diff --git a/objects/routing_transaction.go b/objects/routing_transaction.go index 3348bdc..7655fa3 100644 --- a/objects/routing_transaction.go +++ b/objects/routing_transaction.go @@ -1,11 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "time" - - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // RoutingTransaction This object represents a transaction that was forwarded through a Lightspark node on the Lightning Network, i.e., a routed transaction. You can retrieve this object to receive information about any transaction routed through your Lightspark Node. type RoutingTransaction struct { diff --git a/objects/routing_transaction_failure_reason.go b/objects/routing_transaction_failure_reason.go index 64337f1..7c751c1 100644 --- a/objects/routing_transaction_failure_reason.go +++ b/objects/routing_transaction_failure_reason.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // RoutingTransactionFailureReason This is an enum of the potential reasons that an attempted routed transaction through a Lightspark node may have failed. diff --git a/objects/send_payment_output.go b/objects/send_payment_output.go index 259945b..777bbd1 100644 --- a/objects/send_payment_output.go +++ b/objects/send_payment_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type SendPaymentOutput struct { // Payment The payment that has been sent. diff --git a/objects/set_invoice_payment_hash_output.go b/objects/set_invoice_payment_hash_output.go index 11bf053..a3cc138 100644 --- a/objects/set_invoice_payment_hash_output.go +++ b/objects/set_invoice_payment_hash_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type SetInvoicePaymentHashOutput struct { Invoice types.EntityWrapper `json:"set_invoice_payment_hash_output_invoice"` } diff --git a/objects/sign_invoice_output.go b/objects/sign_invoice_output.go index 19cbce1..40dfaf4 100644 --- a/objects/sign_invoice_output.go +++ b/objects/sign_invoice_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type SignInvoiceOutput struct { // Invoice The signed invoice object. diff --git a/objects/signable_payload.go b/objects/signable_payload.go index e399fae..380c88c 100644 --- a/objects/signable_payload.go +++ b/objects/signable_payload.go @@ -1,11 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "time" - - "github.com/lightsparkdev/go-sdk/types" -) +import "time" type SignablePayload struct { diff --git a/objects/signable_payload_status.go b/objects/signable_payload_status.go index 47fe5e7..2f262c1 100644 --- a/objects/signable_payload_status.go +++ b/objects/signable_payload_status.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) type SignablePayloadStatus int diff --git a/objects/transaction.go b/objects/transaction.go index ca14724..586a65d 100644 --- a/objects/transaction.go +++ b/objects/transaction.go @@ -1,11 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "fmt" - "time" -) +import "time" // Transaction This object represents a payment transaction. The transaction can occur either on a Bitcoin Network, or over the Lightning Network. You can retrieve this object to receive specific information about a particular transaction tied to your Lightspark Node. type Transaction interface { diff --git a/objects/transaction_status.go b/objects/transaction_status.go index f7f29d0..3808d50 100644 --- a/objects/transaction_status.go +++ b/objects/transaction_status.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // TransactionStatus This is an enum of the potential statuses a transaction associated with your Lightspark Node can take. diff --git a/objects/transaction_type.go b/objects/transaction_type.go index ba56363..67bfec9 100644 --- a/objects/transaction_type.go +++ b/objects/transaction_type.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // TransactionType This is an enum of the potential types of transactions that can be associated with your Lightspark Node. diff --git a/objects/update_channel_per_commitment_point_output.go b/objects/update_channel_per_commitment_point_output.go index 8a8fcab..27c9e14 100644 --- a/objects/update_channel_per_commitment_point_output.go +++ b/objects/update_channel_per_commitment_point_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type UpdateChannelPerCommitmentPointOutput struct { Channel types.EntityWrapper `json:"update_channel_per_commitment_point_output_channel"` } diff --git a/objects/update_node_shared_secret_output.go b/objects/update_node_shared_secret_output.go index d6e0edc..6bcf28b 100644 --- a/objects/update_node_shared_secret_output.go +++ b/objects/update_node_shared_secret_output.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "github.com/lightsparkdev/go-sdk/types" - type UpdateNodeSharedSecretOutput struct { Node types.EntityWrapper `json:"update_node_shared_secret_output_node"` } diff --git a/objects/wallet.go b/objects/wallet.go index 67e478a..3d77723 100644 --- a/objects/wallet.go +++ b/objects/wallet.go @@ -1,13 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "time" - - "github.com/lightsparkdev/go-sdk/requester" - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // Wallet This object represents a Lightspark Wallet, tied to your Lightspark account. Wallets can be used to send or receive funds over the Lightning Network. You can retrieve this object to receive information about a specific wallet tied to your Lightspark account. type Wallet struct { diff --git a/objects/wallet_status.go b/objects/wallet_status.go index 49cab22..9eadbed 100644 --- a/objects/wallet_status.go +++ b/objects/wallet_status.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // WalletStatus This is an enum of the potential statuses that your Lightspark wallet can take. diff --git a/objects/wallet_to_payment_requests_connection.go b/objects/wallet_to_payment_requests_connection.go index 4400dbd..0031bfa 100644 --- a/objects/wallet_to_payment_requests_connection.go +++ b/objects/wallet_to_payment_requests_connection.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "encoding/json" - type WalletToPaymentRequestsConnection struct { // Count The total count of objects in this connection, using the current filters. It is different from the number of objects returned in the current page (in the `entities` field). diff --git a/objects/wallet_to_transactions_connection.go b/objects/wallet_to_transactions_connection.go index 9f3b519..c650b98 100644 --- a/objects/wallet_to_transactions_connection.go +++ b/objects/wallet_to_transactions_connection.go @@ -1,8 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import "encoding/json" - type WalletToTransactionsConnection struct { // Count The total count of objects in this connection, using the current filters. It is different from the number of objects returned in the current page (in the `entities` field). diff --git a/objects/webhook_event_type.go b/objects/webhook_event_type.go index 3367ef6..209f503 100644 --- a/objects/webhook_event_type.go +++ b/objects/webhook_event_type.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // WebhookEventType This is an enum of the potential event types that can be associated with your Lightspark wallets. diff --git a/objects/withdrawal.go b/objects/withdrawal.go index 67cd6c7..5ec6372 100644 --- a/objects/withdrawal.go +++ b/objects/withdrawal.go @@ -1,11 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "time" - - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // Withdrawal This object represents an L1 withdrawal from your Lightspark Node to any Bitcoin wallet. You can retrieve this object to receive detailed information about any L1 withdrawal associated with your Lightspark Node or account. type Withdrawal struct { diff --git a/objects/withdrawal_mode.go b/objects/withdrawal_mode.go index de3d510..50a46d1 100644 --- a/objects/withdrawal_mode.go +++ b/objects/withdrawal_mode.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // WithdrawalMode This is an enum of the potential modes that your Bitcoin withdrawal can take. diff --git a/objects/withdrawal_request.go b/objects/withdrawal_request.go index 924224a..e5b05f6 100644 --- a/objects/withdrawal_request.go +++ b/objects/withdrawal_request.go @@ -1,13 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved package objects -import ( - "encoding/json" - "time" - - "github.com/lightsparkdev/go-sdk/requester" - "github.com/lightsparkdev/go-sdk/types" -) +import "time" // WithdrawalRequest This object represents a request made for an L1 withdrawal from your Lightspark Node to any Bitcoin wallet. You can retrieve this object to receive detailed information about any withdrawal request made from your Lightspark account. type WithdrawalRequest struct { diff --git a/objects/withdrawal_request_status.go b/objects/withdrawal_request_status.go index 156aed3..92e3092 100644 --- a/objects/withdrawal_request_status.go +++ b/objects/withdrawal_request_status.go @@ -3,6 +3,7 @@ package objects import ( "encoding/json" + "strings" ) // WithdrawalRequestStatus This is an enum of the potential statuses that a Withdrawal can take.