mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 22:04:21 +01:00
Add Go snippets
This commit is contained in:
committed by
Erdem Yerebasmaz
parent
f65bcc1653
commit
dc64895b65
18
snippets/go/buy_btc.go
Normal file
18
snippets/go/buy_btc.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/breez/breez-sdk-go/breez_sdk"
|
||||
)
|
||||
|
||||
func BuyBitcoin() {
|
||||
// ANCHOR: buy-btc
|
||||
buyBitcoinRequest := breez_sdk.BuyBitcoinRequest{
|
||||
Provider: breez_sdk.BuyBitcoinProviderMoonpay,
|
||||
}
|
||||
if buyBitcoinResponse, err := sdk.BuyBitcoin(buyBitcoinRequest); err == nil {
|
||||
log.Printf("%#v", buyBitcoinResponse)
|
||||
}
|
||||
// ANCHOR_END: buy-btc
|
||||
}
|
||||
Reference in New Issue
Block a user