@imtbl/sdk 0.17.4 → 0.17.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { ethers, ContractFactory, utils, Contract as Contract$1, BigNumber as BigNumber$1, providers, constants as constants$1 } from 'ethers';
2
- import $7v2Z6$axios, { HttpStatusCode } from 'axios';
2
+ import globalAxios, { HttpStatusCode } from 'axios';
3
3
  import { Web3Provider, JsonRpcProvider } from '@ethersproject/providers';
4
4
  import $7v2Z6$metamaskdetectprovider from '@metamask/detect-provider';
5
5
  import { TradeType, Token, CurrencyAmount, Percent } from '@uniswap/sdk-core';
@@ -15885,7 +15885,7 @@ const getRequestBody = (options) => {
15885
15885
  return undefined;
15886
15886
  };
15887
15887
  const sendRequest = async (config, options, url, body, formData, headers, onCancel) => {
15888
- const source = $7v2Z6$axios.CancelToken.source();
15888
+ const source = globalAxios.CancelToken.source();
15889
15889
  const requestConfig = {
15890
15890
  url,
15891
15891
  headers,
@@ -15896,7 +15896,7 @@ const sendRequest = async (config, options, url, body, formData, headers, onCanc
15896
15896
  };
15897
15897
  onCancel(() => source.cancel('The user aborted a request.'));
15898
15898
  try {
15899
- return await $7v2Z6$axios.request(requestConfig);
15899
+ return await globalAxios.request(requestConfig);
15900
15900
  }
15901
15901
  catch (error) {
15902
15902
  const axiosError = error;
@@ -16178,7 +16178,7 @@ var Fee;
16178
16178
  /**
16179
16179
  * The Order status
16180
16180
  */
16181
- var OrderStatus;
16181
+ var OrderStatus$1;
16182
16182
  (function (OrderStatus) {
16183
16183
  OrderStatus["PENDING"] = "PENDING";
16184
16184
  OrderStatus["ACTIVE"] = "ACTIVE";
@@ -16186,7 +16186,7 @@ var OrderStatus;
16186
16186
  OrderStatus["FILLED"] = "FILLED";
16187
16187
  OrderStatus["CANCELLED"] = "CANCELLED";
16188
16188
  OrderStatus["EXPIRED"] = "EXPIRED";
16189
- })(OrderStatus || (OrderStatus = {}));
16189
+ })(OrderStatus$1 || (OrderStatus$1 = {}));
16190
16190
 
16191
16191
  /* istanbul ignore file */
16192
16192
  /* tslint:disable */
@@ -16935,7 +16935,7 @@ class Orderbook {
16935
16935
  }
16936
16936
  const extraData = fulfillmentDataRes.result[0].extra_data;
16937
16937
  const orderResult = fulfillmentDataRes.result[0].order;
16938
- if (orderResult.status !== OrderStatus.ACTIVE) {
16938
+ if (orderResult.status !== OrderStatus$1.ACTIVE) {
16939
16939
  throw new Error(`Cannot fulfil order that is not active. Current status: ${orderResult.status}`);
16940
16940
  }
16941
16941
  return this.seaport.fulfillOrder(orderResult, takerAddress, extraData);
@@ -16949,9 +16949,9 @@ class Orderbook {
16949
16949
  */
16950
16950
  async cancelOrder(listingId, accountAddress) {
16951
16951
  const orderResult = await this.apiClient.getListing(listingId);
16952
- if (orderResult.result.status !== OrderStatus.ACTIVE
16953
- && orderResult.result.status !== OrderStatus.INACTIVE
16954
- && orderResult.result.status !== OrderStatus.PENDING) {
16952
+ if (orderResult.result.status !== OrderStatus$1.ACTIVE
16953
+ && orderResult.result.status !== OrderStatus$1.INACTIVE
16954
+ && orderResult.result.status !== OrderStatus$1.PENDING) {
16955
16955
  throw new Error(`Cannot cancel order with status ${orderResult.result.status}`);
16956
16956
  }
16957
16957
  if (orderResult.result.account_address !== accountAddress.toLowerCase()) {
@@ -16970,6 +16970,2843 @@ const constants = {
16970
16970
  estimatedFulfillmentGasGwei: ESTIMATED_FULFILLMENT_GAS_GWEI,
16971
16971
  };
16972
16972
 
16973
+ /* tslint:disable */
16974
+ /* eslint-disable */
16975
+ /**
16976
+ * Immutable zkEVM API
16977
+ * Immutable Multi Rollup API
16978
+ *
16979
+ * The version of the OpenAPI document: 1.0.0
16980
+ * Contact: support@immutable.com
16981
+ *
16982
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
16983
+ * https://openapi-generator.tech
16984
+ * Do not edit the class manually.
16985
+ */
16986
+ // Some imports not used depending on template conditions
16987
+ // @ts-ignore
16988
+ const BASE_PATH = "https://api.sandbox.immutable.com".replace(/\/+$/, "");
16989
+ /**
16990
+ *
16991
+ * @export
16992
+ * @class BaseAPI
16993
+ */
16994
+ class BaseAPI {
16995
+ basePath;
16996
+ axios;
16997
+ configuration;
16998
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
16999
+ this.basePath = basePath;
17000
+ this.axios = axios;
17001
+ if (configuration) {
17002
+ this.configuration = configuration;
17003
+ this.basePath = configuration.basePath || this.basePath;
17004
+ }
17005
+ }
17006
+ }
17007
+ /**
17008
+ *
17009
+ * @export
17010
+ * @class RequiredError
17011
+ * @extends {Error}
17012
+ */
17013
+ class RequiredError extends Error {
17014
+ field;
17015
+ name = "RequiredError";
17016
+ constructor(field, msg) {
17017
+ super(msg);
17018
+ this.field = field;
17019
+ }
17020
+ }
17021
+
17022
+ /* tslint:disable */
17023
+ /* eslint-disable */
17024
+ /**
17025
+ * Immutable zkEVM API
17026
+ * Immutable Multi Rollup API
17027
+ *
17028
+ * The version of the OpenAPI document: 1.0.0
17029
+ * Contact: support@immutable.com
17030
+ *
17031
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
17032
+ * https://openapi-generator.tech
17033
+ * Do not edit the class manually.
17034
+ */
17035
+ /**
17036
+ *
17037
+ * @export
17038
+ */
17039
+ const DUMMY_BASE_URL = 'https://example.com';
17040
+ /**
17041
+ *
17042
+ * @throws {RequiredError}
17043
+ * @export
17044
+ */
17045
+ const assertParamExists = function (functionName, paramName, paramValue) {
17046
+ if (paramValue === null || paramValue === undefined) {
17047
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
17048
+ }
17049
+ };
17050
+ /**
17051
+ *
17052
+ * @export
17053
+ */
17054
+ const setBearerAuthToObject = async function (object, configuration) {
17055
+ if (configuration && configuration.accessToken) {
17056
+ const accessToken = typeof configuration.accessToken === 'function'
17057
+ ? await configuration.accessToken()
17058
+ : await configuration.accessToken;
17059
+ object["Authorization"] = "Bearer " + accessToken;
17060
+ }
17061
+ };
17062
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
17063
+ if (typeof parameter === "object") {
17064
+ if (Array.isArray(parameter)) {
17065
+ parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
17066
+ }
17067
+ else {
17068
+ Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
17069
+ }
17070
+ }
17071
+ else {
17072
+ if (urlSearchParams.has(key)) {
17073
+ urlSearchParams.append(key, parameter);
17074
+ }
17075
+ else {
17076
+ urlSearchParams.set(key, parameter);
17077
+ }
17078
+ }
17079
+ }
17080
+ /**
17081
+ *
17082
+ * @export
17083
+ */
17084
+ const setSearchParams = function (url, ...objects) {
17085
+ const searchParams = new URLSearchParams(url.search);
17086
+ setFlattenedQueryParams(searchParams, objects);
17087
+ url.search = searchParams.toString();
17088
+ };
17089
+ /**
17090
+ *
17091
+ * @export
17092
+ */
17093
+ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
17094
+ const nonString = typeof value !== 'string';
17095
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
17096
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
17097
+ : nonString;
17098
+ return needsSerialization
17099
+ ? JSON.stringify(value !== undefined ? value : {})
17100
+ : (value || "");
17101
+ };
17102
+ /**
17103
+ *
17104
+ * @export
17105
+ */
17106
+ const toPathString = function (url) {
17107
+ return url.pathname + url.search + url.hash;
17108
+ };
17109
+ /**
17110
+ *
17111
+ * @export
17112
+ */
17113
+ const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
17114
+ return (axios = globalAxios, basePath = BASE_PATH) => {
17115
+ const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url };
17116
+ return axios.request(axiosRequestArgs);
17117
+ };
17118
+ };
17119
+
17120
+ /* tslint:disable */
17121
+ /* eslint-disable */
17122
+ /**
17123
+ * Immutable zkEVM API
17124
+ * Immutable Multi Rollup API
17125
+ *
17126
+ * The version of the OpenAPI document: 1.0.0
17127
+ * Contact: support@immutable.com
17128
+ *
17129
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
17130
+ * https://openapi-generator.tech
17131
+ * Do not edit the class manually.
17132
+ */
17133
+ /**
17134
+ * ActivitiesApi - axios parameter creator
17135
+ * @export
17136
+ */
17137
+ const ActivitiesApiAxiosParamCreator = function (configuration) {
17138
+ return {
17139
+ /**
17140
+ * Get a single activity by ID
17141
+ * @summary Get a single activity by ID
17142
+ * @param {string} chainName The name of chain
17143
+ * @param {string} activityId The id of activity
17144
+ * @param {*} [options] Override http request option.
17145
+ * @throws {RequiredError}
17146
+ */
17147
+ getActivity: async (chainName, activityId, options = {}) => {
17148
+ // verify required parameter 'chainName' is not null or undefined
17149
+ assertParamExists('getActivity', 'chainName', chainName);
17150
+ // verify required parameter 'activityId' is not null or undefined
17151
+ assertParamExists('getActivity', 'activityId', activityId);
17152
+ const localVarPath = `/v1/chains/{chain_name}/activities/{activity_id}`
17153
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)))
17154
+ .replace(`{${"activity_id"}}`, encodeURIComponent(String(activityId)));
17155
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
17156
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
17157
+ let baseOptions;
17158
+ if (configuration) {
17159
+ baseOptions = configuration.baseOptions;
17160
+ }
17161
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
17162
+ const localVarHeaderParameter = {};
17163
+ const localVarQueryParameter = {};
17164
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
17165
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
17166
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
17167
+ return {
17168
+ url: toPathString(localVarUrlObj),
17169
+ options: localVarRequestOptions,
17170
+ };
17171
+ },
17172
+ /**
17173
+ * List all activities
17174
+ * @summary List all activities
17175
+ * @param {string} chainName The name of chain
17176
+ * @param {string} [contractAddress] The contract address of NFT or ERC20 Token
17177
+ * @param {string} [tokenId] An `uint256` token id as string
17178
+ * @param {string} [accountAddress] The account address activity contains
17179
+ * @param {ActivityType} [activityType] The activity type
17180
+ * @param {string} [fromIndexedAt] From indexed at including given date
17181
+ * @param {string} [toIndexedAt] To indexed at including given date
17182
+ * @param {string} [transactionHash] The transaction hash of activity
17183
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17184
+ * @param {number} [pageSize] Maximum number of items to return
17185
+ * @param {*} [options] Override http request option.
17186
+ * @throws {RequiredError}
17187
+ */
17188
+ listActivities: async (chainName, contractAddress, tokenId, accountAddress, activityType, fromIndexedAt, toIndexedAt, transactionHash, pageCursor, pageSize, options = {}) => {
17189
+ // verify required parameter 'chainName' is not null or undefined
17190
+ assertParamExists('listActivities', 'chainName', chainName);
17191
+ const localVarPath = `/v1/chains/{chain_name}/activities`
17192
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
17193
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
17194
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
17195
+ let baseOptions;
17196
+ if (configuration) {
17197
+ baseOptions = configuration.baseOptions;
17198
+ }
17199
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
17200
+ const localVarHeaderParameter = {};
17201
+ const localVarQueryParameter = {};
17202
+ if (contractAddress !== undefined) {
17203
+ localVarQueryParameter['contract_address'] = contractAddress;
17204
+ }
17205
+ if (tokenId !== undefined) {
17206
+ localVarQueryParameter['token_id'] = tokenId;
17207
+ }
17208
+ if (accountAddress !== undefined) {
17209
+ localVarQueryParameter['account_address'] = accountAddress;
17210
+ }
17211
+ if (activityType !== undefined) {
17212
+ localVarQueryParameter['activity_type'] = activityType;
17213
+ }
17214
+ if (fromIndexedAt !== undefined) {
17215
+ localVarQueryParameter['from_indexed_at'] = (fromIndexedAt instanceof Date) ?
17216
+ fromIndexedAt.toISOString() :
17217
+ fromIndexedAt;
17218
+ }
17219
+ if (toIndexedAt !== undefined) {
17220
+ localVarQueryParameter['to_indexed_at'] = (toIndexedAt instanceof Date) ?
17221
+ toIndexedAt.toISOString() :
17222
+ toIndexedAt;
17223
+ }
17224
+ if (transactionHash !== undefined) {
17225
+ localVarQueryParameter['transaction_hash'] = transactionHash;
17226
+ }
17227
+ if (pageCursor !== undefined) {
17228
+ localVarQueryParameter['page_cursor'] = pageCursor;
17229
+ }
17230
+ if (pageSize !== undefined) {
17231
+ localVarQueryParameter['page_size'] = pageSize;
17232
+ }
17233
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
17234
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
17235
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
17236
+ return {
17237
+ url: toPathString(localVarUrlObj),
17238
+ options: localVarRequestOptions,
17239
+ };
17240
+ },
17241
+ };
17242
+ };
17243
+ /**
17244
+ * ActivitiesApi - functional programming interface
17245
+ * @export
17246
+ */
17247
+ const ActivitiesApiFp = function (configuration) {
17248
+ const localVarAxiosParamCreator = ActivitiesApiAxiosParamCreator(configuration);
17249
+ return {
17250
+ /**
17251
+ * Get a single activity by ID
17252
+ * @summary Get a single activity by ID
17253
+ * @param {string} chainName The name of chain
17254
+ * @param {string} activityId The id of activity
17255
+ * @param {*} [options] Override http request option.
17256
+ * @throws {RequiredError}
17257
+ */
17258
+ async getActivity(chainName, activityId, options) {
17259
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getActivity(chainName, activityId, options);
17260
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
17261
+ },
17262
+ /**
17263
+ * List all activities
17264
+ * @summary List all activities
17265
+ * @param {string} chainName The name of chain
17266
+ * @param {string} [contractAddress] The contract address of NFT or ERC20 Token
17267
+ * @param {string} [tokenId] An `uint256` token id as string
17268
+ * @param {string} [accountAddress] The account address activity contains
17269
+ * @param {ActivityType} [activityType] The activity type
17270
+ * @param {string} [fromIndexedAt] From indexed at including given date
17271
+ * @param {string} [toIndexedAt] To indexed at including given date
17272
+ * @param {string} [transactionHash] The transaction hash of activity
17273
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17274
+ * @param {number} [pageSize] Maximum number of items to return
17275
+ * @param {*} [options] Override http request option.
17276
+ * @throws {RequiredError}
17277
+ */
17278
+ async listActivities(chainName, contractAddress, tokenId, accountAddress, activityType, fromIndexedAt, toIndexedAt, transactionHash, pageCursor, pageSize, options) {
17279
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listActivities(chainName, contractAddress, tokenId, accountAddress, activityType, fromIndexedAt, toIndexedAt, transactionHash, pageCursor, pageSize, options);
17280
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
17281
+ },
17282
+ };
17283
+ };
17284
+ /**
17285
+ * ActivitiesApi - factory interface
17286
+ * @export
17287
+ */
17288
+ const ActivitiesApiFactory = function (configuration, basePath, axios) {
17289
+ const localVarFp = ActivitiesApiFp(configuration);
17290
+ return {
17291
+ /**
17292
+ * Get a single activity by ID
17293
+ * @summary Get a single activity by ID
17294
+ * @param {string} chainName The name of chain
17295
+ * @param {string} activityId The id of activity
17296
+ * @param {*} [options] Override http request option.
17297
+ * @throws {RequiredError}
17298
+ */
17299
+ getActivity(chainName, activityId, options) {
17300
+ return localVarFp.getActivity(chainName, activityId, options).then((request) => request(axios, basePath));
17301
+ },
17302
+ /**
17303
+ * List all activities
17304
+ * @summary List all activities
17305
+ * @param {string} chainName The name of chain
17306
+ * @param {string} [contractAddress] The contract address of NFT or ERC20 Token
17307
+ * @param {string} [tokenId] An `uint256` token id as string
17308
+ * @param {string} [accountAddress] The account address activity contains
17309
+ * @param {ActivityType} [activityType] The activity type
17310
+ * @param {string} [fromIndexedAt] From indexed at including given date
17311
+ * @param {string} [toIndexedAt] To indexed at including given date
17312
+ * @param {string} [transactionHash] The transaction hash of activity
17313
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17314
+ * @param {number} [pageSize] Maximum number of items to return
17315
+ * @param {*} [options] Override http request option.
17316
+ * @throws {RequiredError}
17317
+ */
17318
+ listActivities(chainName, contractAddress, tokenId, accountAddress, activityType, fromIndexedAt, toIndexedAt, transactionHash, pageCursor, pageSize, options) {
17319
+ return localVarFp.listActivities(chainName, contractAddress, tokenId, accountAddress, activityType, fromIndexedAt, toIndexedAt, transactionHash, pageCursor, pageSize, options).then((request) => request(axios, basePath));
17320
+ },
17321
+ };
17322
+ };
17323
+ /**
17324
+ * ActivitiesApi - object-oriented interface
17325
+ * @export
17326
+ * @class ActivitiesApi
17327
+ * @extends {BaseAPI}
17328
+ */
17329
+ class ActivitiesApi extends BaseAPI {
17330
+ /**
17331
+ * Get a single activity by ID
17332
+ * @summary Get a single activity by ID
17333
+ * @param {ActivitiesApiGetActivityRequest} requestParameters Request parameters.
17334
+ * @param {*} [options] Override http request option.
17335
+ * @throws {RequiredError}
17336
+ * @memberof ActivitiesApi
17337
+ */
17338
+ getActivity(requestParameters, options) {
17339
+ return ActivitiesApiFp(this.configuration).getActivity(requestParameters.chainName, requestParameters.activityId, options).then((request) => request(this.axios, this.basePath));
17340
+ }
17341
+ /**
17342
+ * List all activities
17343
+ * @summary List all activities
17344
+ * @param {ActivitiesApiListActivitiesRequest} requestParameters Request parameters.
17345
+ * @param {*} [options] Override http request option.
17346
+ * @throws {RequiredError}
17347
+ * @memberof ActivitiesApi
17348
+ */
17349
+ listActivities(requestParameters, options) {
17350
+ 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));
17351
+ }
17352
+ }
17353
+
17354
+ /* tslint:disable */
17355
+ /* eslint-disable */
17356
+ /**
17357
+ * Immutable zkEVM API
17358
+ * Immutable Multi Rollup API
17359
+ *
17360
+ * The version of the OpenAPI document: 1.0.0
17361
+ * Contact: support@immutable.com
17362
+ *
17363
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
17364
+ * https://openapi-generator.tech
17365
+ * Do not edit the class manually.
17366
+ */
17367
+ /**
17368
+ * ChainsApi - axios parameter creator
17369
+ * @export
17370
+ */
17371
+ const ChainsApiAxiosParamCreator = function (configuration) {
17372
+ return {
17373
+ /**
17374
+ * List supported chains
17375
+ * @summary List supported chains
17376
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17377
+ * @param {number} [pageSize] Maximum number of items to return
17378
+ * @param {*} [options] Override http request option.
17379
+ * @throws {RequiredError}
17380
+ */
17381
+ listChains: async (pageCursor, pageSize, options = {}) => {
17382
+ const localVarPath = `/v1/chains`;
17383
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
17384
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
17385
+ let baseOptions;
17386
+ if (configuration) {
17387
+ baseOptions = configuration.baseOptions;
17388
+ }
17389
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
17390
+ const localVarHeaderParameter = {};
17391
+ const localVarQueryParameter = {};
17392
+ if (pageCursor !== undefined) {
17393
+ localVarQueryParameter['page_cursor'] = pageCursor;
17394
+ }
17395
+ if (pageSize !== undefined) {
17396
+ localVarQueryParameter['page_size'] = pageSize;
17397
+ }
17398
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
17399
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
17400
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
17401
+ return {
17402
+ url: toPathString(localVarUrlObj),
17403
+ options: localVarRequestOptions,
17404
+ };
17405
+ },
17406
+ };
17407
+ };
17408
+ /**
17409
+ * ChainsApi - functional programming interface
17410
+ * @export
17411
+ */
17412
+ const ChainsApiFp = function (configuration) {
17413
+ const localVarAxiosParamCreator = ChainsApiAxiosParamCreator(configuration);
17414
+ return {
17415
+ /**
17416
+ * List supported chains
17417
+ * @summary List supported chains
17418
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17419
+ * @param {number} [pageSize] Maximum number of items to return
17420
+ * @param {*} [options] Override http request option.
17421
+ * @throws {RequiredError}
17422
+ */
17423
+ async listChains(pageCursor, pageSize, options) {
17424
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listChains(pageCursor, pageSize, options);
17425
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
17426
+ },
17427
+ };
17428
+ };
17429
+ /**
17430
+ * ChainsApi - factory interface
17431
+ * @export
17432
+ */
17433
+ const ChainsApiFactory = function (configuration, basePath, axios) {
17434
+ const localVarFp = ChainsApiFp(configuration);
17435
+ return {
17436
+ /**
17437
+ * List supported chains
17438
+ * @summary List supported chains
17439
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17440
+ * @param {number} [pageSize] Maximum number of items to return
17441
+ * @param {*} [options] Override http request option.
17442
+ * @throws {RequiredError}
17443
+ */
17444
+ listChains(pageCursor, pageSize, options) {
17445
+ return localVarFp.listChains(pageCursor, pageSize, options).then((request) => request(axios, basePath));
17446
+ },
17447
+ };
17448
+ };
17449
+ /**
17450
+ * ChainsApi - object-oriented interface
17451
+ * @export
17452
+ * @class ChainsApi
17453
+ * @extends {BaseAPI}
17454
+ */
17455
+ class ChainsApi extends BaseAPI {
17456
+ /**
17457
+ * List supported chains
17458
+ * @summary List supported chains
17459
+ * @param {ChainsApiListChainsRequest} requestParameters Request parameters.
17460
+ * @param {*} [options] Override http request option.
17461
+ * @throws {RequiredError}
17462
+ * @memberof ChainsApi
17463
+ */
17464
+ listChains(requestParameters = {}, options) {
17465
+ return ChainsApiFp(this.configuration).listChains(requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
17466
+ }
17467
+ }
17468
+
17469
+ /* tslint:disable */
17470
+ /* eslint-disable */
17471
+ /**
17472
+ * Immutable zkEVM API
17473
+ * Immutable Multi Rollup API
17474
+ *
17475
+ * The version of the OpenAPI document: 1.0.0
17476
+ * Contact: support@immutable.com
17477
+ *
17478
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
17479
+ * https://openapi-generator.tech
17480
+ * Do not edit the class manually.
17481
+ */
17482
+ /**
17483
+ * CollectionsApi - axios parameter creator
17484
+ * @export
17485
+ */
17486
+ const CollectionsApiAxiosParamCreator = function (configuration) {
17487
+ return {
17488
+ /**
17489
+ * Get collection by contract address
17490
+ * @summary Get collection by contract address
17491
+ * @param {string} contractAddress The address contract
17492
+ * @param {string} chainName The name of chain
17493
+ * @param {*} [options] Override http request option.
17494
+ * @throws {RequiredError}
17495
+ */
17496
+ getCollection: async (contractAddress, chainName, options = {}) => {
17497
+ // verify required parameter 'contractAddress' is not null or undefined
17498
+ assertParamExists('getCollection', 'contractAddress', contractAddress);
17499
+ // verify required parameter 'chainName' is not null or undefined
17500
+ assertParamExists('getCollection', 'chainName', chainName);
17501
+ const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}`
17502
+ .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
17503
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
17504
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
17505
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
17506
+ let baseOptions;
17507
+ if (configuration) {
17508
+ baseOptions = configuration.baseOptions;
17509
+ }
17510
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
17511
+ const localVarHeaderParameter = {};
17512
+ const localVarQueryParameter = {};
17513
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
17514
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
17515
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
17516
+ return {
17517
+ url: toPathString(localVarUrlObj),
17518
+ options: localVarRequestOptions,
17519
+ };
17520
+ },
17521
+ /**
17522
+ * List all collections
17523
+ * @summary List all collections
17524
+ * @param {string} chainName The name of chain
17525
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17526
+ * @param {number} [pageSize] Maximum number of items to return
17527
+ * @param {*} [options] Override http request option.
17528
+ * @throws {RequiredError}
17529
+ */
17530
+ listCollections: async (chainName, pageCursor, pageSize, options = {}) => {
17531
+ // verify required parameter 'chainName' is not null or undefined
17532
+ assertParamExists('listCollections', 'chainName', chainName);
17533
+ const localVarPath = `/v1/chains/{chain_name}/collections`
17534
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
17535
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
17536
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
17537
+ let baseOptions;
17538
+ if (configuration) {
17539
+ baseOptions = configuration.baseOptions;
17540
+ }
17541
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
17542
+ const localVarHeaderParameter = {};
17543
+ const localVarQueryParameter = {};
17544
+ if (pageCursor !== undefined) {
17545
+ localVarQueryParameter['page_cursor'] = pageCursor;
17546
+ }
17547
+ if (pageSize !== undefined) {
17548
+ localVarQueryParameter['page_size'] = pageSize;
17549
+ }
17550
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
17551
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
17552
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
17553
+ return {
17554
+ url: toPathString(localVarUrlObj),
17555
+ options: localVarRequestOptions,
17556
+ };
17557
+ },
17558
+ /**
17559
+ * List collections by NFT owner account address
17560
+ * @summary List collections by NFT owner
17561
+ * @param {string} accountAddress Account address
17562
+ * @param {string} chainName The name of chain
17563
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17564
+ * @param {number} [pageSize] Maximum number of items to return
17565
+ * @param {*} [options] Override http request option.
17566
+ * @throws {RequiredError}
17567
+ */
17568
+ listCollectionsByNFTOwner: async (accountAddress, chainName, pageCursor, pageSize, options = {}) => {
17569
+ // verify required parameter 'accountAddress' is not null or undefined
17570
+ assertParamExists('listCollectionsByNFTOwner', 'accountAddress', accountAddress);
17571
+ // verify required parameter 'chainName' is not null or undefined
17572
+ assertParamExists('listCollectionsByNFTOwner', 'chainName', chainName);
17573
+ const localVarPath = `/v1/chains/{chain_name}/accounts/{account_address}/collections`
17574
+ .replace(`{${"account_address"}}`, encodeURIComponent(String(accountAddress)))
17575
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
17576
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
17577
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
17578
+ let baseOptions;
17579
+ if (configuration) {
17580
+ baseOptions = configuration.baseOptions;
17581
+ }
17582
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
17583
+ const localVarHeaderParameter = {};
17584
+ const localVarQueryParameter = {};
17585
+ if (pageCursor !== undefined) {
17586
+ localVarQueryParameter['page_cursor'] = pageCursor;
17587
+ }
17588
+ if (pageSize !== undefined) {
17589
+ localVarQueryParameter['page_size'] = pageSize;
17590
+ }
17591
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
17592
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
17593
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
17594
+ return {
17595
+ url: toPathString(localVarUrlObj),
17596
+ options: localVarRequestOptions,
17597
+ };
17598
+ },
17599
+ };
17600
+ };
17601
+ /**
17602
+ * CollectionsApi - functional programming interface
17603
+ * @export
17604
+ */
17605
+ const CollectionsApiFp = function (configuration) {
17606
+ const localVarAxiosParamCreator = CollectionsApiAxiosParamCreator(configuration);
17607
+ return {
17608
+ /**
17609
+ * Get collection by contract address
17610
+ * @summary Get collection by contract address
17611
+ * @param {string} contractAddress The address contract
17612
+ * @param {string} chainName The name of chain
17613
+ * @param {*} [options] Override http request option.
17614
+ * @throws {RequiredError}
17615
+ */
17616
+ async getCollection(contractAddress, chainName, options) {
17617
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCollection(contractAddress, chainName, options);
17618
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
17619
+ },
17620
+ /**
17621
+ * List all collections
17622
+ * @summary List all collections
17623
+ * @param {string} chainName The name of chain
17624
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17625
+ * @param {number} [pageSize] Maximum number of items to return
17626
+ * @param {*} [options] Override http request option.
17627
+ * @throws {RequiredError}
17628
+ */
17629
+ async listCollections(chainName, pageCursor, pageSize, options) {
17630
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listCollections(chainName, pageCursor, pageSize, options);
17631
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
17632
+ },
17633
+ /**
17634
+ * List collections by NFT owner account address
17635
+ * @summary List collections by NFT owner
17636
+ * @param {string} accountAddress Account address
17637
+ * @param {string} chainName The name of chain
17638
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17639
+ * @param {number} [pageSize] Maximum number of items to return
17640
+ * @param {*} [options] Override http request option.
17641
+ * @throws {RequiredError}
17642
+ */
17643
+ async listCollectionsByNFTOwner(accountAddress, chainName, pageCursor, pageSize, options) {
17644
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listCollectionsByNFTOwner(accountAddress, chainName, pageCursor, pageSize, options);
17645
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
17646
+ },
17647
+ };
17648
+ };
17649
+ /**
17650
+ * CollectionsApi - factory interface
17651
+ * @export
17652
+ */
17653
+ const CollectionsApiFactory = function (configuration, basePath, axios) {
17654
+ const localVarFp = CollectionsApiFp(configuration);
17655
+ return {
17656
+ /**
17657
+ * Get collection by contract address
17658
+ * @summary Get collection by contract address
17659
+ * @param {string} contractAddress The address contract
17660
+ * @param {string} chainName The name of chain
17661
+ * @param {*} [options] Override http request option.
17662
+ * @throws {RequiredError}
17663
+ */
17664
+ getCollection(contractAddress, chainName, options) {
17665
+ return localVarFp.getCollection(contractAddress, chainName, options).then((request) => request(axios, basePath));
17666
+ },
17667
+ /**
17668
+ * List all collections
17669
+ * @summary List all collections
17670
+ * @param {string} chainName The name of chain
17671
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17672
+ * @param {number} [pageSize] Maximum number of items to return
17673
+ * @param {*} [options] Override http request option.
17674
+ * @throws {RequiredError}
17675
+ */
17676
+ listCollections(chainName, pageCursor, pageSize, options) {
17677
+ return localVarFp.listCollections(chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
17678
+ },
17679
+ /**
17680
+ * List collections by NFT owner account address
17681
+ * @summary List collections by NFT owner
17682
+ * @param {string} accountAddress Account address
17683
+ * @param {string} chainName The name of chain
17684
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17685
+ * @param {number} [pageSize] Maximum number of items to return
17686
+ * @param {*} [options] Override http request option.
17687
+ * @throws {RequiredError}
17688
+ */
17689
+ listCollectionsByNFTOwner(accountAddress, chainName, pageCursor, pageSize, options) {
17690
+ return localVarFp.listCollectionsByNFTOwner(accountAddress, chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
17691
+ },
17692
+ };
17693
+ };
17694
+ /**
17695
+ * CollectionsApi - object-oriented interface
17696
+ * @export
17697
+ * @class CollectionsApi
17698
+ * @extends {BaseAPI}
17699
+ */
17700
+ class CollectionsApi extends BaseAPI {
17701
+ /**
17702
+ * Get collection by contract address
17703
+ * @summary Get collection by contract address
17704
+ * @param {CollectionsApiGetCollectionRequest} requestParameters Request parameters.
17705
+ * @param {*} [options] Override http request option.
17706
+ * @throws {RequiredError}
17707
+ * @memberof CollectionsApi
17708
+ */
17709
+ getCollection(requestParameters, options) {
17710
+ return CollectionsApiFp(this.configuration).getCollection(requestParameters.contractAddress, requestParameters.chainName, options).then((request) => request(this.axios, this.basePath));
17711
+ }
17712
+ /**
17713
+ * List all collections
17714
+ * @summary List all collections
17715
+ * @param {CollectionsApiListCollectionsRequest} requestParameters Request parameters.
17716
+ * @param {*} [options] Override http request option.
17717
+ * @throws {RequiredError}
17718
+ * @memberof CollectionsApi
17719
+ */
17720
+ listCollections(requestParameters, options) {
17721
+ return CollectionsApiFp(this.configuration).listCollections(requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
17722
+ }
17723
+ /**
17724
+ * List collections by NFT owner account address
17725
+ * @summary List collections by NFT owner
17726
+ * @param {CollectionsApiListCollectionsByNFTOwnerRequest} requestParameters Request parameters.
17727
+ * @param {*} [options] Override http request option.
17728
+ * @throws {RequiredError}
17729
+ * @memberof CollectionsApi
17730
+ */
17731
+ listCollectionsByNFTOwner(requestParameters, options) {
17732
+ return CollectionsApiFp(this.configuration).listCollectionsByNFTOwner(requestParameters.accountAddress, requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
17733
+ }
17734
+ }
17735
+
17736
+ /* tslint:disable */
17737
+ /* eslint-disable */
17738
+ /**
17739
+ * Immutable zkEVM API
17740
+ * Immutable Multi Rollup API
17741
+ *
17742
+ * The version of the OpenAPI document: 1.0.0
17743
+ * Contact: support@immutable.com
17744
+ *
17745
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
17746
+ * https://openapi-generator.tech
17747
+ * Do not edit the class manually.
17748
+ */
17749
+ /**
17750
+ * NftOwnersApi - axios parameter creator
17751
+ * @export
17752
+ */
17753
+ const NftOwnersApiAxiosParamCreator = function (configuration) {
17754
+ return {
17755
+ /**
17756
+ * List NFT owners by token ID
17757
+ * @summary List NFT owners by token ID
17758
+ * @param {string} contractAddress The address of contract
17759
+ * @param {string} tokenId An `uint256` token id as string
17760
+ * @param {string} chainName The name of chain
17761
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17762
+ * @param {number} [pageSize] Maximum number of items to return
17763
+ * @param {*} [options] Override http request option.
17764
+ * @throws {RequiredError}
17765
+ */
17766
+ listNFTOwners: async (contractAddress, tokenId, chainName, pageCursor, pageSize, options = {}) => {
17767
+ // verify required parameter 'contractAddress' is not null or undefined
17768
+ assertParamExists('listNFTOwners', 'contractAddress', contractAddress);
17769
+ // verify required parameter 'tokenId' is not null or undefined
17770
+ assertParamExists('listNFTOwners', 'tokenId', tokenId);
17771
+ // verify required parameter 'chainName' is not null or undefined
17772
+ assertParamExists('listNFTOwners', 'chainName', chainName);
17773
+ const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners`
17774
+ .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
17775
+ .replace(`{${"token_id"}}`, encodeURIComponent(String(tokenId)))
17776
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
17777
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
17778
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
17779
+ let baseOptions;
17780
+ if (configuration) {
17781
+ baseOptions = configuration.baseOptions;
17782
+ }
17783
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
17784
+ const localVarHeaderParameter = {};
17785
+ const localVarQueryParameter = {};
17786
+ if (pageCursor !== undefined) {
17787
+ localVarQueryParameter['page_cursor'] = pageCursor;
17788
+ }
17789
+ if (pageSize !== undefined) {
17790
+ localVarQueryParameter['page_size'] = pageSize;
17791
+ }
17792
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
17793
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
17794
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
17795
+ return {
17796
+ url: toPathString(localVarUrlObj),
17797
+ options: localVarRequestOptions,
17798
+ };
17799
+ },
17800
+ };
17801
+ };
17802
+ /**
17803
+ * NftOwnersApi - functional programming interface
17804
+ * @export
17805
+ */
17806
+ const NftOwnersApiFp = function (configuration) {
17807
+ const localVarAxiosParamCreator = NftOwnersApiAxiosParamCreator(configuration);
17808
+ return {
17809
+ /**
17810
+ * List NFT owners by token ID
17811
+ * @summary List NFT owners by token ID
17812
+ * @param {string} contractAddress The address of contract
17813
+ * @param {string} tokenId An `uint256` token id as string
17814
+ * @param {string} chainName The name of chain
17815
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17816
+ * @param {number} [pageSize] Maximum number of items to return
17817
+ * @param {*} [options] Override http request option.
17818
+ * @throws {RequiredError}
17819
+ */
17820
+ async listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options) {
17821
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options);
17822
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
17823
+ },
17824
+ };
17825
+ };
17826
+ /**
17827
+ * NftOwnersApi - factory interface
17828
+ * @export
17829
+ */
17830
+ const NftOwnersApiFactory = function (configuration, basePath, axios) {
17831
+ const localVarFp = NftOwnersApiFp(configuration);
17832
+ return {
17833
+ /**
17834
+ * List NFT owners by token ID
17835
+ * @summary List NFT owners by token ID
17836
+ * @param {string} contractAddress The address of contract
17837
+ * @param {string} tokenId An `uint256` token id as string
17838
+ * @param {string} chainName The name of chain
17839
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17840
+ * @param {number} [pageSize] Maximum number of items to return
17841
+ * @param {*} [options] Override http request option.
17842
+ * @throws {RequiredError}
17843
+ */
17844
+ listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options) {
17845
+ return localVarFp.listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
17846
+ },
17847
+ };
17848
+ };
17849
+ /**
17850
+ * NftOwnersApi - object-oriented interface
17851
+ * @export
17852
+ * @class NftOwnersApi
17853
+ * @extends {BaseAPI}
17854
+ */
17855
+ class NftOwnersApi extends BaseAPI {
17856
+ /**
17857
+ * List NFT owners by token ID
17858
+ * @summary List NFT owners by token ID
17859
+ * @param {NftOwnersApiListNFTOwnersRequest} requestParameters Request parameters.
17860
+ * @param {*} [options] Override http request option.
17861
+ * @throws {RequiredError}
17862
+ * @memberof NftOwnersApi
17863
+ */
17864
+ listNFTOwners(requestParameters, options) {
17865
+ return NftOwnersApiFp(this.configuration).listNFTOwners(requestParameters.contractAddress, requestParameters.tokenId, requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
17866
+ }
17867
+ }
17868
+
17869
+ /* tslint:disable */
17870
+ /* eslint-disable */
17871
+ /**
17872
+ * Immutable zkEVM API
17873
+ * Immutable Multi Rollup API
17874
+ *
17875
+ * The version of the OpenAPI document: 1.0.0
17876
+ * Contact: support@immutable.com
17877
+ *
17878
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
17879
+ * https://openapi-generator.tech
17880
+ * Do not edit the class manually.
17881
+ */
17882
+ /**
17883
+ * NftsApi - axios parameter creator
17884
+ * @export
17885
+ */
17886
+ const NftsApiAxiosParamCreator = function (configuration) {
17887
+ return {
17888
+ /**
17889
+ * Get NFT by token ID
17890
+ * @summary Get NFT by token ID
17891
+ * @param {string} contractAddress The address of NFT contract
17892
+ * @param {string} tokenId An `uint256` token id as string
17893
+ * @param {string} chainName The name of chain
17894
+ * @param {*} [options] Override http request option.
17895
+ * @throws {RequiredError}
17896
+ */
17897
+ getNFT: async (contractAddress, tokenId, chainName, options = {}) => {
17898
+ // verify required parameter 'contractAddress' is not null or undefined
17899
+ assertParamExists('getNFT', 'contractAddress', contractAddress);
17900
+ // verify required parameter 'tokenId' is not null or undefined
17901
+ assertParamExists('getNFT', 'tokenId', tokenId);
17902
+ // verify required parameter 'chainName' is not null or undefined
17903
+ assertParamExists('getNFT', 'chainName', chainName);
17904
+ const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}`
17905
+ .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
17906
+ .replace(`{${"token_id"}}`, encodeURIComponent(String(tokenId)))
17907
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
17908
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
17909
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
17910
+ let baseOptions;
17911
+ if (configuration) {
17912
+ baseOptions = configuration.baseOptions;
17913
+ }
17914
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
17915
+ const localVarHeaderParameter = {};
17916
+ const localVarQueryParameter = {};
17917
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
17918
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
17919
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
17920
+ return {
17921
+ url: toPathString(localVarUrlObj),
17922
+ options: localVarRequestOptions,
17923
+ };
17924
+ },
17925
+ /**
17926
+ * List NFTs by contract address
17927
+ * @summary List NFTs by contract address
17928
+ * @param {string} contractAddress Contract address
17929
+ * @param {string} chainName The name of chain
17930
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17931
+ * @param {number} [pageSize] Maximum number of items to return
17932
+ * @param {*} [options] Override http request option.
17933
+ * @throws {RequiredError}
17934
+ */
17935
+ listNFTs: async (contractAddress, chainName, pageCursor, pageSize, options = {}) => {
17936
+ // verify required parameter 'contractAddress' is not null or undefined
17937
+ assertParamExists('listNFTs', 'contractAddress', contractAddress);
17938
+ // verify required parameter 'chainName' is not null or undefined
17939
+ assertParamExists('listNFTs', 'chainName', chainName);
17940
+ const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts`
17941
+ .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
17942
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
17943
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
17944
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
17945
+ let baseOptions;
17946
+ if (configuration) {
17947
+ baseOptions = configuration.baseOptions;
17948
+ }
17949
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
17950
+ const localVarHeaderParameter = {};
17951
+ const localVarQueryParameter = {};
17952
+ if (pageCursor !== undefined) {
17953
+ localVarQueryParameter['page_cursor'] = pageCursor;
17954
+ }
17955
+ if (pageSize !== undefined) {
17956
+ localVarQueryParameter['page_size'] = pageSize;
17957
+ }
17958
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
17959
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
17960
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
17961
+ return {
17962
+ url: toPathString(localVarUrlObj),
17963
+ options: localVarRequestOptions,
17964
+ };
17965
+ },
17966
+ /**
17967
+ * List NFTs by account address
17968
+ * @summary List NFTs by account address
17969
+ * @param {string} accountAddress Account address
17970
+ * @param {string} chainName The name of chain
17971
+ * @param {string} [contractAddress] The address of contract
17972
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
17973
+ * @param {number} [pageSize] Maximum number of items to return
17974
+ * @param {*} [options] Override http request option.
17975
+ * @throws {RequiredError}
17976
+ */
17977
+ listNFTsByAccountAddress: async (accountAddress, chainName, contractAddress, pageCursor, pageSize, options = {}) => {
17978
+ // verify required parameter 'accountAddress' is not null or undefined
17979
+ assertParamExists('listNFTsByAccountAddress', 'accountAddress', accountAddress);
17980
+ // verify required parameter 'chainName' is not null or undefined
17981
+ assertParamExists('listNFTsByAccountAddress', 'chainName', chainName);
17982
+ const localVarPath = `/v1/chains/{chain_name}/accounts/{account_address}/nfts`
17983
+ .replace(`{${"account_address"}}`, encodeURIComponent(String(accountAddress)))
17984
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
17985
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
17986
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
17987
+ let baseOptions;
17988
+ if (configuration) {
17989
+ baseOptions = configuration.baseOptions;
17990
+ }
17991
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
17992
+ const localVarHeaderParameter = {};
17993
+ const localVarQueryParameter = {};
17994
+ if (contractAddress !== undefined) {
17995
+ localVarQueryParameter['contract_address'] = contractAddress;
17996
+ }
17997
+ if (pageCursor !== undefined) {
17998
+ localVarQueryParameter['page_cursor'] = pageCursor;
17999
+ }
18000
+ if (pageSize !== undefined) {
18001
+ localVarQueryParameter['page_size'] = pageSize;
18002
+ }
18003
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
18004
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18005
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
18006
+ return {
18007
+ url: toPathString(localVarUrlObj),
18008
+ options: localVarRequestOptions,
18009
+ };
18010
+ },
18011
+ };
18012
+ };
18013
+ /**
18014
+ * NftsApi - functional programming interface
18015
+ * @export
18016
+ */
18017
+ const NftsApiFp = function (configuration) {
18018
+ const localVarAxiosParamCreator = NftsApiAxiosParamCreator(configuration);
18019
+ return {
18020
+ /**
18021
+ * Get NFT by token ID
18022
+ * @summary Get NFT by token ID
18023
+ * @param {string} contractAddress The address of NFT contract
18024
+ * @param {string} tokenId An `uint256` token id as string
18025
+ * @param {string} chainName The name of chain
18026
+ * @param {*} [options] Override http request option.
18027
+ * @throws {RequiredError}
18028
+ */
18029
+ async getNFT(contractAddress, tokenId, chainName, options) {
18030
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getNFT(contractAddress, tokenId, chainName, options);
18031
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18032
+ },
18033
+ /**
18034
+ * List NFTs by contract address
18035
+ * @summary List NFTs by contract address
18036
+ * @param {string} contractAddress Contract address
18037
+ * @param {string} chainName The name of chain
18038
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
18039
+ * @param {number} [pageSize] Maximum number of items to return
18040
+ * @param {*} [options] Override http request option.
18041
+ * @throws {RequiredError}
18042
+ */
18043
+ async listNFTs(contractAddress, chainName, pageCursor, pageSize, options) {
18044
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTs(contractAddress, chainName, pageCursor, pageSize, options);
18045
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18046
+ },
18047
+ /**
18048
+ * List NFTs by account address
18049
+ * @summary List NFTs by account address
18050
+ * @param {string} accountAddress Account address
18051
+ * @param {string} chainName The name of chain
18052
+ * @param {string} [contractAddress] The address of contract
18053
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
18054
+ * @param {number} [pageSize] Maximum number of items to return
18055
+ * @param {*} [options] Override http request option.
18056
+ * @throws {RequiredError}
18057
+ */
18058
+ async listNFTsByAccountAddress(accountAddress, chainName, contractAddress, pageCursor, pageSize, options) {
18059
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTsByAccountAddress(accountAddress, chainName, contractAddress, pageCursor, pageSize, options);
18060
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18061
+ },
18062
+ };
18063
+ };
18064
+ /**
18065
+ * NftsApi - factory interface
18066
+ * @export
18067
+ */
18068
+ const NftsApiFactory = function (configuration, basePath, axios) {
18069
+ const localVarFp = NftsApiFp(configuration);
18070
+ return {
18071
+ /**
18072
+ * Get NFT by token ID
18073
+ * @summary Get NFT by token ID
18074
+ * @param {string} contractAddress The address of NFT contract
18075
+ * @param {string} tokenId An `uint256` token id as string
18076
+ * @param {string} chainName The name of chain
18077
+ * @param {*} [options] Override http request option.
18078
+ * @throws {RequiredError}
18079
+ */
18080
+ getNFT(contractAddress, tokenId, chainName, options) {
18081
+ return localVarFp.getNFT(contractAddress, tokenId, chainName, options).then((request) => request(axios, basePath));
18082
+ },
18083
+ /**
18084
+ * List NFTs by contract address
18085
+ * @summary List NFTs by contract address
18086
+ * @param {string} contractAddress Contract address
18087
+ * @param {string} chainName The name of chain
18088
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
18089
+ * @param {number} [pageSize] Maximum number of items to return
18090
+ * @param {*} [options] Override http request option.
18091
+ * @throws {RequiredError}
18092
+ */
18093
+ listNFTs(contractAddress, chainName, pageCursor, pageSize, options) {
18094
+ return localVarFp.listNFTs(contractAddress, chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
18095
+ },
18096
+ /**
18097
+ * List NFTs by account address
18098
+ * @summary List NFTs by account address
18099
+ * @param {string} accountAddress Account address
18100
+ * @param {string} chainName The name of chain
18101
+ * @param {string} [contractAddress] The address of contract
18102
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
18103
+ * @param {number} [pageSize] Maximum number of items to return
18104
+ * @param {*} [options] Override http request option.
18105
+ * @throws {RequiredError}
18106
+ */
18107
+ listNFTsByAccountAddress(accountAddress, chainName, contractAddress, pageCursor, pageSize, options) {
18108
+ return localVarFp.listNFTsByAccountAddress(accountAddress, chainName, contractAddress, pageCursor, pageSize, options).then((request) => request(axios, basePath));
18109
+ },
18110
+ };
18111
+ };
18112
+ /**
18113
+ * NftsApi - object-oriented interface
18114
+ * @export
18115
+ * @class NftsApi
18116
+ * @extends {BaseAPI}
18117
+ */
18118
+ class NftsApi extends BaseAPI {
18119
+ /**
18120
+ * Get NFT by token ID
18121
+ * @summary Get NFT by token ID
18122
+ * @param {NftsApiGetNFTRequest} requestParameters Request parameters.
18123
+ * @param {*} [options] Override http request option.
18124
+ * @throws {RequiredError}
18125
+ * @memberof NftsApi
18126
+ */
18127
+ getNFT(requestParameters, options) {
18128
+ return NftsApiFp(this.configuration).getNFT(requestParameters.contractAddress, requestParameters.tokenId, requestParameters.chainName, options).then((request) => request(this.axios, this.basePath));
18129
+ }
18130
+ /**
18131
+ * List NFTs by contract address
18132
+ * @summary List NFTs by contract address
18133
+ * @param {NftsApiListNFTsRequest} requestParameters Request parameters.
18134
+ * @param {*} [options] Override http request option.
18135
+ * @throws {RequiredError}
18136
+ * @memberof NftsApi
18137
+ */
18138
+ listNFTs(requestParameters, options) {
18139
+ return NftsApiFp(this.configuration).listNFTs(requestParameters.contractAddress, requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
18140
+ }
18141
+ /**
18142
+ * List NFTs by account address
18143
+ * @summary List NFTs by account address
18144
+ * @param {NftsApiListNFTsByAccountAddressRequest} requestParameters Request parameters.
18145
+ * @param {*} [options] Override http request option.
18146
+ * @throws {RequiredError}
18147
+ * @memberof NftsApi
18148
+ */
18149
+ listNFTsByAccountAddress(requestParameters, options) {
18150
+ return NftsApiFp(this.configuration).listNFTsByAccountAddress(requestParameters.accountAddress, requestParameters.chainName, requestParameters.contractAddress, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
18151
+ }
18152
+ }
18153
+
18154
+ /* tslint:disable */
18155
+ /* eslint-disable */
18156
+ /**
18157
+ * Immutable zkEVM API
18158
+ * Immutable Multi Rollup API
18159
+ *
18160
+ * The version of the OpenAPI document: 1.0.0
18161
+ * Contact: support@immutable.com
18162
+ *
18163
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
18164
+ * https://openapi-generator.tech
18165
+ * Do not edit the class manually.
18166
+ */
18167
+ /**
18168
+ * OrdersApi - axios parameter creator
18169
+ * @export
18170
+ */
18171
+ const OrdersApiAxiosParamCreator = function (configuration) {
18172
+ return {
18173
+ /**
18174
+ * Create a listing
18175
+ * @summary Create a listing
18176
+ * @param {string} chainName
18177
+ * @param {CreateListingRequestBody} createListingRequestBody
18178
+ * @param {*} [options] Override http request option.
18179
+ * @throws {RequiredError}
18180
+ */
18181
+ createListing: async (chainName, createListingRequestBody, options = {}) => {
18182
+ // verify required parameter 'chainName' is not null or undefined
18183
+ assertParamExists('createListing', 'chainName', chainName);
18184
+ // verify required parameter 'createListingRequestBody' is not null or undefined
18185
+ assertParamExists('createListing', 'createListingRequestBody', createListingRequestBody);
18186
+ const localVarPath = `/v1/chains/{chain_name}/orders/listings`
18187
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
18188
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
18189
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
18190
+ let baseOptions;
18191
+ if (configuration) {
18192
+ baseOptions = configuration.baseOptions;
18193
+ }
18194
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
18195
+ const localVarHeaderParameter = {};
18196
+ const localVarQueryParameter = {};
18197
+ localVarHeaderParameter['Content-Type'] = 'application/json';
18198
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
18199
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18200
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
18201
+ localVarRequestOptions.data = serializeDataIfNeeded(createListingRequestBody, localVarRequestOptions, configuration);
18202
+ return {
18203
+ url: toPathString(localVarUrlObj),
18204
+ options: localVarRequestOptions,
18205
+ };
18206
+ },
18207
+ /**
18208
+ * Retrieve signed fulfillment data based on the list of order IDs and corresponding fees.
18209
+ * @summary Retrieve fulfillment data for orders
18210
+ * @param {string} chainName
18211
+ * @param {Array<FulfillmentDataRequest>} fulfillmentDataRequest
18212
+ * @param {*} [options] Override http request option.
18213
+ * @throws {RequiredError}
18214
+ */
18215
+ fulfillmentData: async (chainName, fulfillmentDataRequest, options = {}) => {
18216
+ // verify required parameter 'chainName' is not null or undefined
18217
+ assertParamExists('fulfillmentData', 'chainName', chainName);
18218
+ // verify required parameter 'fulfillmentDataRequest' is not null or undefined
18219
+ assertParamExists('fulfillmentData', 'fulfillmentDataRequest', fulfillmentDataRequest);
18220
+ const localVarPath = `/v1/chains/{chain_name}/orders/fulfillment-data`
18221
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
18222
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
18223
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
18224
+ let baseOptions;
18225
+ if (configuration) {
18226
+ baseOptions = configuration.baseOptions;
18227
+ }
18228
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
18229
+ const localVarHeaderParameter = {};
18230
+ const localVarQueryParameter = {};
18231
+ localVarHeaderParameter['Content-Type'] = 'application/json';
18232
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
18233
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18234
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
18235
+ localVarRequestOptions.data = serializeDataIfNeeded(fulfillmentDataRequest, localVarRequestOptions, configuration);
18236
+ return {
18237
+ url: toPathString(localVarUrlObj),
18238
+ options: localVarRequestOptions,
18239
+ };
18240
+ },
18241
+ /**
18242
+ * Get a single listing by ID
18243
+ * @summary Get a single listing by ID
18244
+ * @param {string} chainName
18245
+ * @param {string} listingId Global Order identifier
18246
+ * @param {*} [options] Override http request option.
18247
+ * @throws {RequiredError}
18248
+ */
18249
+ getListing: async (chainName, listingId, options = {}) => {
18250
+ // verify required parameter 'chainName' is not null or undefined
18251
+ assertParamExists('getListing', 'chainName', chainName);
18252
+ // verify required parameter 'listingId' is not null or undefined
18253
+ assertParamExists('getListing', 'listingId', listingId);
18254
+ const localVarPath = `/v1/chains/{chain_name}/orders/listings/{listing_id}`
18255
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)))
18256
+ .replace(`{${"listing_id"}}`, encodeURIComponent(String(listingId)));
18257
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
18258
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
18259
+ let baseOptions;
18260
+ if (configuration) {
18261
+ baseOptions = configuration.baseOptions;
18262
+ }
18263
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
18264
+ const localVarHeaderParameter = {};
18265
+ const localVarQueryParameter = {};
18266
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
18267
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18268
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
18269
+ return {
18270
+ url: toPathString(localVarUrlObj),
18271
+ options: localVarRequestOptions,
18272
+ };
18273
+ },
18274
+ /**
18275
+ * Get a single trade by ID
18276
+ * @summary Get a single trade by ID
18277
+ * @param {string} chainName
18278
+ * @param {string} tradeId Global Trade identifier
18279
+ * @param {*} [options] Override http request option.
18280
+ * @throws {RequiredError}
18281
+ */
18282
+ getTrade: async (chainName, tradeId, options = {}) => {
18283
+ // verify required parameter 'chainName' is not null or undefined
18284
+ assertParamExists('getTrade', 'chainName', chainName);
18285
+ // verify required parameter 'tradeId' is not null or undefined
18286
+ assertParamExists('getTrade', 'tradeId', tradeId);
18287
+ const localVarPath = `/v1/chains/{chain_name}/trades/{trade_id}`
18288
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)))
18289
+ .replace(`{${"trade_id"}}`, encodeURIComponent(String(tradeId)));
18290
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
18291
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
18292
+ let baseOptions;
18293
+ if (configuration) {
18294
+ baseOptions = configuration.baseOptions;
18295
+ }
18296
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
18297
+ const localVarHeaderParameter = {};
18298
+ const localVarQueryParameter = {};
18299
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
18300
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18301
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
18302
+ return {
18303
+ url: toPathString(localVarUrlObj),
18304
+ options: localVarRequestOptions,
18305
+ };
18306
+ },
18307
+ /**
18308
+ * List all listings
18309
+ * @summary List all listings
18310
+ * @param {string} chainName
18311
+ * @param {OrderStatus} [status] Order status to filter by
18312
+ * @param {string} [sellItemContractAddress] Sell item contract address to filter by
18313
+ * @param {string} [buyItemContractAddress] Buy item contract address to filter by
18314
+ * @param {string} [sellItemTokenId] Sell item token identifier to filter by
18315
+ * @param {number} [pageSize] Maximum number of orders to return per page
18316
+ * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
18317
+ * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
18318
+ * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
18319
+ * @param {*} [options] Override http request option.
18320
+ * @throws {RequiredError}
18321
+ */
18322
+ listListings: async (chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options = {}) => {
18323
+ // verify required parameter 'chainName' is not null or undefined
18324
+ assertParamExists('listListings', 'chainName', chainName);
18325
+ const localVarPath = `/v1/chains/{chain_name}/orders/listings`
18326
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
18327
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
18328
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
18329
+ let baseOptions;
18330
+ if (configuration) {
18331
+ baseOptions = configuration.baseOptions;
18332
+ }
18333
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
18334
+ const localVarHeaderParameter = {};
18335
+ const localVarQueryParameter = {};
18336
+ if (status !== undefined) {
18337
+ localVarQueryParameter['status'] = status;
18338
+ }
18339
+ if (sellItemContractAddress !== undefined) {
18340
+ localVarQueryParameter['sell_item_contract_address'] = sellItemContractAddress;
18341
+ }
18342
+ if (buyItemContractAddress !== undefined) {
18343
+ localVarQueryParameter['buy_item_contract_address'] = buyItemContractAddress;
18344
+ }
18345
+ if (sellItemTokenId !== undefined) {
18346
+ localVarQueryParameter['sell_item_token_id'] = sellItemTokenId;
18347
+ }
18348
+ if (pageSize !== undefined) {
18349
+ localVarQueryParameter['page_size'] = pageSize;
18350
+ }
18351
+ if (sortBy !== undefined) {
18352
+ localVarQueryParameter['sort_by'] = sortBy;
18353
+ }
18354
+ if (sortDirection !== undefined) {
18355
+ localVarQueryParameter['sort_direction'] = sortDirection;
18356
+ }
18357
+ if (pageCursor !== undefined) {
18358
+ localVarQueryParameter['page_cursor'] = pageCursor;
18359
+ }
18360
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
18361
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18362
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
18363
+ return {
18364
+ url: toPathString(localVarUrlObj),
18365
+ options: localVarRequestOptions,
18366
+ };
18367
+ },
18368
+ /**
18369
+ * List all trades
18370
+ * @summary List all trades
18371
+ * @param {string} chainName
18372
+ * @param {string} [accountAddress]
18373
+ * @param {number} [pageSize] Maximum number of trades to return per page
18374
+ * @param {'created_at'} [sortBy] Trade field to sort by
18375
+ * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
18376
+ * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
18377
+ * @param {*} [options] Override http request option.
18378
+ * @throws {RequiredError}
18379
+ */
18380
+ listTrades: async (chainName, accountAddress, pageSize, sortBy, sortDirection, pageCursor, options = {}) => {
18381
+ // verify required parameter 'chainName' is not null or undefined
18382
+ assertParamExists('listTrades', 'chainName', chainName);
18383
+ const localVarPath = `/v1/chains/{chain_name}/trades`
18384
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
18385
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
18386
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
18387
+ let baseOptions;
18388
+ if (configuration) {
18389
+ baseOptions = configuration.baseOptions;
18390
+ }
18391
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
18392
+ const localVarHeaderParameter = {};
18393
+ const localVarQueryParameter = {};
18394
+ if (accountAddress !== undefined) {
18395
+ localVarQueryParameter['account_address'] = accountAddress;
18396
+ }
18397
+ if (pageSize !== undefined) {
18398
+ localVarQueryParameter['page_size'] = pageSize;
18399
+ }
18400
+ if (sortBy !== undefined) {
18401
+ localVarQueryParameter['sort_by'] = sortBy;
18402
+ }
18403
+ if (sortDirection !== undefined) {
18404
+ localVarQueryParameter['sort_direction'] = sortDirection;
18405
+ }
18406
+ if (pageCursor !== undefined) {
18407
+ localVarQueryParameter['page_cursor'] = pageCursor;
18408
+ }
18409
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
18410
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18411
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
18412
+ return {
18413
+ url: toPathString(localVarUrlObj),
18414
+ options: localVarRequestOptions,
18415
+ };
18416
+ },
18417
+ };
18418
+ };
18419
+ /**
18420
+ * OrdersApi - functional programming interface
18421
+ * @export
18422
+ */
18423
+ const OrdersApiFp = function (configuration) {
18424
+ const localVarAxiosParamCreator = OrdersApiAxiosParamCreator(configuration);
18425
+ return {
18426
+ /**
18427
+ * Create a listing
18428
+ * @summary Create a listing
18429
+ * @param {string} chainName
18430
+ * @param {CreateListingRequestBody} createListingRequestBody
18431
+ * @param {*} [options] Override http request option.
18432
+ * @throws {RequiredError}
18433
+ */
18434
+ async createListing(chainName, createListingRequestBody, options) {
18435
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createListing(chainName, createListingRequestBody, options);
18436
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18437
+ },
18438
+ /**
18439
+ * Retrieve signed fulfillment data based on the list of order IDs and corresponding fees.
18440
+ * @summary Retrieve fulfillment data for orders
18441
+ * @param {string} chainName
18442
+ * @param {Array<FulfillmentDataRequest>} fulfillmentDataRequest
18443
+ * @param {*} [options] Override http request option.
18444
+ * @throws {RequiredError}
18445
+ */
18446
+ async fulfillmentData(chainName, fulfillmentDataRequest, options) {
18447
+ const localVarAxiosArgs = await localVarAxiosParamCreator.fulfillmentData(chainName, fulfillmentDataRequest, options);
18448
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18449
+ },
18450
+ /**
18451
+ * Get a single listing by ID
18452
+ * @summary Get a single listing by ID
18453
+ * @param {string} chainName
18454
+ * @param {string} listingId Global Order identifier
18455
+ * @param {*} [options] Override http request option.
18456
+ * @throws {RequiredError}
18457
+ */
18458
+ async getListing(chainName, listingId, options) {
18459
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getListing(chainName, listingId, options);
18460
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18461
+ },
18462
+ /**
18463
+ * Get a single trade by ID
18464
+ * @summary Get a single trade by ID
18465
+ * @param {string} chainName
18466
+ * @param {string} tradeId Global Trade identifier
18467
+ * @param {*} [options] Override http request option.
18468
+ * @throws {RequiredError}
18469
+ */
18470
+ async getTrade(chainName, tradeId, options) {
18471
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getTrade(chainName, tradeId, options);
18472
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18473
+ },
18474
+ /**
18475
+ * List all listings
18476
+ * @summary List all listings
18477
+ * @param {string} chainName
18478
+ * @param {OrderStatus} [status] Order status to filter by
18479
+ * @param {string} [sellItemContractAddress] Sell item contract address to filter by
18480
+ * @param {string} [buyItemContractAddress] Buy item contract address to filter by
18481
+ * @param {string} [sellItemTokenId] Sell item token identifier to filter by
18482
+ * @param {number} [pageSize] Maximum number of orders to return per page
18483
+ * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
18484
+ * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
18485
+ * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
18486
+ * @param {*} [options] Override http request option.
18487
+ * @throws {RequiredError}
18488
+ */
18489
+ async listListings(chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
18490
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listListings(chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options);
18491
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18492
+ },
18493
+ /**
18494
+ * List all trades
18495
+ * @summary List all trades
18496
+ * @param {string} chainName
18497
+ * @param {string} [accountAddress]
18498
+ * @param {number} [pageSize] Maximum number of trades to return per page
18499
+ * @param {'created_at'} [sortBy] Trade field to sort by
18500
+ * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
18501
+ * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
18502
+ * @param {*} [options] Override http request option.
18503
+ * @throws {RequiredError}
18504
+ */
18505
+ async listTrades(chainName, accountAddress, pageSize, sortBy, sortDirection, pageCursor, options) {
18506
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listTrades(chainName, accountAddress, pageSize, sortBy, sortDirection, pageCursor, options);
18507
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18508
+ },
18509
+ };
18510
+ };
18511
+ /**
18512
+ * OrdersApi - factory interface
18513
+ * @export
18514
+ */
18515
+ const OrdersApiFactory = function (configuration, basePath, axios) {
18516
+ const localVarFp = OrdersApiFp(configuration);
18517
+ return {
18518
+ /**
18519
+ * Create a listing
18520
+ * @summary Create a listing
18521
+ * @param {string} chainName
18522
+ * @param {CreateListingRequestBody} createListingRequestBody
18523
+ * @param {*} [options] Override http request option.
18524
+ * @throws {RequiredError}
18525
+ */
18526
+ createListing(chainName, createListingRequestBody, options) {
18527
+ return localVarFp.createListing(chainName, createListingRequestBody, options).then((request) => request(axios, basePath));
18528
+ },
18529
+ /**
18530
+ * Retrieve signed fulfillment data based on the list of order IDs and corresponding fees.
18531
+ * @summary Retrieve fulfillment data for orders
18532
+ * @param {string} chainName
18533
+ * @param {Array<FulfillmentDataRequest>} fulfillmentDataRequest
18534
+ * @param {*} [options] Override http request option.
18535
+ * @throws {RequiredError}
18536
+ */
18537
+ fulfillmentData(chainName, fulfillmentDataRequest, options) {
18538
+ return localVarFp.fulfillmentData(chainName, fulfillmentDataRequest, options).then((request) => request(axios, basePath));
18539
+ },
18540
+ /**
18541
+ * Get a single listing by ID
18542
+ * @summary Get a single listing by ID
18543
+ * @param {string} chainName
18544
+ * @param {string} listingId Global Order identifier
18545
+ * @param {*} [options] Override http request option.
18546
+ * @throws {RequiredError}
18547
+ */
18548
+ getListing(chainName, listingId, options) {
18549
+ return localVarFp.getListing(chainName, listingId, options).then((request) => request(axios, basePath));
18550
+ },
18551
+ /**
18552
+ * Get a single trade by ID
18553
+ * @summary Get a single trade by ID
18554
+ * @param {string} chainName
18555
+ * @param {string} tradeId Global Trade identifier
18556
+ * @param {*} [options] Override http request option.
18557
+ * @throws {RequiredError}
18558
+ */
18559
+ getTrade(chainName, tradeId, options) {
18560
+ return localVarFp.getTrade(chainName, tradeId, options).then((request) => request(axios, basePath));
18561
+ },
18562
+ /**
18563
+ * List all listings
18564
+ * @summary List all listings
18565
+ * @param {string} chainName
18566
+ * @param {OrderStatus} [status] Order status to filter by
18567
+ * @param {string} [sellItemContractAddress] Sell item contract address to filter by
18568
+ * @param {string} [buyItemContractAddress] Buy item contract address to filter by
18569
+ * @param {string} [sellItemTokenId] Sell item token identifier to filter by
18570
+ * @param {number} [pageSize] Maximum number of orders to return per page
18571
+ * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
18572
+ * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
18573
+ * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
18574
+ * @param {*} [options] Override http request option.
18575
+ * @throws {RequiredError}
18576
+ */
18577
+ listListings(chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
18578
+ return localVarFp.listListings(chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options).then((request) => request(axios, basePath));
18579
+ },
18580
+ /**
18581
+ * List all trades
18582
+ * @summary List all trades
18583
+ * @param {string} chainName
18584
+ * @param {string} [accountAddress]
18585
+ * @param {number} [pageSize] Maximum number of trades to return per page
18586
+ * @param {'created_at'} [sortBy] Trade field to sort by
18587
+ * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
18588
+ * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
18589
+ * @param {*} [options] Override http request option.
18590
+ * @throws {RequiredError}
18591
+ */
18592
+ listTrades(chainName, accountAddress, pageSize, sortBy, sortDirection, pageCursor, options) {
18593
+ return localVarFp.listTrades(chainName, accountAddress, pageSize, sortBy, sortDirection, pageCursor, options).then((request) => request(axios, basePath));
18594
+ },
18595
+ };
18596
+ };
18597
+ /**
18598
+ * OrdersApi - object-oriented interface
18599
+ * @export
18600
+ * @class OrdersApi
18601
+ * @extends {BaseAPI}
18602
+ */
18603
+ class OrdersApi extends BaseAPI {
18604
+ /**
18605
+ * Create a listing
18606
+ * @summary Create a listing
18607
+ * @param {OrdersApiCreateListingRequest} requestParameters Request parameters.
18608
+ * @param {*} [options] Override http request option.
18609
+ * @throws {RequiredError}
18610
+ * @memberof OrdersApi
18611
+ */
18612
+ createListing(requestParameters, options) {
18613
+ return OrdersApiFp(this.configuration).createListing(requestParameters.chainName, requestParameters.createListingRequestBody, options).then((request) => request(this.axios, this.basePath));
18614
+ }
18615
+ /**
18616
+ * Retrieve signed fulfillment data based on the list of order IDs and corresponding fees.
18617
+ * @summary Retrieve fulfillment data for orders
18618
+ * @param {OrdersApiFulfillmentDataRequest} requestParameters Request parameters.
18619
+ * @param {*} [options] Override http request option.
18620
+ * @throws {RequiredError}
18621
+ * @memberof OrdersApi
18622
+ */
18623
+ fulfillmentData(requestParameters, options) {
18624
+ return OrdersApiFp(this.configuration).fulfillmentData(requestParameters.chainName, requestParameters.fulfillmentDataRequest, options).then((request) => request(this.axios, this.basePath));
18625
+ }
18626
+ /**
18627
+ * Get a single listing by ID
18628
+ * @summary Get a single listing by ID
18629
+ * @param {OrdersApiGetListingRequest} requestParameters Request parameters.
18630
+ * @param {*} [options] Override http request option.
18631
+ * @throws {RequiredError}
18632
+ * @memberof OrdersApi
18633
+ */
18634
+ getListing(requestParameters, options) {
18635
+ return OrdersApiFp(this.configuration).getListing(requestParameters.chainName, requestParameters.listingId, options).then((request) => request(this.axios, this.basePath));
18636
+ }
18637
+ /**
18638
+ * Get a single trade by ID
18639
+ * @summary Get a single trade by ID
18640
+ * @param {OrdersApiGetTradeRequest} requestParameters Request parameters.
18641
+ * @param {*} [options] Override http request option.
18642
+ * @throws {RequiredError}
18643
+ * @memberof OrdersApi
18644
+ */
18645
+ getTrade(requestParameters, options) {
18646
+ return OrdersApiFp(this.configuration).getTrade(requestParameters.chainName, requestParameters.tradeId, options).then((request) => request(this.axios, this.basePath));
18647
+ }
18648
+ /**
18649
+ * List all listings
18650
+ * @summary List all listings
18651
+ * @param {OrdersApiListListingsRequest} requestParameters Request parameters.
18652
+ * @param {*} [options] Override http request option.
18653
+ * @throws {RequiredError}
18654
+ * @memberof OrdersApi
18655
+ */
18656
+ listListings(requestParameters, options) {
18657
+ 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));
18658
+ }
18659
+ /**
18660
+ * List all trades
18661
+ * @summary List all trades
18662
+ * @param {OrdersApiListTradesRequest} requestParameters Request parameters.
18663
+ * @param {*} [options] Override http request option.
18664
+ * @throws {RequiredError}
18665
+ * @memberof OrdersApi
18666
+ */
18667
+ listTrades(requestParameters, options) {
18668
+ return OrdersApiFp(this.configuration).listTrades(requestParameters.chainName, requestParameters.accountAddress, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(this.axios, this.basePath));
18669
+ }
18670
+ }
18671
+
18672
+ /* tslint:disable */
18673
+ /* eslint-disable */
18674
+ /**
18675
+ * Immutable zkEVM API
18676
+ * Immutable Multi Rollup API
18677
+ *
18678
+ * The version of the OpenAPI document: 1.0.0
18679
+ * Contact: support@immutable.com
18680
+ *
18681
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
18682
+ * https://openapi-generator.tech
18683
+ * Do not edit the class manually.
18684
+ */
18685
+ /**
18686
+ * PassportApi - axios parameter creator
18687
+ * @export
18688
+ */
18689
+ const PassportApiAxiosParamCreator = function (configuration) {
18690
+ return {
18691
+ /**
18692
+ * Create a counterfactual address for a user based on their Ethereum address
18693
+ * @summary Create a counterfactual address
18694
+ * @param {CreateCounterfactualAddressRequest} createCounterfactualAddressRequest
18695
+ * @param {*} [options] Override http request option.
18696
+ * @throws {RequiredError}
18697
+ */
18698
+ createCounterfactualAddress: async (createCounterfactualAddressRequest, options = {}) => {
18699
+ // verify required parameter 'createCounterfactualAddressRequest' is not null or undefined
18700
+ assertParamExists('createCounterfactualAddress', 'createCounterfactualAddressRequest', createCounterfactualAddressRequest);
18701
+ const localVarPath = `/passport-mr/v1/counterfactual-address`;
18702
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
18703
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
18704
+ let baseOptions;
18705
+ if (configuration) {
18706
+ baseOptions = configuration.baseOptions;
18707
+ }
18708
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
18709
+ const localVarHeaderParameter = {};
18710
+ const localVarQueryParameter = {};
18711
+ // authentication BearerAuth required
18712
+ // http bearer authentication required
18713
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
18714
+ localVarHeaderParameter['Content-Type'] = 'application/json';
18715
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
18716
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18717
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
18718
+ localVarRequestOptions.data = serializeDataIfNeeded(createCounterfactualAddressRequest, localVarRequestOptions, configuration);
18719
+ return {
18720
+ url: toPathString(localVarUrlObj),
18721
+ options: localVarRequestOptions,
18722
+ };
18723
+ },
18724
+ /**
18725
+ * Get all the Ethereum linked addresses for a user based on its userId
18726
+ * @summary Get Ethereum linked addresses for a user
18727
+ * @param {string} userId The user\&#39;s userId
18728
+ * @param {*} [options] Override http request option.
18729
+ * @throws {RequiredError}
18730
+ */
18731
+ getLinkedAddresses: async (userId, options = {}) => {
18732
+ // verify required parameter 'userId' is not null or undefined
18733
+ assertParamExists('getLinkedAddresses', 'userId', userId);
18734
+ const localVarPath = `/passport-mr/v1/users/{userId}/linked-addresses`
18735
+ .replace(`{${"userId"}}`, encodeURIComponent(String(userId)));
18736
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
18737
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
18738
+ let baseOptions;
18739
+ if (configuration) {
18740
+ baseOptions = configuration.baseOptions;
18741
+ }
18742
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
18743
+ const localVarHeaderParameter = {};
18744
+ const localVarQueryParameter = {};
18745
+ // authentication BearerAuth required
18746
+ // http bearer authentication required
18747
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
18748
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
18749
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18750
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
18751
+ return {
18752
+ url: toPathString(localVarUrlObj),
18753
+ options: localVarRequestOptions,
18754
+ };
18755
+ },
18756
+ };
18757
+ };
18758
+ /**
18759
+ * PassportApi - functional programming interface
18760
+ * @export
18761
+ */
18762
+ const PassportApiFp = function (configuration) {
18763
+ const localVarAxiosParamCreator = PassportApiAxiosParamCreator(configuration);
18764
+ return {
18765
+ /**
18766
+ * Create a counterfactual address for a user based on their Ethereum address
18767
+ * @summary Create a counterfactual address
18768
+ * @param {CreateCounterfactualAddressRequest} createCounterfactualAddressRequest
18769
+ * @param {*} [options] Override http request option.
18770
+ * @throws {RequiredError}
18771
+ */
18772
+ async createCounterfactualAddress(createCounterfactualAddressRequest, options) {
18773
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createCounterfactualAddress(createCounterfactualAddressRequest, options);
18774
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18775
+ },
18776
+ /**
18777
+ * Get all the Ethereum linked addresses for a user based on its userId
18778
+ * @summary Get Ethereum linked addresses for a user
18779
+ * @param {string} userId The user\&#39;s userId
18780
+ * @param {*} [options] Override http request option.
18781
+ * @throws {RequiredError}
18782
+ */
18783
+ async getLinkedAddresses(userId, options) {
18784
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getLinkedAddresses(userId, options);
18785
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18786
+ },
18787
+ };
18788
+ };
18789
+ /**
18790
+ * PassportApi - factory interface
18791
+ * @export
18792
+ */
18793
+ const PassportApiFactory = function (configuration, basePath, axios) {
18794
+ const localVarFp = PassportApiFp(configuration);
18795
+ return {
18796
+ /**
18797
+ * Create a counterfactual address for a user based on their Ethereum address
18798
+ * @summary Create a counterfactual address
18799
+ * @param {CreateCounterfactualAddressRequest} createCounterfactualAddressRequest
18800
+ * @param {*} [options] Override http request option.
18801
+ * @throws {RequiredError}
18802
+ */
18803
+ createCounterfactualAddress(createCounterfactualAddressRequest, options) {
18804
+ return localVarFp.createCounterfactualAddress(createCounterfactualAddressRequest, options).then((request) => request(axios, basePath));
18805
+ },
18806
+ /**
18807
+ * Get all the Ethereum linked addresses for a user based on its userId
18808
+ * @summary Get Ethereum linked addresses for a user
18809
+ * @param {string} userId The user\&#39;s userId
18810
+ * @param {*} [options] Override http request option.
18811
+ * @throws {RequiredError}
18812
+ */
18813
+ getLinkedAddresses(userId, options) {
18814
+ return localVarFp.getLinkedAddresses(userId, options).then((request) => request(axios, basePath));
18815
+ },
18816
+ };
18817
+ };
18818
+ /**
18819
+ * PassportApi - object-oriented interface
18820
+ * @export
18821
+ * @class PassportApi
18822
+ * @extends {BaseAPI}
18823
+ */
18824
+ class PassportApi extends BaseAPI {
18825
+ /**
18826
+ * Create a counterfactual address for a user based on their Ethereum address
18827
+ * @summary Create a counterfactual address
18828
+ * @param {PassportApiCreateCounterfactualAddressRequest} requestParameters Request parameters.
18829
+ * @param {*} [options] Override http request option.
18830
+ * @throws {RequiredError}
18831
+ * @memberof PassportApi
18832
+ */
18833
+ createCounterfactualAddress(requestParameters, options) {
18834
+ return PassportApiFp(this.configuration).createCounterfactualAddress(requestParameters.createCounterfactualAddressRequest, options).then((request) => request(this.axios, this.basePath));
18835
+ }
18836
+ /**
18837
+ * Get all the Ethereum linked addresses for a user based on its userId
18838
+ * @summary Get Ethereum linked addresses for a user
18839
+ * @param {PassportApiGetLinkedAddressesRequest} requestParameters Request parameters.
18840
+ * @param {*} [options] Override http request option.
18841
+ * @throws {RequiredError}
18842
+ * @memberof PassportApi
18843
+ */
18844
+ getLinkedAddresses(requestParameters, options) {
18845
+ return PassportApiFp(this.configuration).getLinkedAddresses(requestParameters.userId, options).then((request) => request(this.axios, this.basePath));
18846
+ }
18847
+ }
18848
+
18849
+ /* tslint:disable */
18850
+ /* eslint-disable */
18851
+ /**
18852
+ * Immutable zkEVM API
18853
+ * Immutable Multi Rollup API
18854
+ *
18855
+ * The version of the OpenAPI document: 1.0.0
18856
+ * Contact: support@immutable.com
18857
+ *
18858
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
18859
+ * https://openapi-generator.tech
18860
+ * Do not edit the class manually.
18861
+ */
18862
+ /**
18863
+ * TokensApi - axios parameter creator
18864
+ * @export
18865
+ */
18866
+ const TokensApiAxiosParamCreator = function (configuration) {
18867
+ return {
18868
+ /**
18869
+ * Get single ERC20 token
18870
+ * @summary Get single ERC20 token
18871
+ * @param {string} contractAddress The address of contract
18872
+ * @param {string} chainName The name of chain
18873
+ * @param {*} [options] Override http request option.
18874
+ * @throws {RequiredError}
18875
+ */
18876
+ getERC20Token: async (contractAddress, chainName, options = {}) => {
18877
+ // verify required parameter 'contractAddress' is not null or undefined
18878
+ assertParamExists('getERC20Token', 'contractAddress', contractAddress);
18879
+ // verify required parameter 'chainName' is not null or undefined
18880
+ assertParamExists('getERC20Token', 'chainName', chainName);
18881
+ const localVarPath = `/v1/chains/{chain_name}/tokens/{contract_address}`
18882
+ .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
18883
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
18884
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
18885
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
18886
+ let baseOptions;
18887
+ if (configuration) {
18888
+ baseOptions = configuration.baseOptions;
18889
+ }
18890
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
18891
+ const localVarHeaderParameter = {};
18892
+ const localVarQueryParameter = {};
18893
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
18894
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18895
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
18896
+ return {
18897
+ url: toPathString(localVarUrlObj),
18898
+ options: localVarRequestOptions,
18899
+ };
18900
+ },
18901
+ /**
18902
+ * List ERC20 tokens
18903
+ * @summary List ERC20 tokens
18904
+ * @param {string} chainName The name of chain
18905
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
18906
+ * @param {number} [pageSize] Maximum number of items to return
18907
+ * @param {*} [options] Override http request option.
18908
+ * @throws {RequiredError}
18909
+ */
18910
+ listERC20Tokens: async (chainName, pageCursor, pageSize, options = {}) => {
18911
+ // verify required parameter 'chainName' is not null or undefined
18912
+ assertParamExists('listERC20Tokens', 'chainName', chainName);
18913
+ const localVarPath = `/v1/chains/{chain_name}/tokens`
18914
+ .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
18915
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
18916
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
18917
+ let baseOptions;
18918
+ if (configuration) {
18919
+ baseOptions = configuration.baseOptions;
18920
+ }
18921
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
18922
+ const localVarHeaderParameter = {};
18923
+ const localVarQueryParameter = {};
18924
+ if (pageCursor !== undefined) {
18925
+ localVarQueryParameter['page_cursor'] = pageCursor;
18926
+ }
18927
+ if (pageSize !== undefined) {
18928
+ localVarQueryParameter['page_size'] = pageSize;
18929
+ }
18930
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
18931
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18932
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
18933
+ return {
18934
+ url: toPathString(localVarUrlObj),
18935
+ options: localVarRequestOptions,
18936
+ };
18937
+ },
18938
+ };
18939
+ };
18940
+ /**
18941
+ * TokensApi - functional programming interface
18942
+ * @export
18943
+ */
18944
+ const TokensApiFp = function (configuration) {
18945
+ const localVarAxiosParamCreator = TokensApiAxiosParamCreator(configuration);
18946
+ return {
18947
+ /**
18948
+ * Get single ERC20 token
18949
+ * @summary Get single ERC20 token
18950
+ * @param {string} contractAddress The address of contract
18951
+ * @param {string} chainName The name of chain
18952
+ * @param {*} [options] Override http request option.
18953
+ * @throws {RequiredError}
18954
+ */
18955
+ async getERC20Token(contractAddress, chainName, options) {
18956
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getERC20Token(contractAddress, chainName, options);
18957
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18958
+ },
18959
+ /**
18960
+ * List ERC20 tokens
18961
+ * @summary List ERC20 tokens
18962
+ * @param {string} chainName The name of chain
18963
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
18964
+ * @param {number} [pageSize] Maximum number of items to return
18965
+ * @param {*} [options] Override http request option.
18966
+ * @throws {RequiredError}
18967
+ */
18968
+ async listERC20Tokens(chainName, pageCursor, pageSize, options) {
18969
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listERC20Tokens(chainName, pageCursor, pageSize, options);
18970
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
18971
+ },
18972
+ };
18973
+ };
18974
+ /**
18975
+ * TokensApi - factory interface
18976
+ * @export
18977
+ */
18978
+ const TokensApiFactory = function (configuration, basePath, axios) {
18979
+ const localVarFp = TokensApiFp(configuration);
18980
+ return {
18981
+ /**
18982
+ * Get single ERC20 token
18983
+ * @summary Get single ERC20 token
18984
+ * @param {string} contractAddress The address of contract
18985
+ * @param {string} chainName The name of chain
18986
+ * @param {*} [options] Override http request option.
18987
+ * @throws {RequiredError}
18988
+ */
18989
+ getERC20Token(contractAddress, chainName, options) {
18990
+ return localVarFp.getERC20Token(contractAddress, chainName, options).then((request) => request(axios, basePath));
18991
+ },
18992
+ /**
18993
+ * List ERC20 tokens
18994
+ * @summary List ERC20 tokens
18995
+ * @param {string} chainName The name of chain
18996
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
18997
+ * @param {number} [pageSize] Maximum number of items to return
18998
+ * @param {*} [options] Override http request option.
18999
+ * @throws {RequiredError}
19000
+ */
19001
+ listERC20Tokens(chainName, pageCursor, pageSize, options) {
19002
+ return localVarFp.listERC20Tokens(chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
19003
+ },
19004
+ };
19005
+ };
19006
+ /**
19007
+ * TokensApi - object-oriented interface
19008
+ * @export
19009
+ * @class TokensApi
19010
+ * @extends {BaseAPI}
19011
+ */
19012
+ class TokensApi extends BaseAPI {
19013
+ /**
19014
+ * Get single ERC20 token
19015
+ * @summary Get single ERC20 token
19016
+ * @param {TokensApiGetERC20TokenRequest} requestParameters Request parameters.
19017
+ * @param {*} [options] Override http request option.
19018
+ * @throws {RequiredError}
19019
+ * @memberof TokensApi
19020
+ */
19021
+ getERC20Token(requestParameters, options) {
19022
+ return TokensApiFp(this.configuration).getERC20Token(requestParameters.contractAddress, requestParameters.chainName, options).then((request) => request(this.axios, this.basePath));
19023
+ }
19024
+ /**
19025
+ * List ERC20 tokens
19026
+ * @summary List ERC20 tokens
19027
+ * @param {TokensApiListERC20TokensRequest} requestParameters Request parameters.
19028
+ * @param {*} [options] Override http request option.
19029
+ * @throws {RequiredError}
19030
+ * @memberof TokensApi
19031
+ */
19032
+ listERC20Tokens(requestParameters, options) {
19033
+ return TokensApiFp(this.configuration).listERC20Tokens(requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
19034
+ }
19035
+ }
19036
+
19037
+ /* tslint:disable */
19038
+ /* eslint-disable */
19039
+ /**
19040
+ * Immutable zkEVM API
19041
+ * Immutable Multi Rollup API
19042
+ *
19043
+ * The version of the OpenAPI document: 1.0.0
19044
+ * Contact: support@immutable.com
19045
+ *
19046
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19047
+ * https://openapi-generator.tech
19048
+ * Do not edit the class manually.
19049
+ */
19050
+ class Configuration {
19051
+ /**
19052
+ * parameter for apiKey security
19053
+ * @param name security name
19054
+ * @memberof Configuration
19055
+ */
19056
+ apiKey;
19057
+ /**
19058
+ * parameter for basic security
19059
+ *
19060
+ * @type {string}
19061
+ * @memberof Configuration
19062
+ */
19063
+ username;
19064
+ /**
19065
+ * parameter for basic security
19066
+ *
19067
+ * @type {string}
19068
+ * @memberof Configuration
19069
+ */
19070
+ password;
19071
+ /**
19072
+ * parameter for oauth2 security
19073
+ * @param name security name
19074
+ * @param scopes oauth2 scope
19075
+ * @memberof Configuration
19076
+ */
19077
+ accessToken;
19078
+ /**
19079
+ * override base path
19080
+ *
19081
+ * @type {string}
19082
+ * @memberof Configuration
19083
+ */
19084
+ basePath;
19085
+ /**
19086
+ * base options for axios calls
19087
+ *
19088
+ * @type {any}
19089
+ * @memberof Configuration
19090
+ */
19091
+ baseOptions;
19092
+ /**
19093
+ * The FormData constructor that will be used to create multipart form data
19094
+ * requests. You can inject this here so that execution environments that
19095
+ * do not support the FormData class can still run the generated client.
19096
+ *
19097
+ * @type {new () => FormData}
19098
+ */
19099
+ formDataCtor;
19100
+ constructor(param = {}) {
19101
+ this.apiKey = param.apiKey;
19102
+ this.username = param.username;
19103
+ this.password = param.password;
19104
+ this.accessToken = param.accessToken;
19105
+ this.basePath = param.basePath;
19106
+ this.baseOptions = param.baseOptions;
19107
+ this.formDataCtor = param.formDataCtor;
19108
+ }
19109
+ /**
19110
+ * Check if the given MIME is a JSON MIME.
19111
+ * JSON MIME examples:
19112
+ * application/json
19113
+ * application/json; charset=UTF8
19114
+ * APPLICATION/JSON
19115
+ * application/vnd.company+json
19116
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
19117
+ * @return True if the given MIME is JSON, false otherwise.
19118
+ */
19119
+ isJsonMime(mime) {
19120
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
19121
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
19122
+ }
19123
+ }
19124
+
19125
+ /* tslint:disable */
19126
+ /* eslint-disable */
19127
+ /**
19128
+ * Immutable zkEVM API
19129
+ * Immutable Multi Rollup API
19130
+ *
19131
+ * The version of the OpenAPI document: 1.0.0
19132
+ * Contact: support@immutable.com
19133
+ *
19134
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19135
+ * https://openapi-generator.tech
19136
+ * Do not edit the class manually.
19137
+ */
19138
+ const APIError400AllOfCodeEnum = {
19139
+ ValidationError: 'VALIDATION_ERROR'
19140
+ };
19141
+
19142
+ /* tslint:disable */
19143
+ /* eslint-disable */
19144
+ /**
19145
+ * Immutable zkEVM API
19146
+ * Immutable Multi Rollup API
19147
+ *
19148
+ * The version of the OpenAPI document: 1.0.0
19149
+ * Contact: support@immutable.com
19150
+ *
19151
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19152
+ * https://openapi-generator.tech
19153
+ * Do not edit the class manually.
19154
+ */
19155
+ const APIError401AllOfCodeEnum = {
19156
+ UnauthorisedRequest: 'UNAUTHORISED_REQUEST'
19157
+ };
19158
+
19159
+ /* tslint:disable */
19160
+ /* eslint-disable */
19161
+ /**
19162
+ * Immutable zkEVM API
19163
+ * Immutable Multi Rollup API
19164
+ *
19165
+ * The version of the OpenAPI document: 1.0.0
19166
+ * Contact: support@immutable.com
19167
+ *
19168
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19169
+ * https://openapi-generator.tech
19170
+ * Do not edit the class manually.
19171
+ */
19172
+ const APIError403AllOfCodeEnum = {
19173
+ AuthenticationError: 'AUTHENTICATION_ERROR'
19174
+ };
19175
+
19176
+ /* tslint:disable */
19177
+ /* eslint-disable */
19178
+ /**
19179
+ * Immutable zkEVM API
19180
+ * Immutable Multi Rollup API
19181
+ *
19182
+ * The version of the OpenAPI document: 1.0.0
19183
+ * Contact: support@immutable.com
19184
+ *
19185
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19186
+ * https://openapi-generator.tech
19187
+ * Do not edit the class manually.
19188
+ */
19189
+ const APIError404AllOfCodeEnum = {
19190
+ ResourceNotFound: 'RESOURCE_NOT_FOUND'
19191
+ };
19192
+
19193
+ /* tslint:disable */
19194
+ /* eslint-disable */
19195
+ /**
19196
+ * Immutable zkEVM API
19197
+ * Immutable Multi Rollup API
19198
+ *
19199
+ * The version of the OpenAPI document: 1.0.0
19200
+ * Contact: support@immutable.com
19201
+ *
19202
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19203
+ * https://openapi-generator.tech
19204
+ * Do not edit the class manually.
19205
+ */
19206
+ const APIError429AllOfCodeEnum = {
19207
+ TooManyRequestsError: 'TOO_MANY_REQUESTS_ERROR'
19208
+ };
19209
+
19210
+ /* tslint:disable */
19211
+ /* eslint-disable */
19212
+ /**
19213
+ * Immutable zkEVM API
19214
+ * Immutable Multi Rollup API
19215
+ *
19216
+ * The version of the OpenAPI document: 1.0.0
19217
+ * Contact: support@immutable.com
19218
+ *
19219
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19220
+ * https://openapi-generator.tech
19221
+ * Do not edit the class manually.
19222
+ */
19223
+ const APIError500AllOfCodeEnum = {
19224
+ InternalServerError: 'INTERNAL_SERVER_ERROR'
19225
+ };
19226
+
19227
+ /* tslint:disable */
19228
+ /* eslint-disable */
19229
+ /**
19230
+ * Immutable zkEVM API
19231
+ * Immutable Multi Rollup API
19232
+ *
19233
+ * The version of the OpenAPI document: 1.0.0
19234
+ * Contact: support@immutable.com
19235
+ *
19236
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19237
+ * https://openapi-generator.tech
19238
+ * Do not edit the class manually.
19239
+ */
19240
+ /**
19241
+ * The activity type
19242
+ * @export
19243
+ * @enum {string}
19244
+ */
19245
+ const ActivityType = {
19246
+ Mint: 'mint',
19247
+ Burn: 'burn',
19248
+ Transfer: 'transfer',
19249
+ Sale: 'sale',
19250
+ Deposit: 'deposit',
19251
+ Withdrawal: 'withdrawal'
19252
+ };
19253
+
19254
+ /* tslint:disable */
19255
+ /* eslint-disable */
19256
+ /**
19257
+ * Immutable zkEVM API
19258
+ * Immutable Multi Rollup API
19259
+ *
19260
+ * The version of the OpenAPI document: 1.0.0
19261
+ * Contact: support@immutable.com
19262
+ *
19263
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19264
+ * https://openapi-generator.tech
19265
+ * Do not edit the class manually.
19266
+ */
19267
+ /**
19268
+ * The collection contract type
19269
+ * @export
19270
+ * @enum {string}
19271
+ */
19272
+ const CollectionContractType = {
19273
+ Erc721: 'ERC721'
19274
+ };
19275
+
19276
+ /* tslint:disable */
19277
+ /* eslint-disable */
19278
+ /**
19279
+ * Immutable zkEVM API
19280
+ * Immutable Multi Rollup API
19281
+ *
19282
+ * The version of the OpenAPI document: 1.0.0
19283
+ * Contact: support@immutable.com
19284
+ *
19285
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19286
+ * https://openapi-generator.tech
19287
+ * Do not edit the class manually.
19288
+ */
19289
+ const ERC20ItemItemTypeEnum = {
19290
+ Erc20: 'ERC20'
19291
+ };
19292
+
19293
+ /* tslint:disable */
19294
+ /* eslint-disable */
19295
+ /**
19296
+ * Immutable zkEVM API
19297
+ * Immutable Multi Rollup API
19298
+ *
19299
+ * The version of the OpenAPI document: 1.0.0
19300
+ * Contact: support@immutable.com
19301
+ *
19302
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19303
+ * https://openapi-generator.tech
19304
+ * Do not edit the class manually.
19305
+ */
19306
+ const ERC721ItemItemTypeEnum = {
19307
+ Erc721: 'ERC721'
19308
+ };
19309
+
19310
+ /* tslint:disable */
19311
+ /* eslint-disable */
19312
+ /**
19313
+ * Immutable zkEVM API
19314
+ * Immutable Multi Rollup API
19315
+ *
19316
+ * The version of the OpenAPI document: 1.0.0
19317
+ * Contact: support@immutable.com
19318
+ *
19319
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19320
+ * https://openapi-generator.tech
19321
+ * Do not edit the class manually.
19322
+ */
19323
+ const FeeFeeTypeEnum = {
19324
+ Royalty: 'ROYALTY',
19325
+ MakerMarketplace: 'MAKER_MARKETPLACE',
19326
+ TakerMarketplace: 'TAKER_MARKETPLACE',
19327
+ Protocol: 'PROTOCOL'
19328
+ };
19329
+
19330
+ /* tslint:disable */
19331
+ /* eslint-disable */
19332
+ /**
19333
+ * Immutable zkEVM API
19334
+ * Immutable Multi Rollup API
19335
+ *
19336
+ * The version of the OpenAPI document: 1.0.0
19337
+ * Contact: support@immutable.com
19338
+ *
19339
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19340
+ * https://openapi-generator.tech
19341
+ * Do not edit the class manually.
19342
+ */
19343
+ /**
19344
+ * The contract type for an NFT
19345
+ * @export
19346
+ * @enum {string}
19347
+ */
19348
+ const NFTContractType = {
19349
+ Erc721: 'ERC721'
19350
+ };
19351
+
19352
+ /* tslint:disable */
19353
+ /* eslint-disable */
19354
+ /**
19355
+ * Immutable zkEVM API
19356
+ * Immutable Multi Rollup API
19357
+ *
19358
+ * The version of the OpenAPI document: 1.0.0
19359
+ * Contact: support@immutable.com
19360
+ *
19361
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19362
+ * https://openapi-generator.tech
19363
+ * Do not edit the class manually.
19364
+ */
19365
+ const NativeItemItemTypeEnum = {
19366
+ Native: 'NATIVE'
19367
+ };
19368
+
19369
+ /* tslint:disable */
19370
+ /* eslint-disable */
19371
+ /**
19372
+ * Immutable zkEVM API
19373
+ * Immutable Multi Rollup API
19374
+ *
19375
+ * The version of the OpenAPI document: 1.0.0
19376
+ * Contact: support@immutable.com
19377
+ *
19378
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19379
+ * https://openapi-generator.tech
19380
+ * Do not edit the class manually.
19381
+ */
19382
+ /**
19383
+ * The Order status
19384
+ * @export
19385
+ * @enum {string}
19386
+ */
19387
+ const OrderStatus = {
19388
+ Pending: 'PENDING',
19389
+ Active: 'ACTIVE',
19390
+ Inactive: 'INACTIVE',
19391
+ Filled: 'FILLED',
19392
+ Cancelled: 'CANCELLED',
19393
+ Expired: 'EXPIRED'
19394
+ };
19395
+
19396
+ /* tslint:disable */
19397
+ /* eslint-disable */
19398
+ /**
19399
+ * Immutable zkEVM API
19400
+ * Immutable Multi Rollup API
19401
+ *
19402
+ * The version of the OpenAPI document: 1.0.0
19403
+ * Contact: support@immutable.com
19404
+ *
19405
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19406
+ * https://openapi-generator.tech
19407
+ * Do not edit the class manually.
19408
+ */
19409
+ const ProtocolDataOrderTypeEnum = {
19410
+ FullRestricted: 'FULL_RESTRICTED'
19411
+ };
19412
+
19413
+ /* tslint:disable */
19414
+ /* eslint-disable */
19415
+ /**
19416
+ * Immutable zkEVM API
19417
+ * Immutable Multi Rollup API
19418
+ *
19419
+ * The version of the OpenAPI document: 1.0.0
19420
+ * Contact: support@immutable.com
19421
+ *
19422
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19423
+ * https://openapi-generator.tech
19424
+ * Do not edit the class manually.
19425
+ */
19426
+ const SaleFeeTypeEnum = {
19427
+ Royalty: 'ROYALTY'
19428
+ };
19429
+
19430
+ /* tslint:disable */
19431
+ /* eslint-disable */
19432
+ /**
19433
+ * Immutable zkEVM API
19434
+ * Immutable Multi Rollup API
19435
+ *
19436
+ * The version of the OpenAPI document: 1.0.0
19437
+ * Contact: support@immutable.com
19438
+ *
19439
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19440
+ * https://openapi-generator.tech
19441
+ * Do not edit the class manually.
19442
+ */
19443
+ /**
19444
+ * The contract type for a token
19445
+ * @export
19446
+ * @enum {string}
19447
+ */
19448
+ const TokenContractType = {
19449
+ Erc20: 'ERC20'
19450
+ };
19451
+
19452
+ /* tslint:disable */
19453
+ /* eslint-disable */
19454
+ /**
19455
+ * Immutable zkEVM API
19456
+ * Immutable Multi Rollup API
19457
+ *
19458
+ * The version of the OpenAPI document: 1.0.0
19459
+ * Contact: support@immutable.com
19460
+ *
19461
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19462
+ * https://openapi-generator.tech
19463
+ * Do not edit the class manually.
19464
+ */
19465
+
19466
+ var index = /*#__PURE__*/Object.freeze({
19467
+ __proto__: null,
19468
+ APIError400AllOfCodeEnum: APIError400AllOfCodeEnum,
19469
+ APIError401AllOfCodeEnum: APIError401AllOfCodeEnum,
19470
+ APIError403AllOfCodeEnum: APIError403AllOfCodeEnum,
19471
+ APIError404AllOfCodeEnum: APIError404AllOfCodeEnum,
19472
+ APIError429AllOfCodeEnum: APIError429AllOfCodeEnum,
19473
+ APIError500AllOfCodeEnum: APIError500AllOfCodeEnum,
19474
+ ActivitiesApi: ActivitiesApi,
19475
+ ActivitiesApiAxiosParamCreator: ActivitiesApiAxiosParamCreator,
19476
+ ActivitiesApiFactory: ActivitiesApiFactory,
19477
+ ActivitiesApiFp: ActivitiesApiFp,
19478
+ ActivityType: ActivityType,
19479
+ ChainsApi: ChainsApi,
19480
+ ChainsApiAxiosParamCreator: ChainsApiAxiosParamCreator,
19481
+ ChainsApiFactory: ChainsApiFactory,
19482
+ ChainsApiFp: ChainsApiFp,
19483
+ CollectionContractType: CollectionContractType,
19484
+ CollectionsApi: CollectionsApi,
19485
+ CollectionsApiAxiosParamCreator: CollectionsApiAxiosParamCreator,
19486
+ CollectionsApiFactory: CollectionsApiFactory,
19487
+ CollectionsApiFp: CollectionsApiFp,
19488
+ Configuration: Configuration,
19489
+ ERC20ItemItemTypeEnum: ERC20ItemItemTypeEnum,
19490
+ ERC721ItemItemTypeEnum: ERC721ItemItemTypeEnum,
19491
+ FeeFeeTypeEnum: FeeFeeTypeEnum,
19492
+ NFTContractType: NFTContractType,
19493
+ NativeItemItemTypeEnum: NativeItemItemTypeEnum,
19494
+ NftOwnersApi: NftOwnersApi,
19495
+ NftOwnersApiAxiosParamCreator: NftOwnersApiAxiosParamCreator,
19496
+ NftOwnersApiFactory: NftOwnersApiFactory,
19497
+ NftOwnersApiFp: NftOwnersApiFp,
19498
+ NftsApi: NftsApi,
19499
+ NftsApiAxiosParamCreator: NftsApiAxiosParamCreator,
19500
+ NftsApiFactory: NftsApiFactory,
19501
+ NftsApiFp: NftsApiFp,
19502
+ OrderStatus: OrderStatus,
19503
+ OrdersApi: OrdersApi,
19504
+ OrdersApiAxiosParamCreator: OrdersApiAxiosParamCreator,
19505
+ OrdersApiFactory: OrdersApiFactory,
19506
+ OrdersApiFp: OrdersApiFp,
19507
+ PassportApi: PassportApi,
19508
+ PassportApiAxiosParamCreator: PassportApiAxiosParamCreator,
19509
+ PassportApiFactory: PassportApiFactory,
19510
+ PassportApiFp: PassportApiFp,
19511
+ ProtocolDataOrderTypeEnum: ProtocolDataOrderTypeEnum,
19512
+ SaleFeeTypeEnum: SaleFeeTypeEnum,
19513
+ TokenContractType: TokenContractType,
19514
+ TokensApi: TokensApi,
19515
+ TokensApiAxiosParamCreator: TokensApiAxiosParamCreator,
19516
+ TokensApiFactory: TokensApiFactory,
19517
+ TokensApiFp: TokensApiFp
19518
+ });
19519
+
19520
+ /**
19521
+ * Custom Error class that is returned from the API when a request fails
19522
+ */
19523
+ class APIError extends Error {
19524
+ code;
19525
+ details;
19526
+ link;
19527
+ traceId;
19528
+ constructor({ message, code, details, link, trace_id: traceId, }) {
19529
+ super(message);
19530
+ this.code = code;
19531
+ this.details = details;
19532
+ this.link = link;
19533
+ this.traceId = traceId;
19534
+ }
19535
+ }
19536
+
19537
+ /* eslint-disable implicit-arrow-linebreak */
19538
+ const defaultHeaders = {
19539
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.17.5',
19540
+ };
19541
+ /**
19542
+ * createAPIConfiguration to create a custom Configuration
19543
+ * other than the production and sandbox defined below.
19544
+ */
19545
+ const createAPIConfiguration = ({ basePath, headers: baseHeaders, }) => {
19546
+ if (!basePath.trim()) {
19547
+ throw Error('basePath can not be empty');
19548
+ }
19549
+ const headers = { ...(baseHeaders || {}), ...defaultHeaders };
19550
+ const configParams = {
19551
+ basePath,
19552
+ baseOptions: { headers },
19553
+ };
19554
+ return new index.Configuration(configParams);
19555
+ };
19556
+ const production = () => createAPIConfiguration({
19557
+ basePath: 'https://indexer-mr.imtbl.com',
19558
+ });
19559
+ const sandbox = () => createAPIConfiguration({
19560
+ basePath: 'https://api.sandbox.immutable.com',
19561
+ });
19562
+ class BlockchainDataConfiguration {
19563
+ apiConfig;
19564
+ baseConfig;
19565
+ constructor({ baseConfig, overrides }) {
19566
+ this.baseConfig = baseConfig;
19567
+ if (overrides) {
19568
+ this.apiConfig = createAPIConfiguration(overrides);
19569
+ }
19570
+ else {
19571
+ switch (baseConfig.environment) {
19572
+ case Environment$1.SANDBOX: {
19573
+ this.apiConfig = sandbox();
19574
+ break;
19575
+ }
19576
+ case Environment$1.PRODUCTION: {
19577
+ this.apiConfig = production();
19578
+ break;
19579
+ }
19580
+ default: {
19581
+ this.apiConfig = sandbox();
19582
+ }
19583
+ }
19584
+ }
19585
+ }
19586
+ }
19587
+
19588
+ /* eslint-disable @typescript-eslint/naming-convention */
19589
+ /**
19590
+ * [Formats an error in the APIError shape](https://axios-http.com/docs/handling_errors)
19591
+ * @param error - The Error object thrown by the request
19592
+ * @returns APIError
19593
+ */
19594
+ function formatError(error) {
19595
+ if (globalAxios.isAxiosError(error) && error.response) {
19596
+ const apiError = error.response.data;
19597
+ if (apiError.code && apiError.message) {
19598
+ return new APIError({
19599
+ code: apiError.code,
19600
+ message: apiError.message,
19601
+ details: apiError.details || null,
19602
+ link: apiError.link || '',
19603
+ trace_id: apiError.trace_id || '',
19604
+ });
19605
+ }
19606
+ return new APIError({
19607
+ code: error.code ?? error.response?.status.toString() ?? 'unknown_error_code',
19608
+ message: String(error),
19609
+ details: null,
19610
+ link: '',
19611
+ trace_id: '',
19612
+ });
19613
+ }
19614
+ return new APIError({
19615
+ code: 'unknown_error_code',
19616
+ message: String(error),
19617
+ details: null,
19618
+ link: '',
19619
+ trace_id: '',
19620
+ });
19621
+ }
19622
+
19623
+ class BlockchainData {
19624
+ config;
19625
+ activities;
19626
+ chains;
19627
+ collections;
19628
+ nfts;
19629
+ nftOwners;
19630
+ tokens;
19631
+ constructor(moduleConfig) {
19632
+ this.config = new BlockchainDataConfiguration(moduleConfig);
19633
+ this.activities = new index.ActivitiesApi(this.config.apiConfig);
19634
+ this.chains = new index.ChainsApi(this.config.apiConfig);
19635
+ this.collections = new index.CollectionsApi(this.config.apiConfig);
19636
+ this.nfts = new index.NftsApi(this.config.apiConfig);
19637
+ this.nftOwners = new index.NftOwnersApi(this.config.apiConfig);
19638
+ this.tokens = new index.TokensApi(this.config.apiConfig);
19639
+ }
19640
+ /**
19641
+ * List all activities
19642
+ * @param request - the request object containing the parameters to be provided in the API request
19643
+ * @returns a promise that resolves with a list of activities
19644
+ * @throws {@link index.APIError}
19645
+ */
19646
+ async listActivities(request) {
19647
+ return await this.activities
19648
+ .listActivities(request)
19649
+ .then((res) => res.data)
19650
+ .catch((err) => {
19651
+ throw formatError(err);
19652
+ });
19653
+ }
19654
+ /**
19655
+ * Get a single activity by ID
19656
+ * @param request - the request object containing the parameters to be provided in the API request
19657
+ * @returns a promise that resolves with a single activity
19658
+ * @throws {@link index.APIError}
19659
+ */
19660
+ async getActivity(request) {
19661
+ return await this.activities
19662
+ .getActivity(request)
19663
+ .then((res) => res.data)
19664
+ .catch((err) => {
19665
+ throw formatError(err);
19666
+ });
19667
+ }
19668
+ /**
19669
+ * List supported chains
19670
+ * @param request - the request object containing the parameters to be provided in the API request
19671
+ * @returns a promise that resolves with a list of supported chains
19672
+ * @throws {@link index.APIError}
19673
+ */
19674
+ async listChains(request) {
19675
+ return await this.chains
19676
+ .listChains(request)
19677
+ .then((res) => res.data)
19678
+ .catch((err) => {
19679
+ throw formatError(err);
19680
+ });
19681
+ }
19682
+ /**
19683
+ * List all collections
19684
+ * @param request - the request object containing the parameters to be provided in the API request
19685
+ * @returns a promise that resolves with a list of collections
19686
+ * @throws {@link index.APIError}
19687
+ */
19688
+ async listCollections(request) {
19689
+ return await this.collections
19690
+ .listCollections(request)
19691
+ .then((res) => res.data)
19692
+ .catch((err) => {
19693
+ throw formatError(err);
19694
+ });
19695
+ }
19696
+ /**
19697
+ * List collections by NFT owner
19698
+ * @param request - the request object containing the parameters to be provided in the API request
19699
+ * @returns a promise that resolves with a list of collections
19700
+ * @throws {@link index.APIError}
19701
+ */
19702
+ async listCollectionsByNFTOwner(request) {
19703
+ return await this.collections
19704
+ .listCollectionsByNFTOwner(request)
19705
+ .then((res) => res.data)
19706
+ .catch((err) => {
19707
+ throw formatError(err);
19708
+ });
19709
+ }
19710
+ /**
19711
+ * Get collection by contract address
19712
+ * @param request - the request object containing the parameters to be provided in the API request
19713
+ * @returns a promise that resolves with a single collection
19714
+ * @throws {@link index.APIError}
19715
+ */
19716
+ async getCollection(request) {
19717
+ return await this.collections
19718
+ .getCollection(request)
19719
+ .then((res) => res.data)
19720
+ .catch((err) => {
19721
+ throw formatError(err);
19722
+ });
19723
+ }
19724
+ /**
19725
+ * Get NFT by token ID
19726
+ * @param request - the request object containing the parameters to be provided in the API request
19727
+ * @returns a promise that resolves with a single NFT
19728
+ * @throws {@link index.APIError}
19729
+ */
19730
+ async getNFT(request) {
19731
+ return await this.nfts
19732
+ .getNFT(request)
19733
+ .then((res) => res.data)
19734
+ .catch((err) => {
19735
+ throw formatError(err);
19736
+ });
19737
+ }
19738
+ /**
19739
+ * List NFTs by contract address
19740
+ * @param request - the request object containing the parameters to be provided in the API request
19741
+ * @returns a promise that resolves with a list of NFTs
19742
+ * @throws {@link index.APIError}
19743
+ */
19744
+ async listNFTs(request) {
19745
+ return await this.nfts
19746
+ .listNFTs(request)
19747
+ .then((res) => res.data)
19748
+ .catch((err) => {
19749
+ throw formatError(err);
19750
+ });
19751
+ }
19752
+ /**
19753
+ * List NFTs by account address
19754
+ * @param request - the request object containing the parameters to be provided in the API request
19755
+ * @returns a promise that resolves with a list of NFTs
19756
+ * @throws {@link index.APIError}
19757
+ */
19758
+ async listNFTsByAccountAddress(request) {
19759
+ return await this.nfts
19760
+ .listNFTsByAccountAddress(request)
19761
+ .then((res) => res.data)
19762
+ .catch((err) => {
19763
+ throw formatError(err);
19764
+ });
19765
+ }
19766
+ /**
19767
+ * List NFT owners by token ID
19768
+ * @param request - the request object containing the parameters to be provided in the API request
19769
+ * @returns a promise that resolves with a list of NFT owners
19770
+ * @throws {@link index.APIError}
19771
+ */
19772
+ async listNFTOwners(request) {
19773
+ return await this.nftOwners
19774
+ .listNFTOwners(request)
19775
+ .then((res) => res.data)
19776
+ .catch((err) => {
19777
+ throw formatError(err);
19778
+ });
19779
+ }
19780
+ /**
19781
+ * List ERC20 Token contracts
19782
+ * @param request - the request object containing the parameters to be provided in the API request
19783
+ * @returns a promise that resolves with a list of ERC20 Tokens
19784
+ * @throws {@link index.APIError}
19785
+ */
19786
+ async listTokens(request) {
19787
+ return await this.tokens
19788
+ .listERC20Tokens(request)
19789
+ .then((res) => res.data)
19790
+ .catch((err) => {
19791
+ throw formatError(err);
19792
+ });
19793
+ }
19794
+ /**
19795
+ * Get details for an ERC20 Token by contract address
19796
+ * @param request - the request object containing the parameters to be provided in the API request
19797
+ * @returns a promise that resolves with a list of ERC20 Tokens
19798
+ * @throws {@link index.APIError}
19799
+ */
19800
+ async getToken(request) {
19801
+ return await this.tokens
19802
+ .getERC20Token(request)
19803
+ .then((res) => res.data)
19804
+ .catch((err) => {
19805
+ throw formatError(err);
19806
+ });
19807
+ }
19808
+ }
19809
+
16973
19810
  /* eslint-disable class-methods-use-this */
16974
19811
 
16975
19812
 
@@ -17472,6 +20309,7 @@ var $e055e79256bbc1dd$export$80f4da0d409a629d;
17472
20309
  CheckoutErrorType["EXECUTE_APPROVAL_TRANSACTION_ERROR"] = "EXECUTE_APPROVAL_TRANSACTION_ERROR";
17473
20310
  CheckoutErrorType["EXECUTE_FULFILMENT_TRANSACTION_ERROR"] = "EXECUTE_FULFILMENT_TRANSACTION_ERROR";
17474
20311
  CheckoutErrorType["SIGN_MESSAGE_ERROR"] = "SIGN_MESSAGE_ERROR";
20312
+ CheckoutErrorType["BRIDGE_GAS_ESTIMATE_ERROR"] = "BRIDGE_GAS_ESTIMATE_ERROR";
17475
20313
  })($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
17476
20314
  class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
17477
20315
  message;
@@ -17664,7 +20502,7 @@ class $a492ee374ae7b613$export$d902b56530cd5f87 {
17664
20502
  static async makeHttpRequest(url) {
17665
20503
  let response;
17666
20504
  try {
17667
- response = await (0, $7v2Z6$axios).get(url);
20505
+ response = await (0, globalAxios).get(url);
17668
20506
  } catch (error) {
17669
20507
  throw new Error(`Error fetching from api: ${error.message}`);
17670
20508
  }
@@ -17798,7 +20636,7 @@ class $fd8a8472dcc3ec2b$export$ef140a6b05dfc786 {
17798
20636
  chainId;
17799
20637
  cacheMap;
17800
20638
  static async makeHttpRequest(url) {
17801
- return ($7v2Z6$axios).get(url);
20639
+ return (globalAxios).get(url);
17802
20640
  }
17803
20641
  setCache(key, data) {
17804
20642
  this.cacheMap[key] = {
@@ -17868,7 +20706,7 @@ class $fd8a8472dcc3ec2b$export$ef140a6b05dfc786 {
17868
20706
  } catch (err) {
17869
20707
  let code = (HttpStatusCode).InternalServerError;
17870
20708
  let message = "InternalServerError";
17871
- if (($7v2Z6$axios).isAxiosError(err)) {
20709
+ if ((globalAxios).isAxiosError(err)) {
17872
20710
  code = err.response?.status || code;
17873
20711
  message = err.message;
17874
20712
  }
@@ -17902,7 +20740,7 @@ class $fd8a8472dcc3ec2b$export$ef140a6b05dfc786 {
17902
20740
  } catch (err) {
17903
20741
  let code = (HttpStatusCode).InternalServerError;
17904
20742
  let message = "InternalServerError";
17905
- if (($7v2Z6$axios).isAxiosError(err)) {
20743
+ if ((globalAxios).isAxiosError(err)) {
17906
20744
  code = err.response?.status || code;
17907
20745
  message = err.message;
17908
20746
  }
@@ -18279,6 +21117,7 @@ async function $570856c68db0bd36$export$9e73e22953cebcfc(tokenBridge, tokenAddre
18279
21117
 
18280
21118
 
18281
21119
 
21120
+
18282
21121
  async function $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, config) {
18283
21122
  const rootChainProvider = readOnlyProviders.get(fromChainId);
18284
21123
  const childChainProvider = readOnlyProviders.get(toChainId);
@@ -18314,6 +21153,13 @@ async function $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config) {
18314
21153
  }
18315
21154
  });
18316
21155
  }
21156
+ function $67fc622a2b913d5f$export$436dd76f23f463ff(config) {
21157
+ return new (BlockchainData)({
21158
+ baseConfig: {
21159
+ environment: config.environment
21160
+ }
21161
+ });
21162
+ }
18317
21163
 
18318
21164
 
18319
21165
 
@@ -19104,43 +21950,30 @@ const $7f2e17f026d4fc8d$export$f1ca3744c025ab81 = async (config, provider)=>{
19104
21950
 
19105
21951
 
19106
21952
 
21953
+ var $b23305044c0e096a$export$3057de18ac0c076;
21954
+ (function(RouteCalculatorType) {
21955
+ RouteCalculatorType["ROUTES_FOUND"] = "ROUTES_FOUND";
21956
+ RouteCalculatorType["NO_ROUTES"] = "NO_ROUTES";
21957
+ RouteCalculatorType["NO_OPTIONS"] = "NO_OPTIONS";
21958
+ })($b23305044c0e096a$export$3057de18ac0c076 || ($b23305044c0e096a$export$3057de18ac0c076 = {}));
21959
+ var $b23305044c0e096a$export$3af78bb3e8650ee6;
21960
+ (function(FundingRouteType) {
21961
+ FundingRouteType["BRIDGE"] = "BRIDGE";
21962
+ FundingRouteType["ON_RAMP"] = "ONRAMP";
21963
+ FundingRouteType["SWAP"] = "SWAP";
21964
+ })($b23305044c0e096a$export$3af78bb3e8650ee6 || ($b23305044c0e096a$export$3af78bb3e8650ee6 = {}));
19107
21965
 
19108
21966
 
19109
21967
 
19110
21968
 
19111
21969
 
19112
- async function $0e0060cb42e136d2$export$339cb2be73677b30(config, existingReadOnlyProviders) {
19113
- if (config.isProduction && existingReadOnlyProviders?.has(($0472f23319457bfb$export$c06e1e7429de6283).ETHEREUM)) return existingReadOnlyProviders;
19114
- if (existingReadOnlyProviders?.has(($0472f23319457bfb$export$c06e1e7429de6283).SEPOLIA)) return existingReadOnlyProviders;
19115
- const readOnlyProviders = new Map();
19116
- const allowedNetworks = await $de192de6ef100f9f$export$3043f6442a9ef563(config, {
19117
- type: ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL
19118
- });
19119
- allowedNetworks.networks.forEach((networkInfo)=>{
19120
- const rpcUrl = config.networkMap.get(networkInfo.chainId)?.rpcUrls[0];
19121
- const provider = new (JsonRpcProvider)(rpcUrl);
19122
- readOnlyProviders.set(networkInfo.chainId, provider);
19123
- });
19124
- return readOnlyProviders;
19125
- }
19126
-
19127
-
19128
-
19129
-
19130
- const $33acec7b4a26c053$export$23ddeb2642d2f9d = async (config, ownerAddress, availableRoutingOptions)=>{
21970
+ const $33acec7b4a26c053$export$23ddeb2642d2f9d = async (config, readOnlyProviders, ownerAddress, availableRoutingOptions)=>{
19131
21971
  const chainBalances = new Map();
19132
21972
  const chainBalancePromises = new Map();
19133
- let readOnlyProviders = new Map();
19134
- let providerError;
19135
- try {
19136
- readOnlyProviders = await (0, $0e0060cb42e136d2$export$339cb2be73677b30)(config);
19137
- } catch (error) {
19138
- providerError = error;
19139
- }
19140
21973
  if (readOnlyProviders.size === 0) {
19141
21974
  const noProviderResult = {
19142
21975
  success: false,
19143
- error: providerError || new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Provider failed", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_ERROR),
21976
+ error: new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No L1 or L2 provider available", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_ERROR),
19144
21977
  balances: []
19145
21978
  };
19146
21979
  chainBalances.set(($4013c5c91bb535f6$export$9b794d067cdd1af6)(config), noProviderResult);
@@ -19184,44 +22017,243 @@ const $33acec7b4a26c053$export$23ddeb2642d2f9d = async (config, ownerAddress, av
19184
22017
  };
19185
22018
 
19186
22019
 
22020
+ /* eslint-disable @typescript-eslint/no-unused-vars */
22021
+
22022
+
22023
+
22024
+
22025
+ const $f730af3b727f04ac$export$22fea095b15361de = (balances)=>{
22026
+ for (const balance of balances.balances){
22027
+ if (!balance.token.address || balance.token.address === "") return balance.balance;
22028
+ }
22029
+ return (BigNumber$1).from(0);
22030
+ };
22031
+
22032
+
22033
+
22034
+
22035
+
22036
+
22037
+ const $8a49d1a3783a2640$export$3aff971444a4f244 = async (config, readOnlyProviders)=>{
22038
+ try {
22039
+ const estimate = await (0, $2e7bf45a7c9a9570$export$942c8de7174809fc)({
22040
+ gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2,
22041
+ isSpendingCapApprovalRequired: false
22042
+ }, readOnlyProviders, config);
22043
+ const gasEstimate = estimate.gasFee.estimatedAmount;
22044
+ const bridgeFee = estimate.bridgeFee.estimatedAmount;
22045
+ let totalFees = (0, BigNumber$1).from(0);
22046
+ if (gasEstimate) totalFees = totalFees.add(gasEstimate);
22047
+ if (bridgeFee) totalFees = totalFees.add(bridgeFee);
22048
+ return totalFees;
22049
+ } catch (err) {
22050
+ throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Error estimating gas for bridge", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).BRIDGE_GAS_ESTIMATE_ERROR, {
22051
+ message: err.message
22052
+ });
22053
+ }
22054
+ };
22055
+
22056
+
22057
+
22058
+ const $823db9fb0ca4bc15$export$c37d8687c27b9660 = "0x0000000000000000000000000000000000000001";
22059
+ const $823db9fb0ca4bc15$export$1430626eec86fce9 = (chainId)=>{
22060
+ if (chainId === ($0472f23319457bfb$export$c06e1e7429de6283).IMTBL_ZKEVM_TESTNET) return "imtbl-zkevm-testnet";
22061
+ return "";
22062
+ };
22063
+ const $823db9fb0ca4bc15$export$53e663abd9b77fc1 = (chainId)=>{
22064
+ if (chainId === ($0472f23319457bfb$export$c06e1e7429de6283).SEPOLIA) return "0x2Fa06C6672dDCc066Ab04631192738799231dE4a";
22065
+ if (chainId === ($0472f23319457bfb$export$c06e1e7429de6283).ETHEREUM) return "0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF";
22066
+ return "";
22067
+ };
22068
+
22069
+
22070
+
22071
+
22072
+
22073
+
22074
+
22075
+ const $07ac9c0576988336$export$7847f5f5cce25dfa = async (config, readOnlyProviders, l1provider, depositorAddress, fromChainId, toChainId, token, depositAmount)=>{
22076
+ try {
22077
+ const tokenBridge = await $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, config);
22078
+ const { unsignedTx: unsignedTx } = await tokenBridge.getUnsignedApproveDepositBridgeTx({
22079
+ depositorAddress: depositorAddress,
22080
+ token: token,
22081
+ depositAmount: depositAmount
22082
+ });
22083
+ if (unsignedTx === null) return (0, BigNumber$1).from(0);
22084
+ return await l1provider.estimateGas(unsignedTx);
22085
+ } catch (err) {
22086
+ throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Error occurred while attempting ot estimate gas for approval transaction", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).BRIDGE_GAS_ESTIMATE_ERROR, {
22087
+ message: err.message
22088
+ });
22089
+ }
22090
+ };
22091
+ const $07ac9c0576988336$export$a3dd181de896b7c7 = async (config, readOnlyProviders, l1provider, depositorAddress, l1Address, delta)=>{
22092
+ if (l1Address === ($823db9fb0ca4bc15$export$c37d8687c27b9660)) return (BigNumber$1).from(0); // Native ETH does not require approval
22093
+ const fromChainId = ($4013c5c91bb535f6$export$9b794d067cdd1af6)(config);
22094
+ const toChainId = ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config);
22095
+ return await $07ac9c0576988336$export$7847f5f5cce25dfa(config, readOnlyProviders, l1provider, depositorAddress, fromChainId, toChainId, l1Address, delta);
22096
+ };
22097
+
22098
+
22099
+
22100
+ const $fa9ac5bfdbbf9dfa$export$9994ad18c2f0e665 = (balances, totalFees)=>{
22101
+ const balance = ($f730af3b727f04ac$export$22fea095b15361de)(balances);
22102
+ return balance.gte(totalFees);
22103
+ };
22104
+ const $fa9ac5bfdbbf9dfa$export$97330fab5f794e7f = (balanceRequirement)=>{
22105
+ if (balanceRequirement.type === ($4b58188d47aafe8d$export$1fc8f52ad1810e52).NATIVE) return $d85ad1457a3f1a83$export$b80040cb173ba6e9;
22106
+ if (balanceRequirement.type === ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20) return balanceRequirement.required.token.address ?? "";
22107
+ return "";
22108
+ };
22109
+ const $fa9ac5bfdbbf9dfa$export$952cdf461a00a8c6 = async (config, balanceRequirement)=>{
22110
+ const l2address = $fa9ac5bfdbbf9dfa$export$97330fab5f794e7f(balanceRequirement);
22111
+ if (l2address === "") return "";
22112
+ if (l2address === ($d85ad1457a3f1a83$export$b80040cb173ba6e9)) return ($823db9fb0ca4bc15$export$53e663abd9b77fc1)(($4013c5c91bb535f6$export$9b794d067cdd1af6)(config));
22113
+ const chainName = ($823db9fb0ca4bc15$export$1430626eec86fce9)(($4013c5c91bb535f6$export$c9af4e4b001c6476)(config));
22114
+ if (chainName === "") return ""; // Chain name not a valid indexer chain name
22115
+ const blockchainData = ($67fc622a2b913d5f$export$436dd76f23f463ff)(config);
22116
+ const tokenData = await blockchainData.getToken({
22117
+ chainName: chainName,
22118
+ contractAddress: l2address
22119
+ });
22120
+ const l1address = tokenData.result.root_contract_address;
22121
+ if (l1address === null) return ""; // No L1 representation of this token
22122
+ return l1address;
22123
+ };
22124
+ const $fa9ac5bfdbbf9dfa$export$da05aed50d75046 = async (config, readOnlyProviders, feeEstimates)=>{
22125
+ let bridgeFeeEstimate = feeEstimates.get(($b23305044c0e096a$export$3af78bb3e8650ee6).BRIDGE);
22126
+ if (bridgeFeeEstimate) return bridgeFeeEstimate;
22127
+ bridgeFeeEstimate = await ($8a49d1a3783a2640$export$3aff971444a4f244)(config, readOnlyProviders);
22128
+ feeEstimates.set(($b23305044c0e096a$export$3af78bb3e8650ee6).BRIDGE, bridgeFeeEstimate);
22129
+ return bridgeFeeEstimate;
22130
+ };
22131
+ const $fa9ac5bfdbbf9dfa$var$constructBridgeFundingRoute = (chainId, balance)=>({
22132
+ type: ($b23305044c0e096a$export$3af78bb3e8650ee6).BRIDGE,
22133
+ chainId: chainId,
22134
+ asset: {
22135
+ balance: balance.balance,
22136
+ formattedBalance: balance.formattedBalance,
22137
+ token: {
22138
+ name: balance.token.name,
22139
+ symbol: balance.token.symbol,
22140
+ address: balance.token.address,
22141
+ decimals: balance.token.decimals
22142
+ }
22143
+ }
22144
+ });
22145
+ const $fa9ac5bfdbbf9dfa$export$3139474685e4dedd = (address)=>{
22146
+ if (!address || address === "") return true;
22147
+ return false;
22148
+ };
22149
+ const $fa9ac5bfdbbf9dfa$export$ddc7ba2b57d7c5fa = async (config, readOnlyProviders, depositorAddress, availableRoutingOptions, balanceRequirement, balances, feeEstimates)=>{
22150
+ if (!availableRoutingOptions.bridge) return undefined;
22151
+ const chainId = ($4013c5c91bb535f6$export$9b794d067cdd1af6)(config);
22152
+ const tokenBalanceResult = balances.get(chainId);
22153
+ const l1provider = readOnlyProviders.get(chainId);
22154
+ if (!l1provider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No L1 provider available", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_ERROR, {
22155
+ chainId: chainId.toString()
22156
+ });
22157
+ // If no balances on layer 1 then Bridge cannot be an option
22158
+ if (tokenBalanceResult === undefined || tokenBalanceResult.success === false) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Error getting balances", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_BALANCE_ERROR, {
22159
+ chainId: chainId.toString()
22160
+ });
22161
+ if (tokenBalanceResult.balances.length === 0) return undefined;
22162
+ const bridgeFeeEstimate = await $fa9ac5bfdbbf9dfa$export$da05aed50d75046(config, readOnlyProviders, feeEstimates);
22163
+ // If the user has no ETH to cover the bridge fees or approval fees then bridge cannot be an option
22164
+ if (!$fa9ac5bfdbbf9dfa$export$9994ad18c2f0e665(tokenBalanceResult, bridgeFeeEstimate)) return undefined;
22165
+ const l1address = await $fa9ac5bfdbbf9dfa$export$952cdf461a00a8c6(config, balanceRequirement);
22166
+ if (l1address === "") return undefined;
22167
+ const gasForApproval = await ($07ac9c0576988336$export$a3dd181de896b7c7)(config, readOnlyProviders, l1provider, depositorAddress, l1address, balanceRequirement.delta.balance);
22168
+ if (!$fa9ac5bfdbbf9dfa$export$9994ad18c2f0e665(tokenBalanceResult, gasForApproval.add(bridgeFeeEstimate))) return undefined;
22169
+ // If the L1 representation of the requirement is ETH then find the ETH balance and check if the balance covers the delta
22170
+ if (l1address === ($823db9fb0ca4bc15$export$c37d8687c27b9660)) {
22171
+ const nativeETHBalance = tokenBalanceResult.balances.find((balance)=>$fa9ac5bfdbbf9dfa$export$3139474685e4dedd(balance.token.address));
22172
+ if (nativeETHBalance && nativeETHBalance.balance.gte(balanceRequirement.delta.balance.add(bridgeFeeEstimate))) return $fa9ac5bfdbbf9dfa$var$constructBridgeFundingRoute(chainId, nativeETHBalance);
22173
+ return undefined;
22174
+ }
22175
+ // Find the balance of the L1 representation of the token and check if the balance covers the delta
22176
+ const erc20balance = tokenBalanceResult.balances.find((balance)=>balance.token.address === l1address);
22177
+ if (erc20balance && erc20balance.balance.gte(balanceRequirement.delta.balance)) return $fa9ac5bfdbbf9dfa$var$constructBridgeFundingRoute(chainId, erc20balance);
22178
+ return undefined;
22179
+ };
22180
+
22181
+
22182
+
22183
+
22184
+
22185
+ async function $0e0060cb42e136d2$export$339cb2be73677b30(config, existingReadOnlyProviders) {
22186
+ if (config.isProduction && existingReadOnlyProviders?.has(($0472f23319457bfb$export$c06e1e7429de6283).ETHEREUM)) return existingReadOnlyProviders;
22187
+ if (existingReadOnlyProviders?.has(($0472f23319457bfb$export$c06e1e7429de6283).SEPOLIA)) return existingReadOnlyProviders;
22188
+ const readOnlyProviders = new Map();
22189
+ const allowedNetworks = await $de192de6ef100f9f$export$3043f6442a9ef563(config, {
22190
+ type: ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL
22191
+ });
22192
+ allowedNetworks.networks.forEach((networkInfo)=>{
22193
+ const rpcUrl = config.networkMap.get(networkInfo.chainId)?.rpcUrls[0];
22194
+ const provider = new (JsonRpcProvider)(rpcUrl);
22195
+ readOnlyProviders.set(networkInfo.chainId, provider);
22196
+ });
22197
+ return readOnlyProviders;
22198
+ }
22199
+
22200
+
22201
+
22202
+ const $c16168a9c28ae4fd$export$31ce7ba1a2956195 = (balanceRequirements)=>{
22203
+ let insufficientBalanceCount = 0;
22204
+ let insufficientBridgeRequirement;
22205
+ for (const balanceRequirement of balanceRequirements.balanceRequirements)if (!balanceRequirement.sufficient) {
22206
+ insufficientBalanceCount++;
22207
+ insufficientBridgeRequirement = balanceRequirement;
22208
+ }
22209
+ if (insufficientBalanceCount === 1) return insufficientBridgeRequirement;
22210
+ return undefined;
22211
+ };
19187
22212
  const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, balanceRequirements, availableRoutingOptions)=>{
19188
- // eslint-disable-next-line no-console
19189
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
19190
- await ($33acec7b4a26c053$export$23ddeb2642d2f9d)(config, ownerAddress, availableRoutingOptions);
22213
+ let readOnlyProviders;
22214
+ try {
22215
+ readOnlyProviders = await (0, $0e0060cb42e136d2$export$339cb2be73677b30)(config);
22216
+ } catch (err) {
22217
+ throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Error occurred while creating read only providers", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_ERROR, {
22218
+ message: err.message
22219
+ });
22220
+ }
22221
+ const tokenBalances = await ($33acec7b4a26c053$export$23ddeb2642d2f9d)(config, readOnlyProviders, ownerAddress, availableRoutingOptions);
19191
22222
  // Get allowed tokens?
19192
- // Check bridging routes
22223
+ // Bridge and swap fee cache
22224
+ const feeEstimates = new Map();
22225
+ // Ensures only 1 balance requirement is insufficient otherwise one bridge route cannot be recommended
22226
+ let bridgeFundingStep;
22227
+ const insufficientRequirement = $c16168a9c28ae4fd$export$31ce7ba1a2956195(balanceRequirements);
22228
+ if (availableRoutingOptions.bridge && insufficientRequirement) bridgeFundingStep = await ($fa9ac5bfdbbf9dfa$export$ddc7ba2b57d7c5fa)(config, readOnlyProviders, ownerAddress, availableRoutingOptions, insufficientRequirement, tokenBalances, feeEstimates);
19193
22229
  // Check on-ramp routes
19194
22230
  // Check swap routes
19195
22231
  // > Could bridge first
19196
22232
  // > Could on-ramp first
19197
22233
  // > Could double swap
19198
- return {
22234
+ if (bridgeFundingStep) return {
19199
22235
  availableOptions: [],
19200
22236
  response: {
19201
- type: "ROUTES_FOUND",
22237
+ type: ($b23305044c0e096a$export$3057de18ac0c076).ROUTES_FOUND,
19202
22238
  message: "Routes found"
19203
22239
  },
19204
22240
  fundingRoutes: [
19205
22241
  {
19206
22242
  priority: 1,
19207
22243
  steps: [
19208
- {
19209
- type: "bridge",
19210
- chainId: 1,
19211
- asset: {
19212
- balance: (BigNumber$1).from(0),
19213
- formattedBalance: "0",
19214
- token: {
19215
- name: "ETH",
19216
- symbol: "ETH",
19217
- decimals: 18
19218
- }
19219
- }
19220
- }
22244
+ bridgeFundingStep
19221
22245
  ]
19222
22246
  }
19223
22247
  ]
19224
22248
  };
22249
+ return {
22250
+ availableOptions: [],
22251
+ response: {
22252
+ type: ($b23305044c0e096a$export$3057de18ac0c076).NO_ROUTES,
22253
+ message: "Routes not found"
22254
+ },
22255
+ fundingRoutes: []
22256
+ };
19225
22257
  };
19226
22258
 
19227
22259