[−][src]Struct ergo_lib::chain::ergo_box::box_builder::ErgoBoxCandidateBuilder
ErgoBoxCandidate builder
Implementations
impl ErgoBoxCandidateBuilder
[src]
pub fn new(value: BoxValue, ergo_tree: ErgoTree, creation_height: u32) -> Self
[src]
Create builder with required box parameters:
value
- box value in nanoErgs,
ergo_tree
- ErgoTree to guard this box,
current_height
- chain height that will be set in the built 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, ErgoBoxCandidateBuilderError>
[src]
Calculate serialized box size(in bytes)
pub fn calc_min_box_value(
&self
) -> Result<BoxValue, ErgoBoxCandidateBuilderError>
[src]
&self
) -> Result<BoxValue, ErgoBoxCandidateBuilderError>
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: Token)
[src]
Add given token id and token amount
pub fn build(self) -> Result<ErgoBoxCandidate, ErgoBoxCandidateBuilderError>
[src]
Build the box candidate
Trait Implementations
impl Clone for ErgoBoxCandidateBuilder
[src]
pub fn clone(&self) -> ErgoBoxCandidateBuilder
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug 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> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,