mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 22:04:21 +01:00
rename python_snippets folder to python
.
This commit is contained in:
34
snippets/python/README.md
Normal file
34
snippets/python/README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
## Steps to run locally
|
||||
1. Build a python package
|
||||
- By running the publish-all-platforms CI in the breez-sdk repository (use dummy binaries)
|
||||
- or by downloading from Pypi
|
||||
2. Download the wheel artifact for your platform. For linux that is `python-wheel-3.8-manylinux_2_31_x86_64`
|
||||
3. Unzip the artifact in the `snippets/python/packages` folder.
|
||||
4. Run `pip install packages/{NAME_OF_.WHL_FILE}`
|
||||
4. happy coding!
|
||||
|
||||
To check the syntax:
|
||||
|
||||
```bash
|
||||
cd snippets/python
|
||||
python3 -m compileall src
|
||||
```
|
||||
|
||||
To check the snippet formatting:
|
||||
|
||||
```bash
|
||||
cd snippets/python/src
|
||||
ruff --ignore F841 --ignore F401 --output-format=github .
|
||||
```
|
||||
|
||||
To execute the snippets locally, in order to check for type correctness:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
export API_KEY="..."
|
||||
export MNEMONIC="..."
|
||||
|
||||
cd snippets/python
|
||||
python main.py $API_KEY $MNEMONIC
|
||||
```
|
||||
@@ -1,27 +0,0 @@
|
||||
## Steps to run locally
|
||||
|
||||
To check the syntax:
|
||||
|
||||
```bash
|
||||
cd snippets/python_snippets
|
||||
python3 -m compileall src
|
||||
```
|
||||
|
||||
To check the snippet formatting:
|
||||
|
||||
```bash
|
||||
cd snippets/python_snippets/src
|
||||
ruff --ignore F841 --ignore F401 --output-format=github .
|
||||
```
|
||||
|
||||
To execute the snippets locally, in order to check for type correctness:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
export API_KEY="..."
|
||||
export MNEMONIC="..."
|
||||
|
||||
cd snippets/python_snippets
|
||||
python main.py $API_KEY $MNEMONIC
|
||||
```
|
||||
@@ -66,7 +66,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/buy_btc.py:buy-btc}}
|
||||
{{#include ../../snippets/python/src/buy_btc.py:buy-btc}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/connecting_lsp.py:get-lsp-info}}
|
||||
{{#include ../../snippets/python/src/connecting_lsp.py:get-lsp-info}}
|
||||
```
|
||||
</section>
|
||||
|
||||
@@ -137,7 +137,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/connecting_lsp.py:connect-lsp}}
|
||||
{{#include ../../snippets/python/src/connecting_lsp.py:connect-lsp}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/fiat_currencies.py:list-fiat-currencies}}
|
||||
{{#include ../../snippets/python/src/fiat_currencies.py:list-fiat-currencies}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/getting_started.py:init-sdk}}
|
||||
{{#include ../../snippets/python/src/getting_started.py:init-sdk}}
|
||||
```
|
||||
</section>
|
||||
|
||||
@@ -214,7 +214,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/getting_started.py:fetch-balance}}
|
||||
{{#include ../../snippets/python/src/getting_started.py:fetch-balance}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/list_payments.py:list-payments}}
|
||||
{{#include ../../snippets/python/src/list_payments.py:list-payments}}
|
||||
```
|
||||
</section>
|
||||
|
||||
@@ -137,7 +137,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/list_payments.py:list-payments-filtered}}
|
||||
{{#include ../../snippets/python/src/list_payments.py:list-payments-filtered}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/lnurl_auth.py:lnurl-auth}}
|
||||
{{#include ../../snippets/python/src/lnurl_auth.py:lnurl-auth}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/lnurl_pay.py:lnurl-pay}}
|
||||
{{#include ../../snippets/python/src/lnurl_pay.py:lnurl-pay}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/lnurl_withdraw.py:lnurl-withdraw}}
|
||||
{{#include ../../snippets/python/src/lnurl_withdraw.py:lnurl-withdraw}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/receive_onchain.py:generate-receive-onchain-address}}
|
||||
{{#include ../../snippets/python/src/receive_onchain.py:generate-receive-onchain-address}}
|
||||
```
|
||||
</section>
|
||||
|
||||
@@ -139,7 +139,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/receive_onchain.py:in-progress-swap}}
|
||||
{{#include ../../snippets/python/src/receive_onchain.py:in-progress-swap}}
|
||||
```
|
||||
</section>
|
||||
|
||||
@@ -221,7 +221,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/receive_onchain.py:list-refundables}}
|
||||
{{#include ../../snippets/python/src/receive_onchain.py:list-refundables}}
|
||||
```
|
||||
</section>
|
||||
|
||||
@@ -306,7 +306,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/receive_onchain.py:execute-refund}}
|
||||
{{#include ../../snippets/python/src/receive_onchain.py:execute-refund}}
|
||||
```
|
||||
</section>
|
||||
|
||||
@@ -384,7 +384,7 @@ do {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/receive_onchain.py:get-channel-opening-fees}}
|
||||
{{#include ../../snippets/python/src/receive_onchain.py:get-channel-opening-fees}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/receive_payment.py:receive-payment}}
|
||||
{{#include ../../snippets/python/src/receive_payment.py:receive-payment}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/send_onchain.py:estimate-current-reverse-swap-total-fees}}
|
||||
{{#include ../../snippets/python/src/send_onchain.py:estimate-current-reverse-swap-total-fees}}
|
||||
```
|
||||
</section>
|
||||
|
||||
@@ -135,7 +135,7 @@ Log.v("Breez", "Maximum amount, in sats: ${fees.max}")
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/send_onchain.py:get-current-reverse-swap-min-max}}
|
||||
{{#include ../../snippets/python/src/send_onchain.py:get-current-reverse-swap-min-max}}
|
||||
```
|
||||
</section>
|
||||
|
||||
@@ -221,7 +221,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/send_onchain.py:start-reverse-swap}}
|
||||
{{#include ../../snippets/python/src/send_onchain.py:start-reverse-swap}}
|
||||
```
|
||||
</section>
|
||||
|
||||
@@ -297,7 +297,7 @@ for (rs in sdk.inProgressReverseSwaps()) {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/send_onchain.py:check-reverse-swaps-status}}
|
||||
{{#include ../../snippets/python/src/send_onchain.py:check-reverse-swaps-status}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/send_spontaneous_payment.py:send-spontaneous-payment}}
|
||||
{{#include ../../snippets/python/src/send_spontaneous_payment.py:send-spontaneous-payment}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ try {
|
||||
<section>
|
||||
|
||||
```python,ignore
|
||||
{{#include ../../snippets/python_snippets/src/static_channel_backup.py:static-channel-backup}}
|
||||
{{#include ../../snippets/python/src/static_channel_backup.py:static-channel-backup}}
|
||||
```
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user