Struct ergo_lib_wasm::box_selector::SimpleBoxSelector[][src]

pub struct SimpleBoxSelector(_);

Naive box selector, collects inputs until target balance is reached

Implementations

impl SimpleBoxSelector[src]

pub fn new() -> Self[src]

Create empty SimpleBoxSelector

pub fn select(
    &self,
    inputs: &ErgoBoxes,
    target_balance: &BoxValue,
    target_tokens: &Tokens
) -> Result<BoxSelection, JsValue>
[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.

Trait Implementations

impl FromWasmAbi for SimpleBoxSelector[src]

type Abi = u32

The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more

impl IntoWasmAbi for SimpleBoxSelector[src]

type Abi = u32

The wasm ABI type that this converts into when crossing the ABI boundary. Read more

impl OptionFromWasmAbi for SimpleBoxSelector[src]

impl OptionIntoWasmAbi for SimpleBoxSelector[src]

impl RefFromWasmAbi for SimpleBoxSelector[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

type Anchor = Ref<'static, SimpleBoxSelector>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don't persist beyond one function call, and so that they remain anonymous. Read more

impl RefMutFromWasmAbi for SimpleBoxSelector[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

type Anchor = RefMut<'static, SimpleBoxSelector>

Same as RefFromWasmAbi::Anchor

impl WasmDescribe for SimpleBoxSelector[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<F> TryExtractInto<F> for F[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,