@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/index.cjs
CHANGED
|
@@ -4256,7 +4256,7 @@ class MultiRollupApiClients {
|
|
|
4256
4256
|
}
|
|
4257
4257
|
|
|
4258
4258
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4259
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.
|
|
4259
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.3' };
|
|
4260
4260
|
const createConfig = ({ basePath, headers, }) => {
|
|
4261
4261
|
if (!basePath.trim()) {
|
|
4262
4262
|
throw Error('basePath can not be empty');
|
|
@@ -4316,7 +4316,7 @@ class APIError extends Error {
|
|
|
4316
4316
|
|
|
4317
4317
|
/* eslint-disable implicit-arrow-linebreak */
|
|
4318
4318
|
const defaultHeaders = {
|
|
4319
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.
|
|
4319
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.3',
|
|
4320
4320
|
};
|
|
4321
4321
|
/**
|
|
4322
4322
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -4755,7 +4755,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
4755
4755
|
chainID,
|
|
4756
4756
|
coreContractAddress,
|
|
4757
4757
|
registrationContractAddress,
|
|
4758
|
-
sdkVersion: 'ts-immutable-sdk-0.39.
|
|
4758
|
+
sdkVersion: 'ts-immutable-sdk-0.39.3',
|
|
4759
4759
|
});
|
|
4760
4760
|
/**
|
|
4761
4761
|
* Sets `sdkVersion` at the time of build
|
|
@@ -30951,7 +30951,7 @@ const SUPPORTED_SANDBOX_BRIDGES = [ETH_SEPOLIA_TO_ZKEVM_DEVNET, ETH_SEPOLIA_TO_Z
|
|
|
30951
30951
|
/**
|
|
30952
30952
|
* @constant {BridgeInstance[]} SUPPORTED_PRODUCTION_BRIDGES - An array of supported bridge instances for the production environment.
|
|
30953
30953
|
*/
|
|
30954
|
-
const SUPPORTED_PRODUCTION_BRIDGES = [];
|
|
30954
|
+
const SUPPORTED_PRODUCTION_BRIDGES = [ETH_MAINNET_TO_ZKEVM_MAINNET];
|
|
30955
30955
|
/**
|
|
30956
30956
|
* @constant {Object} SUPPORTED_BRIDGES_FOR_ENVIRONMENT - An object mapping environment types to their supported bridge instances.
|
|
30957
30957
|
*/
|
|
@@ -35482,7 +35482,7 @@ const GAS_OVERRIDES = {
|
|
|
35482
35482
|
maxPriorityFeePerGas: ethers.BigNumber.from(101e9),
|
|
35483
35483
|
};
|
|
35484
35484
|
|
|
35485
|
-
const SDK_VERSION_MARKER = '0.39.
|
|
35485
|
+
const SDK_VERSION_MARKER = '0.39.3';
|
|
35486
35486
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
35487
35487
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
35488
35488
|
|
|
@@ -35521,7 +35521,13 @@ class RemoteConfigFetcher {
|
|
|
35521
35521
|
async loadConfig() {
|
|
35522
35522
|
if (this.configCache)
|
|
35523
35523
|
return this.configCache;
|
|
35524
|
-
|
|
35524
|
+
let response;
|
|
35525
|
+
try {
|
|
35526
|
+
response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config`);
|
|
35527
|
+
}
|
|
35528
|
+
catch (err) {
|
|
35529
|
+
throw new CheckoutError(`Error: ${err.message}`, CheckoutErrorType.API_ERROR);
|
|
35530
|
+
}
|
|
35525
35531
|
// Ensure that the configuration is valid
|
|
35526
35532
|
this.configCache = this.parseResponse(response);
|
|
35527
35533
|
return this.configCache;
|
|
@@ -35529,7 +35535,13 @@ class RemoteConfigFetcher {
|
|
|
35529
35535
|
async loadConfigTokens() {
|
|
35530
35536
|
if (this.tokensCache)
|
|
35531
35537
|
return this.tokensCache;
|
|
35532
|
-
|
|
35538
|
+
let response;
|
|
35539
|
+
try {
|
|
35540
|
+
response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config/tokens`);
|
|
35541
|
+
}
|
|
35542
|
+
catch (err) {
|
|
35543
|
+
throw new CheckoutError(`Error: ${err.message}`, CheckoutErrorType.API_ERROR);
|
|
35544
|
+
}
|
|
35533
35545
|
// Ensure that the configuration is valid
|
|
35534
35546
|
this.tokensCache = this.parseResponse(response);
|
|
35535
35547
|
return this.tokensCache;
|
|
@@ -35736,13 +35748,7 @@ class Blockscout {
|
|
|
35736
35748
|
const cached = this.getCache(url);
|
|
35737
35749
|
if (cached)
|
|
35738
35750
|
return Promise.resolve(cached);
|
|
35739
|
-
const response = await this.httpClient.get(url);
|
|
35740
|
-
if (response.status >= 400) {
|
|
35741
|
-
return Promise.reject({
|
|
35742
|
-
code: response.status,
|
|
35743
|
-
message: response.statusText,
|
|
35744
|
-
});
|
|
35745
|
-
}
|
|
35751
|
+
const response = await this.httpClient.get(url); // success if 2XX response otherwise throw error
|
|
35746
35752
|
// To get around an issue with native tokens being an ERC-20, there is the need
|
|
35747
35753
|
// to remove IMX from `resp` and add it back in using getNativeTokenByWalletAddress.
|
|
35748
35754
|
// This has affected some of the early wallets, and it might not be an issue in mainnet
|
|
@@ -35777,13 +35783,7 @@ class Blockscout {
|
|
|
35777
35783
|
const cached = this.getCache(url);
|
|
35778
35784
|
if (cached)
|
|
35779
35785
|
return Promise.resolve(cached);
|
|
35780
|
-
const response = await this.httpClient.get(url);
|
|
35781
|
-
if (response.status >= 400) {
|
|
35782
|
-
return Promise.reject({
|
|
35783
|
-
code: response.status,
|
|
35784
|
-
message: response.statusText,
|
|
35785
|
-
});
|
|
35786
|
-
}
|
|
35786
|
+
const response = await this.httpClient.get(url); // success if 2XX response otherwise throw error
|
|
35787
35787
|
const data = {
|
|
35788
35788
|
token: this.nativeToken,
|
|
35789
35789
|
value: response.data.coin_balance,
|
|
@@ -39028,22 +39028,8 @@ class HttpClient {
|
|
|
39028
39028
|
return config;
|
|
39029
39029
|
}, (error) => Promise.reject(error));
|
|
39030
39030
|
}
|
|
39031
|
-
// eslint-disable-next-line class-methods-use-this
|
|
39032
|
-
processResponse(response) {
|
|
39033
|
-
if (response && response?.status !== 200) {
|
|
39034
|
-
throw new CheckoutError(`Error: ${response.status} ${response.statusText}`, CheckoutErrorType.API_ERROR);
|
|
39035
|
-
}
|
|
39036
|
-
}
|
|
39037
39031
|
async request(config) {
|
|
39038
|
-
|
|
39039
|
-
try {
|
|
39040
|
-
response = await this.axiosInstance.request(config);
|
|
39041
|
-
}
|
|
39042
|
-
catch (error) {
|
|
39043
|
-
throw new CheckoutError(error.message, CheckoutErrorType.API_ERROR);
|
|
39044
|
-
}
|
|
39045
|
-
this.processResponse(response);
|
|
39046
|
-
return response;
|
|
39032
|
+
return await this.axiosInstance.request(config);
|
|
39047
39033
|
}
|
|
39048
39034
|
async get(url, config) {
|
|
39049
39035
|
const requestConfig = {
|
package/dist/index.d.ts
CHANGED
|
@@ -18361,7 +18361,6 @@ declare class HttpClient {
|
|
|
18361
18361
|
constructor(config?: CheckoutModuleConfiguration);
|
|
18362
18362
|
private shouldAddPublishableKey;
|
|
18363
18363
|
private setupInterceptors;
|
|
18364
|
-
private processResponse;
|
|
18365
18364
|
request(config: AxiosRequestConfig$1): Promise<AxiosResponse$1<any, any>>;
|
|
18366
18365
|
get(url: string, config?: AxiosRequestConfig$1): Promise<AxiosResponse$1<any, any>>;
|
|
18367
18366
|
post(url: string, data?: any, config?: AxiosRequestConfig$1): Promise<AxiosResponse$1<any, any>>;
|
package/dist/index.js
CHANGED
|
@@ -4234,7 +4234,7 @@ class MultiRollupApiClients {
|
|
|
4234
4234
|
}
|
|
4235
4235
|
|
|
4236
4236
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4237
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.
|
|
4237
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.3' };
|
|
4238
4238
|
const createConfig = ({ basePath, headers, }) => {
|
|
4239
4239
|
if (!basePath.trim()) {
|
|
4240
4240
|
throw Error('basePath can not be empty');
|
|
@@ -4294,7 +4294,7 @@ class APIError extends Error {
|
|
|
4294
4294
|
|
|
4295
4295
|
/* eslint-disable implicit-arrow-linebreak */
|
|
4296
4296
|
const defaultHeaders = {
|
|
4297
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.
|
|
4297
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.3',
|
|
4298
4298
|
};
|
|
4299
4299
|
/**
|
|
4300
4300
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -4733,7 +4733,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
4733
4733
|
chainID,
|
|
4734
4734
|
coreContractAddress,
|
|
4735
4735
|
registrationContractAddress,
|
|
4736
|
-
sdkVersion: 'ts-immutable-sdk-0.39.
|
|
4736
|
+
sdkVersion: 'ts-immutable-sdk-0.39.3',
|
|
4737
4737
|
});
|
|
4738
4738
|
/**
|
|
4739
4739
|
* Sets `sdkVersion` at the time of build
|
|
@@ -30929,7 +30929,7 @@ const SUPPORTED_SANDBOX_BRIDGES = [ETH_SEPOLIA_TO_ZKEVM_DEVNET, ETH_SEPOLIA_TO_Z
|
|
|
30929
30929
|
/**
|
|
30930
30930
|
* @constant {BridgeInstance[]} SUPPORTED_PRODUCTION_BRIDGES - An array of supported bridge instances for the production environment.
|
|
30931
30931
|
*/
|
|
30932
|
-
const SUPPORTED_PRODUCTION_BRIDGES = [];
|
|
30932
|
+
const SUPPORTED_PRODUCTION_BRIDGES = [ETH_MAINNET_TO_ZKEVM_MAINNET];
|
|
30933
30933
|
/**
|
|
30934
30934
|
* @constant {Object} SUPPORTED_BRIDGES_FOR_ENVIRONMENT - An object mapping environment types to their supported bridge instances.
|
|
30935
30935
|
*/
|
|
@@ -35460,7 +35460,7 @@ const GAS_OVERRIDES = {
|
|
|
35460
35460
|
maxPriorityFeePerGas: BigNumber$1.from(101e9),
|
|
35461
35461
|
};
|
|
35462
35462
|
|
|
35463
|
-
const SDK_VERSION_MARKER = '0.39.
|
|
35463
|
+
const SDK_VERSION_MARKER = '0.39.3';
|
|
35464
35464
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
35465
35465
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
35466
35466
|
|
|
@@ -35499,7 +35499,13 @@ class RemoteConfigFetcher {
|
|
|
35499
35499
|
async loadConfig() {
|
|
35500
35500
|
if (this.configCache)
|
|
35501
35501
|
return this.configCache;
|
|
35502
|
-
|
|
35502
|
+
let response;
|
|
35503
|
+
try {
|
|
35504
|
+
response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config`);
|
|
35505
|
+
}
|
|
35506
|
+
catch (err) {
|
|
35507
|
+
throw new CheckoutError(`Error: ${err.message}`, CheckoutErrorType.API_ERROR);
|
|
35508
|
+
}
|
|
35503
35509
|
// Ensure that the configuration is valid
|
|
35504
35510
|
this.configCache = this.parseResponse(response);
|
|
35505
35511
|
return this.configCache;
|
|
@@ -35507,7 +35513,13 @@ class RemoteConfigFetcher {
|
|
|
35507
35513
|
async loadConfigTokens() {
|
|
35508
35514
|
if (this.tokensCache)
|
|
35509
35515
|
return this.tokensCache;
|
|
35510
|
-
|
|
35516
|
+
let response;
|
|
35517
|
+
try {
|
|
35518
|
+
response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config/tokens`);
|
|
35519
|
+
}
|
|
35520
|
+
catch (err) {
|
|
35521
|
+
throw new CheckoutError(`Error: ${err.message}`, CheckoutErrorType.API_ERROR);
|
|
35522
|
+
}
|
|
35511
35523
|
// Ensure that the configuration is valid
|
|
35512
35524
|
this.tokensCache = this.parseResponse(response);
|
|
35513
35525
|
return this.tokensCache;
|
|
@@ -35714,13 +35726,7 @@ class Blockscout {
|
|
|
35714
35726
|
const cached = this.getCache(url);
|
|
35715
35727
|
if (cached)
|
|
35716
35728
|
return Promise.resolve(cached);
|
|
35717
|
-
const response = await this.httpClient.get(url);
|
|
35718
|
-
if (response.status >= 400) {
|
|
35719
|
-
return Promise.reject({
|
|
35720
|
-
code: response.status,
|
|
35721
|
-
message: response.statusText,
|
|
35722
|
-
});
|
|
35723
|
-
}
|
|
35729
|
+
const response = await this.httpClient.get(url); // success if 2XX response otherwise throw error
|
|
35724
35730
|
// To get around an issue with native tokens being an ERC-20, there is the need
|
|
35725
35731
|
// to remove IMX from `resp` and add it back in using getNativeTokenByWalletAddress.
|
|
35726
35732
|
// This has affected some of the early wallets, and it might not be an issue in mainnet
|
|
@@ -35755,13 +35761,7 @@ class Blockscout {
|
|
|
35755
35761
|
const cached = this.getCache(url);
|
|
35756
35762
|
if (cached)
|
|
35757
35763
|
return Promise.resolve(cached);
|
|
35758
|
-
const response = await this.httpClient.get(url);
|
|
35759
|
-
if (response.status >= 400) {
|
|
35760
|
-
return Promise.reject({
|
|
35761
|
-
code: response.status,
|
|
35762
|
-
message: response.statusText,
|
|
35763
|
-
});
|
|
35764
|
-
}
|
|
35764
|
+
const response = await this.httpClient.get(url); // success if 2XX response otherwise throw error
|
|
35765
35765
|
const data = {
|
|
35766
35766
|
token: this.nativeToken,
|
|
35767
35767
|
value: response.data.coin_balance,
|
|
@@ -39006,22 +39006,8 @@ class HttpClient {
|
|
|
39006
39006
|
return config;
|
|
39007
39007
|
}, (error) => Promise.reject(error));
|
|
39008
39008
|
}
|
|
39009
|
-
// eslint-disable-next-line class-methods-use-this
|
|
39010
|
-
processResponse(response) {
|
|
39011
|
-
if (response && response?.status !== 200) {
|
|
39012
|
-
throw new CheckoutError(`Error: ${response.status} ${response.statusText}`, CheckoutErrorType.API_ERROR);
|
|
39013
|
-
}
|
|
39014
|
-
}
|
|
39015
39009
|
async request(config) {
|
|
39016
|
-
|
|
39017
|
-
try {
|
|
39018
|
-
response = await this.axiosInstance.request(config);
|
|
39019
|
-
}
|
|
39020
|
-
catch (error) {
|
|
39021
|
-
throw new CheckoutError(error.message, CheckoutErrorType.API_ERROR);
|
|
39022
|
-
}
|
|
39023
|
-
this.processResponse(response);
|
|
39024
|
-
return response;
|
|
39010
|
+
return await this.axiosInstance.request(config);
|
|
39025
39011
|
}
|
|
39026
39012
|
async get(url, config) {
|
|
39027
39013
|
const requestConfig = {
|
package/dist/passport.js
CHANGED
|
@@ -2349,7 +2349,7 @@ class MultiRollupApiClients {
|
|
|
2349
2349
|
}
|
|
2350
2350
|
|
|
2351
2351
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2352
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.39.
|
|
2352
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.39.3' };
|
|
2353
2353
|
const createConfig = ({ basePath, headers, }) => {
|
|
2354
2354
|
if (!basePath.trim()) {
|
|
2355
2355
|
throw Error('basePath can not be empty');
|
|
@@ -2405,7 +2405,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
2405
2405
|
chainID,
|
|
2406
2406
|
coreContractAddress,
|
|
2407
2407
|
registrationContractAddress,
|
|
2408
|
-
sdkVersion: 'ts-immutable-sdk-0.39.
|
|
2408
|
+
sdkVersion: 'ts-immutable-sdk-0.39.3',
|
|
2409
2409
|
});
|
|
2410
2410
|
/**
|
|
2411
2411
|
* Sets `sdkVersion` at the time of build
|
package/package.json
CHANGED