[][src]Trait ergo_lib::wallet::box_selector::BoxSelector

pub trait BoxSelector<T: ErgoBoxAssets> {
    pub fn select(
        &self,
        inputs: Vec<T>,
        target_balance: BoxValue,
        target_tokens: &[Token]
    ) -> Result<BoxSelection<T>, BoxSelectorError>; }

Box selector

Required methods

pub fn select(
    &self,
    inputs: Vec<T>,
    target_balance: BoxValue,
    target_tokens: &[Token]
) -> Result<BoxSelection<T>, BoxSelectorError>
[src]

Selects boxes out of the provided inputs to satisfy target balance and tokens inputs - spendable boxes target_balance - value (in nanoERGs) to find in input boxes (inputs) target_tokens - token amounts to find in input boxes(inputs)

Loading content...

Implementors

impl<T: ErgoBoxAssets> BoxSelector<T> for SimpleBoxSelector[src]

pub fn select(
    &self,
    inputs: Vec<T>,
    target_balance: BoxValue,
    target_tokens: &[Token]
) -> Result<BoxSelection<T>, BoxSelectorError>
[src]

Selects inputs to satisfy target balance and tokens. inputs - available inputs (returns an error, if empty), target_balance - coins (in nanoERGs) needed, target_tokens - amount of tokens needed. Returns selected inputs and box assets(value+tokens) with change.

Loading content...