Skip to content

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

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

feat: add native TRX and TRC20 coin configs (wallet-only)#1722
shamardy wants to merge 2 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

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>
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.

2 participants