Documentation
¶
Index ¶
- Constants
- Variables
- type BoltDB
- func (db *BoltDB) AddPendingProofs(proofs cashu.Proofs) error
- func (db *BoltDB) AddPendingProofsByQuoteId(proofs cashu.Proofs, quoteId string) error
- func (db *BoltDB) Close() error
- func (db *BoltDB) DeletePendingProofs(Ys []string) error
- func (db *BoltDB) DeletePendingProofsByQuoteId(quoteId string) error
- func (db *BoltDB) DeleteProof(secret string) error
- func (db *BoltDB) GetInvoice(paymentHash string) *Invoice
- func (db *BoltDB) GetInvoiceByQuoteId(quoteId string) *Invoice
- func (db *BoltDB) GetInvoices() []Invoice
- func (db *BoltDB) GetKeyset(keysetId string) *crypto.WalletKeyset
- func (db *BoltDB) GetKeysetCounter(keysetId string) uint32
- func (db *BoltDB) GetKeysets() crypto.KeysetsMap
- func (db *BoltDB) GetMeltQuoteById(id string) *MeltQuote
- func (db *BoltDB) GetMeltQuotes() []MeltQuote
- func (db *BoltDB) GetMintQuoteById(id string) *MintQuote
- func (db *BoltDB) GetMintQuotes() []MintQuote
- func (db *BoltDB) GetMnemonic() string
- func (db *BoltDB) GetPendingProofs() []DBProof
- func (db *BoltDB) GetPendingProofsByQuoteId(quoteId string) []DBProof
- func (db *BoltDB) GetProofs() cashu.Proofs
- func (db *BoltDB) GetProofsByKeysetId(id string) cashu.Proofs
- func (db *BoltDB) GetSeed() []byte
- func (db *BoltDB) IncrementKeysetCounter(keysetId string, num uint32) error
- func (db *BoltDB) MigrateInvoicesToQuotes() error
- func (db *BoltDB) SaveInvoice(invoice Invoice) error
- func (db *BoltDB) SaveKeyset(keyset *crypto.WalletKeyset) error
- func (db *BoltDB) SaveMeltQuote(quote MeltQuote) error
- func (db *BoltDB) SaveMintQuote(quote MintQuote) error
- func (db *BoltDB) SaveMnemonicSeed(mnemonic string, seed []byte)
- func (db *BoltDB) SaveProofs(proofs cashu.Proofs) error
- func (db *BoltDB) UpdateKeysetMintURL(oldURL, newURL string) error
- type DBProof
- type Invoice
- type MeltQuote
- type MintQuote
- type QuoteType
- type WalletDB
Constants ¶
View Source
const ( KEYSETS_BUCKET = "keysets" PROOFS_BUCKET = "proofs" PENDING_PROOFS_BUCKET = "pending_proofs" MINT_QUOTES_BUCKET = "mint_quotes" MELT_QUOTES_BUCKET = "melt_quotes" INVOICES_BUCKET = "invoices" SEED_BUCKET = "seed" MNEMONIC_KEY = "mnemonic" )
Variables ¶
View Source
var ( ProofNotFound = errors.New("proof not found") KeysetMintURLNotFound = errors.New("keyset with mint url not found") )
Functions ¶
This section is empty.
Types ¶
type BoltDB ¶
type BoltDB struct {
// contains filtered or unexported fields
}
func (*BoltDB) AddPendingProofsByQuoteId ¶
func (*BoltDB) DeletePendingProofs ¶
func (*BoltDB) DeletePendingProofsByQuoteId ¶
func (*BoltDB) DeleteProof ¶
func (*BoltDB) GetInvoice ¶
func (*BoltDB) GetInvoiceByQuoteId ¶
func (*BoltDB) GetInvoices ¶
func (*BoltDB) GetKeysetCounter ¶
func (*BoltDB) GetKeysets ¶
func (db *BoltDB) GetKeysets() crypto.KeysetsMap
func (*BoltDB) GetMeltQuoteById ¶
func (*BoltDB) GetMeltQuotes ¶
func (*BoltDB) GetMintQuoteById ¶
func (*BoltDB) GetMintQuotes ¶
func (*BoltDB) GetMnemonic ¶
func (*BoltDB) GetPendingProofs ¶
func (*BoltDB) GetPendingProofsByQuoteId ¶
func (*BoltDB) IncrementKeysetCounter ¶
func (*BoltDB) MigrateInvoicesToQuotes ¶
func (*BoltDB) SaveInvoice ¶
func (*BoltDB) SaveKeyset ¶
func (db *BoltDB) SaveKeyset(keyset *crypto.WalletKeyset) error
NOTE: Keysets are stored in nested buckets by mint URL. I.e a keyset with mint URL http://mint.com will create a bucket inside the KEYSETS_BUCKET named by the mint URL and inside this bucket, save the keysets by keyset id
func (*BoltDB) SaveMeltQuote ¶
func (*BoltDB) SaveMintQuote ¶
func (*BoltDB) SaveMnemonicSeed ¶
func (*BoltDB) UpdateKeysetMintURL ¶
UpdateKeysetMintURL creates a new bucket named with newURL. It will then iterate over all the keysets that were stored in the oldURL bucket and copy them over to the new bucket with newURL. It also needs to change the MintURL field for each keyset.
type MintQuote ¶
type MintQuote struct {
QuoteId string
Mint string
Method string
State nut04.State
Unit string
PaymentRequest string
Amount uint64
CreatedAt int64
SettledAt int64
QuoteExpiry uint64
PrivateKey *secp256k1.PrivateKey
}
func (*MintQuote) MarshalJSON ¶
func (*MintQuote) UnmarshalJSON ¶
type WalletDB ¶
type WalletDB interface {
SaveMnemonicSeed(string, []byte)
GetSeed() []byte
GetMnemonic() string
SaveProofs(cashu.Proofs) error
GetProofs() cashu.Proofs
GetProofsByKeysetId(string) cashu.Proofs
DeleteProof(string) error
AddPendingProofs(cashu.Proofs) error
AddPendingProofsByQuoteId(cashu.Proofs, string) error
GetPendingProofs() []DBProof
GetPendingProofsByQuoteId(string) []DBProof
DeletePendingProofs([]string) error
DeletePendingProofsByQuoteId(string) error
SaveKeyset(*crypto.WalletKeyset) error
GetKeysets() crypto.KeysetsMap
GetKeyset(string) *crypto.WalletKeyset
IncrementKeysetCounter(string, uint32) error
GetKeysetCounter(string) uint32
UpdateKeysetMintURL(oldURL, newURL string) error
SaveMintQuote(MintQuote) error
GetMintQuotes() []MintQuote
GetMintQuoteById(string) *MintQuote
SaveMeltQuote(MeltQuote) error
GetMeltQuotes() []MeltQuote
GetMeltQuoteById(string) *MeltQuote
Close() error
}
Click to show internal directories.
Click to hide internal directories.