[−][src]Struct ergo_lib_wasm::ergo_box::box_builder::ErgoBoxCandidateBuilder
ErgoBoxCandidate builder
Implementations
impl ErgoBoxCandidateBuilder
[src]
pub fn new(value: &BoxValue, contract: &Contract, creation_height: u32) -> Self
[src]
Create builder with required box parameters:
value
- amount of money associated with the box
contract
- guarding contract(Contract
), which should be evaluated to true in order
to open(spend) this box
creation_height
- height when a transaction containing the box is created.
It should not exceed height of the block, containing the transaction with this box.
pub fn set_min_box_value_per_byte(&mut self, new_min_value_per_byte: u32)
[src]
Set minimal value (per byte of the serialized box size)
pub fn min_box_value_per_byte(&self) -> u32
[src]
Get minimal value (per byte of the serialized box size)
pub fn set_value(&mut self, new_value: BoxValue)
[src]
Set new box value
pub fn value(&self) -> BoxValue
[src]
Get box value
pub fn calc_box_size_bytes(&self) -> Result<usize, JsValue>
[src]
Calculate serialized box size(in bytes)
pub fn calc_min_box_value(&self) -> Result<BoxValue, JsValue>
[src]
Calculate minimal box value for the current box serialized size(in bytes)
pub fn set_register_value(
&mut self,
register_id: NonMandatoryRegisterId,
value: &Constant
)
[src]
&mut self,
register_id: NonMandatoryRegisterId,
value: &Constant
)
Set register with a given id (R4-R9) to the given value
pub fn register_value(
&self,
register_id: NonMandatoryRegisterId
) -> Option<Constant>
[src]
&self,
register_id: NonMandatoryRegisterId
) -> Option<Constant>
Returns register value for the given register id (R4-R9), or None if the register is empty
pub fn delete_register_value(&mut self, register_id: NonMandatoryRegisterId)
[src]
Delete register value(make register empty) for the given register id (R4-R9)
pub fn mint_token(
&mut self,
token: &Token,
token_name: String,
token_desc: String,
num_decimals: usize
)
[src]
&mut self,
token: &Token,
token_name: String,
token_desc: String,
num_decimals: usize
)
Mint token, as defined in https://github.com/ergoplatform/eips/blob/master/eip-0004.md
token
- token id(box id of the first input box in transaction) and token amount,
token_name
- token name (will be encoded in R4),
token_desc
- token description (will be encoded in R5),
num_decimals
- number of decimals (will be encoded in R6)
pub fn add_token(&mut self, token_id: &TokenId, amount: &TokenAmount)
[src]
Add given token id and token amount
pub fn build(&self) -> Result<ErgoBoxCandidate, JsValue>
[src]
Build the box candidate
Trait Implementations
impl FromWasmAbi for ErgoBoxCandidateBuilder
[src]
type Abi = u32
The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more
pub unsafe fn from_abi(js: u32) -> Self
[src]
impl IntoWasmAbi for ErgoBoxCandidateBuilder
[src]
type Abi = u32
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
pub fn into_abi(self) -> u32
[src]
impl OptionFromWasmAbi for ErgoBoxCandidateBuilder
[src]
impl OptionIntoWasmAbi for ErgoBoxCandidateBuilder
[src]
impl RefFromWasmAbi for ErgoBoxCandidateBuilder
[src]
type Abi = u32
The wasm ABI type references to Self
are recovered from.
type Anchor = Ref<'static, ErgoBoxCandidateBuilder>
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
pub unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl RefMutFromWasmAbi for ErgoBoxCandidateBuilder
[src]
type Abi = u32
Same as RefFromWasmAbi::Abi
type Anchor = RefMut<'static, ErgoBoxCandidateBuilder>
Same as RefFromWasmAbi::Anchor
pub unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl WasmDescribe for ErgoBoxCandidateBuilder
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ErgoBoxCandidateBuilder
[src]
impl !Send for ErgoBoxCandidateBuilder
[src]
impl !Sync for ErgoBoxCandidateBuilder
[src]
impl Unpin for ErgoBoxCandidateBuilder
[src]
impl !UnwindSafe for ErgoBoxCandidateBuilder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
[src]
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
pub fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<F> TryExtractInto<F> for F
[src]
pub fn try_extract_into<T>(self) -> Result<T, TryExtractFromError> where
T: TryExtractFrom<F>,
[src]
T: TryExtractFrom<F>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,