Documentation
¶
Index ¶
- func GetProofsAndMint(tokenStr string) (cashu.Proofs, string, error)
- func GetSatoshisAmountFromBolt11(bolt11 string) (uint64, error)
- func MakeTokenString(proofs cashu.Proofs, mint string) string
- func ParseKeysetKeys(keys nut01.KeysMap) (map[uint64]*btcec.PublicKey, error)
- type HistoryEntry
- type PayOptions
- type ReceiveOptions
- type SendOptions
- type Token
- type TokenRef
- type Wallet
- func (w *Wallet) AddMint(ctx context.Context, urls ...string) error
- func (w *Wallet) Balance() uint64
- func (w *Wallet) Close() error
- func (w *Wallet) DropToken(ctx context.Context, tokenID string)
- func (w *Wallet) PayBolt11(ctx context.Context, invoice string, opts PayOptions) (string, error)
- func (w *Wallet) Receive(ctx context.Context, proofs cashu.Proofs, mint string, opts ReceiveOptions) error
- func (w *Wallet) RemoveMint(ctx context.Context, urls ...string) error
- func (w *Wallet) SendExternal(ctx context.Context, mint string, targetAmount uint64, opts SendOptions) (cashu.Proofs, error)
- func (w *Wallet) SendInternal(ctx context.Context, amount uint64, opts SendOptions) (cashu.Proofs, string, error)
- func (w *Wallet) SetPrivateKey(ctx context.Context, privateKey string) error
- type WalletOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HistoryEntry ¶
type PayOptions ¶
type PayOptions struct {
FromMint string
}
PayOptions contains options for paying a bolt11 invoice
type ReceiveOptions ¶
type ReceiveOptions struct {
IntoMint []string
IsNutzap bool
AcceptTokensInSourceMintInTheWorseCase bool
}
ReceiveOptions contains options for receiving tokens
type SendOptions ¶
type SendOptions struct {
SpecificSourceMint string
P2PK *btcec.PublicKey
RefundTimelock nostr.Timestamp
Hashlock [32]byte
}
SendOptions contains options for sending tokens
type Token ¶
type Wallet ¶
type Wallet struct {
sync.Mutex
// PublishUpdate must be set to a function that publishes event to the user relays
// (if all arguments are their zero values that means it is a wallet update event).
PublishUpdate func(
event nostr.Event,
deleted *Token,
received *Token,
change *Token,
isHistory bool,
)
// Processed, if not nil, is called every time a received event is processed
// (do not do any wallet operations while handling this as that will cause a mutex deadlock).
Processed func(nostr.Event, error)
// Stable is closed when we have gotten an EOSE from all relays
Stable chan struct{}
// properties that come in events
PrivateKey *btcec.PrivateKey
PublicKey *btcec.PublicKey
Mints []string
Tokens []Token
History []HistoryEntry
// contains filtered or unexported fields
}
func LoadWallet ¶
func (*Wallet) SendExternal ¶
func (*Wallet) SendInternal ¶
type WalletOptions ¶
type WalletOptions struct {
WithHistory bool
}
WalletOptions contains options for loading a wallet
Source Files
¶
Click to show internal directories.
Click to hide internal directories.