Every token needs a smart contract on the blockchain but you don’t need to know Solidity to build it.

1

Create a contract

Firstly, we need to create the contract that we will be using. In this case, we will create a non-fungible token contract.

curl --request POST \
--url https://protocol-sandbox.lumx.io/contracts \
--header 'Bearer: $API_KEY' \
--header 'Content-Type: application/json' \
--data '
{
  "type": "non-fungible",
  "name": "First contract",
  "description": "My first non-fungible contract"
}
'

You will receive a status 201 with an object containing the ID of the contract.

2

Create an token type

Now, it’s time to create a token type and link it to the contract that we’ve created. Think of a token type as the template for the token that you want to create.

Remember to switch <CONTRACT_ID>.
curl --request POST \
--url https://protocol-sandbox.lumx.io/contracts/<CONTRACT_ID>/token-types \
--header 'Bearer: $API_KEY' \
--header 'Content-Type: application/json' \
--data '
{
  "name": "First item type",
  "description": "My first item type",
  "maxSupply": 100
}
'

You will receive a status 201 with an object containing the ID of the token type.

3

It's time to deploy it

The last step is to deploy your contract to the blockchain. You can do that with one simple request.

Remember to switch <CONTRACT_ID>.
curl --request POST \
--url https://protocol-sandbox.lumx.io/contracts/<CONTRACT_ID>/deploy \
--header 'Bearer: $API_KEY'

You will receive a status 200 with an object containing the contract address on the blockchain.

Congratulations! You can check your contract on the block explorer. Just paste the contract address in the search field.

Coming up next, let’s create a wallet to receive the token from your newly created smart contract.

Any problems during this guide? Check some possible troubleshooting.