Skip to content

Commit 693d24c

Browse files
Lightspark Engjklein24
authored andcommitted
Project import generated by Copybara.
GitOrigin-RevId: bf1f6ce42604da12ba6a5cd4b2a55887fcda209c
1 parent ef10e5f commit 693d24c

74 files changed

Lines changed: 3065 additions & 618 deletions

Some content is hidden

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

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ name = "pypi"
55

66
[packages]
77
cryptography = "*"
8+
eciespy = "*"
89
pyjwt = "*"
910
requests = "*"
1011

Pipfile.lock

Lines changed: 467 additions & 234 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

copy.bara.sky

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ core.workflow(
1616
mode = "SQUASH",
1717

1818
origin_files = glob(
19-
["rust-sdk/lightspark/**", "copy.bara.sky"],
19+
["rust-sdk/**", "copy.bara.sky"],
2020
exclude = ["rust-sdk/lightspark/examples/internal_example.rs"],
2121
),
2222

@@ -27,7 +27,7 @@ core.workflow(
2727
core.todo_replace(
2828
mode = 'SCRUB_NAMES'
2929
),
30-
core.move("rust-sdk/lightspark/", "")
30+
core.move("rust-sdk/", "")
3131
],
3232
)
3333

@@ -68,8 +68,7 @@ core.workflow(
6868
),
6969
destination = git.github_destination(
7070
url = "https://github.com/lightsparkdev/go-sdk.git",
71-
# TODO: Move this back to main when we're ready to release.
72-
push = "rc/remote-signing",
71+
push = "main",
7372
),
7473
# Switch to ITERATIVE mode to import each commit separately.
7574
mode = "SQUASH",

examples/example.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Copyright ©, 2022-present, Lightspark Group, Inc. - All Rights Reserved
22

33
import logging
4-
import math
54
import os
65
from datetime import datetime, timedelta
76

@@ -10,7 +9,6 @@
109
logger = logging.getLogger("lightspark")
1110
logger.setLevel(logging.DEBUG)
1211

13-
1412
#################################################################
1513
## MODIFY THOSE VARIABLES BEFORE RUNNING THE EXAMPLE
1614
#################################################################
@@ -290,6 +288,26 @@
290288
)
291289
print("")
292290

291+
# Screen a node
292+
node_pubkey = "bc1qj4mfcgej3wxp8eundzq7sq8f80wps02kk38sgadrer39mr5l7ncqrgmp89"
293+
rating = client.screen_node(
294+
provider=lightspark.ComplianceProvider.CHAINALYSIS, node_pubkey=node_pubkey
295+
)
296+
print(f"Got risk rating for node with pubkey {node_pubkey}: {rating}")
297+
print("")
298+
299+
# Register a successful payment
300+
node_pubkey = "bc1qj4mfcgej3wxp8eundzq7sq8f80wps02kk38sgadrer39mr5l7ncqrgmp89"
301+
payment_id = "<Your successful outgoing payment id>"
302+
client.register_payment(
303+
provider=lightspark.ComplianceProvider.CHAINALYSIS,
304+
node_pubkey=node_pubkey,
305+
payment_id=payment_id,
306+
direction=lightspark.PaymentDirection.SENT,
307+
)
308+
print(f"Successfully registered payment {payment_id}")
309+
print("")
310+
293311
# Issue an arbitrary GraphQL request
294312

295313
result = client.execute_graphql_request(

lightspark/__init__.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright ©, 2022-present, Lightspark Group, Inc. - All Rights Reserved
22

3+
import lightspark.utils
34
from lightspark.lightspark_client import *
45
from lightspark.objects.Account import Account
56
from lightspark.objects.AccountToApiTokensConnection import AccountToApiTokensConnection
@@ -24,6 +25,7 @@
2425
from lightspark.objects.ChannelToTransactionsConnection import (
2526
ChannelToTransactionsConnection,
2627
)
28+
from lightspark.objects.ComplianceProvider import ComplianceProvider
2729
from lightspark.objects.Connection import Connection
2830
from lightspark.objects.CreateApiTokenInput import CreateApiTokenInput
2931
from lightspark.objects.CreateApiTokenOutput import CreateApiTokenOutput
@@ -38,9 +40,7 @@
3840
from lightspark.objects.CreateTestModeInvoiceOutput import CreateTestModeInvoiceOutput
3941
from lightspark.objects.CreateTestModePaymentInput import CreateTestModePaymentInput
4042
from lightspark.objects.CreateTestModePaymentoutput import CreateTestModePaymentoutput
41-
from lightspark.objects.CryptoSanctionsScreeningProvider import (
42-
CryptoSanctionsScreeningProvider,
43-
)
43+
from lightspark.objects.CreateUmaInvoiceInput import CreateUmaInvoiceInput
4444
from lightspark.objects.CurrencyAmount import CurrencyAmount
4545
from lightspark.objects.CurrencyUnit import CurrencyUnit
4646
from lightspark.objects.DeleteApiTokenInput import DeleteApiTokenInput
@@ -88,17 +88,28 @@
8888
from lightspark.objects.OutgoingPaymentAttemptToHopsConnection import (
8989
OutgoingPaymentAttemptToHopsConnection,
9090
)
91+
from lightspark.objects.OutgoingPaymentsForInvoiceQueryInput import (
92+
OutgoingPaymentsForInvoiceQueryInput,
93+
)
94+
from lightspark.objects.OutgoingPaymentsForInvoiceQueryOutput import (
95+
OutgoingPaymentsForInvoiceQueryOutput,
96+
)
9197
from lightspark.objects.OutgoingPaymentToAttemptsConnection import (
9298
OutgoingPaymentToAttemptsConnection,
9399
)
94100
from lightspark.objects.PageInfo import PageInfo
95101
from lightspark.objects.PayInvoiceInput import PayInvoiceInput
96102
from lightspark.objects.PayInvoiceOutput import PayInvoiceOutput
103+
from lightspark.objects.PaymentDirection import PaymentDirection
97104
from lightspark.objects.PaymentFailureReason import PaymentFailureReason
98105
from lightspark.objects.PaymentRequest import PaymentRequest
99106
from lightspark.objects.PaymentRequestData import PaymentRequestData
100107
from lightspark.objects.PaymentRequestStatus import PaymentRequestStatus
108+
from lightspark.objects.PayUmaInvoiceInput import PayUmaInvoiceInput
101109
from lightspark.objects.Permission import Permission
110+
from lightspark.objects.PostTransactionData import PostTransactionData
111+
from lightspark.objects.RegisterPaymentInput import RegisterPaymentInput
112+
from lightspark.objects.RegisterPaymentOutput import RegisterPaymentOutput
102113
from lightspark.objects.RequestWithdrawalInput import RequestWithdrawalInput
103114
from lightspark.objects.RequestWithdrawalOutput import RequestWithdrawalOutput
104115
from lightspark.objects.RichText import RichText
@@ -107,8 +118,8 @@
107118
from lightspark.objects.RoutingTransactionFailureReason import (
108119
RoutingTransactionFailureReason,
109120
)
110-
from lightspark.objects.ScreenBitcoinAddressesInput import ScreenBitcoinAddressesInput
111-
from lightspark.objects.ScreenBitcoinAddressesOutput import ScreenBitcoinAddressesOutput
121+
from lightspark.objects.ScreenNodeInput import ScreenNodeInput
122+
from lightspark.objects.ScreenNodeOutput import ScreenNodeOutput
112123
from lightspark.objects.Secret import Secret
113124
from lightspark.objects.SendPaymentInput import SendPaymentInput
114125
from lightspark.objects.SendPaymentOutput import SendPaymentOutput

0 commit comments

Comments
 (0)