Token Trading Account Emulator

This endpoint emulates a token trading account. You can check balances, send tokens, and receive tokens.

Checking Balance

To check the balance of an address, use the following curl command:

curl "https://jamiedubs-glifbux.web.val.run/balance?address=user1"

Sending Tokens

To send tokens, use the following curl command:

curl -X POST https://jamiedubs-glifbux.web.val.run/send \
     -H "Content-Type: application/json" \
     -d '{
       "from": "user1",
       "to": "user2",
       "amount": 5
     }'

Listing All Accounts

To list all active accounts and their balances, use the following curl command:

curl "https://jamiedubs-glifbux.web.val.run/accounts"

Minting Tokens*

Requires Chairman Authorization

To mint new tokens, use the following curl command:

curl -X POST https://jamiedubs-glifbux.web.val.run/mint \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer CHAIRMAN_PASSWORD" \
     -d '{
       "address": "user2",
       "amount": 1000
     }'

Notes

View source: Val Town