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
I would like to propose an enhancement to wagmi that would allow users to retrieve the holders of a token. I believe this could be useful for some developers who might, for example, want to integrate a ranking of holders into their dapp. What do you think?
I am very interested in implementing this feature, which could be implemented as follows:
useToken returns a getHolders function that can be called to retrieve the token holders in the following way:
getHolders({
index,
sort?,
filter?,
percent?,});
index: Passing the index of holders, for example, index: "10", index: "10:100", and index: "10:".
sort: Optional parameter: "asc" or "desc", default is "desc".
filter: Optional parameter, a function that is passed and will be applied to each entry to determine if it should be retrieved. For example:
filter: (holder)=>{returnholder.balance>10000;};
percent: Optional parameter which is a boolean, default is false. If it is true, it returns for each the percentage of tokens owned in relation to the total supply.
I would like to get your feedback on this feature.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I would like to propose an enhancement to wagmi that would allow users to retrieve the holders of a token. I believe this could be useful for some developers who might, for example, want to integrate a ranking of holders into their dapp. What do you think?
I am very interested in implementing this feature, which could be implemented as follows:
useToken returns a getHolders function that can be called to retrieve the token holders in the following way:
I would like to get your feedback on this feature.
Beta Was this translation helpful? Give feedback.
All reactions