Documentation
¶
Index ¶
- Constants
- func AddHTLCWitnessToInputs(inputs cashu.Proofs, preimage string, signingKey *btcec.PrivateKey) (cashu.Proofs, error)
- func AddHTLCWitnessToOutputs(outputs cashu.BlindedMessages, preimage string, signingKey *btcec.PrivateKey) (cashu.BlindedMessages, error)
- func AddP2PKWitnessToInputs(inputs cashu.Proofs, signingKeys []*btcec.PrivateKey) (cashu.Proofs, error)
- func AddP2PKWitnessToOutputs(outputs cashu.BlindedMessages, signingKeys []*btcec.PrivateKey) (cashu.BlindedMessages, error)
- func BlindedMessagesFromSpendingCondition(splitAmounts []uint64, keysetId string, ...) (cashu.BlindedMessages, []string, []*secp256k1.PrivateKey, error)
- func CLNClient(clnNode *cln.CLN) (*lightning.CLNClient, error)
- func ConstructProofs(blindedSignatures cashu.BlindedSignatures, secrets []string, ...) (cashu.Proofs, error)
- func CreateBlindedMessages(amount uint64, keysetId string) (cashu.BlindedMessages, []string, []*secp256k1.PrivateKey, error)
- func CreateTestMint(backend lightning.Client, dbpath string, inputFeePpk uint, ...) (*mint.Mint, error)
- func CreateTestMintServer(backend lightning.Client, port int, rotateKeyset bool, dbpath string, ...) (*mint.MintServer, error)
- func CreateTestWallet(walletpath, defaultMint string) (*wallet.Wallet, error)
- func Fees(proofs cashu.Proofs, mint string) (uint, error)
- func FundCashuWallet(ctx context.Context, wallet *wallet.Wallet, backend LightningBackend, ...) error
- func FundNode(ctx context.Context, bitcoind *btcdocker.Bitcoind, ...) error
- func GenerateRandomBytes() ([]byte, error)
- func GetAvailablePort() (int, error)
- func GetBlindedSignatures(amount uint64, mint *mint.Mint, payer LightningBackend) (cashu.BlindedMessages, []string, []*secp256k1.PrivateKey, ...)
- func GetProofsWithSpendingCondition(amount uint64, spendingCondition nut10.SpendingCondition, mint *mint.Mint, ...) (cashu.Proofs, error)
- func GetValidProofsForAmount(amount uint64, mint *mint.Mint, payer LightningBackend) (cashu.Proofs, error)
- func LndClient(lnd *lnd.Lnd) (*lightning.LndClient, error)
- func MineBlocks(bitcoind *btcdocker.Bitcoind, numBlocks int64) error
- func MintConfig(backend lightning.Client, port int, rotateKeyset bool, dbpath string, ...) (*mint.Config, error)
- func OpenChannel(ctx context.Context, bitcoind *btcdocker.Bitcoind, from LightningBackend, ...) error
- func SyncNode(node LightningBackend) error
- type CLNBackend
- func (clnContainer *CLNBackend) ConnectToPeer(peer *Peer) error
- func (clnContainer *CLNBackend) CreateHodlInvoice(amount uint64, hash string) (*Invoice, error)
- func (clnContainer *CLNBackend) CreateInvoice(amount uint64) (*Invoice, error)
- func (clnContainer *CLNBackend) Info() (*NodeInfo, error)
- func (clnContainer *CLNBackend) LookupInvoice(hash string) (*Invoice, error)
- func (clnContainer *CLNBackend) NewAddress() (btcutil.Address, error)
- func (clnContainer *CLNBackend) OpenChannel(to *Peer, amount uint64) error
- func (clnContainer *CLNBackend) PayInvoice(invoice string) error
- func (clnContainer *CLNBackend) Post(url string, body interface{}) (*http.Response, error)
- func (clnContainer *CLNBackend) SettleHodlInvoice(preimage string) error
- func (clnContainer *CLNBackend) Synced() (bool, error)
- type InfoResponse
- type Invoice
- type LightningBackend
- type LndBackend
- func (lndContainer *LndBackend) ConnectToPeer(peer *Peer) error
- func (lndContainer *LndBackend) CreateHodlInvoice(amount uint64, hash string) (*Invoice, error)
- func (lndContainer *LndBackend) CreateInvoice(amount uint64) (*Invoice, error)
- func (lndContainer *LndBackend) Info() (*NodeInfo, error)
- func (lndContainer *LndBackend) LookupInvoice(hash string) (*Invoice, error)
- func (lndContainer *LndBackend) NewAddress() (btcutil.Address, error)
- func (lndContainer *LndBackend) OpenChannel(to *Peer, amount uint64) error
- func (lndContainer *LndBackend) PayInvoice(invoice string) error
- func (lndContainer *LndBackend) SettleHodlInvoice(preimage string) error
- func (lndContainer *LndBackend) Synced() (bool, error)
- type NodeInfo
- type NutshellMintContainer
- type Peer
Constants ¶
View Source
const (
NUM_BLOCKS int64 = 110
)
Variables ¶
This section is empty.
Functions ¶
func AddHTLCWitnessToInputs ¶
func AddHTLCWitnessToInputs(inputs cashu.Proofs, preimage string, signingKey *btcec.PrivateKey) (cashu.Proofs, error)
it will add signatures if signingKey is not nil
func AddHTLCWitnessToOutputs ¶
func AddHTLCWitnessToOutputs(outputs cashu.BlindedMessages, preimage string, signingKey *btcec.PrivateKey) (cashu.BlindedMessages, error)
it will add signatures if signingKey is not nil
func AddP2PKWitnessToInputs ¶
func AddP2PKWitnessToOutputs ¶
func AddP2PKWitnessToOutputs( outputs cashu.BlindedMessages, signingKeys []*btcec.PrivateKey, ) (cashu.BlindedMessages, error)
func BlindedMessagesFromSpendingCondition ¶
func BlindedMessagesFromSpendingCondition( splitAmounts []uint64, keysetId string, spendingCondition nut10.SpendingCondition, ) ( cashu.BlindedMessages, []string, []*secp256k1.PrivateKey, error, )
func ConstructProofs ¶
func ConstructProofs(blindedSignatures cashu.BlindedSignatures, secrets []string, rs []*secp256k1.PrivateKey, keyset nut01.Keyset) (cashu.Proofs, error)
func CreateBlindedMessages ¶
func CreateBlindedMessages(amount uint64, keysetId string) (cashu.BlindedMessages, []string, []*secp256k1.PrivateKey, error)
func CreateTestMint ¶
func CreateTestMintServer ¶
func CreateTestWallet ¶
func FundCashuWallet ¶
func GenerateRandomBytes ¶
func GetAvailablePort ¶
func GetBlindedSignatures ¶
func GetBlindedSignatures(amount uint64, mint *mint.Mint, payer LightningBackend) ( cashu.BlindedMessages, []string, []*secp256k1.PrivateKey, cashu.BlindedSignatures, error)
func GetProofsWithSpendingCondition ¶
func GetProofsWithSpendingCondition( amount uint64, spendingCondition nut10.SpendingCondition, mint *mint.Mint, payer LightningBackend, ) (cashu.Proofs, error)
func GetValidProofsForAmount ¶
func MintConfig ¶
func OpenChannel ¶
func OpenChannel( ctx context.Context, bitcoind *btcdocker.Bitcoind, from LightningBackend, to LightningBackend, amount uint64, ) error
func SyncNode ¶
func SyncNode(node LightningBackend) error
Types ¶
type CLNBackend ¶
func NewCLNBackend ¶
func NewCLNBackend(cln *cln.CLN) *CLNBackend
func (*CLNBackend) ConnectToPeer ¶
func (clnContainer *CLNBackend) ConnectToPeer(peer *Peer) error
func (*CLNBackend) CreateHodlInvoice ¶
func (clnContainer *CLNBackend) CreateHodlInvoice(amount uint64, hash string) (*Invoice, error)
NOTE: CLN does not support HODL invoices (unless using a plugin). These will not be used in the tests. Rather will do it through LND.
func (*CLNBackend) CreateInvoice ¶
func (clnContainer *CLNBackend) CreateInvoice(amount uint64) (*Invoice, error)
func (*CLNBackend) Info ¶
func (clnContainer *CLNBackend) Info() (*NodeInfo, error)
func (*CLNBackend) LookupInvoice ¶
func (clnContainer *CLNBackend) LookupInvoice(hash string) (*Invoice, error)
func (*CLNBackend) NewAddress ¶
func (clnContainer *CLNBackend) NewAddress() (btcutil.Address, error)
func (*CLNBackend) OpenChannel ¶
func (clnContainer *CLNBackend) OpenChannel(to *Peer, amount uint64) error
func (*CLNBackend) PayInvoice ¶
func (clnContainer *CLNBackend) PayInvoice(invoice string) error
func (*CLNBackend) Post ¶
func (clnContainer *CLNBackend) Post(url string, body interface{}) (*http.Response, error)
func (*CLNBackend) SettleHodlInvoice ¶
func (clnContainer *CLNBackend) SettleHodlInvoice(preimage string) error
func (*CLNBackend) Synced ¶
func (clnContainer *CLNBackend) Synced() (bool, error)
type InfoResponse ¶
type LightningBackend ¶
type LightningBackend interface {
Info() (*NodeInfo, error)
Synced() (bool, error)
NewAddress() (btcutil.Address, error)
ConnectToPeer(peer *Peer) error
OpenChannel(to *Peer, amount uint64) error
PayInvoice(string) error
CreateInvoice(amount uint64) (*Invoice, error)
LookupInvoice(hash string) (*Invoice, error)
CreateHodlInvoice(amount uint64, hash string) (*Invoice, error)
SettleHodlInvoice(preimage string) error
}
type LndBackend ¶
func (*LndBackend) ConnectToPeer ¶
func (lndContainer *LndBackend) ConnectToPeer(peer *Peer) error
func (*LndBackend) CreateHodlInvoice ¶
func (lndContainer *LndBackend) CreateHodlInvoice(amount uint64, hash string) (*Invoice, error)
func (*LndBackend) CreateInvoice ¶
func (lndContainer *LndBackend) CreateInvoice(amount uint64) (*Invoice, error)
func (*LndBackend) Info ¶
func (lndContainer *LndBackend) Info() (*NodeInfo, error)
func (*LndBackend) LookupInvoice ¶
func (lndContainer *LndBackend) LookupInvoice(hash string) (*Invoice, error)
func (*LndBackend) NewAddress ¶
func (lndContainer *LndBackend) NewAddress() (btcutil.Address, error)
func (*LndBackend) OpenChannel ¶
func (lndContainer *LndBackend) OpenChannel(to *Peer, amount uint64) error
func (*LndBackend) PayInvoice ¶
func (lndContainer *LndBackend) PayInvoice(invoice string) error
func (*LndBackend) SettleHodlInvoice ¶
func (lndContainer *LndBackend) SettleHodlInvoice(preimage string) error
func (*LndBackend) Synced ¶
func (lndContainer *LndBackend) Synced() (bool, error)
type NutshellMintContainer ¶
type NutshellMintContainer struct {
testcontainers.Container
Host string
}
Click to show internal directories.
Click to hide internal directories.