Sign Tron transactions
Signing a Tron transaction is identical to how we sign an Ethereum or Solana transaction with the exception that we need to pass in the Tron specific RPC URL, chain ID, and method.
You can get an RPC URL for Tron from www.trongrid.io.
In the example we are going to update:
chainID
totron:nile
rpcUrl
togrpc.nile.trongrid.io:50051?api_key=<API_KEY>
method
totron_sendTransaction
params
to a base64 encoded serialized Tron transaction
Here is a short snippet of how to get the params
using tronweb
, for a complete example checkout this example repo:
Below is an example curl command for signing a Tron message:
The RPC URL for Tron uses the GRPC protocol, not HTTP.
Supported Methods and ChainIds
Methods:
tron_sendTransaction
ChainIds:
tron:mainnet
tron:nile
tron:shasta
Last updated