@imtbl/sdk 0.39.2 → 0.39.3
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.
- package/dist/blockchain_data.js +1 -1
- package/dist/browser/checkout/sdk.js +5 -5
- package/dist/browser/checkout/widgets.js +59 -59
- package/dist/checkout.d.ts +0 -1
- package/dist/checkout.js +20 -34
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +12 -12
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +22 -36
- package/dist/index.d.ts +0 -1
- package/dist/index.js +22 -36
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/checkout.d.ts
CHANGED
|
@@ -12433,7 +12433,6 @@ declare class HttpClient {
|
|
|
12433
12433
|
constructor(config?: CheckoutModuleConfiguration);
|
|
12434
12434
|
private shouldAddPublishableKey;
|
|
12435
12435
|
private setupInterceptors;
|
|
12436
|
-
private processResponse;
|
|
12437
12436
|
request(config: AxiosRequestConfig): Promise<AxiosResponse<any, any>>;
|
|
12438
12437
|
get(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse<any, any>>;
|
|
12439
12438
|
post(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse<any, any>>;
|
package/dist/checkout.js
CHANGED
|
@@ -16668,7 +16668,7 @@ const SUPPORTED_SANDBOX_BRIDGES = [ETH_SEPOLIA_TO_ZKEVM_DEVNET, ETH_SEPOLIA_TO_Z
|
|
|
16668
16668
|
/**
|
|
16669
16669
|
* @constant {BridgeInstance[]} SUPPORTED_PRODUCTION_BRIDGES - An array of supported bridge instances for the production environment.
|
|
16670
16670
|
*/
|
|
16671
|
-
const SUPPORTED_PRODUCTION_BRIDGES = [];
|
|
16671
|
+
const SUPPORTED_PRODUCTION_BRIDGES = [ETH_MAINNET_TO_ZKEVM_MAINNET];
|
|
16672
16672
|
/**
|
|
16673
16673
|
* @constant {Object} SUPPORTED_BRIDGES_FOR_ENVIRONMENT - An object mapping environment types to their supported bridge instances.
|
|
16674
16674
|
*/
|
|
@@ -25801,7 +25801,7 @@ class APIError extends Error {
|
|
|
25801
25801
|
|
|
25802
25802
|
/* eslint-disable implicit-arrow-linebreak */
|
|
25803
25803
|
const defaultHeaders = {
|
|
25804
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.
|
|
25804
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.3',
|
|
25805
25805
|
};
|
|
25806
25806
|
/**
|
|
25807
25807
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -27150,7 +27150,7 @@ const GAS_OVERRIDES = {
|
|
|
27150
27150
|
maxPriorityFeePerGas: BigNumber$1.from(101e9),
|
|
27151
27151
|
};
|
|
27152
27152
|
|
|
27153
|
-
const SDK_VERSION_MARKER = '0.39.
|
|
27153
|
+
const SDK_VERSION_MARKER = '0.39.3';
|
|
27154
27154
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
27155
27155
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
27156
27156
|
|
|
@@ -27189,7 +27189,13 @@ class RemoteConfigFetcher {
|
|
|
27189
27189
|
async loadConfig() {
|
|
27190
27190
|
if (this.configCache)
|
|
27191
27191
|
return this.configCache;
|
|
27192
|
-
|
|
27192
|
+
let response;
|
|
27193
|
+
try {
|
|
27194
|
+
response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config`);
|
|
27195
|
+
}
|
|
27196
|
+
catch (err) {
|
|
27197
|
+
throw new CheckoutError(`Error: ${err.message}`, CheckoutErrorType.API_ERROR);
|
|
27198
|
+
}
|
|
27193
27199
|
// Ensure that the configuration is valid
|
|
27194
27200
|
this.configCache = this.parseResponse(response);
|
|
27195
27201
|
return this.configCache;
|
|
@@ -27197,7 +27203,13 @@ class RemoteConfigFetcher {
|
|
|
27197
27203
|
async loadConfigTokens() {
|
|
27198
27204
|
if (this.tokensCache)
|
|
27199
27205
|
return this.tokensCache;
|
|
27200
|
-
|
|
27206
|
+
let response;
|
|
27207
|
+
try {
|
|
27208
|
+
response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config/tokens`);
|
|
27209
|
+
}
|
|
27210
|
+
catch (err) {
|
|
27211
|
+
throw new CheckoutError(`Error: ${err.message}`, CheckoutErrorType.API_ERROR);
|
|
27212
|
+
}
|
|
27201
27213
|
// Ensure that the configuration is valid
|
|
27202
27214
|
this.tokensCache = this.parseResponse(response);
|
|
27203
27215
|
return this.tokensCache;
|
|
@@ -27404,13 +27416,7 @@ class Blockscout {
|
|
|
27404
27416
|
const cached = this.getCache(url);
|
|
27405
27417
|
if (cached)
|
|
27406
27418
|
return Promise.resolve(cached);
|
|
27407
|
-
const response = await this.httpClient.get(url);
|
|
27408
|
-
if (response.status >= 400) {
|
|
27409
|
-
return Promise.reject({
|
|
27410
|
-
code: response.status,
|
|
27411
|
-
message: response.statusText,
|
|
27412
|
-
});
|
|
27413
|
-
}
|
|
27419
|
+
const response = await this.httpClient.get(url); // success if 2XX response otherwise throw error
|
|
27414
27420
|
// To get around an issue with native tokens being an ERC-20, there is the need
|
|
27415
27421
|
// to remove IMX from `resp` and add it back in using getNativeTokenByWalletAddress.
|
|
27416
27422
|
// This has affected some of the early wallets, and it might not be an issue in mainnet
|
|
@@ -27445,13 +27451,7 @@ class Blockscout {
|
|
|
27445
27451
|
const cached = this.getCache(url);
|
|
27446
27452
|
if (cached)
|
|
27447
27453
|
return Promise.resolve(cached);
|
|
27448
|
-
const response = await this.httpClient.get(url);
|
|
27449
|
-
if (response.status >= 400) {
|
|
27450
|
-
return Promise.reject({
|
|
27451
|
-
code: response.status,
|
|
27452
|
-
message: response.statusText,
|
|
27453
|
-
});
|
|
27454
|
-
}
|
|
27454
|
+
const response = await this.httpClient.get(url); // success if 2XX response otherwise throw error
|
|
27455
27455
|
const data = {
|
|
27456
27456
|
token: this.nativeToken,
|
|
27457
27457
|
value: response.data.coin_balance,
|
|
@@ -30696,22 +30696,8 @@ class HttpClient {
|
|
|
30696
30696
|
return config;
|
|
30697
30697
|
}, (error) => Promise.reject(error));
|
|
30698
30698
|
}
|
|
30699
|
-
// eslint-disable-next-line class-methods-use-this
|
|
30700
|
-
processResponse(response) {
|
|
30701
|
-
if (response && response?.status !== 200) {
|
|
30702
|
-
throw new CheckoutError(`Error: ${response.status} ${response.statusText}`, CheckoutErrorType.API_ERROR);
|
|
30703
|
-
}
|
|
30704
|
-
}
|
|
30705
30699
|
async request(config) {
|
|
30706
|
-
|
|
30707
|
-
try {
|
|
30708
|
-
response = await this.axiosInstance.request(config);
|
|
30709
|
-
}
|
|
30710
|
-
catch (error) {
|
|
30711
|
-
throw new CheckoutError(error.message, CheckoutErrorType.API_ERROR);
|
|
30712
|
-
}
|
|
30713
|
-
this.processResponse(response);
|
|
30714
|
-
return response;
|
|
30700
|
+
return await this.axiosInstance.request(config);
|
|
30715
30701
|
}
|
|
30716
30702
|
async get(url, config) {
|
|
30717
30703
|
const requestConfig = {
|
|
@@ -17,7 +17,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
17
17
|
chainID,
|
|
18
18
|
coreContractAddress,
|
|
19
19
|
registrationContractAddress,
|
|
20
|
-
sdkVersion: 'ts-immutable-sdk-0.39.
|
|
20
|
+
sdkVersion: 'ts-immutable-sdk-0.39.3',
|
|
21
21
|
});
|
|
22
22
|
/**
|
|
23
23
|
* Sets `sdkVersion` at the time of build
|