diff --git a/CHANGELOG.md b/CHANGELOG.md index 4528e8a..69cf99f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ # Changelog +## [1.12.0](https://github.com/nftscan-official/nftscan-api-js-sdk/compare/v1.11.0...v1.12.0) (2023-12-18) + + +### ✨ Features | 新功能 + +* add interface `getChainOverview` ([913e81d](https://github.com/nftscan-official/nftscan-api-js-sdk/commit/913e81df178c0319978f24b100d71a5760d8ddf0)) + ## [1.11.0](https://github.com/nftscan-official/nftscan-api-js-sdk/compare/v1.10.0...v1.11.0) (2023-12-04) diff --git a/package.json b/package.json index b97a534..159ce5b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nftscan-api", - "version": "1.11.0", + "version": "1.12.0", "description": "js/ts SDK for NFTScan APIs", "main": "dist/cjs/index.js", "main-es": "dist/es/index.js", diff --git a/src/api/evm/statistic/index.ts b/src/api/evm/statistic/index.ts index 1528b4c..aa0b53c 100644 --- a/src/api/evm/statistic/index.ts +++ b/src/api/evm/statistic/index.ts @@ -9,6 +9,7 @@ import { import { AccountHoldingDistributionResponse, AccountHoldingTrendingResponse, + ChainOverviewResponse, CollectionBlueChipListResponse, CollectionHoldingDistributionResponse, CollectionOverviewResponse, @@ -476,4 +477,17 @@ export default class NftscanEvmStatistic extends BaseApi { { distribution_type: trendingType }, ); } + + /** + * Chain Overview + * - This endpoint returns the current chain overview data referring to NFTScan Overview({@link https://eth.nftscan.com/}). + * - details: {@link https://docs.nftscan.com/reference/evm/chain-overview} + * @returns Promise<{@link ChainOverviewResponse}> + */ + getChainOverview(): Promise { + return nftscanGet( + this.config, + `${NftscanConst.API.evm.statistic.getChainOverview}`, + ); + } } diff --git a/src/index.ts b/src/index.ts index 1f4655b..ca64098 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,6 @@ import NftscanEvm from './api/evm/nftscan-evm'; import NftscanSolana from './api/solana/nftscan-solana'; -import NftscanInit from './util/nftscan.init'; - -NftscanInit.onCreate(); +import './util/nftscan.init'; export * from './types/index'; export { NftscanEvm, NftscanSolana }; diff --git a/src/types/evm/statistic/response-data.ts b/src/types/evm/statistic/response-data.ts index 1266e7e..d6468a7 100644 --- a/src/types/evm/statistic/response-data.ts +++ b/src/types/evm/statistic/response-data.ts @@ -1102,3 +1102,58 @@ export interface AccountHoldingTrendingResponse { */ value: number; } + +/** + * The response data of EVM API 'getChainOverview' + */ +export interface ChainOverviewResponse { + /** + * The 24-hour total number of assets + */ + asset_24h: number; + + /** + * The total number of assets + */ + asset_total: number; + + /** + * The 24-hour total number of contracts + */ + contract_24h: number; + + /** + * The total number of contracts + */ + contract_total: number; + + /** + * The 24-hour total number of transactions + */ + transfer_24h: number; + + /** + * The total number of transactions + */ + transfer_total: number; + + /** + * The 24-hour total volume on the NFT Marketplaces + */ + volume_24h: number; + + /** + * The total volume on the NFT Marketplaces + */ + volume_total: number; + + /** + * The 1-day total number of wallet addresses + */ + wallet_address_1d: number; + + /** + * The total number of wallet addresses + */ + wallet_address_total: number; +} diff --git a/src/util/nftscan.const.ts b/src/util/nftscan.const.ts index 7310b35..98a60f1 100644 --- a/src/util/nftscan.const.ts +++ b/src/util/nftscan.const.ts @@ -73,6 +73,7 @@ export default class NftscanConst { getCollectionBlueChipList: '/v2/statistics/blue/chip/list', getAccountHoldingDistribution: '/v2/statistics/distribution/', getAccountHoldingTrending: '/v2/statistics/holding/trending/', + getChainOverview: '/v2/statistics/chain/overview', }, refresh: { refreshAsset: '/v2/refresh/metadata', diff --git a/src/util/nftscan.init.ts b/src/util/nftscan.init.ts index f5cd019..3d17266 100644 --- a/src/util/nftscan.init.ts +++ b/src/util/nftscan.init.ts @@ -1,13 +1,3 @@ import { initHttpConfig } from '../http/nftscan.http'; -export default class NftscanInit { - static created = false; - - static onCreate() { - if (this.created) { - return; - } - this.created = true; - initHttpConfig(); - } -} +initHttpConfig();