pub struct ConnectorChain { /* private fields */ }Expand description
A chain of connector outputs.
Each connector is a p2tr keyspend output for the provided key. Each connector has the p2tr dust value.
Implementations§
Source§impl ConnectorChain
impl ConnectorChain
Sourcepub fn total_weight(len: usize) -> Weight
pub fn total_weight(len: usize) -> Weight
The total size in vbytes of the connector tree.
Sourcepub fn required_budget(len: usize) -> Amount
pub fn required_budget(len: usize) -> Amount
The budget needed for a chain of length len to pay for
one dust for the connector output per tx
Sourcepub fn output_script(pubkey: PublicKey) -> ScriptBuf
pub fn output_script(pubkey: PublicKey) -> ScriptBuf
Create the scriptPubkey to create a connector chain using the given publick key.
Sourcepub fn address(network: Network, pubkey: PublicKey) -> Address
pub fn address(network: Network, pubkey: PublicKey) -> Address
Create the address to create a connector chain using the given publick key.
Sourcepub fn new(len: usize, utxo: OutPoint, pubkey: PublicKey) -> ConnectorChain
pub fn new(len: usize, utxo: OutPoint, pubkey: PublicKey) -> ConnectorChain
Create a new connector tree.
Before calling this method, a utxo should be created with a scriptPubkey as specified by ConnectorChain::output_script or ConnectorChain::address. The amount in this output is expected to be exaclty equal to ConnectorChain::required_budget for the given length.
pub fn len(&self) -> usize
Sourcepub fn iter_signed_txs(
&self,
sign_key: &Keypair,
) -> Result<ConnectorTxIter<'_>, InvalidSigningKeyError>
pub fn iter_signed_txs( &self, sign_key: &Keypair, ) -> Result<ConnectorTxIter<'_>, InvalidSigningKeyError>
Iterator over the signed transactions in this chain.
We expect the internal key here, not the output key.
Sourcepub fn iter_unsigned_txs(&self) -> ConnectorTxIter<'_> ⓘ
pub fn iter_unsigned_txs(&self) -> ConnectorTxIter<'_> ⓘ
Iterator over the transactions in this chain.
Sourcepub fn connectors(&self) -> ConnectorIter<'_> ⓘ
pub fn connectors(&self) -> ConnectorIter<'_> ⓘ
Iterator over the connector outpoints and unsigned txs in this chain.
Sourcepub fn connectors_signed(
&self,
sign_key: &Keypair,
) -> Result<ConnectorIter<'_>, InvalidSigningKeyError>
pub fn connectors_signed( &self, sign_key: &Keypair, ) -> Result<ConnectorIter<'_>, InvalidSigningKeyError>
Iterator over the connector outpoints and signed txs in this chain.
We expect the internal key here, not the output key.
Trait Implementations§
Source§impl Clone for ConnectorChain
impl Clone for ConnectorChain
Source§fn clone(&self) -> ConnectorChain
fn clone(&self) -> ConnectorChain
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more