This documentation provides an overview of the API endpoints available in the Pi Coin application, which is built on the Stellar network. The API allows users to create assets, issue PiCoins, transfer coins, and check balances.
The base URL for the API is:
http://localhost:3000/api
/create-asset
POST
Content-Type: application/json
{
"secretKey": "YOUR_SECRET_KEY"
}
200 OK
{
"message": "Asset PI created successfully!"
}
/issue-picoins
POST
Content-Type: application/json
{
"secretKey": "YOUR_SECRET_KEY",
"amount": 100
}
200 OK
{
"message": "100 PI issued successfully!"
}
/transfer-picoins
POST
Content-Type: application/json
{
"secretKey": "YOUR_SECRET_KEY",
"destination": "DESTINATION_ACCOUNT_PUBLIC_KEY",
"amount": 10
}
200 OK
{
"message": "10 PI transferred to DESTINATION_ACCOUNT_PUBLIC_KEY!"
}
/get-balance
POST
Content-Type: application/json
{
"secretKey": "YOUR_SECRET_KEY"
}
200 OK
{
"balance": "1000",
"asset": "PI"
}
In case of an error, the API will return a response with a status code indicating the type of error and a message describing the issue.
400 Bad Request
{
"error": "Invalid secret key"
}
This API documentation provides a comprehensive overview of the available endpoints for the Pi Coin application. For further assistance, please refer to the codebase or contact the development team.