Skip to content

Commit

Permalink
docs: adding user facing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Oct 17, 2023
1 parent f285eea commit 1a46dce
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ Human readable name for this upload, for use in file listings.

### mint

Mint a new fungible or non-fungible assets on Algorand.
Mint new fungible or non-fungible assets on Algorand.

```shell
algokit task mint [OPTIONS]
Expand Down
2 changes: 1 addition & 1 deletion docs/features/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ AlgoKit Tasks are a collection of handy tasks that can be used to perform variou
- [Sending transactions](./tasks/send.md) - Send signed goal clerk compatible Algorand transactions.
- [NFD lookups](./tasks/nfd.md) - Perform a lookup via NFD domain or address, returning the associated address or domain respectively using the AlgoKit CLI.
- [IPFS uploads](./tasks/ipfs.md) - Upload files to IPFS.
- ARC19 asset minting - Coming soon!
- [Asset minting](./tasks/mint.md) - Mint new fungible or non-fungible assets on Algorand.
66 changes: 66 additions & 0 deletions docs/features/tasks/mint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# AlgoKit Task Mint

The AlgoKit Mint feature allows you to mint new fungible or non-fungible assets on the Algorand blockchain. This feature supports the creation of assets, validation of asset parameters, and uploading of asset metadata and image to IPFS using the Web3 Storage provider. Immutable assets are compliant with [ARC3](https://arc.algorand.foundation/ARCs/arc-0003), while mutable are based using [ARC19](https://arc.algorand.foundation/ARCs/arc-0019) standard.

## Usage

Available commands and possible usage as follows:

```bash
Usage: algokit task mint [OPTIONS]

Mint new fungible or non-fungible assets on Algorand.

Options:
--creator TEXT Address or alias of the asset creator. [required]
-n, --name TEXT Asset name. [required]
-u, --unit TEXT Unit name of the asset. [required]
-t, --total INTEGER Total supply of the asset. Defaults to 1.
-d, --decimals INTEGER Number of decimals. Defaults to 0.
-i, --image FILE Path to the asset image file to be uploaded to IPFS. [required]
-m, --metadata FILE Path to the ARC19 compliant asset metadata file to be uploaded to IPFS. If not
provided, a default metadata object will be generated automatically based on asset-
name, decimals and image. For more details refer to
https://arc.algorand.foundation/ARCs/arc-0003#json-metadata-file-schema.
--mutable / --immutable Whether the asset should be mutable or immutable. Refers to `ARC19` by default.
--nft / --ft Whether the asset should be validated as NFT or FT. Refers to NFT by default and
validates canonical definitions of pure or fractional NFTs as per ARC3 standard.
-n, --network [localnet|testnet|mainnet]
Network to use. Refers to `localnet` by default.
-h, --help Show this message and exit.
```

## Options

- `--creator TEXT`: Specifies the address or alias of the asset creator. This option is required.
- `-n, --name TEXT`: Specifies the asset name. This option is required.
- `-u, --unit TEXT`: Specifies the unit name of the asset. This option is required.
- `-t, --total INTEGER`: Specifies the total supply of the asset. Defaults to 1.
- `-d, --decimals INTEGER`: Specifies the number of decimals. Defaults to 0.
- `-i, --image PATH`: Specifies the path to the asset image file to be uploaded to IPFS. This option is required.
- `-m, --metadata PATH`: Specifies the path to the ARC19 compliant asset metadata file to be uploaded to IPFS. If not provided, a default metadata object will be generated automatically based on asset-name, decimals and image.
- `--mutable / --immutable`: Specifies whether the asset should be mutable or immutable. Refers to `ARC19` by default.
- `--nft / --ft`: Specifies whether the asset should be validated as NFT or FT. Refers to NFT by default and validates canonical definitions of pure or fractional NFTs as per ARC3 standard.
- `-n, --network [localnet|testnet|mainnet]`: Specifies the network to use. Refers to `localnet` by default.

## Example

To mint a new in interactive mode, you can use the mint command as follows:

```bash
$ algokit task mint
```

This will interactively prompt you for required information, upload the asset image and metadata to IPFS using the Web3 Storage provider and mint a new asset on the Algorand blockchain. The [asset's metadata](https://arc.algorand.foundation/ARCs/arc-0003#json-metadata-file-schema) will be generated automatically based on the provided asset name, decimals, and image.

If you want to provide a custom metadata file, you can use the --metadata flag:

```bash
$ algokit task mint --metadata {PATH_TO_METADATA}
```

If the minting process is successful, the asset ID and transaction ID will be output to the console.

For non interactive mode, refer to usage section above for available options.

> Please note, creator account must have at least 0.2 Algos available to cover minimum balance requirements.
2 changes: 1 addition & 1 deletion src/algokit/cli/tasks/mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _validate_asset_name(context: click.Context, param: click.Parameter, value:

@click.command(
name="mint",
help="Mint a new fungible or non-fungible assets on Algorand.",
help="Mint new fungible or non-fungible assets on Algorand.",
)
@click.option(
"--creator",
Expand Down
2 changes: 1 addition & 1 deletion src/algokit/core/tasks/mint/mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def mint_token( # noqa: PLR0913
decimals: int | None = 0,
) -> tuple[int, str]:
"""
Mint a new token on the Algorand blockchain.
Mint new token on the Algorand blockchain.
Args:
client (algod.AlgodClient): An instance of the `algod.AlgodClient` class representing the Algorand node.
Expand Down

0 comments on commit 1a46dce

Please sign in to comment.