mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-11-18 18:16:50 +01:00
nip61, and related modifications to nip60.
This commit is contained in:
@@ -11,19 +11,17 @@ import (
|
||||
"github.com/nbd-wtf/go-nostr/nip60/client"
|
||||
)
|
||||
|
||||
func (w *Wallet) ReceiveToken(ctx context.Context, serializedToken string) error {
|
||||
func (w *Wallet) Receive(
|
||||
ctx context.Context,
|
||||
proofs cashu.Proofs,
|
||||
mint string,
|
||||
) error {
|
||||
if w.wl.PublishUpdate == nil {
|
||||
return fmt.Errorf("can't do write operations: missing PublishUpdate function")
|
||||
}
|
||||
|
||||
token, err := cashu.DecodeToken(serializedToken)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
source := "http" + nostr.NormalizeURL(token.Mint())[2:]
|
||||
source := "http" + nostr.NormalizeURL(mint)[2:]
|
||||
lightningSwap := slices.Contains(w.Mints, source)
|
||||
proofs := token.Proofs()
|
||||
swapOpts := make([]SwapOption, 0, 1)
|
||||
|
||||
for i, proof := range proofs {
|
||||
|
||||
Reference in New Issue
Block a user