@xoxno/sdk-js 0.1.354 → 1.0.0

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.
@@ -0,0 +1,9 @@
1
+ export declare const coveredMethods: readonly ["PATCH", "POST", "DELETE", "PUT"];
2
+ declare const _nestTypes: readonly ["string", "number", "boolean"];
3
+ declare const _returnTypes: readonly ["application/json", "multipart/form-data"];
4
+ declare const _securityModes: readonly ["requiredAny", "requiredWeb2", "requiredJwt", "optionalAny"];
5
+ export type ICoveredMethods = (typeof coveredMethods)[number];
6
+ export type INestType = (typeof _nestTypes)[number];
7
+ export type IReturnTypes = (typeof _returnTypes)[number];
8
+ export type ISecurityMode = (typeof _securityModes)[number];
9
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { IChainID } from '@multiversx/sdk-core/out/interface';
2
- export declare enum Chain {
2
+ declare enum Chain {
3
3
  MAINNET = "1",
4
4
  DEVNET = "D"
5
5
  }
@@ -26,7 +26,8 @@ export declare class XOXNOClient {
26
26
  chain?: Chain;
27
27
  }>): XOXNOClient;
28
28
  static getInstance(): XOXNOClient;
29
- fetchWithTimeout: <T>(path: string, options?: RequestInit & {
29
+ fetchWithTimeout: <T>(path: string, { params, ...options }?: RequestInit & {
30
30
  params?: Record<string, any>;
31
31
  }) => Promise<T>;
32
32
  }
33
+ export {};
@@ -1,6 +1,12 @@
1
1
  export declare class CollectionNotFoundError extends Error {
2
2
  constructor(item: string);
3
3
  }
4
+ export declare class AddressNotFoundError extends Error {
5
+ constructor(item: string);
6
+ }
7
+ export declare class NFTNotFoundError extends Error {
8
+ constructor(item: string);
9
+ }
4
10
  export declare class PaginatedTopError extends Error {
5
11
  constructor(top: number);
6
12
  }
@@ -1,4 +1,7 @@
1
- import type { CosmosDbGenericFilter } from '@xoxno/types';
2
1
  export declare function collectionGuard<T>(collection: string, callback: Promise<T>): Promise<T>;
2
+ export declare function addressGuard<T>(address: string, callback: Promise<T>): Promise<T>;
3
+ export declare function nftGuard<T>(identifier: string, callback: Promise<T>): Promise<T>;
3
4
  export declare function collectionGuardOnly(collection: string): Promise<void>;
4
- export declare function paginatedGuard<T, R>(filter: CosmosDbGenericFilter<T>, callback: (filter: string) => Promise<R>): Promise<R>;
5
+ export declare function paginatedGuard<T extends {
6
+ top?: number;
7
+ }, R>(filter: T, callback: (filter: string) => Promise<R>): Promise<R>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/sdk-js",
3
- "version": "0.1.354",
3
+ "version": "1.0.0",
4
4
  "description": "The SDK to interact with the XOXNO Protocol!",
5
5
  "type": "module",
6
6
  "exports": {
@@ -24,10 +24,11 @@
24
24
  "sideEffects": false,
25
25
  "scripts": {
26
26
  "test": "jest",
27
+ "build:sdk": "npx bun run src/sdk/parseSwagger.ts && eslint 'src/sdk/swagger.ts' --fix",
27
28
  "build:types": "tsc --emitDeclarationOnly",
28
29
  "build:esm": "webpack --config webpack-esm.config.mjs",
29
30
  "build:cjs": "webpack --config webpack-cjs.config.mjs",
30
- "build": "npm run build:types && npm run build:esm && npm run build:cjs",
31
+ "build": "npm run build:sdk && npm run build:types && npm run build:esm && npm run build:cjs",
31
32
  "lint": "eslint 'src/**/*.{ts,tsx}' --fix",
32
33
  "format": "prettier --write 'src/**/*.{ts,tsx}'",
33
34
  "commit": "git-cz",
@@ -75,6 +76,7 @@
75
76
  "@types/node": "^22.10.2",
76
77
  "@typescript-eslint/eslint-plugin": "^8.19.0",
77
78
  "@typescript-eslint/parser": "^8.19.0",
79
+ "bun": "^1.2.18",
78
80
  "commitizen": "^4.3.1",
79
81
  "cz-conventional-changelog": "^3.3.0",
80
82
  "eslint": "^8",
@@ -93,14 +95,12 @@
93
95
  "typescript": "^5.7.2",
94
96
  "webpack": "^5.97.1",
95
97
  "webpack-cli": "^6.0.1",
96
- "webpack-merge": "^6.0.1"
98
+ "webpack-merge": "^6.0.1",
99
+ "yaml": "^2.8.0"
97
100
  },
98
101
  "dependencies": {
99
102
  "@multiversx/sdk-core": "^13.17.2",
100
103
  "@multiversx/sdk-network-providers": "^2.9.3",
101
- "@xoxno/types": "^1.0.9",
102
- "axios": "^1.7.9",
103
- "protobufjs": "^7.4.0",
104
- "webpack-bundle-analyzer": "^4.10.2"
104
+ "@xoxno/types": "^1.0.72"
105
105
  }
106
106
  }
@@ -1,302 +0,0 @@
1
- import { type CollectionProfileDoc, type CollectionTraitMap, type NftCosmosResponse, type NftDocFilter } from '@xoxno/types';
2
- import type { ActivityChain, AnalyticsGraphs, CollectionListings, CollectionRanksExport, CollectionStatsDoc, CollectionStatsResults, CollectionVolume, GetCollectionMintInfo, GetCollectionsArgs, GetCollectionStatsArgs, GETDropsArgs, GetDropsResponse, GetGlobalOffersArgs, GetOffersArgs, GetOffersResponse, GlobalOffersResult, IOwners, ISingleHolder, PublicOnly, StakingSummaryPools, SuggestNFTsArgs, SuggestResults, TradincActivityArgs, TradingActivityResponse } from '../types';
3
- /**
4
- * CollectionModule provides a set of methods to interact with NFT collections.
5
- * It includes methods for getting collection profile information, floor price,
6
- * collection attributes, and searching NFTs within a collection.
7
- *
8
- * @example
9
- * const collectionModule = new CollectionModule();
10
- */
11
- export declare class CollectionModule {
12
- private api;
13
- constructor();
14
- /**
15
- * @public
16
- * @async
17
- * @function getCollectionProfile
18
- * @param {string} collection - The ticker of the collection to fetch the profile for.
19
- * @returns {Promise<CollectionProfileDoc>} A promise that resolves to the fetched collection profile.
20
- *
21
- * This function fetches the profile of a given collection. It takes the following parameter:
22
- * - collection (string): The ticker of the collection to fetch the profile for.
23
- *
24
- * The function first validates the input ticker and checks if it is a valid collection ticker.
25
- * If it is valid, the function fetches the collection profile using the API.
26
- * Finally, it returns a promise that resolves to the fetched collection profile.
27
- */
28
- getCollectionProfile: (collection: string) => Promise<CollectionProfileDoc>;
29
- /**
30
- * Fetches the floor price of a collection.
31
- * @param collection - The ticker of the collection.
32
- * @param token - The token for the floor price calculation (default: 'EGLD').
33
- * @returns A Promise that resolves to the collection's floor price as a number.
34
- * @throws An error if the provided collection ticker is invalid.
35
- */
36
- getCollectionFloorPrice: (collection: string, token?: string) => Promise<{
37
- price: number;
38
- usdPrice: number;
39
- }>;
40
- /**
41
- * @public
42
- * @async
43
- * @function getCollectionAttributes
44
- * @param {string} collection - The ticker of the collection to fetch the attributes for.
45
- * @returns {Promise<CollectionTraitMap>} A promise that resolves to the fetched collection attributes.
46
- *
47
- * This function fetches the attributes of a given collection. It takes the following parameter:
48
- * - collection (string): The ticker of the collection to fetch the attributes for.
49
- *
50
- * The function first validates the input ticker and checks if it is a valid collection ticker.
51
- * If it is valid, the function fetches the collection attributes using the API.
52
- * Finally, it returns a promise that resolves to the fetched collection attributes.
53
- */
54
- getCollectionAttributes: (collection: string) => Promise<CollectionTraitMap>;
55
- /**
56
- * Searches for NFTs based on the provided arguments.
57
- * @param {NftDocFilter} args - The SearchNFTsArgs object containing the search parameters.
58
- * @returns {Promise<NftCosmosResponse>} A Promise that resolves to the SearchNFTsResponse object.
59
- * @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 100.
60
- */
61
- getNFTs: (args: PublicOnly<NftDocFilter>) => Promise<NftCosmosResponse>;
62
- /**
63
- * Searches for NFTs based on the provided arguments.
64
- * @param {NftDocFilter} args - The SearchNFTsArgs object containing the search parameters.
65
- * @returns {Promise<NftCosmosResponse>} A Promise that resolves to the SearchNFTsResponse object.
66
- * @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 100.
67
- */
68
- getSearchNFTs: (args: PublicOnly<NftDocFilter>) => Promise<NftCosmosResponse>;
69
- /**
70
- * @public
71
- * @async
72
- * @function suggestCollections
73
- * @param {SuggestNFTsArgs} args - An object containing the necessary parameters to fetch suggested collections results.
74
- * @returns {Promise<SuggestResults>} A promise that resolves to the fetched collections results.
75
- *
76
- * This function fetches suggested collections results based on the provided arguments. It takes an object with the following properties:
77
- * - name (string): The name to search for (required).
78
- * - top (number, optional): The maximum number of results to return (default is 35, cannot be greater than 100).
79
- * - skip (number, optional): The number of results to skip (default is 0).
80
- *
81
- * Finally, it returns a promise that resolves to the fetched collections results.
82
- */
83
- suggestCollections: (args: SuggestNFTsArgs) => Promise<SuggestResults>;
84
- /**
85
- * @public
86
- * @async
87
- * @function collectionListingsAnalytics
88
- * @param {string} ticker - The unique collection identifier called ticker
89
- * @returns {Promise<CollectionListings>} A promise that resolves to the distribution of listings
90
- */
91
- collectionListingsAnalytics: (ticker: string) => Promise<CollectionListings>;
92
- /**
93
- * Retrieves trading history based on the provided arguments.
94
- *
95
- * @param {TradincActivityArgs} args - The arguments for filtering the trading activity.
96
- * @returns {Promise<TradingActivityResponse>} A promise resolving to a TradingActivityResponse object containing the activity.
97
- * @throws {Error} Throws an error if the 'top' argument is greater than 100.
98
- */
99
- getTradingActivity: (args: TradincActivityArgs) => Promise<TradingActivityResponse>;
100
- getOffers: (args: GetOffersArgs) => Promise<GetOffersResponse>;
101
- /**
102
- * Fetch collections profiles based on the provided arguments.
103
- * @param {GetCollectionsArgs} args - The GetCollectionsArgs object containing the search parameters.
104
- * @returns {Promise<CollectionsNFTsResponse>} A Promise that resolves to the CollectionsNFTsResponse object.
105
- * @throws An error if the 'top' value is greater than 100.
106
- */
107
- getCollections: (args?: GetCollectionsArgs) => Promise<{
108
- results: CollectionProfileDoc[];
109
- count: number;
110
- hasMoreResults: boolean;
111
- }>;
112
- /**
113
- * Fetch global offers based on the provided arguments.
114
- * @param {GetGlobalOffersArgs} args - The GetCollectionsArgs object containing the search parameters.
115
- * @returns {Promise<GlobalOffersResult>} A Promise that resolves to the GlobalOffersResult object.
116
- * @throws An error if the 'top' value is greater than 100.
117
- */
118
- getGlobalOffers: (args?: GetGlobalOffersArgs) => Promise<GlobalOffersResult>;
119
- /**
120
- * @public
121
- * @async
122
- * @function getCollectionVolume
123
- * @param {string} collection - The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
124
- * @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
125
- * @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
126
- * @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
127
- * @returns {Promise<CollectionVolume[]>} A promise that resolves to an array of collection volume data.
128
- *
129
- * This function fetches volume data for a given collection within a specified date range and binning period. It takes the following parameters:
130
- * - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
131
- * - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
132
- * - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
133
- * - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
134
- *
135
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
136
- * If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
137
- * Finally, it returns a promise that resolves to an array of collection volume data.
138
- */
139
- getCollectionVolume: (collection: string, after: string, before: string, bin: string) => Promise<CollectionVolume[]>;
140
- /**
141
- * @public
142
- * @async
143
- * @function getMarketplaceVolume
144
- * @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
145
- * @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
146
- * @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
147
- * @returns {Promise<CollectionVolume[]>} A promise that resolves to an array of collection volume data.
148
- *
149
- * This function fetches volume data for a given collection within a specified date range and binning period. It takes the following parameters:
150
- * - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
151
- * - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
152
- * - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
153
- * - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
154
- *
155
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
156
- * If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
157
- * Finally, it returns a promise that resolves to an array of collection volume data.
158
- */
159
- getMarketplaceVolume: (after: string, before: string, bin: string, chain?: ActivityChain[]) => Promise<CollectionVolume[]>;
160
- /**
161
- * @public
162
- * @async
163
- * @function getCollectionOwners
164
- * @param {string} collection - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
165
- * @returns {Promise<IOwners>} A promise that resolves a struct of collection information about holders
166
- *
167
- * This function fetches owner information for a given collection. It takes the following parameter:
168
- * - collection (string): The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
169
- *
170
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
171
- * If it is valid, the function fetches the collection owner information using the API.
172
- * Finally, it returns a promise that resolves a struct of collection information about holders
173
- */
174
- getCollectionOwners: (collection: string) => Promise<IOwners>;
175
- /**
176
- * @public
177
- * @async
178
- * @function getExportOwners
179
- * @param {string} collection - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
180
- * @returns {Promise<ISingleHolder[]>} A promise that resolves an array of holders part of the collection.
181
- *
182
- * This function fetches owners information for a given collection. It takes the following parameter:
183
- * - collection (string): The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
184
- *
185
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
186
- * If it is valid, the function fetches the collection owner information using the API.
187
- * Finally, it returns a promise that resolves to an array of collection owner information.
188
- */
189
- getExportOwners: (collection: string) => Promise<ISingleHolder[]>;
190
- /**
191
- * @public
192
- * @async
193
- * @function getCollectionsStatistics
194
- * @param {GetCollectionStatsArgs} args - The filter payload for the collection statsitics
195
- * @returns {Promise<CollectionStatsResults>} A promise that resolves to a struct with information
196
- * Finally, it returns a promise that resolves a struct with information
197
- */
198
- getCollectionsStatistics: (args: GetCollectionStatsArgs) => Promise<CollectionStatsResults>;
199
- /**
200
- * @public
201
- * @async
202
- * @function getCollectionStats
203
- * @param {GetCollectionStatsArgs} args - The filter payload for the collection statsitics
204
- * @returns {Promise<CollectionStatsDoc>} A promise that resolves to a struct with information
205
- * Finally, it returns a promise that resolves a struct with information
206
- */
207
- getCollectionStats: (ticker: string) => Promise<CollectionStatsDoc>;
208
- getAwaitEmpty: (delay: number) => Promise<boolean>;
209
- /**
210
- * @public
211
- * @async
212
- * @function getCollectionMintInfo
213
- * @param {string} ticker - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
214
- * @returns {Promise<GetCollectionMintInfo>} A promise that resolves to a struct with information
215
- * Finally, it returns a promise that resolves a struct with information
216
- */
217
- getCollectionMintInfo: ({ ticker, extra, }: {
218
- ticker: string;
219
- extra?: RequestInit;
220
- }) => Promise<GetCollectionMintInfo>;
221
- /**
222
- * @public
223
- * @async
224
- * @function getCollectionRanks
225
- * @param {string} ticker - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
226
- * @returns {Promise<CollectionRanksExport[]>} A promise that resolves to a struct with information
227
- * Finally, it returns a promise that resolves a struct with information
228
- */
229
- getCollectionRanks: ({ ticker, extra, }: {
230
- ticker: string;
231
- extra?: RequestInit;
232
- }) => Promise<CollectionRanksExport[]>;
233
- /**
234
- * @public
235
- * @async
236
- * @function getDropInfo
237
- * @param {string} collectionTag - The unique ID of the collection part of the launchpad smart contract
238
- * @param {string} creatorTag - The unique ID of the creator part of the launchpad smart contract
239
- * @returns {Promise<GetCollectionMintInfo>} A promise that resolves to a struct with information
240
- * Finally, it returns a promise that resolves a struct with information
241
- */
242
- getDropInfo: ({ collectionTag, creatorTag, extra, }: {
243
- collectionTag: string;
244
- creatorTag: string;
245
- extra?: RequestInit;
246
- }) => Promise<GetCollectionMintInfo>;
247
- /**
248
- * @public
249
- * @async
250
- * @function getCollectionGraphData
251
- * @param category - The ticker of the collection.
252
- * @returns {Promise<AnalyticsGraphs>} A promise the required analytics data
253
- * This function gets the global graph data
254
- */
255
- getCollectionGraphData: (collection: string, startTime: string, endTime: string, bin: string) => Promise<AnalyticsGraphs>;
256
- /**
257
- * @public
258
- * @async
259
- * @function getPinnedCollections
260
- * @returns {Promise<CollectionProfileDoc[]>} A promise that resolves to the fetched pinned collections.
261
- */
262
- getPinnedCollections: (chain?: ActivityChain) => Promise<CollectionProfileDoc[]>;
263
- /**
264
- * @public
265
- * @async
266
- * @function getPinnedDrops
267
- * @returns {Promise<GetCollectionMintInfo[]>} A promise that resolves to the fetched pinned collections.
268
- */
269
- getPinnedDrops: (chain?: ActivityChain) => Promise<GetCollectionMintInfo[]>;
270
- /**
271
- * Get drops based on the provided arguments.
272
- * @param {SearchNFTsArgs} args - The SearchNFTsArgs object containing the search parameters.
273
- * @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
274
- * @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 100.
275
- */
276
- getSearchDrops: (args: GETDropsArgs) => Promise<GetDropsResponse>;
277
- /**
278
- * Get drops based on the provided arguments.
279
- * @param {SearchNFTsArgs} args - The SearchNFTsArgs object containing the search parameters.
280
- * @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
281
- * @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 100.
282
- */
283
- getDrops: (args: GETDropsArgs) => Promise<GetDropsResponse>;
284
- /** Gets collection staking info
285
- * @param {String} collection - User's address
286
- * @returns {StakingSummaryPools[]} Collection's staking info
287
- * @throws {Error} Throws an error if the collection is invalid
288
- * */
289
- getCollectionStakingSummary: ({ collection, extra, }: {
290
- collection: string;
291
- extra?: RequestInit;
292
- }) => Promise<StakingSummaryPools[]>;
293
- /**
294
- * @public
295
- * @async
296
- * @function getCollectionsFloor
297
- * @param collections - The tickers of the collection.
298
- * @returns {Promise<Record<string, number>>} Floor price of the collections
299
- * This function gets the floor price of the collections
300
- */
301
- getCollectionsFloor: (collections: string[]) => Promise<Record<string, number>>;
302
- }
@@ -1,63 +0,0 @@
1
- import type { ActivityChain } from '../types';
2
- import type { FungibleAssetsMap, SuggestNFTsArgs, SuggestResults } from '../types/collection';
3
- import { AssetCategory } from '../types/collection';
4
- import type { AshSwapPaymentData, StakingExplore, StatisticsSummary, TokenUSDPrices } from '../types/common';
5
- export declare class CommonModule {
6
- private api;
7
- constructor();
8
- /** Gets all tokens usd price
9
- * @returns {TokenUSDPrices} User's creator info
10
- * */
11
- getTokensUsdPrice: () => Promise<TokenUSDPrices>;
12
- /** Gets all tokens usd price
13
- * @returns {TokenUSDPrices} User's creator info
14
- * */
15
- getAshSwapAmount: ({ originalToken, originalTokenValue, paymentToken, }: {
16
- originalToken: string;
17
- originalTokenValue: string;
18
- paymentToken: string;
19
- }) => Promise<AshSwapPaymentData>;
20
- /**
21
- * @public
22
- * @async
23
- * @function getFungibleTokens
24
- * @param category - The ticker of the collection.
25
- * @returns {Promise<FungibleAssetsMap>} A promise that resolves a map of ESDT tokens and their info
26
- * This function fetches all branded fungible assets and their info
27
- */
28
- getFungibleTokens: (categories?: AssetCategory[], identifiers?: string[], chain?: ActivityChain[]) => Promise<FungibleAssetsMap>;
29
- /**
30
- * @public
31
- * @async
32
- * @function getAnalyticsOverview
33
- * @returns {Promise<StatisticsSummary>} A promise the required analytics data
34
- * This function gets the global graph data
35
- */
36
- getAnalyticsOverview: (chain?: ActivityChain[]) => Promise<StatisticsSummary>;
37
- /**
38
- * @public
39
- * @async
40
- * @function suggestResults
41
- * @param {SuggestNFTsArgs} args - An object containing the necessary parameters to fetch suggested NFT results.
42
- * @returns {Promise<SuggestResults>} A promise that resolves to the fetched NFT results.
43
- *
44
- * This function fetches suggested NFT results based on the provided arguments. It takes an object with the following properties:
45
- * - name (string): The name to search for (required).
46
- * - orderBy (SuggestOrderBy[], optional): An array of ordering preferences for the results.
47
- * - top (number, optional): The maximum number of results to return (default is 35, cannot be greater than 100).
48
- * - skip (number, optional): The number of results to skip (default is 0).
49
- *
50
- * The function first validates the input arguments and constructs a payload body with the provided parameters.
51
- * Then, it converts the payload body into a base64 string and fetches the suggested results using the API.
52
- * Finally, it returns a promise that resolves to the fetched NFT results.
53
- */
54
- suggestResults: (args: SuggestNFTsArgs) => Promise<SuggestResults>;
55
- /**
56
- * @public
57
- * @async
58
- * @function getExploreStaking
59
- * @returns {Promise<StakingExplore[]>} A promise that resolves to the fetched staking explore data.
60
- * This function fetches the staking explore data.
61
- */
62
- getExploreStaking: () => Promise<StakingExplore[]>;
63
- }
@@ -1,84 +0,0 @@
1
- import type { NftDoc } from '@xoxno/types';
2
- import type { ActivityChain } from '../types/nft';
3
- import type { TradincActivityArgs, TradingActivityResponse } from '../types/trading';
4
- import type { UserOffers } from '../types/user';
5
- /**
6
- * NFTModule provides a set of methods to interact with single NFTs.
7
- * It includes methods for getting single NFT information, and searching NFTs by collection and nonce.
8
- *
9
- * @example
10
- * const nftModule = new NFTModule();
11
- */
12
- export declare class NFTModule {
13
- private api;
14
- constructor();
15
- /**
16
- * @public
17
- * @async
18
- * @function getNFTByIdentifier
19
- * @param {string} identifier - The identifier of the NFT to fetch data for.
20
- * @returns {Promise<NftDoc>} A promise that resolves to the fetched NFT data.
21
- *
22
- * This function fetches data for a given NFT by its identifier. It takes the following parameter:
23
- * - identifier (string): The identifier of the NFT to fetch data for.
24
- *
25
- * The function first validates the input identifier and checks if it is a valid NFT identifier.
26
- * If it is valid, the function fetches the NFT data using the API.
27
- * Finally, it returns a promise that resolves to the fetched NFT data.
28
- */
29
- getNFTByIdentifier: (identifier: string, extra?: RequestInit) => Promise<NftDoc>;
30
- /**
31
- * @public
32
- * @async
33
- * @function getNFTByIdentifier
34
- * @param {string} identifier - The identifier of the NFT to fetch data for.
35
- * @returns {Promise<NftDoc>} A promise that resolves to the fetched NFT data.
36
- *
37
- * This function fetches data for a given NFT by its identifier. It takes the following parameter:
38
- * - identifier (string): The identifier of the NFT to fetch data for.
39
- *
40
- * The function first validates the input identifier and checks if it is a valid NFT identifier.
41
- * If it is valid, the function fetches the NFT data using the API.
42
- * Finally, it returns a promise that resolves to the fetched NFT data.
43
- */
44
- getNFTsOffers: (identifier: string, skip?: number, top?: number) => Promise<UserOffers>;
45
- /**
46
- * Gets an NFT by collection and nonce.
47
- * @param collection The collection ticker.
48
- * @param nonce The nonce of the NFT.
49
- * @returns {Promise<NftDoc>} The NFT data.
50
- * @throws Throws an error when the collection ticker is invalid.
51
- */
52
- getNFTByCollectionAndNonce: (collection: string, nonce: number) => Promise<NftDoc>;
53
- /**
54
- * @public
55
- * @async
56
- * @function getDailyTrending
57
- * @returns {Promise<NftDoc[]>} A promise that resolves to the array of trending NFTs.
58
- * This function fetches the top NFTs that are trending today based on their floor and volumes
59
- */
60
- getDailyTrending: () => Promise<NftDoc[]>;
61
- /**
62
- * @public
63
- * @async
64
- * @function getPinnedNFTs
65
- * @returns {Promise<NftDoc[]>} A promise that resolves to the fetched pinned collections.
66
- */
67
- getPinnedNFTs: (chain?: ActivityChain) => Promise<NftDoc[]>;
68
- /**
69
- * Get NFT by collection and nonce hex
70
- *
71
- * @param collection - collection ticker
72
- * @param nonceHex - nonce hex
73
- * @return {Promise<NftDoc>} NFT data
74
- */
75
- getNFTByCollectionAndNonceHex: (collection: string, nonceHex: string) => Promise<NftDoc>;
76
- /**
77
- * Retrieves trading history based on the provided arguments.
78
- *
79
- * @param {TradincActivityArgs} args - The arguments for filtering the trading activity.
80
- * @returns {Promise<TradingActivityResponse>} A promise resolving to a TradingActivityResponse object containing the activity.
81
- * @throws {Error} Throws an error if the 'top' argument is greater than 100.
82
- */
83
- getTradingActivity: (args: TradincActivityArgs) => Promise<TradingActivityResponse>;
84
- }
@@ -1,11 +0,0 @@
1
- import type { StakingSummaryPools } from '../types/staking';
2
- export declare class StakingModule {
3
- private api;
4
- constructor();
5
- /** Gets pool details
6
- * @param {number} poolId - User's address
7
- * @returns {CreatoPoolDetailsrInfo} User's creator info
8
- * @throws {Error} Throws an error if the address is invalid
9
- * */
10
- getPoolDetails: (poolId: number) => Promise<StakingSummaryPools>;
11
- }