Skip to content

Assetux/ton-dns-resolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TON DNS Resolver

A lightweight NestJS service for resolving .ton domain names to wallet addresses using the TonWeb SDK.


Description

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
}

Configuration

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_NETWORKmainnet or testnet
  • TON_RPC_URL — optional, set your own RPC provider URL

Build & Run

1. Install dependencies

yarn install

2. Run in development mode

yarn dev

3. Build the project

yarn build

4. Start from build

yarn start

Testing

Tests are written using Jest and ts-jest.

Run the test suite:

yarn test

Useful Links

About

A lightweight NestJS service for resolving .ton domain names to wallet addresses using the TonWeb SDK.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors