Skip to content

feat: add native TRX and TRC20 coin configs (wallet-only)#1722

Open
shamardy wants to merge 12 commits intomasterfrom
feat/add-tron-coins
Open

feat: add native TRX and TRC20 coin configs (wallet-only)#1722
shamardy wants to merge 12 commits intomasterfrom
feat/add-tron-coins

Conversation

@shamardy
Copy link

@shamardy shamardy commented Mar 6, 2026

Summary

  • Add TRX (TRON mainnet) and TRXT (Nile testnet) platform coin configs
  • Add USDT-TRC20 (mainnet) and USDT-TRC20-TEST (Nile testnet) token configs
  • Add RPC node configs: api.trongrid.io (mainnet), api.nileex.io + nile.trongrid.io (testnet)
  • All entries are wallet_only pending swap contract support

Companion to GLEECBTC/komodo-defi-framework#2714

Test plan

Activation

  • Activate TRX with mainnet node via enable_eth_with_tokens
  • Activate TRX with mainnet node via task::enable_eth::init
  • Activate TRXT with Nile testnet nodes
  • Activate USDT-TRC20 together with TRX platform (tokens in platform request)
  • Activate USDT-TRC20 standalone after TRX platform via enable_erc20_token / task::enable_erc20::init
  • Activate USDT-TRC20-TEST after TRXT platform

Addresses

  • Verify T... address matches TronLink for same mnemonic
  • Verify HD wallet derivation path m/44'/195' produces correct addresses (cross-check with TronLink)

Balances

  • Test my_balance returns correct TRX balance
  • Test my_balance returns correct TRC20 token balance

Withdrawals

  • Test TRX withdraw — verify tx hex, amounts, fee details structure
  • Test TRC20 withdraw — verify tx hex, amounts, fee details structure
  • Test withdraw + broadcast (send_raw_transaction) on testnet
  • Test max withdraw for TRX (accounts for fee correctly)

Fees

  • Verify fee estimation (bandwidth/energy costs) matches expected values

🤖 Generated with Claude Code

- TRX: TRON mainnet, wallet_only, HD path m/44'/195'
- USDT-TRC20: Tether on TRON mainnet (TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t)
- TRXT: TRON Nile testnet
- USDT-TRC20-TEST: Tether on Nile testnet (TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf)
- Node configs for mainnet (api.trongrid.io) and testnet (api.nileex.io, nile.trongrid.io)

All entries are wallet_only pending swap contract support.

Companion to GLEECBTC/komodo-defi-framework#2714

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
coins Outdated
}
},
{
"coin": "USDT-TRC20-TEST",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- should only be used once in a ticker, like in USDC-AVX20_OLD
for testchains it's better to use a completely different ticker, like TESTUSDT-TRC20
if the ticker starts with USDT-, GUI will use the price of USDT for this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, renamed to TESTUSDT-TRC20 and updated the name field to match.

"decimals": 6,
"derivation_path": "m/44'/195'",
"protocol": {
"type": "TRC20",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type of tokens is ERC20, no matter which specific chain it's on
like in

    "coin": "MASK-PLG20",
    "chain_id": 137,
    "protocol": {
      "type": "ERC20",
      "protocol_data": {
        "platform": "MATIC",
        "contract_address": "0x2B9E7ccDF0F4e5B24757c1E1a80e311E34Cb10c7"

Copy link
Author

@shamardy shamardy Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TRC20 is a new coin type for tron

"required_confirmations": 1,
"derivation_path": "m/44'/195'",
"protocol": {
"type": "TRX",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on the other EVM chains, the main coin is configured like this

    "coin": "MATIC",
    "fname": "Polygon",
    "protocol": {
      "type": "ETH",
      "protocol_data": {
        "chain_id": 137
      }

with type ETH and chain_id
has this changed for TRX?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, no chain_id for tron

shamardy and others added 10 commits March 6, 2026 17:57
Rename USDT-TRC20-TEST to TESTUSDT-TRC20 per review feedback:
- Avoids double hyphen in ticker (convention: single hyphen only)
- Prevents GUI from matching USDT price for testnet coin

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fix: set TRX/TRXT coin type to TRC-20

TRX and TRXT had an empty "type" field because the protocol type
resolution in get_protocol_info() only handled ETH and QTUM as
platform coin protocols. TRON uses its own protocol type ("TRX")
rather than "ETH", so it fell through all type-assignment paths.

Add "TRX" to the platform protocol check so TRX resolves to "TRC-20"
via the existing protocols dict, matching how ETH resolves to "ERC-20".

* Update coins json file (#1741)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fix(config): generate TRX type for Tron platform assets

* Update coins json file (#1744)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Resolved conflicts in generated utils/*.json by taking master versions
then re-running generate_app_configs.py so outputs match the merged tree.
…1747)

* fix(config): generate TRX type for Tron platform assets

* Update coins json file (#1744)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: add Tron-native RPC scanning and fix TRC20 token connectivity

The scanner was probing TRX nodes with Ethereum JSON-RPC (eth_blockNumber)
against the base URL, which TronGrid returns 405 for. This caused all TRX
and TRC20 coins to be permanently delisted despite functional nodes.

- Add TronServer class that probes /wallet/getnowblock (Tron HTTP API)
- Route TRX-protocol coins to the new Tron scanner automatically
- Add tron-rpc.publicnode.com as a second mainnet RPC node
- Fix testnet TRC20 tokens mapping to wrong parent chain (TRX vs TRXT)
- Add -TRC20 to token suffix list so TRC20 tokens inherit parent status

* Update coins json file (#1748)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@GLEECBTC GLEECBTC deleted a comment from bogvas194-wq Mar 21, 2026
@GLEECBTC GLEECBTC deleted a comment from bogvas194-wq Mar 21, 2026
@GLEECBTC GLEECBTC deleted a comment from bogvas194-wq Mar 21, 2026
@GLEECBTC GLEECBTC deleted a comment from bogvas194-wq Mar 21, 2026
@GLEECBTC GLEECBTC deleted a comment from bogvas194-wq Mar 21, 2026
@GLEECBTC GLEECBTC deleted a comment from bogvas194-wq Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants