@imtbl/sdk 0.1.9-alpha.3 → 0.1.9

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.
@@ -1,2458 +0,0 @@
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.sandbox.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
- * NftOwnersApi - axios parameter creator
702
- * @export
703
- */
704
- const NftOwnersApiAxiosParamCreator = function (configuration) {
705
- return {
706
- /**
707
- * List NFT owners by token ID
708
- * @summary List NFT owners by token ID
709
- * @param {string} contractAddress The address of contract
710
- * @param {string} tokenId An `uint256` token id as string
711
- * @param {string} chainName The name of chain
712
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
713
- * @param {number} [pageSize] Maximum number of items to return
714
- * @param {*} [options] Override http request option.
715
- * @throws {RequiredError}
716
- */
717
- listNFTOwners: async (contractAddress, tokenId, chainName, pageCursor, pageSize, options = {}) => {
718
- // verify required parameter 'contractAddress' is not null or undefined
719
- assertParamExists('listNFTOwners', 'contractAddress', contractAddress);
720
- // verify required parameter 'tokenId' is not null or undefined
721
- assertParamExists('listNFTOwners', 'tokenId', tokenId);
722
- // verify required parameter 'chainName' is not null or undefined
723
- assertParamExists('listNFTOwners', 'chainName', chainName);
724
- const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners`
725
- .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
726
- .replace(`{${"token_id"}}`, encodeURIComponent(String(tokenId)))
727
- .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
728
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
729
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
730
- let baseOptions;
731
- if (configuration) {
732
- baseOptions = configuration.baseOptions;
733
- }
734
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
735
- const localVarHeaderParameter = {};
736
- const localVarQueryParameter = {};
737
- if (pageCursor !== undefined) {
738
- localVarQueryParameter['page_cursor'] = pageCursor;
739
- }
740
- if (pageSize !== undefined) {
741
- localVarQueryParameter['page_size'] = pageSize;
742
- }
743
- setSearchParams(localVarUrlObj, localVarQueryParameter);
744
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
745
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
746
- return {
747
- url: toPathString(localVarUrlObj),
748
- options: localVarRequestOptions,
749
- };
750
- },
751
- };
752
- };
753
- /**
754
- * NftOwnersApi - functional programming interface
755
- * @export
756
- */
757
- const NftOwnersApiFp = function (configuration) {
758
- const localVarAxiosParamCreator = NftOwnersApiAxiosParamCreator(configuration);
759
- return {
760
- /**
761
- * List NFT owners by token ID
762
- * @summary List NFT owners by token ID
763
- * @param {string} contractAddress The address of contract
764
- * @param {string} tokenId An `uint256` token id as string
765
- * @param {string} chainName The name of chain
766
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
767
- * @param {number} [pageSize] Maximum number of items to return
768
- * @param {*} [options] Override http request option.
769
- * @throws {RequiredError}
770
- */
771
- async listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options) {
772
- const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options);
773
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
774
- },
775
- };
776
- };
777
- /**
778
- * NftOwnersApi - factory interface
779
- * @export
780
- */
781
- const NftOwnersApiFactory = function (configuration, basePath, axios) {
782
- const localVarFp = NftOwnersApiFp(configuration);
783
- return {
784
- /**
785
- * List NFT owners by token ID
786
- * @summary List NFT owners by token ID
787
- * @param {string} contractAddress The address of contract
788
- * @param {string} tokenId An `uint256` token id as string
789
- * @param {string} chainName The name of chain
790
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
791
- * @param {number} [pageSize] Maximum number of items to return
792
- * @param {*} [options] Override http request option.
793
- * @throws {RequiredError}
794
- */
795
- listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options) {
796
- return localVarFp.listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
797
- },
798
- };
799
- };
800
- /**
801
- * NftOwnersApi - object-oriented interface
802
- * @export
803
- * @class NftOwnersApi
804
- * @extends {BaseAPI}
805
- */
806
- class NftOwnersApi extends BaseAPI {
807
- /**
808
- * List NFT owners by token ID
809
- * @summary List NFT owners by token ID
810
- * @param {NftOwnersApiListNFTOwnersRequest} requestParameters Request parameters.
811
- * @param {*} [options] Override http request option.
812
- * @throws {RequiredError}
813
- * @memberof NftOwnersApi
814
- */
815
- listNFTOwners(requestParameters, options) {
816
- return NftOwnersApiFp(this.configuration).listNFTOwners(requestParameters.contractAddress, requestParameters.tokenId, requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
817
- }
818
- }
819
-
820
- /* tslint:disable */
821
- /* eslint-disable */
822
- /**
823
- * Immutable X API
824
- * Immutable Multi Rollup API
825
- *
826
- * The version of the OpenAPI document: 1.0.0
827
- * Contact: support@immutable.com
828
- *
829
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
830
- * https://openapi-generator.tech
831
- * Do not edit the class manually.
832
- */
833
- /**
834
- * NftsApi - axios parameter creator
835
- * @export
836
- */
837
- const NftsApiAxiosParamCreator = function (configuration) {
838
- return {
839
- /**
840
- * Get NFT by token ID
841
- * @summary Get NFT by token ID
842
- * @param {string} contractAddress The address of NFT contract
843
- * @param {string} tokenId An `uint256` token id as string
844
- * @param {string} chainName The name of chain
845
- * @param {*} [options] Override http request option.
846
- * @throws {RequiredError}
847
- */
848
- getNFT: async (contractAddress, tokenId, chainName, options = {}) => {
849
- // verify required parameter 'contractAddress' is not null or undefined
850
- assertParamExists('getNFT', 'contractAddress', contractAddress);
851
- // verify required parameter 'tokenId' is not null or undefined
852
- assertParamExists('getNFT', 'tokenId', tokenId);
853
- // verify required parameter 'chainName' is not null or undefined
854
- assertParamExists('getNFT', 'chainName', chainName);
855
- const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}`
856
- .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
857
- .replace(`{${"token_id"}}`, encodeURIComponent(String(tokenId)))
858
- .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
859
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
860
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
861
- let baseOptions;
862
- if (configuration) {
863
- baseOptions = configuration.baseOptions;
864
- }
865
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
866
- const localVarHeaderParameter = {};
867
- const localVarQueryParameter = {};
868
- setSearchParams(localVarUrlObj, localVarQueryParameter);
869
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
870
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
871
- return {
872
- url: toPathString(localVarUrlObj),
873
- options: localVarRequestOptions,
874
- };
875
- },
876
- /**
877
- * List NFTs by contract address
878
- * @summary List NFTs by contract address
879
- * @param {string} contractAddress Contract address
880
- * @param {string} chainName The name of chain
881
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
882
- * @param {number} [pageSize] Maximum number of items to return
883
- * @param {*} [options] Override http request option.
884
- * @throws {RequiredError}
885
- */
886
- listNFTs: async (contractAddress, chainName, pageCursor, pageSize, options = {}) => {
887
- // verify required parameter 'contractAddress' is not null or undefined
888
- assertParamExists('listNFTs', 'contractAddress', contractAddress);
889
- // verify required parameter 'chainName' is not null or undefined
890
- assertParamExists('listNFTs', 'chainName', chainName);
891
- const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts`
892
- .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
893
- .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
894
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
895
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
896
- let baseOptions;
897
- if (configuration) {
898
- baseOptions = configuration.baseOptions;
899
- }
900
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
901
- const localVarHeaderParameter = {};
902
- const localVarQueryParameter = {};
903
- if (pageCursor !== undefined) {
904
- localVarQueryParameter['page_cursor'] = pageCursor;
905
- }
906
- if (pageSize !== undefined) {
907
- localVarQueryParameter['page_size'] = pageSize;
908
- }
909
- setSearchParams(localVarUrlObj, localVarQueryParameter);
910
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
911
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
912
- return {
913
- url: toPathString(localVarUrlObj),
914
- options: localVarRequestOptions,
915
- };
916
- },
917
- /**
918
- * List NFTs by account address
919
- * @summary List NFTs by account address
920
- * @param {string} accountAddress Account address
921
- * @param {string} chainName The name of chain
922
- * @param {string} [contractAddress] The address of contract
923
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
924
- * @param {number} [pageSize] Maximum number of items to return
925
- * @param {*} [options] Override http request option.
926
- * @throws {RequiredError}
927
- */
928
- listNFTsByAccountAddress: async (accountAddress, chainName, contractAddress, pageCursor, pageSize, options = {}) => {
929
- // verify required parameter 'accountAddress' is not null or undefined
930
- assertParamExists('listNFTsByAccountAddress', 'accountAddress', accountAddress);
931
- // verify required parameter 'chainName' is not null or undefined
932
- assertParamExists('listNFTsByAccountAddress', 'chainName', chainName);
933
- const localVarPath = `/v1/chains/{chain_name}/accounts/{account_address}/nfts`
934
- .replace(`{${"account_address"}}`, encodeURIComponent(String(accountAddress)))
935
- .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
936
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
937
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
938
- let baseOptions;
939
- if (configuration) {
940
- baseOptions = configuration.baseOptions;
941
- }
942
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
943
- const localVarHeaderParameter = {};
944
- const localVarQueryParameter = {};
945
- if (contractAddress !== undefined) {
946
- localVarQueryParameter['contract_address'] = contractAddress;
947
- }
948
- if (pageCursor !== undefined) {
949
- localVarQueryParameter['page_cursor'] = pageCursor;
950
- }
951
- if (pageSize !== undefined) {
952
- localVarQueryParameter['page_size'] = pageSize;
953
- }
954
- setSearchParams(localVarUrlObj, localVarQueryParameter);
955
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
956
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
957
- return {
958
- url: toPathString(localVarUrlObj),
959
- options: localVarRequestOptions,
960
- };
961
- },
962
- };
963
- };
964
- /**
965
- * NftsApi - functional programming interface
966
- * @export
967
- */
968
- const NftsApiFp = function (configuration) {
969
- const localVarAxiosParamCreator = NftsApiAxiosParamCreator(configuration);
970
- return {
971
- /**
972
- * Get NFT by token ID
973
- * @summary Get NFT by token ID
974
- * @param {string} contractAddress The address of NFT contract
975
- * @param {string} tokenId An `uint256` token id as string
976
- * @param {string} chainName The name of chain
977
- * @param {*} [options] Override http request option.
978
- * @throws {RequiredError}
979
- */
980
- async getNFT(contractAddress, tokenId, chainName, options) {
981
- const localVarAxiosArgs = await localVarAxiosParamCreator.getNFT(contractAddress, tokenId, chainName, options);
982
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
983
- },
984
- /**
985
- * List NFTs by contract address
986
- * @summary List NFTs by contract address
987
- * @param {string} contractAddress Contract address
988
- * @param {string} chainName The name of chain
989
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
990
- * @param {number} [pageSize] Maximum number of items to return
991
- * @param {*} [options] Override http request option.
992
- * @throws {RequiredError}
993
- */
994
- async listNFTs(contractAddress, chainName, pageCursor, pageSize, options) {
995
- const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTs(contractAddress, chainName, pageCursor, pageSize, options);
996
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
997
- },
998
- /**
999
- * List NFTs by account address
1000
- * @summary List NFTs by account address
1001
- * @param {string} accountAddress Account address
1002
- * @param {string} chainName The name of chain
1003
- * @param {string} [contractAddress] The address of contract
1004
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1005
- * @param {number} [pageSize] Maximum number of items to return
1006
- * @param {*} [options] Override http request option.
1007
- * @throws {RequiredError}
1008
- */
1009
- async listNFTsByAccountAddress(accountAddress, chainName, contractAddress, pageCursor, pageSize, options) {
1010
- const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTsByAccountAddress(accountAddress, chainName, contractAddress, pageCursor, pageSize, options);
1011
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1012
- },
1013
- };
1014
- };
1015
- /**
1016
- * NftsApi - factory interface
1017
- * @export
1018
- */
1019
- const NftsApiFactory = function (configuration, basePath, axios) {
1020
- const localVarFp = NftsApiFp(configuration);
1021
- return {
1022
- /**
1023
- * Get NFT by token ID
1024
- * @summary Get NFT by token ID
1025
- * @param {string} contractAddress The address of NFT contract
1026
- * @param {string} tokenId An `uint256` token id as string
1027
- * @param {string} chainName The name of chain
1028
- * @param {*} [options] Override http request option.
1029
- * @throws {RequiredError}
1030
- */
1031
- getNFT(contractAddress, tokenId, chainName, options) {
1032
- return localVarFp.getNFT(contractAddress, tokenId, chainName, options).then((request) => request(axios, basePath));
1033
- },
1034
- /**
1035
- * List NFTs by contract address
1036
- * @summary List NFTs by contract address
1037
- * @param {string} contractAddress Contract address
1038
- * @param {string} chainName The name of chain
1039
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1040
- * @param {number} [pageSize] Maximum number of items to return
1041
- * @param {*} [options] Override http request option.
1042
- * @throws {RequiredError}
1043
- */
1044
- listNFTs(contractAddress, chainName, pageCursor, pageSize, options) {
1045
- return localVarFp.listNFTs(contractAddress, chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
1046
- },
1047
- /**
1048
- * List NFTs by account address
1049
- * @summary List NFTs by account address
1050
- * @param {string} accountAddress Account address
1051
- * @param {string} chainName The name of chain
1052
- * @param {string} [contractAddress] The address of contract
1053
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1054
- * @param {number} [pageSize] Maximum number of items to return
1055
- * @param {*} [options] Override http request option.
1056
- * @throws {RequiredError}
1057
- */
1058
- listNFTsByAccountAddress(accountAddress, chainName, contractAddress, pageCursor, pageSize, options) {
1059
- return localVarFp.listNFTsByAccountAddress(accountAddress, chainName, contractAddress, pageCursor, pageSize, options).then((request) => request(axios, basePath));
1060
- },
1061
- };
1062
- };
1063
- /**
1064
- * NftsApi - object-oriented interface
1065
- * @export
1066
- * @class NftsApi
1067
- * @extends {BaseAPI}
1068
- */
1069
- class NftsApi extends BaseAPI {
1070
- /**
1071
- * Get NFT by token ID
1072
- * @summary Get NFT by token ID
1073
- * @param {NftsApiGetNFTRequest} requestParameters Request parameters.
1074
- * @param {*} [options] Override http request option.
1075
- * @throws {RequiredError}
1076
- * @memberof NftsApi
1077
- */
1078
- getNFT(requestParameters, options) {
1079
- return NftsApiFp(this.configuration).getNFT(requestParameters.contractAddress, requestParameters.tokenId, requestParameters.chainName, options).then((request) => request(this.axios, this.basePath));
1080
- }
1081
- /**
1082
- * List NFTs by contract address
1083
- * @summary List NFTs by contract address
1084
- * @param {NftsApiListNFTsRequest} requestParameters Request parameters.
1085
- * @param {*} [options] Override http request option.
1086
- * @throws {RequiredError}
1087
- * @memberof NftsApi
1088
- */
1089
- listNFTs(requestParameters, options) {
1090
- return NftsApiFp(this.configuration).listNFTs(requestParameters.contractAddress, requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
1091
- }
1092
- /**
1093
- * List NFTs by account address
1094
- * @summary List NFTs by account address
1095
- * @param {NftsApiListNFTsByAccountAddressRequest} requestParameters Request parameters.
1096
- * @param {*} [options] Override http request option.
1097
- * @throws {RequiredError}
1098
- * @memberof NftsApi
1099
- */
1100
- listNFTsByAccountAddress(requestParameters, options) {
1101
- return NftsApiFp(this.configuration).listNFTsByAccountAddress(requestParameters.accountAddress, requestParameters.chainName, requestParameters.contractAddress, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
1102
- }
1103
- }
1104
-
1105
- /* tslint:disable */
1106
- /* eslint-disable */
1107
- /**
1108
- * Immutable X API
1109
- * Immutable Multi Rollup API
1110
- *
1111
- * The version of the OpenAPI document: 1.0.0
1112
- * Contact: support@immutable.com
1113
- *
1114
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1115
- * https://openapi-generator.tech
1116
- * Do not edit the class manually.
1117
- */
1118
- /**
1119
- * OrdersApi - axios parameter creator
1120
- * @export
1121
- */
1122
- const OrdersApiAxiosParamCreator = function (configuration) {
1123
- return {
1124
- /**
1125
- * Create a listing
1126
- * @summary Create a listing
1127
- * @param {string} chainName
1128
- * @param {CreateListingRequestBody} createListingRequestBody
1129
- * @param {*} [options] Override http request option.
1130
- * @throws {RequiredError}
1131
- */
1132
- createListing: async (chainName, createListingRequestBody, options = {}) => {
1133
- // verify required parameter 'chainName' is not null or undefined
1134
- assertParamExists('createListing', 'chainName', chainName);
1135
- // verify required parameter 'createListingRequestBody' is not null or undefined
1136
- assertParamExists('createListing', 'createListingRequestBody', createListingRequestBody);
1137
- const localVarPath = `/v1/chains/{chain_name}/orders/listings`
1138
- .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1139
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1140
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1141
- let baseOptions;
1142
- if (configuration) {
1143
- baseOptions = configuration.baseOptions;
1144
- }
1145
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1146
- const localVarHeaderParameter = {};
1147
- const localVarQueryParameter = {};
1148
- localVarHeaderParameter['Content-Type'] = 'application/json';
1149
- setSearchParams(localVarUrlObj, localVarQueryParameter);
1150
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1151
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1152
- localVarRequestOptions.data = serializeDataIfNeeded(createListingRequestBody, localVarRequestOptions, configuration);
1153
- return {
1154
- url: toPathString(localVarUrlObj),
1155
- options: localVarRequestOptions,
1156
- };
1157
- },
1158
- /**
1159
- * Get a single listing by ID
1160
- * @summary Get a single listing by ID
1161
- * @param {string} chainName
1162
- * @param {string} listingId Global Order identifier
1163
- * @param {*} [options] Override http request option.
1164
- * @throws {RequiredError}
1165
- */
1166
- getListing: async (chainName, listingId, options = {}) => {
1167
- // verify required parameter 'chainName' is not null or undefined
1168
- assertParamExists('getListing', 'chainName', chainName);
1169
- // verify required parameter 'listingId' is not null or undefined
1170
- assertParamExists('getListing', 'listingId', listingId);
1171
- const localVarPath = `/v1/chains/{chain_name}/orders/listings/{listing_id}`
1172
- .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)))
1173
- .replace(`{${"listing_id"}}`, encodeURIComponent(String(listingId)));
1174
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1175
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1176
- let baseOptions;
1177
- if (configuration) {
1178
- baseOptions = configuration.baseOptions;
1179
- }
1180
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1181
- const localVarHeaderParameter = {};
1182
- const localVarQueryParameter = {};
1183
- setSearchParams(localVarUrlObj, localVarQueryParameter);
1184
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1185
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1186
- return {
1187
- url: toPathString(localVarUrlObj),
1188
- options: localVarRequestOptions,
1189
- };
1190
- },
1191
- /**
1192
- * List all listings
1193
- * @summary List all listings
1194
- * @param {string} chainName
1195
- * @param {OrderStatus} [status] Order status to filter by
1196
- * @param {string} [sellItemContractAddress] Sell item contract address to filter by
1197
- * @param {string} [buyItemContractAddress] Buy item contract address to filter by
1198
- * @param {string} [sellItemTokenId] Sell item token identifier to filter by
1199
- * @param {number} [pageSize] Maximum number of orders to return per page
1200
- * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
1201
- * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
1202
- * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
1203
- * @param {*} [options] Override http request option.
1204
- * @throws {RequiredError}
1205
- */
1206
- listListings: async (chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options = {}) => {
1207
- // verify required parameter 'chainName' is not null or undefined
1208
- assertParamExists('listListings', 'chainName', chainName);
1209
- const localVarPath = `/v1/chains/{chain_name}/orders/listings`
1210
- .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1211
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1212
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1213
- let baseOptions;
1214
- if (configuration) {
1215
- baseOptions = configuration.baseOptions;
1216
- }
1217
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1218
- const localVarHeaderParameter = {};
1219
- const localVarQueryParameter = {};
1220
- if (status !== undefined) {
1221
- localVarQueryParameter['status'] = status;
1222
- }
1223
- if (sellItemContractAddress !== undefined) {
1224
- localVarQueryParameter['sell_item_contract_address'] = sellItemContractAddress;
1225
- }
1226
- if (buyItemContractAddress !== undefined) {
1227
- localVarQueryParameter['buy_item_contract_address'] = buyItemContractAddress;
1228
- }
1229
- if (sellItemTokenId !== undefined) {
1230
- localVarQueryParameter['sell_item_token_id'] = sellItemTokenId;
1231
- }
1232
- if (pageSize !== undefined) {
1233
- localVarQueryParameter['page_size'] = pageSize;
1234
- }
1235
- if (sortBy !== undefined) {
1236
- localVarQueryParameter['sort_by'] = sortBy;
1237
- }
1238
- if (sortDirection !== undefined) {
1239
- localVarQueryParameter['sort_direction'] = sortDirection;
1240
- }
1241
- if (pageCursor !== undefined) {
1242
- localVarQueryParameter['page_cursor'] = pageCursor;
1243
- }
1244
- setSearchParams(localVarUrlObj, localVarQueryParameter);
1245
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1246
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1247
- return {
1248
- url: toPathString(localVarUrlObj),
1249
- options: localVarRequestOptions,
1250
- };
1251
- },
1252
- };
1253
- };
1254
- /**
1255
- * OrdersApi - functional programming interface
1256
- * @export
1257
- */
1258
- const OrdersApiFp = function (configuration) {
1259
- const localVarAxiosParamCreator = OrdersApiAxiosParamCreator(configuration);
1260
- return {
1261
- /**
1262
- * Create a listing
1263
- * @summary Create a listing
1264
- * @param {string} chainName
1265
- * @param {CreateListingRequestBody} createListingRequestBody
1266
- * @param {*} [options] Override http request option.
1267
- * @throws {RequiredError}
1268
- */
1269
- async createListing(chainName, createListingRequestBody, options) {
1270
- const localVarAxiosArgs = await localVarAxiosParamCreator.createListing(chainName, createListingRequestBody, options);
1271
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1272
- },
1273
- /**
1274
- * Get a single listing by ID
1275
- * @summary Get a single listing by ID
1276
- * @param {string} chainName
1277
- * @param {string} listingId Global Order identifier
1278
- * @param {*} [options] Override http request option.
1279
- * @throws {RequiredError}
1280
- */
1281
- async getListing(chainName, listingId, options) {
1282
- const localVarAxiosArgs = await localVarAxiosParamCreator.getListing(chainName, listingId, options);
1283
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1284
- },
1285
- /**
1286
- * List all listings
1287
- * @summary List all listings
1288
- * @param {string} chainName
1289
- * @param {OrderStatus} [status] Order status to filter by
1290
- * @param {string} [sellItemContractAddress] Sell item contract address to filter by
1291
- * @param {string} [buyItemContractAddress] Buy item contract address to filter by
1292
- * @param {string} [sellItemTokenId] Sell item token identifier to filter by
1293
- * @param {number} [pageSize] Maximum number of orders to return per page
1294
- * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
1295
- * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
1296
- * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
1297
- * @param {*} [options] Override http request option.
1298
- * @throws {RequiredError}
1299
- */
1300
- async listListings(chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
1301
- const localVarAxiosArgs = await localVarAxiosParamCreator.listListings(chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options);
1302
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1303
- },
1304
- };
1305
- };
1306
- /**
1307
- * OrdersApi - factory interface
1308
- * @export
1309
- */
1310
- const OrdersApiFactory = function (configuration, basePath, axios) {
1311
- const localVarFp = OrdersApiFp(configuration);
1312
- return {
1313
- /**
1314
- * Create a listing
1315
- * @summary Create a listing
1316
- * @param {string} chainName
1317
- * @param {CreateListingRequestBody} createListingRequestBody
1318
- * @param {*} [options] Override http request option.
1319
- * @throws {RequiredError}
1320
- */
1321
- createListing(chainName, createListingRequestBody, options) {
1322
- return localVarFp.createListing(chainName, createListingRequestBody, options).then((request) => request(axios, basePath));
1323
- },
1324
- /**
1325
- * Get a single listing by ID
1326
- * @summary Get a single listing by ID
1327
- * @param {string} chainName
1328
- * @param {string} listingId Global Order identifier
1329
- * @param {*} [options] Override http request option.
1330
- * @throws {RequiredError}
1331
- */
1332
- getListing(chainName, listingId, options) {
1333
- return localVarFp.getListing(chainName, listingId, options).then((request) => request(axios, basePath));
1334
- },
1335
- /**
1336
- * List all listings
1337
- * @summary List all listings
1338
- * @param {string} chainName
1339
- * @param {OrderStatus} [status] Order status to filter by
1340
- * @param {string} [sellItemContractAddress] Sell item contract address to filter by
1341
- * @param {string} [buyItemContractAddress] Buy item contract address to filter by
1342
- * @param {string} [sellItemTokenId] Sell item token identifier to filter by
1343
- * @param {number} [pageSize] Maximum number of orders to return per page
1344
- * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
1345
- * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
1346
- * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
1347
- * @param {*} [options] Override http request option.
1348
- * @throws {RequiredError}
1349
- */
1350
- listListings(chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
1351
- return localVarFp.listListings(chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options).then((request) => request(axios, basePath));
1352
- },
1353
- };
1354
- };
1355
- /**
1356
- * OrdersApi - object-oriented interface
1357
- * @export
1358
- * @class OrdersApi
1359
- * @extends {BaseAPI}
1360
- */
1361
- class OrdersApi extends BaseAPI {
1362
- /**
1363
- * Create a listing
1364
- * @summary Create a listing
1365
- * @param {OrdersApiCreateListingRequest} requestParameters Request parameters.
1366
- * @param {*} [options] Override http request option.
1367
- * @throws {RequiredError}
1368
- * @memberof OrdersApi
1369
- */
1370
- createListing(requestParameters, options) {
1371
- return OrdersApiFp(this.configuration).createListing(requestParameters.chainName, requestParameters.createListingRequestBody, options).then((request) => request(this.axios, this.basePath));
1372
- }
1373
- /**
1374
- * Get a single listing by ID
1375
- * @summary Get a single listing by ID
1376
- * @param {OrdersApiGetListingRequest} requestParameters Request parameters.
1377
- * @param {*} [options] Override http request option.
1378
- * @throws {RequiredError}
1379
- * @memberof OrdersApi
1380
- */
1381
- getListing(requestParameters, options) {
1382
- return OrdersApiFp(this.configuration).getListing(requestParameters.chainName, requestParameters.listingId, options).then((request) => request(this.axios, this.basePath));
1383
- }
1384
- /**
1385
- * List all listings
1386
- * @summary List all listings
1387
- * @param {OrdersApiListListingsRequest} requestParameters Request parameters.
1388
- * @param {*} [options] Override http request option.
1389
- * @throws {RequiredError}
1390
- * @memberof OrdersApi
1391
- */
1392
- listListings(requestParameters, options) {
1393
- return OrdersApiFp(this.configuration).listListings(requestParameters.chainName, requestParameters.status, requestParameters.sellItemContractAddress, requestParameters.buyItemContractAddress, requestParameters.sellItemTokenId, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(this.axios, this.basePath));
1394
- }
1395
- }
1396
-
1397
- /* tslint:disable */
1398
- /* eslint-disable */
1399
- /**
1400
- * Immutable X API
1401
- * Immutable Multi Rollup API
1402
- *
1403
- * The version of the OpenAPI document: 1.0.0
1404
- * Contact: support@immutable.com
1405
- *
1406
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1407
- * https://openapi-generator.tech
1408
- * Do not edit the class manually.
1409
- */
1410
- /**
1411
- * PassportApi - axios parameter creator
1412
- * @export
1413
- */
1414
- const PassportApiAxiosParamCreator = function (configuration) {
1415
- return {
1416
- /**
1417
- * Create a counterfactual address for a user based on their Ethereum address
1418
- * @summary Create a counterfactual address
1419
- * @param {CreateCounterfactualAddressRequest} createCounterfactualAddressRequest
1420
- * @param {*} [options] Override http request option.
1421
- * @throws {RequiredError}
1422
- */
1423
- createCounterfactualAddress: async (createCounterfactualAddressRequest, options = {}) => {
1424
- // verify required parameter 'createCounterfactualAddressRequest' is not null or undefined
1425
- assertParamExists('createCounterfactualAddress', 'createCounterfactualAddressRequest', createCounterfactualAddressRequest);
1426
- const localVarPath = `/passport-mr/v1/counterfactual-address`;
1427
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1428
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1429
- let baseOptions;
1430
- if (configuration) {
1431
- baseOptions = configuration.baseOptions;
1432
- }
1433
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1434
- const localVarHeaderParameter = {};
1435
- const localVarQueryParameter = {};
1436
- // authentication BearerAuth required
1437
- // http bearer authentication required
1438
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
1439
- localVarHeaderParameter['Content-Type'] = 'application/json';
1440
- setSearchParams(localVarUrlObj, localVarQueryParameter);
1441
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1442
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1443
- localVarRequestOptions.data = serializeDataIfNeeded(createCounterfactualAddressRequest, localVarRequestOptions, configuration);
1444
- return {
1445
- url: toPathString(localVarUrlObj),
1446
- options: localVarRequestOptions,
1447
- };
1448
- },
1449
- };
1450
- };
1451
- /**
1452
- * PassportApi - functional programming interface
1453
- * @export
1454
- */
1455
- const PassportApiFp = function (configuration) {
1456
- const localVarAxiosParamCreator = PassportApiAxiosParamCreator(configuration);
1457
- return {
1458
- /**
1459
- * Create a counterfactual address for a user based on their Ethereum address
1460
- * @summary Create a counterfactual address
1461
- * @param {CreateCounterfactualAddressRequest} createCounterfactualAddressRequest
1462
- * @param {*} [options] Override http request option.
1463
- * @throws {RequiredError}
1464
- */
1465
- async createCounterfactualAddress(createCounterfactualAddressRequest, options) {
1466
- const localVarAxiosArgs = await localVarAxiosParamCreator.createCounterfactualAddress(createCounterfactualAddressRequest, options);
1467
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1468
- },
1469
- };
1470
- };
1471
- /**
1472
- * PassportApi - factory interface
1473
- * @export
1474
- */
1475
- const PassportApiFactory = function (configuration, basePath, axios) {
1476
- const localVarFp = PassportApiFp(configuration);
1477
- return {
1478
- /**
1479
- * Create a counterfactual address for a user based on their Ethereum address
1480
- * @summary Create a counterfactual address
1481
- * @param {CreateCounterfactualAddressRequest} createCounterfactualAddressRequest
1482
- * @param {*} [options] Override http request option.
1483
- * @throws {RequiredError}
1484
- */
1485
- createCounterfactualAddress(createCounterfactualAddressRequest, options) {
1486
- return localVarFp.createCounterfactualAddress(createCounterfactualAddressRequest, options).then((request) => request(axios, basePath));
1487
- },
1488
- };
1489
- };
1490
- /**
1491
- * PassportApi - object-oriented interface
1492
- * @export
1493
- * @class PassportApi
1494
- * @extends {BaseAPI}
1495
- */
1496
- class PassportApi extends BaseAPI {
1497
- /**
1498
- * Create a counterfactual address for a user based on their Ethereum address
1499
- * @summary Create a counterfactual address
1500
- * @param {PassportApiCreateCounterfactualAddressRequest} requestParameters Request parameters.
1501
- * @param {*} [options] Override http request option.
1502
- * @throws {RequiredError}
1503
- * @memberof PassportApi
1504
- */
1505
- createCounterfactualAddress(requestParameters, options) {
1506
- return PassportApiFp(this.configuration).createCounterfactualAddress(requestParameters.createCounterfactualAddressRequest, options).then((request) => request(this.axios, this.basePath));
1507
- }
1508
- }
1509
-
1510
- /* tslint:disable */
1511
- /* eslint-disable */
1512
- /**
1513
- * Immutable X API
1514
- * Immutable Multi Rollup API
1515
- *
1516
- * The version of the OpenAPI document: 1.0.0
1517
- * Contact: support@immutable.com
1518
- *
1519
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1520
- * https://openapi-generator.tech
1521
- * Do not edit the class manually.
1522
- */
1523
- /**
1524
- * TokensApi - axios parameter creator
1525
- * @export
1526
- */
1527
- const TokensApiAxiosParamCreator = function (configuration) {
1528
- return {
1529
- /**
1530
- * Get single ERC20 token
1531
- * @summary Get single ERC20 token
1532
- * @param {string} contractAddress The address of contract
1533
- * @param {string} chainName The name of chain
1534
- * @param {*} [options] Override http request option.
1535
- * @throws {RequiredError}
1536
- */
1537
- getERC20Token: async (contractAddress, chainName, options = {}) => {
1538
- // verify required parameter 'contractAddress' is not null or undefined
1539
- assertParamExists('getERC20Token', 'contractAddress', contractAddress);
1540
- // verify required parameter 'chainName' is not null or undefined
1541
- assertParamExists('getERC20Token', 'chainName', chainName);
1542
- const localVarPath = `/v1/chains/{chain_name}/tokens/{contract_address}`
1543
- .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
1544
- .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1545
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1546
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1547
- let baseOptions;
1548
- if (configuration) {
1549
- baseOptions = configuration.baseOptions;
1550
- }
1551
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1552
- const localVarHeaderParameter = {};
1553
- const localVarQueryParameter = {};
1554
- setSearchParams(localVarUrlObj, localVarQueryParameter);
1555
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1556
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1557
- return {
1558
- url: toPathString(localVarUrlObj),
1559
- options: localVarRequestOptions,
1560
- };
1561
- },
1562
- /**
1563
- * List ERC20 tokens
1564
- * @summary List ERC20 tokens
1565
- * @param {string} chainName The name of chain
1566
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1567
- * @param {number} [pageSize] Maximum number of items to return
1568
- * @param {*} [options] Override http request option.
1569
- * @throws {RequiredError}
1570
- */
1571
- listERC20Tokens: async (chainName, pageCursor, pageSize, options = {}) => {
1572
- // verify required parameter 'chainName' is not null or undefined
1573
- assertParamExists('listERC20Tokens', 'chainName', chainName);
1574
- const localVarPath = `/v1/chains/{chain_name}/tokens`
1575
- .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1576
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1577
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1578
- let baseOptions;
1579
- if (configuration) {
1580
- baseOptions = configuration.baseOptions;
1581
- }
1582
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1583
- const localVarHeaderParameter = {};
1584
- const localVarQueryParameter = {};
1585
- if (pageCursor !== undefined) {
1586
- localVarQueryParameter['page_cursor'] = pageCursor;
1587
- }
1588
- if (pageSize !== undefined) {
1589
- localVarQueryParameter['page_size'] = pageSize;
1590
- }
1591
- setSearchParams(localVarUrlObj, localVarQueryParameter);
1592
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1593
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1594
- return {
1595
- url: toPathString(localVarUrlObj),
1596
- options: localVarRequestOptions,
1597
- };
1598
- },
1599
- };
1600
- };
1601
- /**
1602
- * TokensApi - functional programming interface
1603
- * @export
1604
- */
1605
- const TokensApiFp = function (configuration) {
1606
- const localVarAxiosParamCreator = TokensApiAxiosParamCreator(configuration);
1607
- return {
1608
- /**
1609
- * Get single ERC20 token
1610
- * @summary Get single ERC20 token
1611
- * @param {string} contractAddress The address of contract
1612
- * @param {string} chainName The name of chain
1613
- * @param {*} [options] Override http request option.
1614
- * @throws {RequiredError}
1615
- */
1616
- async getERC20Token(contractAddress, chainName, options) {
1617
- const localVarAxiosArgs = await localVarAxiosParamCreator.getERC20Token(contractAddress, chainName, options);
1618
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1619
- },
1620
- /**
1621
- * List ERC20 tokens
1622
- * @summary List ERC20 tokens
1623
- * @param {string} chainName The name of chain
1624
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1625
- * @param {number} [pageSize] Maximum number of items to return
1626
- * @param {*} [options] Override http request option.
1627
- * @throws {RequiredError}
1628
- */
1629
- async listERC20Tokens(chainName, pageCursor, pageSize, options) {
1630
- const localVarAxiosArgs = await localVarAxiosParamCreator.listERC20Tokens(chainName, pageCursor, pageSize, options);
1631
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1632
- },
1633
- };
1634
- };
1635
- /**
1636
- * TokensApi - factory interface
1637
- * @export
1638
- */
1639
- const TokensApiFactory = function (configuration, basePath, axios) {
1640
- const localVarFp = TokensApiFp(configuration);
1641
- return {
1642
- /**
1643
- * Get single ERC20 token
1644
- * @summary Get single ERC20 token
1645
- * @param {string} contractAddress The address of contract
1646
- * @param {string} chainName The name of chain
1647
- * @param {*} [options] Override http request option.
1648
- * @throws {RequiredError}
1649
- */
1650
- getERC20Token(contractAddress, chainName, options) {
1651
- return localVarFp.getERC20Token(contractAddress, chainName, options).then((request) => request(axios, basePath));
1652
- },
1653
- /**
1654
- * List ERC20 tokens
1655
- * @summary List ERC20 tokens
1656
- * @param {string} chainName The name of chain
1657
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1658
- * @param {number} [pageSize] Maximum number of items to return
1659
- * @param {*} [options] Override http request option.
1660
- * @throws {RequiredError}
1661
- */
1662
- listERC20Tokens(chainName, pageCursor, pageSize, options) {
1663
- return localVarFp.listERC20Tokens(chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
1664
- },
1665
- };
1666
- };
1667
- /**
1668
- * TokensApi - object-oriented interface
1669
- * @export
1670
- * @class TokensApi
1671
- * @extends {BaseAPI}
1672
- */
1673
- class TokensApi extends BaseAPI {
1674
- /**
1675
- * Get single ERC20 token
1676
- * @summary Get single ERC20 token
1677
- * @param {TokensApiGetERC20TokenRequest} requestParameters Request parameters.
1678
- * @param {*} [options] Override http request option.
1679
- * @throws {RequiredError}
1680
- * @memberof TokensApi
1681
- */
1682
- getERC20Token(requestParameters, options) {
1683
- return TokensApiFp(this.configuration).getERC20Token(requestParameters.contractAddress, requestParameters.chainName, options).then((request) => request(this.axios, this.basePath));
1684
- }
1685
- /**
1686
- * List ERC20 tokens
1687
- * @summary List ERC20 tokens
1688
- * @param {TokensApiListERC20TokensRequest} requestParameters Request parameters.
1689
- * @param {*} [options] Override http request option.
1690
- * @throws {RequiredError}
1691
- * @memberof TokensApi
1692
- */
1693
- listERC20Tokens(requestParameters, options) {
1694
- return TokensApiFp(this.configuration).listERC20Tokens(requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
1695
- }
1696
- }
1697
-
1698
- /* tslint:disable */
1699
- /* eslint-disable */
1700
- /**
1701
- * Immutable X API
1702
- * Immutable Multi Rollup API
1703
- *
1704
- * The version of the OpenAPI document: 1.0.0
1705
- * Contact: support@immutable.com
1706
- *
1707
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1708
- * https://openapi-generator.tech
1709
- * Do not edit the class manually.
1710
- */
1711
- class Configuration {
1712
- /**
1713
- * parameter for apiKey security
1714
- * @param name security name
1715
- * @memberof Configuration
1716
- */
1717
- apiKey;
1718
- /**
1719
- * parameter for basic security
1720
- *
1721
- * @type {string}
1722
- * @memberof Configuration
1723
- */
1724
- username;
1725
- /**
1726
- * parameter for basic security
1727
- *
1728
- * @type {string}
1729
- * @memberof Configuration
1730
- */
1731
- password;
1732
- /**
1733
- * parameter for oauth2 security
1734
- * @param name security name
1735
- * @param scopes oauth2 scope
1736
- * @memberof Configuration
1737
- */
1738
- accessToken;
1739
- /**
1740
- * override base path
1741
- *
1742
- * @type {string}
1743
- * @memberof Configuration
1744
- */
1745
- basePath;
1746
- /**
1747
- * base options for axios calls
1748
- *
1749
- * @type {any}
1750
- * @memberof Configuration
1751
- */
1752
- baseOptions;
1753
- /**
1754
- * The FormData constructor that will be used to create multipart form data
1755
- * requests. You can inject this here so that execution environments that
1756
- * do not support the FormData class can still run the generated client.
1757
- *
1758
- * @type {new () => FormData}
1759
- */
1760
- formDataCtor;
1761
- constructor(param = {}) {
1762
- this.apiKey = param.apiKey;
1763
- this.username = param.username;
1764
- this.password = param.password;
1765
- this.accessToken = param.accessToken;
1766
- this.basePath = param.basePath;
1767
- this.baseOptions = param.baseOptions;
1768
- this.formDataCtor = param.formDataCtor;
1769
- }
1770
- /**
1771
- * Check if the given MIME is a JSON MIME.
1772
- * JSON MIME examples:
1773
- * application/json
1774
- * application/json; charset=UTF8
1775
- * APPLICATION/JSON
1776
- * application/vnd.company+json
1777
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
1778
- * @return True if the given MIME is JSON, false otherwise.
1779
- */
1780
- isJsonMime(mime) {
1781
- const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
1782
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
1783
- }
1784
- }
1785
-
1786
- /* tslint:disable */
1787
- /* eslint-disable */
1788
- /**
1789
- * Immutable X API
1790
- * Immutable Multi Rollup API
1791
- *
1792
- * The version of the OpenAPI document: 1.0.0
1793
- * Contact: support@immutable.com
1794
- *
1795
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1796
- * https://openapi-generator.tech
1797
- * Do not edit the class manually.
1798
- */
1799
- const APIError400AllOfCodeEnum = {
1800
- ValidationError: 'VALIDATION_ERROR'
1801
- };
1802
-
1803
- /* tslint:disable */
1804
- /* eslint-disable */
1805
- /**
1806
- * Immutable X API
1807
- * Immutable Multi Rollup API
1808
- *
1809
- * The version of the OpenAPI document: 1.0.0
1810
- * Contact: support@immutable.com
1811
- *
1812
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1813
- * https://openapi-generator.tech
1814
- * Do not edit the class manually.
1815
- */
1816
- const APIError401AllOfCodeEnum = {
1817
- UnauthorisedRequest: 'UNAUTHORISED_REQUEST'
1818
- };
1819
-
1820
- /* tslint:disable */
1821
- /* eslint-disable */
1822
- /**
1823
- * Immutable X API
1824
- * Immutable Multi Rollup API
1825
- *
1826
- * The version of the OpenAPI document: 1.0.0
1827
- * Contact: support@immutable.com
1828
- *
1829
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1830
- * https://openapi-generator.tech
1831
- * Do not edit the class manually.
1832
- */
1833
- const APIError403AllOfCodeEnum = {
1834
- AuthenticationError: 'AUTHENTICATION_ERROR'
1835
- };
1836
-
1837
- /* tslint:disable */
1838
- /* eslint-disable */
1839
- /**
1840
- * Immutable X API
1841
- * Immutable Multi Rollup API
1842
- *
1843
- * The version of the OpenAPI document: 1.0.0
1844
- * Contact: support@immutable.com
1845
- *
1846
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1847
- * https://openapi-generator.tech
1848
- * Do not edit the class manually.
1849
- */
1850
- const APIError404AllOfCodeEnum = {
1851
- ResourceNotFound: 'RESOURCE_NOT_FOUND'
1852
- };
1853
-
1854
- /* tslint:disable */
1855
- /* eslint-disable */
1856
- /**
1857
- * Immutable X API
1858
- * Immutable Multi Rollup API
1859
- *
1860
- * The version of the OpenAPI document: 1.0.0
1861
- * Contact: support@immutable.com
1862
- *
1863
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1864
- * https://openapi-generator.tech
1865
- * Do not edit the class manually.
1866
- */
1867
- const APIError429AllOfCodeEnum = {
1868
- TooManyRequestsError: 'TOO_MANY_REQUESTS_ERROR'
1869
- };
1870
-
1871
- /* tslint:disable */
1872
- /* eslint-disable */
1873
- /**
1874
- * Immutable X API
1875
- * Immutable Multi Rollup API
1876
- *
1877
- * The version of the OpenAPI document: 1.0.0
1878
- * Contact: support@immutable.com
1879
- *
1880
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1881
- * https://openapi-generator.tech
1882
- * Do not edit the class manually.
1883
- */
1884
- const APIError500AllOfCodeEnum = {
1885
- InternalServerError: 'INTERNAL_SERVER_ERROR'
1886
- };
1887
-
1888
- /* tslint:disable */
1889
- /* eslint-disable */
1890
- /**
1891
- * Immutable X API
1892
- * Immutable Multi Rollup API
1893
- *
1894
- * The version of the OpenAPI document: 1.0.0
1895
- * Contact: support@immutable.com
1896
- *
1897
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1898
- * https://openapi-generator.tech
1899
- * Do not edit the class manually.
1900
- */
1901
- /**
1902
- * The activity type
1903
- * @export
1904
- * @enum {string}
1905
- */
1906
- const ActivityType = {
1907
- Mint: 'mint',
1908
- Burn: 'burn',
1909
- Transfer: 'transfer',
1910
- Sale: 'sale'
1911
- };
1912
-
1913
- /* tslint:disable */
1914
- /* eslint-disable */
1915
- /**
1916
- * Immutable X API
1917
- * Immutable Multi Rollup API
1918
- *
1919
- * The version of the OpenAPI document: 1.0.0
1920
- * Contact: support@immutable.com
1921
- *
1922
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1923
- * https://openapi-generator.tech
1924
- * Do not edit the class manually.
1925
- */
1926
- /**
1927
- * The collection contract type
1928
- * @export
1929
- * @enum {string}
1930
- */
1931
- const CollectionContractType = {
1932
- Erc721: 'ERC721'
1933
- };
1934
-
1935
- /* tslint:disable */
1936
- /* eslint-disable */
1937
- /**
1938
- * Immutable X API
1939
- * Immutable Multi Rollup API
1940
- *
1941
- * The version of the OpenAPI document: 1.0.0
1942
- * Contact: support@immutable.com
1943
- *
1944
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1945
- * https://openapi-generator.tech
1946
- * Do not edit the class manually.
1947
- */
1948
- const CreateOrderProtocolDataOrderTypeEnum = {
1949
- FullRestricted: 'FULL_RESTRICTED'
1950
- };
1951
-
1952
- /* tslint:disable */
1953
- /* eslint-disable */
1954
- /**
1955
- * Immutable X API
1956
- * Immutable Multi Rollup API
1957
- *
1958
- * The version of the OpenAPI document: 1.0.0
1959
- * Contact: support@immutable.com
1960
- *
1961
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1962
- * https://openapi-generator.tech
1963
- * Do not edit the class manually.
1964
- */
1965
- const ERC20ItemItemTypeEnum = {
1966
- Erc20: 'ERC20'
1967
- };
1968
-
1969
- /* tslint:disable */
1970
- /* eslint-disable */
1971
- /**
1972
- * Immutable X API
1973
- * Immutable Multi Rollup API
1974
- *
1975
- * The version of the OpenAPI document: 1.0.0
1976
- * Contact: support@immutable.com
1977
- *
1978
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1979
- * https://openapi-generator.tech
1980
- * Do not edit the class manually.
1981
- */
1982
- const ERC721ItemItemTypeEnum = {
1983
- Erc721: 'ERC721'
1984
- };
1985
-
1986
- /* tslint:disable */
1987
- /* eslint-disable */
1988
- /**
1989
- * Immutable X API
1990
- * Immutable Multi Rollup API
1991
- *
1992
- * The version of the OpenAPI document: 1.0.0
1993
- * Contact: support@immutable.com
1994
- *
1995
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1996
- * https://openapi-generator.tech
1997
- * Do not edit the class manually.
1998
- */
1999
- const FeeFeeTypeEnum = {
2000
- Royalty: 'ROYALTY'
2001
- };
2002
-
2003
- /* tslint:disable */
2004
- /* eslint-disable */
2005
- /**
2006
- * Immutable X API
2007
- * Immutable Multi Rollup API
2008
- *
2009
- * The version of the OpenAPI document: 1.0.0
2010
- * Contact: support@immutable.com
2011
- *
2012
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2013
- * https://openapi-generator.tech
2014
- * Do not edit the class manually.
2015
- */
2016
- /**
2017
- * The contract type for an NFT
2018
- * @export
2019
- * @enum {string}
2020
- */
2021
- const NFTContractType = {
2022
- Erc721: 'ERC721'
2023
- };
2024
-
2025
- /* tslint:disable */
2026
- /* eslint-disable */
2027
- /**
2028
- * Immutable X API
2029
- * Immutable Multi Rollup API
2030
- *
2031
- * The version of the OpenAPI document: 1.0.0
2032
- * Contact: support@immutable.com
2033
- *
2034
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2035
- * https://openapi-generator.tech
2036
- * Do not edit the class manually.
2037
- */
2038
- const NativeItemItemTypeEnum = {
2039
- Native: 'NATIVE'
2040
- };
2041
-
2042
- /* tslint:disable */
2043
- /* eslint-disable */
2044
- /**
2045
- * Immutable X API
2046
- * Immutable Multi Rollup API
2047
- *
2048
- * The version of the OpenAPI document: 1.0.0
2049
- * Contact: support@immutable.com
2050
- *
2051
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2052
- * https://openapi-generator.tech
2053
- * Do not edit the class manually.
2054
- */
2055
- /**
2056
- * The Order status
2057
- * @export
2058
- * @enum {string}
2059
- */
2060
- const OrderStatus = {
2061
- Pending: 'PENDING',
2062
- Active: 'ACTIVE',
2063
- Inactive: 'INACTIVE',
2064
- Filled: 'FILLED',
2065
- Cancelled: 'CANCELLED',
2066
- Expired: 'EXPIRED'
2067
- };
2068
-
2069
- /* tslint:disable */
2070
- /* eslint-disable */
2071
- /**
2072
- * Immutable X API
2073
- * Immutable Multi Rollup API
2074
- *
2075
- * The version of the OpenAPI document: 1.0.0
2076
- * Contact: support@immutable.com
2077
- *
2078
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2079
- * https://openapi-generator.tech
2080
- * Do not edit the class manually.
2081
- */
2082
- const SaleFeeTypeEnum = {
2083
- Royalty: 'ROYALTY'
2084
- };
2085
-
2086
- /* tslint:disable */
2087
- /* eslint-disable */
2088
- /**
2089
- * Immutable X API
2090
- * Immutable Multi Rollup API
2091
- *
2092
- * The version of the OpenAPI document: 1.0.0
2093
- * Contact: support@immutable.com
2094
- *
2095
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2096
- * https://openapi-generator.tech
2097
- * Do not edit the class manually.
2098
- */
2099
- /**
2100
- * The contract type for a token
2101
- * @export
2102
- * @enum {string}
2103
- */
2104
- const TokenContractType = {
2105
- Erc20: 'ERC20'
2106
- };
2107
-
2108
- /* tslint:disable */
2109
- /* eslint-disable */
2110
- /**
2111
- * Immutable X API
2112
- * Immutable Multi Rollup API
2113
- *
2114
- * The version of the OpenAPI document: 1.0.0
2115
- * Contact: support@immutable.com
2116
- *
2117
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2118
- * https://openapi-generator.tech
2119
- * Do not edit the class manually.
2120
- */
2121
-
2122
- var index = /*#__PURE__*/Object.freeze({
2123
- __proto__: null,
2124
- APIError400AllOfCodeEnum: APIError400AllOfCodeEnum,
2125
- APIError401AllOfCodeEnum: APIError401AllOfCodeEnum,
2126
- APIError403AllOfCodeEnum: APIError403AllOfCodeEnum,
2127
- APIError404AllOfCodeEnum: APIError404AllOfCodeEnum,
2128
- APIError429AllOfCodeEnum: APIError429AllOfCodeEnum,
2129
- APIError500AllOfCodeEnum: APIError500AllOfCodeEnum,
2130
- ActivitiesApi: ActivitiesApi,
2131
- ActivitiesApiAxiosParamCreator: ActivitiesApiAxiosParamCreator,
2132
- ActivitiesApiFactory: ActivitiesApiFactory,
2133
- ActivitiesApiFp: ActivitiesApiFp,
2134
- ActivityType: ActivityType,
2135
- ChainsApi: ChainsApi,
2136
- ChainsApiAxiosParamCreator: ChainsApiAxiosParamCreator,
2137
- ChainsApiFactory: ChainsApiFactory,
2138
- ChainsApiFp: ChainsApiFp,
2139
- CollectionContractType: CollectionContractType,
2140
- CollectionsApi: CollectionsApi,
2141
- CollectionsApiAxiosParamCreator: CollectionsApiAxiosParamCreator,
2142
- CollectionsApiFactory: CollectionsApiFactory,
2143
- CollectionsApiFp: CollectionsApiFp,
2144
- Configuration: Configuration,
2145
- CreateOrderProtocolDataOrderTypeEnum: CreateOrderProtocolDataOrderTypeEnum,
2146
- ERC20ItemItemTypeEnum: ERC20ItemItemTypeEnum,
2147
- ERC721ItemItemTypeEnum: ERC721ItemItemTypeEnum,
2148
- FeeFeeTypeEnum: FeeFeeTypeEnum,
2149
- NFTContractType: NFTContractType,
2150
- NativeItemItemTypeEnum: NativeItemItemTypeEnum,
2151
- NftOwnersApi: NftOwnersApi,
2152
- NftOwnersApiAxiosParamCreator: NftOwnersApiAxiosParamCreator,
2153
- NftOwnersApiFactory: NftOwnersApiFactory,
2154
- NftOwnersApiFp: NftOwnersApiFp,
2155
- NftsApi: NftsApi,
2156
- NftsApiAxiosParamCreator: NftsApiAxiosParamCreator,
2157
- NftsApiFactory: NftsApiFactory,
2158
- NftsApiFp: NftsApiFp,
2159
- OrderStatus: OrderStatus,
2160
- OrdersApi: OrdersApi,
2161
- OrdersApiAxiosParamCreator: OrdersApiAxiosParamCreator,
2162
- OrdersApiFactory: OrdersApiFactory,
2163
- OrdersApiFp: OrdersApiFp,
2164
- PassportApi: PassportApi,
2165
- PassportApiAxiosParamCreator: PassportApiAxiosParamCreator,
2166
- PassportApiFactory: PassportApiFactory,
2167
- PassportApiFp: PassportApiFp,
2168
- SaleFeeTypeEnum: SaleFeeTypeEnum,
2169
- TokenContractType: TokenContractType,
2170
- TokensApi: TokensApi,
2171
- TokensApiAxiosParamCreator: TokensApiAxiosParamCreator,
2172
- TokensApiFactory: TokensApiFactory,
2173
- TokensApiFp: TokensApiFp
2174
- });
2175
-
2176
- var Environment;
2177
- (function (Environment) {
2178
- Environment["PRODUCTION"] = "production";
2179
- Environment["SANDBOX"] = "sandbox";
2180
- })(Environment || (Environment = {}));
2181
-
2182
- /**
2183
- * Custom Error class that is returned from the API when a request fails
2184
- */
2185
- class APIError extends Error {
2186
- code;
2187
- details;
2188
- link;
2189
- traceId;
2190
- constructor({ message, code, details, link, trace_id: traceId, }) {
2191
- super(message);
2192
- this.code = code;
2193
- this.details = details;
2194
- this.link = link;
2195
- this.traceId = traceId;
2196
- }
2197
- }
2198
-
2199
- /* eslint-disable implicit-arrow-linebreak */
2200
- const defaultHeaders = {
2201
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.1.9-alpha.3',
2202
- };
2203
- /**
2204
- * createAPIConfiguration to create a custom Configuration
2205
- * other than the production and sandbox defined below.
2206
- */
2207
- const createAPIConfiguration = ({ basePath, headers: baseHeaders, }) => {
2208
- if (!basePath.trim()) {
2209
- throw Error('basePath can not be empty');
2210
- }
2211
- const headers = { ...(baseHeaders || {}), ...defaultHeaders };
2212
- const configParams = {
2213
- basePath,
2214
- baseOptions: { headers },
2215
- };
2216
- return new index.Configuration(configParams);
2217
- };
2218
- const production = () => createAPIConfiguration({
2219
- basePath: 'https://indexer-mr.dev.imtbl.com/v1', // TODO update before mainnet release
2220
- });
2221
- const sandbox = () => createAPIConfiguration({
2222
- basePath: 'https://indexer-mr.dev.imtbl.com/v1', // TODO update before testnet release
2223
- });
2224
- class BlockchainDataConfiguration {
2225
- apiConfig;
2226
- baseConfig;
2227
- constructor({ baseConfig, overrides }) {
2228
- this.baseConfig = baseConfig;
2229
- if (overrides) {
2230
- this.apiConfig = createAPIConfiguration(overrides);
2231
- }
2232
- else {
2233
- switch (baseConfig.environment) {
2234
- case Environment.SANDBOX: {
2235
- this.apiConfig = sandbox();
2236
- break;
2237
- }
2238
- case Environment.PRODUCTION: {
2239
- this.apiConfig = production();
2240
- break;
2241
- }
2242
- default: {
2243
- this.apiConfig = sandbox();
2244
- }
2245
- }
2246
- }
2247
- }
2248
- }
2249
-
2250
- /* eslint-disable @typescript-eslint/naming-convention */
2251
- /**
2252
- * [Formats an error in the APIError shape](https://axios-http.com/docs/handling_errors)
2253
- * @param error - The Error object thrown by the request
2254
- * @returns APIError
2255
- */
2256
- function formatError(error) {
2257
- if (globalAxios.isAxiosError(error) && error.response) {
2258
- const apiError = error.response.data;
2259
- if (apiError.code && apiError.message) {
2260
- return new APIError({
2261
- code: apiError.code,
2262
- message: apiError.message,
2263
- details: apiError.details || null,
2264
- link: apiError.link || '',
2265
- trace_id: apiError.trace_id || '',
2266
- });
2267
- }
2268
- return new APIError({
2269
- code: error.code ?? error.response?.status.toString() ?? 'unknown_error_code',
2270
- message: String(error),
2271
- details: null,
2272
- link: '',
2273
- trace_id: '',
2274
- });
2275
- }
2276
- return new APIError({
2277
- code: 'unknown_error_code',
2278
- message: String(error),
2279
- details: null,
2280
- link: '',
2281
- trace_id: '',
2282
- });
2283
- }
2284
-
2285
- class BlockchainData {
2286
- config;
2287
- activities;
2288
- chains;
2289
- collections;
2290
- nfts;
2291
- nftOwners;
2292
- tokens;
2293
- constructor(moduleConfig) {
2294
- this.config = new BlockchainDataConfiguration(moduleConfig);
2295
- this.activities = new index.ActivitiesApi(this.config.apiConfig);
2296
- this.chains = new index.ChainsApi(this.config.apiConfig);
2297
- this.collections = new index.CollectionsApi(this.config.apiConfig);
2298
- this.nfts = new index.NftsApi(this.config.apiConfig);
2299
- this.nftOwners = new index.NftOwnersApi(this.config.apiConfig);
2300
- this.tokens = new index.TokensApi(this.config.apiConfig);
2301
- }
2302
- /**
2303
- * List all activities
2304
- * @param request - the request object containing the parameters to be provided in the API request
2305
- * @returns a promise that resolves with a list of activities
2306
- * @throws {@link index.APIError}
2307
- */
2308
- async listActivities(request) {
2309
- return await this.activities
2310
- .listActivities(request)
2311
- .then((res) => res.data)
2312
- .catch((err) => {
2313
- throw formatError(err);
2314
- });
2315
- }
2316
- /**
2317
- * Get a single activity by ID
2318
- * @param request - the request object containing the parameters to be provided in the API request
2319
- * @returns a promise that resolves with a single activity
2320
- * @throws {@link index.APIError}
2321
- */
2322
- async getActivity(request) {
2323
- return await this.activities
2324
- .getActivity(request)
2325
- .then((res) => res.data)
2326
- .catch((err) => {
2327
- throw formatError(err);
2328
- });
2329
- }
2330
- /**
2331
- * List supported chains
2332
- * @param request - the request object containing the parameters to be provided in the API request
2333
- * @returns a promise that resolves with a list of supported chains
2334
- * @throws {@link index.APIError}
2335
- */
2336
- async listChains(request) {
2337
- return await this.chains
2338
- .listChains(request)
2339
- .then((res) => res.data)
2340
- .catch((err) => {
2341
- throw formatError(err);
2342
- });
2343
- }
2344
- /**
2345
- * List all collections
2346
- * @param request - the request object containing the parameters to be provided in the API request
2347
- * @returns a promise that resolves with a list of collections
2348
- * @throws {@link index.APIError}
2349
- */
2350
- async listCollections(request) {
2351
- return await this.collections
2352
- .listCollections(request)
2353
- .then((res) => res.data)
2354
- .catch((err) => {
2355
- throw formatError(err);
2356
- });
2357
- }
2358
- /**
2359
- * Get collection by contract address
2360
- * @param request - the request object containing the parameters to be provided in the API request
2361
- * @returns a promise that resolves with a single collection
2362
- * @throws {@link index.APIError}
2363
- */
2364
- async getCollection(request) {
2365
- return await this.collections
2366
- .getCollection(request)
2367
- .then((res) => res.data)
2368
- .catch((err) => {
2369
- throw formatError(err);
2370
- });
2371
- }
2372
- /**
2373
- * Get NFT by token ID
2374
- * @param request - the request object containing the parameters to be provided in the API request
2375
- * @returns a promise that resolves with a single NFT
2376
- * @throws {@link index.APIError}
2377
- */
2378
- async getNFT(request) {
2379
- return await this.nfts
2380
- .getNFT(request)
2381
- .then((res) => res.data)
2382
- .catch((err) => {
2383
- throw formatError(err);
2384
- });
2385
- }
2386
- /**
2387
- * List NFTs by contract address
2388
- * @param request - the request object containing the parameters to be provided in the API request
2389
- * @returns a promise that resolves with a list of NFTs
2390
- * @throws {@link index.APIError}
2391
- */
2392
- async listNFTs(request) {
2393
- return await this.nfts
2394
- .listNFTs(request)
2395
- .then((res) => res.data)
2396
- .catch((err) => {
2397
- throw formatError(err);
2398
- });
2399
- }
2400
- /**
2401
- * List NFTs by account address
2402
- * @param request - the request object containing the parameters to be provided in the API request
2403
- * @returns a promise that resolves with a list of NFTs
2404
- * @throws {@link index.APIError}
2405
- */
2406
- async listNFTsByAccountAddress(request) {
2407
- return await this.nfts
2408
- .listNFTsByAccountAddress(request)
2409
- .then((res) => res.data)
2410
- .catch((err) => {
2411
- throw formatError(err);
2412
- });
2413
- }
2414
- /**
2415
- * List NFT owners by token ID
2416
- * @param request - the request object containing the parameters to be provided in the API request
2417
- * @returns a promise that resolves with a list of NFT owners
2418
- * @throws {@link index.APIError}
2419
- */
2420
- async listNFTOwners(request) {
2421
- return await this.nftOwners
2422
- .listNFTOwners(request)
2423
- .then((res) => res.data)
2424
- .catch((err) => {
2425
- throw formatError(err);
2426
- });
2427
- }
2428
- /**
2429
- * List ERC20 Token contracts
2430
- * @param request - the request object containing the parameters to be provided in the API request
2431
- * @returns a promise that resolves with a list of ERC20 Tokens
2432
- * @throws {@link index.APIError}
2433
- */
2434
- async listTokens(request) {
2435
- return await this.tokens
2436
- .listERC20Tokens(request)
2437
- .then((res) => res.data)
2438
- .catch((err) => {
2439
- throw formatError(err);
2440
- });
2441
- }
2442
- /**
2443
- * Get details for an ERC20 Token by contract address
2444
- * @param request - the request object containing the parameters to be provided in the API request
2445
- * @returns a promise that resolves with a list of ERC20 Tokens
2446
- * @throws {@link index.APIError}
2447
- */
2448
- async getToken(request) {
2449
- return await this.tokens
2450
- .getERC20Token(request)
2451
- .then((res) => res.data)
2452
- .catch((err) => {
2453
- throw formatError(err);
2454
- });
2455
- }
2456
- }
2457
-
2458
- export { APIError, BlockchainData };