Documentation ¶
Index ¶
- func AmountSplit(amount uint64) []uint64
- func NewLightningClient() (lightning.Client, error)
- type Mint
- func (m *Mint) CheckFees(pr string) (uint64, error)
- func (m *Mint) CheckSpendables(proofs []cashu.Proof) map[int]bool
- func (m Mint) GetKeySet() []string
- func (m Mint) GetKeySetIds() []string
- func (m *Mint) GetPublicKeys() map[uint64]string
- func (m Mint) LoadKeySet(id string) *crypto.KeySet
- func (m *Mint) Melt(proofs []cashu.Proof, invoice string) (payment lightning.Payment, err error)
- func (m Mint) Mint(messages cashu.BlindedMessages, pr string, keySet *crypto.KeySet) ([]cashu.BlindedSignature, error)
- func (m Mint) MintWithoutKeySet(messages cashu.BlindedMessages, pr string) ([]cashu.BlindedSignature, error)
- func (m *Mint) RequestMint(amount uint64) (lightning.Invoice, error)
- func (m *Mint) Split(proofs []cashu.Proof, amount uint64, outputs []cashu.BlindedMessage, ...) ([]cashu.BlindedSignature, []cashu.BlindedSignature, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AmountSplit ¶
AmountSplit will convert amount into binary and return array with decimal binary values
func NewLightningClient ¶
NewLightningClient will create a new lightning client implementation based on the ln config
Types ¶
type Mint ¶
type Mint struct { KeySetId string // contains filtered or unexported fields }
Mint implements all functions for a cashu ledger.
func (*Mint) CheckSpendables ¶
checkSpendables checks multiple proofs
func (Mint) GetKeySetIds ¶
func (*Mint) GetPublicKeys ¶
GetPublicKeys will return current public keys for all amounts
func (*Mint) Melt ¶
if not all( [self._verify_proof(p) for p in proofs]): raise Exception ("could not verify proofs.")
melt will meld proofs
func (Mint) Mint ¶
func (m Mint) Mint(messages cashu.BlindedMessages, pr string, keySet *crypto.KeySet) ([]cashu.BlindedSignature, error)
func (Mint) MintWithoutKeySet ¶
func (m Mint) MintWithoutKeySet(messages cashu.BlindedMessages, pr string) ([]cashu.BlindedSignature, error)
func (*Mint) RequestMint ¶
requestMint will create and return the lightning invoice for a mint
func (*Mint) Split ¶
func (m *Mint) Split(proofs []cashu.Proof, amount uint64, outputs []cashu.BlindedMessage, keySet *crypto.KeySet) ([]cashu.BlindedSignature, []cashu.BlindedSignature, error)
split will split proofs. creates BlindedSignatures from BlindedMessages.
type Options ¶
type Options func(l *Mint)
func WithClient ¶
func WithInitialKeySet ¶
func WithStorage ¶
func WithStorage(database db.MintStorage) Options
Click to show internal directories.
Click to hide internal directories.