Skip to content

Commit f7d2a6b

Browse files
authored
Merge pull request #43 from lightsparkdev/sdk-regen/JYa9HQ
Regenerate sdk
2 parents d438950 + aa27c44 commit f7d2a6b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1432
-1005
lines changed

lightspark/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@
100100
)
101101
from lightspark.objects.Invoice import Invoice
102102
from lightspark.objects.InvoiceData import InvoiceData
103+
from lightspark.objects.InvoiceForPaymentHashInput import InvoiceForPaymentHashInput
104+
from lightspark.objects.InvoiceForPaymentHashOutput import InvoiceForPaymentHashOutput
103105
from lightspark.objects.InvoiceType import InvoiceType
104106
from lightspark.objects.LightningFeeEstimateForInvoiceInput import (
105107
LightningFeeEstimateForInvoiceInput,
@@ -130,6 +132,7 @@
130132
from lightspark.objects.NodeAddress import NodeAddress
131133
from lightspark.objects.NodeAddressType import NodeAddressType
132134
from lightspark.objects.NodeToAddressesConnection import NodeToAddressesConnection
135+
from lightspark.objects.OnChainFeeTarget import OnChainFeeTarget
133136
from lightspark.objects.OnChainTransaction import OnChainTransaction
134137
from lightspark.objects.OutgoingPayment import OutgoingPayment
135138
from lightspark.objects.OutgoingPaymentAttempt import OutgoingPaymentAttempt
@@ -181,6 +184,7 @@
181184
from lightspark.objects.ReleasePaymentPreimageInput import ReleasePaymentPreimageInput
182185
from lightspark.objects.ReleasePaymentPreimageOutput import ReleasePaymentPreimageOutput
183186
from lightspark.objects.RemoteSigningSubEventType import RemoteSigningSubEventType
187+
from lightspark.objects.RequestInitiator import RequestInitiator
184188
from lightspark.objects.RequestWithdrawalInput import RequestWithdrawalInput
185189
from lightspark.objects.RequestWithdrawalOutput import RequestWithdrawalOutput
186190
from lightspark.objects.RichText import RichText

lightspark/objects/Account.py

+1
Original file line numberDiff line numberDiff line change
@@ -1786,6 +1786,7 @@ def get_withdrawal_requests(
17861786
id
17871787
}
17881788
withdrawal_request_idempotency_key: idempotency_key
1789+
withdrawal_request_initiator: initiator
17891790
}
17901791
}
17911792
}

lightspark/objects/AccountToTransactionsConnection.py

+33-24
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@ def to_json(self) -> Mapping[str, Any]:
4242
"__typename": "AccountToTransactionsConnection",
4343
"account_to_transactions_connection_count": self.count,
4444
"account_to_transactions_connection_page_info": self.page_info.to_json(),
45-
"account_to_transactions_connection_profit_loss": self.profit_loss.to_json()
46-
if self.profit_loss
47-
else None,
48-
"account_to_transactions_connection_average_fee_earned": self.average_fee_earned.to_json()
49-
if self.average_fee_earned
50-
else None,
51-
"account_to_transactions_connection_total_amount_transacted": self.total_amount_transacted.to_json()
52-
if self.total_amount_transacted
53-
else None,
45+
"account_to_transactions_connection_profit_loss": (
46+
self.profit_loss.to_json() if self.profit_loss else None
47+
),
48+
"account_to_transactions_connection_average_fee_earned": (
49+
self.average_fee_earned.to_json() if self.average_fee_earned else None
50+
),
51+
"account_to_transactions_connection_total_amount_transacted": (
52+
self.total_amount_transacted.to_json()
53+
if self.total_amount_transacted
54+
else None
55+
),
5456
"account_to_transactions_connection_entities": [
5557
e.to_json() for e in self.entities
5658
],
@@ -109,21 +111,28 @@ def from_json(
109111
page_info=PageInfo_from_json(
110112
requester, obj["account_to_transactions_connection_page_info"]
111113
),
112-
profit_loss=CurrencyAmount_from_json(
113-
requester, obj["account_to_transactions_connection_profit_loss"]
114-
)
115-
if obj["account_to_transactions_connection_profit_loss"]
116-
else None,
117-
average_fee_earned=CurrencyAmount_from_json(
118-
requester, obj["account_to_transactions_connection_average_fee_earned"]
119-
)
120-
if obj["account_to_transactions_connection_average_fee_earned"]
121-
else None,
122-
total_amount_transacted=CurrencyAmount_from_json(
123-
requester, obj["account_to_transactions_connection_total_amount_transacted"]
124-
)
125-
if obj["account_to_transactions_connection_total_amount_transacted"]
126-
else None,
114+
profit_loss=(
115+
CurrencyAmount_from_json(
116+
requester, obj["account_to_transactions_connection_profit_loss"]
117+
)
118+
if obj["account_to_transactions_connection_profit_loss"]
119+
else None
120+
),
121+
average_fee_earned=(
122+
CurrencyAmount_from_json(
123+
requester, obj["account_to_transactions_connection_average_fee_earned"]
124+
)
125+
if obj["account_to_transactions_connection_average_fee_earned"]
126+
else None
127+
),
128+
total_amount_transacted=(
129+
CurrencyAmount_from_json(
130+
requester,
131+
obj["account_to_transactions_connection_total_amount_transacted"],
132+
)
133+
if obj["account_to_transactions_connection_total_amount_transacted"]
134+
else None
135+
),
127136
entities=list(
128137
map(
129138
# pylint: disable=unnecessary-lambda

lightspark/objects/BlockchainBalance.py

+58-48
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,24 @@ class BlockchainBalance:
3535

3636
def to_json(self) -> Mapping[str, Any]:
3737
return {
38-
"blockchain_balance_total_balance": self.total_balance.to_json()
39-
if self.total_balance
40-
else None,
41-
"blockchain_balance_confirmed_balance": self.confirmed_balance.to_json()
42-
if self.confirmed_balance
43-
else None,
44-
"blockchain_balance_unconfirmed_balance": self.unconfirmed_balance.to_json()
45-
if self.unconfirmed_balance
46-
else None,
47-
"blockchain_balance_locked_balance": self.locked_balance.to_json()
48-
if self.locked_balance
49-
else None,
50-
"blockchain_balance_required_reserve": self.required_reserve.to_json()
51-
if self.required_reserve
52-
else None,
53-
"blockchain_balance_available_balance": self.available_balance.to_json()
54-
if self.available_balance
55-
else None,
38+
"blockchain_balance_total_balance": (
39+
self.total_balance.to_json() if self.total_balance else None
40+
),
41+
"blockchain_balance_confirmed_balance": (
42+
self.confirmed_balance.to_json() if self.confirmed_balance else None
43+
),
44+
"blockchain_balance_unconfirmed_balance": (
45+
self.unconfirmed_balance.to_json() if self.unconfirmed_balance else None
46+
),
47+
"blockchain_balance_locked_balance": (
48+
self.locked_balance.to_json() if self.locked_balance else None
49+
),
50+
"blockchain_balance_required_reserve": (
51+
self.required_reserve.to_json() if self.required_reserve else None
52+
),
53+
"blockchain_balance_available_balance": (
54+
self.available_balance.to_json() if self.available_balance else None
55+
),
5656
}
5757

5858

@@ -114,34 +114,44 @@ def to_json(self) -> Mapping[str, Any]:
114114
def from_json(requester: Requester, obj: Mapping[str, Any]) -> BlockchainBalance:
115115
return BlockchainBalance(
116116
requester=requester,
117-
total_balance=CurrencyAmount_from_json(
118-
requester, obj["blockchain_balance_total_balance"]
119-
)
120-
if obj["blockchain_balance_total_balance"]
121-
else None,
122-
confirmed_balance=CurrencyAmount_from_json(
123-
requester, obj["blockchain_balance_confirmed_balance"]
124-
)
125-
if obj["blockchain_balance_confirmed_balance"]
126-
else None,
127-
unconfirmed_balance=CurrencyAmount_from_json(
128-
requester, obj["blockchain_balance_unconfirmed_balance"]
129-
)
130-
if obj["blockchain_balance_unconfirmed_balance"]
131-
else None,
132-
locked_balance=CurrencyAmount_from_json(
133-
requester, obj["blockchain_balance_locked_balance"]
134-
)
135-
if obj["blockchain_balance_locked_balance"]
136-
else None,
137-
required_reserve=CurrencyAmount_from_json(
138-
requester, obj["blockchain_balance_required_reserve"]
139-
)
140-
if obj["blockchain_balance_required_reserve"]
141-
else None,
142-
available_balance=CurrencyAmount_from_json(
143-
requester, obj["blockchain_balance_available_balance"]
144-
)
145-
if obj["blockchain_balance_available_balance"]
146-
else None,
117+
total_balance=(
118+
CurrencyAmount_from_json(requester, obj["blockchain_balance_total_balance"])
119+
if obj["blockchain_balance_total_balance"]
120+
else None
121+
),
122+
confirmed_balance=(
123+
CurrencyAmount_from_json(
124+
requester, obj["blockchain_balance_confirmed_balance"]
125+
)
126+
if obj["blockchain_balance_confirmed_balance"]
127+
else None
128+
),
129+
unconfirmed_balance=(
130+
CurrencyAmount_from_json(
131+
requester, obj["blockchain_balance_unconfirmed_balance"]
132+
)
133+
if obj["blockchain_balance_unconfirmed_balance"]
134+
else None
135+
),
136+
locked_balance=(
137+
CurrencyAmount_from_json(
138+
requester, obj["blockchain_balance_locked_balance"]
139+
)
140+
if obj["blockchain_balance_locked_balance"]
141+
else None
142+
),
143+
required_reserve=(
144+
CurrencyAmount_from_json(
145+
requester, obj["blockchain_balance_required_reserve"]
146+
)
147+
if obj["blockchain_balance_required_reserve"]
148+
else None
149+
),
150+
available_balance=(
151+
CurrencyAmount_from_json(
152+
requester, obj["blockchain_balance_available_balance"]
153+
)
154+
if obj["blockchain_balance_available_balance"]
155+
else None
156+
),
147157
)

lightspark/objects/Channel.py

+86-68
Original file line numberDiff line numberDiff line change
@@ -164,37 +164,43 @@ def to_json(self) -> Mapping[str, Any]:
164164
"channel_id": self.id,
165165
"channel_created_at": self.created_at.isoformat(),
166166
"channel_updated_at": self.updated_at.isoformat(),
167-
"channel_funding_transaction": {"id": self.funding_transaction_id}
168-
if self.funding_transaction_id
169-
else None,
167+
"channel_funding_transaction": (
168+
{"id": self.funding_transaction_id}
169+
if self.funding_transaction_id
170+
else None
171+
),
170172
"channel_capacity": self.capacity.to_json() if self.capacity else None,
171-
"channel_local_balance": self.local_balance.to_json()
172-
if self.local_balance
173-
else None,
174-
"channel_local_unsettled_balance": self.local_unsettled_balance.to_json()
175-
if self.local_unsettled_balance
176-
else None,
177-
"channel_remote_balance": self.remote_balance.to_json()
178-
if self.remote_balance
179-
else None,
180-
"channel_remote_unsettled_balance": self.remote_unsettled_balance.to_json()
181-
if self.remote_unsettled_balance
182-
else None,
183-
"channel_unsettled_balance": self.unsettled_balance.to_json()
184-
if self.unsettled_balance
185-
else None,
186-
"channel_total_balance": self.total_balance.to_json()
187-
if self.total_balance
188-
else None,
173+
"channel_local_balance": (
174+
self.local_balance.to_json() if self.local_balance else None
175+
),
176+
"channel_local_unsettled_balance": (
177+
self.local_unsettled_balance.to_json()
178+
if self.local_unsettled_balance
179+
else None
180+
),
181+
"channel_remote_balance": (
182+
self.remote_balance.to_json() if self.remote_balance else None
183+
),
184+
"channel_remote_unsettled_balance": (
185+
self.remote_unsettled_balance.to_json()
186+
if self.remote_unsettled_balance
187+
else None
188+
),
189+
"channel_unsettled_balance": (
190+
self.unsettled_balance.to_json() if self.unsettled_balance else None
191+
),
192+
"channel_total_balance": (
193+
self.total_balance.to_json() if self.total_balance else None
194+
),
189195
"channel_status": self.status.value if self.status else None,
190196
"channel_estimated_force_closure_wait_minutes": self.estimated_force_closure_wait_minutes,
191-
"channel_commit_fee": self.commit_fee.to_json()
192-
if self.commit_fee
193-
else None,
197+
"channel_commit_fee": (
198+
self.commit_fee.to_json() if self.commit_fee else None
199+
),
194200
"channel_fees": self.fees.to_json() if self.fees else None,
195-
"channel_remote_node": {"id": self.remote_node_id}
196-
if self.remote_node_id
197-
else None,
201+
"channel_remote_node": (
202+
{"id": self.remote_node_id} if self.remote_node_id else None
203+
),
198204
"channel_local_node": {"id": self.local_node_id},
199205
"channel_short_channel_id": self.short_channel_id,
200206
}
@@ -305,51 +311,63 @@ def from_json(requester: Requester, obj: Mapping[str, Any]) -> Channel:
305311
id=obj["channel_id"],
306312
created_at=datetime.fromisoformat(obj["channel_created_at"]),
307313
updated_at=datetime.fromisoformat(obj["channel_updated_at"]),
308-
funding_transaction_id=obj["channel_funding_transaction"]["id"]
309-
if obj["channel_funding_transaction"]
310-
else None,
311-
capacity=CurrencyAmount_from_json(requester, obj["channel_capacity"])
312-
if obj["channel_capacity"]
313-
else None,
314-
local_balance=CurrencyAmount_from_json(requester, obj["channel_local_balance"])
315-
if obj["channel_local_balance"]
316-
else None,
317-
local_unsettled_balance=CurrencyAmount_from_json(
318-
requester, obj["channel_local_unsettled_balance"]
319-
)
320-
if obj["channel_local_unsettled_balance"]
321-
else None,
322-
remote_balance=CurrencyAmount_from_json(
323-
requester, obj["channel_remote_balance"]
324-
)
325-
if obj["channel_remote_balance"]
326-
else None,
327-
remote_unsettled_balance=CurrencyAmount_from_json(
328-
requester, obj["channel_remote_unsettled_balance"]
329-
)
330-
if obj["channel_remote_unsettled_balance"]
331-
else None,
332-
unsettled_balance=CurrencyAmount_from_json(
333-
requester, obj["channel_unsettled_balance"]
334-
)
335-
if obj["channel_unsettled_balance"]
336-
else None,
337-
total_balance=CurrencyAmount_from_json(requester, obj["channel_total_balance"])
338-
if obj["channel_total_balance"]
339-
else None,
314+
funding_transaction_id=(
315+
obj["channel_funding_transaction"]["id"]
316+
if obj["channel_funding_transaction"]
317+
else None
318+
),
319+
capacity=(
320+
CurrencyAmount_from_json(requester, obj["channel_capacity"])
321+
if obj["channel_capacity"]
322+
else None
323+
),
324+
local_balance=(
325+
CurrencyAmount_from_json(requester, obj["channel_local_balance"])
326+
if obj["channel_local_balance"]
327+
else None
328+
),
329+
local_unsettled_balance=(
330+
CurrencyAmount_from_json(requester, obj["channel_local_unsettled_balance"])
331+
if obj["channel_local_unsettled_balance"]
332+
else None
333+
),
334+
remote_balance=(
335+
CurrencyAmount_from_json(requester, obj["channel_remote_balance"])
336+
if obj["channel_remote_balance"]
337+
else None
338+
),
339+
remote_unsettled_balance=(
340+
CurrencyAmount_from_json(requester, obj["channel_remote_unsettled_balance"])
341+
if obj["channel_remote_unsettled_balance"]
342+
else None
343+
),
344+
unsettled_balance=(
345+
CurrencyAmount_from_json(requester, obj["channel_unsettled_balance"])
346+
if obj["channel_unsettled_balance"]
347+
else None
348+
),
349+
total_balance=(
350+
CurrencyAmount_from_json(requester, obj["channel_total_balance"])
351+
if obj["channel_total_balance"]
352+
else None
353+
),
340354
status=parse_enum_optional(ChannelStatus, obj["channel_status"]),
341355
estimated_force_closure_wait_minutes=obj[
342356
"channel_estimated_force_closure_wait_minutes"
343357
],
344-
commit_fee=CurrencyAmount_from_json(requester, obj["channel_commit_fee"])
345-
if obj["channel_commit_fee"]
346-
else None,
347-
fees=ChannelFees_from_json(requester, obj["channel_fees"])
348-
if obj["channel_fees"]
349-
else None,
350-
remote_node_id=obj["channel_remote_node"]["id"]
351-
if obj["channel_remote_node"]
352-
else None,
358+
commit_fee=(
359+
CurrencyAmount_from_json(requester, obj["channel_commit_fee"])
360+
if obj["channel_commit_fee"]
361+
else None
362+
),
363+
fees=(
364+
ChannelFees_from_json(requester, obj["channel_fees"])
365+
if obj["channel_fees"]
366+
else None
367+
),
368+
remote_node_id=(
369+
obj["channel_remote_node"]["id"] if obj["channel_remote_node"] else None
370+
),
353371
local_node_id=obj["channel_local_node"]["id"],
354372
short_channel_id=obj["channel_short_channel_id"],
355373
)

0 commit comments

Comments
 (0)