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: Vec<FundingInput>,
pub fund_output_serial_id: u64,
pub fee_rate_per_vb: u64,
pub cet_locktime: u32,
pub refund_locktime: u32,
/* private fields */
}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: Vec<FundingInput>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(
id: ContractId,
contract: &ContractInput,
oracle_announcements: Vec<Vec<OracleAnnouncement>>,
offer_params: &PartyParams,
funding_inputs: &[FundingInput],
counter_party: &PublicKey,
refund_delay: u32,
cet_locktime: u32,
keys_id: KeysId,
) -> Self
pub fn new( id: ContractId, contract: &ContractInput, oracle_announcements: Vec<Vec<OracleAnnouncement>>, offer_params: &PartyParams, funding_inputs: &[FundingInput], counter_party: &PublicKey, refund_delay: u32, cet_locktime: u32, keys_id: KeysId, ) -> Self
Creates a new OfferedContract from the given parameters.
Sourcepub fn try_from_offer_dlc(
offer_dlc: &OfferDlc,
counter_party: PublicKey,
keys_id: KeysId,
) -> Result<OfferedContract, Error>
pub fn try_from_offer_dlc( offer_dlc: &OfferDlc, counter_party: PublicKey, keys_id: KeysId, ) -> Result<OfferedContract, Error>
Convert an OfferDlc message to an OfferedContract.
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