@imtbl/sdk 0.23.1 → 0.23.2-alpha.2
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.d.ts +467 -0
- package/dist/blockchain_data.js +135 -11
- package/dist/browser/153.afe08b0c.chunk.js +1 -0
- package/dist/browser/175.cdce927d.chunk.js +1 -0
- package/dist/browser/362.7e7bfa44.chunk.js +1 -0
- package/dist/browser/383.de862369.chunk.js +1 -0
- package/dist/browser/472.923d4bd5.chunk.js +1 -0
- package/dist/browser/603.3e2914e2.chunk.js +2 -0
- package/dist/browser/692.306a7f2a.chunk.js +1 -0
- package/dist/browser/703.5c480d28.chunk.js +1 -0
- package/dist/browser/82.bed3464b.chunk.js +2 -0
- package/dist/browser/ajs-destination.52125420.chunk.js +1 -0
- package/dist/browser/auto-track.a6dd767a.chunk.js +1 -0
- package/dist/browser/checkout.js +1 -2
- package/dist/browser/legacyVideos.55664053.chunk.js +1 -0
- package/dist/browser/queryString.307c6759.chunk.js +1 -0
- package/dist/browser/remoteMiddleware.c0e773ab.chunk.js +1 -0
- package/dist/browser/schemaFilter.0ba00503.chunk.js +1 -0
- package/dist/browser/tsub-middleware.bb1047fe.chunk.js +2 -0
- package/dist/checkout_sdk.d.ts +2 -13
- package/dist/checkout_sdk.js +291 -126
- package/dist/checkout_widgets.js +1 -1
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +13 -13
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +314 -138
- package/dist/index.d.ts +469 -13
- package/dist/index.js +314 -138
- package/dist/passport.js +22 -11
- package/package.json +1 -1
package/dist/passport.js
CHANGED
|
@@ -1785,7 +1785,7 @@ class MultiRollupApiClients {
|
|
|
1785
1785
|
}
|
|
1786
1786
|
|
|
1787
1787
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1788
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.23.
|
|
1788
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.23.2-alpha.2' };
|
|
1789
1789
|
const createConfig = ({ basePath, headers, }) => {
|
|
1790
1790
|
if (!basePath.trim()) {
|
|
1791
1791
|
throw Error('basePath can not be empty');
|
|
@@ -1841,7 +1841,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
1841
1841
|
chainID,
|
|
1842
1842
|
coreContractAddress,
|
|
1843
1843
|
registrationContractAddress,
|
|
1844
|
-
sdkVersion: 'ts-immutable-sdk-0.23.
|
|
1844
|
+
sdkVersion: 'ts-immutable-sdk-0.23.2-alpha.2',
|
|
1845
1845
|
});
|
|
1846
1846
|
/**
|
|
1847
1847
|
* Sets `sdkVersion` at the time of build
|
|
@@ -6686,14 +6686,25 @@ class AuthManager {
|
|
|
6686
6686
|
this.deviceCredentialsManager.clearCredentials();
|
|
6687
6687
|
}, PassportErrorType.LOGOUT_ERROR);
|
|
6688
6688
|
}
|
|
6689
|
-
async loginSilent() {
|
|
6690
|
-
|
|
6689
|
+
async loginSilent({ forceRefresh } = { forceRefresh: false }) {
|
|
6690
|
+
// eslint-disable-next-line arrow-body-style
|
|
6691
|
+
return withPassportError(async () => {
|
|
6692
|
+
return this.getUser({ forceRefresh });
|
|
6693
|
+
}, PassportErrorType.SILENT_LOGIN_ERROR);
|
|
6691
6694
|
}
|
|
6692
|
-
|
|
6695
|
+
/**
|
|
6696
|
+
* Get the user from the cache or refresh the token if it's expired.
|
|
6697
|
+
* @param forceRefresh If set to true, force an HTTP call to the OIDC server's authorization endpoint. This call will
|
|
6698
|
+
* throw an error if there's no refresh token.
|
|
6699
|
+
*/
|
|
6700
|
+
async getWebUser({ forceRefresh = false }) {
|
|
6701
|
+
if (forceRefresh) {
|
|
6702
|
+
const newOidcUser = await this.userManager.signinSilent();
|
|
6703
|
+
return newOidcUser ? AuthManager.mapOidcUserToDomainModel(newOidcUser) : null;
|
|
6704
|
+
}
|
|
6693
6705
|
const oidcUser = await this.userManager.getUser();
|
|
6694
|
-
if (!oidcUser)
|
|
6706
|
+
if (!oidcUser)
|
|
6695
6707
|
return null;
|
|
6696
|
-
}
|
|
6697
6708
|
const tokenExpired = isTokenExpired(oidcUser);
|
|
6698
6709
|
if (!tokenExpired) {
|
|
6699
6710
|
return AuthManager.mapOidcUserToDomainModel(oidcUser);
|
|
@@ -6706,9 +6717,9 @@ class AuthManager {
|
|
|
6706
6717
|
}
|
|
6707
6718
|
return null;
|
|
6708
6719
|
}
|
|
6709
|
-
async getUser() {
|
|
6720
|
+
async getUser({ forceRefresh } = { forceRefresh: false }) {
|
|
6710
6721
|
return withPassportError(async () => {
|
|
6711
|
-
const user = await this.getWebUser();
|
|
6722
|
+
const user = await this.getWebUser({ forceRefresh });
|
|
6712
6723
|
if (user) {
|
|
6713
6724
|
return user;
|
|
6714
6725
|
}
|
|
@@ -7486,7 +7497,7 @@ class PassportImxProviderFactory {
|
|
|
7486
7497
|
}, jwt);
|
|
7487
7498
|
// User metadata is updated asynchronously. Poll userinfo endpoint until it is updated.
|
|
7488
7499
|
const updatedUser = await retryWithDelay(async () => {
|
|
7489
|
-
const user = await this.authManager.loginSilent();
|
|
7500
|
+
const user = await this.authManager.loginSilent({ forceRefresh: true }); // force refresh to get updated user info
|
|
7490
7501
|
const metadataExists = !!user?.imx;
|
|
7491
7502
|
if (metadataExists) {
|
|
7492
7503
|
return user;
|
|
@@ -7986,7 +7997,7 @@ async function registerZkEvmUser({ authManager, config, magicProvider, multiRoll
|
|
|
7986
7997
|
user = await authManager.refreshToken(credentials.refresh_token);
|
|
7987
7998
|
}
|
|
7988
7999
|
else {
|
|
7989
|
-
user = await authManager.loginSilent();
|
|
8000
|
+
user = await authManager.loginSilent({ forceRefresh: true });
|
|
7990
8001
|
}
|
|
7991
8002
|
if (!user?.zkEvm) {
|
|
7992
8003
|
throw new JsonRpcError(RpcErrorCode.INTERNAL_ERROR, 'Failed to refresh user details');
|
package/package.json
CHANGED