@imtbl/sdk 0.4.4 → 0.6.1-alpha

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