Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification on Event_index in Tronweb #555

Open
AmardeepSambaru opened this issue Sep 5, 2024 · 3 comments
Open

Clarification on Event_index in Tronweb #555

AmardeepSambaru opened this issue Sep 5, 2024 · 3 comments

Comments

@AmardeepSambaru
Copy link

AmardeepSambaru commented Sep 5, 2024

I am a Node operator and have set up the Tron event subscription using the official documentation (https://developers.tron.network/docs/event-plugin-deployment-mongodb).
After executing the getEventResult method in TronWeb, I noticed that the output does not include the event_index parameter. see the below output of this method

{
block: 64894266,
timestamp: 1725330330000,
contract: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
name: 'Transfer',
transaction: '3b1d5a1020104e179140acd8c3c6defc963bb139ec1bd665830179e2819913ca',
result: {
from: '0xbae017880fb02f310e418e4a135c77f3d567ccb3',
to: '0x7d98443d36f2ad2740d52f0f4fd8a7bafb4403db',
value: '69000000'
},
resourceNode: 'fullNode',
unconfirmed: true,
fingerprint: 'qgYzMgexxTFqgNTFNTNeqYbMTDqeNJIJ'
}

However, when using TronGrid with public url, the event_index parameter is present in the output. see the below output

{
  block_number: 64874111,
  block_timestamp: 1725269847000,
  caller_contract_address: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
  contract_address: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
  **event_index: 7,**
  event_name: 'Transfer',
  result: [Object],
  result_type: [Object],
  event: 'Transfer(address indexed from, address indexed to, uint256 value)',
  transaction_id: '74d0d411a30f4f6061201d42ee3510eb652a1d0b34a2efb88309f1444998d258'
}

Could you please confirm whether the event_index parameter is only available through TronGrid, or if it is possible to retrieve it via TronWeb as well?
Please help me.
Thank you.

@Satan-web3
Copy link
Contributor

TronWeb beta versions adapted TronGrid api which may be not compatible with java-tron api. It is recommended that you always use event service with TronGrid.

@zachariahevans174
Copy link

zachariahevans174 commented Sep 9, 2024 via email

@Satan-web3
Copy link
Contributor

Sorry I don't understand what you mean. Could you make it clear?

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

No branches or pull requests

3 participants