v1

latestOpenAPI 3.0.32026-07-1320201.0 MB
Tron Paymaster

Estimate Paymaster Fees

This endpoint is used to estimate the fees for a paymaster request.

With the creation of a paymaster request you need to pay for the energy and bandwidth that is needed to process the transaction. To simplify the process of calculating the fees, we provide this endpoint to estimate the fees for a transaction. The ressouces wich a transaction needs to be procesed are energy and bandwidth. Bandwidth is needed to send the transaction to the network and energy is needed to execute the transaction.

Therefore it differs between the transaction types and the smart contracts how much energy and bandwidth is needed.

After setteling yor paymaster request the fees will be deducted from your credit balance. If you don't have enough funds on your balance, the request will fail.

post/api/v2/tron/paymaster/estimate

Headers

X-Network'testnet' | 'mainnet'

Specify "testnet" for test network or leave empty for main network. Defaults to "mainnet" if not provided.

Authorizationstring required

Bearer token for authorization. Required for authenticated endpoints.

Content-Type'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data' required

The MIME type of the request body.

Request body

type'TRX' | 'TRC10' | 'TRC20' | 'TRC721' required

The type of transaction.

fromstring required

The address to send the transaction from.

tostring required

The address to send the transaction to.

contractaddressstring

The contract address of the token. This field is required when <code>type</code> is <code>TRC20</code> or <code>TRC721</code>.

tokenidnumber

The token id of the token. This field is required when <code>type</code> is <code>TRC721</code> or <code>TRC10</code>.

amountstring required

The amount to send.

passwordstring

The password for the address. This field is required when <code>privatekey</code> is not present.

privatekeystring

The private key of the sender.

callback_urlstring

The callback url to send the response to.

Example request

{
  "type": "TRC20",
  "from": "TLkkCeNdJKPNUwucdro84WjswkzM62LCTH",
  "to": "TUwmZghA7u2GxGxKaxM1mkCmsTF4wHs4vp",
  "contractaddress": "0x708c419d1b9ae123047f70787a503b6ba51e048a27966e0220cc5feXXXXXXXXX",
  "tokenid": 1,
  "amount": "1",
  "password": "your_password",
  "privatekey": "708c419d1b9ae123047f70787a503b6ba51e048a27966e0220cc5feXXXXXXXXX",
  "callback_url": "https://example.com/callback"
}

Response

Successfully estimated the fees

statusinteger
okboolean
messagestring

Example response

{
  "status": 200,
  "ok": true,
  "message": "Successfully estimated the fees",
  "data": {
    "energy_consumption": 32000,
    "bandwidth_consumption": 368,
    "paymaster_fee": 0.15
  }
}