mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-18 22:34:19 +01:00
Extract rust snippets and reference them
This commit is contained in:
14
snippets/rust/src/buy_btc.rs
Normal file
14
snippets/rust/src/buy_btc.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use anyhow::Result;
|
||||
use breez_sdk_core::*;
|
||||
|
||||
async fn buy(sdk: Arc<BreezServices>) -> Result<()> {
|
||||
let res = sdk.buy_bitcoin(
|
||||
BuyBitcoinRequest {
|
||||
provider: BuyBitcoinProvider::Moonpay,
|
||||
opening_fee_params: None})
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user