1 // This file is Copyright its original authors, visible in version control
4 // This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
5 // or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
7 // You may not use this file except in accordance with one or both of these
10 //! Structs and traits which allow other parts of rust-lightning to interact with the blockchain.
12 use bitcoin::blockdata::script::Script;
13 use bitcoin::hash_types::Txid;
15 use chain::transaction::OutPoint;
17 pub mod chaininterface;
19 pub mod keysinterface;
21 /// An interface for providing [`WatchEvent`]s.
23 /// [`WatchEvent`]: enum.WatchEvent.html
24 pub trait WatchEventProvider {
25 /// Releases events produced since the last call. Subsequent calls must only return new events.
26 fn release_pending_watch_events(&self) -> Vec<WatchEvent>;
29 /// An event indicating on-chain activity to watch for pertaining to a channel.
31 /// Watch for a transaction with `txid` and having an output with `script_pubkey` as a spending
34 /// Identifier of the transaction.
37 /// Spending condition for an output of the transaction.
38 script_pubkey: Script,
40 /// Watch for spends of a transaction output identified by `outpoint` having `script_pubkey` as
41 /// the spending condition.
43 /// Identifier for the output.
46 /// Spending condition for the output.
47 script_pubkey: Script,