@xoxno/sdk-js 0.0.17-alpha → 0.0.19-alpha
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 +108 -10
- package/dist/collection/index.js +181 -10
- package/dist/collection/index.js.map +1 -1
- package/dist/interactions/index.d.ts +65 -4
- package/dist/interactions/index.js +190 -1
- package/dist/interactions/index.js.map +1 -1
- package/dist/nft/index.d.ts +12 -3
- package/dist/nft/index.js +12 -3
- package/dist/nft/index.js.map +1 -1
- package/dist/staking/index.d.ts +13 -0
- package/dist/staking/index.js +27 -0
- package/dist/staking/index.js.map +1 -1
- package/dist/types/collection.d.ts +131 -23
- package/dist/types/collection.js +9 -1
- package/dist/types/collection.js.map +1 -1
- package/dist/types/interactions.d.ts +32 -0
- package/dist/utils/SmartContractAbis.d.ts +1 -1
- package/dist/utils/SmartContractAbis.js +13 -17
- package/dist/utils/SmartContractAbis.js.map +1 -1
- package/dist/utils/api.js +7 -8
- package/dist/utils/api.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollectionsNFTsResponse, GetCollectionsArgs, ICollectionAttributes, ICollectionProfile,
|
|
1
|
+
import { CollectionsNFTsResponse, GetCollectionsArgs, ICollectionAttributes, ICollectionProfile, GetCollectionNFTsArgs, SearchNFTsResponse, SuggestNFTsArgs, SuggestResults, CollectionVolume, FloorPriceHistory, CollectionHoldersInfo } from '../types/collection';
|
|
2
2
|
import { TradincActivityArgs, TradingActivityResponse } from '../types/trading';
|
|
3
3
|
/**
|
|
4
4
|
* CollectionModule provides a set of methods to interact with NFT collections.
|
|
@@ -12,10 +12,18 @@ export default class CollectionModule {
|
|
|
12
12
|
private api;
|
|
13
13
|
constructor();
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
18
|
-
* @
|
|
15
|
+
* @public
|
|
16
|
+
* @async
|
|
17
|
+
* @function getCollectionProfile
|
|
18
|
+
* @param {string} collection - The ticker of the collection to fetch the profile for.
|
|
19
|
+
* @returns {Promise<ICollectionProfile>} 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.
|
|
19
27
|
*/
|
|
20
28
|
getCollectionProfile: (collection: string) => Promise<ICollectionProfile>;
|
|
21
29
|
/**
|
|
@@ -27,10 +35,18 @@ export default class CollectionModule {
|
|
|
27
35
|
*/
|
|
28
36
|
getCollectionFloorPrice: (collection: string, token?: string) => Promise<number>;
|
|
29
37
|
/**
|
|
30
|
-
*
|
|
31
|
-
* @
|
|
32
|
-
* @
|
|
33
|
-
* @
|
|
38
|
+
* @public
|
|
39
|
+
* @async
|
|
40
|
+
* @function getCollectionAttributes
|
|
41
|
+
* @param {string} collection - The ticker of the collection to fetch the attributes for.
|
|
42
|
+
* @returns {Promise<ICollectionAttributes>} A promise that resolves to the fetched collection attributes.
|
|
43
|
+
*
|
|
44
|
+
* This function fetches the attributes of a given collection. It takes the following parameter:
|
|
45
|
+
* - collection (string): The ticker of the collection to fetch the attributes for.
|
|
46
|
+
*
|
|
47
|
+
* The function first validates the input ticker and checks if it is a valid collection ticker.
|
|
48
|
+
* If it is valid, the function fetches the collection attributes using the API.
|
|
49
|
+
* Finally, it returns a promise that resolves to the fetched collection attributes.
|
|
34
50
|
*/
|
|
35
51
|
getCollectionAttributes: (collection: string) => Promise<ICollectionAttributes>;
|
|
36
52
|
/**
|
|
@@ -39,7 +55,32 @@ export default class CollectionModule {
|
|
|
39
55
|
* @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
|
|
40
56
|
* @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 35.
|
|
41
57
|
*/
|
|
42
|
-
|
|
58
|
+
getCollectionNFTs: (args: GetCollectionNFTsArgs) => Promise<SearchNFTsResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* Searches for Global NFTs or in specific collections based on the provided arguments.
|
|
61
|
+
* @param {ExploreNFTsArgs} args - The SearchNFTsArgs object containing the search parameters.
|
|
62
|
+
* @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
|
|
63
|
+
* @throws An error if the 'top' value is greater than 35.
|
|
64
|
+
*/
|
|
65
|
+
getGlobalNFTs: (args: GetCollectionNFTsArgs) => Promise<SearchNFTsResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* @public
|
|
68
|
+
* @async
|
|
69
|
+
* @function suggestResults
|
|
70
|
+
* @param {SuggestNFTsArgs} args - An object containing the necessary parameters to fetch suggested NFT results.
|
|
71
|
+
* @returns {Promise<SuggestResults>} A promise that resolves to the fetched NFT results.
|
|
72
|
+
*
|
|
73
|
+
* This function fetches suggested NFT results based on the provided arguments. It takes an object with the following properties:
|
|
74
|
+
* - name (string): The name to search for (required).
|
|
75
|
+
* - orderBy (SuggestOrderBy[], optional): An array of ordering preferences for the results.
|
|
76
|
+
* - top (number, optional): The maximum number of results to return (default is 35, cannot be greater than 35).
|
|
77
|
+
* - skip (number, optional): The number of results to skip (default is 0).
|
|
78
|
+
*
|
|
79
|
+
* The function first validates the input arguments and constructs a payload body with the provided parameters.
|
|
80
|
+
* Then, it converts the payload body into a base64 string and fetches the suggested results using the API.
|
|
81
|
+
* Finally, it returns a promise that resolves to the fetched NFT results.
|
|
82
|
+
*/
|
|
83
|
+
suggestResults: (args: SuggestNFTsArgs) => Promise<SuggestResults>;
|
|
43
84
|
/**
|
|
44
85
|
* Retrieves trading history based on the provided arguments.
|
|
45
86
|
*
|
|
@@ -55,4 +96,61 @@ export default class CollectionModule {
|
|
|
55
96
|
* @throws An error if the 'top' value is greater than 35.
|
|
56
97
|
*/
|
|
57
98
|
getCollections: (args?: GetCollectionsArgs) => Promise<CollectionsNFTsResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* @public
|
|
101
|
+
* @async
|
|
102
|
+
* @function getCollectionVolume
|
|
103
|
+
* @param {string} collection - The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
|
|
104
|
+
* @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
105
|
+
* @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
|
|
106
|
+
* @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
|
|
107
|
+
* @returns {Promise<CollectionVolume[]>} A promise that resolves to an array of collection volume data.
|
|
108
|
+
*
|
|
109
|
+
* This function fetches volume data for a given collection within a specified date range and binning period. It takes the following parameters:
|
|
110
|
+
* - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
|
|
111
|
+
* - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
112
|
+
* - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
|
|
113
|
+
* - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
|
|
114
|
+
*
|
|
115
|
+
* The function first validates the input collection ticker and checks if it is a valid collection ticker.
|
|
116
|
+
* If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
|
|
117
|
+
* Finally, it returns a promise that resolves to an array of collection volume data.
|
|
118
|
+
*/
|
|
119
|
+
getCollectionVolume: (collection: string, after: string, before: string, bin: string) => Promise<CollectionVolume[]>;
|
|
120
|
+
/**
|
|
121
|
+
* @public
|
|
122
|
+
* @async
|
|
123
|
+
* @function getCollectionFloor
|
|
124
|
+
* @param {string} collection - The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
|
|
125
|
+
* @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
126
|
+
* @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
|
|
127
|
+
* @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
|
|
128
|
+
* @returns {Promise<FloorPriceHistory[]>} A promise that resolves to an array of floor price history data.
|
|
129
|
+
*
|
|
130
|
+
* This function fetches floor data for a given collection within a specified date range and binning period. It takes the following parameters:
|
|
131
|
+
* - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
|
|
132
|
+
* - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
133
|
+
* - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
|
|
134
|
+
* - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
|
|
135
|
+
*
|
|
136
|
+
* The function first validates the input collection ticker and checks if it is a valid collection ticker.
|
|
137
|
+
* If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
|
|
138
|
+
* Finally, it returns a promise that resolves to an array of floor price history data.
|
|
139
|
+
*/
|
|
140
|
+
getCollectionFloor: (collection: string, after: string, before: string, bin: string) => Promise<FloorPriceHistory[]>;
|
|
141
|
+
/**
|
|
142
|
+
* @public
|
|
143
|
+
* @async
|
|
144
|
+
* @function getCollectionOwners
|
|
145
|
+
* @param {string} collection - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
|
|
146
|
+
* @returns {Promise<CollectionHoldersInfo[]>} A promise that resolves to an array of collection owner information.
|
|
147
|
+
*
|
|
148
|
+
* This function fetches owner information for a given collection. It takes the following parameter:
|
|
149
|
+
* - collection (string): The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
|
|
150
|
+
*
|
|
151
|
+
* The function first validates the input collection ticker and checks if it is a valid collection ticker.
|
|
152
|
+
* If it is valid, the function fetches the collection owner information using the API.
|
|
153
|
+
* Finally, it returns a promise that resolves to an array of collection owner information.
|
|
154
|
+
*/
|
|
155
|
+
getCollectionOwners: (collection: string) => Promise<CollectionHoldersInfo>;
|
|
58
156
|
}
|
package/dist/collection/index.js
CHANGED
|
@@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const collection_1 = require("../types/collection");
|
|
15
16
|
const api_1 = __importDefault(require("../utils/api"));
|
|
16
17
|
const getActivity_1 = require("../utils/getActivity");
|
|
17
18
|
const regex_1 = require("../utils/regex");
|
|
@@ -26,10 +27,18 @@ const regex_1 = require("../utils/regex");
|
|
|
26
27
|
class CollectionModule {
|
|
27
28
|
constructor() {
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
-
* @
|
|
31
|
-
* @
|
|
32
|
-
* @
|
|
30
|
+
* @public
|
|
31
|
+
* @async
|
|
32
|
+
* @function getCollectionProfile
|
|
33
|
+
* @param {string} collection - The ticker of the collection to fetch the profile for.
|
|
34
|
+
* @returns {Promise<ICollectionProfile>} A promise that resolves to the fetched collection profile.
|
|
35
|
+
*
|
|
36
|
+
* This function fetches the profile of a given collection. It takes the following parameter:
|
|
37
|
+
* - collection (string): The ticker of the collection to fetch the profile for.
|
|
38
|
+
*
|
|
39
|
+
* The function first validates the input ticker and checks if it is a valid collection ticker.
|
|
40
|
+
* If it is valid, the function fetches the collection profile using the API.
|
|
41
|
+
* Finally, it returns a promise that resolves to the fetched collection profile.
|
|
33
42
|
*/
|
|
34
43
|
this.getCollectionProfile = (collection) => __awaiter(this, void 0, void 0, function* () {
|
|
35
44
|
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
@@ -53,10 +62,18 @@ class CollectionModule {
|
|
|
53
62
|
return response;
|
|
54
63
|
});
|
|
55
64
|
/**
|
|
56
|
-
*
|
|
57
|
-
* @
|
|
58
|
-
* @
|
|
59
|
-
* @
|
|
65
|
+
* @public
|
|
66
|
+
* @async
|
|
67
|
+
* @function getCollectionAttributes
|
|
68
|
+
* @param {string} collection - The ticker of the collection to fetch the attributes for.
|
|
69
|
+
* @returns {Promise<ICollectionAttributes>} A promise that resolves to the fetched collection attributes.
|
|
70
|
+
*
|
|
71
|
+
* This function fetches the attributes of a given collection. It takes the following parameter:
|
|
72
|
+
* - collection (string): The ticker of the collection to fetch the attributes for.
|
|
73
|
+
*
|
|
74
|
+
* The function first validates the input ticker and checks if it is a valid collection ticker.
|
|
75
|
+
* If it is valid, the function fetches the collection attributes using the API.
|
|
76
|
+
* Finally, it returns a promise that resolves to the fetched collection attributes.
|
|
60
77
|
*/
|
|
61
78
|
this.getCollectionAttributes = (collection) => __awaiter(this, void 0, void 0, function* () {
|
|
62
79
|
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
@@ -71,9 +88,9 @@ class CollectionModule {
|
|
|
71
88
|
* @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
|
|
72
89
|
* @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 35.
|
|
73
90
|
*/
|
|
74
|
-
this.
|
|
91
|
+
this.getCollectionNFTs = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
75
92
|
var _a, _b, _c, _d;
|
|
76
|
-
if (!(0, regex_1.isValidCollectionTicker)(args.collection)) {
|
|
93
|
+
if (args.collection && !(0, regex_1.isValidCollectionTicker)(args.collection)) {
|
|
77
94
|
throw new Error('Invalid collection ticker: ' + args.collection);
|
|
78
95
|
}
|
|
79
96
|
if (args.top && args.top > 35) {
|
|
@@ -108,6 +125,85 @@ class CollectionModule {
|
|
|
108
125
|
const response = yield this.api.fetchWithTimeout(`/searchNFTs/${buffer}`);
|
|
109
126
|
return Object.assign(Object.assign({}, response), { getNextPagePayload: Object.assign(Object.assign({}, args), { skip: ((_a = args.skip) !== null && _a !== void 0 ? _a : 0) + ((_b = args.top) !== null && _b !== void 0 ? _b : 35) }), hasMoreResults: response.resultsCount > ((_c = args.skip) !== null && _c !== void 0 ? _c : 0) + ((_d = args.top) !== null && _d !== void 0 ? _d : 35) });
|
|
110
127
|
});
|
|
128
|
+
/**
|
|
129
|
+
* Searches for Global NFTs or in specific collections based on the provided arguments.
|
|
130
|
+
* @param {ExploreNFTsArgs} args - The SearchNFTsArgs object containing the search parameters.
|
|
131
|
+
* @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
|
|
132
|
+
* @throws An error if the 'top' value is greater than 35.
|
|
133
|
+
*/
|
|
134
|
+
this.getGlobalNFTs = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
var _e, _f, _g, _h;
|
|
136
|
+
if (args.top && args.top > 35) {
|
|
137
|
+
throw new Error('Top cannot be greater than 35');
|
|
138
|
+
}
|
|
139
|
+
const payloadBody = {
|
|
140
|
+
curated: args.onlyVerified || true,
|
|
141
|
+
filters: {
|
|
142
|
+
onSale: args.onlyOnSale || false,
|
|
143
|
+
marketplace: args.listedOnlyOn || undefined,
|
|
144
|
+
auctionTypes: args.onlyOnSale
|
|
145
|
+
? args.onlyAuctions
|
|
146
|
+
? ['NftBid', 'SftAll']
|
|
147
|
+
: ['Nft', 'SftOnePerPayment']
|
|
148
|
+
: undefined,
|
|
149
|
+
tokens: args.listedInToken || undefined,
|
|
150
|
+
attributes: args.attributes || undefined,
|
|
151
|
+
range: args.priceRange
|
|
152
|
+
? Object.assign(Object.assign({}, args.priceRange), { type: args.onlyAuctions
|
|
153
|
+
? 'saleInfoNft/current_bid_short'
|
|
154
|
+
: 'saleInfoNft/min_bid_short' }) : undefined,
|
|
155
|
+
rankRange: args.rankRange || undefined,
|
|
156
|
+
},
|
|
157
|
+
search: args.extraSearch || [],
|
|
158
|
+
name: args.searchName || '',
|
|
159
|
+
orderBy: args.orderBy || undefined,
|
|
160
|
+
collections: args.collections || [],
|
|
161
|
+
select: args.onlySelectFields || undefined,
|
|
162
|
+
top: args.top || 35,
|
|
163
|
+
skip: args.skip || 0,
|
|
164
|
+
};
|
|
165
|
+
const buffer = Buffer.from(JSON.stringify(payloadBody)).toString('base64');
|
|
166
|
+
const response = yield this.api.fetchWithTimeout(`/exploreNFTs/${buffer}`);
|
|
167
|
+
return Object.assign(Object.assign({}, response), { getNextPagePayload: Object.assign(Object.assign({}, args), { skip: ((_e = args.skip) !== null && _e !== void 0 ? _e : 0) + ((_f = args.top) !== null && _f !== void 0 ? _f : 35) }), hasMoreResults: response.resultsCount > ((_g = args.skip) !== null && _g !== void 0 ? _g : 0) + ((_h = args.top) !== null && _h !== void 0 ? _h : 35) });
|
|
168
|
+
});
|
|
169
|
+
/**
|
|
170
|
+
* @public
|
|
171
|
+
* @async
|
|
172
|
+
* @function suggestResults
|
|
173
|
+
* @param {SuggestNFTsArgs} args - An object containing the necessary parameters to fetch suggested NFT results.
|
|
174
|
+
* @returns {Promise<SuggestResults>} A promise that resolves to the fetched NFT results.
|
|
175
|
+
*
|
|
176
|
+
* This function fetches suggested NFT results based on the provided arguments. It takes an object with the following properties:
|
|
177
|
+
* - name (string): The name to search for (required).
|
|
178
|
+
* - orderBy (SuggestOrderBy[], optional): An array of ordering preferences for the results.
|
|
179
|
+
* - top (number, optional): The maximum number of results to return (default is 35, cannot be greater than 35).
|
|
180
|
+
* - skip (number, optional): The number of results to skip (default is 0).
|
|
181
|
+
*
|
|
182
|
+
* The function first validates the input arguments and constructs a payload body with the provided parameters.
|
|
183
|
+
* Then, it converts the payload body into a base64 string and fetches the suggested results using the API.
|
|
184
|
+
* Finally, it returns a promise that resolves to the fetched NFT results.
|
|
185
|
+
*/
|
|
186
|
+
this.suggestResults = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
if (args.top && args.top > 35) {
|
|
188
|
+
throw new Error('Top cannot be greater than 35');
|
|
189
|
+
}
|
|
190
|
+
if (!args.name) {
|
|
191
|
+
throw new Error('Name is required');
|
|
192
|
+
}
|
|
193
|
+
const payloadBody = {
|
|
194
|
+
name: args.name,
|
|
195
|
+
orderBy: args.orderBy || [
|
|
196
|
+
collection_1.SuggestOrderBy.TotalVolumeHighToLow,
|
|
197
|
+
collection_1.SuggestOrderBy.FollowersHighToLow,
|
|
198
|
+
collection_1.SuggestOrderBy.IsVerifiedTrueToFalse,
|
|
199
|
+
collection_1.SuggestOrderBy.HasImageTrueToFalse,
|
|
200
|
+
],
|
|
201
|
+
top: args.top || 35,
|
|
202
|
+
skip: args.skip || 0,
|
|
203
|
+
};
|
|
204
|
+
const buffer = Buffer.from(JSON.stringify(payloadBody)).toString('base64');
|
|
205
|
+
return yield this.api.fetchWithTimeout(`/search/${buffer}`);
|
|
206
|
+
});
|
|
111
207
|
/**
|
|
112
208
|
* Retrieves trading history based on the provided arguments.
|
|
113
209
|
*
|
|
@@ -148,6 +244,81 @@ class CollectionModule {
|
|
|
148
244
|
hasMoreResults: response.length >= ((args === null || args === void 0 ? void 0 : args.top) || 25),
|
|
149
245
|
};
|
|
150
246
|
});
|
|
247
|
+
/**
|
|
248
|
+
* @public
|
|
249
|
+
* @async
|
|
250
|
+
* @function getCollectionVolume
|
|
251
|
+
* @param {string} collection - The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
|
|
252
|
+
* @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
253
|
+
* @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
|
|
254
|
+
* @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
|
|
255
|
+
* @returns {Promise<CollectionVolume[]>} A promise that resolves to an array of collection volume data.
|
|
256
|
+
*
|
|
257
|
+
* This function fetches volume data for a given collection within a specified date range and binning period. It takes the following parameters:
|
|
258
|
+
* - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
|
|
259
|
+
* - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
260
|
+
* - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
|
|
261
|
+
* - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
|
|
262
|
+
*
|
|
263
|
+
* The function first validates the input collection ticker and checks if it is a valid collection ticker.
|
|
264
|
+
* If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
|
|
265
|
+
* Finally, it returns a promise that resolves to an array of collection volume data.
|
|
266
|
+
*/
|
|
267
|
+
this.getCollectionVolume = (collection, after, before, bin) => __awaiter(this, void 0, void 0, function* () {
|
|
268
|
+
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
269
|
+
throw new Error('Invalid collection ticker: ' + collection);
|
|
270
|
+
}
|
|
271
|
+
const response = yield this.api.fetchWithTimeout(`/getCollectionVolume/${collection}?after=${after}&before=${before}&bin=${bin}`);
|
|
272
|
+
return response;
|
|
273
|
+
});
|
|
274
|
+
/**
|
|
275
|
+
* @public
|
|
276
|
+
* @async
|
|
277
|
+
* @function getCollectionFloor
|
|
278
|
+
* @param {string} collection - The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
|
|
279
|
+
* @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
280
|
+
* @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
|
|
281
|
+
* @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
|
|
282
|
+
* @returns {Promise<FloorPriceHistory[]>} A promise that resolves to an array of floor price history data.
|
|
283
|
+
*
|
|
284
|
+
* This function fetches floor data for a given collection within a specified date range and binning period. It takes the following parameters:
|
|
285
|
+
* - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
|
|
286
|
+
* - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
287
|
+
* - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
|
|
288
|
+
* - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
|
|
289
|
+
*
|
|
290
|
+
* The function first validates the input collection ticker and checks if it is a valid collection ticker.
|
|
291
|
+
* If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
|
|
292
|
+
* Finally, it returns a promise that resolves to an array of floor price history data.
|
|
293
|
+
*/
|
|
294
|
+
this.getCollectionFloor = (collection, after, before, bin) => __awaiter(this, void 0, void 0, function* () {
|
|
295
|
+
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
296
|
+
throw new Error('Invalid collection ticker: ' + collection);
|
|
297
|
+
}
|
|
298
|
+
const response = yield this.api.fetchWithTimeout(`/getCollectionFloor/${collection}?after=${after}&before=${before}&bin=${bin}`);
|
|
299
|
+
return response;
|
|
300
|
+
});
|
|
301
|
+
/**
|
|
302
|
+
* @public
|
|
303
|
+
* @async
|
|
304
|
+
* @function getCollectionOwners
|
|
305
|
+
* @param {string} collection - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
|
|
306
|
+
* @returns {Promise<CollectionHoldersInfo[]>} A promise that resolves to an array of collection owner information.
|
|
307
|
+
*
|
|
308
|
+
* This function fetches owner information for a given collection. It takes the following parameter:
|
|
309
|
+
* - collection (string): The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
|
|
310
|
+
*
|
|
311
|
+
* The function first validates the input collection ticker and checks if it is a valid collection ticker.
|
|
312
|
+
* If it is valid, the function fetches the collection owner information using the API.
|
|
313
|
+
* Finally, it returns a promise that resolves to an array of collection owner information.
|
|
314
|
+
*/
|
|
315
|
+
this.getCollectionOwners = (collection) => __awaiter(this, void 0, void 0, function* () {
|
|
316
|
+
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
317
|
+
throw new Error('Invalid collection ticker: ' + collection);
|
|
318
|
+
}
|
|
319
|
+
const response = yield this.api.fetchWithTimeout(`/getCollectionOwners/${collection}`);
|
|
320
|
+
return response;
|
|
321
|
+
});
|
|
151
322
|
this.api = api_1.default.init();
|
|
152
323
|
}
|
|
153
324
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collection/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src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AAC;QAEF;;;;;;;;;;;;;WAaG;QACI,wBAAmB,GAAG,CAC3B,UAAkB,EACc,EAAE;YAClC,IAAI,CAAC,IAAA,+BAAuB,EAAC,UAAU,CAAC,EAAE;gBACxC,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,UAAU,CAAC,CAAC;aAC7D;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,wBAAwB,UAAU,EAAE,CACrC,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAtYA,IAAI,CAAC,GAAG,GAAG,aAAW,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CAsYF;AA1YD,mCA0YC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { Interaction } from '@multiversx/sdk-core/out/smartcontracts/interaction';
|
|
2
2
|
import { GlobalOffer } from '../types/collection';
|
|
3
|
-
import
|
|
4
|
-
import { Auction, ChangeListing } from '../types/interactions';
|
|
3
|
+
import { AcceptGlobalOffer, Auction, ChangeListing, NFTBody, NewListingArgs, Payment, SendCustomOffer, SendGlobalOffer } from '../types/interactions';
|
|
5
4
|
export default class SCInteraction {
|
|
6
5
|
private xo;
|
|
7
6
|
private call;
|
|
8
7
|
private api;
|
|
9
|
-
constructor(
|
|
10
|
-
static
|
|
8
|
+
private constructor();
|
|
9
|
+
static init(): Promise<SCInteraction>;
|
|
11
10
|
private getResult;
|
|
12
11
|
/**
|
|
13
12
|
* Gets the percentage of each transaction that will be paid to the marketplace.
|
|
@@ -101,6 +100,35 @@ export default class SCInteraction {
|
|
|
101
100
|
* @returns {Interaction} The interaction object of the smart contract
|
|
102
101
|
*/
|
|
103
102
|
withdrawGlobalOffer(offerID: number): Interaction;
|
|
103
|
+
/**
|
|
104
|
+
* Accept a global offer
|
|
105
|
+
*
|
|
106
|
+
* @param offerID The offer ID
|
|
107
|
+
* @returns {Interaction} The interaction object of the smart contract
|
|
108
|
+
*/
|
|
109
|
+
acceptGlobalOffer({ signature, offer_id, auction_id_opt, nft, }: AcceptGlobalOffer): Interaction;
|
|
110
|
+
/**
|
|
111
|
+
* Send a global offer
|
|
112
|
+
* @param payment_token The token used for payment
|
|
113
|
+
* @param payment_nonce The nonce of the payment token
|
|
114
|
+
* @param price The price of the offer
|
|
115
|
+
* @param collection The collection of the NFT
|
|
116
|
+
* @param attributes The attributes of the NFT
|
|
117
|
+
* @param depositAmount The deposit amount
|
|
118
|
+
* @returns {Interaction} The interaction object of the smart contract
|
|
119
|
+
* */
|
|
120
|
+
sendGlobalOffer({ payment_token, payment_nonce, price, collection, attributes, depositAmount, }: SendGlobalOffer): Interaction;
|
|
121
|
+
/**
|
|
122
|
+
* Send a custom offer
|
|
123
|
+
* @param payment_token The token used for payment
|
|
124
|
+
* @param payment_nonce The nonce of the payment token
|
|
125
|
+
* @param price The price of the offer
|
|
126
|
+
* @param deadline The deadline of the offer
|
|
127
|
+
* @param nft The NFT to be sold
|
|
128
|
+
* @param depositAmount The deposit amount
|
|
129
|
+
* @returns {Interaction} The interaction object of the smart contract
|
|
130
|
+
* */
|
|
131
|
+
sendCustomOffer({ payment_token, payment_nonce, price, deadline, nft, depositAmount, }: SendCustomOffer): Interaction;
|
|
104
132
|
/**
|
|
105
133
|
* Withdraws a custom offer
|
|
106
134
|
*
|
|
@@ -108,6 +136,20 @@ export default class SCInteraction {
|
|
|
108
136
|
* @returns {Interaction} The interaction object of the smart contract
|
|
109
137
|
*/
|
|
110
138
|
withdrawCustomOffer(offerID: number): Interaction;
|
|
139
|
+
/**
|
|
140
|
+
* Decline a custom offer
|
|
141
|
+
*
|
|
142
|
+
* @param offerID The offer ID
|
|
143
|
+
* @returns {Interaction} The interaction object of the smart contract
|
|
144
|
+
*/
|
|
145
|
+
declineCustomOffer(offerID: number, nft?: NFTBody): Interaction;
|
|
146
|
+
/**
|
|
147
|
+
* Accept a custom offer
|
|
148
|
+
*
|
|
149
|
+
* @param offerID The offer ID
|
|
150
|
+
* @returns {Interaction} The interaction object of the smart contract
|
|
151
|
+
*/
|
|
152
|
+
acceptCustomOffer(offerID: number, nft?: NFTBody): Interaction;
|
|
111
153
|
/**
|
|
112
154
|
* @public
|
|
113
155
|
* @function endAuction
|
|
@@ -121,6 +163,24 @@ export default class SCInteraction {
|
|
|
121
163
|
* Finally, it returns the resulting interaction with the specified chainID and gas limit.
|
|
122
164
|
*/
|
|
123
165
|
endAuction(auctionID: number): Interaction;
|
|
166
|
+
/**
|
|
167
|
+
* Bid on an auction
|
|
168
|
+
*
|
|
169
|
+
* @param auctionID The auction ID
|
|
170
|
+
* @param collection The NFT Collection
|
|
171
|
+
* @param nonce The NFT nonce
|
|
172
|
+
* @param payment The payment object
|
|
173
|
+
* @returns {Interaction} The interaction object of the smart contract
|
|
174
|
+
*/
|
|
175
|
+
bidOnAuctionId(auctionID: number, collection: string, nonce: number, payment: Payment): Interaction;
|
|
176
|
+
/**
|
|
177
|
+
* Bulk buy auctions
|
|
178
|
+
*
|
|
179
|
+
* @param auctionIDs The auction IDs
|
|
180
|
+
* @param payment The payment object
|
|
181
|
+
* @returns {Interaction} The interaction object of the smart contract
|
|
182
|
+
*/
|
|
183
|
+
bulkBuy(auctionIDs: number[], payment: Payment): Interaction;
|
|
124
184
|
/**
|
|
125
185
|
* @public
|
|
126
186
|
* @async
|
|
@@ -179,4 +239,5 @@ export default class SCInteraction {
|
|
|
179
239
|
* with the specified chainID and gas limit.
|
|
180
240
|
*/
|
|
181
241
|
changeListing(listings: ChangeListing[]): Promise<Interaction>;
|
|
242
|
+
listNFTs(listings: NewListingArgs[]): Promise<Interaction>;
|
|
182
243
|
}
|