Skip to main content

Creating tokens

Parameters

  • x-wallet-id: Wallet identifier.
  • name: Token name. It must have up to 30 characters.
  • symbol: Token symbol. It must have up to 5 characters.
  • amount: The amount of tokens to mint. It must be an integer with the value in cents, i.e., 123 means 1.23.

Optional Parameters

  • address: Destination address of minted tokens.
  • change_address: Optional address to send the change amount.

Request

curl -X POST -H "X-Wallet-Id: default-wallet" -H "Content-type: application/json" \
--data '{"name": "Test Coin", "symbol": "TSC", "amount": 100}' \
http://localhost:8000/wallet/create-token

Response

The data attribute value has been replaced by the "+" symbol to make the JSON easier to visualize.

{
"success":true,
"configurationString":"[Test Coin:TSC:00c63b9e498522696811f77733aaac000bddc7cdcaa672eeea87e16f1f3bd589:e0d44314]",
"inputs":[
{
"hash":"00d2bbd62eddf0d05b526ce64c8568e6ed56c2378d1b11f11ecaa531d86d4409",
"index":1,
"data":{
"type":"Buffer",
"data":[+]
},
"tx_id":"00d2bbd62eddf0d05b526ce64c8568e6ed56c2378d1b11f11ecaa531d86d4409"
}
],
"outputs":[
{
"value":100,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":1,
"decodedScript":null,
"token_data":1
},
{
"value":1,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":129,
"decodedScript":null,
"token_data":129
},
{
"value":2,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":129,
"decodedScript":null,
"token_data":129
}
],
"version":2,
"weight":8.000001,
"nonce":68,
"timestamp":1659726762,
"parents":[
"00754b7a04fc45b7c8838397378d005955bc1f62278aa207b829fbb4d1567281",
"001bf4899c93aa9a8f8541479ca979054f1fddc40b1888878fcd298b8fe49f18"
],
"hash":"00c63b9e498522696811f77733aaac000bddc7cdcaa672eeea87e16f1f3bd589",
"_dataToSignCache":null,
"name":"Test Coin",
"symbol":"TSC"
}

Request with Optional Parameters

curl -X POST -H "X-Wallet-Id: default-wallet" -H "Content-type: application/json" \
--data '{"name": "Test Token", "symbol": "TST", "amount": 200, "address": "WXgLK1zwWQFPJDSycj4PuGm2azxuhP3TYN", "change_address": "WRvz87PMerwehhpmGRz123oB4v15j4Xrqe"}' \
http://localhost:8000/wallet/create-token

Response

The data attribute value has been replaced by the "+" symbol to make the JSON easier to visualize.

{
"success":true,
"configurationString":"[Test Token:TST:00a81a470f664a81dc53aa9a93e2d825482049fc15460507b1e9c3f14598551f:3cb4b618]",
"inputs":[
{
"hash":"006ea0ecf296d6ba3e9afa08f23deb82268d1e8456da966b9bbff03cb142684d",
"index":0,
"data":{
"type":"Buffer",
"data":[+]
},
"tx_id":"006ea0ecf296d6ba3e9afa08f23deb82268d1e8456da966b9bbff03cb142684d"
}
],
"outputs":[
{
"value":46,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":0,
"decodedScript":null,
"token_data":0
},
{
"value":200,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":1,
"decodedScript":null,
"token_data":1
},
{
"value":1,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":129,
"decodedScript":null,
"token_data":129
},
{
"value":2,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":129,
"decodedScript":null,
"token_data":129
}
],
"version":2,
"weight":8.000001,
"nonce":23,
"timestamp":1659727185,
"parents":[
"00c63b9e498522696811f77733aaac000bddc7cdcaa672eeea87e16f1f3bd589",
"00754b7a04fc45b7c8838397378d005955bc1f62278aa207b829fbb4d1567281"
],
"hash":"00a81a470f664a81dc53aa9a93e2d825482049fc15460507b1e9c3f14598551f",
"_dataToSignCache":null,
"name":"Test Token",
"symbol":"TST"
}

Non-Fungible Tokens (NFT)

Creation of NFTs with options to specify minting/melting authorities.

info

The complete NFT standard can be found in RFC-0032.

Parameters

  • x-wallet-id: Wallet identifier.
  • name: Name of the token. It must have up to 30 characters.
  • symbol: Symbol of the token. It must have up to 5 characters.
  • amount: The amount of tokens to mint. It must be an integer.
  • data: String that uniquely identifies the NFT. For example, the IPFS link to a metadata file, a URI to an asset, or any string. Max size: 150 characters

Optional Parameters

  • address: Destination address of minted tokens.
  • change_address: Optional address to send the change amount.
  • create_mint: If to create mint authority for the created NFT. The default is false.
  • create_melt: If to create melt authority for the created NFT. The default is false.

Request

curl -X POST -H "X-Wallet-Id: default-wallet" -H "Content-type: application/json" \
--data '{"name": "Aardvark NFT Token", "symbol": "AVK", "amount": 5, "data": "ipfs://ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco/wiki/Aardvark.html"}' \
http://localhost:8000/wallet/create-nft

Response

The data attribute value has been replaced by the "+" symbol to make the JSON easier to visualize.

{
"success":true,
"configurationString":"[Aardvark NFT Token:AVK:00ab242c6e8408a39f67db490a66aefc4998bd80cc2b2d8788b18dbf6c0c4b87:701abb76]",
"inputs":[
{
"hash":"00a81a470f664a81dc53aa9a93e2d825482049fc15460507b1e9c3f14598551f",
"index":0,
"data":{
"type":"Buffer",
"data":[+]
},
"tx_id":"00a81a470f664a81dc53aa9a93e2d825482049fc15460507b1e9c3f14598551f"
}
],
"outputs":[
{
"value":1,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":0,
"decodedScript":null,
"token_data":0
},
{
"value":44,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":0,
"decodedScript":null,
"token_data":0
},
{
"value":5,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":1,
"decodedScript":null,
"token_data":1
}
],
"version":2,
"weight":8.000001,
"nonce":231,
"timestamp":1659727513,
"parents":[
"00a81a470f664a81dc53aa9a93e2d825482049fc15460507b1e9c3f14598551f",
"00c63b9e498522696811f77733aaac000bddc7cdcaa672eeea87e16f1f3bd589"
],
"hash":"00ab242c6e8408a39f67db490a66aefc4998bd80cc2b2d8788b18dbf6c0c4b87",
"_dataToSignCache":null,
"name":"Aardvark NFT Token",
"symbol":"AVK"
}

Request with Optional Parameters

curl -X POST -H "X-Wallet-Id: default-wallet" -H "Content-type: application/json" \
--data '{"name": "Aardvark NFT Token", "symbol": "AVK", "amount": 10, "data": "ipfs://ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco/wiki/Aardvark.html", "address": "WadtCBjzfTPQxNjX5CMgy5TFdYiU93vHGB", "change_address": "Wg6da2omUtvMC8guYAiLAbExykCfTYd2Hr", "create_mint": true, "create_melt": true}' \
http://localhost:8000/wallet/create-nft

Response

The data attribute value has been replaced by the "+" symbol to make the JSON easier to visualize.

{
"success":true,
"configurationString":"[Aardvark NFT Token:AVK:00c7359baacbf7c90f7d6a32ded2616543199c040371f7a92477bd7eaf05a7d3:f6423291]",
"inputs":[
{
"hash":"00ab242c6e8408a39f67db490a66aefc4998bd80cc2b2d8788b18dbf6c0c4b87",
"index":1,
"data":{
"type":"Buffer",
"data":[+]
},
"tx_id":"00ab242c6e8408a39f67db490a66aefc4998bd80cc2b2d8788b18dbf6c0c4b87"
}
],
"outputs":[
{
"value":1,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":0,
"decodedScript":null,
"token_data":0
},
{
"value":42,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":0,
"decodedScript":null,
"token_data":0
},
{
"value":10,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":1,
"decodedScript":null,
"token_data":1
},
{
"value":1,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":129,
"decodedScript":null,
"token_data":129
},
{
"value":2,
"script":{
"type":"Buffer",
"data":[+]
},
"tokenData":129,
"decodedScript":null,
"token_data":129
}
],
"version":2,
"weight":8.000001,
"nonce":71,
"timestamp":1659727671,
"parents":[
"00ab242c6e8408a39f67db490a66aefc4998bd80cc2b2d8788b18dbf6c0c4b87",
"00a81a470f664a81dc53aa9a93e2d825482049fc15460507b1e9c3f14598551f"
],
"hash":"00c7359baacbf7c90f7d6a32ded2616543199c040371f7a92477bd7eaf05a7d3",
"_dataToSignCache":null,
"name":"Aardvark NFT Token",
"symbol":"AVK"
}