Documentation ¶
Index ¶
- Constants
- type Config
- type LogLevel
- type MeltMethodSettings
- type Mint
- func (m *Mint) GetActiveKeyset() crypto.MintKeyset
- func (m *Mint) GetMeltQuoteState(ctx context.Context, quoteId string) (storage.MeltQuote, error)
- func (m *Mint) GetMintQuoteState(quoteId string) (storage.MintQuote, error)
- func (m *Mint) MeltTokens(ctx context.Context, meltTokensRequest nut05.PostMeltBolt11Request) (storage.MeltQuote, error)
- func (m *Mint) MintTokens(mintTokensRequest nut04.PostMintBolt11Request) (cashu.BlindedSignatures, error)
- func (m *Mint) ProofsStateCheck(Ys []string) ([]nut07.ProofState, error)
- func (m *Mint) RequestMeltQuote(meltQuoteRequest nut05.PostMeltQuoteBolt11Request) (storage.MeltQuote, error)
- func (m *Mint) RequestMintQuote(mintQuoteRequest nut04.PostMintQuoteBolt11Request) (storage.MintQuote, error)
- func (m *Mint) RestoreSignatures(blindedMessages cashu.BlindedMessages) (cashu.BlindedMessages, cashu.BlindedSignatures, error)
- func (m *Mint) RetrieveMintInfo() (nut06.MintInfo, error)
- func (m *Mint) SetMintInfo(mintInfo MintInfo)
- func (m *Mint) Swap(proofs cashu.Proofs, blindedMessages cashu.BlindedMessages) (cashu.BlindedSignatures, error)
- func (m *Mint) TransactionFees(inputs cashu.Proofs) uint
- type MintInfo
- type MintLimits
- type MintMethodSettings
- type MintServer
Constants ¶
const (
QuoteExpiryMins = 10
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MeltMethodSettings ¶ added in v0.2.0
type Mint ¶
type Mint struct {
// contains filtered or unexported fields
}
func (*Mint) GetActiveKeyset ¶ added in v0.2.0
func (m *Mint) GetActiveKeyset() crypto.MintKeyset
func (*Mint) GetMeltQuoteState ¶
GetMeltQuoteState returns the state of a melt quote. Used to check whether a melt quote has been paid.
func (*Mint) GetMintQuoteState ¶
GetMintQuoteState returns the state of a mint quote. Used to check whether a mint quote has been paid.
func (*Mint) MeltTokens ¶
func (m *Mint) MeltTokens(ctx context.Context, meltTokensRequest nut05.PostMeltBolt11Request) (storage.MeltQuote, error)
MeltTokens verifies whether proofs provided are valid and proceeds to attempt payment.
func (*Mint) MintTokens ¶
func (m *Mint) MintTokens(mintTokensRequest nut04.PostMintBolt11Request) (cashu.BlindedSignatures, error)
MintTokens verifies whether the mint quote with id has been paid and proceeds to sign the blindedMessages and return the BlindedSignatures if it was paid.
func (*Mint) ProofsStateCheck ¶ added in v0.3.0
func (m *Mint) ProofsStateCheck(Ys []string) ([]nut07.ProofState, error)
func (*Mint) RequestMeltQuote ¶ added in v0.2.0
func (m *Mint) RequestMeltQuote(meltQuoteRequest nut05.PostMeltQuoteBolt11Request) (storage.MeltQuote, error)
RequestMeltQuote will process a request to melt tokens and return a MeltQuote. A melt is requested by a wallet to request the mint to pay an invoice.
func (*Mint) RequestMintQuote ¶
func (m *Mint) RequestMintQuote(mintQuoteRequest nut04.PostMintQuoteBolt11Request) (storage.MintQuote, error)
RequestMintQuote will process a request to mint tokens and returns a mint quote or an error. The request to mint a token is explained in NUT-04 here: https://github.com/cashubtc/nuts/blob/main/04.md.
func (*Mint) RestoreSignatures ¶ added in v0.3.0
func (m *Mint) RestoreSignatures(blindedMessages cashu.BlindedMessages) (cashu.BlindedMessages, cashu.BlindedSignatures, error)
func (*Mint) RetrieveMintInfo ¶ added in v0.2.0
func (*Mint) SetMintInfo ¶ added in v0.2.0
func (*Mint) Swap ¶
func (m *Mint) Swap(proofs cashu.Proofs, blindedMessages cashu.BlindedMessages) (cashu.BlindedSignatures, error)
Swap will process a request to swap tokens. A swap requires a set of valid proofs and blinded messages. If valid, the mint will sign the blindedMessages and invalidate the proofs that were used as input. It returns the BlindedSignatures.
type MintLimits ¶ added in v0.2.0
type MintLimits struct { MaxBalance uint64 MintingSettings MintMethodSettings MeltingSettings MeltMethodSettings }
type MintMethodSettings ¶ added in v0.2.0
type MintServer ¶
type MintServer struct {
// contains filtered or unexported fields
}
func SetupMintServer ¶
func SetupMintServer(config Config) (*MintServer, error)
func (*MintServer) Shutdown ¶ added in v0.3.0
func (ms *MintServer) Shutdown()
func (*MintServer) Start ¶ added in v0.3.0
func (ms *MintServer) Start() error