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