Skip to content

Commit

Permalink
Merge pull request #50 from lightsparkdev/sdk-regen/6Gzn0g
Browse files Browse the repository at this point in the history
Regenerating SDKs following introspection of schemas.
  • Loading branch information
JasonCWang authored Oct 10, 2024
2 parents f6cf9d7 + c97b5d8 commit aecb8a8
Show file tree
Hide file tree
Showing 105 changed files with 221 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lightspark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@
from lightspark.objects.IncomingPaymentsForInvoiceQueryOutput import (
IncomingPaymentsForInvoiceQueryOutput,
)
from lightspark.objects.IncomingPaymentsForPaymentHashQueryInput import (
IncomingPaymentsForPaymentHashQueryInput,
)
from lightspark.objects.IncomingPaymentsForPaymentHashQueryOutput import (
IncomingPaymentsForPaymentHashQueryOutput,
)
from lightspark.objects.IncomingPaymentToAttemptsConnection import (
IncomingPaymentToAttemptsConnection,
)
Expand Down
2 changes: 2 additions & 0 deletions lightspark/objects/Account.py
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,8 @@ def get_payment_requests(
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
}
invoice_is_uma: is_uma
invoice_is_lnurl: is_lnurl
}
}
}
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/AccountToApiTokensConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

@dataclass
class AccountToApiTokensConnection(Connection):

requester: Requester

count: int
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/AccountToChannelsConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

@dataclass
class AccountToChannelsConnection(Connection):

requester: Requester

count: int
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/AccountToPaymentRequestsConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

@dataclass
class AccountToPaymentRequestsConnection(Connection):

requester: Requester

count: int
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/AccountToTransactionsConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

@dataclass
class AccountToTransactionsConnection(Connection):

requester: Requester

count: int
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/AccountToWalletsConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

@dataclass
class AccountToWalletsConnection(Connection):

requester: Requester

count: int
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/ChannelSnapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

@dataclass
class ChannelSnapshot(Entity):

requester: Requester

id: str
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/ChannelToTransactionsConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@dataclass
class ChannelToTransactionsConnection:

requester: Requester

count: int
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/ClaimUmaInvitationInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@dataclass
class ClaimUmaInvitationInput:

invitation_code: str
"""The unique code that identifies this invitation and was shared by the inviter."""

Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/ClaimUmaInvitationOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@dataclass
class ClaimUmaInvitationOutput:

requester: Requester

invitation_id: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@dataclass
class ClaimUmaInvitationWithIncentivesInput:

invitation_code: str
"""The unique code that identifies this invitation and was shared by the inviter."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@dataclass
class ClaimUmaInvitationWithIncentivesOutput:

requester: Requester

invitation_id: str
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/Connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

@dataclass
class Connection:

requester: Requester

count: int
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateApiTokenInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@dataclass
class CreateApiTokenInput:

name: str
"""An arbitrary name that the user can choose to identify the API token in a list."""

Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateApiTokenOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@dataclass
class CreateApiTokenOutput:

requester: Requester

api_token: ApiToken
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateInvitationWithIncentivesInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@dataclass
class CreateInvitationWithIncentivesInput:

inviter_uma: str
"""The UMA of the user creating the invitation. It will be used to identify the inviter when receiving the invitation."""

Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateInvitationWithIncentivesOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@dataclass
class CreateInvitationWithIncentivesOutput:

requester: Requester

invitation_id: str
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateInvoiceInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@dataclass
class CreateInvoiceInput:

node_id: str
"""The node from which to create the invoice."""

Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateInvoiceOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@dataclass
class CreateInvoiceOutput:

requester: Requester

invoice_id: str
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateLnurlInvoiceInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@dataclass
class CreateLnurlInvoiceInput:

node_id: str
"""The node from which to create the invoice."""

Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateNodeWalletAddressInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@dataclass
class CreateNodeWalletAddressInput:

node_id: str

def to_json(self) -> Mapping[str, Any]:
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateNodeWalletAddressOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

@dataclass
class CreateNodeWalletAddressOutput:

requester: Requester

node_id: str
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateTestModeInvoiceInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@dataclass
class CreateTestModeInvoiceInput:

local_node_id: str

amount_msats: int
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateTestModeInvoiceOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@dataclass
class CreateTestModeInvoiceOutput:

requester: Requester

encoded_payment_request: str
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateTestModePaymentInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@dataclass
class CreateTestModePaymentInput:

local_node_id: str
"""The node to where you want to send the payment."""

Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateUmaInvitationInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@dataclass
class CreateUmaInvitationInput:

inviter_uma: str
"""The UMA of the user creating the invitation. It will be used to identify the inviter when receiving the invitation."""

Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/CreateUmaInvitationOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@dataclass
class CreateUmaInvitationOutput:

requester: Requester

invitation_id: str
Expand Down
6 changes: 6 additions & 0 deletions lightspark/objects/CreateUmaInvoiceInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@

@dataclass
class CreateUmaInvoiceInput:

node_id: str
"""The node from which to create the invoice."""

amount_msats: int
"""The amount for which the invoice should be created, in millisatoshis."""

metadata_hash: str
"""The SHA256 hash of the UMA metadata payload. This will be present in the h-tag (SHA256 purpose of payment) of the resulting Bolt 11 invoice."""

expiry_secs: Optional[int]
"""The expiry of the invoice in seconds. Default value is 86400 (1 day)."""

receiver_hash: Optional[str]
"""An optional, monthly-rotated, unique hashed identifier corresponding to the receiver of the payment."""

def to_json(self) -> Mapping[str, Any]:
return {
Expand Down
2 changes: 2 additions & 0 deletions lightspark/objects/CurrencyUnit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class CurrencyUnit(Enum):
"""0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible."""
USD = "USD"
"""United States Dollar."""
MXN = "MXN"
"""Mexican Peso."""
NANOBITCOIN = "NANOBITCOIN"
"""0.000000001 (10e-9) Bitcoin or a billionth of a Bitcoin. We recommend using the Satoshi unit instead when possible."""
MICROBITCOIN = "MICROBITCOIN"
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/DailyLiquidityForecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

@dataclass
class DailyLiquidityForecast:

requester: Requester

date: datetime
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/DeclineToSignMessagesInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@dataclass
class DeclineToSignMessagesInput:

payload_ids: List[str]
"""List of payload ids to decline to sign because validation failed."""

Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/DeclineToSignMessagesOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@dataclass
class DeclineToSignMessagesOutput:

requester: Requester

declined_payloads: List[SignablePayload]
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/DeleteApiTokenInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@dataclass
class DeleteApiTokenInput:

api_token_id: str

def to_json(self) -> Mapping[str, Any]:
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/DeleteApiTokenOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@dataclass
class DeleteApiTokenOutput:

requester: Requester

account_id: str
Expand Down
2 changes: 2 additions & 0 deletions lightspark/objects/Entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ class Entity:
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
}
invoice_is_uma: is_uma
invoice_is_lnurl: is_lnurl
}
... on LightsparkNodeWithOSK {
__typename
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/FailHtlcsInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@dataclass
class FailHtlcsInput:

invoice_id: str
"""The id of invoice which the pending HTLCs that need to be failed are paying for."""

Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/FailHtlcsOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@dataclass
class FailHtlcsOutput:

requester: Requester

invoice_id: str
Expand Down
5 changes: 5 additions & 0 deletions lightspark/objects/FundNodeInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@

@dataclass
class FundNodeInput:

node_id: str

amount_sats: Optional[int]

funding_address: Optional[str]

def to_json(self) -> Mapping[str, Any]:
return {
"fund_node_input_node_id": self.node_id,
"fund_node_input_amount_sats": self.amount_sats,
"fund_node_input_funding_address": self.funding_address,
}


def from_json(obj: Mapping[str, Any]) -> FundNodeInput:
return FundNodeInput(
node_id=obj["fund_node_input_node_id"],
amount_sats=obj["fund_node_input_amount_sats"],
funding_address=obj["fund_node_input_funding_address"],
)
1 change: 1 addition & 0 deletions lightspark/objects/FundNodeOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@dataclass
class FundNodeOutput:

requester: Requester

amount: CurrencyAmount
Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/IdAndSignature.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@dataclass
class IdAndSignature:

id: str
"""The id of the message."""

Expand Down
1 change: 1 addition & 0 deletions lightspark/objects/IncomingPaymentsForInvoiceQueryInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@dataclass
class IncomingPaymentsForInvoiceQueryInput:

invoice_id: str

statuses: Optional[List[TransactionStatus]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@dataclass
class IncomingPaymentsForInvoiceQueryOutput:

requester: Requester

payments: List[IncomingPayment]
Expand Down
Loading

0 comments on commit aecb8a8

Please sign in to comment.