Skip to content

Libermall/tnt

 
 

Repository files navigation

🧨 TNT — TON NFT Tool

Query, modify, and mint NFTs on The Open Network — from your terminal.

All-in-one command-line utility for TON NFTs. Zero third-party services, single-binary JVM build, ships with mainnet / testnet / sandbox networks out of the box.

License: AGPL-3.0 Stars Release Last commit Kotlin TON Built by Libermall

Libermall · Libermall ID · FunC contracts · Marketplace front-end


Why TNT

  • No third parties — talks directly to TON nodes, your keys never leave your machine.
  • Single-binary distribution — one JVM zip, works on macOS, Linux, Windows.
  • Multi-network ready--network=mainnet|testnet|sandbox flag, no separate builds.
  • Single-use wallet per mint — eliminates the need to expose your seed phrase to the tool; mint operations spin up a fresh wallet contract, transfer ownership, then walk away.
  • Used in production — by the Libermall NFT marketplace and ecosystem tooling since 2022.

⚠️ Status: pre-1.0. Modifying commands (tnt mint) are stable on testnet/sandbox but use on mainnet at your own risk. Always test on testnet first.

Architecture

                ┌────────────────────────────────┐
   $ tnt ───►  │   tnt CLI  (Kotlin · JDK 11+)   │
                │   ───────────────────────────  │
                │   collection · item · mint     │
                │       │           │      │      │
                └───────┼───────────┼──────┼──────┘
                        │           │      │
                        ▼           ▼      ▼
                ┌────────────────────────────────┐
                │       ton-kotlin SDK            │
                └───────────────┬────────────────┘
                                │
                ┌───────────────┴────────────────┐
                ▼                                ▼
           TON mainnet                  testnet / sandbox

Install

Download a release

wget https://github.com/LiberMall/tnt/releases/latest/download/tnt.zip
unzip tnt.zip
cd tnt-*
./bin/tnt --help

Build from source

git clone git@github.com:LiberMall/tnt.git
cd tnt
./gradlew assembleDist
./build/install/tnt/bin/tnt --help

Requires JDK 11 or newer.

Commands

Command What it does
tnt collection <addr> Read a collection: size, owner, metadata kind, metadata URI
tnt item <addr> Read an NFT item: index, collection, owner, content URI
tnt mint <spec.json> Mint a standalone item, a whole collection, or a batch (see Specification)

Every command accepts --network=mainnet|testnet|sandbox (defaults to testnet).

Quickstart

Read an NFT collection

$ tnt --network=mainnet collection 'EQAadrsHePbHk-v7KtM4_jrX0HTlMYfP9ZGtlLgn590D7-SC'
                    Collection Properties
┌─────────┬──────────────────────────────────────────────────┐
│ Address │ EQAadrsHePbHk-v7KtM4_jrX0HTlMYfP9ZGtlLgn590D7-SC │
│ Size    │ 7778                                             │
│ Owner   │ EQDVF5iErB47ryuH2HRBrbVIm-EKrb5WdTStrGEM8F9i77qB │
└─────────┴──────────────────────────────────────────────────┘
                    Collection Content
┌──────┬─────────────────────────────────────────────────────────────────┐
│ Kind │ off-chain                                                        │
│ Uri  │ https://s.getgems.io/nft/b/c/626a922e5e67c1f424154711/meta.json │
└──────┴─────────────────────────────────────────────────────────────────┘

Read an NFT item

$ tnt --network=mainnet item 'EQA9V87ROI2DZqm65Jj-CIaOMF4RgElzOge0YgktWqyOJO1x'
                        Item Properties
┌─────────────┬──────────────────────────────────────────────────┐
│ Address     │ EQA9V87ROI2DZqm65Jj-CIaOMF4RgElzOge0YgktWqyOJO1x │
│ Initialized │ true                                             │
│ Index       │ 69                                               │
│ Collection  │ EQAadrsHePbHk-v7KtM4_jrX0HTlMYfP9ZGtlLgn590D7-SC │
│ Owner       │ EQChmtQM0oJX01hIY-9ej_whDeAWqtz_UtqlnDJJBpUszX28 │
└─────────────┴──────────────────────────────────────────────────┘

Mint an item

$ tnt --network=testnet mint examples/lonely_dog.json

Send at least 0.3 TON to the single-use wallet address that TNT prints. The tool deploys the contract, transfers ownership to your account, then exits.

Specification file

tnt mint reads a portable JSON file so the same collection can be deployed on testnet during development and on mainnet at launch.

Standalone item

{
  "entities": [
    {
      "type": "item",
      "index": 69,
      "owner": "EQDpl_EDsAwIME91TvXCi6xsM_7dYaB4vZoDbcu_QHmldeUI",
      "content": {
        "type": "full_snake",
        "value": "https://s.getgems.io/nft/b/c/626a922e5e67c1f424154711/69/meta.json"
      }
    }
  ]
}
  • entities — array of NFT entities to mint. One spec can contain many.
  • type"item" for standalone items.
  • index — item index inside the collection. Use 0 for standalone items.
  • owner — recipient account. After successful mint, ownership is transferred to this address. "none" burns the item.
  • content"full_snake" (URL to off-chain JSON, snake-encoded), "naked_snake", or "cell" (base64-encoded raw BoC for advanced users).

Collection of items

{
  "entities": [
    {
      "type": "collection",
      "collection_content": {
        "type": "full_snake",
        "value": "https://s.getgems.io/nft/b/c/626a922e5e67c1f424154711/meta.json"
      },
      "common_content": {
        "type": "naked_snake",
        "value": "https://s.getgems.io/nft/b/c/626a922e5e67c1f424154711/"
      },
      "owner": "EQDpl_EDsAwIME91TvXCi6xsM_7dYaB4vZoDbcu_QHmldeUI",
      "royalty": {
        "numerator": 69,
        "denominator": 1000,
        "destination": "EQDpl_EDsAwIME91TvXCi6xsM_7dYaB4vZoDbcu_QHmldeUI"
      },
      "items": [
        {
          "owner": "EQDpl_EDsAwIME91TvXCi6xsM_7dYaB4vZoDbcu_QHmldeUI",
          "content": { "type": "naked_snake", "value": "1/meta.json" }
        }
      ]
    }
  ]
}

Key fields:

  • royalty.numerator / denominator — percentage of each secondary-market sale routed to royalty.destination. Hard cap at 15%. Set both to 0 (and destination to "none") to disable royalties.
  • common_content — the shared prefix of every item's metadata URL.
  • items[] — order matters. The first item gets index 0, the second 1, and so on.

To mint:

$ tnt --network=testnet mint examples/tegro_dog.json

TNT will print a single-use wallet address. Send at least 3 TON (or proportional to collection size) to it.

Why a single-use wallet per mint

Most TON minting tools require you to feed them your seed phrase. TNT does the opposite — for every tnt mint invocation it generates a fresh, single-use wallet, asks you to fund it with the exact amount needed, deploys the entity, transfers ownership to your real account, then disposes of the wallet.

Trade-off: if tnt mint aborts mid-flight (insufficient funds, network error), the residual balance can be permanently stuck. Recovery from log files is possible — TNT writes the single-use wallet's private key to /tmp/tnt.YYYYMMDDTHHMMSS.log precisely for this case. Treat those logs as sensitive.

Approximate per-item cost: ~0.3 TON (worst-case fee + 0.1 TON safety margin). In practice it's closer to 0.18 TON.

Roadmap

  • Read collection / item state
  • Mint standalone items, collections, batches via JSON spec
  • Multi-network support (mainnet / testnet / sandbox)
  • Royalty configuration
  • v1.0 — failure recovery from log files without exposing keys
  • v1.1 — royalty / editor migration commands
  • v1.2 — jetton support (TIP-3)
  • v1.3 — automated fee estimation
  • v1.4tnt transfer, tnt set-content, tnt revoke-ownership

Used by

Reporting issues

GitHub Issues. Include OS + JDK version, the command you ran, and the program's output.

Run-logs live at /tmp/tnt.*.log (Unix) or %TEMP%\tnt.*.log (Windows) — attach them to bug reports for fastest triage.

⚠️ tnt mint log files contain the single-use wallet's private key (so funds are recoverable). Redact before sharing publicly.

Security

To report a vulnerability privately, see SECURITY.md — or email security@libermall.com. Do not open a public issue for security findings.

Contributing

PRs welcome — especially around the v1.0 recovery flow. See CONTRIBUTING.md for build instructions and style guide.

License

AGPL-3.0 — see the file for the full text. Strong copyleft is intentional: improvements to TNT belong back in the commons.


Part of the Libermall ecosystem.

Identity · DEX · Pay · Card

About

TNT — TON NFT Tool. All-in-one CLI to query, modify, and mint NFTs on The Open Network. Used in production by Libermall NFT marketplace and Libermall ID.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Kotlin 100.0%