thetatoken / theta-infrastructure-ledger-explorer

Explorer for the Theta Ledger
https://docs.thetatoken.org/
MIT License
57 stars 26 forks source link

TNS integration in Theta Ledger Explorer #37

Closed AdrienVinches closed 2 years ago

AdrienVinches commented 2 years ago

I integrate the npm tns-resolver@1.0.12 to display TNS name whenever one is assigned to an address I would like to discuss the following file in more detail, let me know what's the best way: frontend/src/common/components/stakes-table.jsx

Here is few screenshots of the result:

account-detail-guardian-account account-details-no-staking transac-deposite-stake png transac-details-smart-contract transac-details-transfer transac-list-tnt-20 transac-list-tnt-721 transac-list transac-reserve-fund transac-service-payment transac-splut-contract transac-stake-reward-distribution transac-withdraw-stake

AdrienVinches commented 2 years ago

I updated the npm to tns-resolver@2.0.1 to display TNS name whenever one is assigned to an address Here is few screenshots of the result:

account-detail-guardian-account account-details-beneficiary account-details-no-staking

stake-top-staking-wallet-tfuel stake-top-staking-wallet-theta stake-top-validator-guardian token-details-transactions-details token-details-transactions-list

transac-deposite-stake transac-details-smart-contract-transfer transac-details-smart-contract transac-details-transfer transac-list-tnt-20 transac-list-tnt-721 transac-list transac-stake-reward-distribution transac-withdraw-stake

AdrienVinches commented 2 years ago

Hi @zhenyang-sliver thanks for looking at the request and for adjustment you did! Just one observation is that by modifying the arrayUnique(array) function to return a return [...new Set(array)] instead of what I had is introducing an issue where we pass an array that can contain empty entries which the smart contracts doesn't like. Is it ok to rollback the arrayUnique function? everything else is great!

zhenyang-sliver commented 2 years ago

Thanks for the info! @AdrienVinches How about change it to return [...new Set(array.filter(a => a != null))]. It should cover that case as well.

AdrienVinches commented 2 years ago

That would be perfect! thanks!

zhenyang-sliver commented 2 years ago

Deployed the fix.

Some examples: https://explorer.thetatoken.org/account/0x4417fFbb5A04611DecCCd9Fe9529f98742664690 https://explorer.thetatoken.org/stakes

Please let me know if you see any issues. Thanks.