mint

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigDirName string = "nutmix"
View Source
const ConfigFileName string = "config.toml"
View Source
const LogFileName string = "nutmix.log"

Variables

View Source
var (
	NETWORK_ENV                = "NETWORK"
	MINT_LIGHTNING_BACKEND_ENV = "MINT_LIGHTNING_BACKEND"
)

Functions

func CheckChainParams

func CheckChainParams(network string) (chaincfg.Params, error)

func CheckMeltRequest

func CheckMeltRequest(ctx context.Context, mint *Mint, quoteId string) (cashu.PostMeltQuoteBolt11Response, error)

func CheckMintRequest

func CheckMintRequest(mint *Mint, quote cashu.MintRequestDB, invoice *zpay32.Invoice) (cashu.MintRequestDB, error)

func CheckProofState

func CheckProofState(ctx context.Context, mint *Mint, Ys []cashu.WrappedPublicKey) ([]cashu.CheckState, error)

func SendJson

func SendJson(conn *websocket.Conn, content any) error

func SetUpConfigDB

func SetUpConfigDB(db database.MintDB) (utils.Config, error)

will not look for os.variable config only file config

Types

type MeltQuoteChannel

type MeltQuoteChannel struct {
	Channel chan cashu.MeltRequestDB
	SubId   string
}

type Mint

type Mint struct {
	LightningBackend lightning.LightningBackend
	MintDB           database.MintDB
	Signer           signer.Signer
	OICDClient       *oidc.Provider
	Observer         *Observer
	MintPubkey       string
	Config           utils.Config
}

func SetUpMint

func SetUpMint(ctx context.Context, config utils.Config, db database.MintDB, sig signer.Signer) (*Mint, error)

func (*Mint) CheckMeltQuoteState

func (m *Mint) CheckMeltQuoteState(ctx context.Context, quoteId string) (cashu.MeltRequestDB, error)

func (*Mint) CheckPendingQuoteAndProofs

func (m *Mint) CheckPendingQuoteAndProofs() error

func (*Mint) CheckProofsAreSameUnit

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

func (*Mint) GetChangeOutput

func (m *Mint) GetChangeOutput(messages []cashu.BlindedMessage, overPaidFees uint64, unit string) ([]cashu.RecoverSigDB, error)

func (*Mint) IsInternalTransaction

func (m *Mint) IsInternalTransaction(request string) (bool, error)

func (*Mint) Melt

func (*Mint) SetupOidcService added in v0.4.0

func (m *Mint) SetupOidcService(ctx context.Context, url string) error

func (*Mint) VerifyAuthBlindToken

func (m *Mint) VerifyAuthBlindToken(authProof cashu.AuthProof) error

func (*Mint) VerifyAuthClearToken

func (m *Mint) VerifyAuthClearToken(token string) error

func (*Mint) VerifyInputsAndOutputs

func (m *Mint) VerifyInputsAndOutputs(tx pgx.Tx, proofs cashu.Proofs, outputs []cashu.BlindedMessage) error

func (*Mint) VerifyOutputs

func (m *Mint) VerifyOutputs(tx pgx.Tx, outputs []cashu.BlindedMessage, keys []cashu.BasicKeysetResponse) (cashu.Unit, error)

func (*Mint) VerifyProofsBDHKE added in v0.4.0

func (m *Mint) VerifyProofsBDHKE(proofs cashu.Proofs) error

VerifyProofsBDHKE verifies the BDHKE cryptographic signatures of the proofs. This should always be called regardless of SIG_ALL.

func (*Mint) VerifyUnitSupport

func (m *Mint) VerifyUnitSupport(unitStr string) error

type MintQuoteChannel

type MintQuoteChannel struct {
	Channel chan cashu.MintRequestDB
	SubId   string
}

type Observer

type Observer struct {
	Proofs    map[string][]ProofWatchChannel
	MintQuote map[string][]MintQuoteChannel
	MeltQuote map[string][]MeltQuoteChannel
	sync.Mutex
}

func (*Observer) AddMeltWatch

func (o *Observer) AddMeltWatch(quote string, meltChan MeltQuoteChannel)

func (*Observer) AddMintWatch

func (o *Observer) AddMintWatch(quote string, mintChan MintQuoteChannel)

func (*Observer) AddProofWatch

func (o *Observer) AddProofWatch(y string, proofChan ProofWatchChannel)

func (*Observer) RemoveWatch

func (o *Observer) RemoveWatch(subId string)

func (*Observer) SendMeltEvent

func (o *Observer) SendMeltEvent(melt cashu.MeltRequestDB)

func (*Observer) SendMintEvent

func (o *Observer) SendMintEvent(mint cashu.MintRequestDB)

func (*Observer) SendProofsEvent

func (o *Observer) SendProofsEvent(proofs cashu.Proofs)

type ProofWatchChannel

type ProofWatchChannel struct {
	Channel chan cashu.Proof
	SubId   string
}

type SeedType

type SeedType struct {
	Version uint32
	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