pub struct TokenBuilder {
pub name: Option<String>,
pub symbol: Option<String>,
pub total_supply: Option<i64>,
pub current_supply: Option<f64>,
pub initial_supply_percentage: Option<f64>,
pub inflation_rate: Option<f64>,
pub burn_rate: Option<f64>,
pub initial_price: Option<f64>,
pub airdrop_percentage: Option<f64>,
pub unlock_schedule: Option<Vec<UnlockEvent>>,
}
Expand description
Builder for creating a new token. The builder allows to configure the token with the following parameters.
Fields§
§name: Option<String>
Name of the token. Required field.
symbol: Option<String>
Symbol of the token. Default value: “TKN”.
total_supply: Option<i64>
Total supply of the token. Default value: 1,000,000.
current_supply: Option<f64>
Current supply of the token. Default value: 0.
initial_supply_percentage: Option<f64>
Initial supply of the token, in percentage of total supply. Default value: 100%.
inflation_rate: Option<f64>
Annual percentage increase in supply, if supply is inflationary. Optional field.
burn_rate: Option<f64>
Percentage of tokens burned during each transaction, if deflationary. Optional field.
initial_price: Option<f64>
Initial price of the token in simulation. Default value: 1.
airdrop_percentage: Option<f64>
Airdrop amount of the token, in percentage of total supply. Optional field.
unlock_schedule: Option<Vec<UnlockEvent>>
Unlock schedule. Optional field.
Implementations§
Source§impl TokenBuilder
impl TokenBuilder
Sourcepub fn total_supply(self, total_supply: i64) -> Self
pub fn total_supply(self, total_supply: i64) -> Self
Sourcepub fn current_supply(self, current_supply: f64) -> Self
pub fn current_supply(self, current_supply: f64) -> Self
Sourcepub fn initial_supply_percentage(self, initial_supply_percentage: f64) -> Self
pub fn initial_supply_percentage(self, initial_supply_percentage: f64) -> Self
Sourcepub fn inflation_rate(self, inflation_rate: f64) -> Self
pub fn inflation_rate(self, inflation_rate: f64) -> Self
Sourcepub fn initial_price(self, initial_price: f64) -> Self
pub fn initial_price(self, initial_price: f64) -> Self
Sourcepub fn airdrop_percentage(self, airdrop_percentage: f64) -> Self
pub fn airdrop_percentage(self, airdrop_percentage: f64) -> Self
Sourcepub fn unlock_schedule(self, unlock_schedule: Vec<UnlockEvent>) -> Self
pub fn unlock_schedule(self, unlock_schedule: Vec<UnlockEvent>) -> Self
Trait Implementations§
Source§impl Debug for TokenBuilder
impl Debug for TokenBuilder
Source§impl Default for TokenBuilder
impl Default for TokenBuilder
Source§fn default() -> TokenBuilder
fn default() -> TokenBuilder
Returns the “default value” for a type. Read more
Source§impl PartialEq for TokenBuilder
impl PartialEq for TokenBuilder
impl StructuralPartialEq for TokenBuilder
Auto Trait Implementations§
impl Freeze for TokenBuilder
impl RefUnwindSafe for TokenBuilder
impl Send for TokenBuilder
impl Sync for TokenBuilder
impl Unpin for TokenBuilder
impl UnwindSafe for TokenBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more