@xoxno/sdk-js 0.1.353 → 0.1.354
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/dist/collection/index.d.ts +19 -24
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/interactions/index.d.ts +3 -3
- package/dist/interactor.cjs.js +1 -1
- package/dist/interactor.esm.js +1 -1
- package/dist/nft/index.d.ts +19 -10
- package/dist/types/index.d.ts +3 -0
- package/dist/types/trading.d.ts +0 -1
- package/dist/users/index.d.ts +4 -3
- package/dist/utils/api.d.ts +3 -1
- package/dist/utils/errors.d.ts +6 -0
- package/dist/utils/getActivity.d.ts +1 -1
- package/dist/utils/guards.d.ts +4 -0
- package/dist/utils/types.d.ts +1 -0
- package/package.json +2 -1
package/dist/nft/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NftDoc } from '@xoxno/types';
|
|
2
|
+
import type { ActivityChain } from '../types/nft';
|
|
2
3
|
import type { TradincActivityArgs, TradingActivityResponse } from '../types/trading';
|
|
3
4
|
import type { UserOffers } from '../types/user';
|
|
4
5
|
/**
|
|
@@ -16,7 +17,7 @@ export declare class NFTModule {
|
|
|
16
17
|
* @async
|
|
17
18
|
* @function getNFTByIdentifier
|
|
18
19
|
* @param {string} identifier - The identifier of the NFT to fetch data for.
|
|
19
|
-
* @returns {Promise<
|
|
20
|
+
* @returns {Promise<NftDoc>} A promise that resolves to the fetched NFT data.
|
|
20
21
|
*
|
|
21
22
|
* This function fetches data for a given NFT by its identifier. It takes the following parameter:
|
|
22
23
|
* - identifier (string): The identifier of the NFT to fetch data for.
|
|
@@ -25,13 +26,13 @@ export declare class NFTModule {
|
|
|
25
26
|
* If it is valid, the function fetches the NFT data using the API.
|
|
26
27
|
* Finally, it returns a promise that resolves to the fetched NFT data.
|
|
27
28
|
*/
|
|
28
|
-
getNFTByIdentifier: (identifier: string, extra?: RequestInit) => Promise<
|
|
29
|
+
getNFTByIdentifier: (identifier: string, extra?: RequestInit) => Promise<NftDoc>;
|
|
29
30
|
/**
|
|
30
31
|
* @public
|
|
31
32
|
* @async
|
|
32
33
|
* @function getNFTByIdentifier
|
|
33
34
|
* @param {string} identifier - The identifier of the NFT to fetch data for.
|
|
34
|
-
* @returns {Promise<
|
|
35
|
+
* @returns {Promise<NftDoc>} A promise that resolves to the fetched NFT data.
|
|
35
36
|
*
|
|
36
37
|
* This function fetches data for a given NFT by its identifier. It takes the following parameter:
|
|
37
38
|
* - identifier (string): The identifier of the NFT to fetch data for.
|
|
@@ -45,25 +46,33 @@ export declare class NFTModule {
|
|
|
45
46
|
* Gets an NFT by collection and nonce.
|
|
46
47
|
* @param collection The collection ticker.
|
|
47
48
|
* @param nonce The nonce of the NFT.
|
|
48
|
-
* @returns {Promise<
|
|
49
|
+
* @returns {Promise<NftDoc>} The NFT data.
|
|
49
50
|
* @throws Throws an error when the collection ticker is invalid.
|
|
50
51
|
*/
|
|
51
|
-
getNFTByCollectionAndNonce: (collection: string, nonce: number) => Promise<
|
|
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[]>;
|
|
52
61
|
/**
|
|
53
62
|
* @public
|
|
54
63
|
* @async
|
|
55
64
|
* @function getPinnedNFTs
|
|
56
|
-
* @returns {Promise<
|
|
65
|
+
* @returns {Promise<NftDoc[]>} A promise that resolves to the fetched pinned collections.
|
|
57
66
|
*/
|
|
58
|
-
getPinnedNFTs: (chain?: ActivityChain) => Promise<
|
|
67
|
+
getPinnedNFTs: (chain?: ActivityChain) => Promise<NftDoc[]>;
|
|
59
68
|
/**
|
|
60
69
|
* Get NFT by collection and nonce hex
|
|
61
70
|
*
|
|
62
71
|
* @param collection - collection ticker
|
|
63
72
|
* @param nonceHex - nonce hex
|
|
64
|
-
* @return {Promise<
|
|
73
|
+
* @return {Promise<NftDoc>} NFT data
|
|
65
74
|
*/
|
|
66
|
-
getNFTByCollectionAndNonceHex: (collection: string, nonceHex: string) => Promise<
|
|
75
|
+
getNFTByCollectionAndNonceHex: (collection: string, nonceHex: string) => Promise<NftDoc>;
|
|
67
76
|
/**
|
|
68
77
|
* Retrieves trading history based on the provided arguments.
|
|
69
78
|
*
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/trading.d.ts
CHANGED
package/dist/users/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NftDocFilter } from '@xoxno/types';
|
|
2
|
+
import type { CollectionCreatorInfo, CreatorInfo, EventCreatorInfo, PublicOnly, SearchNFTsResponse, StakingStatus, StakingSummaryPools, StakingSummaryPoolsSlim, StatusResponse, SuggestNFTsArgs, SuggestResults, TradincActivityArgs, TradingActivityResponse } from '../types';
|
|
2
3
|
import type { ArgsUserOffers, BulkAccount, CreatorProfile, IApiShareholder, IOwnerInfo, IUserProfile, StakingCreatorInfo, UserAnalyticSummary, UserInventory, UserNetworkAccount, UserOffers, UserPoolStakingInfo, UserStats, UserTokenInventory, UserXOXNODrop } from '../types/user';
|
|
3
4
|
export declare class UserModule {
|
|
4
5
|
private api;
|
|
@@ -44,7 +45,7 @@ export declare class UserModule {
|
|
|
44
45
|
* @param address - The user's address
|
|
45
46
|
* @returns {UserInventory} - A list of token ids and the price
|
|
46
47
|
*/
|
|
47
|
-
getUserNFTs: (args:
|
|
48
|
+
getUserNFTs: (args: PublicOnly<NftDocFilter>) => Promise<import("@xoxno/types").NftCosmosResponse>;
|
|
48
49
|
/**
|
|
49
50
|
* @name getUserOffers
|
|
50
51
|
* @description Fetches all offers sent or received associated with a user address
|
|
@@ -141,7 +142,7 @@ export declare class UserModule {
|
|
|
141
142
|
* @param {String} address - User's address
|
|
142
143
|
* @param {number} top - Top
|
|
143
144
|
* @param {number} skip - Skip
|
|
144
|
-
* @returns {
|
|
145
|
+
* @returns {NftDoc[]} Array of NFTs
|
|
145
146
|
* @throws {Error} Throws an error if the address is invalid
|
|
146
147
|
* */
|
|
147
148
|
getUserFavoriteNFTs: (address: string, top: number, skip: number) => Promise<SearchNFTsResponse>;
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -26,5 +26,7 @@ export declare class XOXNOClient {
|
|
|
26
26
|
chain?: Chain;
|
|
27
27
|
}>): XOXNOClient;
|
|
28
28
|
static getInstance(): XOXNOClient;
|
|
29
|
-
fetchWithTimeout: <T>(path: string, options?:
|
|
29
|
+
fetchWithTimeout: <T>(path: string, options?: RequestInit & {
|
|
30
|
+
params?: Record<string, any>;
|
|
31
|
+
}) => Promise<T>;
|
|
30
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { XOXNOClient } from '..';
|
|
2
1
|
import type { TradincActivityArgs, TradingActivityResponse } from '../types/trading';
|
|
2
|
+
import type { XOXNOClient } from './api';
|
|
3
3
|
/**
|
|
4
4
|
* Fetches the trading activity of the given collections
|
|
5
5
|
* @param args - The trading activity arguments
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CosmosDbGenericFilter } from '@xoxno/types';
|
|
2
|
+
export declare function collectionGuard<T>(collection: string, callback: Promise<T>): Promise<T>;
|
|
3
|
+
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>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xoxno/sdk-js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.354",
|
|
4
4
|
"description": "The SDK to interact with the XOXNO Protocol!",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@multiversx/sdk-core": "^13.17.2",
|
|
100
100
|
"@multiversx/sdk-network-providers": "^2.9.3",
|
|
101
|
+
"@xoxno/types": "^1.0.9",
|
|
101
102
|
"axios": "^1.7.9",
|
|
102
103
|
"protobufjs": "^7.4.0",
|
|
103
104
|
"webpack-bundle-analyzer": "^4.10.2"
|