tronprotocol / tronweb

Javascript API Library for interacting with the TRON Network
MIT License
423 stars 271 forks source link

getEventResult filter onlyConfirmed/onlyUnconfirmed not working #422

Closed ud-klee closed 9 months ago

ud-klee commented 1 year ago

The problem seems to be that when constructing the query string tronWeb is using snake-case parameter names, where the event query service expects camel-case names.

Query string construction here: https://github.com/tronprotocol/tronweb/blob/v5.2.0/src/lib/event.js#L112

The /event/contract/{contractAddress} API endpoint in event query service: https://github.com/tronprotocol/tron-eventquery/blob/master/src/main/java/org/tron/trongeventquery/contractevents/ContractEventController.java#L343

If I issue a raw HTTP request using camel-case names, it does work.

PS: This was tested with a local lite fullnode and local event query service, not public API providers.

Related issue https://github.com/tronprotocol/tronweb/issues/156

start940315 commented 12 months ago

It looks like a typo error. Please use tronWeb.eventServer.request to send a raw request as a temporary solution. In V6, we are going to change this api.

start940315 commented 9 months ago

Fixed in TronWeb v6.0.0-beta.0. Welcome to try.