Step 1. Mint a token

First, take note of the contract id for the contract you want to use, as well as the item type id for the type of token you want to mint. Also, you’ll need to provide the id of the wallet for which you want to mint the token.

With these values ready, all you need is to use the mint a token endpoint:

curl --request POST \
  --url https://protocol-sandbox.lumx.io/v1/transactions/mints \
  --header 'Authorization: Bearer $API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "itemTypeId": "<item_type_to_be_minted>",
  "walletId": "<wallet_to_receive_the_token>",
  "amount": 1
}'

Step 2. Read mint request

Every new mint is queued up to mitigate the possibility of a transaction failing.

By using the id you received when creating the mint transaction, you can check the transaction’s status on the blockchain. Make a call to the read a transaction endpoint:

curl --request GET \
  --url https://protocol-sandbox.lumx.io/v1/transactions/<id_received_on_step_1> \
  --header 'Authorization: Bearer $API_KEY'

You will receive a status 200 with an object containing the mint request status and transaction hash.

Congratulations! You can check your transaction on the block explorer, using the transaction hash you received.

Any problems during this recipe? Check some possible troubleshooting.