Using Lisk Elements to search in assets

Using Lisk Elements it’s possible to search in the data field, like this:
https://testnet.lisk.io/api/transactions?recipientId=500L&limit=10&data=test%

Is it also possible, or will it be possible to use a similar method to search in the asset field for transactions and accounts?
Example call: https://testnet.lisk.io/api/transactions?recipientId=500L&limit=10&offset=0&asset_contains=poll

So the above call will only retrieve transactions where the asset contains the string (or object) “poll”.

More specifically will this be possible?

client.accounts.get({ asset:{fruit:"apple" })
    .then(res => {
        console.log(res.data);
    })

As an example, to search in the asset if the key fruit contains the value apple.

Hi @korben3!

Unfortunately it is not possible to query transactions based on asset data with the API.

Also, it is not planned to add this feature to the Lisk SDK.

So in case you need transactions based on data in asset you would first require all transactions with Lisk Elements, and then write small function to filter out the relevant transactions based on the asset data.

If would like to see this feature in the Lisk SDK, feel free to open a new issue at the Lisk SDK GitHub repository, maybe the devs will include it in one of their sprints :slight_smile: