Asset
Last updated
Last updated
- Defines a custom asset An asset definition operation registers an asset with the Fractal ledger. An asset is a digital resource that can be issued and transferred. An asset has an issuer and a unique code. The DefineAsset operation must provide an unused token code. The transaction containing the DefineAsset operation will fail if there is already another asset on the ledger with the same code.
Parameters:
<WalletKeypar>
- Wallet keypair
<string>
- asset name
<string>
- (optional) asset memo
<string>
- (optional) A set of rules (options) for the new asset.
Results:
Promise<TransactionBuilder>
- An instance of TransactionBuilder
from Ledger
Example:
- Return Asset Code This method returns Asset Code by given asset type
<number[]>
- asset type
Promise<string>
- asset code.
- Get Asset Details This method returns Asset details by given asset code
<string>
- asset code
Promise<IAsset>
- An instance of FindoraWallet.IAsset
- Returns the pre-defined FRA asset code
FRA asset code can not be re-defined, as well as it can not be used in the DefineAset
or IssueAsset
operations.
This is the main asset code, which is used when user needs to create a transaction, or calculate the fee and so on.
Promise<string>
- Fractal Asset code
- Return Destination's Public Key This method returns the public key of destination
Promise<XfrPublicKey>
- An instance of XfrPublicKey
.
- Return Minimal Fee for transaction This method returns the required minimal fee for transaction
Promise<BigInt>
- An instance of BigInt
.
- Returns a random asset code
Using Ledger
, it generates and returns a random custom asset code
Promise<string>
- Asset code.
- Issue some amount of a custom asset
Asset issuers can use the IssueAsset
operation to mint units of an asset that they have created. Concretely, the IssueAsset
operation creates asset records that represent ownership by a public key of a certain amount of an asset. These asset records are stored in a structure called a transaction output (TXO).
<WalletKeypar>
- wallet keypair
<string>
- asset name
<string>
- amount to be issued
<AssetBlindRules>
- asset blind rules
<number>
- (optional) asset decimals. This parameter can define how many numbers after the comma would this asset have
Promise<TransactionBuilder>
- An instance of TransactionBuilder
from Ledger
Parameters:
Results:
Example:
Parameters:
Results:
Example:
Results:
Example:
Results:
Example:
Results:
Example:
Results:
Example:
Parameters:
Results:
Example: