Create a Token
You can create a token by sending a POST request to the /token
endpoint of Playfix API. This is similar to how you create a project.
Unlike projects, the Playfix Token API provides many token configuration options.
Create a Token
POST
https://api.playfix.io/token/tokens
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <your_access_token> |
Request Body
Name | Type | Description |
---|---|---|
project* | String | The |
title* | String | The title of the token. |
config* | Object | Configuration options for the token. |
config.symbol* | String | A shorthand symbol to refer to the token. Choose a short, uppercase word between 3-5 characters that is unique within your project. |
config.decimals | Integer | A non-negative integer that specifies the number of digits after the decimal point of a unit token. 18 is the standard and recommended decimal for ERC-20 tokens, but you can choose any number from 0 upwards. |
config.initialSupply* | Integer | A positive integer specifying the number of tokens that will be minted for a start. |
config.totalSupply* | Integer | A positive integer specifying the fixed total number of tokens that can ever exist. The value can either be greater than or equal to the |
config.mintable | boolean | Set to |
config.burnable | boolean | Set to |
config.permit | boolean | Set to |
config.pausable | boolean | Set to |
config.votes | boolean | Set to |
config.flashMinting | boolean | Set to |
config.snapshots | boolean | Set to |
config.ownerAddress | String | Wallet address of the contract owner. Which receives the initial token supply. |
network* | String | Name of the network where the token will be deployed. Accepted values include:
|
Example cURL API Call
Example Python API Call
Request Body
project
- The name of the project that will contain the token. This should be the value ofname
from the project you created earlier.title
- The title of the token.config
- Configuration options for the token.symbol
- A shorthand symbol to refer to the token. Choose a short, uppercase word between 3-5 characters that is unique within your project.decimals
- A non-negative integer that specifies the number of digits after the decimal point of a unit token. Decimals are the number of subunits, the smallest unit, that 1 unit of a token contains. For example, ETH has 18 decimals. Therefore, 1 ETH contains 0.000000000000000001 subunits (WEI) of ETH. 18 is the standard and recommended decimal for ERC-20 tokens, but you can choose any number from 0 upwards.initialSupply
- A positive integer specifying the number of tokens that will be minted for a start.totalSupply
- A positive integer specifying the fixed total number of tokens that can ever exist. This value can either be greater than or equal to theinitialSupply
. A low supply typically creates scarcity, increasing demand and the token's value.mintable
(boolean)- Set totrue
allow new token minting.burnable
(boolean)- Set totrue
to allow token burning.permit
(boolean)- Set totrue
to allow gasless approval of tokens.pausable
(boolean)- Set totrue
to allow pausing of token transfer.votes
(boolean)- Set totrue
to enable using token for voting.flashMinting
(boolean)-Flash minting enables the creation of new tokens that will destroy at the end of the transaction. Set totrue
to allow flash minting.snapshots
(boolean)- Set totrue
to allow token balances snapshots for easy future querying.ownerAddress
- The wallet address of the contract owner. The owner address receives the initial supply and has additional privileges.
network
- Name of the network where the token contract will be deployed. You can set this to any of the following network values, depending on your preference:NETWORK_ETHEREUM
: Ethereum mainnet.NETWORK_ETHEREUM_RINKEBY
: Ethereum Gorli testnet. For testing purposes only.NETWORK_POLYGON
: Polygon mainnet.NETWORK_POLYGON_MUMBAI
: Polygon Mumbai testnet. For testing purposes only.
Except boolean, all values of the payload parameter are passed as strings.
Response
Response Fields
name
: A unique name of the token, automatically generated by Playfix. It begins with "tokens/
" followed by a ULID.project
: Name of the project that contains the token, as specified in the API request.title
: Title of the token, as supplied in the API request.config
: The configuration options of the token, as supplied in the API request.network
: Your selected network where the token will be deployed.address
: Address of the token contract when it is deployed. This will be empty for now.deployTxHash
: The transaction hash of the token deployment. This will be empty for now.
Last updated