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: Amount,
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,
pub contract_flags: u8,
/* 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: AmountThe 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.
contract_flags: u8Feature flags for the contract (bit 0: refund to accepter).
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OfferedContract
impl Debug for OfferedContract
Source§impl From<&OfferedContract> for ContractInfo
impl From<&OfferedContract> for ContractInfo
Source§fn from(offered_contract: &OfferedContract) -> SerContractInfo
fn from(offered_contract: &OfferedContract) -> SerContractInfo
Source§impl From<&OfferedContract> for OfferDlc
impl From<&OfferedContract> for OfferDlc
Source§fn from(offered_contract: &OfferedContract) -> OfferDlc
fn from(offered_contract: &OfferedContract) -> OfferDlc
Source§impl From<&OfferedContract> for Vec<OracleInfo>
impl From<&OfferedContract> for Vec<OracleInfo>
Source§fn from(offered_contract: &OfferedContract) -> Vec<SerOracleInfo>
fn from(offered_contract: &OfferedContract) -> Vec<SerOracleInfo>
Source§impl Readable for OfferedContract
impl Readable for OfferedContract
Source§impl Writeable for OfferedContract
impl Writeable for OfferedContract
Auto Trait Implementations§
impl Freeze for OfferedContract
impl RefUnwindSafe for OfferedContract
impl Send for OfferedContract
impl Sync for OfferedContract
impl Unpin for OfferedContract
impl UnsafeUnpin for OfferedContract
impl UnwindSafe for OfferedContract
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LengthReadable for Twhere
T: Readable,
impl<T> LengthReadable for Twhere
T: Readable,
Source§fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
Self in from the given LengthLimitedRead.