storage

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDB

type BoltDB struct {
	// contains filtered or unexported fields
}

func InitBolt

func InitBolt(path string) (*BoltDB, error)

func (*BoltDB) DeleteProof

func (db *BoltDB) DeleteProof(secret string) error

func (*BoltDB) GetInvoice

func (db *BoltDB) GetInvoice(paymentHash string) *Invoice

func (*BoltDB) GetInvoices

func (db *BoltDB) GetInvoices() []Invoice

func (*BoltDB) GetKeyset added in v0.2.0

func (db *BoltDB) GetKeyset(keysetId string) *crypto.WalletKeyset

func (*BoltDB) GetKeysetCounter added in v0.2.0

func (db *BoltDB) GetKeysetCounter(keysetId string) uint32

func (*BoltDB) GetKeysets

func (db *BoltDB) GetKeysets() crypto.KeysetsMap

func (*BoltDB) GetMnemonic added in v0.2.0

func (db *BoltDB) GetMnemonic() string

func (*BoltDB) GetProofs

func (db *BoltDB) GetProofs() cashu.Proofs

return all proofs from db

func (*BoltDB) GetProofsByKeysetId

func (db *BoltDB) GetProofsByKeysetId(id string) cashu.Proofs

func (*BoltDB) GetSeed added in v0.2.0

func (db *BoltDB) GetSeed() []byte

func (*BoltDB) IncrementKeysetCounter added in v0.2.0

func (db *BoltDB) IncrementKeysetCounter(keysetId string, num uint32) error

func (*BoltDB) SaveInvoice

func (db *BoltDB) SaveInvoice(invoice Invoice) error

func (*BoltDB) SaveKeyset

func (db *BoltDB) SaveKeyset(keyset *crypto.WalletKeyset) error

func (*BoltDB) SaveMnemonicSeed added in v0.2.0

func (db *BoltDB) SaveMnemonicSeed(mnemonic string, seed []byte)

func (*BoltDB) SaveProof

func (db *BoltDB) SaveProof(proof cashu.Proof) error

type DB

type DB interface {
	SaveMnemonicSeed(string, []byte)
	GetSeed() []byte
	GetMnemonic() string
	SaveProof(cashu.Proof) error
	GetProofsByKeysetId(string) cashu.Proofs
	GetProofs() cashu.Proofs
	DeleteProof(string) error
	SaveKeyset(*crypto.WalletKeyset) error
	GetKeysets() crypto.KeysetsMap
	GetKeyset(string) *crypto.WalletKeyset
	IncrementKeysetCounter(string, uint32) error
	GetKeysetCounter(string) uint32
	SaveInvoice(Invoice) error
	GetInvoice(string) *Invoice
	GetInvoices() []Invoice
}

type Invoice added in v0.2.0

type Invoice struct {
	TransactionType QuoteType
	// mint or melt quote id
	Id             string
	QuoteAmount    uint64
	PaymentRequest string
	PaymentHash    string
	Preimage       string
	CreatedAt      int64
	Paid           bool
	SettledAt      int64
	InvoiceAmount  uint64
	QuoteExpiry    uint64
}

type QuoteType added in v0.2.0

type QuoteType int
const (
	Mint QuoteType = iota + 1
	Melt
)

func (QuoteType) String added in v0.2.0

func (quote QuoteType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL