Documentation
¶
Index ¶
- func GetProofsAndMint(tokenStr string) (cashu.Proofs, string, error)
- func MakeTokenString(proofs cashu.Proofs, mint string) string
- type HistoryEntry
- type ReceiveOption
- type SendOption
- type SwapOption
- 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) PayBolt11(ctx context.Context, invoice string, opts ...SendOption) (string, error)
- func (w *Wallet) Receive(ctx context.Context, proofs cashu.Proofs, mint string, opts ...ReceiveOption) error
- func (w *Wallet) RemoveMint(ctx context.Context, urls ...string) error
- func (w *Wallet) Send(ctx context.Context, amount uint64, opts ...SendOption) (cashu.Proofs, string, error)
- func (w *Wallet) SendExternal(ctx context.Context, mint string, targetAmount uint64, opts ...SendOption) (cashu.Proofs, error)
- func (w *Wallet) SetPrivateKey(ctx context.Context, privateKey string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HistoryEntry ¶
type ReceiveOption ¶
type ReceiveOption func(*receiveSettings)
func WithMintDestination ¶
func WithMintDestination(url string) ReceiveOption
func WithNutzap ¶
func WithNutzap() ReceiveOption
type SendOption ¶
type SendOption func(opts *sendSettings)
func WithMint ¶
func WithMint(url string) SendOption
func WithP2PK ¶
func WithP2PK(pubkey string) SendOption
func WithRefundable ¶
func WithRefundable(timelock nostr.Timestamp) SendOption
type SwapOption ¶
type SwapOption func(*swapSettings)
func WithSignedOutputs ¶
func WithSignedOutputs() SwapOption
func WithSpendingCondition ¶
func WithSpendingCondition(sc nut10.SpendingCondition) SwapOption
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 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 LoadWalletWithHistory ¶
func (*Wallet) SendExternal ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.