CoinJoinSession

Struct CoinJoinSession 

Source
pub struct CoinJoinSession { /* private fields */ }
Expand description

CoinJoin session for coordinator-less protocol.

Implementations§

Source§

impl CoinJoinSession

Source

pub fn new(output_amount: u64) -> Self

Create a new CoinJoin session.

Source

pub fn id(&self) -> &[u8; 32]

Get session ID.

Source

pub fn state(&self) -> SessionState

Get current state.

Source

pub fn output_amount(&self) -> u64

Get output amount.

Source

pub fn participant_count(&self) -> usize

Get participant count.

Source

pub fn set_min_participants(&mut self, min: usize)

Set minimum participants.

Source

pub fn set_max_participants(&mut self, max: usize)

Set maximum participants.

Source

pub fn join(&mut self, participant: Participant) -> Result<JoinResponse>

Join the session as a participant.

Source

pub fn build_transaction(&mut self) -> Result<&CoinJoinTransaction>

Build the CoinJoin transaction.

Source

pub fn submit_signature( &mut self, participant_id: &str, signature: Vec<u8>, ) -> Result<()>

Submit a signature.

Source

pub fn transaction(&self) -> Option<&CoinJoinTransaction>

Get the built transaction.

Source

pub fn signatures(&self) -> &[(String, Vec<u8>)]

Get collected signatures.

Source

pub fn is_complete(&self) -> bool

Check if session is complete.

Source

pub fn cancel(&mut self)

Cancel the session.

Trait Implementations§

Source§

impl From<&CoinJoinSession> for SessionAnnouncement

Source§

fn from(session: &CoinJoinSession) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.