diff --git a/packages/web3-providers/src/SimpleHash/apis/EVM.ts b/packages/web3-providers/src/SimpleHash/apis/EVM.ts index 6e6b52f42fda..bb6ce9b03f8f 100644 --- a/packages/web3-providers/src/SimpleHash/apis/EVM.ts +++ b/packages/web3-providers/src/SimpleHash/apis/EVM.ts @@ -113,6 +113,28 @@ class SimpleHashAPI_EVM implements NonFungibleTokenAPI.Provider = {}, + ) { + const chain = resolveChain(NetworkPluginID.PLUGIN_EVM, chainId) + const path = urlcat('/api/v0/nfts/top_collectors/:chain/:contract_address', { + chain, + contract_address: address, + cursor: indicator?.id || undefined, + limit: size, + include_owner_image: '1', + }) + const response = await fetchFromSimpleHash<{ next_cursor: string; top_collectors: SimpleHash.TopCollector[] }>( + path, + ) + return createPageable( + response.top_collectors, + indicator, + response.next_cursor ? createNextIndicator(indicator, response.next_cursor) : undefined, + ) + } + async getCollectionOverview(chainId: ChainId, id: string): Promise { // SimpleHash collection id is not address if (isValidAddress(id)) return diff --git a/packages/web3-providers/src/types/SimpleHash.ts b/packages/web3-providers/src/types/SimpleHash.ts index 77e7cd6f4b51..9ee941309f78 100644 --- a/packages/web3-providers/src/types/SimpleHash.ts +++ b/packages/web3-providers/src/types/SimpleHash.ts @@ -173,4 +173,12 @@ export namespace SimpleHash { first_acquired_date: string last_acquired_date: string } + + export interface TopCollector { + owner_address: string + owner_ens_name: string | null + owner_image: string + distinct_nfts_owned: number + total_copies_owned: number + } }