From 1caf35a80223e9f14330699c5b1627289f465c5a Mon Sep 17 00:00:00 2001 From: ok300 <106775972+ok300@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:52:13 +0200 Subject: [PATCH] Use snippet anchor instead of line range --- snippets/rust/src/buy_btc.rs | 2 ++ snippets/rust/src/connecting_lsp.rs | 4 ++++ snippets/rust/src/fiat_currencies.rs | 6 ++++++ snippets/rust/src/getting_started.rs | 4 ++++ snippets/rust/src/list_payments.rs | 4 ++++ snippets/rust/src/lnurl_auth.rs | 2 ++ snippets/rust/src/lnurl_pay.rs | 2 ++ snippets/rust/src/lnurl_withdraw.rs | 2 ++ snippets/rust/src/receive_onchain.rs | 10 ++++++++++ snippets/rust/src/receive_payment.rs | 2 ++ snippets/rust/src/send_onchain.rs | 10 +++++++++- snippets/rust/src/send_payment.rs | 2 ++ snippets/rust/src/send_spontaneous_payment.rs | 2 ++ snippets/rust/src/static_channel_backup.rs | 2 ++ src/guide/buy_btc.md | 2 +- src/guide/connecting_lsp.md | 4 ++-- src/guide/fiat_currencies.md | 6 +++--- src/guide/getting_started.md | 4 ++-- src/guide/list_payments.md | 4 ++-- src/guide/lnurl_auth.md | 2 +- src/guide/lnurl_pay.md | 2 +- src/guide/lnurl_withdraw.md | 2 +- src/guide/receive_onchain.md | 10 +++++----- src/guide/receive_payment.md | 4 ++-- src/guide/send_onchain.md | 8 ++++---- src/guide/send_payment.md | 2 +- src/guide/send_spontaneous_payment.md | 2 +- src/guide/static_channel_backup.md | 2 +- 28 files changed, 80 insertions(+), 28 deletions(-) diff --git a/snippets/rust/src/buy_btc.rs b/snippets/rust/src/buy_btc.rs index 817fa98..e8365ca 100644 --- a/snippets/rust/src/buy_btc.rs +++ b/snippets/rust/src/buy_btc.rs @@ -4,11 +4,13 @@ use anyhow::Result; use breez_sdk_core::*; async fn buy(sdk: Arc) -> Result<()> { + // ANCHOR: buy-btc let res = sdk.buy_bitcoin( BuyBitcoinRequest { provider: BuyBitcoinProvider::Moonpay, opening_fee_params: None}) .await?; + // ANCHOR_END: buy-btc Ok(()) } diff --git a/snippets/rust/src/connecting_lsp.rs b/snippets/rust/src/connecting_lsp.rs index 0b44305..ccb5ee5 100644 --- a/snippets/rust/src/connecting_lsp.rs +++ b/snippets/rust/src/connecting_lsp.rs @@ -4,14 +4,18 @@ use anyhow::Result; use breez_sdk_core::*; async fn get_lsp_info(sdk: Arc) -> Result { + // ANCHOR: get-lsp-info let lsp_id = sdk.lsp_id().await?; let lsp_info = sdk.lsp_info().await?; + // ANCHOR_END: get-lsp-info Ok(lsp_info) } async fn connect_lsp(sdk: Arc, lsp_id: String) -> Result<()> { + // ANCHOR: connect-lsp sdk.connect_lsp(lsp_id).await?; + // ANCHOR_END: connect-lsp Ok(()) } \ No newline at end of file diff --git a/snippets/rust/src/fiat_currencies.rs b/snippets/rust/src/fiat_currencies.rs index 421c13e..4d836c4 100644 --- a/snippets/rust/src/fiat_currencies.rs +++ b/snippets/rust/src/fiat_currencies.rs @@ -5,18 +5,23 @@ use anyhow::Result; use breez_sdk_core::*; async fn list_supported_fiat_currencies(sdk: Arc) -> Result<()> { + // ANCHOR: list-fiat-currencies let supported_fiat_currencies = sdk.list_fiat_currencies().await?; + // ANCHOR_END: list-fiat-currencies Ok(()) } async fn get_current_rates(sdk: Arc) -> Result<()> { + // ANCHOR: fetch-fiat-rates let fiat_rates = sdk.fetch_fiat_rates().await?; + // ANCHOR_END: fetch-fiat-rates Ok(()) } async fn get_fiat_currencies_and_rates(sdk: Arc) -> Result> { + // ANCHOR: get-fiat-currencies-and-rates let supported_fiat_currencies = sdk.list_fiat_currencies().await?; let fiat_rates = sdk.fetch_fiat_rates().await?; @@ -37,4 +42,5 @@ async fn get_fiat_currencies_and_rates(sdk: Arc) -> Result Result> { + // ANCHOR: init-sdk let mnemonic = Mnemonic::generate_in(Language::English, 12)?; let seed = mnemonic.to_seed(""); let invite_code = Some("".into()); @@ -33,15 +34,18 @@ async fn getting_started() -> Result> { Box::new(AppEventListener {}), ) .await?; + // ANCHOR_END: init-sdk Ok(sdk) } async fn getting_started_node_info(sdk: Arc) -> Result<()> { + // ANCHOR: fetch-balance if let Some(node_state) = sdk.node_info()? { let balance_ln = node_state.channels_balance_msat; let balance_onchain = node_state.onchain_balance_msat; } + // ANCHOR_END: fetch-balance Ok(()) } \ No newline at end of file diff --git a/snippets/rust/src/list_payments.rs b/snippets/rust/src/list_payments.rs index 33e8d0f..582f12d 100644 --- a/snippets/rust/src/list_payments.rs +++ b/snippets/rust/src/list_payments.rs @@ -4,6 +4,7 @@ use anyhow::Result; use breez_sdk_core::*; async fn list_payments(sdk: Arc) -> Result> { + // ANCHOR: list-payments let payments = sdk.list_payments( ListPaymentRequest { filter: PaymentTypeFilter::All, @@ -12,11 +13,13 @@ async fn list_payments(sdk: Arc) -> Result> { include_failures: None, } ).await?; + // ANCHOR_END: list-payments Ok(payments) } async fn list_payments_filtered(sdk: Arc) -> Result> { + // ANCHOR: list-payments-filtered let payments = sdk.list_payments( ListPaymentRequest { filter: PaymentTypeFilter::Sent, @@ -25,6 +28,7 @@ async fn list_payments_filtered(sdk: Arc) -> Result> include_failures: true, } ).await?; + // ANCHOR_END: list-payments-filtered Ok(payments) } \ No newline at end of file diff --git a/snippets/rust/src/lnurl_auth.rs b/snippets/rust/src/lnurl_auth.rs index 6d25277..2f93fcb 100644 --- a/snippets/rust/src/lnurl_auth.rs +++ b/snippets/rust/src/lnurl_auth.rs @@ -6,6 +6,7 @@ use breez_sdk_core::InputType::LnUrlAuth; use log::{error, info}; async fn auth(sdk: Arc) -> Result<()> { + // ANCHOR: lnurl-auth // Endpoint can also be of the form: // keyauth://domain.com/auth?key=val let lnurl_auth_url = "lnurl1dp68gurn8ghj7mr0vdskc6r0wd6z7mrww4excttvdankjm3lw3skw0tvdankjm3xdvcn6vtp8q6n2dfsx5mrjwtrxdjnqvtzv56rzcnyv3jrxv3sxqmkyenrvv6kve3exv6nqdtyv43nqcmzvdsnvdrzx33rsenxx5unqc3cxgeqgntfgu"; @@ -23,6 +24,7 @@ async fn auth(sdk: Arc) -> Result<()> { } } } + // ANCHOR_END: lnurl-auth Ok(()) } diff --git a/snippets/rust/src/lnurl_pay.rs b/snippets/rust/src/lnurl_pay.rs index abcd87e..62e4d07 100644 --- a/snippets/rust/src/lnurl_pay.rs +++ b/snippets/rust/src/lnurl_pay.rs @@ -5,6 +5,7 @@ use breez_sdk_core::*; use breez_sdk_core::InputType::LnUrlPay; async fn pay(sdk: Arc) -> Result<()> { + // ANCHOR: lnurl-pay // Endpoint can also be of the form: // lnurlp://domain.com/lnurl-pay?key=val // lnurl1dp68gurn8ghj7mr0vdskc6r0wd6z7mrww4excttsv9un7um9wdekjmmw84jxywf5x43rvv35xgmr2enrxanr2cfcvsmnwe3jxcukvde48qukgdec89snwde3vfjxvepjxpjnjvtpxd3kvdnxx5crxwpjvyunsephsz36jf @@ -17,6 +18,7 @@ async fn pay(sdk: Arc) -> Result<()> { sdk.lnurl_pay(amount_msat, Some(comment), pd).await?; } + // ANCHOR_END: lnurl-pay Ok(()) } diff --git a/snippets/rust/src/lnurl_withdraw.rs b/snippets/rust/src/lnurl_withdraw.rs index 0f3d338..0cfeac3 100644 --- a/snippets/rust/src/lnurl_withdraw.rs +++ b/snippets/rust/src/lnurl_withdraw.rs @@ -4,6 +4,7 @@ use anyhow::Result; use breez_sdk_core::*; async fn withdraw(sdk: Arc) -> Result<()> { + // ANCHOR: lnurl-withdraw // Endpoint can also be of the form: // lnurlw://domain.com/lnurl-withdraw?key=val let lnurl_withdraw_url = "lnurl1dp68gurn8ghj7mr0vdskc6r0wd6z7mrww4exctthd96xserjv9mn7um9wdekjmmw843xxwpexdnxzen9vgunsvfexq6rvdecx93rgdmyxcuxverrvcursenpxvukzv3c8qunsdecx33nzwpnvg6ryc3hv93nzvecxgcxgwp3h33lxk"; @@ -14,6 +15,7 @@ async fn withdraw(sdk: Arc) -> Result<()> { sdk.lnurl_withdraw(wd, amount_msat, Some(description)).await?; } + // ANCHOR_END: lnurl-withdraw Ok(()) } diff --git a/snippets/rust/src/receive_onchain.rs b/snippets/rust/src/receive_onchain.rs index 5edd753..4567638 100644 --- a/snippets/rust/src/receive_onchain.rs +++ b/snippets/rust/src/receive_onchain.rs @@ -4,40 +4,50 @@ use anyhow::Result; use breez_sdk_core::*; async fn generate_receive_onchain_address(sdk: Arc) -> Result<()> { + // ANCHOR: generate-receive-onchain-address let swap_info = sdk.receive_onchain( ReceiveOnchainRequest { opening_fee_params: None } ) .await?; // Send your funds to the below bitcoin address let address = swap_info.bitcoin_address; + // ANCHOR_END: generate-receive-onchain-address Ok(()) } async fn get_in_progress_swap(sdk: Arc) -> Result<()> { + // ANCHOR: in-progress-swap let swap_info = sdk.in_progress_swap().await?; + // ANCHOR_END: in-progress-swap Ok(()) } async fn list_refundables(sdk: Arc) -> Result<()> { + // ANCHOR: list-refundables let refundables = sdk.list_refundables().await?; + // ANCHOR_END: list-refundables Ok(()) } async fn execute_refund(sdk: Arc, refund_tx_fee_rate: u32, refundable: SwapInfo) -> Result<()> { + // ANCHOR: execute-refund let destination_address = "...".into(); let sat_per_vbyte = refund_tx_fee_rate; sdk.refund(refundable.bitcoin_address, destination_address, sat_per_vbyte).await?; + // ANCHOR_END: execute-refund Ok(()) } async fn get_channel_opening_fees(sdk: Arc, amount_msat: u64) -> Result<()> { + // ANCHOR: get-channel-opening-fees let channel_fees = sdk.open_channel_fee( OpenChannelFeeRequest { amount_msat, expiry: None }) .await?; + // ANCHOR_END: get-channel-opening-fees Ok(()) } \ No newline at end of file diff --git a/snippets/rust/src/receive_payment.rs b/snippets/rust/src/receive_payment.rs index e595179..12149a4 100644 --- a/snippets/rust/src/receive_payment.rs +++ b/snippets/rust/src/receive_payment.rs @@ -4,6 +4,7 @@ use anyhow::Result; use breez_sdk_core::*; async fn receive_payment(sdk: Arc) -> Result<()> { + // ANCHOR: receive-payment let res = sdk.receive_payment( ReceivePaymentRequest { amount_sats: 3000, @@ -15,6 +16,7 @@ async fn receive_payment(sdk: Arc) -> Result<()> { use_description_hash: None }) .await?; + // ANCHOR_END: receive-payment Ok(()) } \ No newline at end of file diff --git a/snippets/rust/src/send_onchain.rs b/snippets/rust/src/send_onchain.rs index 07d4eb4..2513c8a 100644 --- a/snippets/rust/src/send_onchain.rs +++ b/snippets/rust/src/send_onchain.rs @@ -5,28 +5,34 @@ use breez_sdk_core::*; use log::info; async fn get_current_fees(sdk: Arc) -> Result<()> { + // ANCHOR: estimate-current-reverse-swap-total-fees let current_fees = sdk.fetch_reverse_swap_fees( ReverseSwapFeesRequest { - send_amount_sat: Some(50000), + send_amount_sat: Some(50_000), }) .await?; info!("Total estimated fees for reverse swap: {:?}", current_fees.total_estimated_fees); + // ANCHOR_END: estimate-current-reverse-swap-total-fees Ok(()) } async fn list_current_fees(sdk: Arc, current_fees: ReverseSwapPairInfo) -> Result<()> { + // ANCHOR: get-current-reverse-swap-min-max info!("Minimum amount, in sats: {}", current_fees.min); info!("Maximum amount, in sats: {}", current_fees.max); + // ANCHOR_END: get-current-reverse-swap-min-max Ok(()) } async fn start_reverse_swap(sdk: Arc, current_fees: ReverseSwapPairInfo, fee_rate: u64) -> Result<()> { + // ANCHOR: start-reverse-swap let destination_address = String::from("bc1.."); let amount_sat = current_fees.min; let satPerVbyte = fee_rate; + // ANCHOR_END: start-reverse-swap sdk.send_onchain(amount_sat, destination_address, current_fees.fees_hash, satPerVbyte).await?; @@ -34,9 +40,11 @@ async fn start_reverse_swap(sdk: Arc, current_fees: ReverseSwapPa } async fn check_reverse_swap_status(sdk: Arc) -> Result<()> { + // ANCHOR: check-reverse-swaps-status for rs in sdk.in_progress_reverse_swaps().await? { info!("Reverse swap {} in progress, status is {:?}", rs.id, rs.status); } + // ANCHOR_END: check-reverse-swaps-status Ok(()) } \ No newline at end of file diff --git a/snippets/rust/src/send_payment.rs b/snippets/rust/src/send_payment.rs index 6e2939e..89844b3 100644 --- a/snippets/rust/src/send_payment.rs +++ b/snippets/rust/src/send_payment.rs @@ -4,8 +4,10 @@ use anyhow::Result; use breez_sdk_core::*; async fn send_payment(sdk: Arc) -> Result<()> { + // ANCHOR: send-payment let bolt11 = "..."; sdk.send_payment(bolt11.into(), None).await?; + // ANCHOR_END: send-payment Ok(()) } \ No newline at end of file diff --git a/snippets/rust/src/send_spontaneous_payment.rs b/snippets/rust/src/send_spontaneous_payment.rs index 213150c..8c75e8f 100644 --- a/snippets/rust/src/send_spontaneous_payment.rs +++ b/snippets/rust/src/send_spontaneous_payment.rs @@ -4,8 +4,10 @@ use anyhow::Result; use breez_sdk_core::*; async fn send_spontaneous_payment(sdk: Arc) -> Result<()> { + // ANCHOR: send-spontaneous-payment let node_id = "..."; sdk.send_spontaneous_payment(node_id.into(), 3000).await?; + // ANCHOR_END: send-spontaneous-payment Ok(()) } \ No newline at end of file diff --git a/snippets/rust/src/static_channel_backup.rs b/snippets/rust/src/static_channel_backup.rs index 2624ee7..4a8644a 100644 --- a/snippets/rust/src/static_channel_backup.rs +++ b/snippets/rust/src/static_channel_backup.rs @@ -2,9 +2,11 @@ use anyhow::Result; use breez_sdk_core::*; async fn retrieve_backup_files() -> Result<()> { + // ANCHOR: static-channel-backup let backup_data = BreezServices::static_backup(StaticBackupRequest { working_dir: "".into(), })?; + // ANCHOR_END: static-channel-backup Ok(()) } diff --git a/src/guide/buy_btc.md b/src/guide/buy_btc.md index d512264..3d0a4df 100644 --- a/src/guide/buy_btc.md +++ b/src/guide/buy_btc.md @@ -12,7 +12,7 @@ Once the buy is completed, the provider will transfer the Bitcoin to the generat
```rust,ignore -{{#include ../../snippets/rust/src/buy_btc.rs:7:11}} +{{#include ../../snippets/rust/src/buy_btc.rs:buy-btc}} ```
diff --git a/src/guide/connecting_lsp.md b/src/guide/connecting_lsp.md index 04a9589..d58d2b6 100644 --- a/src/guide/connecting_lsp.md +++ b/src/guide/connecting_lsp.md @@ -7,7 +7,7 @@ Based on the API key provided to the Breez SDK, a default LSP is selected for yo
```rust,ignore -{{#include ../../snippets/rust/src/connecting_lsp.rs:7:8}} +{{#include ../../snippets/rust/src/connecting_lsp.rs:get-lsp-info}} ```
@@ -117,7 +117,7 @@ When you have selected an LSP you may then connect to it.
```rust,ignore -{{#include ../../snippets/rust/src/connecting_lsp.rs:14}} +{{#include ../../snippets/rust/src/connecting_lsp.rs:connect-lsp}} ```
diff --git a/src/guide/fiat_currencies.md b/src/guide/fiat_currencies.md index 88bd668..e8d7b61 100644 --- a/src/guide/fiat_currencies.md +++ b/src/guide/fiat_currencies.md @@ -7,7 +7,7 @@ In order to list the available fiat currencies:
```rust,ignore -{{#include ../../snippets/rust/src/fiat_currencies.rs:8}} +{{#include ../../snippets/rust/src/fiat_currencies.rs:list-fiat-currencies}} ```
@@ -92,7 +92,7 @@ To get the current BTC rate for the currencies:
```rust,ignore -{{#include ../../snippets/rust/src/fiat_currencies.rs:14}} +{{#include ../../snippets/rust/src/fiat_currencies.rs:fetch-fiat-rates}} ```
@@ -179,7 +179,7 @@ At the example project you can see these methods combined:
```rust,ignore -{{#include ../../snippets/rust/src/fiat_currencies.rs:20:39}} +{{#include ../../snippets/rust/src/fiat_currencies.rs:get-fiat-currencies-and-rates}} ```
diff --git a/src/guide/getting_started.md b/src/guide/getting_started.md index 185d641..cc8643c 100644 --- a/src/guide/getting_started.md +++ b/src/guide/getting_started.md @@ -38,7 +38,7 @@ Now your SDK is ready to be used.
```rust,ignore -{{#include ../../snippets/rust/src/getting_started.rs:9:35}} +{{#include ../../snippets/rust/src/getting_started.rs:init-sdk}} ```
@@ -296,7 +296,7 @@ At any point we can fetch our balance from the Greenlight node:
```rust,ignore -{{#include ../../snippets/rust/src/getting_started.rs:41:44}} +{{#include ../../snippets/rust/src/getting_started.rs:fetch-balance}} ```
diff --git a/src/guide/list_payments.md b/src/guide/list_payments.md index edf7b2f..7cc26a8 100644 --- a/src/guide/list_payments.md +++ b/src/guide/list_payments.md @@ -7,7 +7,7 @@ To view your payment history you can list and filter all the sent and received p
```rust,ignore -{{#include ../../snippets/rust/src/list_payments.rs:7:14}} +{{#include ../../snippets/rust/src/list_payments.rs:list-payments}} ```
@@ -105,7 +105,7 @@ You can optionally filter payments by timestamp and include failed payments.
```rust,ignore -{{#include ../../snippets/rust/src/list_payments.rs:20:27}} +{{#include ../../snippets/rust/src/list_payments.rs:list-payments-filtered}} ```
diff --git a/src/guide/lnurl_auth.md b/src/guide/lnurl_auth.md index f095287..8832151 100644 --- a/src/guide/lnurl_auth.md +++ b/src/guide/lnurl_auth.md @@ -6,7 +6,7 @@
```rust,ignore -{{#include ../../snippets/rust/src/lnurl_auth.rs:9:25}} +{{#include ../../snippets/rust/src/lnurl_auth.rs:lnurl-auth}} ```
diff --git a/src/guide/lnurl_pay.md b/src/guide/lnurl_pay.md index 12feee8..222efa9 100644 --- a/src/guide/lnurl_pay.md +++ b/src/guide/lnurl_pay.md @@ -7,7 +7,7 @@
```rust,ignore -{{#include ../../snippets/rust/src/lnurl_pay.rs:8:19}} +{{#include ../../snippets/rust/src/lnurl_pay.rs:lnurl-pay}} ```
diff --git a/src/guide/lnurl_withdraw.md b/src/guide/lnurl_withdraw.md index b017ecd..507fe8f 100644 --- a/src/guide/lnurl_withdraw.md +++ b/src/guide/lnurl_withdraw.md @@ -8,7 +8,7 @@
```rust,ignore -{{#include ../../snippets/rust/src/lnurl_withdraw.rs:7:17}} +{{#include ../../snippets/rust/src/lnurl_withdraw.rs:lnurl-withdraw}} ```
diff --git a/src/guide/receive_onchain.md b/src/guide/receive_onchain.md index 2aa3c0d..e78bb89 100644 --- a/src/guide/receive_onchain.md +++ b/src/guide/receive_onchain.md @@ -10,7 +10,7 @@ In order to receive funds you first have to be connected to an [LSP](connecting_
```rust,ignore -{{#include ../../snippets/rust/src/receive_onchain.rs:7:12}} +{{#include ../../snippets/rust/src/receive_onchain.rs:generate-receive-onchain-address}} ```
@@ -127,7 +127,7 @@ Once you've sent the funds to the above address, the SDK will monitor this addre
```rust,ignore -{{#include ../../snippets/rust/src/receive_onchain.rs:18}} +{{#include ../../snippets/rust/src/receive_onchain.rs:in-progress-swap}} ```
@@ -228,7 +228,7 @@ In order to execute a refund, you need to supply an on-chain address to where th
```rust,ignore -{{#include ../../snippets/rust/src/receive_onchain.rs:24}} +{{#include ../../snippets/rust/src/receive_onchain.rs:list-refundables}} ```
@@ -324,7 +324,7 @@ Once you have a refundable swap in hand, use the following code to execute a ref
```rust,ignore -{{#include ../../snippets/rust/src/receive_onchain.rs:30:32}} +{{#include ../../snippets/rust/src/receive_onchain.rs:execute-refund}} ```
@@ -453,7 +453,7 @@ To calculate the fees for a channel being opened by the LSP:
```rust,ignore -{{#include ../../snippets/rust/src/receive_onchain.rs:38:40}} +{{#include ../../snippets/rust/src/receive_onchain.rs:get-channel-opening-fees}} ```
diff --git a/src/guide/receive_payment.md b/src/guide/receive_payment.md index 4e6ccba..0f67c9c 100644 --- a/src/guide/receive_payment.md +++ b/src/guide/receive_payment.md @@ -1,6 +1,6 @@ # Receiving Lightning Payments -With the Breez SDK you arn't required to open a channel and set up your inbound liquidity. +With the Breez SDK you aren't required to open a channel and set up your inbound liquidity. The Breez SDK automatically connects your node to the LSP peer and you can now receive payments. @@ -8,7 +8,7 @@ The Breez SDK automatically connects your node to the LSP peer and you can now r
```rust,ignore -{{#include ../../snippets/rust/src/receive_payment.rs:7:17}} +{{#include ../../snippets/rust/src/receive_payment.rs:receive-payment}} ```
diff --git a/src/guide/send_onchain.md b/src/guide/send_onchain.md index d341328..fa92443 100644 --- a/src/guide/send_onchain.md +++ b/src/guide/send_onchain.md @@ -9,7 +9,7 @@ First, fetch the current reverse swap fees:
```rust,ignore -{{#include ../../snippets/rust/src/send_onchain.rs:8:14}} +{{#include ../../snippets/rust/src/send_onchain.rs:estimate-current-reverse-swap-total-fees}} ```
@@ -129,7 +129,7 @@ Fetching the fees also tells you what is the range of amounts you can send:
```rust,ignore -{{#include ../../snippets/rust/src/send_onchain.rs:20:21}} +{{#include ../../snippets/rust/src/send_onchain.rs:get-current-reverse-swap-min-max}} ```
@@ -204,7 +204,7 @@ Once you checked the fees are acceptable, you can start the reverse swap:
```rust,ignore -{{#include ../../snippets/rust/src/send_onchain.rs:27:31}} +{{#include ../../snippets/rust/src/send_onchain.rs:start-reverse-swap}} ```
@@ -341,7 +341,7 @@ You can check its status with:
```rust,ignore -{{#include ../../snippets/rust/src/send_onchain.rs:37:40}} +{{#include ../../snippets/rust/src/send_onchain.rs:check-reverse-swaps-status}} ```
diff --git a/src/guide/send_payment.md b/src/guide/send_payment.md index 49134d7..e9720b9 100644 --- a/src/guide/send_payment.md +++ b/src/guide/send_payment.md @@ -7,7 +7,7 @@ Once you have outbound liquidity you can start sending payments too.
```rust,ignore -{{#include ../../snippets/rust/src/send_payment.rs:7:8}} +{{#include ../../snippets/rust/src/send_payment.rs:send-payment}} ```
diff --git a/src/guide/send_spontaneous_payment.md b/src/guide/send_spontaneous_payment.md index b33e445..000bffd 100644 --- a/src/guide/send_spontaneous_payment.md +++ b/src/guide/send_spontaneous_payment.md @@ -7,7 +7,7 @@ They can even be spontaneous payments to a node without a bolt11 invoice.
```rust,ignore -{{#include ../../snippets/rust/src/send_spontaneous_payment.rs:7:8}} +{{#include ../../snippets/rust/src/send_spontaneous_payment.rs:send-spontaneous-payment}} ```
diff --git a/src/guide/static_channel_backup.md b/src/guide/static_channel_backup.md index 450523a..0d65ed2 100644 --- a/src/guide/static_channel_backup.md +++ b/src/guide/static_channel_backup.md @@ -12,7 +12,7 @@ In order to use the recoverchannel method, the user needs to provide the static
```rust,ignore -{{#include ../../snippets/rust/src/static_channel_backup.rs:5:7}} +{{#include ../../snippets/rust/src/static_channel_backup.rs:static-channel-backup}} ```