Struct dlc_manager::contract::offered_contract::OfferedContract
source · pub struct OfferedContract {
pub id: [u8; 32],
pub is_offer_party: bool,
pub contract_info: Vec<ContractInfo>,
pub counter_party: PublicKey,
pub offer_params: PartyParams,
pub total_collateral: u64,
pub funding_inputs_info: Vec<FundingInputInfo>,
pub fund_output_serial_id: u64,
pub fee_rate_per_vb: u64,
pub cet_locktime: u32,
pub refund_locktime: u32,
}Expand description
Contains information about a contract that was offered.
Fields§
§id: [u8; 32]The temporary id of the contract.
is_offer_party: boolIndicated whether the contract was proposed or received.
contract_info: Vec<ContractInfo>The set of contract information that are used to generate CET and adaptor signatures.
counter_party: PublicKeyThe public key of the counter-party’s node.
offer_params: PartyParamsThe parameters of the offering party.
total_collateral: u64The sum of both parties collateral.
funding_inputs_info: Vec<FundingInputInfo>Information about the offering party’s funding inputs.
fund_output_serial_id: u64The serial id of the fund output used for output ordering.
fee_rate_per_vb: u64The fee rate to be used to construct the DLC transactions.
cet_locktime: u32The time at which the contract is expected to be closeable.
refund_locktime: u32The time at which the contract becomes refundable.
Implementations§
source§impl OfferedContract
impl OfferedContract
sourcepub fn validate(&self) -> Result<(), Error>
pub fn validate(&self) -> Result<(), Error>
Validate that the contract info covers all the possible outcomes that can be attested by the oracle(s).
sourcepub fn new(
contract: &ContractInput,
oracle_announcements: Vec<Vec<OracleAnnouncement>>,
offer_params: &PartyParams,
funding_inputs_info: &[FundingInputInfo],
counter_party: &PublicKey,
refund_delay: u32,
cet_locktime: u32
) -> Self
pub fn new(
contract: &ContractInput,
oracle_announcements: Vec<Vec<OracleAnnouncement>>,
offer_params: &PartyParams,
funding_inputs_info: &[FundingInputInfo],
counter_party: &PublicKey,
refund_delay: u32,
cet_locktime: u32
) -> Self
Creates a new OfferedContract from the given parameters.
Trait Implementations§
source§impl Clone for OfferedContract
impl Clone for OfferedContract
source§fn clone(&self) -> OfferedContract
fn clone(&self) -> OfferedContract
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more