- Rename
.env.example
to.env
- Replace the values in .env with your own values
- Make sure you have installed rust and cargo
- Run the following command to start the server
cargo r -r
This API provides endpoints to interact with addresses, tokens, and events. Below are the available routes, their parameters, and descriptions.
- Description: Retrieves token balances and transfers for a specific address.
- Parameters:
- address (path): The address to retrieve token balances and transfers for.
[
{
"tick": "<tick>",
"balance": "1000",
"transferable_balance": "1000",
"transfers": [
{
"outpoint": "<txid:vout>",
"value": "1000"
}
],
"transfers_count": 1
},
...
]
- Description: Retrieves the history of token actions for a specific address.
- Parameters:
- address (path): The address to retrieve token history for.
- tick (query): The token tick to filter by.
- offset (query, optional): The offset for pagination. (key:
id
) - limit (query, optional): The maximum number of records to return.
[
{
"id": 1,
"tick": "<tick>",
"height": 100,
"type": "Send",
"amt": "1",
"recipient": "<address>",
"adddress": "<address>",
"txid": "<txid>",
"vout": 0
},
...
]
- Description: Retrieves the history of token actions for a specific height.
- Parameters:
- height (path): The block number to retrieve events history for.
[
{
"id": 1,
"tick": "<tick>",
"height": 100,
"type": "Send",
"amt": "1",
"recipient": "<address>",
"adddress": "<address>",
"txid": "<txid>",
"vout": 0
},
...
]
- Description: Retrieves events by TXID
- Parameters:
- txid (path): Transaction Hash (ID)
[
{
"id": 1,
"tick": "<tick>",
"height": 100,
"type": "Send",
"amt": "1",
"recipient": "<address>",
"adddress": "<address>",
"txid": "<txid>",
"vout": 0
},
...
]
- Description: Retrieves metadata for all tokens.
[
{
"genesis": "<inscription_id>",
"tick": "<tick>",
"max": "1000000000",
"lim": "1000",
"dec": 18,
"supply": "6000",
"mint_count": 5,
"transfer_count": 10,
"holders": 10
},
...
]
- Description: Subscribes to events related to specific addresses and tokens.
- Parameters:
- addresses (body, optional): A set of addresses to subscribe to.
- tokens (body, optional): A set of tokens to subscribe to.
{
"event_type": "new_block",
"height": 1,
"proof": "<hash>",
"blockhash": "<hash>"
}
{
"event_type": "reorg",
"blocks_count": 5,
"new_height": 67890
}
{
"id": 1,
"type": "Deploy",
"max": "1000000",
"lim": "500000",
"dec": 18,
"address": "<address>",
"txid": "<txid>",
"vout": 0
}
{
"id": 1,
"type": "Mint",
"amt": "1000.0",
"address": "<address>",
"txid": "<txid>",
"vout": 0
}
{
"id": 1,
"type": "DeployTransfer",
"amt": "500.0",
"address": "<address>",
"txid": "<txid>",
"vout": 0
}
{
"id": 1,
"type": "Send",
"amt": "250.0",
"recipient": "<address>",
"address": "<address>",
"txid": "<txid>",
"vout": 0
}
{
"id": 1,
"type": "Receive",
"amt": "250.0",
"sender": "<address>",
"address": "<address>",
"txid": "<txid>",
"vout": 0
}
{
"id": 1,
"type": "SendReceive",
"amt": "500.0",
"address": "<address>",
"txid": "<txid>",
"vout": 0
}
- Description: Retrieves current status of the server
{
"height": 0,
"proof": "<hash>",
"blockhash": "<hash>"
}
- Description:
- Parameters:
- offset (query, optional): The offset for pagination. (key:
height
) - limit (query, optional): The maximum number of records to return. (up to 100)
- offset (query, optional): The offset for pagination. (key:
[
{
"height": 0,
"hash": "<hash>"
},
...
]