fastnear / fastnear-api-server-rs

23 stars 4 forks source link

xREF balance is not updated when unstaked #11

Open Sliman4 opened 2 months ago

Sliman4 commented 2 months ago

Unstaked here: https://pikespeak.ai/transaction-viewer/5gW8nMyFANfnJ8nA5LHo3DfJ2SoEhx7ajJcPMnMKsVnE Screenshot (made just now at the time of opening this issue): image

xREF is not a very standard token, in terms of that it's a liquid REF staking token and has methods that modify its balance other than ft_transfer and ft_transfer_call, but I guess this could be fixed by updating the balance after an account executes any transaction that involves an FT contract

evgenykuzyakov commented 1 week ago

I guess xREF should implement ft_mint and ft_burn logs, then it will be picked up by the indexer.

Sliman4 commented 1 week ago

Sounds reasonable, but not sure if they would do it. Any chance the balance can also be updated when someone makes any call to a token contract? In most cases it shouldn't result in additional overhead, since most calls are ft_transfer that modify the predecessor's balance anyway, but this will give better info for more partially-compliant tokens. I'm not sure what's the history behind .tkn.near which has different events, but if they're supported, I feel like more non-standard-but-popular tokens can be supported as well, especially if the solution is quite generic and can fix other tokens we don't know about. I don't really want to request the balances from RPC for each token after I get a json that already has most of the correct numbers in it

marco-sundsk commented 1 week ago

For xREF, it has a upgrade interface, and it's owner, the ref DAO, could call it. So, we are gonna add ft_mint and ft_burn logs soon.

marco-sundsk commented 1 week ago

PR for xREF to fix this, https://github.com/ref-finance/ref-token/pull/5, feel free to leave comment for any questions.