@imtbl/sdk 0.1.8 → 0.1.9-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.
@@ -0,0 +1,2725 @@
1
+ import globalAxios from 'axios';
2
+
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ /**
6
+ * Immutable X API
7
+ * Immutable Multi Rollup API
8
+ *
9
+ * The version of the OpenAPI document: 1.0.0
10
+ * Contact: support@immutable.com
11
+ *
12
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13
+ * https://openapi-generator.tech
14
+ * Do not edit the class manually.
15
+ */
16
+ // Some imports not used depending on template conditions
17
+ // @ts-ignore
18
+ const BASE_PATH = "https://indexer-mr.dev.imtbl.com".replace(/\/+$/, "");
19
+ /**
20
+ *
21
+ * @export
22
+ * @class BaseAPI
23
+ */
24
+ class BaseAPI {
25
+ basePath;
26
+ axios;
27
+ configuration;
28
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
29
+ this.basePath = basePath;
30
+ this.axios = axios;
31
+ if (configuration) {
32
+ this.configuration = configuration;
33
+ this.basePath = configuration.basePath || this.basePath;
34
+ }
35
+ }
36
+ }
37
+ /**
38
+ *
39
+ * @export
40
+ * @class RequiredError
41
+ * @extends {Error}
42
+ */
43
+ class RequiredError extends Error {
44
+ field;
45
+ name = "RequiredError";
46
+ constructor(field, msg) {
47
+ super(msg);
48
+ this.field = field;
49
+ }
50
+ }
51
+
52
+ /* tslint:disable */
53
+ /* eslint-disable */
54
+ /**
55
+ * Immutable X API
56
+ * Immutable Multi Rollup API
57
+ *
58
+ * The version of the OpenAPI document: 1.0.0
59
+ * Contact: support@immutable.com
60
+ *
61
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
62
+ * https://openapi-generator.tech
63
+ * Do not edit the class manually.
64
+ */
65
+ /**
66
+ *
67
+ * @export
68
+ */
69
+ const DUMMY_BASE_URL = 'https://example.com';
70
+ /**
71
+ *
72
+ * @throws {RequiredError}
73
+ * @export
74
+ */
75
+ const assertParamExists = function (functionName, paramName, paramValue) {
76
+ if (paramValue === null || paramValue === undefined) {
77
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
78
+ }
79
+ };
80
+ /**
81
+ *
82
+ * @export
83
+ */
84
+ const setBearerAuthToObject = async function (object, configuration) {
85
+ if (configuration && configuration.accessToken) {
86
+ const accessToken = typeof configuration.accessToken === 'function'
87
+ ? await configuration.accessToken()
88
+ : await configuration.accessToken;
89
+ object["Authorization"] = "Bearer " + accessToken;
90
+ }
91
+ };
92
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
93
+ if (typeof parameter === "object") {
94
+ if (Array.isArray(parameter)) {
95
+ parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
96
+ }
97
+ else {
98
+ Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
99
+ }
100
+ }
101
+ else {
102
+ if (urlSearchParams.has(key)) {
103
+ urlSearchParams.append(key, parameter);
104
+ }
105
+ else {
106
+ urlSearchParams.set(key, parameter);
107
+ }
108
+ }
109
+ }
110
+ /**
111
+ *
112
+ * @export
113
+ */
114
+ const setSearchParams = function (url, ...objects) {
115
+ const searchParams = new URLSearchParams(url.search);
116
+ setFlattenedQueryParams(searchParams, objects);
117
+ url.search = searchParams.toString();
118
+ };
119
+ /**
120
+ *
121
+ * @export
122
+ */
123
+ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
124
+ const nonString = typeof value !== 'string';
125
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
126
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
127
+ : nonString;
128
+ return needsSerialization
129
+ ? JSON.stringify(value !== undefined ? value : {})
130
+ : (value || "");
131
+ };
132
+ /**
133
+ *
134
+ * @export
135
+ */
136
+ const toPathString = function (url) {
137
+ return url.pathname + url.search + url.hash;
138
+ };
139
+ /**
140
+ *
141
+ * @export
142
+ */
143
+ const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
144
+ return (axios = globalAxios, basePath = BASE_PATH) => {
145
+ const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url };
146
+ return axios.request(axiosRequestArgs);
147
+ };
148
+ };
149
+
150
+ /* tslint:disable */
151
+ /* eslint-disable */
152
+ /**
153
+ * Immutable X API
154
+ * Immutable Multi Rollup API
155
+ *
156
+ * The version of the OpenAPI document: 1.0.0
157
+ * Contact: support@immutable.com
158
+ *
159
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
160
+ * https://openapi-generator.tech
161
+ * Do not edit the class manually.
162
+ */
163
+ /**
164
+ * ActivitiesApi - axios parameter creator
165
+ * @export
166
+ */
167
+ const ActivitiesApiAxiosParamCreator = function (configuration) {
168
+ return {
169
+ /**
170
+ * Get a single activity by ID
171
+ * @summary Get a single activity by ID
172
+ * @param {string} chainName The name of chain
173
+ * @param {string} activityId The id of activity
174
+ * @param {*} [options] Override http request option.
175
+ * @throws {RequiredError}
176
+ */
177
+ getActivity: async (chainName, activityId, options = {}) => {
178
+ // verify required parameter 'chainName' is not null or undefined
179
+ assertParamExists('getActivity', 'chainName', chainName);
180
+ // verify required parameter 'activityId' is not null or undefined
181
+ assertParamExists('getActivity', 'activityId', activityId);
182
+ const localVarPath = `/v1/chains/{chain_name}/activities/{activity_id}`
183
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)))
184
+ .replace(`{${"activity_id"}}`, encodeURIComponent(String(activityId)));
185
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
186
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
187
+ let baseOptions;
188
+ if (configuration) {
189
+ baseOptions = configuration.baseOptions;
190
+ }
191
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
192
+ const localVarHeaderParameter = {};
193
+ const localVarQueryParameter = {};
194
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
195
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
196
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
197
+ return {
198
+ url: toPathString(localVarUrlObj),
199
+ options: localVarRequestOptions,
200
+ };
201
+ },
202
+ /**
203
+ * List all activities
204
+ * @summary List all activities
205
+ * @param {string} chainName The name of chain
206
+ * @param {string} [contractAddress] The contract address of NFT or ERC20 Token
207
+ * @param {string} [tokenId] An `uint256` token id as string
208
+ * @param {string} [accountAddress] The account address activity contains
209
+ * @param {ActivityType} [activityType] The activity type
210
+ * @param {string} [fromIndexedAt] From indexed at including given date
211
+ * @param {string} [toIndexedAt] To indexed at including given date
212
+ * @param {string} [transactionHash] The transaction hash of activity
213
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
214
+ * @param {number} [pageSize] Maximum number of items to return
215
+ * @param {*} [options] Override http request option.
216
+ * @throws {RequiredError}
217
+ */
218
+ listActivities: async (chainName, contractAddress, tokenId, accountAddress, activityType, fromIndexedAt, toIndexedAt, transactionHash, pageCursor, pageSize, options = {}) => {
219
+ // verify required parameter 'chainName' is not null or undefined
220
+ assertParamExists('listActivities', 'chainName', chainName);
221
+ const localVarPath = `/v1/chains/{chain_name}/activities`
222
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
223
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
224
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
225
+ let baseOptions;
226
+ if (configuration) {
227
+ baseOptions = configuration.baseOptions;
228
+ }
229
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
230
+ const localVarHeaderParameter = {};
231
+ const localVarQueryParameter = {};
232
+ if (contractAddress !== undefined) {
233
+ localVarQueryParameter['contract_address'] = contractAddress;
234
+ }
235
+ if (tokenId !== undefined) {
236
+ localVarQueryParameter['token_id'] = tokenId;
237
+ }
238
+ if (accountAddress !== undefined) {
239
+ localVarQueryParameter['account_address'] = accountAddress;
240
+ }
241
+ if (activityType !== undefined) {
242
+ localVarQueryParameter['activity_type'] = activityType;
243
+ }
244
+ if (fromIndexedAt !== undefined) {
245
+ localVarQueryParameter['from_indexed_at'] = (fromIndexedAt instanceof Date) ?
246
+ fromIndexedAt.toISOString() :
247
+ fromIndexedAt;
248
+ }
249
+ if (toIndexedAt !== undefined) {
250
+ localVarQueryParameter['to_indexed_at'] = (toIndexedAt instanceof Date) ?
251
+ toIndexedAt.toISOString() :
252
+ toIndexedAt;
253
+ }
254
+ if (transactionHash !== undefined) {
255
+ localVarQueryParameter['transaction_hash'] = transactionHash;
256
+ }
257
+ if (pageCursor !== undefined) {
258
+ localVarQueryParameter['page_cursor'] = pageCursor;
259
+ }
260
+ if (pageSize !== undefined) {
261
+ localVarQueryParameter['page_size'] = pageSize;
262
+ }
263
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
264
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
265
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
266
+ return {
267
+ url: toPathString(localVarUrlObj),
268
+ options: localVarRequestOptions,
269
+ };
270
+ },
271
+ };
272
+ };
273
+ /**
274
+ * ActivitiesApi - functional programming interface
275
+ * @export
276
+ */
277
+ const ActivitiesApiFp = function (configuration) {
278
+ const localVarAxiosParamCreator = ActivitiesApiAxiosParamCreator(configuration);
279
+ return {
280
+ /**
281
+ * Get a single activity by ID
282
+ * @summary Get a single activity by ID
283
+ * @param {string} chainName The name of chain
284
+ * @param {string} activityId The id of activity
285
+ * @param {*} [options] Override http request option.
286
+ * @throws {RequiredError}
287
+ */
288
+ async getActivity(chainName, activityId, options) {
289
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getActivity(chainName, activityId, options);
290
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
291
+ },
292
+ /**
293
+ * List all activities
294
+ * @summary List all activities
295
+ * @param {string} chainName The name of chain
296
+ * @param {string} [contractAddress] The contract address of NFT or ERC20 Token
297
+ * @param {string} [tokenId] An `uint256` token id as string
298
+ * @param {string} [accountAddress] The account address activity contains
299
+ * @param {ActivityType} [activityType] The activity type
300
+ * @param {string} [fromIndexedAt] From indexed at including given date
301
+ * @param {string} [toIndexedAt] To indexed at including given date
302
+ * @param {string} [transactionHash] The transaction hash of activity
303
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
304
+ * @param {number} [pageSize] Maximum number of items to return
305
+ * @param {*} [options] Override http request option.
306
+ * @throws {RequiredError}
307
+ */
308
+ async listActivities(chainName, contractAddress, tokenId, accountAddress, activityType, fromIndexedAt, toIndexedAt, transactionHash, pageCursor, pageSize, options) {
309
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listActivities(chainName, contractAddress, tokenId, accountAddress, activityType, fromIndexedAt, toIndexedAt, transactionHash, pageCursor, pageSize, options);
310
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
311
+ },
312
+ };
313
+ };
314
+ /**
315
+ * ActivitiesApi - factory interface
316
+ * @export
317
+ */
318
+ const ActivitiesApiFactory = function (configuration, basePath, axios) {
319
+ const localVarFp = ActivitiesApiFp(configuration);
320
+ return {
321
+ /**
322
+ * Get a single activity by ID
323
+ * @summary Get a single activity by ID
324
+ * @param {string} chainName The name of chain
325
+ * @param {string} activityId The id of activity
326
+ * @param {*} [options] Override http request option.
327
+ * @throws {RequiredError}
328
+ */
329
+ getActivity(chainName, activityId, options) {
330
+ return localVarFp.getActivity(chainName, activityId, options).then((request) => request(axios, basePath));
331
+ },
332
+ /**
333
+ * List all activities
334
+ * @summary List all activities
335
+ * @param {string} chainName The name of chain
336
+ * @param {string} [contractAddress] The contract address of NFT or ERC20 Token
337
+ * @param {string} [tokenId] An `uint256` token id as string
338
+ * @param {string} [accountAddress] The account address activity contains
339
+ * @param {ActivityType} [activityType] The activity type
340
+ * @param {string} [fromIndexedAt] From indexed at including given date
341
+ * @param {string} [toIndexedAt] To indexed at including given date
342
+ * @param {string} [transactionHash] The transaction hash of activity
343
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
344
+ * @param {number} [pageSize] Maximum number of items to return
345
+ * @param {*} [options] Override http request option.
346
+ * @throws {RequiredError}
347
+ */
348
+ listActivities(chainName, contractAddress, tokenId, accountAddress, activityType, fromIndexedAt, toIndexedAt, transactionHash, pageCursor, pageSize, options) {
349
+ return localVarFp.listActivities(chainName, contractAddress, tokenId, accountAddress, activityType, fromIndexedAt, toIndexedAt, transactionHash, pageCursor, pageSize, options).then((request) => request(axios, basePath));
350
+ },
351
+ };
352
+ };
353
+ /**
354
+ * ActivitiesApi - object-oriented interface
355
+ * @export
356
+ * @class ActivitiesApi
357
+ * @extends {BaseAPI}
358
+ */
359
+ class ActivitiesApi extends BaseAPI {
360
+ /**
361
+ * Get a single activity by ID
362
+ * @summary Get a single activity by ID
363
+ * @param {ActivitiesApiGetActivityRequest} requestParameters Request parameters.
364
+ * @param {*} [options] Override http request option.
365
+ * @throws {RequiredError}
366
+ * @memberof ActivitiesApi
367
+ */
368
+ getActivity(requestParameters, options) {
369
+ return ActivitiesApiFp(this.configuration).getActivity(requestParameters.chainName, requestParameters.activityId, options).then((request) => request(this.axios, this.basePath));
370
+ }
371
+ /**
372
+ * List all activities
373
+ * @summary List all activities
374
+ * @param {ActivitiesApiListActivitiesRequest} requestParameters Request parameters.
375
+ * @param {*} [options] Override http request option.
376
+ * @throws {RequiredError}
377
+ * @memberof ActivitiesApi
378
+ */
379
+ listActivities(requestParameters, options) {
380
+ return ActivitiesApiFp(this.configuration).listActivities(requestParameters.chainName, requestParameters.contractAddress, requestParameters.tokenId, requestParameters.accountAddress, requestParameters.activityType, requestParameters.fromIndexedAt, requestParameters.toIndexedAt, requestParameters.transactionHash, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
381
+ }
382
+ }
383
+
384
+ /* tslint:disable */
385
+ /* eslint-disable */
386
+ /**
387
+ * Immutable X API
388
+ * Immutable Multi Rollup API
389
+ *
390
+ * The version of the OpenAPI document: 1.0.0
391
+ * Contact: support@immutable.com
392
+ *
393
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
394
+ * https://openapi-generator.tech
395
+ * Do not edit the class manually.
396
+ */
397
+ /**
398
+ * ChainsApi - axios parameter creator
399
+ * @export
400
+ */
401
+ const ChainsApiAxiosParamCreator = function (configuration) {
402
+ return {
403
+ /**
404
+ * List supported chains
405
+ * @summary List supported chains
406
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
407
+ * @param {number} [pageSize] Maximum number of items to return
408
+ * @param {*} [options] Override http request option.
409
+ * @throws {RequiredError}
410
+ */
411
+ listChains: async (pageCursor, pageSize, options = {}) => {
412
+ const localVarPath = `/v1/chains`;
413
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
414
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
415
+ let baseOptions;
416
+ if (configuration) {
417
+ baseOptions = configuration.baseOptions;
418
+ }
419
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
420
+ const localVarHeaderParameter = {};
421
+ const localVarQueryParameter = {};
422
+ if (pageCursor !== undefined) {
423
+ localVarQueryParameter['page_cursor'] = pageCursor;
424
+ }
425
+ if (pageSize !== undefined) {
426
+ localVarQueryParameter['page_size'] = pageSize;
427
+ }
428
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
429
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
430
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
431
+ return {
432
+ url: toPathString(localVarUrlObj),
433
+ options: localVarRequestOptions,
434
+ };
435
+ },
436
+ };
437
+ };
438
+ /**
439
+ * ChainsApi - functional programming interface
440
+ * @export
441
+ */
442
+ const ChainsApiFp = function (configuration) {
443
+ const localVarAxiosParamCreator = ChainsApiAxiosParamCreator(configuration);
444
+ return {
445
+ /**
446
+ * List supported chains
447
+ * @summary List supported chains
448
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
449
+ * @param {number} [pageSize] Maximum number of items to return
450
+ * @param {*} [options] Override http request option.
451
+ * @throws {RequiredError}
452
+ */
453
+ async listChains(pageCursor, pageSize, options) {
454
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listChains(pageCursor, pageSize, options);
455
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
456
+ },
457
+ };
458
+ };
459
+ /**
460
+ * ChainsApi - factory interface
461
+ * @export
462
+ */
463
+ const ChainsApiFactory = function (configuration, basePath, axios) {
464
+ const localVarFp = ChainsApiFp(configuration);
465
+ return {
466
+ /**
467
+ * List supported chains
468
+ * @summary List supported chains
469
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
470
+ * @param {number} [pageSize] Maximum number of items to return
471
+ * @param {*} [options] Override http request option.
472
+ * @throws {RequiredError}
473
+ */
474
+ listChains(pageCursor, pageSize, options) {
475
+ return localVarFp.listChains(pageCursor, pageSize, options).then((request) => request(axios, basePath));
476
+ },
477
+ };
478
+ };
479
+ /**
480
+ * ChainsApi - object-oriented interface
481
+ * @export
482
+ * @class ChainsApi
483
+ * @extends {BaseAPI}
484
+ */
485
+ class ChainsApi extends BaseAPI {
486
+ /**
487
+ * List supported chains
488
+ * @summary List supported chains
489
+ * @param {ChainsApiListChainsRequest} requestParameters Request parameters.
490
+ * @param {*} [options] Override http request option.
491
+ * @throws {RequiredError}
492
+ * @memberof ChainsApi
493
+ */
494
+ listChains(requestParameters = {}, options) {
495
+ return ChainsApiFp(this.configuration).listChains(requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
496
+ }
497
+ }
498
+
499
+ /* tslint:disable */
500
+ /* eslint-disable */
501
+ /**
502
+ * Immutable X API
503
+ * Immutable Multi Rollup API
504
+ *
505
+ * The version of the OpenAPI document: 1.0.0
506
+ * Contact: support@immutable.com
507
+ *
508
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
509
+ * https://openapi-generator.tech
510
+ * Do not edit the class manually.
511
+ */
512
+ /**
513
+ * CollectionsApi - axios parameter creator
514
+ * @export
515
+ */
516
+ const CollectionsApiAxiosParamCreator = function (configuration) {
517
+ return {
518
+ /**
519
+ * Get collection by contract address
520
+ * @summary Get collection by contract address
521
+ * @param {string} contractAddress The address contract
522
+ * @param {string} chainName The name of chain
523
+ * @param {*} [options] Override http request option.
524
+ * @throws {RequiredError}
525
+ */
526
+ getCollection: async (contractAddress, chainName, options = {}) => {
527
+ // verify required parameter 'contractAddress' is not null or undefined
528
+ assertParamExists('getCollection', 'contractAddress', contractAddress);
529
+ // verify required parameter 'chainName' is not null or undefined
530
+ assertParamExists('getCollection', 'chainName', chainName);
531
+ const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}`
532
+ .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
533
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
534
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
535
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
536
+ let baseOptions;
537
+ if (configuration) {
538
+ baseOptions = configuration.baseOptions;
539
+ }
540
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
541
+ const localVarHeaderParameter = {};
542
+ const localVarQueryParameter = {};
543
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
544
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
545
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
546
+ return {
547
+ url: toPathString(localVarUrlObj),
548
+ options: localVarRequestOptions,
549
+ };
550
+ },
551
+ /**
552
+ * List all collections
553
+ * @summary List all collections
554
+ * @param {string} chainName The name of chain
555
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
556
+ * @param {number} [pageSize] Maximum number of items to return
557
+ * @param {*} [options] Override http request option.
558
+ * @throws {RequiredError}
559
+ */
560
+ listCollections: async (chainName, pageCursor, pageSize, options = {}) => {
561
+ // verify required parameter 'chainName' is not null or undefined
562
+ assertParamExists('listCollections', 'chainName', chainName);
563
+ const localVarPath = `/v1/chains/{chain_name}/collections`
564
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
565
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
566
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
567
+ let baseOptions;
568
+ if (configuration) {
569
+ baseOptions = configuration.baseOptions;
570
+ }
571
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
572
+ const localVarHeaderParameter = {};
573
+ const localVarQueryParameter = {};
574
+ if (pageCursor !== undefined) {
575
+ localVarQueryParameter['page_cursor'] = pageCursor;
576
+ }
577
+ if (pageSize !== undefined) {
578
+ localVarQueryParameter['page_size'] = pageSize;
579
+ }
580
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
581
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
582
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
583
+ return {
584
+ url: toPathString(localVarUrlObj),
585
+ options: localVarRequestOptions,
586
+ };
587
+ },
588
+ };
589
+ };
590
+ /**
591
+ * CollectionsApi - functional programming interface
592
+ * @export
593
+ */
594
+ const CollectionsApiFp = function (configuration) {
595
+ const localVarAxiosParamCreator = CollectionsApiAxiosParamCreator(configuration);
596
+ return {
597
+ /**
598
+ * Get collection by contract address
599
+ * @summary Get collection by contract address
600
+ * @param {string} contractAddress The address contract
601
+ * @param {string} chainName The name of chain
602
+ * @param {*} [options] Override http request option.
603
+ * @throws {RequiredError}
604
+ */
605
+ async getCollection(contractAddress, chainName, options) {
606
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCollection(contractAddress, chainName, options);
607
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
608
+ },
609
+ /**
610
+ * List all collections
611
+ * @summary List all collections
612
+ * @param {string} chainName The name of chain
613
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
614
+ * @param {number} [pageSize] Maximum number of items to return
615
+ * @param {*} [options] Override http request option.
616
+ * @throws {RequiredError}
617
+ */
618
+ async listCollections(chainName, pageCursor, pageSize, options) {
619
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listCollections(chainName, pageCursor, pageSize, options);
620
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
621
+ },
622
+ };
623
+ };
624
+ /**
625
+ * CollectionsApi - factory interface
626
+ * @export
627
+ */
628
+ const CollectionsApiFactory = function (configuration, basePath, axios) {
629
+ const localVarFp = CollectionsApiFp(configuration);
630
+ return {
631
+ /**
632
+ * Get collection by contract address
633
+ * @summary Get collection by contract address
634
+ * @param {string} contractAddress The address contract
635
+ * @param {string} chainName The name of chain
636
+ * @param {*} [options] Override http request option.
637
+ * @throws {RequiredError}
638
+ */
639
+ getCollection(contractAddress, chainName, options) {
640
+ return localVarFp.getCollection(contractAddress, chainName, options).then((request) => request(axios, basePath));
641
+ },
642
+ /**
643
+ * List all collections
644
+ * @summary List all collections
645
+ * @param {string} chainName The name of chain
646
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
647
+ * @param {number} [pageSize] Maximum number of items to return
648
+ * @param {*} [options] Override http request option.
649
+ * @throws {RequiredError}
650
+ */
651
+ listCollections(chainName, pageCursor, pageSize, options) {
652
+ return localVarFp.listCollections(chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
653
+ },
654
+ };
655
+ };
656
+ /**
657
+ * CollectionsApi - object-oriented interface
658
+ * @export
659
+ * @class CollectionsApi
660
+ * @extends {BaseAPI}
661
+ */
662
+ class CollectionsApi extends BaseAPI {
663
+ /**
664
+ * Get collection by contract address
665
+ * @summary Get collection by contract address
666
+ * @param {CollectionsApiGetCollectionRequest} requestParameters Request parameters.
667
+ * @param {*} [options] Override http request option.
668
+ * @throws {RequiredError}
669
+ * @memberof CollectionsApi
670
+ */
671
+ getCollection(requestParameters, options) {
672
+ return CollectionsApiFp(this.configuration).getCollection(requestParameters.contractAddress, requestParameters.chainName, options).then((request) => request(this.axios, this.basePath));
673
+ }
674
+ /**
675
+ * List all collections
676
+ * @summary List all collections
677
+ * @param {CollectionsApiListCollectionsRequest} requestParameters Request parameters.
678
+ * @param {*} [options] Override http request option.
679
+ * @throws {RequiredError}
680
+ * @memberof CollectionsApi
681
+ */
682
+ listCollections(requestParameters, options) {
683
+ return CollectionsApiFp(this.configuration).listCollections(requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
684
+ }
685
+ }
686
+
687
+ /* tslint:disable */
688
+ /* eslint-disable */
689
+ /**
690
+ * Immutable X API
691
+ * Immutable Multi Rollup API
692
+ *
693
+ * The version of the OpenAPI document: 1.0.0
694
+ * Contact: support@immutable.com
695
+ *
696
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
697
+ * https://openapi-generator.tech
698
+ * Do not edit the class manually.
699
+ */
700
+ /**
701
+ * ListingsApi - axios parameter creator
702
+ * @export
703
+ */
704
+ const ListingsApiAxiosParamCreator = function (configuration) {
705
+ return {
706
+ /**
707
+ * Create a listing
708
+ * @summary Create a listing
709
+ * @param {string} chainName
710
+ * @param {CreateListingRequestBody} createListingRequestBody
711
+ * @param {*} [options] Override http request option.
712
+ * @throws {RequiredError}
713
+ */
714
+ createListing: async (chainName, createListingRequestBody, options = {}) => {
715
+ // verify required parameter 'chainName' is not null or undefined
716
+ assertParamExists('createListing', 'chainName', chainName);
717
+ // verify required parameter 'createListingRequestBody' is not null or undefined
718
+ assertParamExists('createListing', 'createListingRequestBody', createListingRequestBody);
719
+ const localVarPath = `/v1/chains/{chain_name}/listings`
720
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
721
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
722
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
723
+ let baseOptions;
724
+ if (configuration) {
725
+ baseOptions = configuration.baseOptions;
726
+ }
727
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
728
+ const localVarHeaderParameter = {};
729
+ const localVarQueryParameter = {};
730
+ localVarHeaderParameter['Content-Type'] = 'application/json';
731
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
732
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
733
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
734
+ localVarRequestOptions.data = serializeDataIfNeeded(createListingRequestBody, localVarRequestOptions, configuration);
735
+ return {
736
+ url: toPathString(localVarUrlObj),
737
+ options: localVarRequestOptions,
738
+ };
739
+ },
740
+ /**
741
+ * Get a single listing by ID
742
+ * @summary Get a single listing by ID
743
+ * @param {string} chainName
744
+ * @param {string} listingId Global Order identifier
745
+ * @param {*} [options] Override http request option.
746
+ * @throws {RequiredError}
747
+ */
748
+ getListing: async (chainName, listingId, options = {}) => {
749
+ // verify required parameter 'chainName' is not null or undefined
750
+ assertParamExists('getListing', 'chainName', chainName);
751
+ // verify required parameter 'listingId' is not null or undefined
752
+ assertParamExists('getListing', 'listingId', listingId);
753
+ const localVarPath = `/v1/chains/{chain_name}/listings/{listing_id}`
754
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)))
755
+ .replace(`{${"listing_id"}}`, encodeURIComponent(String(listingId)));
756
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
757
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
758
+ let baseOptions;
759
+ if (configuration) {
760
+ baseOptions = configuration.baseOptions;
761
+ }
762
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
763
+ const localVarHeaderParameter = {};
764
+ const localVarQueryParameter = {};
765
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
766
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
767
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
768
+ return {
769
+ url: toPathString(localVarUrlObj),
770
+ options: localVarRequestOptions,
771
+ };
772
+ },
773
+ /**
774
+ * List all listings
775
+ * @summary List all listings
776
+ * @param {string} chainName
777
+ * @param {OrderStatus} [status] Order status to filter by
778
+ * @param {string} [sellItemContractAddress] Sell item contract address to filter by
779
+ * @param {string} [sellItemTokenId] Sell item token identifier to filter by
780
+ * @param {number} [pageSize] Maximum number of orders to return per page
781
+ * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
782
+ * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
783
+ * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
784
+ * @param {*} [options] Override http request option.
785
+ * @throws {RequiredError}
786
+ */
787
+ listListings: async (chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options = {}) => {
788
+ // verify required parameter 'chainName' is not null or undefined
789
+ assertParamExists('listListings', 'chainName', chainName);
790
+ const localVarPath = `/v1/chains/{chain_name}/listings`
791
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
792
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
793
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
794
+ let baseOptions;
795
+ if (configuration) {
796
+ baseOptions = configuration.baseOptions;
797
+ }
798
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
799
+ const localVarHeaderParameter = {};
800
+ const localVarQueryParameter = {};
801
+ if (status !== undefined) {
802
+ localVarQueryParameter['status'] = status;
803
+ }
804
+ if (sellItemContractAddress !== undefined) {
805
+ localVarQueryParameter['sell_item_contract_address'] = sellItemContractAddress;
806
+ }
807
+ if (sellItemTokenId !== undefined) {
808
+ localVarQueryParameter['sell_item_token_id'] = sellItemTokenId;
809
+ }
810
+ if (pageSize !== undefined) {
811
+ localVarQueryParameter['page_size'] = pageSize;
812
+ }
813
+ if (sortBy !== undefined) {
814
+ localVarQueryParameter['sort_by'] = sortBy;
815
+ }
816
+ if (sortDirection !== undefined) {
817
+ localVarQueryParameter['sort_direction'] = sortDirection;
818
+ }
819
+ if (pageCursor !== undefined) {
820
+ localVarQueryParameter['page_cursor'] = pageCursor;
821
+ }
822
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
823
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
824
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
825
+ return {
826
+ url: toPathString(localVarUrlObj),
827
+ options: localVarRequestOptions,
828
+ };
829
+ },
830
+ };
831
+ };
832
+ /**
833
+ * ListingsApi - functional programming interface
834
+ * @export
835
+ */
836
+ const ListingsApiFp = function (configuration) {
837
+ const localVarAxiosParamCreator = ListingsApiAxiosParamCreator(configuration);
838
+ return {
839
+ /**
840
+ * Create a listing
841
+ * @summary Create a listing
842
+ * @param {string} chainName
843
+ * @param {CreateListingRequestBody} createListingRequestBody
844
+ * @param {*} [options] Override http request option.
845
+ * @throws {RequiredError}
846
+ */
847
+ async createListing(chainName, createListingRequestBody, options) {
848
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createListing(chainName, createListingRequestBody, options);
849
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
850
+ },
851
+ /**
852
+ * Get a single listing by ID
853
+ * @summary Get a single listing by ID
854
+ * @param {string} chainName
855
+ * @param {string} listingId Global Order identifier
856
+ * @param {*} [options] Override http request option.
857
+ * @throws {RequiredError}
858
+ */
859
+ async getListing(chainName, listingId, options) {
860
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getListing(chainName, listingId, options);
861
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
862
+ },
863
+ /**
864
+ * List all listings
865
+ * @summary List all listings
866
+ * @param {string} chainName
867
+ * @param {OrderStatus} [status] Order status to filter by
868
+ * @param {string} [sellItemContractAddress] Sell item contract address to filter by
869
+ * @param {string} [sellItemTokenId] Sell item token identifier to filter by
870
+ * @param {number} [pageSize] Maximum number of orders to return per page
871
+ * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
872
+ * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
873
+ * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
874
+ * @param {*} [options] Override http request option.
875
+ * @throws {RequiredError}
876
+ */
877
+ async listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
878
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options);
879
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
880
+ },
881
+ };
882
+ };
883
+ /**
884
+ * ListingsApi - factory interface
885
+ * @export
886
+ */
887
+ const ListingsApiFactory = function (configuration, basePath, axios) {
888
+ const localVarFp = ListingsApiFp(configuration);
889
+ return {
890
+ /**
891
+ * Create a listing
892
+ * @summary Create a listing
893
+ * @param {string} chainName
894
+ * @param {CreateListingRequestBody} createListingRequestBody
895
+ * @param {*} [options] Override http request option.
896
+ * @throws {RequiredError}
897
+ */
898
+ createListing(chainName, createListingRequestBody, options) {
899
+ return localVarFp.createListing(chainName, createListingRequestBody, options).then((request) => request(axios, basePath));
900
+ },
901
+ /**
902
+ * Get a single listing by ID
903
+ * @summary Get a single listing by ID
904
+ * @param {string} chainName
905
+ * @param {string} listingId Global Order identifier
906
+ * @param {*} [options] Override http request option.
907
+ * @throws {RequiredError}
908
+ */
909
+ getListing(chainName, listingId, options) {
910
+ return localVarFp.getListing(chainName, listingId, options).then((request) => request(axios, basePath));
911
+ },
912
+ /**
913
+ * List all listings
914
+ * @summary List all listings
915
+ * @param {string} chainName
916
+ * @param {OrderStatus} [status] Order status to filter by
917
+ * @param {string} [sellItemContractAddress] Sell item contract address to filter by
918
+ * @param {string} [sellItemTokenId] Sell item token identifier to filter by
919
+ * @param {number} [pageSize] Maximum number of orders to return per page
920
+ * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
921
+ * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
922
+ * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
923
+ * @param {*} [options] Override http request option.
924
+ * @throws {RequiredError}
925
+ */
926
+ listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
927
+ return localVarFp.listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options).then((request) => request(axios, basePath));
928
+ },
929
+ };
930
+ };
931
+ /**
932
+ * ListingsApi - object-oriented interface
933
+ * @export
934
+ * @class ListingsApi
935
+ * @extends {BaseAPI}
936
+ */
937
+ class ListingsApi extends BaseAPI {
938
+ /**
939
+ * Create a listing
940
+ * @summary Create a listing
941
+ * @param {ListingsApiCreateListingRequest} requestParameters Request parameters.
942
+ * @param {*} [options] Override http request option.
943
+ * @throws {RequiredError}
944
+ * @memberof ListingsApi
945
+ */
946
+ createListing(requestParameters, options) {
947
+ return ListingsApiFp(this.configuration).createListing(requestParameters.chainName, requestParameters.createListingRequestBody, options).then((request) => request(this.axios, this.basePath));
948
+ }
949
+ /**
950
+ * Get a single listing by ID
951
+ * @summary Get a single listing by ID
952
+ * @param {ListingsApiGetListingRequest} requestParameters Request parameters.
953
+ * @param {*} [options] Override http request option.
954
+ * @throws {RequiredError}
955
+ * @memberof ListingsApi
956
+ */
957
+ getListing(requestParameters, options) {
958
+ return ListingsApiFp(this.configuration).getListing(requestParameters.chainName, requestParameters.listingId, options).then((request) => request(this.axios, this.basePath));
959
+ }
960
+ /**
961
+ * List all listings
962
+ * @summary List all listings
963
+ * @param {ListingsApiListListingsRequest} requestParameters Request parameters.
964
+ * @param {*} [options] Override http request option.
965
+ * @throws {RequiredError}
966
+ * @memberof ListingsApi
967
+ */
968
+ listListings(requestParameters, options) {
969
+ return ListingsApiFp(this.configuration).listListings(requestParameters.chainName, requestParameters.status, requestParameters.sellItemContractAddress, requestParameters.sellItemTokenId, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(this.axios, this.basePath));
970
+ }
971
+ }
972
+
973
+ /* tslint:disable */
974
+ /* eslint-disable */
975
+ /**
976
+ * Immutable X API
977
+ * Immutable Multi Rollup API
978
+ *
979
+ * The version of the OpenAPI document: 1.0.0
980
+ * Contact: support@immutable.com
981
+ *
982
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
983
+ * https://openapi-generator.tech
984
+ * Do not edit the class manually.
985
+ */
986
+ /**
987
+ * NftOwnersApi - axios parameter creator
988
+ * @export
989
+ */
990
+ const NftOwnersApiAxiosParamCreator = function (configuration) {
991
+ return {
992
+ /**
993
+ * List NFT owners by token ID
994
+ * @summary List NFT owners by token ID
995
+ * @param {string} contractAddress The address of contract
996
+ * @param {string} tokenId An `uint256` token id as string
997
+ * @param {string} chainName The name of chain
998
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
999
+ * @param {number} [pageSize] Maximum number of items to return
1000
+ * @param {*} [options] Override http request option.
1001
+ * @throws {RequiredError}
1002
+ */
1003
+ listNFTOwners: async (contractAddress, tokenId, chainName, pageCursor, pageSize, options = {}) => {
1004
+ // verify required parameter 'contractAddress' is not null or undefined
1005
+ assertParamExists('listNFTOwners', 'contractAddress', contractAddress);
1006
+ // verify required parameter 'tokenId' is not null or undefined
1007
+ assertParamExists('listNFTOwners', 'tokenId', tokenId);
1008
+ // verify required parameter 'chainName' is not null or undefined
1009
+ assertParamExists('listNFTOwners', 'chainName', chainName);
1010
+ const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners`
1011
+ .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
1012
+ .replace(`{${"token_id"}}`, encodeURIComponent(String(tokenId)))
1013
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1014
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1015
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1016
+ let baseOptions;
1017
+ if (configuration) {
1018
+ baseOptions = configuration.baseOptions;
1019
+ }
1020
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1021
+ const localVarHeaderParameter = {};
1022
+ const localVarQueryParameter = {};
1023
+ if (pageCursor !== undefined) {
1024
+ localVarQueryParameter['page_cursor'] = pageCursor;
1025
+ }
1026
+ if (pageSize !== undefined) {
1027
+ localVarQueryParameter['page_size'] = pageSize;
1028
+ }
1029
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1030
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1031
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1032
+ return {
1033
+ url: toPathString(localVarUrlObj),
1034
+ options: localVarRequestOptions,
1035
+ };
1036
+ },
1037
+ };
1038
+ };
1039
+ /**
1040
+ * NftOwnersApi - functional programming interface
1041
+ * @export
1042
+ */
1043
+ const NftOwnersApiFp = function (configuration) {
1044
+ const localVarAxiosParamCreator = NftOwnersApiAxiosParamCreator(configuration);
1045
+ return {
1046
+ /**
1047
+ * List NFT owners by token ID
1048
+ * @summary List NFT owners by token ID
1049
+ * @param {string} contractAddress The address of contract
1050
+ * @param {string} tokenId An `uint256` token id as string
1051
+ * @param {string} chainName The name of chain
1052
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1053
+ * @param {number} [pageSize] Maximum number of items to return
1054
+ * @param {*} [options] Override http request option.
1055
+ * @throws {RequiredError}
1056
+ */
1057
+ async listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options) {
1058
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options);
1059
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1060
+ },
1061
+ };
1062
+ };
1063
+ /**
1064
+ * NftOwnersApi - factory interface
1065
+ * @export
1066
+ */
1067
+ const NftOwnersApiFactory = function (configuration, basePath, axios) {
1068
+ const localVarFp = NftOwnersApiFp(configuration);
1069
+ return {
1070
+ /**
1071
+ * List NFT owners by token ID
1072
+ * @summary List NFT owners by token ID
1073
+ * @param {string} contractAddress The address of contract
1074
+ * @param {string} tokenId An `uint256` token id as string
1075
+ * @param {string} chainName The name of chain
1076
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1077
+ * @param {number} [pageSize] Maximum number of items to return
1078
+ * @param {*} [options] Override http request option.
1079
+ * @throws {RequiredError}
1080
+ */
1081
+ listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options) {
1082
+ return localVarFp.listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
1083
+ },
1084
+ };
1085
+ };
1086
+ /**
1087
+ * NftOwnersApi - object-oriented interface
1088
+ * @export
1089
+ * @class NftOwnersApi
1090
+ * @extends {BaseAPI}
1091
+ */
1092
+ class NftOwnersApi extends BaseAPI {
1093
+ /**
1094
+ * List NFT owners by token ID
1095
+ * @summary List NFT owners by token ID
1096
+ * @param {NftOwnersApiListNFTOwnersRequest} requestParameters Request parameters.
1097
+ * @param {*} [options] Override http request option.
1098
+ * @throws {RequiredError}
1099
+ * @memberof NftOwnersApi
1100
+ */
1101
+ listNFTOwners(requestParameters, options) {
1102
+ return NftOwnersApiFp(this.configuration).listNFTOwners(requestParameters.contractAddress, requestParameters.tokenId, requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
1103
+ }
1104
+ }
1105
+
1106
+ /* tslint:disable */
1107
+ /* eslint-disable */
1108
+ /**
1109
+ * Immutable X API
1110
+ * Immutable Multi Rollup API
1111
+ *
1112
+ * The version of the OpenAPI document: 1.0.0
1113
+ * Contact: support@immutable.com
1114
+ *
1115
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1116
+ * https://openapi-generator.tech
1117
+ * Do not edit the class manually.
1118
+ */
1119
+ /**
1120
+ * NftsApi - axios parameter creator
1121
+ * @export
1122
+ */
1123
+ const NftsApiAxiosParamCreator = function (configuration) {
1124
+ return {
1125
+ /**
1126
+ * Get NFT by token ID
1127
+ * @summary Get NFT by token ID
1128
+ * @param {string} contractAddress The address of NFT contract
1129
+ * @param {string} tokenId An `uint256` token id as string
1130
+ * @param {string} chainName The name of chain
1131
+ * @param {*} [options] Override http request option.
1132
+ * @throws {RequiredError}
1133
+ */
1134
+ getNFT: async (contractAddress, tokenId, chainName, options = {}) => {
1135
+ // verify required parameter 'contractAddress' is not null or undefined
1136
+ assertParamExists('getNFT', 'contractAddress', contractAddress);
1137
+ // verify required parameter 'tokenId' is not null or undefined
1138
+ assertParamExists('getNFT', 'tokenId', tokenId);
1139
+ // verify required parameter 'chainName' is not null or undefined
1140
+ assertParamExists('getNFT', 'chainName', chainName);
1141
+ const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}`
1142
+ .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
1143
+ .replace(`{${"token_id"}}`, encodeURIComponent(String(tokenId)))
1144
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1145
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1146
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1147
+ let baseOptions;
1148
+ if (configuration) {
1149
+ baseOptions = configuration.baseOptions;
1150
+ }
1151
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1152
+ const localVarHeaderParameter = {};
1153
+ const localVarQueryParameter = {};
1154
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1155
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1156
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1157
+ return {
1158
+ url: toPathString(localVarUrlObj),
1159
+ options: localVarRequestOptions,
1160
+ };
1161
+ },
1162
+ /**
1163
+ * List NFTs by contract address
1164
+ * @summary List NFTs by contract address
1165
+ * @param {string} contractAddress Contract address
1166
+ * @param {string} chainName The name of chain
1167
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1168
+ * @param {number} [pageSize] Maximum number of items to return
1169
+ * @param {*} [options] Override http request option.
1170
+ * @throws {RequiredError}
1171
+ */
1172
+ listNFTs: async (contractAddress, chainName, pageCursor, pageSize, options = {}) => {
1173
+ // verify required parameter 'contractAddress' is not null or undefined
1174
+ assertParamExists('listNFTs', 'contractAddress', contractAddress);
1175
+ // verify required parameter 'chainName' is not null or undefined
1176
+ assertParamExists('listNFTs', 'chainName', chainName);
1177
+ const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts`
1178
+ .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
1179
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1180
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1181
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1182
+ let baseOptions;
1183
+ if (configuration) {
1184
+ baseOptions = configuration.baseOptions;
1185
+ }
1186
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1187
+ const localVarHeaderParameter = {};
1188
+ const localVarQueryParameter = {};
1189
+ if (pageCursor !== undefined) {
1190
+ localVarQueryParameter['page_cursor'] = pageCursor;
1191
+ }
1192
+ if (pageSize !== undefined) {
1193
+ localVarQueryParameter['page_size'] = pageSize;
1194
+ }
1195
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1196
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1197
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1198
+ return {
1199
+ url: toPathString(localVarUrlObj),
1200
+ options: localVarRequestOptions,
1201
+ };
1202
+ },
1203
+ /**
1204
+ * List NFTs by account address
1205
+ * @summary List NFTs by account address
1206
+ * @param {string} accountAddress Account address
1207
+ * @param {string} chainName The name of chain
1208
+ * @param {string} [contractAddress] The address of contract
1209
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1210
+ * @param {number} [pageSize] Maximum number of items to return
1211
+ * @param {*} [options] Override http request option.
1212
+ * @throws {RequiredError}
1213
+ */
1214
+ listNFTsByAccountAddress: async (accountAddress, chainName, contractAddress, pageCursor, pageSize, options = {}) => {
1215
+ // verify required parameter 'accountAddress' is not null or undefined
1216
+ assertParamExists('listNFTsByAccountAddress', 'accountAddress', accountAddress);
1217
+ // verify required parameter 'chainName' is not null or undefined
1218
+ assertParamExists('listNFTsByAccountAddress', 'chainName', chainName);
1219
+ const localVarPath = `/v1/chains/{chain_name}/accounts/{account_address}/nfts`
1220
+ .replace(`{${"account_address"}}`, encodeURIComponent(String(accountAddress)))
1221
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1222
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1223
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1224
+ let baseOptions;
1225
+ if (configuration) {
1226
+ baseOptions = configuration.baseOptions;
1227
+ }
1228
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1229
+ const localVarHeaderParameter = {};
1230
+ const localVarQueryParameter = {};
1231
+ if (contractAddress !== undefined) {
1232
+ localVarQueryParameter['contract_address'] = contractAddress;
1233
+ }
1234
+ if (pageCursor !== undefined) {
1235
+ localVarQueryParameter['page_cursor'] = pageCursor;
1236
+ }
1237
+ if (pageSize !== undefined) {
1238
+ localVarQueryParameter['page_size'] = pageSize;
1239
+ }
1240
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1241
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1242
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1243
+ return {
1244
+ url: toPathString(localVarUrlObj),
1245
+ options: localVarRequestOptions,
1246
+ };
1247
+ },
1248
+ };
1249
+ };
1250
+ /**
1251
+ * NftsApi - functional programming interface
1252
+ * @export
1253
+ */
1254
+ const NftsApiFp = function (configuration) {
1255
+ const localVarAxiosParamCreator = NftsApiAxiosParamCreator(configuration);
1256
+ return {
1257
+ /**
1258
+ * Get NFT by token ID
1259
+ * @summary Get NFT by token ID
1260
+ * @param {string} contractAddress The address of NFT contract
1261
+ * @param {string} tokenId An `uint256` token id as string
1262
+ * @param {string} chainName The name of chain
1263
+ * @param {*} [options] Override http request option.
1264
+ * @throws {RequiredError}
1265
+ */
1266
+ async getNFT(contractAddress, tokenId, chainName, options) {
1267
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getNFT(contractAddress, tokenId, chainName, options);
1268
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1269
+ },
1270
+ /**
1271
+ * List NFTs by contract address
1272
+ * @summary List NFTs by contract address
1273
+ * @param {string} contractAddress Contract address
1274
+ * @param {string} chainName The name of chain
1275
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1276
+ * @param {number} [pageSize] Maximum number of items to return
1277
+ * @param {*} [options] Override http request option.
1278
+ * @throws {RequiredError}
1279
+ */
1280
+ async listNFTs(contractAddress, chainName, pageCursor, pageSize, options) {
1281
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTs(contractAddress, chainName, pageCursor, pageSize, options);
1282
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1283
+ },
1284
+ /**
1285
+ * List NFTs by account address
1286
+ * @summary List NFTs by account address
1287
+ * @param {string} accountAddress Account address
1288
+ * @param {string} chainName The name of chain
1289
+ * @param {string} [contractAddress] The address of contract
1290
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1291
+ * @param {number} [pageSize] Maximum number of items to return
1292
+ * @param {*} [options] Override http request option.
1293
+ * @throws {RequiredError}
1294
+ */
1295
+ async listNFTsByAccountAddress(accountAddress, chainName, contractAddress, pageCursor, pageSize, options) {
1296
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTsByAccountAddress(accountAddress, chainName, contractAddress, pageCursor, pageSize, options);
1297
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1298
+ },
1299
+ };
1300
+ };
1301
+ /**
1302
+ * NftsApi - factory interface
1303
+ * @export
1304
+ */
1305
+ const NftsApiFactory = function (configuration, basePath, axios) {
1306
+ const localVarFp = NftsApiFp(configuration);
1307
+ return {
1308
+ /**
1309
+ * Get NFT by token ID
1310
+ * @summary Get NFT by token ID
1311
+ * @param {string} contractAddress The address of NFT contract
1312
+ * @param {string} tokenId An `uint256` token id as string
1313
+ * @param {string} chainName The name of chain
1314
+ * @param {*} [options] Override http request option.
1315
+ * @throws {RequiredError}
1316
+ */
1317
+ getNFT(contractAddress, tokenId, chainName, options) {
1318
+ return localVarFp.getNFT(contractAddress, tokenId, chainName, options).then((request) => request(axios, basePath));
1319
+ },
1320
+ /**
1321
+ * List NFTs by contract address
1322
+ * @summary List NFTs by contract address
1323
+ * @param {string} contractAddress Contract address
1324
+ * @param {string} chainName The name of chain
1325
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1326
+ * @param {number} [pageSize] Maximum number of items to return
1327
+ * @param {*} [options] Override http request option.
1328
+ * @throws {RequiredError}
1329
+ */
1330
+ listNFTs(contractAddress, chainName, pageCursor, pageSize, options) {
1331
+ return localVarFp.listNFTs(contractAddress, chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
1332
+ },
1333
+ /**
1334
+ * List NFTs by account address
1335
+ * @summary List NFTs by account address
1336
+ * @param {string} accountAddress Account address
1337
+ * @param {string} chainName The name of chain
1338
+ * @param {string} [contractAddress] The address of contract
1339
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1340
+ * @param {number} [pageSize] Maximum number of items to return
1341
+ * @param {*} [options] Override http request option.
1342
+ * @throws {RequiredError}
1343
+ */
1344
+ listNFTsByAccountAddress(accountAddress, chainName, contractAddress, pageCursor, pageSize, options) {
1345
+ return localVarFp.listNFTsByAccountAddress(accountAddress, chainName, contractAddress, pageCursor, pageSize, options).then((request) => request(axios, basePath));
1346
+ },
1347
+ };
1348
+ };
1349
+ /**
1350
+ * NftsApi - object-oriented interface
1351
+ * @export
1352
+ * @class NftsApi
1353
+ * @extends {BaseAPI}
1354
+ */
1355
+ class NftsApi extends BaseAPI {
1356
+ /**
1357
+ * Get NFT by token ID
1358
+ * @summary Get NFT by token ID
1359
+ * @param {NftsApiGetNFTRequest} requestParameters Request parameters.
1360
+ * @param {*} [options] Override http request option.
1361
+ * @throws {RequiredError}
1362
+ * @memberof NftsApi
1363
+ */
1364
+ getNFT(requestParameters, options) {
1365
+ return NftsApiFp(this.configuration).getNFT(requestParameters.contractAddress, requestParameters.tokenId, requestParameters.chainName, options).then((request) => request(this.axios, this.basePath));
1366
+ }
1367
+ /**
1368
+ * List NFTs by contract address
1369
+ * @summary List NFTs by contract address
1370
+ * @param {NftsApiListNFTsRequest} requestParameters Request parameters.
1371
+ * @param {*} [options] Override http request option.
1372
+ * @throws {RequiredError}
1373
+ * @memberof NftsApi
1374
+ */
1375
+ listNFTs(requestParameters, options) {
1376
+ return NftsApiFp(this.configuration).listNFTs(requestParameters.contractAddress, requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
1377
+ }
1378
+ /**
1379
+ * List NFTs by account address
1380
+ * @summary List NFTs by account address
1381
+ * @param {NftsApiListNFTsByAccountAddressRequest} requestParameters Request parameters.
1382
+ * @param {*} [options] Override http request option.
1383
+ * @throws {RequiredError}
1384
+ * @memberof NftsApi
1385
+ */
1386
+ listNFTsByAccountAddress(requestParameters, options) {
1387
+ return NftsApiFp(this.configuration).listNFTsByAccountAddress(requestParameters.accountAddress, requestParameters.chainName, requestParameters.contractAddress, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
1388
+ }
1389
+ }
1390
+
1391
+ /* tslint:disable */
1392
+ /* eslint-disable */
1393
+ /**
1394
+ * Immutable X API
1395
+ * Immutable Multi Rollup API
1396
+ *
1397
+ * The version of the OpenAPI document: 1.0.0
1398
+ * Contact: support@immutable.com
1399
+ *
1400
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1401
+ * https://openapi-generator.tech
1402
+ * Do not edit the class manually.
1403
+ */
1404
+ /**
1405
+ * OrdersApi - axios parameter creator
1406
+ * @export
1407
+ */
1408
+ const OrdersApiAxiosParamCreator = function (configuration) {
1409
+ return {
1410
+ /**
1411
+ * Create a listing
1412
+ * @summary Create a listing
1413
+ * @param {string} chainName
1414
+ * @param {CreateListingRequestBody} createListingRequestBody
1415
+ * @param {*} [options] Override http request option.
1416
+ * @throws {RequiredError}
1417
+ */
1418
+ createListing: async (chainName, createListingRequestBody, options = {}) => {
1419
+ // verify required parameter 'chainName' is not null or undefined
1420
+ assertParamExists('createListing', 'chainName', chainName);
1421
+ // verify required parameter 'createListingRequestBody' is not null or undefined
1422
+ assertParamExists('createListing', 'createListingRequestBody', createListingRequestBody);
1423
+ const localVarPath = `/v1/chains/{chain_name}/listings`
1424
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1425
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1426
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1427
+ let baseOptions;
1428
+ if (configuration) {
1429
+ baseOptions = configuration.baseOptions;
1430
+ }
1431
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1432
+ const localVarHeaderParameter = {};
1433
+ const localVarQueryParameter = {};
1434
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1435
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1436
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1437
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1438
+ localVarRequestOptions.data = serializeDataIfNeeded(createListingRequestBody, localVarRequestOptions, configuration);
1439
+ return {
1440
+ url: toPathString(localVarUrlObj),
1441
+ options: localVarRequestOptions,
1442
+ };
1443
+ },
1444
+ /**
1445
+ * Get a single listing by ID
1446
+ * @summary Get a single listing by ID
1447
+ * @param {string} chainName
1448
+ * @param {string} listingId Global Order identifier
1449
+ * @param {*} [options] Override http request option.
1450
+ * @throws {RequiredError}
1451
+ */
1452
+ getListing: async (chainName, listingId, options = {}) => {
1453
+ // verify required parameter 'chainName' is not null or undefined
1454
+ assertParamExists('getListing', 'chainName', chainName);
1455
+ // verify required parameter 'listingId' is not null or undefined
1456
+ assertParamExists('getListing', 'listingId', listingId);
1457
+ const localVarPath = `/v1/chains/{chain_name}/listings/{listing_id}`
1458
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)))
1459
+ .replace(`{${"listing_id"}}`, encodeURIComponent(String(listingId)));
1460
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1461
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1462
+ let baseOptions;
1463
+ if (configuration) {
1464
+ baseOptions = configuration.baseOptions;
1465
+ }
1466
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1467
+ const localVarHeaderParameter = {};
1468
+ const localVarQueryParameter = {};
1469
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1470
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1471
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1472
+ return {
1473
+ url: toPathString(localVarUrlObj),
1474
+ options: localVarRequestOptions,
1475
+ };
1476
+ },
1477
+ /**
1478
+ * List all listings
1479
+ * @summary List all listings
1480
+ * @param {string} chainName
1481
+ * @param {OrderStatus} [status] Order status to filter by
1482
+ * @param {string} [sellItemContractAddress] Sell item contract address to filter by
1483
+ * @param {string} [sellItemTokenId] Sell item token identifier to filter by
1484
+ * @param {number} [pageSize] Maximum number of orders to return per page
1485
+ * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
1486
+ * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
1487
+ * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
1488
+ * @param {*} [options] Override http request option.
1489
+ * @throws {RequiredError}
1490
+ */
1491
+ listListings: async (chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options = {}) => {
1492
+ // verify required parameter 'chainName' is not null or undefined
1493
+ assertParamExists('listListings', 'chainName', chainName);
1494
+ const localVarPath = `/v1/chains/{chain_name}/listings`
1495
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1496
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1497
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1498
+ let baseOptions;
1499
+ if (configuration) {
1500
+ baseOptions = configuration.baseOptions;
1501
+ }
1502
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1503
+ const localVarHeaderParameter = {};
1504
+ const localVarQueryParameter = {};
1505
+ if (status !== undefined) {
1506
+ localVarQueryParameter['status'] = status;
1507
+ }
1508
+ if (sellItemContractAddress !== undefined) {
1509
+ localVarQueryParameter['sell_item_contract_address'] = sellItemContractAddress;
1510
+ }
1511
+ if (sellItemTokenId !== undefined) {
1512
+ localVarQueryParameter['sell_item_token_id'] = sellItemTokenId;
1513
+ }
1514
+ if (pageSize !== undefined) {
1515
+ localVarQueryParameter['page_size'] = pageSize;
1516
+ }
1517
+ if (sortBy !== undefined) {
1518
+ localVarQueryParameter['sort_by'] = sortBy;
1519
+ }
1520
+ if (sortDirection !== undefined) {
1521
+ localVarQueryParameter['sort_direction'] = sortDirection;
1522
+ }
1523
+ if (pageCursor !== undefined) {
1524
+ localVarQueryParameter['page_cursor'] = pageCursor;
1525
+ }
1526
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1527
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1528
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1529
+ return {
1530
+ url: toPathString(localVarUrlObj),
1531
+ options: localVarRequestOptions,
1532
+ };
1533
+ },
1534
+ };
1535
+ };
1536
+ /**
1537
+ * OrdersApi - functional programming interface
1538
+ * @export
1539
+ */
1540
+ const OrdersApiFp = function (configuration) {
1541
+ const localVarAxiosParamCreator = OrdersApiAxiosParamCreator(configuration);
1542
+ return {
1543
+ /**
1544
+ * Create a listing
1545
+ * @summary Create a listing
1546
+ * @param {string} chainName
1547
+ * @param {CreateListingRequestBody} createListingRequestBody
1548
+ * @param {*} [options] Override http request option.
1549
+ * @throws {RequiredError}
1550
+ */
1551
+ async createListing(chainName, createListingRequestBody, options) {
1552
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createListing(chainName, createListingRequestBody, options);
1553
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1554
+ },
1555
+ /**
1556
+ * Get a single listing by ID
1557
+ * @summary Get a single listing by ID
1558
+ * @param {string} chainName
1559
+ * @param {string} listingId Global Order identifier
1560
+ * @param {*} [options] Override http request option.
1561
+ * @throws {RequiredError}
1562
+ */
1563
+ async getListing(chainName, listingId, options) {
1564
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getListing(chainName, listingId, options);
1565
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1566
+ },
1567
+ /**
1568
+ * List all listings
1569
+ * @summary List all listings
1570
+ * @param {string} chainName
1571
+ * @param {OrderStatus} [status] Order status to filter by
1572
+ * @param {string} [sellItemContractAddress] Sell item contract address to filter by
1573
+ * @param {string} [sellItemTokenId] Sell item token identifier to filter by
1574
+ * @param {number} [pageSize] Maximum number of orders to return per page
1575
+ * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
1576
+ * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
1577
+ * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
1578
+ * @param {*} [options] Override http request option.
1579
+ * @throws {RequiredError}
1580
+ */
1581
+ async listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
1582
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options);
1583
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1584
+ },
1585
+ };
1586
+ };
1587
+ /**
1588
+ * OrdersApi - factory interface
1589
+ * @export
1590
+ */
1591
+ const OrdersApiFactory = function (configuration, basePath, axios) {
1592
+ const localVarFp = OrdersApiFp(configuration);
1593
+ return {
1594
+ /**
1595
+ * Create a listing
1596
+ * @summary Create a listing
1597
+ * @param {string} chainName
1598
+ * @param {CreateListingRequestBody} createListingRequestBody
1599
+ * @param {*} [options] Override http request option.
1600
+ * @throws {RequiredError}
1601
+ */
1602
+ createListing(chainName, createListingRequestBody, options) {
1603
+ return localVarFp.createListing(chainName, createListingRequestBody, options).then((request) => request(axios, basePath));
1604
+ },
1605
+ /**
1606
+ * Get a single listing by ID
1607
+ * @summary Get a single listing by ID
1608
+ * @param {string} chainName
1609
+ * @param {string} listingId Global Order identifier
1610
+ * @param {*} [options] Override http request option.
1611
+ * @throws {RequiredError}
1612
+ */
1613
+ getListing(chainName, listingId, options) {
1614
+ return localVarFp.getListing(chainName, listingId, options).then((request) => request(axios, basePath));
1615
+ },
1616
+ /**
1617
+ * List all listings
1618
+ * @summary List all listings
1619
+ * @param {string} chainName
1620
+ * @param {OrderStatus} [status] Order status to filter by
1621
+ * @param {string} [sellItemContractAddress] Sell item contract address to filter by
1622
+ * @param {string} [sellItemTokenId] Sell item token identifier to filter by
1623
+ * @param {number} [pageSize] Maximum number of orders to return per page
1624
+ * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
1625
+ * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
1626
+ * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
1627
+ * @param {*} [options] Override http request option.
1628
+ * @throws {RequiredError}
1629
+ */
1630
+ listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
1631
+ return localVarFp.listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options).then((request) => request(axios, basePath));
1632
+ },
1633
+ };
1634
+ };
1635
+ /**
1636
+ * OrdersApi - object-oriented interface
1637
+ * @export
1638
+ * @class OrdersApi
1639
+ * @extends {BaseAPI}
1640
+ */
1641
+ class OrdersApi extends BaseAPI {
1642
+ /**
1643
+ * Create a listing
1644
+ * @summary Create a listing
1645
+ * @param {OrdersApiCreateListingRequest} requestParameters Request parameters.
1646
+ * @param {*} [options] Override http request option.
1647
+ * @throws {RequiredError}
1648
+ * @memberof OrdersApi
1649
+ */
1650
+ createListing(requestParameters, options) {
1651
+ return OrdersApiFp(this.configuration).createListing(requestParameters.chainName, requestParameters.createListingRequestBody, options).then((request) => request(this.axios, this.basePath));
1652
+ }
1653
+ /**
1654
+ * Get a single listing by ID
1655
+ * @summary Get a single listing by ID
1656
+ * @param {OrdersApiGetListingRequest} requestParameters Request parameters.
1657
+ * @param {*} [options] Override http request option.
1658
+ * @throws {RequiredError}
1659
+ * @memberof OrdersApi
1660
+ */
1661
+ getListing(requestParameters, options) {
1662
+ return OrdersApiFp(this.configuration).getListing(requestParameters.chainName, requestParameters.listingId, options).then((request) => request(this.axios, this.basePath));
1663
+ }
1664
+ /**
1665
+ * List all listings
1666
+ * @summary List all listings
1667
+ * @param {OrdersApiListListingsRequest} requestParameters Request parameters.
1668
+ * @param {*} [options] Override http request option.
1669
+ * @throws {RequiredError}
1670
+ * @memberof OrdersApi
1671
+ */
1672
+ listListings(requestParameters, options) {
1673
+ return OrdersApiFp(this.configuration).listListings(requestParameters.chainName, requestParameters.status, requestParameters.sellItemContractAddress, requestParameters.sellItemTokenId, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(this.axios, this.basePath));
1674
+ }
1675
+ }
1676
+
1677
+ /* tslint:disable */
1678
+ /* eslint-disable */
1679
+ /**
1680
+ * Immutable X API
1681
+ * Immutable Multi Rollup API
1682
+ *
1683
+ * The version of the OpenAPI document: 1.0.0
1684
+ * Contact: support@immutable.com
1685
+ *
1686
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1687
+ * https://openapi-generator.tech
1688
+ * Do not edit the class manually.
1689
+ */
1690
+ /**
1691
+ * PassportApi - axios parameter creator
1692
+ * @export
1693
+ */
1694
+ const PassportApiAxiosParamCreator = function (configuration) {
1695
+ return {
1696
+ /**
1697
+ * Create a counterfactual address for a user based on their Ethereum address
1698
+ * @summary Create a counterfactual address
1699
+ * @param {CreateCounterfactualAddressRequest} createCounterfactualAddressRequest
1700
+ * @param {*} [options] Override http request option.
1701
+ * @throws {RequiredError}
1702
+ */
1703
+ createCounterfactualAddress: async (createCounterfactualAddressRequest, options = {}) => {
1704
+ // verify required parameter 'createCounterfactualAddressRequest' is not null or undefined
1705
+ assertParamExists('createCounterfactualAddress', 'createCounterfactualAddressRequest', createCounterfactualAddressRequest);
1706
+ const localVarPath = `/v1/counterfactual-address`;
1707
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1708
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1709
+ let baseOptions;
1710
+ if (configuration) {
1711
+ baseOptions = configuration.baseOptions;
1712
+ }
1713
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1714
+ const localVarHeaderParameter = {};
1715
+ const localVarQueryParameter = {};
1716
+ // authentication BearerAuth required
1717
+ // http bearer authentication required
1718
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1719
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1720
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1721
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1722
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1723
+ localVarRequestOptions.data = serializeDataIfNeeded(createCounterfactualAddressRequest, localVarRequestOptions, configuration);
1724
+ return {
1725
+ url: toPathString(localVarUrlObj),
1726
+ options: localVarRequestOptions,
1727
+ };
1728
+ },
1729
+ };
1730
+ };
1731
+ /**
1732
+ * PassportApi - functional programming interface
1733
+ * @export
1734
+ */
1735
+ const PassportApiFp = function (configuration) {
1736
+ const localVarAxiosParamCreator = PassportApiAxiosParamCreator(configuration);
1737
+ return {
1738
+ /**
1739
+ * Create a counterfactual address for a user based on their Ethereum address
1740
+ * @summary Create a counterfactual address
1741
+ * @param {CreateCounterfactualAddressRequest} createCounterfactualAddressRequest
1742
+ * @param {*} [options] Override http request option.
1743
+ * @throws {RequiredError}
1744
+ */
1745
+ async createCounterfactualAddress(createCounterfactualAddressRequest, options) {
1746
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createCounterfactualAddress(createCounterfactualAddressRequest, options);
1747
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1748
+ },
1749
+ };
1750
+ };
1751
+ /**
1752
+ * PassportApi - factory interface
1753
+ * @export
1754
+ */
1755
+ const PassportApiFactory = function (configuration, basePath, axios) {
1756
+ const localVarFp = PassportApiFp(configuration);
1757
+ return {
1758
+ /**
1759
+ * Create a counterfactual address for a user based on their Ethereum address
1760
+ * @summary Create a counterfactual address
1761
+ * @param {CreateCounterfactualAddressRequest} createCounterfactualAddressRequest
1762
+ * @param {*} [options] Override http request option.
1763
+ * @throws {RequiredError}
1764
+ */
1765
+ createCounterfactualAddress(createCounterfactualAddressRequest, options) {
1766
+ return localVarFp.createCounterfactualAddress(createCounterfactualAddressRequest, options).then((request) => request(axios, basePath));
1767
+ },
1768
+ };
1769
+ };
1770
+ /**
1771
+ * PassportApi - object-oriented interface
1772
+ * @export
1773
+ * @class PassportApi
1774
+ * @extends {BaseAPI}
1775
+ */
1776
+ class PassportApi extends BaseAPI {
1777
+ /**
1778
+ * Create a counterfactual address for a user based on their Ethereum address
1779
+ * @summary Create a counterfactual address
1780
+ * @param {PassportApiCreateCounterfactualAddressRequest} requestParameters Request parameters.
1781
+ * @param {*} [options] Override http request option.
1782
+ * @throws {RequiredError}
1783
+ * @memberof PassportApi
1784
+ */
1785
+ createCounterfactualAddress(requestParameters, options) {
1786
+ return PassportApiFp(this.configuration).createCounterfactualAddress(requestParameters.createCounterfactualAddressRequest, options).then((request) => request(this.axios, this.basePath));
1787
+ }
1788
+ }
1789
+
1790
+ /* tslint:disable */
1791
+ /* eslint-disable */
1792
+ /**
1793
+ * Immutable X API
1794
+ * Immutable Multi Rollup API
1795
+ *
1796
+ * The version of the OpenAPI document: 1.0.0
1797
+ * Contact: support@immutable.com
1798
+ *
1799
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1800
+ * https://openapi-generator.tech
1801
+ * Do not edit the class manually.
1802
+ */
1803
+ /**
1804
+ * TokensApi - axios parameter creator
1805
+ * @export
1806
+ */
1807
+ const TokensApiAxiosParamCreator = function (configuration) {
1808
+ return {
1809
+ /**
1810
+ * Get single ERC20 token
1811
+ * @summary Get single ERC20 token
1812
+ * @param {string} contractAddress The address of contract
1813
+ * @param {string} chainName The name of chain
1814
+ * @param {*} [options] Override http request option.
1815
+ * @throws {RequiredError}
1816
+ */
1817
+ getERC20Token: async (contractAddress, chainName, options = {}) => {
1818
+ // verify required parameter 'contractAddress' is not null or undefined
1819
+ assertParamExists('getERC20Token', 'contractAddress', contractAddress);
1820
+ // verify required parameter 'chainName' is not null or undefined
1821
+ assertParamExists('getERC20Token', 'chainName', chainName);
1822
+ const localVarPath = `/v1/chains/{chain_name}/tokens/{contract_address}`
1823
+ .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
1824
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1825
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1826
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1827
+ let baseOptions;
1828
+ if (configuration) {
1829
+ baseOptions = configuration.baseOptions;
1830
+ }
1831
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1832
+ const localVarHeaderParameter = {};
1833
+ const localVarQueryParameter = {};
1834
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1835
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1836
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1837
+ return {
1838
+ url: toPathString(localVarUrlObj),
1839
+ options: localVarRequestOptions,
1840
+ };
1841
+ },
1842
+ /**
1843
+ * List ERC20 tokens
1844
+ * @summary List ERC20 tokens
1845
+ * @param {string} chainName The name of chain
1846
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1847
+ * @param {number} [pageSize] Maximum number of items to return
1848
+ * @param {*} [options] Override http request option.
1849
+ * @throws {RequiredError}
1850
+ */
1851
+ listERC20Tokens: async (chainName, pageCursor, pageSize, options = {}) => {
1852
+ // verify required parameter 'chainName' is not null or undefined
1853
+ assertParamExists('listERC20Tokens', 'chainName', chainName);
1854
+ const localVarPath = `/v1/chains/{chain_name}/tokens`
1855
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1856
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1857
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1858
+ let baseOptions;
1859
+ if (configuration) {
1860
+ baseOptions = configuration.baseOptions;
1861
+ }
1862
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1863
+ const localVarHeaderParameter = {};
1864
+ const localVarQueryParameter = {};
1865
+ if (pageCursor !== undefined) {
1866
+ localVarQueryParameter['page_cursor'] = pageCursor;
1867
+ }
1868
+ if (pageSize !== undefined) {
1869
+ localVarQueryParameter['page_size'] = pageSize;
1870
+ }
1871
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1872
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1873
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1874
+ return {
1875
+ url: toPathString(localVarUrlObj),
1876
+ options: localVarRequestOptions,
1877
+ };
1878
+ },
1879
+ };
1880
+ };
1881
+ /**
1882
+ * TokensApi - functional programming interface
1883
+ * @export
1884
+ */
1885
+ const TokensApiFp = function (configuration) {
1886
+ const localVarAxiosParamCreator = TokensApiAxiosParamCreator(configuration);
1887
+ return {
1888
+ /**
1889
+ * Get single ERC20 token
1890
+ * @summary Get single ERC20 token
1891
+ * @param {string} contractAddress The address of contract
1892
+ * @param {string} chainName The name of chain
1893
+ * @param {*} [options] Override http request option.
1894
+ * @throws {RequiredError}
1895
+ */
1896
+ async getERC20Token(contractAddress, chainName, options) {
1897
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getERC20Token(contractAddress, chainName, options);
1898
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1899
+ },
1900
+ /**
1901
+ * List ERC20 tokens
1902
+ * @summary List ERC20 tokens
1903
+ * @param {string} chainName The name of chain
1904
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1905
+ * @param {number} [pageSize] Maximum number of items to return
1906
+ * @param {*} [options] Override http request option.
1907
+ * @throws {RequiredError}
1908
+ */
1909
+ async listERC20Tokens(chainName, pageCursor, pageSize, options) {
1910
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listERC20Tokens(chainName, pageCursor, pageSize, options);
1911
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1912
+ },
1913
+ };
1914
+ };
1915
+ /**
1916
+ * TokensApi - factory interface
1917
+ * @export
1918
+ */
1919
+ const TokensApiFactory = function (configuration, basePath, axios) {
1920
+ const localVarFp = TokensApiFp(configuration);
1921
+ return {
1922
+ /**
1923
+ * Get single ERC20 token
1924
+ * @summary Get single ERC20 token
1925
+ * @param {string} contractAddress The address of contract
1926
+ * @param {string} chainName The name of chain
1927
+ * @param {*} [options] Override http request option.
1928
+ * @throws {RequiredError}
1929
+ */
1930
+ getERC20Token(contractAddress, chainName, options) {
1931
+ return localVarFp.getERC20Token(contractAddress, chainName, options).then((request) => request(axios, basePath));
1932
+ },
1933
+ /**
1934
+ * List ERC20 tokens
1935
+ * @summary List ERC20 tokens
1936
+ * @param {string} chainName The name of chain
1937
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1938
+ * @param {number} [pageSize] Maximum number of items to return
1939
+ * @param {*} [options] Override http request option.
1940
+ * @throws {RequiredError}
1941
+ */
1942
+ listERC20Tokens(chainName, pageCursor, pageSize, options) {
1943
+ return localVarFp.listERC20Tokens(chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
1944
+ },
1945
+ };
1946
+ };
1947
+ /**
1948
+ * TokensApi - object-oriented interface
1949
+ * @export
1950
+ * @class TokensApi
1951
+ * @extends {BaseAPI}
1952
+ */
1953
+ class TokensApi extends BaseAPI {
1954
+ /**
1955
+ * Get single ERC20 token
1956
+ * @summary Get single ERC20 token
1957
+ * @param {TokensApiGetERC20TokenRequest} requestParameters Request parameters.
1958
+ * @param {*} [options] Override http request option.
1959
+ * @throws {RequiredError}
1960
+ * @memberof TokensApi
1961
+ */
1962
+ getERC20Token(requestParameters, options) {
1963
+ return TokensApiFp(this.configuration).getERC20Token(requestParameters.contractAddress, requestParameters.chainName, options).then((request) => request(this.axios, this.basePath));
1964
+ }
1965
+ /**
1966
+ * List ERC20 tokens
1967
+ * @summary List ERC20 tokens
1968
+ * @param {TokensApiListERC20TokensRequest} requestParameters Request parameters.
1969
+ * @param {*} [options] Override http request option.
1970
+ * @throws {RequiredError}
1971
+ * @memberof TokensApi
1972
+ */
1973
+ listERC20Tokens(requestParameters, options) {
1974
+ return TokensApiFp(this.configuration).listERC20Tokens(requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
1975
+ }
1976
+ }
1977
+
1978
+ /* tslint:disable */
1979
+ /* eslint-disable */
1980
+ /**
1981
+ * Immutable X API
1982
+ * Immutable Multi Rollup API
1983
+ *
1984
+ * The version of the OpenAPI document: 1.0.0
1985
+ * Contact: support@immutable.com
1986
+ *
1987
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1988
+ * https://openapi-generator.tech
1989
+ * Do not edit the class manually.
1990
+ */
1991
+ class Configuration {
1992
+ /**
1993
+ * parameter for apiKey security
1994
+ * @param name security name
1995
+ * @memberof Configuration
1996
+ */
1997
+ apiKey;
1998
+ /**
1999
+ * parameter for basic security
2000
+ *
2001
+ * @type {string}
2002
+ * @memberof Configuration
2003
+ */
2004
+ username;
2005
+ /**
2006
+ * parameter for basic security
2007
+ *
2008
+ * @type {string}
2009
+ * @memberof Configuration
2010
+ */
2011
+ password;
2012
+ /**
2013
+ * parameter for oauth2 security
2014
+ * @param name security name
2015
+ * @param scopes oauth2 scope
2016
+ * @memberof Configuration
2017
+ */
2018
+ accessToken;
2019
+ /**
2020
+ * override base path
2021
+ *
2022
+ * @type {string}
2023
+ * @memberof Configuration
2024
+ */
2025
+ basePath;
2026
+ /**
2027
+ * base options for axios calls
2028
+ *
2029
+ * @type {any}
2030
+ * @memberof Configuration
2031
+ */
2032
+ baseOptions;
2033
+ /**
2034
+ * The FormData constructor that will be used to create multipart form data
2035
+ * requests. You can inject this here so that execution environments that
2036
+ * do not support the FormData class can still run the generated client.
2037
+ *
2038
+ * @type {new () => FormData}
2039
+ */
2040
+ formDataCtor;
2041
+ constructor(param = {}) {
2042
+ this.apiKey = param.apiKey;
2043
+ this.username = param.username;
2044
+ this.password = param.password;
2045
+ this.accessToken = param.accessToken;
2046
+ this.basePath = param.basePath;
2047
+ this.baseOptions = param.baseOptions;
2048
+ this.formDataCtor = param.formDataCtor;
2049
+ }
2050
+ /**
2051
+ * Check if the given MIME is a JSON MIME.
2052
+ * JSON MIME examples:
2053
+ * application/json
2054
+ * application/json; charset=UTF8
2055
+ * APPLICATION/JSON
2056
+ * application/vnd.company+json
2057
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
2058
+ * @return True if the given MIME is JSON, false otherwise.
2059
+ */
2060
+ isJsonMime(mime) {
2061
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
2062
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
2063
+ }
2064
+ }
2065
+
2066
+ /* tslint:disable */
2067
+ /* eslint-disable */
2068
+ /**
2069
+ * Immutable X API
2070
+ * Immutable Multi Rollup API
2071
+ *
2072
+ * The version of the OpenAPI document: 1.0.0
2073
+ * Contact: support@immutable.com
2074
+ *
2075
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2076
+ * https://openapi-generator.tech
2077
+ * Do not edit the class manually.
2078
+ */
2079
+ const APIError400AllOfCodeEnum = {
2080
+ ValidationError: 'VALIDATION_ERROR'
2081
+ };
2082
+
2083
+ /* tslint:disable */
2084
+ /* eslint-disable */
2085
+ /**
2086
+ * Immutable X API
2087
+ * Immutable Multi Rollup API
2088
+ *
2089
+ * The version of the OpenAPI document: 1.0.0
2090
+ * Contact: support@immutable.com
2091
+ *
2092
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2093
+ * https://openapi-generator.tech
2094
+ * Do not edit the class manually.
2095
+ */
2096
+ const APIError401AllOfCodeEnum = {
2097
+ UnauthorisedRequest: 'UNAUTHORISED_REQUEST'
2098
+ };
2099
+
2100
+ /* tslint:disable */
2101
+ /* eslint-disable */
2102
+ /**
2103
+ * Immutable X API
2104
+ * Immutable Multi Rollup API
2105
+ *
2106
+ * The version of the OpenAPI document: 1.0.0
2107
+ * Contact: support@immutable.com
2108
+ *
2109
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2110
+ * https://openapi-generator.tech
2111
+ * Do not edit the class manually.
2112
+ */
2113
+ const APIError403AllOfCodeEnum = {
2114
+ AuthenticationError: 'AUTHENTICATION_ERROR'
2115
+ };
2116
+
2117
+ /* tslint:disable */
2118
+ /* eslint-disable */
2119
+ /**
2120
+ * Immutable X API
2121
+ * Immutable Multi Rollup API
2122
+ *
2123
+ * The version of the OpenAPI document: 1.0.0
2124
+ * Contact: support@immutable.com
2125
+ *
2126
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2127
+ * https://openapi-generator.tech
2128
+ * Do not edit the class manually.
2129
+ */
2130
+ const APIError404AllOfCodeEnum = {
2131
+ ResourceNotFound: 'RESOURCE_NOT_FOUND'
2132
+ };
2133
+
2134
+ /* tslint:disable */
2135
+ /* eslint-disable */
2136
+ /**
2137
+ * Immutable X API
2138
+ * Immutable Multi Rollup API
2139
+ *
2140
+ * The version of the OpenAPI document: 1.0.0
2141
+ * Contact: support@immutable.com
2142
+ *
2143
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2144
+ * https://openapi-generator.tech
2145
+ * Do not edit the class manually.
2146
+ */
2147
+ const APIError429AllOfCodeEnum = {
2148
+ TooManyRequestsError: 'TOO_MANY_REQUESTS_ERROR'
2149
+ };
2150
+
2151
+ /* tslint:disable */
2152
+ /* eslint-disable */
2153
+ /**
2154
+ * Immutable X API
2155
+ * Immutable Multi Rollup API
2156
+ *
2157
+ * The version of the OpenAPI document: 1.0.0
2158
+ * Contact: support@immutable.com
2159
+ *
2160
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2161
+ * https://openapi-generator.tech
2162
+ * Do not edit the class manually.
2163
+ */
2164
+ const APIError500AllOfCodeEnum = {
2165
+ InternalServerError: 'INTERNAL_SERVER_ERROR'
2166
+ };
2167
+
2168
+ /* tslint:disable */
2169
+ /* eslint-disable */
2170
+ /**
2171
+ * Immutable X API
2172
+ * Immutable Multi Rollup API
2173
+ *
2174
+ * The version of the OpenAPI document: 1.0.0
2175
+ * Contact: support@immutable.com
2176
+ *
2177
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2178
+ * https://openapi-generator.tech
2179
+ * Do not edit the class manually.
2180
+ */
2181
+ /**
2182
+ * The activity type
2183
+ * @export
2184
+ * @enum {string}
2185
+ */
2186
+ const ActivityType = {
2187
+ Mint: 'mint',
2188
+ Burn: 'burn',
2189
+ Transfer: 'transfer',
2190
+ Sale: 'sale'
2191
+ };
2192
+
2193
+ /* tslint:disable */
2194
+ /* eslint-disable */
2195
+ /**
2196
+ * Immutable X API
2197
+ * Immutable Multi Rollup API
2198
+ *
2199
+ * The version of the OpenAPI document: 1.0.0
2200
+ * Contact: support@immutable.com
2201
+ *
2202
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2203
+ * https://openapi-generator.tech
2204
+ * Do not edit the class manually.
2205
+ */
2206
+ const BuyItemItemTypeEnum = {
2207
+ Native: 'NATIVE',
2208
+ Erc20: 'ERC20'
2209
+ };
2210
+
2211
+ /* tslint:disable */
2212
+ /* eslint-disable */
2213
+ /**
2214
+ * Immutable X API
2215
+ * Immutable Multi Rollup API
2216
+ *
2217
+ * The version of the OpenAPI document: 1.0.0
2218
+ * Contact: support@immutable.com
2219
+ *
2220
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2221
+ * https://openapi-generator.tech
2222
+ * Do not edit the class manually.
2223
+ */
2224
+ /**
2225
+ * The collection contract type
2226
+ * @export
2227
+ * @enum {string}
2228
+ */
2229
+ const CollectionContractType = {
2230
+ Erc721: 'ERC721'
2231
+ };
2232
+
2233
+ /* tslint:disable */
2234
+ /* eslint-disable */
2235
+ /**
2236
+ * Immutable X API
2237
+ * Immutable Multi Rollup API
2238
+ *
2239
+ * The version of the OpenAPI document: 1.0.0
2240
+ * Contact: support@immutable.com
2241
+ *
2242
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2243
+ * https://openapi-generator.tech
2244
+ * Do not edit the class manually.
2245
+ */
2246
+ const CreateOrderProtocolDataOrderTypeEnum = {
2247
+ FullRestricted: 'FULL_RESTRICTED'
2248
+ };
2249
+
2250
+ /* tslint:disable */
2251
+ /* eslint-disable */
2252
+ /**
2253
+ * Immutable X API
2254
+ * Immutable Multi Rollup API
2255
+ *
2256
+ * The version of the OpenAPI document: 1.0.0
2257
+ * Contact: support@immutable.com
2258
+ *
2259
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2260
+ * https://openapi-generator.tech
2261
+ * Do not edit the class manually.
2262
+ */
2263
+ const FeeFeeTypeEnum = {
2264
+ Royalty: 'ROYALTY'
2265
+ };
2266
+
2267
+ /* tslint:disable */
2268
+ /* eslint-disable */
2269
+ /**
2270
+ * Immutable X API
2271
+ * Immutable Multi Rollup API
2272
+ *
2273
+ * The version of the OpenAPI document: 1.0.0
2274
+ * Contact: support@immutable.com
2275
+ *
2276
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2277
+ * https://openapi-generator.tech
2278
+ * Do not edit the class manually.
2279
+ */
2280
+ /**
2281
+ * The contract type for an NFT
2282
+ * @export
2283
+ * @enum {string}
2284
+ */
2285
+ const NFTContractType = {
2286
+ Erc721: 'ERC721'
2287
+ };
2288
+
2289
+ /* tslint:disable */
2290
+ /* eslint-disable */
2291
+ /**
2292
+ * Immutable X API
2293
+ * Immutable Multi Rollup API
2294
+ *
2295
+ * The version of the OpenAPI document: 1.0.0
2296
+ * Contact: support@immutable.com
2297
+ *
2298
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2299
+ * https://openapi-generator.tech
2300
+ * Do not edit the class manually.
2301
+ */
2302
+ /**
2303
+ * The Order status
2304
+ * @export
2305
+ * @enum {string}
2306
+ */
2307
+ const OrderStatus = {
2308
+ Pending: 'PENDING',
2309
+ Active: 'ACTIVE',
2310
+ Inactive: 'INACTIVE',
2311
+ Filled: 'FILLED',
2312
+ Cancelled: 'CANCELLED',
2313
+ Expired: 'EXPIRED'
2314
+ };
2315
+
2316
+ /* tslint:disable */
2317
+ /* eslint-disable */
2318
+ /**
2319
+ * Immutable X API
2320
+ * Immutable Multi Rollup API
2321
+ *
2322
+ * The version of the OpenAPI document: 1.0.0
2323
+ * Contact: support@immutable.com
2324
+ *
2325
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2326
+ * https://openapi-generator.tech
2327
+ * Do not edit the class manually.
2328
+ */
2329
+ const SaleFeeTypeEnum = {
2330
+ Royalty: 'ROYALTY'
2331
+ };
2332
+
2333
+ /* tslint:disable */
2334
+ /* eslint-disable */
2335
+ /**
2336
+ * Immutable X API
2337
+ * Immutable Multi Rollup API
2338
+ *
2339
+ * The version of the OpenAPI document: 1.0.0
2340
+ * Contact: support@immutable.com
2341
+ *
2342
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2343
+ * https://openapi-generator.tech
2344
+ * Do not edit the class manually.
2345
+ */
2346
+ const SellItemItemTypeEnum = {
2347
+ Erc721: 'ERC721'
2348
+ };
2349
+
2350
+ /* tslint:disable */
2351
+ /* eslint-disable */
2352
+ /**
2353
+ * Immutable X API
2354
+ * Immutable Multi Rollup API
2355
+ *
2356
+ * The version of the OpenAPI document: 1.0.0
2357
+ * Contact: support@immutable.com
2358
+ *
2359
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2360
+ * https://openapi-generator.tech
2361
+ * Do not edit the class manually.
2362
+ */
2363
+ /**
2364
+ * The contract type for a token
2365
+ * @export
2366
+ * @enum {string}
2367
+ */
2368
+ const TokenContractType = {
2369
+ Erc20: 'ERC20'
2370
+ };
2371
+
2372
+ /* tslint:disable */
2373
+ /* eslint-disable */
2374
+ /**
2375
+ * Immutable X API
2376
+ * Immutable Multi Rollup API
2377
+ *
2378
+ * The version of the OpenAPI document: 1.0.0
2379
+ * Contact: support@immutable.com
2380
+ *
2381
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2382
+ * https://openapi-generator.tech
2383
+ * Do not edit the class manually.
2384
+ */
2385
+
2386
+ var index = /*#__PURE__*/Object.freeze({
2387
+ __proto__: null,
2388
+ APIError400AllOfCodeEnum: APIError400AllOfCodeEnum,
2389
+ APIError401AllOfCodeEnum: APIError401AllOfCodeEnum,
2390
+ APIError403AllOfCodeEnum: APIError403AllOfCodeEnum,
2391
+ APIError404AllOfCodeEnum: APIError404AllOfCodeEnum,
2392
+ APIError429AllOfCodeEnum: APIError429AllOfCodeEnum,
2393
+ APIError500AllOfCodeEnum: APIError500AllOfCodeEnum,
2394
+ ActivitiesApi: ActivitiesApi,
2395
+ ActivitiesApiAxiosParamCreator: ActivitiesApiAxiosParamCreator,
2396
+ ActivitiesApiFactory: ActivitiesApiFactory,
2397
+ ActivitiesApiFp: ActivitiesApiFp,
2398
+ ActivityType: ActivityType,
2399
+ BuyItemItemTypeEnum: BuyItemItemTypeEnum,
2400
+ ChainsApi: ChainsApi,
2401
+ ChainsApiAxiosParamCreator: ChainsApiAxiosParamCreator,
2402
+ ChainsApiFactory: ChainsApiFactory,
2403
+ ChainsApiFp: ChainsApiFp,
2404
+ CollectionContractType: CollectionContractType,
2405
+ CollectionsApi: CollectionsApi,
2406
+ CollectionsApiAxiosParamCreator: CollectionsApiAxiosParamCreator,
2407
+ CollectionsApiFactory: CollectionsApiFactory,
2408
+ CollectionsApiFp: CollectionsApiFp,
2409
+ Configuration: Configuration,
2410
+ CreateOrderProtocolDataOrderTypeEnum: CreateOrderProtocolDataOrderTypeEnum,
2411
+ FeeFeeTypeEnum: FeeFeeTypeEnum,
2412
+ ListingsApi: ListingsApi,
2413
+ ListingsApiAxiosParamCreator: ListingsApiAxiosParamCreator,
2414
+ ListingsApiFactory: ListingsApiFactory,
2415
+ ListingsApiFp: ListingsApiFp,
2416
+ NFTContractType: NFTContractType,
2417
+ NftOwnersApi: NftOwnersApi,
2418
+ NftOwnersApiAxiosParamCreator: NftOwnersApiAxiosParamCreator,
2419
+ NftOwnersApiFactory: NftOwnersApiFactory,
2420
+ NftOwnersApiFp: NftOwnersApiFp,
2421
+ NftsApi: NftsApi,
2422
+ NftsApiAxiosParamCreator: NftsApiAxiosParamCreator,
2423
+ NftsApiFactory: NftsApiFactory,
2424
+ NftsApiFp: NftsApiFp,
2425
+ OrderStatus: OrderStatus,
2426
+ OrdersApi: OrdersApi,
2427
+ OrdersApiAxiosParamCreator: OrdersApiAxiosParamCreator,
2428
+ OrdersApiFactory: OrdersApiFactory,
2429
+ OrdersApiFp: OrdersApiFp,
2430
+ PassportApi: PassportApi,
2431
+ PassportApiAxiosParamCreator: PassportApiAxiosParamCreator,
2432
+ PassportApiFactory: PassportApiFactory,
2433
+ PassportApiFp: PassportApiFp,
2434
+ SaleFeeTypeEnum: SaleFeeTypeEnum,
2435
+ SellItemItemTypeEnum: SellItemItemTypeEnum,
2436
+ TokenContractType: TokenContractType,
2437
+ TokensApi: TokensApi,
2438
+ TokensApiAxiosParamCreator: TokensApiAxiosParamCreator,
2439
+ TokensApiFactory: TokensApiFactory,
2440
+ TokensApiFp: TokensApiFp
2441
+ });
2442
+
2443
+ var Environment;
2444
+ (function (Environment) {
2445
+ Environment["PRODUCTION"] = "production";
2446
+ Environment["SANDBOX"] = "sandbox";
2447
+ })(Environment || (Environment = {}));
2448
+
2449
+ /**
2450
+ * Custom Error class that is returned from the API when a request fails
2451
+ */
2452
+ class APIError extends Error {
2453
+ code;
2454
+ details;
2455
+ link;
2456
+ traceId;
2457
+ constructor({ message, code, details, link, trace_id: traceId, }) {
2458
+ super(message);
2459
+ this.code = code;
2460
+ this.details = details;
2461
+ this.link = link;
2462
+ this.traceId = traceId;
2463
+ }
2464
+ }
2465
+
2466
+ /* eslint-disable implicit-arrow-linebreak */
2467
+ const defaultHeaders = {
2468
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.1.9-alpha',
2469
+ };
2470
+ /**
2471
+ * createAPIConfiguration to create a custom Configuration
2472
+ * other than the production and sandbox defined below.
2473
+ */
2474
+ const createAPIConfiguration = ({ basePath, headers: baseHeaders, }) => {
2475
+ if (!basePath.trim()) {
2476
+ throw Error('basePath can not be empty');
2477
+ }
2478
+ const headers = { ...(baseHeaders || {}), ...defaultHeaders };
2479
+ const configParams = {
2480
+ basePath,
2481
+ baseOptions: { headers },
2482
+ };
2483
+ return new index.Configuration(configParams);
2484
+ };
2485
+ const production = () => createAPIConfiguration({
2486
+ basePath: 'https://indexer-mr.dev.imtbl.com/v1', // TODO update before mainnet release
2487
+ });
2488
+ const sandbox = () => createAPIConfiguration({
2489
+ basePath: 'https://indexer-mr.dev.imtbl.com/v1', // TODO update before testnet release
2490
+ });
2491
+ class BlockchainDataConfiguration {
2492
+ apiConfig;
2493
+ baseConfig;
2494
+ constructor({ baseConfig, overrides }) {
2495
+ this.baseConfig = baseConfig;
2496
+ if (overrides) {
2497
+ this.apiConfig = createAPIConfiguration(overrides);
2498
+ }
2499
+ else {
2500
+ switch (baseConfig.environment) {
2501
+ case Environment.SANDBOX: {
2502
+ this.apiConfig = sandbox();
2503
+ break;
2504
+ }
2505
+ case Environment.PRODUCTION: {
2506
+ this.apiConfig = production();
2507
+ break;
2508
+ }
2509
+ default: {
2510
+ this.apiConfig = sandbox();
2511
+ }
2512
+ }
2513
+ }
2514
+ }
2515
+ }
2516
+
2517
+ /* eslint-disable @typescript-eslint/naming-convention */
2518
+ /**
2519
+ * [Formats an error in the APIError shape](https://axios-http.com/docs/handling_errors)
2520
+ * @param error - The Error object thrown by the request
2521
+ * @returns APIError
2522
+ */
2523
+ function formatError(error) {
2524
+ if (globalAxios.isAxiosError(error) && error.response) {
2525
+ const apiError = error.response.data;
2526
+ if (apiError.code && apiError.message) {
2527
+ return new APIError({
2528
+ code: apiError.code,
2529
+ message: apiError.message,
2530
+ details: apiError.details || null,
2531
+ link: apiError.link || '',
2532
+ trace_id: apiError.trace_id || '',
2533
+ });
2534
+ }
2535
+ return new APIError({
2536
+ code: error.code ?? error.response?.status.toString() ?? 'unknown_error_code',
2537
+ message: String(error),
2538
+ details: null,
2539
+ link: '',
2540
+ trace_id: '',
2541
+ });
2542
+ }
2543
+ return new APIError({
2544
+ code: 'unknown_error_code',
2545
+ message: String(error),
2546
+ details: null,
2547
+ link: '',
2548
+ trace_id: '',
2549
+ });
2550
+ }
2551
+
2552
+ class BlockchainData {
2553
+ config;
2554
+ activities;
2555
+ chains;
2556
+ collections;
2557
+ nfts;
2558
+ nftOwners;
2559
+ tokens;
2560
+ constructor(moduleConfig) {
2561
+ this.config = new BlockchainDataConfiguration(moduleConfig);
2562
+ this.activities = new index.ActivitiesApi(this.config.apiConfig);
2563
+ this.chains = new index.ChainsApi(this.config.apiConfig);
2564
+ this.collections = new index.CollectionsApi(this.config.apiConfig);
2565
+ this.nfts = new index.NftsApi(this.config.apiConfig);
2566
+ this.nftOwners = new index.NftOwnersApi(this.config.apiConfig);
2567
+ this.tokens = new index.TokensApi(this.config.apiConfig);
2568
+ }
2569
+ /**
2570
+ * List all activities
2571
+ * @param request - the request object containing the parameters to be provided in the API request
2572
+ * @returns a promise that resolves with a list of activities
2573
+ * @throws {@link index.APIError}
2574
+ */
2575
+ async listActivities(request) {
2576
+ return await this.activities
2577
+ .listActivities(request)
2578
+ .then((res) => res.data)
2579
+ .catch((err) => {
2580
+ throw formatError(err);
2581
+ });
2582
+ }
2583
+ /**
2584
+ * Get a single activity by ID
2585
+ * @param request - the request object containing the parameters to be provided in the API request
2586
+ * @returns a promise that resolves with a single activity
2587
+ * @throws {@link index.APIError}
2588
+ */
2589
+ async getActivity(request) {
2590
+ return await this.activities
2591
+ .getActivity(request)
2592
+ .then((res) => res.data)
2593
+ .catch((err) => {
2594
+ throw formatError(err);
2595
+ });
2596
+ }
2597
+ /**
2598
+ * List supported chains
2599
+ * @param request - the request object containing the parameters to be provided in the API request
2600
+ * @returns a promise that resolves with a list of supported chains
2601
+ * @throws {@link index.APIError}
2602
+ */
2603
+ async listChains(request) {
2604
+ return await this.chains
2605
+ .listChains(request)
2606
+ .then((res) => res.data)
2607
+ .catch((err) => {
2608
+ throw formatError(err);
2609
+ });
2610
+ }
2611
+ /**
2612
+ * List all collections
2613
+ * @param request - the request object containing the parameters to be provided in the API request
2614
+ * @returns a promise that resolves with a list of collections
2615
+ * @throws {@link index.APIError}
2616
+ */
2617
+ async listCollections(request) {
2618
+ return await this.collections
2619
+ .listCollections(request)
2620
+ .then((res) => res.data)
2621
+ .catch((err) => {
2622
+ throw formatError(err);
2623
+ });
2624
+ }
2625
+ /**
2626
+ * Get collection by contract address
2627
+ * @param request - the request object containing the parameters to be provided in the API request
2628
+ * @returns a promise that resolves with a single collection
2629
+ * @throws {@link index.APIError}
2630
+ */
2631
+ async getCollection(request) {
2632
+ return await this.collections
2633
+ .getCollection(request)
2634
+ .then((res) => res.data)
2635
+ .catch((err) => {
2636
+ throw formatError(err);
2637
+ });
2638
+ }
2639
+ /**
2640
+ * Get NFT by token ID
2641
+ * @param request - the request object containing the parameters to be provided in the API request
2642
+ * @returns a promise that resolves with a single NFT
2643
+ * @throws {@link index.APIError}
2644
+ */
2645
+ async getNFT(request) {
2646
+ return await this.nfts
2647
+ .getNFT(request)
2648
+ .then((res) => res.data)
2649
+ .catch((err) => {
2650
+ throw formatError(err);
2651
+ });
2652
+ }
2653
+ /**
2654
+ * List NFTs by contract address
2655
+ * @param request - the request object containing the parameters to be provided in the API request
2656
+ * @returns a promise that resolves with a list of NFTs
2657
+ * @throws {@link index.APIError}
2658
+ */
2659
+ async listNFTs(request) {
2660
+ return await this.nfts
2661
+ .listNFTs(request)
2662
+ .then((res) => res.data)
2663
+ .catch((err) => {
2664
+ throw formatError(err);
2665
+ });
2666
+ }
2667
+ /**
2668
+ * List NFTs by account address
2669
+ * @param request - the request object containing the parameters to be provided in the API request
2670
+ * @returns a promise that resolves with a list of NFTs
2671
+ * @throws {@link index.APIError}
2672
+ */
2673
+ async listNFTsByAccountAddress(request) {
2674
+ return await this.nfts
2675
+ .listNFTsByAccountAddress(request)
2676
+ .then((res) => res.data)
2677
+ .catch((err) => {
2678
+ throw formatError(err);
2679
+ });
2680
+ }
2681
+ /**
2682
+ * List NFT owners by token ID
2683
+ * @param request - the request object containing the parameters to be provided in the API request
2684
+ * @returns a promise that resolves with a list of NFT owners
2685
+ * @throws {@link index.APIError}
2686
+ */
2687
+ async listNFTOwners(request) {
2688
+ return await this.nftOwners
2689
+ .listNFTOwners(request)
2690
+ .then((res) => res.data)
2691
+ .catch((err) => {
2692
+ throw formatError(err);
2693
+ });
2694
+ }
2695
+ /**
2696
+ * List ERC20 Token contracts
2697
+ * @param request - the request object containing the parameters to be provided in the API request
2698
+ * @returns a promise that resolves with a list of ERC20 Tokens
2699
+ * @throws {@link index.APIError}
2700
+ */
2701
+ async listTokens(request) {
2702
+ return await this.tokens
2703
+ .listERC20Tokens(request)
2704
+ .then((res) => res.data)
2705
+ .catch((err) => {
2706
+ throw formatError(err);
2707
+ });
2708
+ }
2709
+ /**
2710
+ * Get details for an ERC20 Token by contract address
2711
+ * @param request - the request object containing the parameters to be provided in the API request
2712
+ * @returns a promise that resolves with a list of ERC20 Tokens
2713
+ * @throws {@link index.APIError}
2714
+ */
2715
+ async getToken(request) {
2716
+ return await this.tokens
2717
+ .getERC20Token(request)
2718
+ .then((res) => res.data)
2719
+ .catch((err) => {
2720
+ throw formatError(err);
2721
+ });
2722
+ }
2723
+ }
2724
+
2725
+ export { APIError, BlockchainData };