You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to support Tokens in the XT Wallet I came up with an "accuracy" problem of fetching transactions for a specific token. Atm, I'm doing 5 (five) HTTP requests to the node to get
Token Trades
Token Transfers
Open Bid Orders
Open Ask Orders
further transactions like minting, issuance, distribution using getAccountTransactions with type/subtype filter
Problem
The problem is that I need to filter the result getAccountTransactions by the Token Id, trying to find the tx for the related token. This is limited as it may happen, that an active account can have hundreds of transactions per day and then some token related transactions from a very few days ago won't appear. I could do multiple calls using the pagination, but the main problem still persists.
Solution
If we would be able to return only transactions for a given account and given token we can be much more precise on the transaction history for a token. So, additionally to the type/subtype filter an additional asset filter could be a nice extension.
I'm aware that this might introduce a bigger effort, as one cannot simply filter the attachment_bytes using SQL. And doing the filter only server side brings up the similar "accuracy" problem as doing it on application level (although, it can be done much faster due to direct database access) - Ideally, another nullable column asset_id for token/asset related can be added to the transaction table and set on each transaction with type=2.
The text was updated successfully, but these errors were encountered:
Motivation
While trying to support Tokens in the XT Wallet I came up with an "accuracy" problem of fetching transactions for a specific token. Atm, I'm doing 5 (five) HTTP requests to the node to get
getAccountTransactions
with type/subtype filterProblem
The problem is that I need to filter the result
getAccountTransactions
by the Token Id, trying to find the tx for the related token. This is limited as it may happen, that an active account can have hundreds of transactions per day and then some token related transactions from a very few days ago won't appear. I could do multiple calls using the pagination, but the main problem still persists.Solution
If we would be able to return only transactions for a given account and given token we can be much more precise on the transaction history for a token. So, additionally to the type/subtype filter an additional asset filter could be a nice extension.
I'm aware that this might introduce a bigger effort, as one cannot simply filter the attachment_bytes using SQL. And doing the filter only server side brings up the similar "accuracy" problem as doing it on application level (although, it can be done much faster due to direct database access) - Ideally, another
nullable
columnasset_id
for token/asset related can be added to thetransaction
table and set on each transaction with type=2.The text was updated successfully, but these errors were encountered: