API Documentation
Introduction
The Suatokens node provides a comprehensive API (Application Programming Interface) that enables developers to interact with the Suatokens platform programmatically. This API facilitates various functionalities related to token creation, management, and transaction processing.
Below are the key functionalities available through the Suatokens node API:
- Token Creation: Create new tokens on the Suatokens platform, including both non-fungible tokens (NFTs) and fungible tokens with customizable parameters.
- Token Management: Query existing tokens, update token properties, and transfer token ownership.
- Transaction Processing: Initiate token transfers between addresses, including both individual and batch transfers.
- Event Monitoring: Monitor events occurring on the Suatokens platform in real-time.
- Metadata Management: Manage metadata associated with tokens, including descriptions, images, and external links.
- Security and Authentication: Secure interactions with authentication and access control mechanisms.
The Suatokens node API offers a robust set of functionalities for developers to build applications and services that leverage the capabilities of the Suatokens platform.
Create Token
Method: POST
Endpoint: http://localhost:8077/token/create
Body:
To generate above properly formated JSON use Create Token Form.
You need to install and use a Suatokens node and Suacoin Wallet.
### How to configure suatokens node:
edit .env file example: suacoin_rpcnode_url=localhost:8442 suacoin_rpcuser=your_rpc_user suacoin_rpcpass=your_rpc_password suatokens_node_url= databasename= where database and suatokens_node_url are optional ### How to configure suacoin node: Linux: ~/.suacoin MacOSX: ~/Library/Application Support/Suacoin Windows: %APPDATA%\Suacoin edit file suacoin.conf example: upnp=1 rescan=1 listen=1 deamon=1 server=1 rpcuser=your_rpc_user rpcpassword=your_rpc_password rpcbind=127.0.0.1 rpcbind=0.0.0.0 rpcallowip=127.0.0.1 rpcallowip=0.0.0.0/0
For more information refer to README.md.
If you only need to create a token without diving into technical details, explore token creation services in the Directory.
Transfer Token
Method: POST
Endpoint: http://localhost:8077/transfers/create
Body:
To generate above properly formated JSON use Create Transfer Form.
Mint Token
Method: POST
Endpoint: http://localhost:8077/mints/create
Body:
To generate above properly formated JSON use Create Mint Form.
List Mints
Method: GET
Endpoint: http://localhost:8077/mints/list
Query Params:
token: token id (optional)
Balance
Method: GET
Endpoint: http://localhost:8077/balance?token=9f8e3247d5c852c31b984d09c1fdae330302f5a9469d33682c5295aeb857e986
&address=1Abij8LkbxSfCx6EdsJr66Pcp2WpAJZa5k
Query Params:
token: token id
address: suacoin address
Get Transfer
Method: GET
Endpoint: http://localhost:8077/transfers/get?id=daf30f96bd7e40cffbe246c7eefe7ffec30affaa3118f73b0bb56e156d7fa404
Query Params:
id: transaction hash id
List Transfers
Method: GET
Endpoint: http://localhost:8077/transfers/list?token=9f8e3247d5c852c31b984d09c1fdae330302f5a9469d33682c5295aeb857e986
Query Params:
token: token id
Get Token Transfers Total
Method: GET
Endpoint: http://localhost:8077/transfers/total?token=9f8e3247d5c852c31b984d09c1fdae330302f5a9469d33682c5295aeb857e986
Query Params:
token: token id
List Transfers for Address
Method: GET
Endpoint: http://localhost:8077/transfers/list?token=938928923
&address=1Abij8LkbxSfCx6EdsJr66Pcp2WpAJZa5k
Query Params:
token: token id
address: suacoin address
List Tokens
Method: GET
Endpoint: http://localhost:8077/token/list?token=9f8e3247d5c852c31b984d09c1fdae330302f5a9469d33682c5295aeb857e986
Query Params:
token: token id (optional)
address: suacoin address (optional)
List Nodes
Method: GET
Endpoint: http://localhost:8077/node/list
getavgfee
Method: GET
Endpoint: http://localhost:8077/getavgfee
Get Holders Count
Method: GET
Endpoint: http://localhost:8077/holders
Query Params:
token: token id
Block Count
Method: GET
Endpoint: http://localhost:8077/blockcount