Skip to content
VerifiedXVerifiedX Docs
verifiedx.io
verifiedx.io

Fungible Tokens

Deploying a fungible token smart contract follows the same process as any smart contract. Please review this documentation.

Adding a feature type with the token details to the payload. FeatureName 13 is the Token feature.

{
...
"Features": [
{
"FeatureName": 13,
"FeatureFeatures": {
"TokenName": "My Token Name",
"TokenTicker": "My Token Ticker",
"TokenDecimalPlaces": 16,
"TokenSupply": 1000, //0 for infinite supply
"TokenBurnable": true,
"TokenMintable": true,
"TokenVoting": true,
"TokenImageURL": "https://...", // optional
"TokenImageBase": "base64ImageData..."
},
}
]
}

After compiling, the token smart contract still needs to be minted, following the same approach as any smart contract.

GET http://localhost:7292/scapi/scv1/MintSmartContract/{SMART_CONTRACT_UID}

Note: The base token’s smart contract must be of infinite supply in order to mint tokens.

GET http://localhost:7292/tkapi/TKV2/TokenMint/{scUID}/{fromAddress}/{amount}

scUID: The token’s smart contract identifier.

fromAddress: The smart contract owner’s address.

amount: The amount of tokens to mint (decimals supported)

{
"Success": true,
"Message": "Result: TX Success. SCUID: ..."
}

Note: all token action methods will return a similar response structure. If Success is false the Message param will include details. Every action is sent from an account held by the node’s wallet, and an encrypted wallet must be unlocked first.

GET http://localhost:7292/tkapi/TKV2/TransferToken/{scUID}/{fromAddress}/{toAddress}/{amount}

scUID: The token’s smart contract identifier.

fromAddress: The sender’s address

toAddress: The recipient’s address

amount: The amount of tokens to transfer (decimals supported)

GET http://localhost:7292/tkapi/TKV2/BurnToken/{scUID}/{fromAddress}/{amount}

scUID: The token’s smart contract identifier.

fromAddress: The address of the token owner to burn from.

amount: The amount of tokens to burn (decimals supported)

Pausing (and Unpausing) Token Transactions

Section titled “Pausing (and Unpausing) Token Transactions”
GET http://localhost:7292/tkapi/TKV2/PauseTokenContract/{scUID}/{fromAddress}

scUID: The token’s smart contract identifier.

fromAddress: The address of the token owner.

The same call toggles: on a paused contract it unpauses.

GET http://localhost:7292/tkapi/TKV2/BanAddress/{scUID}/{fromAddress}/{banAddress}

scUID: The token’s smart contract identifier.

fromAddress: The address of the token owner.

banAddress: The address to ban from the token.

GET http://localhost:7292/tkapi/TKV2/ChangeTokenContractOwnership/{scUID}/{fromAddress}/{toAddress}

scUID: The token’s smart contract identifier.

fromAddress: The sender’s address

toAddress: The recipient’s address

POST http://localhost:7292/tkapi/TKV2/CreateTokenTopic
{
"TopicName": "Raise the supply",
"TopicDescription": "Mint 1,000 more tokens for the community fund.",
"SmartContractUID": "<token smart contract UID>",
"MinimumVoteRequirement": 10,
"FromAddress": "<token owner address>",
"VotingEndDays": 30
}

TopicName is at most 128 characters and TopicDescription at most 1,600. MinimumVoteRequirement is a whole number. VotingEndDays is one of 30, 60, 90 or 180. FromAddress must be the token contract’s owner.

GET http://localhost:7292/tkapi/TKV2/CastTokenTopicVote/{scUID}/{fromAddress}/{topicUID}/{voteType}

scUID: The token’s smart contract identifier.

fromAddress: The voter’s address

topicUID: The topic’s unique identifier

voteType: 1 == YES; 0 == NO

  • GET /tkapi/TKV2/GetTokens/{scUID}/{getAll}: the tokens held by the wallet’s accounts (getAll=true), or one token’s details.
  • GET /tkapi/TKV2/GetTokensUpdate: rebuilds the wallet’s in-memory token list.
  • GET /tkapi/TKV2/GetVoteBySmartContractUID/{scUID}: the wallet’s votes on a token’s topics.
  • GET /tkapi/TKV2/GetVoteByTopic/{topicUID}: the votes recorded for one topic.
  • GET /tkapi/TKV2/GetVotesByAddress/{fromAddress}: every token vote cast by an address.
  • GET /tkapi/TKV2/GetTokenOwnerVoteList/{tUID}: the vote list the token owner sees for a topic.