Skip to content

Commit

Permalink
Regenerate SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenlu committed May 3, 2024
1 parent 1e74552 commit 589ce37
Show file tree
Hide file tree
Showing 23 changed files with 268 additions and 40 deletions.
10 changes: 10 additions & 0 deletions objects/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ func (obj Account) GetTransactions(requester *requester.Requester, first *int64,
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
}
}
incoming_payment_is_internal_payment: is_internal_payment
}
... on OutgoingPayment {
__typename
Expand Down Expand Up @@ -1249,6 +1250,7 @@ func (obj Account) GetTransactions(requester *requester.Requester, first *int64,
}
}
outgoing_payment_payment_preimage: payment_preimage
outgoing_payment_is_internal_payment: is_internal_payment
}
... on RoutingTransaction {
__typename
Expand Down Expand Up @@ -1748,6 +1750,14 @@ func (obj Account) GetWithdrawalRequests(requester *requester.Requester, first *
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
}
withdrawal_request_total_fees: total_fees {
__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
}
withdrawal_request_bitcoin_address: bitcoin_address
withdrawal_request_withdrawal_mode: withdrawal_mode
withdrawal_request_status: status
Expand Down
4 changes: 2 additions & 2 deletions objects/channel_closing_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type ChannelClosingTransaction struct {
// TransactionHash The hash of this transaction, so it can be uniquely identified on the Lightning Network.
TransactionHash *string `json:"channel_closing_transaction_transaction_hash"`

// Fees The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin blockchain.
// Fees The fees that were paid by the node for this transaction.
Fees *CurrencyAmount `json:"channel_closing_transaction_fees"`

// BlockHash The hash of the block that included this transaction. This will be null for unconfirmed transactions.
Expand Down Expand Up @@ -90,7 +90,7 @@ fragment ChannelClosingTransactionFragment on ChannelClosingTransaction {
`
)

// GetFees The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin blockchain.
// GetFees The fees that were paid by the node for this transaction.
func (obj ChannelClosingTransaction) GetFees() *CurrencyAmount {
return obj.Fees
}
Expand Down
4 changes: 2 additions & 2 deletions objects/channel_opening_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type ChannelOpeningTransaction struct {
// TransactionHash The hash of this transaction, so it can be uniquely identified on the Lightning Network.
TransactionHash *string `json:"channel_opening_transaction_transaction_hash"`

// Fees The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin blockchain.
// Fees The fees that were paid by the node for this transaction.
Fees *CurrencyAmount `json:"channel_opening_transaction_fees"`

// BlockHash The hash of the block that included this transaction. This will be null for unconfirmed transactions.
Expand Down Expand Up @@ -90,7 +90,7 @@ fragment ChannelOpeningTransactionFragment on ChannelOpeningTransaction {
`
)

// GetFees The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin blockchain.
// GetFees The fees that were paid by the node for this transaction.
func (obj ChannelOpeningTransaction) GetFees() *CurrencyAmount {
return obj.Fees
}
Expand Down
12 changes: 12 additions & 0 deletions objects/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ func ConnectionUnmarshal(data map[string]interface{}) (Connection, error) {
return nil, err
}
return walletToWithdrawalRequestsConnection, nil
case "WithdrawalRequestToChannelClosingTransactionsConnection":
var withdrawalRequestToChannelClosingTransactionsConnection WithdrawalRequestToChannelClosingTransactionsConnection
if err := json.Unmarshal(dataJSON, &withdrawalRequestToChannelClosingTransactionsConnection); err != nil {
return nil, err
}
return withdrawalRequestToChannelClosingTransactionsConnection, nil
case "WithdrawalRequestToChannelOpeningTransactionsConnection":
var withdrawalRequestToChannelOpeningTransactionsConnection WithdrawalRequestToChannelOpeningTransactionsConnection
if err := json.Unmarshal(dataJSON, &withdrawalRequestToChannelOpeningTransactionsConnection); err != nil {
return nil, err
}
return withdrawalRequestToChannelOpeningTransactionsConnection, nil

default:
return nil, fmt.Errorf("unknown Connection type: %s", data["__typename"])
Expand Down
4 changes: 2 additions & 2 deletions objects/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Deposit struct {
// TransactionHash The hash of this transaction, so it can be uniquely identified on the Lightning Network.
TransactionHash *string `json:"deposit_transaction_hash"`

// Fees The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin blockchain.
// Fees The fees that were paid by the node for this transaction.
Fees *CurrencyAmount `json:"deposit_fees"`

// BlockHash The hash of the block that included this transaction. This will be null for unconfirmed transactions.
Expand Down Expand Up @@ -90,7 +90,7 @@ fragment DepositFragment on Deposit {
`
)

// GetFees The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin blockchain.
// GetFees The fees that were paid by the node for this transaction.
func (obj Deposit) GetFees() *CurrencyAmount {
return obj.Fees
}
Expand Down
11 changes: 11 additions & 0 deletions objects/fail_htlcs_input.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
package objects

type FailHtlcsInput struct {

// InvoiceId The id of invoice which the pending HTLCs that need to be failed are paying for.
InvoiceId string `json:"fail_htlcs_input_invoice_id"`

// CancelInvoice Whether the invoice needs to be canceled after failing the htlcs. If yes, the invoice cannot be paid anymore.
CancelInvoice bool `json:"fail_htlcs_input_cancel_invoice"`
}
19 changes: 19 additions & 0 deletions objects/fail_htlcs_output.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 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"`
}

const (
FailHtlcsOutputFragment = `
fragment FailHtlcsOutputFragment on FailHtlcsOutput {
__typename
fail_htlcs_output_invoice: invoice {
id
}
}
`
)
4 changes: 4 additions & 0 deletions objects/incoming_payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ type IncomingPayment struct {
// UmaPostTransactionData The post transaction data which can be used in KYT payment registration.
UmaPostTransactionData *[]PostTransactionData `json:"incoming_payment_uma_post_transaction_data"`

// IsInternalPayment Whether the payment is made from the same node.
IsInternalPayment bool `json:"incoming_payment_is_internal_payment"`

// Typename The typename of the object
Typename string `json:"__typename"`
}
Expand Down Expand Up @@ -86,6 +89,7 @@ fragment IncomingPaymentFragment on IncomingPayment {
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
}
}
incoming_payment_is_internal_payment: is_internal_payment
}
`
)
Expand Down
1 change: 1 addition & 0 deletions objects/incoming_payments_for_invoice_query_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ fragment IncomingPaymentsForInvoiceQueryOutputFragment on IncomingPaymentsForInv
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
}
}
incoming_payment_is_internal_payment: is_internal_payment
}
}
`
Expand Down
16 changes: 9 additions & 7 deletions objects/lightspark_node_with_o_s_k.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,11 @@ func (obj LightsparkNodeWithOSK) GetAddresses(requester *requester.Requester, fi
return result, nil
}

func (obj LightsparkNodeWithOSK) GetChannels(requester *requester.Requester, first *int64, statuses *[]ChannelStatus, after *string) (*LightsparkNodeToChannelsConnection, error) {
query := `query FetchLightsparkNodeToChannelsConnection($entity_id: ID!, $first: Int, $statuses: [ChannelStatus!], $after: String) {
func (obj LightsparkNodeWithOSK) GetChannels(requester *requester.Requester, first *int64, after *string, beforeDate *time.Time, afterDate *time.Time, statuses *[]ChannelStatus) (*LightsparkNodeToChannelsConnection, error) {
query := `query FetchLightsparkNodeToChannelsConnection($entity_id: ID!, $first: Int, $after: String, $before_date: DateTime, $after_date: DateTime, $statuses: [ChannelStatus!]) {
entity(id: $entity_id) {
... on LightsparkNodeWithOSK {
channels(, first: $first, statuses: $statuses, after: $after) {
channels(, first: $first, after: $after, before_date: $before_date, after_date: $after_date, statuses: $statuses) {
__typename
lightspark_node_to_channels_connection_count: count
lightspark_node_to_channels_connection_page_info: page_info {
Expand Down Expand Up @@ -461,10 +461,12 @@ func (obj LightsparkNodeWithOSK) GetChannels(requester *requester.Requester, fir
}
}`
variables := map[string]interface{}{
"entity_id": obj.Id,
"first": first,
"statuses": statuses,
"after": after,
"entity_id": obj.Id,
"first": first,
"after": after,
"before_date": beforeDate,
"after_date": afterDate,
"statuses": statuses,
}

response, err := requester.ExecuteGraphql(query, variables, nil)
Expand Down
16 changes: 9 additions & 7 deletions objects/lightspark_node_with_remote_signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ func (obj LightsparkNodeWithRemoteSigning) GetAddresses(requester *requester.Req
return result, nil
}

func (obj LightsparkNodeWithRemoteSigning) GetChannels(requester *requester.Requester, first *int64, statuses *[]ChannelStatus, after *string) (*LightsparkNodeToChannelsConnection, error) {
query := `query FetchLightsparkNodeToChannelsConnection($entity_id: ID!, $first: Int, $statuses: [ChannelStatus!], $after: String) {
func (obj LightsparkNodeWithRemoteSigning) GetChannels(requester *requester.Requester, first *int64, after *string, beforeDate *time.Time, afterDate *time.Time, statuses *[]ChannelStatus) (*LightsparkNodeToChannelsConnection, error) {
query := `query FetchLightsparkNodeToChannelsConnection($entity_id: ID!, $first: Int, $after: String, $before_date: DateTime, $after_date: DateTime, $statuses: [ChannelStatus!]) {
entity(id: $entity_id) {
... on LightsparkNodeWithRemoteSigning {
channels(, first: $first, statuses: $statuses, after: $after) {
channels(, first: $first, after: $after, before_date: $before_date, after_date: $after_date, statuses: $statuses) {
__typename
lightspark_node_to_channels_connection_count: count
lightspark_node_to_channels_connection_page_info: page_info {
Expand Down Expand Up @@ -453,10 +453,12 @@ func (obj LightsparkNodeWithRemoteSigning) GetChannels(requester *requester.Requ
}
}`
variables := map[string]interface{}{
"entity_id": obj.Id,
"first": first,
"statuses": statuses,
"after": after,
"entity_id": obj.Id,
"first": first,
"after": after,
"before_date": beforeDate,
"after_date": afterDate,
"statuses": statuses,
}

response, err := requester.ExecuteGraphql(query, variables, nil)
Expand Down
2 changes: 1 addition & 1 deletion objects/on_chain_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type OnChainTransaction interface {
Transaction
Entity

// GetFees The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin blockchain.
// GetFees The fees that were paid by the node for this transaction.
GetFees() *CurrencyAmount

// GetBlockHash The hash of the block that included this transaction. This will be null for unconfirmed transactions.
Expand Down
9 changes: 9 additions & 0 deletions objects/outgoing_payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ type OutgoingPayment struct {
// PaymentPreimage The preimage of the payment.
PaymentPreimage *string `json:"outgoing_payment_payment_preimage"`

// IsInternalPayment Whether the payment is made to the same node.
IsInternalPayment bool `json:"outgoing_payment_is_internal_payment"`

// Typename The typename of the object
Typename string `json:"__typename"`
}
Expand Down Expand Up @@ -409,6 +412,7 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
}
}
outgoing_payment_payment_preimage: payment_preimage
outgoing_payment_is_internal_payment: is_internal_payment
}
`
)
Expand Down Expand Up @@ -571,6 +575,9 @@ type OutgoingPaymentJSON struct {
// PaymentPreimage The preimage of the payment.
PaymentPreimage *string `json:"outgoing_payment_payment_preimage"`

// IsInternalPayment Whether the payment is made to the same node.
IsInternalPayment bool `json:"outgoing_payment_is_internal_payment"`

// Typename The typename of the object
Typename string `json:"__typename"`
}
Expand Down Expand Up @@ -617,6 +624,8 @@ func (data *OutgoingPayment) UnmarshalJSON(dataBytes []byte) error {

data.PaymentPreimage = temp.PaymentPreimage

data.IsInternalPayment = temp.IsInternalPayment

data.Typename = temp.Typename

return nil
Expand Down
1 change: 1 addition & 0 deletions objects/outgoing_payments_for_invoice_query_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ fragment OutgoingPaymentsForInvoiceQueryOutputFragment on OutgoingPaymentsForInv
}
}
outgoing_payment_payment_preimage: payment_preimage
outgoing_payment_is_internal_payment: is_internal_payment
}
}
`
Expand Down
6 changes: 6 additions & 0 deletions objects/remote_signing_sub_event_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const (
RemoteSigningSubEventTypeRequestInvoicePaymentHash

RemoteSigningSubEventTypeRevealCounterpartyPerCommitmentSecret

RemoteSigningSubEventTypeVlsMessage
)

func (a *RemoteSigningSubEventType) UnmarshalJSON(b []byte) error {
Expand All @@ -52,6 +54,8 @@ func (a *RemoteSigningSubEventType) UnmarshalJSON(b []byte) error {
*a = RemoteSigningSubEventTypeRequestInvoicePaymentHash
case "REVEAL_COUNTERPARTY_PER_COMMITMENT_SECRET":
*a = RemoteSigningSubEventTypeRevealCounterpartyPerCommitmentSecret
case "VLS_MESSAGE":
*a = RemoteSigningSubEventTypeVlsMessage

}
return nil
Expand All @@ -78,6 +82,8 @@ func (a RemoteSigningSubEventType) StringValue() string {
s = "REQUEST_INVOICE_PAYMENT_HASH"
case RemoteSigningSubEventTypeRevealCounterpartyPerCommitmentSecret:
s = "REVEAL_COUNTERPARTY_PER_COMMITMENT_SECRET"
case RemoteSigningSubEventTypeVlsMessage:
s = "VLS_MESSAGE"

}
return s
Expand Down
3 changes: 3 additions & 0 deletions objects/request_withdrawal_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ type RequestWithdrawalInput struct {

// WithdrawalMode The strategy that should be used to withdraw the funds from this node.
WithdrawalMode WithdrawalMode `json:"request_withdrawal_input_withdrawal_mode"`

// IdempotencyKey The idempotency key of the request. The same result will be returned for the same idempotency key.
IdempotencyKey *string `json:"request_withdrawal_input_idempotency_key"`
}
10 changes: 10 additions & 0 deletions objects/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ func (obj Wallet) GetTransactions(requester *requester.Requester, first *int64,
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
}
}
incoming_payment_is_internal_payment: is_internal_payment
}
... on OutgoingPayment {
__typename
Expand Down Expand Up @@ -594,6 +595,7 @@ func (obj Wallet) GetTransactions(requester *requester.Requester, first *int64,
}
}
outgoing_payment_payment_preimage: payment_preimage
outgoing_payment_is_internal_payment: is_internal_payment
}
... on RoutingTransaction {
__typename
Expand Down Expand Up @@ -1121,6 +1123,14 @@ func (obj Wallet) GetWithdrawalRequests(requester *requester.Requester, first *i
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
}
withdrawal_request_total_fees: total_fees {
__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
}
withdrawal_request_bitcoin_address: bitcoin_address
withdrawal_request_withdrawal_mode: withdrawal_mode
withdrawal_request_status: status
Expand Down
4 changes: 2 additions & 2 deletions objects/withdrawal.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Withdrawal struct {
// TransactionHash The hash of this transaction, so it can be uniquely identified on the Lightning Network.
TransactionHash *string `json:"withdrawal_transaction_hash"`

// Fees The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin blockchain.
// Fees The fees that were paid by the node for this transaction.
Fees *CurrencyAmount `json:"withdrawal_fees"`

// BlockHash The hash of the block that included this transaction. This will be null for unconfirmed transactions.
Expand Down Expand Up @@ -90,7 +90,7 @@ fragment WithdrawalFragment on Withdrawal {
`
)

// GetFees The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin blockchain.
// GetFees The fees that were paid by the node for this transaction.
func (obj Withdrawal) GetFees() *CurrencyAmount {
return obj.Fees
}
Expand Down
Loading

0 comments on commit 589ce37

Please sign in to comment.