2

i couldnt find a way to get the history of transactions a certain Tron address is involved in

i tried the tronweb API : https://api.trongrid.io/v1/accounts/TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh/transactions/trc20?limit=100&contract_address=TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t

yet this didnt do anything. so has anyone managed to find a way to do this ?

whitebat 199
  • 172
  • 2
  • 9

4 Answers4

4

It's quiet simple just make a GET request to the following url:

https://api.trongrid.io/v1/accounts/{wallet-address}/transactions/{standard}?&contract_address={contract-address}

Replace {wallet-address} with your desired tron wallet address.

Replace {standard} with the standard of token that you want e.g. trc20.

Replace {contract_address} with the address of the contract of your target token e.g. TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t (USD Tether).

Here are all possible parameters :

  • only_confirmed (boolean) : true | false. If false, it returns both confirmed and unconfirmed transactions. If no param is specified, it returns both confirmed and unconfirmed transactions. Cannot be used at the same time with only_unconfirmed param.

  • only_unconfirmed (boolean) : true | false. If false, it returns both confirmed and unconfirmed transactions. If no param is specified, it returns both confirmed and unconfirmed transactions. Cannot be used at the same time with only_confirmed param.

  • limit (int32) : number of transactions per page, default 20, max 200

  • fingerprint (string) : fingerprint of the last transaction returned by the previous page; when using it, the other parameters and filters should remain the same

  • order_by (string) : block_timestamp,asc | block_timestamp,desc (default)

  • min_timestamp (date-time) : minimum block_timestamp, default 0

  • max_timestamp (date-time) : maximum block_timestamp, default now

  • contract_address (string) : contract address in base58 or hex

  • only_to (boolean) : true | false. If true, only transactions to this address, default: false

  • only_from (boolean) true | false. If true, only transactions from this address, default: false

Hooman Limouee
  • 1,143
  • 2
  • 21
  • 43
  • i had a success hitting this endpoint, but what remains are trx and trc10 transactions, if i replace the standard with trx or trc10 it returns an error while it works for trc20, any idea as to why? – whitebat 199 Jun 17 '22 at 11:39
2

I had success by hitting this endpoint: (docs here)

https://api.trongrid.io/v1/contracts/${contractAddress}/events?block_number=${blockNumber}&only_confirmed=true

It looks like another option is to use TronWeb's getEvents() endpoint:

How to get TRC20 transactions to an address

There is also this, which seems kind of similar:

https://developers.tron.network/reference/geteventresult

joeytwiddle
  • 29,306
  • 13
  • 121
  • 110
  • well this seems to give the history of transactions of a contract address, yet what i want is the history of transactions of a wallet address – whitebat 199 Mar 01 '22 at 14:14
1

The tron GET endpoint you're looking for is: "api.trongrid.io/v1/accounts/{address}/transactions"

Replace {address} with your tron wallet address. Cheers!

Olamigoke Philip
  • 1,035
  • 8
  • 10
  • Here's a link to the Tron dApps developer guide: https://developers.tron.network/docs/exchangewallet-integrate-with-the-tron-network#trongrid-api-endpoint – Olamigoke Philip Sep 08 '22 at 07:05
  • Note that this returns only few token transactions. To make sure you get them all you need to call also api.trongrid.io/v1/accounts/{address}/transactions/trc20 – Nick Jan 27 '23 at 06:22
0

You can download it in a CSV format from the tronscan.org

but keep in mind that only the first 10,000 transactions are available. enter image description here