diff --git a/README.md b/README.md index adaadd7..e6b03d4 100644 --- a/README.md +++ b/README.md @@ -14,5 +14,5 @@ To locally serve the docs run: ```bash cargo install mdbook mdbook build -mdbook serve +mdbook serve --open ``` diff --git a/src/README.md b/src/README.md deleted file mode 100644 index e10b99d..0000000 --- a/src/README.md +++ /dev/null @@ -1 +0,0 @@ -# Introduction diff --git a/src/guide/getting_started.md b/src/guide/getting_started.md index 2310506..a884c28 100644 --- a/src/guide/getting_started.md +++ b/src/guide/getting_started.md @@ -20,15 +20,19 @@ Breez SDK is available in several platforms. Follow the [Installing](install.md)
## Connecting -```rust,no_run +```rust,ignore +let mnemonic = Mnemonic::generate_in(Language::English, 12)?; +let seed = mnemonic.to_seed(""); +let invite_code = Some("...".into()); + // Create the default config -let config = BreezServices::default_config( +let mut config = BreezServices::default_config( EnvironmentType::Production, "your API key".into(), breez_sdk_core::NodeConfig::Greenlight { config: GreenlightNodeConfig { partner_credentials: None, - invite_code: None, + invite_code }, }, ); @@ -47,7 +51,7 @@ let sdk = BreezServices::connect( At any point we can fetch our balance from the Greenlight node: -```rust,no_run +```rust,ignore if let Some(node_state) = sdk.node_info()? { let balance_ln = node_state.channels_balance_msat; let balance_onchain = node_state.onchain_balance_msat; diff --git a/src/guide/lnurl_auth.md b/src/guide/lnurl_auth.md index 18afa74..4d5defb 100644 --- a/src/guide/lnurl_auth.md +++ b/src/guide/lnurl_auth.md @@ -5,7 +5,7 @@
Rust
-```rust,no_run +```rust,ignore // Endpoint can also be of the form: // keyauth://domain.com/auth?key=val let lnurl_auth_url = "lnurl1dp68gurn8ghj7mr0vdskc6r0wd6z7mrww4excttvdankjm3lw3skw0tvdankjm3xdvcn6vtp8q6n2dfsx5mrjwtrxdjnqvtzv56rzcnyv3jrxv3sxqmkyenrvv6kve3exv6nqdtyv43nqcmzvdsnvdrzx33rsenxx5unqc3cxgeqgntfgu"; diff --git a/src/guide/lnurl_pay.md b/src/guide/lnurl_pay.md index 21e2b39..b7242da 100644 --- a/src/guide/lnurl_pay.md +++ b/src/guide/lnurl_pay.md @@ -6,7 +6,7 @@
Rust
-```rust,no_run +```rust,ignore // Endpoint can also be of the form: // lnurlp://domain.com/lnurl-pay?key=val // lnurl1dp68gurn8ghj7mr0vdskc6r0wd6z7mrww4excttsv9un7um9wdekjmmw84jxywf5x43rvv35xgmr2enrxanr2cfcvsmnwe3jxcukvde48qukgdec89snwde3vfjxvepjxpjnjvtpxd3kvdnxx5crxwpjvyunsephsz36jf @@ -145,7 +145,7 @@ catch (Exception) } ```
- + ## Supported Specs - [LUD-01](https://github.com/lnurl/luds/blob/luds/01.md) LNURL bech32 encoding diff --git a/src/guide/lnurl_withdraw.md b/src/guide/lnurl_withdraw.md index dc186bd..d33d9c2 100644 --- a/src/guide/lnurl_withdraw.md +++ b/src/guide/lnurl_withdraw.md @@ -7,7 +7,7 @@
Rust
-```rust,no_run +```rust,ignore // Endpoint can also be of the form: // lnurlw://domain.com/lnurl-withdraw?key=val let lnurl_withdraw_url = "lnurl1dp68gurn8ghj7mr0vdskc6r0wd6z7mrww4exctthd96xserjv9mn7um9wdekjmmw843xxwpexdnxzen9vgunsvfexq6rvdecx93rgdmyxcuxverrvcursenpxvukzv3c8qunsdecx33nzwpnvg6ryc3hv93nzvecxgcxgwp3h33lxk"; @@ -143,7 +143,7 @@ catch (Exception) } ```
- + ## Supported Specs diff --git a/src/guide/payments.md b/src/guide/payments.md index 1c8c137..03beca0 100644 --- a/src/guide/payments.md +++ b/src/guide/payments.md @@ -8,18 +8,18 @@ Breez SDK doesn't require you to open a channel and set up your inbound liquidity. Breez SDK automatically connects your node to the LSP peer and you can now receive payments: -```rust,no_run +```rust,ignore let invoice = sdk.receive_payment(3000, "Invoice for 3000 sats".into()).await?; ``` ## Sending Lightning Payments -```rust,no_run +```rust,ignore let bolt11 = "..."; sdk.send_payment(bolt11.into(), Some(3000)).await?; ``` ## Sending Spontaneous Lightning Payments -```rust,no_run +```rust,ignore let node_id = "..."; sdk.send_payment(node_id.into(), Some(3000)).await?; ``` diff --git a/src/guide/send_onchain.md b/src/guide/send_onchain.md index dd76d84..cac5cd4 100644 --- a/src/guide/send_onchain.md +++ b/src/guide/send_onchain.md @@ -8,7 +8,7 @@ First, fetch the current reverse swap fees:
Rust
-```rust,no_run +```rust,ignore let current_fees = sdk.fetch_reverse_swap_fees().await?; info!("Percentage fee for the reverse swap service: {}", current_fees.fees_percentage); @@ -22,14 +22,14 @@ of the total costs. Fetching the fees also tells you what is the range of amounts you can send: -```rust,no_run +```rust,ignore info!("Minimum amount, in sats: {}", current_fees.min); info!("Maximum amount, in sats: {}", current_fees.max); ``` Once you checked the fees are acceptable, you can start the reverse swap: -```rust,no_run +```rust,ignore let destination_address = String::from("bc1.."); let amount_sat = current_fees.min; @@ -42,7 +42,7 @@ is either settled or cancelled. This will happen automatically at the end of the You can check its status with: -```rust,no_run +```rust,ignore for rs in sdk.in_progress_reverse_swaps().await? { info!("Reverse swap {} in progress, status is {}", rs.id, rs.status); }