Skip to content

Commit 1f8d459

Browse files
Lightspark Engjklein24
Lightspark Eng
authored andcommitted
Project import generated by Copybara.
GitOrigin-RevId: e8d85a7e954c559aaa0240a9380e78e18c4889b6
0 parents  commit 1f8d459

File tree

116 files changed

+12487
-0
lines changed

Some content is hidden

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

116 files changed

+12487
-0
lines changed

.fossa.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 3
2+
3+
project:
4+
id: lightspark/python-sdk
5+
name: python-sdk
6+
url: https://github.com/lightsparkdev/webdev

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*~
2+
.pyre/
3+
lightspark.egg-info/
4+
dist/
5+
build/

.pylintrc

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[MASTER]
2+
persistent=no
3+
4+
[MESSAGES]
5+
6+
# Enforce minimal documentation. Probably nice to fix.
7+
# C0114: missing-module-docstring
8+
# C0115: missing-class-docstring
9+
# C0116: missing-function-docstring
10+
11+
# Formatting nitpicks
12+
# C0301: line-too-long
13+
# C0302: too-many-lines
14+
15+
# These feel a bit pedantic
16+
# R0801: duplicate-code
17+
# R0902: too-many-instance-attributes
18+
# R0903: too-few-public-methods
19+
# R0904: too-many-public-methods
20+
# R0913: too-many-arguments
21+
# R0914: too-many-locals
22+
# R0915: too-many-statements
23+
# C0103: invalid-name
24+
# C0104: disallowed-name
25+
26+
disable=C0103,C0104,C0301,C0302,C0114,C0115,C0116,C0301,R0801,R0902,R0903,R0904,R0913,R0914,R0915
27+
28+
[MISCELLANEOUS]
29+
30+
# List of note tags that will trigger W0511.
31+
# default: FIXME,XXX,TODO
32+
notes=DONTCHECKIN

.pyre_configuration

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"site_package_search_strategy": "pep561",
3+
"source_directories": [
4+
"."
5+
]
6+
}

.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

CHANGELOG.md

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Changelog
2+
3+
# v0.9.0
4+
5+
Early beta preview of what will be our 1.0.0 release API. This is a major breaking change from the previous version of the SDK with a cleaner API surface and some nice new feature improvements from early feedback.
6+
7+
# v0.5.1
8+
9+
## New Features:
10+
11+
- Added a `commit_fee` field to the channel object to get the amount to be paid in fees for the current set of commitment transactions.
12+
13+
# v0.5.0
14+
15+
Several breaking changes and improvements to the SDK to make it more robust and easier to use.
16+
17+
## Breaking Changes:
18+
19+
- `Edge` objects' entites have been collapsed into `Connection` objects to remove the need for the client to manaually pull out entities from the `edges` field.
20+
21+
**Before:**
22+
23+
```python
24+
for edge in account.get_transactions().edges:
25+
print(edge.entity.amount)
26+
```
27+
28+
**After:**
29+
30+
```python
31+
for transaction in account.get_transactions().entities:
32+
print(transaction.amount)
33+
```
34+
35+
- Removed several queries and types which are not needed in the 3P SDK and shouldn't have been exposed. If you were using any of these, please let us know!
36+
37+
## New Features:
38+
39+
- `LightsparkClient.fund_node` to automatically add fake funds to a REGTEST node.
40+
- `LightsparkClient.create_api_token` and `LightsparkClient.delete_api_token` to create and delete API tokens.
41+
- `LightsparkClient.send_payment` to send a keysend payment using a destination node's public key which doesn't require an invoice at all.
42+
43+
## Notable fixes:
44+
45+
- Adding a `__FUTURE_VALUE__` value to all enum classes. This allows the SDK to be forward-compatible with new values that may be added to the API in the future, rather than crashing.
46+
47+
# v0.4.3
48+
49+
- Fix instantiation of enums (they were instantiated as `str` objects)
50+
- Return concrete entities instead of interfaces. This fixes the fact that `Account.get_transactions` did not return all the transactions details.
51+
- Spread fragments on GraphQL interfaces to enable fetching the details of each entity.
52+
- Conditional JSON loaders to instantiate the right concrete object.
53+
- Add `__init__.py` files for better module support.
54+
- Add `setup.py` for PIP repository support.
55+
56+
# v0.4.2
57+
58+
- Adds a way to paginate transactions (and other connections) using `after`.
59+
- Updates the SDK to match the latest API version (some fields were added, no breaking change)
60+
61+
# v0.4.1
62+
63+
- Fix 2 bugs around `datetime` serialization:
64+
- Add the serialization to the JSON encoder
65+
- Make sure the `datetime` objects are timezone aware
66+
67+
# v0.4.0
68+
69+
- Fields that take arguments are now fetched lazily and expose a function for the client to specify the arguments. Impacts the following fields:
70+
- `Account.blockchain_balance`
71+
- `Account.conductivity`
72+
- `Account.local_balance`
73+
- `Account.remote_balance`
74+
- `Account.uptime_percentage`
75+
- `Channel.uptime_percentage`
76+
77+
```python
78+
# Old way to query (example)
79+
account.blockchain_balance
80+
81+
# New way to query (examples)
82+
account.get_blockchain_balance()
83+
account.get_blockchain_balance(bitcoin_networks=[lightspark.BitcoinNetwork.REGTEST])
84+
```
85+
86+
# v0.3.0
87+
88+
- Eagerly fetch `InvoiceData.destination`
89+
90+
# v0.2.0
91+
92+
SDK and APIs completely refactored. Consider this a new version
93+
94+
# v0.1.0
95+
96+
First draft of the SDK.

Pipfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
cryptography = "*"
8+
requests = "*"
9+
10+
[dev-packages]
11+
black = "*"
12+
flask = "*"
13+
importlib_metadata = "*"
14+
isort = "==5.11.4"
15+
pylint = "*"
16+
pyre-check = "*"
17+
pytest = "*"
18+
typed-ast = "*"
19+
unidiff = "*"

0 commit comments

Comments
 (0)