mint

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmountSplit

func AmountSplit(amount uint64) []uint64

AmountSplit will return an array with all decimal binary values (i.e. powers of two) that the given amount consists of.

func NewLightningClient

func NewLightningClient() (lightning.Client, error)

NewLightningClient will create a new lightning client implementation based on the ln config

Types

type Mint

type Mint struct {
	MasterSha526 string

	KeySetId string
	// contains filtered or unexported fields
}

Mint implements all functions for a cashu ledger.

func New

func New(masterKey string, opt ...Options) *Mint

New creates a new ledger and derives keys

func (*Mint) CheckFees

func (m *Mint) CheckFees(pr string) (uint64, error)

func (*Mint) CheckSpendables

func (m *Mint) CheckSpendables(proofs []cashu.Proof) cashu.CheckSpendableResponse

checkSpendables checks multiple proofs

func (Mint) GetKeySet

func (m Mint) GetKeySet() []string

func (Mint) GetKeySetIds

func (m Mint) GetKeySetIds() []string

func (*Mint) GetPublicKeys

func (m *Mint) GetPublicKeys() map[uint64]string

GetPublicKeys will return current public keys for all amounts

func (Mint) LoadKeySet

func (m Mint) LoadKeySet(id string) (*crypto.KeySet, error)

func (*Mint) Melt

func (m *Mint) Melt(proofs []cashu.Proof, invoice string) (payment lightning.Payment, err error)

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

func (m *Mint) RequestMint(amount uint64) (lightning.Invoicer, error)

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 WithClient(client lightning.Client) Options

func WithInitialKeySet

func WithInitialKeySet(derivationPath string) Options

func WithStorage

func WithStorage(database db.MintStorage) Options

Jump to

Keyboard shortcuts

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