Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate SDKs #57

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lightspark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
from lightspark.objects.CreateUmaInvitationOutput import CreateUmaInvitationOutput
from lightspark.objects.CreateUmaInvoiceInput import CreateUmaInvoiceInput
from lightspark.objects.CurrencyAmount import CurrencyAmount
from lightspark.objects.CurrencyAmountInput import CurrencyAmountInput
from lightspark.objects.CurrencyUnit import CurrencyUnit
from lightspark.objects.DailyLiquidityForecast import DailyLiquidityForecast
from lightspark.objects.DeclineToSignMessagesInput import DeclineToSignMessagesInput
Expand Down Expand Up @@ -175,6 +176,7 @@
from lightspark.objects.PaymentRequest import PaymentRequest
from lightspark.objects.PaymentRequestData import PaymentRequestData
from lightspark.objects.PaymentRequestStatus import PaymentRequestStatus
from lightspark.objects.PayTestModeInvoiceInput import PayTestModeInvoiceInput
from lightspark.objects.PayUmaInvoiceInput import PayUmaInvoiceInput
from lightspark.objects.Permission import Permission
from lightspark.objects.PostTransactionData import PostTransactionData
Expand Down
25 changes: 19 additions & 6 deletions lightspark/objects/Account.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from .BlockchainBalance import from_json as BlockchainBalance_from_json
from .CurrencyAmount import CurrencyAmount
from .CurrencyAmount import from_json as CurrencyAmount_from_json
from .CurrencyAmountInput import CurrencyAmountInput
from .Entity import Entity
from .LightsparkNodeOwner import LightsparkNodeOwner
from .TransactionFailures import TransactionFailures
Expand Down Expand Up @@ -745,13 +746,15 @@ def get_transactions(
lightning_node_id: Optional[str] = None,
statuses: Optional[List[TransactionStatus]] = None,
exclude_failures: Optional[TransactionFailures] = None,
max_amount: Optional[CurrencyAmountInput] = None,
min_amount: Optional[CurrencyAmountInput] = None,
) -> AccountToTransactionsConnection:
json = self.requester.execute_graphql(
"""
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) {
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 {
Expand Down Expand Up @@ -1351,6 +1354,8 @@ def get_transactions(
"lightning_node_id": lightning_node_id,
"statuses": statuses,
"exclude_failures": exclude_failures,
"max_amount": max_amount,
"min_amount": min_amount,
},
)
connection = json["entity"]["transactions"]
Expand All @@ -1364,13 +1369,15 @@ def get_payment_requests(
before_date: Optional[datetime] = None,
bitcoin_network: Optional[BitcoinNetwork] = None,
lightning_node_id: Optional[str] = None,
max_amount: Optional[CurrencyAmountInput] = None,
min_amount: Optional[CurrencyAmountInput] = None,
) -> AccountToPaymentRequestsConnection:
json = self.requester.execute_graphql(
"""
query FetchAccountToPaymentRequestsConnection($entity_id: ID!, $first: Int, $after: String, $after_date: DateTime, $before_date: DateTime, $bitcoin_network: BitcoinNetwork, $lightning_node_id: ID) {
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 {
Expand Down Expand Up @@ -1704,6 +1711,8 @@ def get_payment_requests(
"before_date": before_date,
"bitcoin_network": bitcoin_network,
"lightning_node_id": lightning_node_id,
"max_amount": max_amount,
"min_amount": min_amount,
},
)
connection = json["entity"]["payment_requests"]
Expand All @@ -1719,13 +1728,15 @@ def get_withdrawal_requests(
idempotency_keys: Optional[List[str]] = None,
after_date: Optional[datetime] = None,
before_date: Optional[datetime] = None,
max_amount: Optional[CurrencyAmountInput] = None,
min_amount: Optional[CurrencyAmountInput] = None,
) -> AccountToWithdrawalRequestsConnection:
json = self.requester.execute_graphql(
"""
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) {
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 {
Expand Down Expand Up @@ -1805,6 +1816,8 @@ def get_withdrawal_requests(
"idempotency_keys": idempotency_keys,
"after_date": after_date,
"before_date": before_date,
"max_amount": max_amount,
"min_amount": min_amount,
},
)
connection = json["entity"]["withdrawal_requests"]
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
5 changes: 5 additions & 0 deletions lightspark/objects/CreateTestModeInvoiceInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@

@dataclass
class CreateTestModeInvoiceInput:

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

amount_msats: int
"""The amount for which the invoice should be created, in millisatoshis. Setting the amount to 0 will allow the payer to specify an amount."""

memo: Optional[str]
"""An optional memo to include in the invoice."""

invoice_type: Optional[InvoiceType]
"""The type of invoice to create."""

def to_json(self) -> Mapping[str, Any]:
return {
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
1 change: 1 addition & 0 deletions lightspark/objects/CreateUmaInvoiceInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@dataclass
class CreateUmaInvoiceInput:

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

Expand Down
29 changes: 29 additions & 0 deletions lightspark/objects/CurrencyAmountInput.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright ©, 2022-present, Lightspark Group, Inc. - All Rights Reserved

from dataclasses import dataclass
from typing import Any, Mapping

from lightspark.utils.enums import parse_enum

from .CurrencyUnit import CurrencyUnit


@dataclass
class CurrencyAmountInput:

value: int

unit: CurrencyUnit

def to_json(self) -> Mapping[str, Any]:
return {
"currency_amount_input_value": self.value,
"currency_amount_input_unit": self.unit.value,
}


def from_json(obj: Mapping[str, Any]) -> CurrencyAmountInput:
return CurrencyAmountInput(
value=obj["currency_amount_input_value"],
unit=parse_enum(CurrencyUnit, obj["currency_amount_input_unit"]),
)
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
Loading
Loading