A lightweight NestJS service for resolving .ton domain names to wallet addresses using the TonWeb SDK.
This service provides a simple HTTP API to query TON DNS records.
Currently it supports resolving a .ton domain into a wallet address (category wallet in TON DNS).
API:
GET /dns/toAddress?name={domain.ton}→ returns the associated wallet address if available.
Example response:
{
"name": "foundation.ton",
"address": "EQDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}If no wallet record exists:
{
"name": "unknown.ton",
"address": null
}The service uses environment variables.
Create a .env file based on the provided .env.example:
PORT=3000
TON_NETWORK=mainnet
# TON_RPC_URL= # optional: custom RPC endpoint; if empty, a public endpoint will be chosen automatically via TON Access- PORT — HTTP server port (default: 3000)
- TON_NETWORK —
mainnetortestnet - TON_RPC_URL — optional, set your own RPC provider URL
yarn installyarn devyarn buildyarn startTests are written using Jest and ts-jest.
Run the test suite:
yarn test