pub struct AssetConfigTransactionBuilder { /* private fields */ }
Expand description
Builder for AssetConfigTransactionFields
.
Implementations§
Source§impl AssetConfigTransactionBuilder
impl AssetConfigTransactionBuilder
Sourcepub fn header(&mut self, value: TransactionHeader) -> &mut Self
pub fn header(&mut self, value: TransactionHeader) -> &mut Self
Common transaction header fields.
Sourcepub fn asset_id(&mut self, value: u64) -> &mut Self
pub fn asset_id(&mut self, value: u64) -> &mut Self
ID of the asset to operate on.
For asset creation, this must be 0. For asset reconfiguration this is the ID of the existing asset to be reconfigured, For asset destroy this is the ID of the existing asset to be destroyed.
Sourcepub fn total(&mut self, value: u64) -> &mut Self
pub fn total(&mut self, value: u64) -> &mut Self
The total amount of the smallest divisible (decimal) unit to create.
Required when creating a new asset. For example, if creating a asset with 2 decimals and wanting a total supply of 100 units, this value should be 10000.
This field can only be specified upon asset creation.
Sourcepub fn decimals(&mut self, value: u32) -> &mut Self
pub fn decimals(&mut self, value: u32) -> &mut Self
The amount of decimal places the asset should have.
If unspecified then the asset will be in whole units (i.e. 0
).
- If 0, the asset is not divisible;
- If 1, the base unit of the asset is in tenths;
- If 2, the base unit of the asset is in hundredths;
- If 3, the base unit of the asset is in thousandths;
and so on up to 19 decimal places.
This field can only be specified upon asset creation.
Sourcepub fn default_frozen(&mut self, value: bool) -> &mut Self
pub fn default_frozen(&mut self, value: bool) -> &mut Self
Whether the asset is frozen by default for all accounts.
Defaults to false
.
If true
then for anyone apart from the creator to hold the
asset it needs to be unfrozen per account using an asset freeze
transaction from the freeze
account, which must be set on creation.
This field can only be specified upon asset creation.
Sourcepub fn asset_name(&mut self, value: String) -> &mut Self
pub fn asset_name(&mut self, value: String) -> &mut Self
The optional name of the asset.
Max size is 32 bytes.
This field can only be specified upon asset creation.
Sourcepub fn unit_name(&mut self, value: String) -> &mut Self
pub fn unit_name(&mut self, value: String) -> &mut Self
The optional name of the unit of this asset (e.g. ticker name).
Max size is 8 bytes.
This field can only be specified upon asset creation.
Sourcepub fn url(&mut self, value: String) -> &mut Self
pub fn url(&mut self, value: String) -> &mut Self
Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).
Max size is 96 bytes.
This field can only be specified upon asset creation.
Sourcepub fn metadata_hash(&mut self, value: [u8; 32]) -> &mut Self
pub fn metadata_hash(&mut self, value: [u8; 32]) -> &mut Self
32-byte hash of some metadata that is relevant to your asset and/or asset holders.
The format of this metadata is up to the application.
This field can only be specified upon asset creation.
Sourcepub fn manager(&mut self, value: Address) -> &mut Self
pub fn manager(&mut self, value: Address) -> &mut Self
The address of the optional account that can manage the configuration of the asset and destroy it.
The configuration fields it can change are manager
, reserve
, clawback
, and freeze
.
If not set or set to the Zero address the asset becomes permanently immutable.
Sourcepub fn reserve(&mut self, value: Address) -> &mut Self
pub fn reserve(&mut self, value: Address) -> &mut Self
The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
This address has no specific authority in the protocol itself and is informational only.
Some standards like ARC-19 rely on this field to hold meaningful data.
It can be used in the case where you want to signal to holders of your asset that the uncirculated units of the asset reside in an account that is different from the default creator account.
If not set or set to the Zero address the field is permanently empty.
Sourcepub fn freeze(&mut self, value: Address) -> &mut Self
pub fn freeze(&mut self, value: Address) -> &mut Self
The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
If empty, freezing is not permitted.
If not set or set to the Zero address the field is permanently empty.
Sourcepub fn clawback(&mut self, value: Address) -> &mut Self
pub fn clawback(&mut self, value: Address) -> &mut Self
The address of the optional account that can clawback holdings of this asset from any account.
This field should be used with caution as the clawback account has the ability to unconditionally take assets from any account.
If empty, clawback is not permitted.
If not set or set to the Zero address the field is permanently empty.
Sourcepub fn build_fields(
&self,
) -> Result<AssetConfigTransactionFields, AssetConfigTransactionBuilderError>
pub fn build_fields( &self, ) -> Result<AssetConfigTransactionFields, AssetConfigTransactionBuilderError>
Source§impl AssetConfigTransactionBuilder
impl AssetConfigTransactionBuilder
pub fn build(&self) -> Result<Transaction, AssetConfigTransactionBuilderError>
Trait Implementations§
Source§impl Clone for AssetConfigTransactionBuilder
impl Clone for AssetConfigTransactionBuilder
Source§fn clone(&self) -> AssetConfigTransactionBuilder
fn clone(&self) -> AssetConfigTransactionBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more