Skip to content

Commit e4f00d9

Browse files
committed
feat: add endpoint getBlueChipStatistics, which returns blue chip statistics referring to [NFTScan Overview](https://www.nftscan.com/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d?module=Analytics)
1 parent 7545587 commit e4f00d9

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

src/api/evm/statistic/index.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from '../../../types/evm/statistic/request-params';
77
import {
88
QueryAccountOverviewResponse,
9+
QueryBlueChipStatisticsResponse,
910
QueryCollectionRankingResponse,
1011
QueryCollectionStatisticsResponse,
1112
QueryCollectionTradeResponse,
@@ -144,7 +145,7 @@ export default class NftscanEvmStatistic extends BaseApi<NftscanConfig> {
144145
* *****
145146
* Obtain account overview statistics.
146147
* - This endpoint returns overview statistics for an account address referring to NFTScan Overview({@link https://www.nftscan.com/0xea7a0f1434084b2e99b42f045896e7326fed9dc1}).
147-
* - details: {@link https://docs.nftscan.com/nftscan/trendingUsingGET}
148+
* - details: {@link https://docs.nftscan.com/nftscan/accountOverviewUsingGET}
148149
* @param accountAddress The account address
149150
* @returns Promise<{@link QueryAccountOverviewResponse}>
150151
*/
@@ -159,6 +160,27 @@ export default class NftscanEvmStatistic extends BaseApi<NftscanConfig> {
159160
);
160161
}
161162

163+
/**
164+
* *****
165+
* [PRO]
166+
* *****
167+
* Obtain blue chip statistics.
168+
* - This endpoint returns blue chip statistics referring to({@link https://www.nftscan.com/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d?module=Analytics}).
169+
* - details: {@link https://docs.nftscan.com/nftscan/blueChipUsingGET}
170+
* @param contractAddress The NFT contract address
171+
* @returns Promise<{@link QueryBlueChipStatisticsResponse}>
172+
*/
173+
getBlueChipStatistics(contractAddress: string): Promise<QueryBlueChipStatisticsResponse> {
174+
if (isEmpty(contractAddress)) {
175+
return missingParamError('contractAddress');
176+
}
177+
178+
return nftscanGet<NsObject, QueryBlueChipStatisticsResponse>(
179+
this.config,
180+
`${NftscanConst.API.evm.statistic.getBlueChipStatistics}${contractAddress}`,
181+
);
182+
}
183+
162184
/**
163185
* Obtain marketplace ranking statistics.
164186
* - This endpoint returns NFT marketplace ranking statistics referring to NFTScan Marketplace({@link https://www.nftscan.com/marketplace}).

src/types/evm/statistic/response-data.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,26 @@ export interface QueryCollectionStatisticsResponse {
542542
volume_24h: number;
543543
}
544544

545+
/**
546+
* The response parameters of EVM API 'getBlueChipStatistics'
547+
*/
548+
export interface QueryBlueChipStatisticsResponse {
549+
/**
550+
* How many owners who have at least one Blue Chip NFT for the collection.
551+
*/
552+
blue_chip_owner: number;
553+
554+
/**
555+
* Percentage of owners of this collection who have at least one Blue Chip NFT
556+
*/
557+
next_blue_chip_probability: string;
558+
559+
/**
560+
* How many owners for the collection
561+
*/
562+
owner: number;
563+
}
564+
545565
/**
546566
* The response parameters of EVM API 'getMintRanking'
547567
*/

src/util/nftscan.const.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export default class NftscanConst {
4545
getCollectionTrade: '/v2/statistics/collection/trade/',
4646
getCollectionTrending: '/v2/statistics/collection/trending/',
4747
getAccountOverview: '/v2/statistics/overview/',
48+
getBlueChipStatistics: '/v2/statistics/blue/chip/',
4849
getMarketplaceRanking: '/v2/statistics/ranking/marketplace',
4950
getMarketCapRanking: '/v2/statistics/ranking/marketcap',
5051
getCollectionStatistics: '/v2/statistics/collection/',

0 commit comments

Comments
 (0)