Skip to content

Commit

Permalink
Merge pull request #19 from nftscan-official/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
yohuohuohuo authored Dec 18, 2023
2 parents 2b7c4ae + a6e636d commit e8d25b3
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 15 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
14 changes: 14 additions & 0 deletions src/api/evm/statistic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import {
AccountHoldingDistributionResponse,
AccountHoldingTrendingResponse,
ChainOverviewResponse,
CollectionBlueChipListResponse,
CollectionHoldingDistributionResponse,
CollectionOverviewResponse,
Expand Down Expand Up @@ -476,4 +477,17 @@ export default class NftscanEvmStatistic extends BaseApi<NftscanConfig> {
{ 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<ChainOverviewResponse> {
return nftscanGet<NsObject, ChainOverviewResponse>(
this.config,
`${NftscanConst.API.evm.statistic.getChainOverview}`,
);
}
}
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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 };
55 changes: 55 additions & 0 deletions src/types/evm/statistic/response-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions src/util/nftscan.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
12 changes: 1 addition & 11 deletions src/util/nftscan.init.ts
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit e8d25b3

Please sign in to comment.