threefoldtech / tfgrid-sdk-ts

Apache License 2.0
4 stars 8 forks source link

TFChain Explorer to see TFT balance/transactions of a given wallet #2380

Open Mik-TF opened 4 months ago

Mik-TF commented 4 months ago

Which package/s are you suggesting this feature for?

tfgrid-sdk-ts, dashboard

Situation

A user asked if we had a TFChain Explorer to see TFT balance/transactions of a given wallet.

Describe the solution you'd like

Solution

As of now, balances can be queried directly from TFChain, but it's not yet user friendly.

We could offer a new section on the Dashboard, that would lead to a TFChain explorer to query wallet information.

0oM4R commented 3 months ago

who will pick this issue, please check if there is some provider that support this feature for Polkadot or substrate

sameh-farouk commented 1 week ago

My picture for this feature would be something like this: Users will be presented with a line chart showing historical balances over a configurable period or range of blocks. Additionally, there will be a table containing a transaction list with filtering and sorting options. The table can be initially visible or loaded when the user clicks on a specific point on the line chart that represents a specific block on the chain. Clicking on a transaction row can take you to the chain explorer (polkadot UI) to display the related extrinsic or inclusive block page.

Before I can start working on the indexer backend to support this use case, we need to decide on the different scenarios for displaying the list of transactions. This decision will depend on the type of transactions and the level of auditability required for the user.

1- We can display a list of all changes in the account balance, allowing for more detailed analytics and reporting on transaction-level activities. different types would be included such as withdrawals, deposits, transfers, locks, and unlocks. This would provide the user with low-level details of all changes, including intermediary statuses when we initially lock the amount every hour before eventually withdrawing and transferring the amount to the foundation, sales, stacking pool accounts, and burning the remaining.

2- The first scenario is useful and comprehensive, but it could also be overwhelming. In this case, we can consider an alternative approach where we only show the user a stripped transactions list for only ones related to his smart contracts bills. Any changes to the user's balance due to activities other than contract billing will not be recorded or included. For example, transactions related to incoming or outgoing transfers will not be shown.

3- A hybrid approach could be to list transactions related to when tokens actually leave or enter user accounts. Similar to the first scenario, this would include all balance change events except for locking and unlocking actions. This would result in a shorter list and reduced storage requirements, as these transactions normally occur every 24 hours per contract as opposed to every hour. If the balance chart displays both usable and locked balances, the transaction list won't include the transactions that caused the locked amount to change.

Appreciate all feedback. specially @Mik-TF @zaelgohary @AhmedHanafy725 @xmonader

Mik-TF commented 1 week ago

Thanks @sameh-farouk it's a great overview of what could be done.

Could we have two displays? Advanced version + basic version (default), with a toggle button on the top right corner of the screen. By default it shows the basic version, and users can click on the Advanced mode button to enable it.

In this case, we could have

If this takes a lot of time + resources, we could have two phases to integrate this in the dashboard:

About choosing between case 1. and case 3., IMO the case 1. is very satisfying for the users as it shows the whole picture. Once again, it depends on the time + resource we have on this. It might be simpler to do case 3. But case 1 would be great.