mint

package
v0.0.0-...-c6a72db Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AlreadyActiveProof = errors.New("Proof already being spent")
	AlreadyActiveQuote = errors.New("Quote already being spent")
)
View Source
var (
	ErrInvalidProof        = errors.New("Invalid proof")
	ErrQuoteNotPaid        = errors.New("Quote not paid")
	ErrMessageAmountToBig  = errors.New("Message amount is to big")
	ErrInvalidBlindMessage = errors.New("Invalid blind message")
)
View Source
var (
	NETWORK_ENV                = "NETWORK"
	MINT_LIGHTNING_BACKEND_ENV = "MINT_LIGHTNING_BACKEND"
)

Functions

This section is empty.

Types

type ActiveMeltQuote

type ActiveMeltQuote struct {
	Quote []string
	sync.Mutex
}

type ActiveProofs

type ActiveProofs struct {
	Proofs []cashu.Proof
	sync.Mutex
}

type ActiveQuote

type ActiveQuote struct {
	Quote []string
	sync.Mutex
}

type AddToDBFunc

type AddToDBFunc func(*pgxpool.Pool, bool, cashu.ACTION_STATE, string) error

type KeysetMap

type KeysetMap map[uint64]cashu.Keyset

type Mint

type Mint struct {
	ActiveKeysets map[string]KeysetMap
	Keysets       map[string][]cashu.Keyset
	LightningComs comms.LightingComms
	Network       chaincfg.Params
	PendingProofs []cashu.Proof
	ActiveProofs  ActiveProofs
	ActiveQuotes  ActiveQuote
	MintPubkey    string
}

func SetUpMint

func SetUpMint(ctx context.Context, mint_privkey string, seeds []cashu.Seed) (*Mint, error)

func (*Mint) AddActiveMintQuote

func (a *Mint) AddActiveMintQuote(quote string) error

func (*Mint) AddProofs

func (a *Mint) AddProofs(proofs []cashu.Proof) error

func (*Mint) AddQuotesAndProofs

func (m *Mint) AddQuotesAndProofs(quote string, proofs []cashu.Proof) error

func (*Mint) CheckProofsAreSameUnit

func (m *Mint) CheckProofsAreSameUnit(proofs []cashu.Proof) (cashu.Unit, error)

func (*Mint) GetAllKeysets

func (m *Mint) GetAllKeysets() []cashu.Keyset

func (*Mint) GetKeysetById

func (m *Mint) GetKeysetById(id string) ([]cashu.Keyset, error)

func (*Mint) OrderActiveKeysByUnit

func (m *Mint) OrderActiveKeysByUnit() cashu.KeysResponse

func (*Mint) RemoveActiveMintQuote

func (a *Mint) RemoveActiveMintQuote(quote string) error

func (*Mint) RemoveProofs

func (a *Mint) RemoveProofs(proofs []cashu.Proof)

func (*Mint) RemoveQuotesAndProofs

func (m *Mint) RemoveQuotesAndProofs(quote string, proofs []cashu.Proof)

func (*Mint) SignBlindedMessages

func (m *Mint) SignBlindedMessages(outputs []cashu.BlindedMessage, unit string) ([]cashu.BlindSignature, []cashu.RecoverSigDB, error)

func (*Mint) ValidateProof

func (m *Mint) ValidateProof(proof cashu.Proof, unit cashu.Unit, checkOutputs *bool, pubkeysFromProofs *map[*btcec.PublicKey]bool) error

func (*Mint) VerifyLightingPaymentHappened

func (m *Mint) VerifyLightingPaymentHappened(ctx context.Context, pool *pgxpool.Pool, paid bool, quote string, dbCall AddToDBFunc) (cashu.ACTION_STATE, string, error)

func (*Mint) VerifyListOfProofs

func (m *Mint) VerifyListOfProofs(proofs []cashu.Proof, blindMessages []cashu.BlindedMessage, unit cashu.Unit) error

type SeedType

type SeedType struct {
	Version int
	Active  bool
	Unit    cashu.Unit
}

func CheckForInactiveSeeds

func CheckForInactiveSeeds(seeds []cashu.Seed) ([]SeedType, error)

Jump to

Keyboard shortcuts

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