Documentation ¶
Index ¶
- func GetActiveKeysets(mintURL string) (*nut01.GetKeysResponse, error)
- func GetAllKeysets(mintURL string) (*nut02.GetKeysetsResponse, error)
- func GetMintActiveKeysets(mintURL string) (map[string]crypto.Keyset, error)
- func GetMintInactiveKeysets(mintURL string) (map[string]crypto.Keyset, error)
- func GetMintQuoteState(mintURL, quoteId string) (*nut04.PostMintQuoteBolt11Response, error)
- func InitStorage(path string) (storage.DB, error)
- func NewBlindedMessage(id string, amount uint64, B_ *secp256k1.PublicKey) cashu.BlindedMessage
- func PostMeltBolt11(mintURL string, meltRequest nut05.PostMeltBolt11Request) (*nut05.PostMeltBolt11Response, error)
- func PostMeltQuoteBolt11(mintURL string, meltQuoteRequest nut05.PostMeltQuoteBolt11Request) (*nut05.PostMeltQuoteBolt11Response, error)
- func PostMintBolt11(mintURL string, mintRequest nut04.PostMintBolt11Request) (*nut04.PostMintBolt11Response, error)
- func PostMintQuoteBolt11(mintURL string, mintQuoteRequest nut04.PostMintQuoteBolt11Request) (*nut04.PostMintQuoteBolt11Response, error)
- func PostSwap(mintURL string, swapRequest nut03.PostSwapRequest) (*nut03.PostSwapResponse, error)
- type Config
- type Wallet
- func (w *Wallet) CheckQuotePaid(quoteId string) bool
- func (w *Wallet) ConstructProofs(blindedSignatures cashu.BlindedSignatures, secrets []string, ...) (cashu.Proofs, error)
- func (w *Wallet) CreateBlindedMessages(amount uint64, keyset crypto.Keyset) (cashu.BlindedMessages, []string, []*secp256k1.PrivateKey, error)
- func (w *Wallet) CurrentMint() string
- func (w *Wallet) GetActiveSatKeyset() crypto.Keyset
- func (w *Wallet) GetAllInvoices() []lightning.Invoice
- func (w *Wallet) GetBalance() uint64
- func (w *Wallet) GetBalanceByMints() map[string]uint64
- func (w *Wallet) GetInvoiceByPaymentHash(hash string) *lightning.Invoice
- func (w *Wallet) GetInvoiceByPaymentRequest(pr string) (*lightning.Invoice, error)
- func (w *Wallet) GetProofsByMint(mintURL string) (cashu.Proofs, error)
- func (w *Wallet) Melt(invoice string, mint string) (*nut05.PostMeltBolt11Response, error)
- func (w *Wallet) MintTokens(quoteId string) (cashu.Proofs, error)
- func (w *Wallet) Receive(token cashu.Token, swap bool) (uint64, error)
- func (w *Wallet) RequestMint(amount uint64) (*nut04.PostMintQuoteBolt11Response, error)
- func (w *Wallet) Send(amount uint64, mintURL string) (*cashu.Token, error)
- func (w *Wallet) TrustedMints() map[string]walletMint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetActiveKeysets ¶
func GetActiveKeysets(mintURL string) (*nut01.GetKeysResponse, error)
func GetAllKeysets ¶
func GetAllKeysets(mintURL string) (*nut02.GetKeysetsResponse, error)
func GetMintActiveKeysets ¶
func GetMintInactiveKeysets ¶
func GetMintQuoteState ¶
func GetMintQuoteState(mintURL, quoteId string) (*nut04.PostMintQuoteBolt11Response, error)
func NewBlindedMessage ¶
func NewBlindedMessage(id string, amount uint64, B_ *secp256k1.PublicKey) cashu.BlindedMessage
func PostMeltBolt11 ¶
func PostMeltBolt11(mintURL string, meltRequest nut05.PostMeltBolt11Request) ( *nut05.PostMeltBolt11Response, error)
func PostMeltQuoteBolt11 ¶
func PostMeltQuoteBolt11(mintURL string, meltQuoteRequest nut05.PostMeltQuoteBolt11Request) ( *nut05.PostMeltQuoteBolt11Response, error)
func PostMintBolt11 ¶
func PostMintBolt11(mintURL string, mintRequest nut04.PostMintBolt11Request) ( *nut04.PostMintBolt11Response, error)
func PostMintQuoteBolt11 ¶
func PostMintQuoteBolt11(mintURL string, mintQuoteRequest nut04.PostMintQuoteBolt11Request) ( *nut04.PostMintQuoteBolt11Response, error)
func PostSwap ¶
func PostSwap(mintURL string, swapRequest nut03.PostSwapRequest) (*nut03.PostSwapResponse, error)
Types ¶
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
func LoadWallet ¶
func (*Wallet) CheckQuotePaid ¶
CheckQuotePaid reports whether the mint quote has been paid
func (*Wallet) ConstructProofs ¶
func (w *Wallet) ConstructProofs(blindedSignatures cashu.BlindedSignatures, secrets []string, rs []*secp256k1.PrivateKey, keyset *crypto.Keyset) (cashu.Proofs, error)
ConstructProofs unblinds the blindedSignatures and returns the proofs
func (*Wallet) CreateBlindedMessages ¶
func (w *Wallet) CreateBlindedMessages(amount uint64, keyset crypto.Keyset) (cashu.BlindedMessages, []string, []*secp256k1.PrivateKey, error)
returns Blinded messages, secrets - [][]byte, and list of r
func (*Wallet) CurrentMint ¶
CurrentMint returns the current mint url
func (*Wallet) GetActiveSatKeyset ¶
func (*Wallet) GetAllInvoices ¶
func (*Wallet) GetBalance ¶
GetBalance returns the total balance aggregated from all proofs
func (*Wallet) GetBalanceByMints ¶
GetBalanceByMints returns a map of string mint and a uint64 that represents the balance for that mint
func (*Wallet) GetInvoiceByPaymentHash ¶
func (*Wallet) GetInvoiceByPaymentRequest ¶
func (*Wallet) GetProofsByMint ¶
GetProofsByMint will return an array of proofs that are from the passed mint
func (*Wallet) MintTokens ¶
MintTokens will check whether if the mint quote has been paid. If yes, it will create blinded messages that will send to the mint to get the blinded signatures. If successful, it will unblind the signatures to generate proofs and store the proofs in the db.
func (*Wallet) Receive ¶
Receives Cashu token. If swap is true, it will swap the funds to the configured default mint. If false, it will add the proofs from the mint and add that mint to the list of trusted mints.
func (*Wallet) RequestMint ¶
func (w *Wallet) RequestMint(amount uint64) (*nut04.PostMintQuoteBolt11Response, error)
RequestMint requests a mint quote to the wallet's current mint for the specified amount