Documentation ¶
Index ¶
- func FilterUnconfirmedHeuristic[UTXO UtxoI](unspentOutputs []UTXO) []UTXO
- func LegacyFeeFilter(chain *xc.ChainConfig, satsPerByte uint64, multiplier float64, ...) uint64
- func MinFeePerByte(chain *xc.ChainConfig) uint64
- type Outpoint
- type Output
- type TxInput
- func (input *TxInput) GetDriver() xc.Driver
- func (txInput *TxInput) GetGetPricePerByte() xc.AmountBlockchain
- func (txInput *TxInput) HasSameUtxoAs(other *TxInput) (*Outpoint, bool)
- func (input *TxInput) IndependentOf(other xc.TxInput) (independent bool)
- func (input *TxInput) SafeFromDoubleSend(others ...xc.TxInput) (safe bool)
- func (txInput *TxInput) SetAmount(amount xc.AmountBlockchain)
- func (input *TxInput) SetGasFeePriority(other xc.GasFeePriority) error
- func (txInput *TxInput) SetPublicKey(publicKeyBytes []byte) error
- func (txInput *TxInput) SetPublicKeyFromStr(publicKeyStr string) error
- func (txInput *TxInput) SumUtxo() *xc.AmountBlockchain
- type UtxoI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterUnconfirmedHeuristic ¶
func FilterUnconfirmedHeuristic[UTXO UtxoI](unspentOutputs []UTXO) []UTXO
func LegacyFeeFilter ¶
func LegacyFeeFilter(chain *xc.ChainConfig, satsPerByte uint64, multiplier float64, maxGasPrice float64) uint64
Previously we would apply multiplier during estimation, rather than during tx-building/serialization. This should be removed with the legacy endpoints.
Types ¶
type Output ¶
type Output struct { Outpoint `json:"outpoint"` Value xc.AmountBlockchain `json:"value"` PubKeyScript []byte `json:"pubkey_script"` }
func FilterForMinUtxoSet ¶
func FilterForMinUtxoSet(unspentOutputs []Output, targetAmount xc.AmountBlockchain, minUtxo int) []Output
1. sort unspentOutputs from lowest to highest 2. grab the minimum amount of UTXO needed to satify amount 3. tack on the smallest utxo's until `minUtxo` is reached. This ensures a small number of UTXO are used for transaction while also consolidating some smaller utxo into the transaction. Returns the total balance of the min utxo set. txInput.inputs are updated to the new set.
func NewOutputs ¶
type TxInput ¶
type TxInput struct { xc.TxInputEnvelope UnspentOutputs []Output `json:"unspent_outputs"` FromPublicKey []byte `json:"from_pubkey"` GasPricePerByte xc.AmountBlockchain `json:"gas_price_per_byte"` }
TxInput for Bitcoin
func (*TxInput) GetGetPricePerByte ¶
func (txInput *TxInput) GetGetPricePerByte() xc.AmountBlockchain
func (*TxInput) HasSameUtxoAs ¶
Indicate if another txInput has a same UTXO and returns the first one.
func (*TxInput) IndependentOf ¶
func (*TxInput) SafeFromDoubleSend ¶
func (*TxInput) SetAmount ¶
func (txInput *TxInput) SetAmount(amount xc.AmountBlockchain)
func (*TxInput) SetGasFeePriority ¶
func (input *TxInput) SetGasFeePriority(other xc.GasFeePriority) error
func (*TxInput) SetPublicKey ¶
func (*TxInput) SetPublicKeyFromStr ¶
func (*TxInput) SumUtxo ¶
func (txInput *TxInput) SumUtxo() *xc.AmountBlockchain
Click to show internal directories.
Click to hide internal directories.