Documentation
¶
Index ¶
- Variables
- type AddressProvider
- type Balance
- type BlockEpoch
- type BlockProvider
- type BoltzTxProvider
- type Currency
- type ElectrumConfig
- type ElectrumOptions
- type Id
- type MultiTxProvider
- type Onchain
- func (onchain *Onchain) AddWallet(wallet Wallet)
- func (onchain *Onchain) BroadcastTransaction(transaction boltz.Transaction) (string, error)
- func (onchain *Onchain) Disconnect()
- func (onchain *Onchain) EstimateFee(currency boltz.Currency, allowLowball bool) (float64, error)
- func (onchain *Onchain) FindOutput(info OutputArgs) (*OutputResult, error)
- func (onchain *Onchain) GetAnyWallet(checker WalletChecker) (Wallet, error)
- func (onchain *Onchain) GetBlockHeight(currency boltz.Currency) (uint32, error)
- func (onchain *Onchain) GetBlockProvider(currency boltz.Currency) BlockProvider
- func (onchain *Onchain) GetCurrency(currency boltz.Currency) (*Currency, error)
- func (onchain *Onchain) GetTransaction(currency boltz.Currency, txId string, ourOutputBlindingKey *btcec.PrivateKey) (boltz.Transaction, error)
- func (onchain *Onchain) GetTransactionFee(currency boltz.Currency, txId string) (uint64, error)
- func (onchain *Onchain) GetUnspentOutputs(currency boltz.Currency, address string) ([]*Output, error)
- func (onchain *Onchain) GetWallets(checker WalletChecker) []Wallet
- func (onchain *Onchain) Init()
- func (onchain *Onchain) IsTransactionConfirmed(currency boltz.Currency, txId string) (bool, error)
- func (onchain *Onchain) RegisterBlockListener(ctx context.Context, currency boltz.Currency) *utils.ChannelForwarder[*BlockEpoch]
- func (onchain *Onchain) RemoveWallet(id Id)
- type Output
- type OutputArgs
- type OutputResult
- type TransactionOutput
- type TxProvider
- type Wallet
- type WalletChecker
- type WalletInfo
- type WalletTransaction
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotConfirmed = errors.New("lockup transaction not confirmed")
View Source
var RegtestElectrumConfig = ElectrumConfig{ Btc: ElectrumOptions{Url: "localhost:19001"}, Liquid: ElectrumOptions{Url: "localhost:19002"}, }
Functions ¶
This section is empty.
Types ¶
type AddressProvider ¶
type BlockEpoch ¶
type BlockEpoch struct {
Height uint32
}
type BlockProvider ¶
type BoltzTxProvider ¶
func (BoltzTxProvider) BroadcastTransaction ¶
func (txProvider BoltzTxProvider) BroadcastTransaction(txHex string) (string, error)
func (BoltzTxProvider) GetRawTransaction ¶
func (txProvider BoltzTxProvider) GetRawTransaction(txId string) (string, error)
func (BoltzTxProvider) IsTransactionConfirmed ¶
func (txProvider BoltzTxProvider) IsTransactionConfirmed(txId string) (bool, error)
type Currency ¶
type Currency struct { Blocks BlockProvider Tx TxProvider // contains filtered or unexported fields }
type ElectrumConfig ¶
type ElectrumConfig struct { Btc ElectrumOptions Liquid ElectrumOptions }
type ElectrumOptions ¶
type MultiTxProvider ¶
type MultiTxProvider struct { TxProvider Providers []TxProvider }
func (MultiTxProvider) BroadcastTransaction ¶
func (m MultiTxProvider) BroadcastTransaction(txHex string) (txId string, err error)
func (MultiTxProvider) GetRawTransaction ¶
func (m MultiTxProvider) GetRawTransaction(txId string) (hex string, err error)
func (MultiTxProvider) IsTransactionConfirmed ¶
func (m MultiTxProvider) IsTransactionConfirmed(txId string) (confirmed bool, err error)
type Onchain ¶
type Onchain struct { Btc *Currency Liquid *Currency Network *boltz.Network Wallets []Wallet OnWalletChange *utils.ChannelForwarder[[]Wallet] }
func (*Onchain) BroadcastTransaction ¶
func (onchain *Onchain) BroadcastTransaction(transaction boltz.Transaction) (string, error)
func (*Onchain) Disconnect ¶
func (onchain *Onchain) Disconnect()
func (*Onchain) EstimateFee ¶
func (*Onchain) FindOutput ¶
func (onchain *Onchain) FindOutput(info OutputArgs) (*OutputResult, error)
func (*Onchain) GetAnyWallet ¶
func (onchain *Onchain) GetAnyWallet(checker WalletChecker) (Wallet, error)
func (*Onchain) GetBlockHeight ¶
func (*Onchain) GetBlockProvider ¶
func (onchain *Onchain) GetBlockProvider(currency boltz.Currency) BlockProvider
func (*Onchain) GetCurrency ¶
func (*Onchain) GetTransaction ¶
func (*Onchain) GetTransactionFee ¶
func (*Onchain) GetUnspentOutputs ¶
func (*Onchain) GetWallets ¶
func (onchain *Onchain) GetWallets(checker WalletChecker) []Wallet
func (*Onchain) IsTransactionConfirmed ¶
func (*Onchain) RegisterBlockListener ¶
func (onchain *Onchain) RegisterBlockListener(ctx context.Context, currency boltz.Currency) *utils.ChannelForwarder[*BlockEpoch]
func (*Onchain) RemoveWallet ¶
type OutputArgs ¶
type OutputResult ¶
type OutputResult struct { Transaction boltz.Transaction Vout uint32 Value uint64 }
type TransactionOutput ¶
type TxProvider ¶
type TxProvider interface { GetRawTransaction(txId string) (string, error) BroadcastTransaction(txHex string) (string, error) IsTransactionConfirmed(txId string) (bool, error) }
func NewBoltzTxProvider ¶
func NewBoltzTxProvider(boltz *boltz.Api, currency boltz.Currency) TxProvider
type Wallet ¶
type Wallet interface { NewAddress() (string, error) SendToAddress(address string, amount uint64, satPerVbyte float64, sendAll bool) (string, error) Ready() bool GetBalance() (*Balance, error) GetWalletInfo() WalletInfo Disconnect() error GetTransactions(limit, offset uint64) ([]*WalletTransaction, error) }
type WalletChecker ¶
type WalletChecker struct { Id *Id Name *string Currency boltz.Currency AllowReadonly bool TenantId *Id }
func (*WalletChecker) Allowed ¶
func (walletChecker *WalletChecker) Allowed(wallet Wallet) bool
type WalletInfo ¶
func (WalletInfo) InsufficientBalanceError ¶
func (info WalletInfo) InsufficientBalanceError(amount uint64) error
type WalletTransaction ¶
Click to show internal directories.
Click to hide internal directories.