-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix also an issue for calculating the required fee.
- Loading branch information
Showing
3 changed files
with
56 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Issue an asset | ||
|
||
One of the most important parts of a blockchain solution is providing a rocksolid interface for token. In terms of the ardor blockchain they are called "assets". | ||
|
||
Currently there are to major types of assets. Singleton and "normal" assets. Normal assets are just the same like singleton assets with one major difference. Singleton assets only exsits once. | ||
|
||
From an endpoint perspective the are the same: | ||
|
||
```php | ||
public function issueAsset(String $name, $description = null, int $amount = 1, int $decimals = 0, int $chain = 0, array $more = []) | ||
``` | ||
|
||
```php | ||
|
||
use \AMBERSIVE\Ardor\Classes\ArdorAccounts; | ||
use \AMBERSIVE\Ardor\Models\ArdorAssets; | ||
|
||
... | ||
|
||
public function returnAcccountData():ArdorAccount { | ||
|
||
$ardor = new ArdorAssets(); | ||
$account = $ardor->issueAsset("My Asset", "Test description", 1, 0, 2); | ||
|
||
} | ||
``` | ||
|
||
Sometime it is required to transport more information within an asset. Therefor you can make use of the second param. | ||
If you pass an array it will automatically transform it to json : | ||
|
||
```php | ||
|
||
... | ||
|
||
public function returnAcccountData():ArdorAccount { | ||
|
||
$ardor = new ArdorAssets(); | ||
$account = $ardor->issueAsset( | ||
"My Asset", [ | ||
"msg" => "Test description" | ||
], 1, 0, 2); | ||
|
||
} | ||
``` | ||
|
||
--- | ||
Return to the [overview](../overview.md) page for all topics. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters