apenft-js-tron 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +529 -185
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -1
- package/dist/src/queryAPI/graphql/assetApi.d.ts +3 -1
- package/dist/src/queryAPI/graphql/assetApi.js +28 -0
- package/dist/src/queryAPI/graphql/collectionApi.d.ts +2 -1
- package/dist/src/queryAPI/graphql/collectionApi.js +14 -0
- package/dist/src/queryAPI/graphql/gql/asset.d.ts +2 -0
- package/dist/src/queryAPI/graphql/gql/asset.js +4 -2
- package/dist/src/queryAPI/graphql/gql/collection.d.ts +1 -0
- package/dist/src/queryAPI/graphql/gql/collection.js +4 -3
- package/dist/src/queryAPI/graphql/gql/fragments.js +1 -1
- package/dist/src/queryAPI/graphql/gql/ranking.d.ts +1 -0
- package/dist/src/queryAPI/graphql/gql/ranking.js +11 -0
- package/dist/src/queryAPI/graphql/index.d.ts +3 -1
- package/dist/src/queryAPI/graphql/index.js +4 -1
- package/dist/src/queryAPI/graphql/rankingApi.d.ts +6 -0
- package/dist/src/queryAPI/graphql/rankingApi.js +78 -0
- package/dist/src/queryAPI/index.d.ts +15 -2
- package/dist/src/queryAPI/index.js +92 -0
- package/dist/src/utils/types.d.ts +81 -4
- package/dist/src/utils/types.js +36 -1
- package/index.ts +19 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { APENFTOrders } from './src/tradeAPI/index';
|
|
2
2
|
export { APENFTQuery } from './src/queryAPI/index';
|
|
3
3
|
export { initApprove } from './src/tradeAPI/approve';
|
|
4
|
-
export { Network, MakeOrderType, APENFTSchemaName, OrderSide } from './src/utils/types';
|
|
4
|
+
export { Network, MakeOrderType, APENFTSchemaName, OrderSide, AssetSortBy, CollectionTradeTrendFilterDays, EventType, CollectionSortBy, AssetListCollectionTypes, AssetStatus, Category, } from './src/utils/types';
|
|
5
5
|
export { AssetFactory } from './src/tradeAPI/nft';
|
|
6
6
|
export type { APIConfig } from './src/utils/types';
|
|
7
7
|
export { toBaseUnitAmount, getSchemaList, makeBigNumber, } from './src/utils/helper';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.APENFTError = exports.NULL_ADDRESS = exports.makeBigNumber = exports.getSchemaList = exports.toBaseUnitAmount = exports.AssetFactory = exports.OrderSide = exports.APENFTSchemaName = exports.MakeOrderType = exports.Network = exports.initApprove = exports.APENFTQuery = exports.APENFTOrders = void 0;
|
|
3
|
+
exports.APENFTError = exports.NULL_ADDRESS = exports.makeBigNumber = exports.getSchemaList = exports.toBaseUnitAmount = exports.AssetFactory = exports.Category = exports.AssetStatus = exports.AssetListCollectionTypes = exports.CollectionSortBy = exports.EventType = exports.CollectionTradeTrendFilterDays = exports.AssetSortBy = exports.OrderSide = exports.APENFTSchemaName = exports.MakeOrderType = exports.Network = exports.initApprove = exports.APENFTQuery = exports.APENFTOrders = void 0;
|
|
4
4
|
var index_1 = require("./src/tradeAPI/index");
|
|
5
5
|
Object.defineProperty(exports, "APENFTOrders", { enumerable: true, get: function () { return index_1.APENFTOrders; } });
|
|
6
6
|
var index_2 = require("./src/queryAPI/index");
|
|
@@ -12,6 +12,13 @@ Object.defineProperty(exports, "Network", { enumerable: true, get: function () {
|
|
|
12
12
|
Object.defineProperty(exports, "MakeOrderType", { enumerable: true, get: function () { return types_1.MakeOrderType; } });
|
|
13
13
|
Object.defineProperty(exports, "APENFTSchemaName", { enumerable: true, get: function () { return types_1.APENFTSchemaName; } });
|
|
14
14
|
Object.defineProperty(exports, "OrderSide", { enumerable: true, get: function () { return types_1.OrderSide; } });
|
|
15
|
+
Object.defineProperty(exports, "AssetSortBy", { enumerable: true, get: function () { return types_1.AssetSortBy; } });
|
|
16
|
+
Object.defineProperty(exports, "CollectionTradeTrendFilterDays", { enumerable: true, get: function () { return types_1.CollectionTradeTrendFilterDays; } });
|
|
17
|
+
Object.defineProperty(exports, "EventType", { enumerable: true, get: function () { return types_1.EventType; } });
|
|
18
|
+
Object.defineProperty(exports, "CollectionSortBy", { enumerable: true, get: function () { return types_1.CollectionSortBy; } });
|
|
19
|
+
Object.defineProperty(exports, "AssetListCollectionTypes", { enumerable: true, get: function () { return types_1.AssetListCollectionTypes; } });
|
|
20
|
+
Object.defineProperty(exports, "AssetStatus", { enumerable: true, get: function () { return types_1.AssetStatus; } });
|
|
21
|
+
Object.defineProperty(exports, "Category", { enumerable: true, get: function () { return types_1.Category; } });
|
|
15
22
|
var nft_1 = require("./src/tradeAPI/nft");
|
|
16
23
|
Object.defineProperty(exports, "AssetFactory", { enumerable: true, get: function () { return nft_1.AssetFactory; } });
|
|
17
24
|
// for APENFT market
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APIConfig, AssetListingsParams, AssetDetailParams, AssetMoreParams, AssetTradingHistory } from "../../utils/types";
|
|
1
|
+
import { APIConfig, AssetListingsParams, AssetDetailParams, AssetMoreParams, AssetTradingHistory, AssetQueryParams } from "../../utils/types";
|
|
2
2
|
import { GraphqlApi } from "./base";
|
|
3
3
|
export declare class AssetApi extends GraphqlApi {
|
|
4
4
|
constructor(config: APIConfig);
|
|
@@ -10,4 +10,6 @@ export declare class AssetApi extends GraphqlApi {
|
|
|
10
10
|
getAssetListingInfo(params: AssetDetailParams): Promise<any>;
|
|
11
11
|
getAssetSales(params: AssetDetailParams): Promise<any>;
|
|
12
12
|
getAssetBids(params: AssetDetailParams): Promise<any>;
|
|
13
|
+
getCurrencies(): Promise<any>;
|
|
14
|
+
getAllAssets(params: AssetQueryParams): Promise<any>;
|
|
13
15
|
}
|
|
@@ -171,6 +171,34 @@ var AssetApi = /** @class */ (function (_super) {
|
|
|
171
171
|
});
|
|
172
172
|
});
|
|
173
173
|
};
|
|
174
|
+
AssetApi.prototype.getCurrencies = function () {
|
|
175
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
176
|
+
return __generator(this, function (_a) {
|
|
177
|
+
switch (_a.label) {
|
|
178
|
+
case 0: return [4 /*yield*/, this.blockChainRequest({
|
|
179
|
+
funcName: "getCurrencies",
|
|
180
|
+
gql: asset_1.getCurrencies,
|
|
181
|
+
params: {},
|
|
182
|
+
})];
|
|
183
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
AssetApi.prototype.getAllAssets = function (params) {
|
|
189
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
switch (_a.label) {
|
|
192
|
+
case 0: return [4 /*yield*/, this.blockChainRequest({
|
|
193
|
+
funcName: "getAllAssets",
|
|
194
|
+
gql: asset_1.getAllAssets,
|
|
195
|
+
params: params,
|
|
196
|
+
})];
|
|
197
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
};
|
|
174
202
|
return AssetApi;
|
|
175
203
|
}(base_1.GraphqlApi));
|
|
176
204
|
exports.AssetApi = AssetApi;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APIConfig, CollectionTradeTrendParams, AddressParams, CollectionTradingHistoryParams, HotCollectionsParams } from "../../utils/types";
|
|
1
|
+
import { APIConfig, CollectionTradeTrendParams, AddressParams, CollectionTradingHistoryParams, HotCollectionsParams, CollectionListParams } from "../../utils/types";
|
|
2
2
|
import { GraphqlApi } from "./base";
|
|
3
3
|
export declare class CollectionApi extends GraphqlApi {
|
|
4
4
|
constructor(config: APIConfig);
|
|
@@ -7,4 +7,5 @@ export declare class CollectionApi extends GraphqlApi {
|
|
|
7
7
|
getSingleCollectionAttributes(params: AddressParams): Promise<any>;
|
|
8
8
|
getCollectionTradingHistory(params: CollectionTradingHistoryParams): Promise<any>;
|
|
9
9
|
getHotCollections(params: HotCollectionsParams): Promise<any>;
|
|
10
|
+
getAllCollections(params: CollectionListParams): Promise<any>;
|
|
10
11
|
}
|
|
@@ -129,6 +129,20 @@ var CollectionApi = /** @class */ (function (_super) {
|
|
|
129
129
|
});
|
|
130
130
|
});
|
|
131
131
|
};
|
|
132
|
+
CollectionApi.prototype.getAllCollections = function (params) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
+
return __generator(this, function (_a) {
|
|
135
|
+
switch (_a.label) {
|
|
136
|
+
case 0: return [4 /*yield*/, this.blockChainRequest({
|
|
137
|
+
funcName: "getAllCollections",
|
|
138
|
+
gql: collection_1.getAllCollections,
|
|
139
|
+
params: params,
|
|
140
|
+
})];
|
|
141
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
};
|
|
132
146
|
return CollectionApi;
|
|
133
147
|
}(base_1.GraphqlApi));
|
|
134
148
|
exports.CollectionApi = CollectionApi;
|
|
@@ -6,3 +6,5 @@ export declare const getAssetMoreCollection: string;
|
|
|
6
6
|
export declare const getAssetListingInfo: string;
|
|
7
7
|
export declare const getAssetSales: string;
|
|
8
8
|
export declare const getAssetBids: string;
|
|
9
|
+
export declare const getCurrencies: string;
|
|
10
|
+
export declare const getAllAssets: string;
|
|
@@ -4,7 +4,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getAssetBids = exports.getAssetSales = exports.getAssetListingInfo = exports.getAssetMoreCollection = exports.getAssetTradingHistory = exports.getAssetOffers = exports.getAssetListings = exports.getAssetDetail = void 0;
|
|
7
|
+
exports.getAllAssets = exports.getCurrencies = exports.getAssetBids = exports.getAssetSales = exports.getAssetListingInfo = exports.getAssetMoreCollection = exports.getAssetTradingHistory = exports.getAssetOffers = exports.getAssetListings = exports.getAssetDetail = void 0;
|
|
8
8
|
var graphql_request_1 = require("graphql-request");
|
|
9
9
|
var fragments_1 = require("./fragments");
|
|
10
10
|
exports.getAssetDetail = (0, graphql_request_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n query getAssetDetail($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n token_id\n contract_address\n image_url\n animation_url\n token_uri\n token_type\n name\n description\n creators {\n address\n profile {\n user_name\n profile_image_url\n }\n }\n attributes {\n trait_type\n value\n }\n collection {\n royalty\n royalty_address\n name\n is_verified\n contract_address\n image_url\n description\n discord_link\n facebook_link\n instagram_link\n telegram_link\n twitter_link\n website_link\n external_url\n medium_link\n categories\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n }\n payment_tokens {\n address\n symbol\n decimal\n icon\n }\n attributes {\n asset_total\n trait_types_total\n trait_types {\n trait_type\n values_total\n values {\n count\n value\n }\n }\n }\n }\n asks_v2 {\n ...asksFields\n }\n bids_v2 {\n ...bidsFields\n }\n sales_v2 {\n ...salesFields\n }\n owners {\n balance\n owner {\n ...userFields\n }\n }\n }\n }\n"], ["\n ", "\n ", "\n ", "\n ", "\n query getAssetDetail($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n token_id\n contract_address\n image_url\n animation_url\n token_uri\n token_type\n name\n description\n creators {\n address\n profile {\n user_name\n profile_image_url\n }\n }\n attributes {\n trait_type\n value\n }\n collection {\n royalty\n royalty_address\n name\n is_verified\n contract_address\n image_url\n description\n discord_link\n facebook_link\n instagram_link\n telegram_link\n twitter_link\n website_link\n external_url\n medium_link\n categories\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n }\n payment_tokens {\n address\n symbol\n decimal\n icon\n }\n attributes {\n asset_total\n trait_types_total\n trait_types {\n trait_type\n values_total\n values {\n count\n value\n }\n }\n }\n }\n asks_v2 {\n ...asksFields\n }\n bids_v2 {\n ...bidsFields\n }\n sales_v2 {\n ...salesFields\n }\n owners {\n balance\n owner {\n ...userFields\n }\n }\n }\n }\n"])), fragments_1.USER_FIELDS, fragments_1.ASKS_FIELDS, fragments_1.BIDS_FIELDS, fragments_1.SALES_FIELDS);
|
|
@@ -15,4 +15,6 @@ exports.getAssetMoreCollection = (0, graphql_request_1.gql)(templateObject_5 ||
|
|
|
15
15
|
exports.getAssetListingInfo = (0, graphql_request_1.gql)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n query getAssetListingInfo($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n asks_v2 {\n ...asksFields\n }\n }\n }\n"], ["\n ", "\n query getAssetListingInfo($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n asks_v2 {\n ...asksFields\n }\n }\n }\n"])), fragments_1.ASKS_FIELDS);
|
|
16
16
|
exports.getAssetSales = (0, graphql_request_1.gql)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n query getAssetSales($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n sales_v2 {\n ...salesFields\n }\n }\n }\n"], ["\n ", "\n query getAssetSales($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n sales_v2 {\n ...salesFields\n }\n }\n }\n"])), fragments_1.SALES_FIELDS);
|
|
17
17
|
exports.getAssetBids = (0, graphql_request_1.gql)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n query getAssetSales($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n bids_v2 {\n ...bidsFields\n }\n }\n }\n"], ["\n ", "\n query getAssetSales($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n bids_v2 {\n ...bidsFields\n }\n }\n }\n"])), fragments_1.BIDS_FIELDS);
|
|
18
|
-
|
|
18
|
+
exports.getCurrencies = (0, graphql_request_1.gql)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n query getCurrencyList {\n ui_filters {\n explore_currencies {\n address\n icon\n symbol\n }\n }\n }\n"], ["\n query getCurrencyList {\n ui_filters {\n explore_currencies {\n address\n icon\n symbol\n }\n }\n }\n"])));
|
|
19
|
+
exports.getAllAssets = (0, graphql_request_1.gql)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n ", "\n ", "\n query getAssets(\n $pagination: Pagination\n $sort: AssetSortBy\n $price: PriceRangeFilter\n $statuses: [AssetStatus]\n $collections: [String]\n $user_account: String\n $owners: [String]\n $creators: [String]\n $attributes: [AttributesFilter]\n $search: String\n $categories: [String]\n $currencies: [String]\n $is_recommend: Boolean,\n $collection_types: [assetListCollectionTypes]\n ) {\n assets(\n sort: $sort\n pagination: $pagination\n price: $price\n statuses: $statuses\n collections: $collections\n user_account: $user_account\n owners: $owners\n creators: $creators\n attributes: $attributes\n search: $search\n categories: $categories\n currencies: $currencies\n is_recommend: $is_recommend,\n collection_types: $collection_types\n ) {\n items {\n ...assetsFields,\n }\n pagination {\n ...paginationFields\n total\n }\n }\n }\n"], ["\n ", "\n ", "\n query getAssets(\n $pagination: Pagination\n $sort: AssetSortBy\n $price: PriceRangeFilter\n $statuses: [AssetStatus]\n $collections: [String]\n $user_account: String\n $owners: [String]\n $creators: [String]\n $attributes: [AttributesFilter]\n $search: String\n $categories: [String]\n $currencies: [String]\n $is_recommend: Boolean,\n $collection_types: [assetListCollectionTypes]\n ) {\n assets(\n sort: $sort\n pagination: $pagination\n price: $price\n statuses: $statuses\n collections: $collections\n user_account: $user_account\n owners: $owners\n creators: $creators\n attributes: $attributes\n search: $search\n categories: $categories\n currencies: $currencies\n is_recommend: $is_recommend,\n collection_types: $collection_types\n ) {\n items {\n ...assetsFields,\n }\n pagination {\n ...paginationFields\n total\n }\n }\n }\n"])), fragments_1.PAGINATION_FIELDS, fragments_1.ASSETS_FIELDS);
|
|
20
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
@@ -4,12 +4,13 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getHotCollections = exports.getCollectionTradingHistory = exports.getSingleCollectionInfo = exports.getSingleCollectionAttributes = exports.getCollectionTradeTrend = void 0;
|
|
7
|
+
exports.getAllCollections = exports.getHotCollections = exports.getCollectionTradingHistory = exports.getSingleCollectionInfo = exports.getSingleCollectionAttributes = exports.getCollectionTradeTrend = void 0;
|
|
8
8
|
var graphql_request_1 = require("graphql-request");
|
|
9
9
|
var fragments_1 = require("./fragments");
|
|
10
10
|
exports.getCollectionTradeTrend = (0, graphql_request_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n query getCollectionTradeTrend($days: CollectionTradeTrendFilterDays, $collection: String) {\n collection_trade_trend(days: $days, collection: $collection) {\n avg_price\n num_sale\n volume\n day_stats {\n avg_price\n num_sale\n timestamp\n volume\n }\n }\n }\n"], ["\n query getCollectionTradeTrend($days: CollectionTradeTrendFilterDays, $collection: String) {\n collection_trade_trend(days: $days, collection: $collection) {\n avg_price\n num_sale\n volume\n day_stats {\n avg_price\n num_sale\n timestamp\n volume\n }\n }\n }\n"])));
|
|
11
11
|
exports.getSingleCollectionAttributes = (0, graphql_request_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n query getSingleCollectionAttributes($address: String) {\n collection(address: $address) {\n attributes {\n asset_total\n trait_types {\n trait_type\n values_total\n values {\n count\n value\n }\n }\n }\n }\n }\n"], ["\n query getSingleCollectionAttributes($address: String) {\n collection(address: $address) {\n attributes {\n asset_total\n trait_types {\n trait_type\n values_total\n values {\n count\n value\n }\n }\n }\n }\n }\n"])));
|
|
12
12
|
exports.getSingleCollectionInfo = (0, graphql_request_1.gql)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n query getSingleCollectionInfo($address: String) {\n collection(address: $address) {\n contract_address\n description\n discord_link\n facebook_link\n instagram_link\n telegram_link\n twitter_link\n website_link\n external_url\n medium_link\n image_original_url\n image_url\n banner_image_url\n is_verified\n in_activity\n name\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n avg_price_24h\n }\n owner {\n address\n }\n co_operators\n }\n }\n"], ["\n query getSingleCollectionInfo($address: String) {\n collection(address: $address) {\n contract_address\n description\n discord_link\n facebook_link\n instagram_link\n telegram_link\n twitter_link\n website_link\n external_url\n medium_link\n image_original_url\n image_url\n banner_image_url\n is_verified\n in_activity\n name\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n avg_price_24h\n }\n owner {\n address\n }\n co_operators\n }\n }\n"])));
|
|
13
|
-
exports.getCollectionTradingHistory = (0, graphql_request_1.gql)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n query getCollectionTradingHistory(\n $pagination: Pagination\n $event_types: [EventType]\n $currencies: [String]\n $collections: [String]\n $user: String\n ) {\n events(pagination: $pagination, event_types: $event_types, currencies: $currencies, collections: $collections, user: $user) {\n items {\n event_type\n event_time\n expire_time\n from_address\n to_address\n token_id\n tx_hash\n contract_address\n to {\n ...
|
|
13
|
+
exports.getCollectionTradingHistory = (0, graphql_request_1.gql)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n ", "\n query getCollectionTradingHistory(\n $pagination: Pagination\n $event_types: [EventType]\n $currencies: [String]\n $collections: [String]\n $user: String\n ) {\n events(pagination: $pagination, event_types: $event_types, currencies: $currencies, collections: $collections, user: $user) {\n items {\n event_type\n event_time\n expire_time\n from_address\n to_address\n token_id\n tx_hash\n contract_address\n to {\n ...userFields\n }\n from {\n ...userFields\n }\n quantity\n payments {\n currency {\n symbol\n icon\n decimal\n }\n price\n }\n token {\n image_url\n name\n }\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"], ["\n ", "\n ", "\n query getCollectionTradingHistory(\n $pagination: Pagination\n $event_types: [EventType]\n $currencies: [String]\n $collections: [String]\n $user: String\n ) {\n events(pagination: $pagination, event_types: $event_types, currencies: $currencies, collections: $collections, user: $user) {\n items {\n event_type\n event_time\n expire_time\n from_address\n to_address\n token_id\n tx_hash\n contract_address\n to {\n ...userFields\n }\n from {\n ...userFields\n }\n quantity\n payments {\n currency {\n symbol\n icon\n decimal\n }\n price\n }\n token {\n image_url\n name\n }\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"])), fragments_1.PAGINATION_FIELDS, fragments_1.USER_FIELDS);
|
|
14
14
|
exports.getHotCollections = (0, graphql_request_1.gql)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query getHotCollections($chain: String, $is_recommend: Boolean) {\n collections(chain: $chain, is_recommend: $is_recommend) {\n items {\n image_url\n name\n contract_address\n is_verified\n description\n fore_banner_image_url\n banner_image_url\n object_count\n stat {\n volume_total\n floor_price\n owners_total\n assets_total\n }\n }\n }\n }\n"], ["\n query getHotCollections($chain: String, $is_recommend: Boolean) {\n collections(chain: $chain, is_recommend: $is_recommend) {\n items {\n image_url\n name\n contract_address\n is_verified\n description\n fore_banner_image_url\n banner_image_url\n object_count\n stat {\n volume_total\n floor_price\n owners_total\n assets_total\n }\n }\n }\n }\n"])));
|
|
15
|
-
|
|
15
|
+
exports.getAllCollections = (0, graphql_request_1.gql)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n query getCollections(\n $pagination: Pagination\n $sort: CollectionSortBy\n $search: String\n $owners: [String]\n $asset_owners: [String]\n $asset_creators: [String]\n $event_involved: [String]\n $collection_types: [collectionListCollectionTypes]\n ) {\n collections(\n pagination: $pagination\n sort: $sort\n search: $search\n owners: $owners\n asset_owners: $asset_owners\n asset_creators: $asset_creators\n event_involved: $event_involved,\n collection_types: $collection_types\n ) {\n items {\n name\n image_url\n contract_address\n is_verified\n object_count\n stat {\n floor_price\n }\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"], ["\n ", "\n query getCollections(\n $pagination: Pagination\n $sort: CollectionSortBy\n $search: String\n $owners: [String]\n $asset_owners: [String]\n $asset_creators: [String]\n $event_involved: [String]\n $collection_types: [collectionListCollectionTypes]\n ) {\n collections(\n pagination: $pagination\n sort: $sort\n search: $search\n owners: $owners\n asset_owners: $asset_owners\n asset_creators: $asset_creators\n event_involved: $event_involved,\n collection_types: $collection_types\n ) {\n items {\n name\n image_url\n contract_address\n is_verified\n object_count\n stat {\n floor_price\n }\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"])), fragments_1.PAGINATION_FIELDS);
|
|
16
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -12,6 +12,6 @@ exports.CURRENCY_FIELDS = (0, graphql_request_1.gql)(templateObject_3 || (templa
|
|
|
12
12
|
exports.ASKS_FIELDS = (0, graphql_request_1.gql)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n fragment asksFields on NFTBestAsk {\n bestAskCreatedDate\n bestAskExpirationDate\n bestAskListingDate\n bestAskOrderQuantity\n bestAskOrderString\n bestAskOrderType\n bestAskPrice\n bestAskPriceBase\n bestAskPriceCNY\n bestAskPriceUSD\n bestAskSaleKind\n bestAskToken\n bestAskTokenId\n chain\n chainId\n contractAddress\n currency {\n address\n decimal\n icon\n symbol\n }\n }\n"], ["\n fragment asksFields on NFTBestAsk {\n bestAskCreatedDate\n bestAskExpirationDate\n bestAskListingDate\n bestAskOrderQuantity\n bestAskOrderString\n bestAskOrderType\n bestAskPrice\n bestAskPriceBase\n bestAskPriceCNY\n bestAskPriceUSD\n bestAskSaleKind\n bestAskToken\n bestAskTokenId\n chain\n chainId\n contractAddress\n currency {\n address\n decimal\n icon\n symbol\n }\n }\n"])));
|
|
13
13
|
exports.BIDS_FIELDS = (0, graphql_request_1.gql)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n fragment bidsFields on NFTBestBid {\n bestBidCreatedDate\n bestBidListingDate\n bestBidOrderQuantity\n bestBidOrderString\n bestBidPrice\n bestBidPriceBase\n bestBidPriceCNY\n bestBidPriceUSD\n bestBidToken\n bestBidTokenId\n chain\n chainId\n contractAddress\n currency {\n address\n decimal\n icon\n symbol\n }\n }\n"], ["\n fragment bidsFields on NFTBestBid {\n bestBidCreatedDate\n bestBidListingDate\n bestBidOrderQuantity\n bestBidOrderString\n bestBidPrice\n bestBidPriceBase\n bestBidPriceCNY\n bestBidPriceUSD\n bestBidToken\n bestBidTokenId\n chain\n chainId\n contractAddress\n currency {\n address\n decimal\n icon\n symbol\n }\n }\n"])));
|
|
14
14
|
exports.SALES_FIELDS = (0, graphql_request_1.gql)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n fragment salesFields on NFTLastSale {\n currency {\n address\n decimal\n icon\n symbol\n }\n lastSalePrice\n lastSaleQuantity\n }\n"], ["\n fragment salesFields on NFTLastSale {\n currency {\n address\n decimal\n icon\n symbol\n }\n lastSalePrice\n lastSaleQuantity\n }\n"])));
|
|
15
|
-
exports.ASSETS_FIELDS = (0, graphql_request_1.gql)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n fragment assetsFields on Token {\n token_id\n contract_address\n image_url\n animation_url\n name\n collection {\n name\n is_verified\n contract_address\n image_url\n banner_image_url\n description\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n }\n payment_tokens {\n address\n symbol\n decimal\n icon\n }\n }\n asks_v2 {\n ...asksFields\n }\n bids_v2 {\n ...bidsFields\n }\n sales_v2 {\n ...salesFields\n }\n owners {\n owner {\n ...userFields\n }\n }\n }\n"], ["\n ", "\n ", "\n ", "\n ", "\n fragment assetsFields on Token {\n token_id\n contract_address\n image_url\n animation_url\n name\n collection {\n name\n is_verified\n contract_address\n image_url\n banner_image_url\n description\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n }\n payment_tokens {\n address\n symbol\n decimal\n icon\n }\n }\n asks_v2 {\n ...asksFields\n }\n bids_v2 {\n ...bidsFields\n }\n sales_v2 {\n ...salesFields\n }\n owners {\n owner {\n ...userFields\n }\n }\n }\n"])), exports.USER_FIELDS, exports.ASKS_FIELDS, exports.BIDS_FIELDS, exports.SALES_FIELDS);
|
|
15
|
+
exports.ASSETS_FIELDS = (0, graphql_request_1.gql)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n fragment assetsFields on Token {\n token_id\n contract_address\n image_url\n animation_url\n name\n token_type\n token_uri\n collection {\n royalty\n royalty_address\n name\n is_verified\n contract_address\n image_url\n banner_image_url\n description\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n }\n payment_tokens {\n address\n symbol\n decimal\n icon\n }\n }\n asks_v2 {\n ...asksFields\n }\n bids_v2 {\n ...bidsFields\n }\n sales_v2 {\n ...salesFields\n }\n owners {\n owner {\n ...userFields\n }\n }\n }\n"], ["\n ", "\n ", "\n ", "\n ", "\n fragment assetsFields on Token {\n token_id\n contract_address\n image_url\n animation_url\n name\n token_type\n token_uri\n collection {\n royalty\n royalty_address\n name\n is_verified\n contract_address\n image_url\n banner_image_url\n description\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n }\n payment_tokens {\n address\n symbol\n decimal\n icon\n }\n }\n asks_v2 {\n ...asksFields\n }\n bids_v2 {\n ...bidsFields\n }\n sales_v2 {\n ...salesFields\n }\n owners {\n owner {\n ...userFields\n }\n }\n }\n"])), exports.USER_FIELDS, exports.ASKS_FIELDS, exports.BIDS_FIELDS, exports.SALES_FIELDS);
|
|
16
16
|
exports.ORDER_FIELDS = (0, graphql_request_1.gql)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n fragment orderFields on OrderV2 {\n approvedOnChain\n basePrice\n cancelled\n chain\n chainId\n closedTime\n closingDate\n createdDate\n collection {\n contract_address\n name\n stat {\n floor_price\n }\n }\n createdDate\n currency {\n symbol\n icon\n decimal\n }\n dataToCall\n englishAuctionReservePrice\n exchange\n exchangeData\n expirationTime\n extra\n feeMethod\n feeRecipient\n finalized\n howToCall\n id\n listingTime\n maker\n makerProtocolFee\n makerRelayerFee\n makerUser {\n address\n profile {\n account_address\n profile_image_url\n user_name\n }\n }\n markedInvalid\n metadata {\n asset {\n address\n data\n id\n quantity\n }\n schema\n }\n orderHash\n orderType\n paymentToken\n price\n priceBase\n priceCNY\n priceUSD\n quantity\n r\n replacementPattern\n s\n saleKind\n salt\n side\n standard\n staticExtradata\n staticTarget\n taker\n takerProtocolFee\n takerRelayerFee\n takerUser {\n address\n profile {\n account_address\n profile_image_url\n user_name\n }\n }\n target\n token {\n image_url\n name\n token_id\n token_type\n }\n v\n }\n"], ["\n fragment orderFields on OrderV2 {\n approvedOnChain\n basePrice\n cancelled\n chain\n chainId\n closedTime\n closingDate\n createdDate\n collection {\n contract_address\n name\n stat {\n floor_price\n }\n }\n createdDate\n currency {\n symbol\n icon\n decimal\n }\n dataToCall\n englishAuctionReservePrice\n exchange\n exchangeData\n expirationTime\n extra\n feeMethod\n feeRecipient\n finalized\n howToCall\n id\n listingTime\n maker\n makerProtocolFee\n makerRelayerFee\n makerUser {\n address\n profile {\n account_address\n profile_image_url\n user_name\n }\n }\n markedInvalid\n metadata {\n asset {\n address\n data\n id\n quantity\n }\n schema\n }\n orderHash\n orderType\n paymentToken\n price\n priceBase\n priceCNY\n priceUSD\n quantity\n r\n replacementPattern\n s\n saleKind\n salt\n side\n standard\n staticExtradata\n staticTarget\n taker\n takerProtocolFee\n takerRelayerFee\n takerUser {\n address\n profile {\n account_address\n profile_image_url\n user_name\n }\n }\n target\n token {\n image_url\n name\n token_id\n token_type\n }\n v\n }\n"])));
|
|
17
17
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRankingDetail: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getRankingDetail = void 0;
|
|
8
|
+
var graphql_request_1 = require("graphql-request");
|
|
9
|
+
var fragments_1 = require("./fragments");
|
|
10
|
+
exports.getRankingDetail = (0, graphql_request_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n query rankingDetail(\n $sort: CollectionSortBy\n $categories: [String]\n $sort_asc: Boolean\n $pagination: Pagination\n $is_rank_disabled: Boolean\n $has_listing_asset: Boolean\n ) {\n collections(\n sort: $sort\n categories: $categories\n sort_asc: $sort_asc\n pagination: $pagination\n is_rank_disabled: $is_rank_disabled,\n has_listing_asset: $has_listing_asset,\n ) {\n items {\n image_url\n name\n contract_address\n is_verified\n stat {\n volume_total\n avg_price_ratio_24h\n avg_price_ratio_7d\n avg_price_24h\n floor_price\n owners_total\n assets_total\n volume_24h\n volume_30d\n volume_7d\n volume_ratio_24h\n volume_ratio_30d\n volume_ratio_7d\n floor_price_24h\n floor_price_30d\n floor_price_7d\n floor_price_ratio_24h\n floor_price_ratio_30d\n floor_price_ratio_7d\n top_price_24h\n top_price_30d\n top_price_7d\n top_price_ratio_24h\n top_price_ratio_30d\n top_price_ratio_7d\n }\n }\n pagination {\n total\n ...paginationFields\n }\n }\n }\n"], ["\n ", "\n query rankingDetail(\n $sort: CollectionSortBy\n $categories: [String]\n $sort_asc: Boolean\n $pagination: Pagination\n $is_rank_disabled: Boolean\n $has_listing_asset: Boolean\n ) {\n collections(\n sort: $sort\n categories: $categories\n sort_asc: $sort_asc\n pagination: $pagination\n is_rank_disabled: $is_rank_disabled,\n has_listing_asset: $has_listing_asset,\n ) {\n items {\n image_url\n name\n contract_address\n is_verified\n stat {\n volume_total\n avg_price_ratio_24h\n avg_price_ratio_7d\n avg_price_24h\n floor_price\n owners_total\n assets_total\n volume_24h\n volume_30d\n volume_7d\n volume_ratio_24h\n volume_ratio_30d\n volume_ratio_7d\n floor_price_24h\n floor_price_30d\n floor_price_7d\n floor_price_ratio_24h\n floor_price_ratio_30d\n floor_price_ratio_7d\n top_price_24h\n top_price_30d\n top_price_7d\n top_price_ratio_24h\n top_price_ratio_30d\n top_price_ratio_7d\n }\n }\n pagination {\n total\n ...paginationFields\n }\n }\n }\n"])), fragments_1.PAGINATION_FIELDS);
|
|
11
|
+
var templateObject_1;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { CollectionApi } from "./collectionApi";
|
|
2
2
|
import { AssetApi } from "./assetApi";
|
|
3
3
|
import { AccountApi } from "./accountApi";
|
|
4
|
+
import { RankingApi } from "./rankingApi";
|
|
4
5
|
export declare const GqlApi: {
|
|
5
6
|
collectionApi: typeof CollectionApi;
|
|
6
7
|
assetApi: typeof AssetApi;
|
|
7
8
|
accountApi: typeof AccountApi;
|
|
9
|
+
rankingApi: typeof RankingApi;
|
|
8
10
|
};
|
|
9
|
-
export { CollectionApi, AssetApi, AccountApi };
|
|
11
|
+
export { CollectionApi, AssetApi, AccountApi, RankingApi };
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AccountApi = exports.AssetApi = exports.CollectionApi = exports.GqlApi = void 0;
|
|
3
|
+
exports.RankingApi = exports.AccountApi = exports.AssetApi = exports.CollectionApi = exports.GqlApi = void 0;
|
|
4
4
|
var collectionApi_1 = require("./collectionApi");
|
|
5
5
|
Object.defineProperty(exports, "CollectionApi", { enumerable: true, get: function () { return collectionApi_1.CollectionApi; } });
|
|
6
6
|
var assetApi_1 = require("./assetApi");
|
|
7
7
|
Object.defineProperty(exports, "AssetApi", { enumerable: true, get: function () { return assetApi_1.AssetApi; } });
|
|
8
8
|
var accountApi_1 = require("./accountApi");
|
|
9
9
|
Object.defineProperty(exports, "AccountApi", { enumerable: true, get: function () { return accountApi_1.AccountApi; } });
|
|
10
|
+
var rankingApi_1 = require("./rankingApi");
|
|
11
|
+
Object.defineProperty(exports, "RankingApi", { enumerable: true, get: function () { return rankingApi_1.RankingApi; } });
|
|
10
12
|
exports.GqlApi = {
|
|
11
13
|
collectionApi: collectionApi_1.CollectionApi,
|
|
12
14
|
assetApi: assetApi_1.AssetApi,
|
|
13
15
|
accountApi: accountApi_1.AccountApi,
|
|
16
|
+
rankingApi: rankingApi_1.RankingApi,
|
|
14
17
|
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.RankingApi = void 0;
|
|
55
|
+
var ranking_1 = require("./gql/ranking");
|
|
56
|
+
var base_1 = require("./base");
|
|
57
|
+
var RankingApi = /** @class */ (function (_super) {
|
|
58
|
+
__extends(RankingApi, _super);
|
|
59
|
+
function RankingApi(config) {
|
|
60
|
+
return _super.call(this, config) || this;
|
|
61
|
+
}
|
|
62
|
+
RankingApi.prototype.getRankingDetail = function (params) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
+
return __generator(this, function (_a) {
|
|
65
|
+
switch (_a.label) {
|
|
66
|
+
case 0: return [4 /*yield*/, this.blockChainRequest({
|
|
67
|
+
funcName: 'getRankingDetail',
|
|
68
|
+
gql: ranking_1.getRankingDetail,
|
|
69
|
+
params: params,
|
|
70
|
+
})];
|
|
71
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
return RankingApi;
|
|
77
|
+
}(base_1.GraphqlApi));
|
|
78
|
+
exports.RankingApi = RankingApi;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { QueryAPI } from "./restful/queryAPI";
|
|
2
|
-
import { CollectionApi, AssetApi, AccountApi } from "./graphql/index";
|
|
2
|
+
import { CollectionApi, AssetApi, AccountApi, RankingApi } from "./graphql/index";
|
|
3
3
|
import TronWeb from "tronweb";
|
|
4
|
-
import { APIConfig, AddressParams, CollectionTradeTrendParams, CollectionTradingHistoryParams, HotCollectionsParams, FixPriceOrderParams, EnglishAuctionOrderParams, LowerPriceOrderParams, Pagination } from "../utils/types";
|
|
4
|
+
import { APIConfig, AddressParams, CollectionTradeTrendParams, CollectionTradingHistoryParams, HotCollectionsParams, AssetSortBy, FixPriceOrderParams, EnglishAuctionOrderParams, LowerPriceOrderParams, Pagination, AssetQueryFilters, CollectionSortBy, CollectionListFilterObj, RankingDetailParams } from "../utils/types";
|
|
5
5
|
export declare class APENFTQuery extends QueryAPI {
|
|
6
6
|
gqlApi: {
|
|
7
7
|
collectionApi: CollectionApi;
|
|
8
8
|
assetApi: AssetApi;
|
|
9
9
|
accountApi: AccountApi;
|
|
10
|
+
rankingApi: RankingApi;
|
|
10
11
|
};
|
|
11
12
|
walletProvider: TronWeb;
|
|
12
13
|
accountAddress: string;
|
|
@@ -42,4 +43,16 @@ export declare class APENFTQuery extends QueryAPI {
|
|
|
42
43
|
getSentOffers(account: string, pagination?: Pagination): Promise<any>;
|
|
43
44
|
getReceivedOffers(account: string, pagination?: Pagination): Promise<any>;
|
|
44
45
|
getCollections(account: string, pagination?: Pagination): Promise<any>;
|
|
46
|
+
getAllCollections(params: {
|
|
47
|
+
sort?: CollectionSortBy;
|
|
48
|
+
pagination?: Pagination;
|
|
49
|
+
filters?: CollectionListFilterObj;
|
|
50
|
+
}): Promise<any>;
|
|
51
|
+
getCurrencies(): Promise<any>;
|
|
52
|
+
getAllAssets(params: {
|
|
53
|
+
sort: AssetSortBy;
|
|
54
|
+
pagination?: Pagination;
|
|
55
|
+
filters?: AssetQueryFilters;
|
|
56
|
+
}): Promise<any>;
|
|
57
|
+
getRankingNFTs(params: RankingDetailParams): Promise<any>;
|
|
45
58
|
}
|
|
@@ -94,6 +94,10 @@ var APENFTQuery = /** @class */ (function (_super) {
|
|
|
94
94
|
networkName: networkName,
|
|
95
95
|
account: _this.accountAddress,
|
|
96
96
|
}),
|
|
97
|
+
rankingApi: new index_1.GqlApi.rankingApi({
|
|
98
|
+
networkName: networkName,
|
|
99
|
+
account: _this.accountAddress,
|
|
100
|
+
}),
|
|
97
101
|
};
|
|
98
102
|
_this.walletProvider = walletProvider;
|
|
99
103
|
return _this;
|
|
@@ -674,6 +678,94 @@ var APENFTQuery = /** @class */ (function (_super) {
|
|
|
674
678
|
});
|
|
675
679
|
});
|
|
676
680
|
};
|
|
681
|
+
APENFTQuery.prototype.getAllCollections = function (params) {
|
|
682
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
683
|
+
var _a, sort, pagination, filters, _params, _b, search, owners, data;
|
|
684
|
+
return __generator(this, function (_c) {
|
|
685
|
+
switch (_c.label) {
|
|
686
|
+
case 0:
|
|
687
|
+
_a = params || {}, sort = _a.sort, pagination = _a.pagination, filters = _a.filters;
|
|
688
|
+
_params = {
|
|
689
|
+
pagination: {
|
|
690
|
+
first: (pagination === null || pagination === void 0 ? void 0 : pagination.first) || 100,
|
|
691
|
+
cursor: (pagination === null || pagination === void 0 ? void 0 : pagination.cursor) || '',
|
|
692
|
+
},
|
|
693
|
+
};
|
|
694
|
+
if (sort) {
|
|
695
|
+
_params.sort = sort;
|
|
696
|
+
}
|
|
697
|
+
if (filters) {
|
|
698
|
+
_b = filters || {}, search = _b.search, owners = _b.owners;
|
|
699
|
+
_params.search = search;
|
|
700
|
+
_params.owners = owners;
|
|
701
|
+
}
|
|
702
|
+
return [4 /*yield*/, this.gqlApi.collectionApi.getAllCollections(_params)];
|
|
703
|
+
case 1:
|
|
704
|
+
data = _c.sent();
|
|
705
|
+
return [2 /*return*/, data];
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
});
|
|
709
|
+
};
|
|
710
|
+
APENFTQuery.prototype.getCurrencies = function () {
|
|
711
|
+
var _a;
|
|
712
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
713
|
+
var data;
|
|
714
|
+
return __generator(this, function (_b) {
|
|
715
|
+
switch (_b.label) {
|
|
716
|
+
case 0: return [4 /*yield*/, this.gqlApi.assetApi.getCurrencies()];
|
|
717
|
+
case 1:
|
|
718
|
+
data = _b.sent();
|
|
719
|
+
return [2 /*return*/, ((_a = data === null || data === void 0 ? void 0 : data.ui_filters) === null || _a === void 0 ? void 0 : _a.explore_currencies) || []];
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
});
|
|
723
|
+
};
|
|
724
|
+
APENFTQuery.prototype.getAllAssets = function (params) {
|
|
725
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
726
|
+
var _a, sort, pagination, filters, _params, data;
|
|
727
|
+
return __generator(this, function (_b) {
|
|
728
|
+
switch (_b.label) {
|
|
729
|
+
case 0:
|
|
730
|
+
_a = params || {}, sort = _a.sort, pagination = _a.pagination, filters = _a.filters;
|
|
731
|
+
_params = __assign({ sort: sort, pagination: {
|
|
732
|
+
first: (pagination === null || pagination === void 0 ? void 0 : pagination.first) || 100,
|
|
733
|
+
cursor: (pagination === null || pagination === void 0 ? void 0 : pagination.cursor) || "",
|
|
734
|
+
} }, (filters || {}));
|
|
735
|
+
return [4 /*yield*/, this.gqlApi.assetApi.getAllAssets(_params)];
|
|
736
|
+
case 1:
|
|
737
|
+
data = _b.sent();
|
|
738
|
+
return [2 /*return*/, data === null || data === void 0 ? void 0 : data.assets];
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
});
|
|
742
|
+
};
|
|
743
|
+
APENFTQuery.prototype.getRankingNFTs = function (params) {
|
|
744
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
745
|
+
var _a, sort, sort_asc, categories, is_rank_disabled, has_listing_asset, pagination, _params, data;
|
|
746
|
+
return __generator(this, function (_b) {
|
|
747
|
+
switch (_b.label) {
|
|
748
|
+
case 0:
|
|
749
|
+
_a = params || {}, sort = _a.sort, sort_asc = _a.sort_asc, categories = _a.categories, is_rank_disabled = _a.is_rank_disabled, has_listing_asset = _a.has_listing_asset, pagination = _a.pagination;
|
|
750
|
+
_params = {
|
|
751
|
+
sort: sort,
|
|
752
|
+
sort_asc: sort_asc,
|
|
753
|
+
pagination: {
|
|
754
|
+
first: (pagination === null || pagination === void 0 ? void 0 : pagination.first) || 100,
|
|
755
|
+
cursor: (pagination === null || pagination === void 0 ? void 0 : pagination.cursor) || '',
|
|
756
|
+
},
|
|
757
|
+
categories: categories,
|
|
758
|
+
is_rank_disabled: is_rank_disabled,
|
|
759
|
+
has_listing_asset: has_listing_asset,
|
|
760
|
+
};
|
|
761
|
+
return [4 /*yield*/, this.gqlApi.rankingApi.getRankingDetail(_params)];
|
|
762
|
+
case 1:
|
|
763
|
+
data = _b.sent();
|
|
764
|
+
return [2 /*return*/, data];
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
});
|
|
768
|
+
};
|
|
677
769
|
return APENFTQuery;
|
|
678
770
|
}(queryAPI_1.QueryAPI));
|
|
679
771
|
exports.APENFTQuery = APENFTQuery;
|
|
@@ -416,10 +416,10 @@ export declare enum EventType {
|
|
|
416
416
|
}
|
|
417
417
|
export interface CollectionTradingHistoryParams {
|
|
418
418
|
pagination?: Pagination;
|
|
419
|
-
event_types
|
|
420
|
-
currencies
|
|
421
|
-
collections
|
|
422
|
-
user
|
|
419
|
+
event_types?: EventType[];
|
|
420
|
+
currencies?: string[];
|
|
421
|
+
collections?: string[];
|
|
422
|
+
user?: string;
|
|
423
423
|
}
|
|
424
424
|
export interface HotCollectionsParams {
|
|
425
425
|
chain: string;
|
|
@@ -462,3 +462,80 @@ export interface LowerPriceOrderParams {
|
|
|
462
462
|
id: string;
|
|
463
463
|
price: string;
|
|
464
464
|
}
|
|
465
|
+
export declare enum CollectionSortBy {
|
|
466
|
+
Volume7d = "Volume7d",
|
|
467
|
+
Volume24h = "Volume24h",
|
|
468
|
+
Volume30d = "Volume30d",
|
|
469
|
+
VolumeTotal = "VolumeTotal"
|
|
470
|
+
}
|
|
471
|
+
export declare enum CollectionListCollectionTypes {
|
|
472
|
+
MYSTERY_BOX = "MYSTERY_BOX"
|
|
473
|
+
}
|
|
474
|
+
export interface CollectionListFilters {
|
|
475
|
+
search?: string;
|
|
476
|
+
owners?: string[];
|
|
477
|
+
asset_owners?: string[];
|
|
478
|
+
asset_creators?: string[];
|
|
479
|
+
event_involved?: string[];
|
|
480
|
+
collection_types?: CollectionListCollectionTypes[];
|
|
481
|
+
}
|
|
482
|
+
export interface CollectionListFilterObj {
|
|
483
|
+
search?: string;
|
|
484
|
+
owners?: string[];
|
|
485
|
+
}
|
|
486
|
+
export interface CollectionListParams extends CollectionListFilters {
|
|
487
|
+
sort?: CollectionSortBy;
|
|
488
|
+
pagination: Pagination;
|
|
489
|
+
}
|
|
490
|
+
export interface AssetQueryParams extends AssetQueryFilters {
|
|
491
|
+
sort: AssetSortBy;
|
|
492
|
+
pagination: Pagination;
|
|
493
|
+
}
|
|
494
|
+
export interface PriceRangeFilter {
|
|
495
|
+
min?: number | string;
|
|
496
|
+
max?: number | string;
|
|
497
|
+
currency: 'TRX' | 'USD';
|
|
498
|
+
}
|
|
499
|
+
export interface AssetQueryFilters {
|
|
500
|
+
search?: string;
|
|
501
|
+
price?: PriceRangeFilter;
|
|
502
|
+
statuses?: AssetStatus[];
|
|
503
|
+
collections?: string[];
|
|
504
|
+
user_account?: string;
|
|
505
|
+
owners?: string[];
|
|
506
|
+
creators?: string[];
|
|
507
|
+
categories?: Category[];
|
|
508
|
+
currencies?: string[];
|
|
509
|
+
is_recommend?: boolean;
|
|
510
|
+
collection_types?: AssetListCollectionTypes[];
|
|
511
|
+
}
|
|
512
|
+
export declare enum AssetListCollectionTypes {
|
|
513
|
+
NORMAL = "NORMAL",
|
|
514
|
+
MYSTERY_BOX = "MYSTERY_BOX"
|
|
515
|
+
}
|
|
516
|
+
export declare enum AssetStatus {
|
|
517
|
+
BUY_NOW = "BUY_NOW",
|
|
518
|
+
ON_AUCTION = "ON_AUCTION",
|
|
519
|
+
VERIFIED = "VERIFIED",
|
|
520
|
+
HAS_OFFERS = "HAS_OFFERS"
|
|
521
|
+
}
|
|
522
|
+
export declare enum Category {
|
|
523
|
+
ART = "art",
|
|
524
|
+
COLLECTIBLES = "collectibles",
|
|
525
|
+
VIRTUAL_WORLD = "virtual-world",
|
|
526
|
+
MUSIC = "music",
|
|
527
|
+
UTILITY = "utility",
|
|
528
|
+
SPORTS = "sports",
|
|
529
|
+
TRADING_CARDS = "trading-cards",
|
|
530
|
+
DOMAIN_NAMES = "domain-names"
|
|
531
|
+
}
|
|
532
|
+
export interface RankingDetailParams extends Partial<RankingDetailFilters> {
|
|
533
|
+
sort: CollectionSortBy;
|
|
534
|
+
sort_asc: boolean;
|
|
535
|
+
pagination: Pagination;
|
|
536
|
+
}
|
|
537
|
+
export interface RankingDetailFilters {
|
|
538
|
+
categories: Category[];
|
|
539
|
+
is_rank_disabled: boolean;
|
|
540
|
+
has_listing_asset: boolean;
|
|
541
|
+
}
|