Struct ergo_lib_wasm::tx_builder::TxBuilder[][src]

pub struct TxBuilder(_);

Unsigned transaction builder

Implementations

impl TxBuilder[src]

pub fn SUGGESTED_TX_FEE() -> BoxValue[src]

Suggested transaction fee (semi-default value used across wallets and dApps as of Oct 2020)

pub fn new(
    box_selection: &BoxSelection,
    output_candidates: &ErgoBoxCandidates,
    current_height: u32,
    fee_amount: &BoxValue,
    change_address: &Address,
    min_change_value: &BoxValue
) -> TxBuilder
[src]

Creates new TxBuilder box_selection - selected input boxes (via super::box_selector) output_candidates - output boxes to be "created" in this transaction, current_height - chain height that will be used in additionally created boxes (change, miner's fee, etc.), fee_amount - miner's fee, change_address - change (inputs - outputs) will be sent to this address, min_change_value - minimal value of the change to be sent to change_address, value less than that will be given to miners,

pub fn set_data_inputs(&mut self, data_inputs: &DataInputs)[src]

Set transaction's data inputs

pub fn build(&self) -> Result<UnsignedTransaction, JsValue>[src]

Build the unsigned transaction

pub fn box_selection(&self) -> BoxSelection[src]

Get inputs

pub fn data_inputs(&self) -> DataInputs[src]

Get data inputs

pub fn output_candidates(&self) -> ErgoBoxCandidates[src]

Get outputs EXCLUDING fee and change

pub fn current_height(&self) -> u32[src]

Get current height

pub fn fee_amount(&self) -> BoxValue[src]

Get fee amount

pub fn change_address(&self) -> Address[src]

Get change

pub fn min_change_value(&self) -> BoxValue[src]

Get min change value

Trait Implementations

impl FromWasmAbi for TxBuilder[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 TxBuilder[src]

type Abi = u32

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

impl OptionFromWasmAbi for TxBuilder[src]

impl OptionIntoWasmAbi for TxBuilder[src]

impl RefFromWasmAbi for TxBuilder[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

type Anchor = Ref<'static, TxBuilder>

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 TxBuilder[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

type Anchor = RefMut<'static, TxBuilder>

Same as RefFromWasmAbi::Anchor

impl WasmDescribe for TxBuilder[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>,