mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 22:04:21 +01:00
32 lines
786 B
Go
32 lines
786 B
Go
package example
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/breez/breez-sdk-go/breez_sdk"
|
|
)
|
|
|
|
func ListPayments() {
|
|
// ANCHOR: list-payments
|
|
if payments, err := sdk.ListPayments(breez_sdk.ListPaymentsRequest{}); err == nil {
|
|
log.Printf("%#v", payments)
|
|
}
|
|
// ANCHOR_END: list-payments
|
|
}
|
|
|
|
func ListPaymentsFiltered() {
|
|
// ANCHOR: list-payments-filtered
|
|
filters := []breez_sdk.PaymentTypeFilter{breez_sdk.PaymentTypeFilterSent}
|
|
fromTimestamp := int64(1696880000)
|
|
includeFailures := true
|
|
listPaymentsRequest := breez_sdk.ListPaymentsRequest{
|
|
Filters: &filters,
|
|
FromTimestamp: &fromTimestamp,
|
|
IncludeFailures: &includeFailures,
|
|
}
|
|
if payments, err := sdk.ListPayments(listPaymentsRequest); err == nil {
|
|
log.Printf("%#v", payments)
|
|
}
|
|
// ANCHOR_END: list-payments-filtered
|
|
}
|