@imtbl/sdk 0.35.1 → 0.35.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/README.md +8 -10
- package/dist/blockchain_data.js +1 -1
- package/dist/browser/checkout/sdk.js +3 -3
- package/dist/browser/checkout/widgets.js +67 -102
- package/dist/checkout.d.ts +2 -2
- package/dist/checkout.js +21 -19
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +11 -11
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +32 -33
- package/dist/index.d.ts +2 -2
- package/dist/index.js +32 -33
- package/dist/passport.d.ts +2 -2
- package/dist/passport.js +11 -14
- package/package.json +10 -3
package/dist/index.cjs
CHANGED
|
@@ -3791,7 +3791,7 @@ class MultiRollupApiClients {
|
|
|
3791
3791
|
}
|
|
3792
3792
|
|
|
3793
3793
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3794
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.35.
|
|
3794
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.35.3' };
|
|
3795
3795
|
const createConfig = ({ basePath, headers, }) => {
|
|
3796
3796
|
if (!basePath.trim()) {
|
|
3797
3797
|
throw Error('basePath can not be empty');
|
|
@@ -3851,7 +3851,7 @@ class APIError extends Error {
|
|
|
3851
3851
|
|
|
3852
3852
|
/* eslint-disable implicit-arrow-linebreak */
|
|
3853
3853
|
const defaultHeaders = {
|
|
3854
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.35.
|
|
3854
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.35.3',
|
|
3855
3855
|
};
|
|
3856
3856
|
/**
|
|
3857
3857
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -4262,7 +4262,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
4262
4262
|
chainID,
|
|
4263
4263
|
coreContractAddress,
|
|
4264
4264
|
registrationContractAddress,
|
|
4265
|
-
sdkVersion: 'ts-immutable-sdk-0.35.
|
|
4265
|
+
sdkVersion: 'ts-immutable-sdk-0.35.3',
|
|
4266
4266
|
});
|
|
4267
4267
|
/**
|
|
4268
4268
|
* Sets `sdkVersion` at the time of build
|
|
@@ -8790,7 +8790,7 @@ var ChainId$1;
|
|
|
8790
8790
|
(function (ChainId) {
|
|
8791
8791
|
ChainId[ChainId["IMTBL_ZKEVM_MAINNET"] = 13371] = "IMTBL_ZKEVM_MAINNET";
|
|
8792
8792
|
ChainId[ChainId["IMTBL_ZKEVM_TESTNET"] = 13473] = "IMTBL_ZKEVM_TESTNET";
|
|
8793
|
-
ChainId[ChainId["IMTBL_ZKEVM_DEVNET"] =
|
|
8793
|
+
ChainId[ChainId["IMTBL_ZKEVM_DEVNET"] = 15003] = "IMTBL_ZKEVM_DEVNET";
|
|
8794
8794
|
ChainId[ChainId["ETHEREUM"] = 1] = "ETHEREUM";
|
|
8795
8795
|
ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
|
|
8796
8796
|
})(ChainId$1 || (ChainId$1 = {}));
|
|
@@ -9070,7 +9070,7 @@ class AuthManager {
|
|
|
9070
9070
|
+ `&state=${state}`
|
|
9071
9071
|
+ `&audience=${this.config.oidcConfiguration.audience}`;
|
|
9072
9072
|
}
|
|
9073
|
-
async
|
|
9073
|
+
async loginWithPKCEFlowCallback(authorizationCode, state) {
|
|
9074
9074
|
return withPassportError(async () => {
|
|
9075
9075
|
const pkceData = this.deviceCredentialsManager.getPKCEData();
|
|
9076
9076
|
if (!pkceData) {
|
|
@@ -10000,10 +10000,6 @@ class PassportImxProviderFactory {
|
|
|
10000
10000
|
}
|
|
10001
10001
|
return this.createProviderInstance(user);
|
|
10002
10002
|
}
|
|
10003
|
-
async getProviderWithPKCEFlow(authorizationCode, state) {
|
|
10004
|
-
const user = await this.authManager.connectImxPKCEFlow(authorizationCode, state);
|
|
10005
|
-
return this.createProviderInstance(user);
|
|
10006
|
-
}
|
|
10007
10003
|
async createProviderInstance(user) {
|
|
10008
10004
|
if (!user.idToken) {
|
|
10009
10005
|
throw new PassportError('Failed to initialise', PassportErrorType.WALLET_CONNECTION_ERROR);
|
|
@@ -10994,12 +10990,6 @@ class Passport {
|
|
|
10994
10990
|
async connectImx() {
|
|
10995
10991
|
return this.passportImxProviderFactory.getProvider();
|
|
10996
10992
|
}
|
|
10997
|
-
getPKCEAuthorizationUrl() {
|
|
10998
|
-
return this.authManager.getPKCEAuthorizationUrl();
|
|
10999
|
-
}
|
|
11000
|
-
async connectImxPKCEFlow(authorizationCode, state) {
|
|
11001
|
-
return this.passportImxProviderFactory.getProviderWithPKCEFlow(authorizationCode, state);
|
|
11002
|
-
}
|
|
11003
10993
|
connectEvm() {
|
|
11004
10994
|
if (this.config.network === Networks.PRODUCTION) {
|
|
11005
10995
|
throw new Error('EVM is not supported on production network');
|
|
@@ -11049,6 +11039,13 @@ class Passport {
|
|
|
11049
11039
|
const user = await this.authManager.loginWithDeviceFlowCallback(deviceCode, interval, timeoutMs);
|
|
11050
11040
|
return user.profile;
|
|
11051
11041
|
}
|
|
11042
|
+
loginWithPKCEFlow() {
|
|
11043
|
+
return this.authManager.getPKCEAuthorizationUrl();
|
|
11044
|
+
}
|
|
11045
|
+
async loginWithPKCEFlowCallback(authorizationCode, state) {
|
|
11046
|
+
const user = await this.authManager.loginWithPKCEFlowCallback(authorizationCode, state);
|
|
11047
|
+
return user.profile;
|
|
11048
|
+
}
|
|
11052
11049
|
async logout() {
|
|
11053
11050
|
await this.confirmationScreen.logout();
|
|
11054
11051
|
await this.authManager.logout();
|
|
@@ -28900,36 +28897,38 @@ startTokenIn = tokenIn) => {
|
|
|
28900
28897
|
return routes;
|
|
28901
28898
|
};
|
|
28902
28899
|
|
|
28903
|
-
|
|
28904
|
-
|
|
28905
|
-
|
|
28906
|
-
|
|
28907
|
-
|
|
28908
|
-
|
|
28909
|
-
|
|
28910
|
-
|
|
28911
|
-
|
|
28900
|
+
const getFeeData = async (provider) => {
|
|
28901
|
+
const [block, maxPriorityFeePerGas] = await Promise.all([
|
|
28902
|
+
provider.getBlock('latest'),
|
|
28903
|
+
provider.send('eth_maxPriorityFeePerGas', []),
|
|
28904
|
+
]);
|
|
28905
|
+
if (!block.baseFeePerGas)
|
|
28906
|
+
throw new Error('Base fee per gas not found in block');
|
|
28907
|
+
return {
|
|
28908
|
+
// https://www.blocknative.com/blog/eip-1559-fees
|
|
28909
|
+
maxFeePerGas: block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas),
|
|
28910
|
+
maxPriorityFeePerGas,
|
|
28911
|
+
lastBaseFeePerGas: block.baseFeePerGas,
|
|
28912
|
+
};
|
|
28912
28913
|
};
|
|
28913
28914
|
/**
|
|
28914
28915
|
* Fetch the current gas price estimate. Supports both EIP-1559 and non-EIP1559 chains
|
|
28915
|
-
* @param {
|
|
28916
|
+
* @param {Provider} provider - The JSON RPC provider used to fetch fee data
|
|
28916
28917
|
* @param {Native} nativeToken - The native token of the chain. Gas prices will be denominated in this token
|
|
28917
|
-
* @returns {
|
|
28918
|
+
* @returns {CoinAmount<Native> | null} - The gas price in the smallest denomination of the chain's currency,
|
|
28918
28919
|
* or null if no gas price is available
|
|
28919
28920
|
*/
|
|
28921
|
+
// eslint-disable-next-line max-len
|
|
28920
28922
|
const fetchGasPrice = async (provider, nativeToken) => {
|
|
28921
|
-
const feeData = await
|
|
28923
|
+
const feeData = await getFeeData(provider).catch(() => null);
|
|
28922
28924
|
if (!feeData)
|
|
28923
28925
|
return null;
|
|
28924
|
-
|
|
28925
|
-
return newAmount(feeData.maxFeePerGas.add(feeData.maxPriorityFeePerGas), nativeToken);
|
|
28926
|
-
}
|
|
28927
|
-
return feeData.gasPrice ? newAmount(feeData.gasPrice, nativeToken) : null;
|
|
28926
|
+
return newAmount(feeData.maxFeePerGas, nativeToken);
|
|
28928
28927
|
};
|
|
28929
28928
|
/**
|
|
28930
28929
|
* Calculate the gas fee from the gas price and gas units used for the transaction
|
|
28931
28930
|
*
|
|
28932
|
-
* @param {
|
|
28931
|
+
* @param {CoinAmount<Native>} gasPrice - The price of gas
|
|
28933
28932
|
* @param {BigNumber} gasEstimate - The total gas units that will be used for the transaction
|
|
28934
28933
|
* @returns - The cost of the transaction in the gas token's smallest denomination (e.g. WEI)
|
|
28935
28934
|
*/
|
|
@@ -30569,7 +30568,7 @@ const GAS_OVERRIDES = {
|
|
|
30569
30568
|
maxPriorityFeePerGas: ethers.BigNumber.from(101e9),
|
|
30570
30569
|
};
|
|
30571
30570
|
|
|
30572
|
-
const SDK_VERSION_MARKER = '0.35.
|
|
30571
|
+
const SDK_VERSION_MARKER = '0.35.3';
|
|
30573
30572
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
30574
30573
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
30575
30574
|
|
package/dist/index.d.ts
CHANGED
|
@@ -14697,8 +14697,6 @@ declare class Passport {
|
|
|
14697
14697
|
*/
|
|
14698
14698
|
connectImxSilent(): Promise<IMXProvider | null>;
|
|
14699
14699
|
connectImx(): Promise<IMXProvider>;
|
|
14700
|
-
getPKCEAuthorizationUrl(): string;
|
|
14701
|
-
connectImxPKCEFlow(authorizationCode: string, state: string): Promise<IMXProvider | null>;
|
|
14702
14700
|
connectEvm(): Provider;
|
|
14703
14701
|
/**
|
|
14704
14702
|
*
|
|
@@ -14714,6 +14712,8 @@ declare class Passport {
|
|
|
14714
14712
|
loginCallback(): Promise<void>;
|
|
14715
14713
|
loginWithDeviceFlow(): Promise<DeviceConnectResponse>;
|
|
14716
14714
|
loginWithDeviceFlowCallback(deviceCode: string, interval: number, timeoutMs?: number): Promise<UserProfile>;
|
|
14715
|
+
loginWithPKCEFlow(): string;
|
|
14716
|
+
loginWithPKCEFlowCallback(authorizationCode: string, state: string): Promise<UserProfile>;
|
|
14717
14717
|
logout(): Promise<void>;
|
|
14718
14718
|
/**
|
|
14719
14719
|
* Logs the user out of Passport when using device flow authentication.
|
package/dist/index.js
CHANGED
|
@@ -3769,7 +3769,7 @@ class MultiRollupApiClients {
|
|
|
3769
3769
|
}
|
|
3770
3770
|
|
|
3771
3771
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3772
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.35.
|
|
3772
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.35.3' };
|
|
3773
3773
|
const createConfig = ({ basePath, headers, }) => {
|
|
3774
3774
|
if (!basePath.trim()) {
|
|
3775
3775
|
throw Error('basePath can not be empty');
|
|
@@ -3829,7 +3829,7 @@ class APIError extends Error {
|
|
|
3829
3829
|
|
|
3830
3830
|
/* eslint-disable implicit-arrow-linebreak */
|
|
3831
3831
|
const defaultHeaders = {
|
|
3832
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.35.
|
|
3832
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.35.3',
|
|
3833
3833
|
};
|
|
3834
3834
|
/**
|
|
3835
3835
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -4240,7 +4240,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
4240
4240
|
chainID,
|
|
4241
4241
|
coreContractAddress,
|
|
4242
4242
|
registrationContractAddress,
|
|
4243
|
-
sdkVersion: 'ts-immutable-sdk-0.35.
|
|
4243
|
+
sdkVersion: 'ts-immutable-sdk-0.35.3',
|
|
4244
4244
|
});
|
|
4245
4245
|
/**
|
|
4246
4246
|
* Sets `sdkVersion` at the time of build
|
|
@@ -8768,7 +8768,7 @@ var ChainId$1;
|
|
|
8768
8768
|
(function (ChainId) {
|
|
8769
8769
|
ChainId[ChainId["IMTBL_ZKEVM_MAINNET"] = 13371] = "IMTBL_ZKEVM_MAINNET";
|
|
8770
8770
|
ChainId[ChainId["IMTBL_ZKEVM_TESTNET"] = 13473] = "IMTBL_ZKEVM_TESTNET";
|
|
8771
|
-
ChainId[ChainId["IMTBL_ZKEVM_DEVNET"] =
|
|
8771
|
+
ChainId[ChainId["IMTBL_ZKEVM_DEVNET"] = 15003] = "IMTBL_ZKEVM_DEVNET";
|
|
8772
8772
|
ChainId[ChainId["ETHEREUM"] = 1] = "ETHEREUM";
|
|
8773
8773
|
ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
|
|
8774
8774
|
})(ChainId$1 || (ChainId$1 = {}));
|
|
@@ -9048,7 +9048,7 @@ class AuthManager {
|
|
|
9048
9048
|
+ `&state=${state}`
|
|
9049
9049
|
+ `&audience=${this.config.oidcConfiguration.audience}`;
|
|
9050
9050
|
}
|
|
9051
|
-
async
|
|
9051
|
+
async loginWithPKCEFlowCallback(authorizationCode, state) {
|
|
9052
9052
|
return withPassportError(async () => {
|
|
9053
9053
|
const pkceData = this.deviceCredentialsManager.getPKCEData();
|
|
9054
9054
|
if (!pkceData) {
|
|
@@ -9978,10 +9978,6 @@ class PassportImxProviderFactory {
|
|
|
9978
9978
|
}
|
|
9979
9979
|
return this.createProviderInstance(user);
|
|
9980
9980
|
}
|
|
9981
|
-
async getProviderWithPKCEFlow(authorizationCode, state) {
|
|
9982
|
-
const user = await this.authManager.connectImxPKCEFlow(authorizationCode, state);
|
|
9983
|
-
return this.createProviderInstance(user);
|
|
9984
|
-
}
|
|
9985
9981
|
async createProviderInstance(user) {
|
|
9986
9982
|
if (!user.idToken) {
|
|
9987
9983
|
throw new PassportError('Failed to initialise', PassportErrorType.WALLET_CONNECTION_ERROR);
|
|
@@ -10972,12 +10968,6 @@ class Passport {
|
|
|
10972
10968
|
async connectImx() {
|
|
10973
10969
|
return this.passportImxProviderFactory.getProvider();
|
|
10974
10970
|
}
|
|
10975
|
-
getPKCEAuthorizationUrl() {
|
|
10976
|
-
return this.authManager.getPKCEAuthorizationUrl();
|
|
10977
|
-
}
|
|
10978
|
-
async connectImxPKCEFlow(authorizationCode, state) {
|
|
10979
|
-
return this.passportImxProviderFactory.getProviderWithPKCEFlow(authorizationCode, state);
|
|
10980
|
-
}
|
|
10981
10971
|
connectEvm() {
|
|
10982
10972
|
if (this.config.network === Networks.PRODUCTION) {
|
|
10983
10973
|
throw new Error('EVM is not supported on production network');
|
|
@@ -11027,6 +11017,13 @@ class Passport {
|
|
|
11027
11017
|
const user = await this.authManager.loginWithDeviceFlowCallback(deviceCode, interval, timeoutMs);
|
|
11028
11018
|
return user.profile;
|
|
11029
11019
|
}
|
|
11020
|
+
loginWithPKCEFlow() {
|
|
11021
|
+
return this.authManager.getPKCEAuthorizationUrl();
|
|
11022
|
+
}
|
|
11023
|
+
async loginWithPKCEFlowCallback(authorizationCode, state) {
|
|
11024
|
+
const user = await this.authManager.loginWithPKCEFlowCallback(authorizationCode, state);
|
|
11025
|
+
return user.profile;
|
|
11026
|
+
}
|
|
11030
11027
|
async logout() {
|
|
11031
11028
|
await this.confirmationScreen.logout();
|
|
11032
11029
|
await this.authManager.logout();
|
|
@@ -28878,36 +28875,38 @@ startTokenIn = tokenIn) => {
|
|
|
28878
28875
|
return routes;
|
|
28879
28876
|
};
|
|
28880
28877
|
|
|
28881
|
-
|
|
28882
|
-
|
|
28883
|
-
|
|
28884
|
-
|
|
28885
|
-
|
|
28886
|
-
|
|
28887
|
-
|
|
28888
|
-
|
|
28889
|
-
|
|
28878
|
+
const getFeeData = async (provider) => {
|
|
28879
|
+
const [block, maxPriorityFeePerGas] = await Promise.all([
|
|
28880
|
+
provider.getBlock('latest'),
|
|
28881
|
+
provider.send('eth_maxPriorityFeePerGas', []),
|
|
28882
|
+
]);
|
|
28883
|
+
if (!block.baseFeePerGas)
|
|
28884
|
+
throw new Error('Base fee per gas not found in block');
|
|
28885
|
+
return {
|
|
28886
|
+
// https://www.blocknative.com/blog/eip-1559-fees
|
|
28887
|
+
maxFeePerGas: block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas),
|
|
28888
|
+
maxPriorityFeePerGas,
|
|
28889
|
+
lastBaseFeePerGas: block.baseFeePerGas,
|
|
28890
|
+
};
|
|
28890
28891
|
};
|
|
28891
28892
|
/**
|
|
28892
28893
|
* Fetch the current gas price estimate. Supports both EIP-1559 and non-EIP1559 chains
|
|
28893
|
-
* @param {
|
|
28894
|
+
* @param {Provider} provider - The JSON RPC provider used to fetch fee data
|
|
28894
28895
|
* @param {Native} nativeToken - The native token of the chain. Gas prices will be denominated in this token
|
|
28895
|
-
* @returns {
|
|
28896
|
+
* @returns {CoinAmount<Native> | null} - The gas price in the smallest denomination of the chain's currency,
|
|
28896
28897
|
* or null if no gas price is available
|
|
28897
28898
|
*/
|
|
28899
|
+
// eslint-disable-next-line max-len
|
|
28898
28900
|
const fetchGasPrice = async (provider, nativeToken) => {
|
|
28899
|
-
const feeData = await
|
|
28901
|
+
const feeData = await getFeeData(provider).catch(() => null);
|
|
28900
28902
|
if (!feeData)
|
|
28901
28903
|
return null;
|
|
28902
|
-
|
|
28903
|
-
return newAmount(feeData.maxFeePerGas.add(feeData.maxPriorityFeePerGas), nativeToken);
|
|
28904
|
-
}
|
|
28905
|
-
return feeData.gasPrice ? newAmount(feeData.gasPrice, nativeToken) : null;
|
|
28904
|
+
return newAmount(feeData.maxFeePerGas, nativeToken);
|
|
28906
28905
|
};
|
|
28907
28906
|
/**
|
|
28908
28907
|
* Calculate the gas fee from the gas price and gas units used for the transaction
|
|
28909
28908
|
*
|
|
28910
|
-
* @param {
|
|
28909
|
+
* @param {CoinAmount<Native>} gasPrice - The price of gas
|
|
28911
28910
|
* @param {BigNumber} gasEstimate - The total gas units that will be used for the transaction
|
|
28912
28911
|
* @returns - The cost of the transaction in the gas token's smallest denomination (e.g. WEI)
|
|
28913
28912
|
*/
|
|
@@ -30547,7 +30546,7 @@ const GAS_OVERRIDES = {
|
|
|
30547
30546
|
maxPriorityFeePerGas: BigNumber$1.from(101e9),
|
|
30548
30547
|
};
|
|
30549
30548
|
|
|
30550
|
-
const SDK_VERSION_MARKER = '0.35.
|
|
30549
|
+
const SDK_VERSION_MARKER = '0.35.3';
|
|
30551
30550
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
30552
30551
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
30553
30552
|
|
package/dist/passport.d.ts
CHANGED
|
@@ -10337,8 +10337,6 @@ declare class Passport {
|
|
|
10337
10337
|
*/
|
|
10338
10338
|
connectImxSilent(): Promise<IMXProvider | null>;
|
|
10339
10339
|
connectImx(): Promise<IMXProvider>;
|
|
10340
|
-
getPKCEAuthorizationUrl(): string;
|
|
10341
|
-
connectImxPKCEFlow(authorizationCode: string, state: string): Promise<IMXProvider | null>;
|
|
10342
10340
|
connectEvm(): Provider;
|
|
10343
10341
|
/**
|
|
10344
10342
|
*
|
|
@@ -10354,6 +10352,8 @@ declare class Passport {
|
|
|
10354
10352
|
loginCallback(): Promise<void>;
|
|
10355
10353
|
loginWithDeviceFlow(): Promise<DeviceConnectResponse>;
|
|
10356
10354
|
loginWithDeviceFlowCallback(deviceCode: string, interval: number, timeoutMs?: number): Promise<UserProfile>;
|
|
10355
|
+
loginWithPKCEFlow(): string;
|
|
10356
|
+
loginWithPKCEFlowCallback(authorizationCode: string, state: string): Promise<UserProfile>;
|
|
10357
10357
|
logout(): Promise<void>;
|
|
10358
10358
|
/**
|
|
10359
10359
|
* Logs the user out of Passport when using device flow authentication.
|
package/dist/passport.js
CHANGED
|
@@ -2191,7 +2191,7 @@ class MultiRollupApiClients {
|
|
|
2191
2191
|
}
|
|
2192
2192
|
|
|
2193
2193
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2194
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.35.
|
|
2194
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.35.3' };
|
|
2195
2195
|
const createConfig = ({ basePath, headers, }) => {
|
|
2196
2196
|
if (!basePath.trim()) {
|
|
2197
2197
|
throw Error('basePath can not be empty');
|
|
@@ -2247,7 +2247,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
2247
2247
|
chainID,
|
|
2248
2248
|
coreContractAddress,
|
|
2249
2249
|
registrationContractAddress,
|
|
2250
|
-
sdkVersion: 'ts-immutable-sdk-0.35.
|
|
2250
|
+
sdkVersion: 'ts-immutable-sdk-0.35.3',
|
|
2251
2251
|
});
|
|
2252
2252
|
/**
|
|
2253
2253
|
* Sets `sdkVersion` at the time of build
|
|
@@ -6758,7 +6758,7 @@ var ChainId;
|
|
|
6758
6758
|
(function (ChainId) {
|
|
6759
6759
|
ChainId[ChainId["IMTBL_ZKEVM_MAINNET"] = 13371] = "IMTBL_ZKEVM_MAINNET";
|
|
6760
6760
|
ChainId[ChainId["IMTBL_ZKEVM_TESTNET"] = 13473] = "IMTBL_ZKEVM_TESTNET";
|
|
6761
|
-
ChainId[ChainId["IMTBL_ZKEVM_DEVNET"] =
|
|
6761
|
+
ChainId[ChainId["IMTBL_ZKEVM_DEVNET"] = 15003] = "IMTBL_ZKEVM_DEVNET";
|
|
6762
6762
|
ChainId[ChainId["ETHEREUM"] = 1] = "ETHEREUM";
|
|
6763
6763
|
ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
|
|
6764
6764
|
})(ChainId || (ChainId = {}));
|
|
@@ -7038,7 +7038,7 @@ class AuthManager {
|
|
|
7038
7038
|
+ `&state=${state}`
|
|
7039
7039
|
+ `&audience=${this.config.oidcConfiguration.audience}`;
|
|
7040
7040
|
}
|
|
7041
|
-
async
|
|
7041
|
+
async loginWithPKCEFlowCallback(authorizationCode, state) {
|
|
7042
7042
|
return withPassportError(async () => {
|
|
7043
7043
|
const pkceData = this.deviceCredentialsManager.getPKCEData();
|
|
7044
7044
|
if (!pkceData) {
|
|
@@ -7968,10 +7968,6 @@ class PassportImxProviderFactory {
|
|
|
7968
7968
|
}
|
|
7969
7969
|
return this.createProviderInstance(user);
|
|
7970
7970
|
}
|
|
7971
|
-
async getProviderWithPKCEFlow(authorizationCode, state) {
|
|
7972
|
-
const user = await this.authManager.connectImxPKCEFlow(authorizationCode, state);
|
|
7973
|
-
return this.createProviderInstance(user);
|
|
7974
|
-
}
|
|
7975
7971
|
async createProviderInstance(user) {
|
|
7976
7972
|
if (!user.idToken) {
|
|
7977
7973
|
throw new PassportError('Failed to initialise', PassportErrorType.WALLET_CONNECTION_ERROR);
|
|
@@ -8962,12 +8958,6 @@ class Passport {
|
|
|
8962
8958
|
async connectImx() {
|
|
8963
8959
|
return this.passportImxProviderFactory.getProvider();
|
|
8964
8960
|
}
|
|
8965
|
-
getPKCEAuthorizationUrl() {
|
|
8966
|
-
return this.authManager.getPKCEAuthorizationUrl();
|
|
8967
|
-
}
|
|
8968
|
-
async connectImxPKCEFlow(authorizationCode, state) {
|
|
8969
|
-
return this.passportImxProviderFactory.getProviderWithPKCEFlow(authorizationCode, state);
|
|
8970
|
-
}
|
|
8971
8961
|
connectEvm() {
|
|
8972
8962
|
if (this.config.network === Networks.PRODUCTION) {
|
|
8973
8963
|
throw new Error('EVM is not supported on production network');
|
|
@@ -9017,6 +9007,13 @@ class Passport {
|
|
|
9017
9007
|
const user = await this.authManager.loginWithDeviceFlowCallback(deviceCode, interval, timeoutMs);
|
|
9018
9008
|
return user.profile;
|
|
9019
9009
|
}
|
|
9010
|
+
loginWithPKCEFlow() {
|
|
9011
|
+
return this.authManager.getPKCEAuthorizationUrl();
|
|
9012
|
+
}
|
|
9013
|
+
async loginWithPKCEFlowCallback(authorizationCode, state) {
|
|
9014
|
+
const user = await this.authManager.loginWithPKCEFlowCallback(authorizationCode, state);
|
|
9015
|
+
return user.profile;
|
|
9016
|
+
}
|
|
9020
9017
|
async logout() {
|
|
9021
9018
|
await this.confirmationScreen.logout();
|
|
9022
9019
|
await this.authManager.logout();
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imtbl/sdk",
|
|
3
3
|
"description": "Immutable Unified SDK",
|
|
4
|
-
"version": "0.35.
|
|
4
|
+
"version": "0.35.3",
|
|
5
5
|
"author": "Immutable",
|
|
6
6
|
"browser": "./dist/index.browser.js",
|
|
7
7
|
"bugs": "https://github.com/immutable/ts-immutable-sdk/issues",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@0xsequence/abi": "^1.4.3",
|
|
10
10
|
"@0xsequence/core": "^1.4.3",
|
|
11
|
-
"@biom3/design-tokens": "0.2.
|
|
12
|
-
"@biom3/react": "^0.
|
|
11
|
+
"@biom3/design-tokens": "0.2.9",
|
|
12
|
+
"@biom3/react": "^0.19.13",
|
|
13
13
|
"@ethersproject/abi": "^5.7.0",
|
|
14
14
|
"@ethersproject/abstract-signer": "^5.7.0",
|
|
15
15
|
"@ethersproject/providers": "^5.7.2",
|
|
@@ -115,11 +115,18 @@
|
|
|
115
115
|
"license": "Apache-2.0",
|
|
116
116
|
"main": "./dist/index.cjs",
|
|
117
117
|
"module": "./dist/index.js",
|
|
118
|
+
"overrides": {
|
|
119
|
+
"@openzeppelin/contracts": "3.4.2-solc-0.7"
|
|
120
|
+
},
|
|
118
121
|
"peerDependencies": {
|
|
119
122
|
"react": "^18.2.0",
|
|
120
123
|
"react-dom": "^18.2.0"
|
|
121
124
|
},
|
|
122
125
|
"repository": "immutable/ts-immutable-sdk.git",
|
|
126
|
+
"resolutions": {
|
|
127
|
+
"@biom3/design-tokens": "0.2.9",
|
|
128
|
+
"@openzeppelin/contracts": "3.4.2-solc-0.7"
|
|
129
|
+
},
|
|
123
130
|
"scripts": {
|
|
124
131
|
"build": "yarn packageList && yarn updateDependencies && yarn regenModules && rm -rf dist && NODE_ENV=production rollup --config rollup.config.js && rm -rf dist/types",
|
|
125
132
|
"build:only": "rm -rf dist && NODE_ENV=production rollup --config rollup.config.js && rm -rf dist/types",
|