nip60: fixes, actual Cashu stuff and a wallet.Receive() method.

This commit is contained in:
fiatjaf
2025-01-27 16:33:33 -03:00
parent 3334f7a48b
commit c6747cdf44
11 changed files with 977 additions and 42 deletions

View File

@@ -11,7 +11,7 @@ import (
type HistoryEntry struct {
In bool // in = received, out = sent
Amount uint32
Amount uint64
tokenEventIDs []string
nutZaps []bool
@@ -120,11 +120,11 @@ func (h *HistoryEntry) parse(ctx context.Context, kr nostr.Keyer, evt *nostr.Eve
if tag[2] != "sat" {
return fmt.Errorf("only 'sat' wallets are supported")
}
v, err := strconv.ParseUint(tag[1], 10, 32)
v, err := strconv.ParseUint(tag[1], 10, 64)
if err != nil {
return fmt.Errorf("invalid 'amount' %s: %w", tag[1], err)
}
h.Amount = uint32(v)
h.Amount = v
case "e":
essential++
if len(tag) < 4 {