mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
Add Go snippets
This commit is contained in:
committed by
Erdem Yerebasmaz
parent
f65bcc1653
commit
dc64895b65
19
snippets/go/send_spontaneous_payment.go
Normal file
19
snippets/go/send_spontaneous_payment.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/breez/breez-sdk-go/breez_sdk"
|
||||
)
|
||||
|
||||
func SendSpontaneousPayment() {
|
||||
// ANCHOR: send-spontaneous-payment
|
||||
sendSpontaneousPaymentRequest := breez_sdk.SendSpontaneousPaymentRequest{
|
||||
NodeId: "...",
|
||||
AmountMsat: uint64(3_000_000),
|
||||
}
|
||||
if response, err := sdk.SendSpontaneousPayment(sendSpontaneousPaymentRequest); err == nil {
|
||||
log.Printf("%#v", response)
|
||||
}
|
||||
// ANCHOR_END: send-spontaneous-payment
|
||||
}
|
||||
Reference in New Issue
Block a user