nip60: use more reasonable options instead of the crazy WithWhatever() pattern.

This commit is contained in:
fiatjaf
2025-05-05 16:36:44 -03:00
parent fcea4f1b15
commit b711548b03
7 changed files with 63 additions and 91 deletions
+5 -3
View File
@@ -4,16 +4,16 @@ import (
"context"
"fmt"
"fiatjaf.com/nostr/nip60/client"
"github.com/elnosh/gonuts/cashu"
"github.com/elnosh/gonuts/cashu/nuts/nut04"
"fiatjaf.com/nostr/nip60/client"
)
func (w *Wallet) SendExternal(
ctx context.Context,
mint string,
targetAmount uint64,
opts ...SendOption,
opts SendOptions,
) (cashu.Proofs, error) {
if w.PublishUpdate == nil {
return nil, fmt.Errorf("can't do write operations: missing PublishUpdate function")
@@ -28,7 +28,9 @@ func (w *Wallet) SendExternal(
return nil, fmt.Errorf("failed to generate mint quote: %w", err)
}
if _, err := w.PayBolt11(ctx, mintResp.Request, opts...); err != nil {
if _, err := w.PayBolt11(ctx, mintResp.Request, PayOptions{
FromMint: opts.SpecificSourceMint,
}); err != nil {
return nil, err
}