EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.27k stars 3.6k forks source link

How to filter actions by token symbol #2742

Closed lucca65 closed 6 years ago

lucca65 commented 6 years ago

Hi, I'm developing a Dapp, and using the standard strutucted found in https://github.com/EOSIO/eos/blob/master/contracts/eosio.token/eosio.token.hpp

however, in my frontend app I need to filter by tokens (asset.symbol), and i'm currently using the mongodb plugin, and querying the "Actions" collection, and looking for the token name inside the "data" key, and then searching inside the transfer string (eg.: 4.500 TKS) to know which action is related to each token.

this seem way too much complex for this info, is there a easier less error prone method to check the asset symbol inside actions?

taokayan commented 6 years ago

Please ask support@block.one

andriantolie commented 6 years ago

As far as I know, parsing the token symbol is the only way to filter it. Symbol is just a payload inside the action, which means the action is not aware of the symbol inside it. The token symbol will always be separated with space, so I think it's safe to parse it