@imtbl/sdk 1.4.1-alpha.1 → 1.4.1-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.
Files changed (36) hide show
  1. package/dist/blockchain_data.js +2 -2
  2. package/dist/browser/checkout/sdk.js +4 -4
  3. package/dist/browser/checkout/widgets.js +872 -1
  4. package/dist/checkout.d.ts +1417 -1417
  5. package/dist/checkout.js +4 -4
  6. package/dist/config.js +1 -1
  7. package/dist/index.browser.js +6 -6
  8. package/dist/index.browser.js.map +1 -1
  9. package/dist/index.cjs +61 -30
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js +61 -30
  12. package/dist/orderbook.js +1 -1
  13. package/dist/passport.d.ts +1417 -1417
  14. package/dist/passport.js +58 -27
  15. package/dist/x.js +2 -2
  16. package/package.json +1 -1
  17. package/dist/browser/checkout/BridgeWidget-cf957c15.js +0 -1
  18. package/dist/browser/checkout/OnRampWidget-83d73134.js +0 -1
  19. package/dist/browser/checkout/SaleWidget-ad8b7642.js +0 -2
  20. package/dist/browser/checkout/SpendingCapHero-0a0f9fd0.js +0 -1
  21. package/dist/browser/checkout/SwapWidget-7c0a1017.js +0 -1
  22. package/dist/browser/checkout/TopUpView-3b2e045d.js +0 -1
  23. package/dist/browser/checkout/WalletWidget-381ddb8f.js +0 -1
  24. package/dist/browser/checkout/auto-track-8b6baf69.js +0 -1
  25. package/dist/browser/checkout/balance-1493691b.js +0 -1
  26. package/dist/browser/checkout/index-1c33f972.js +0 -1
  27. package/dist/browser/checkout/index-287f0ec7.js +0 -1
  28. package/dist/browser/checkout/index-531bae54.js +0 -1
  29. package/dist/browser/checkout/index-696631eb.js +0 -773
  30. package/dist/browser/checkout/index-b7b99467.js +0 -1
  31. package/dist/browser/checkout/index-e7272f1c.js +0 -90
  32. package/dist/browser/checkout/index-feece362.js +0 -1
  33. package/dist/browser/checkout/index.umd-bcb0582f.js +0 -1
  34. package/dist/browser/checkout/is-plan-event-enabled-80f76ce6.js +0 -1
  35. package/dist/browser/checkout/retry-86e4cf9a.js +0 -1
  36. package/dist/browser/checkout/useTransakEvents-a01463cc.js +0 -2
package/dist/index.cjs CHANGED
@@ -173,7 +173,7 @@ const flattenProperties$1 = (properties) => {
173
173
  };
174
174
 
175
175
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
176
- const SDK_VERSION$1 = '1.4.1-alpha.1';
176
+ const SDK_VERSION$1 = '1.4.1-alpha.2';
177
177
  let initialised$1 = false;
178
178
  const isInitialised$1 = () => initialised$1;
179
179
  const getReferrer$1 = () => {
@@ -11260,7 +11260,7 @@ class MultiRollupApiClients {
11260
11260
  }
11261
11261
 
11262
11262
  // eslint-disable-next-line @typescript-eslint/naming-convention
11263
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.4.1-alpha.1' };
11263
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.4.1-alpha.2' };
11264
11264
  const createConfig = ({ basePath, headers, }) => {
11265
11265
  if (!basePath.trim()) {
11266
11266
  throw Error('basePath can not be empty');
@@ -11332,7 +11332,7 @@ class APIError extends Error {
11332
11332
 
11333
11333
  /* eslint-disable implicit-arrow-linebreak */
11334
11334
  const defaultHeaders = {
11335
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.4.1-alpha.1',
11335
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.4.1-alpha.2',
11336
11336
  };
11337
11337
  /**
11338
11338
  * createAPIConfiguration to create a custom Configuration
@@ -11765,7 +11765,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
11765
11765
  chainID,
11766
11766
  coreContractAddress,
11767
11767
  registrationContractAddress,
11768
- sdkVersion: 'ts-immutable-sdk-1.4.1-alpha.1',
11768
+ sdkVersion: 'ts-immutable-sdk-1.4.1-alpha.2',
11769
11769
  });
11770
11770
  /**
11771
11771
  * Sets `sdkVersion` at the time of build
@@ -18464,6 +18464,52 @@ class ZkEvmProvider {
18464
18464
  }
18465
18465
  }
18466
18466
 
18467
+ const buildImxClientConfig = (passportModuleConfiguration) => {
18468
+ if (passportModuleConfiguration.overrides) {
18469
+ return createConfig({ basePath: passportModuleConfiguration.overrides.imxPublicApiDomain });
18470
+ }
18471
+ if (passportModuleConfiguration.baseConfig.environment === Environment$1.SANDBOX) {
18472
+ return imxApiConfig.getSandbox();
18473
+ }
18474
+ return imxApiConfig.getProduction();
18475
+ };
18476
+ const buildImxApiClients = (passportModuleConfiguration) => {
18477
+ if (passportModuleConfiguration.overrides?.imxApiClients)
18478
+ return passportModuleConfiguration.overrides.imxApiClients;
18479
+ const config = buildImxClientConfig(passportModuleConfiguration);
18480
+ return new ImxApiClients(config);
18481
+ };
18482
+ const buildPrivateVars = (passportModuleConfiguration) => {
18483
+ const config = new PassportConfiguration(passportModuleConfiguration);
18484
+ const authManager = new AuthManager(config);
18485
+ const magicAdapter = new MagicAdapter(config);
18486
+ const confirmationScreen = new ConfirmationScreen(config);
18487
+ const multiRollupApiClients = new MultiRollupApiClients(config.multiRollupConfig);
18488
+ const passportEventEmitter = new TypedEventEmitter();
18489
+ const immutableXClient = passportModuleConfiguration.overrides
18490
+ ? passportModuleConfiguration.overrides.immutableXClient
18491
+ : new IMXClient({ baseConfig: passportModuleConfiguration.baseConfig });
18492
+ const imxApiClients = buildImxApiClients(passportModuleConfiguration);
18493
+ const passportImxProviderFactory = new PassportImxProviderFactory({
18494
+ authManager,
18495
+ config,
18496
+ confirmationScreen,
18497
+ immutableXClient,
18498
+ magicAdapter,
18499
+ passportEventEmitter,
18500
+ imxApiClients,
18501
+ });
18502
+ return {
18503
+ config,
18504
+ authManager,
18505
+ magicAdapter,
18506
+ confirmationScreen,
18507
+ immutableXClient,
18508
+ multiRollupApiClients,
18509
+ passportEventEmitter,
18510
+ passportImxProviderFactory,
18511
+ };
18512
+ };
18467
18513
  class Passport {
18468
18514
  authManager;
18469
18515
  config;
@@ -18474,30 +18520,15 @@ class Passport {
18474
18520
  passportImxProviderFactory;
18475
18521
  passportEventEmitter;
18476
18522
  constructor(passportModuleConfiguration) {
18477
- this.config = new PassportConfiguration(passportModuleConfiguration);
18478
- this.authManager = new AuthManager(this.config);
18479
- this.magicAdapter = new MagicAdapter(this.config);
18480
- this.confirmationScreen = new ConfirmationScreen(this.config);
18481
- this.immutableXClient = passportModuleConfiguration.overrides?.immutableXClient
18482
- || new IMXClient({
18483
- baseConfig: passportModuleConfiguration.baseConfig,
18484
- });
18485
- this.multiRollupApiClients = new MultiRollupApiClients(this.config.multiRollupConfig);
18486
- this.passportEventEmitter = new TypedEventEmitter();
18487
- const imxClientConfig = this.config.baseConfig.environment === Environment$1.PRODUCTION
18488
- ? imxApiConfig.getProduction()
18489
- : imxApiConfig.getSandbox();
18490
- const imxApiClients = passportModuleConfiguration.overrides?.imxApiClients
18491
- || new ImxApiClients(imxClientConfig);
18492
- this.passportImxProviderFactory = new PassportImxProviderFactory({
18493
- authManager: this.authManager,
18494
- config: this.config,
18495
- confirmationScreen: this.confirmationScreen,
18496
- immutableXClient: this.immutableXClient,
18497
- magicAdapter: this.magicAdapter,
18498
- passportEventEmitter: this.passportEventEmitter,
18499
- imxApiClients,
18500
- });
18523
+ const privateVars = buildPrivateVars(passportModuleConfiguration);
18524
+ this.config = privateVars.config;
18525
+ this.authManager = privateVars.authManager;
18526
+ this.magicAdapter = privateVars.magicAdapter;
18527
+ this.confirmationScreen = privateVars.confirmationScreen;
18528
+ this.immutableXClient = privateVars.immutableXClient;
18529
+ this.multiRollupApiClients = privateVars.multiRollupApiClients;
18530
+ this.passportEventEmitter = privateVars.passportEventEmitter;
18531
+ this.passportImxProviderFactory = privateVars.passportImxProviderFactory;
18501
18532
  setPassportClientId(passportModuleConfiguration.clientId);
18502
18533
  track('passport', 'initialised');
18503
18534
  }
@@ -37030,7 +37061,7 @@ const flattenProperties = (properties) => {
37030
37061
  };
37031
37062
 
37032
37063
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
37033
- const SDK_VERSION = '1.4.1-alpha.1';
37064
+ const SDK_VERSION = '1.4.1-alpha.2';
37034
37065
  let initialised = false;
37035
37066
  const isInitialised = () => initialised;
37036
37067
  const getReferrer = () => {
@@ -42135,7 +42166,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
42135
42166
  maxPriorityFeePerGas: ethers.BigNumber.from(10e9),
42136
42167
  };
42137
42168
 
42138
- const SDK_VERSION_MARKER = '1.4.1-alpha.1';
42169
+ const SDK_VERSION_MARKER = '1.4.1-alpha.2';
42139
42170
  // This SDK version is replaced by the `yarn build` command ran on the root level
42140
42171
  const globalPackageVersion = () => SDK_VERSION_MARKER;
42141
42172
 
package/dist/index.d.ts CHANGED
@@ -28508,12 +28508,12 @@ interface PassportOverrides {
28508
28508
  passportDomain: string;
28509
28509
  imxPublicApiDomain: string;
28510
28510
  immutableXClient: IMXClient;
28511
- imxApiClients: ImxApiClients;
28512
28511
  zkEvmRpcUrl: string;
28513
28512
  relayerUrl: string;
28514
28513
  indexerMrBasePath: string;
28515
28514
  orderBookMrBasePath: string;
28516
28515
  passportMrBasePath: string;
28516
+ imxApiClients?: ImxApiClients;
28517
28517
  }
28518
28518
  interface PassportModuleConfiguration extends ModuleConfiguration<PassportOverrides>, OidcConfiguration {
28519
28519
  /**
package/dist/index.js CHANGED
@@ -151,7 +151,7 @@ const flattenProperties$1 = (properties) => {
151
151
  };
152
152
 
153
153
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
154
- const SDK_VERSION$1 = '1.4.1-alpha.1';
154
+ const SDK_VERSION$1 = '1.4.1-alpha.2';
155
155
  let initialised$1 = false;
156
156
  const isInitialised$1 = () => initialised$1;
157
157
  const getReferrer$1 = () => {
@@ -11238,7 +11238,7 @@ class MultiRollupApiClients {
11238
11238
  }
11239
11239
 
11240
11240
  // eslint-disable-next-line @typescript-eslint/naming-convention
11241
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.4.1-alpha.1' };
11241
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.4.1-alpha.2' };
11242
11242
  const createConfig = ({ basePath, headers, }) => {
11243
11243
  if (!basePath.trim()) {
11244
11244
  throw Error('basePath can not be empty');
@@ -11310,7 +11310,7 @@ class APIError extends Error {
11310
11310
 
11311
11311
  /* eslint-disable implicit-arrow-linebreak */
11312
11312
  const defaultHeaders = {
11313
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.4.1-alpha.1',
11313
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.4.1-alpha.2',
11314
11314
  };
11315
11315
  /**
11316
11316
  * createAPIConfiguration to create a custom Configuration
@@ -11743,7 +11743,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
11743
11743
  chainID,
11744
11744
  coreContractAddress,
11745
11745
  registrationContractAddress,
11746
- sdkVersion: 'ts-immutable-sdk-1.4.1-alpha.1',
11746
+ sdkVersion: 'ts-immutable-sdk-1.4.1-alpha.2',
11747
11747
  });
11748
11748
  /**
11749
11749
  * Sets `sdkVersion` at the time of build
@@ -18442,6 +18442,52 @@ class ZkEvmProvider {
18442
18442
  }
18443
18443
  }
18444
18444
 
18445
+ const buildImxClientConfig = (passportModuleConfiguration) => {
18446
+ if (passportModuleConfiguration.overrides) {
18447
+ return createConfig({ basePath: passportModuleConfiguration.overrides.imxPublicApiDomain });
18448
+ }
18449
+ if (passportModuleConfiguration.baseConfig.environment === Environment$1.SANDBOX) {
18450
+ return imxApiConfig.getSandbox();
18451
+ }
18452
+ return imxApiConfig.getProduction();
18453
+ };
18454
+ const buildImxApiClients = (passportModuleConfiguration) => {
18455
+ if (passportModuleConfiguration.overrides?.imxApiClients)
18456
+ return passportModuleConfiguration.overrides.imxApiClients;
18457
+ const config = buildImxClientConfig(passportModuleConfiguration);
18458
+ return new ImxApiClients(config);
18459
+ };
18460
+ const buildPrivateVars = (passportModuleConfiguration) => {
18461
+ const config = new PassportConfiguration(passportModuleConfiguration);
18462
+ const authManager = new AuthManager(config);
18463
+ const magicAdapter = new MagicAdapter(config);
18464
+ const confirmationScreen = new ConfirmationScreen(config);
18465
+ const multiRollupApiClients = new MultiRollupApiClients(config.multiRollupConfig);
18466
+ const passportEventEmitter = new TypedEventEmitter();
18467
+ const immutableXClient = passportModuleConfiguration.overrides
18468
+ ? passportModuleConfiguration.overrides.immutableXClient
18469
+ : new IMXClient({ baseConfig: passportModuleConfiguration.baseConfig });
18470
+ const imxApiClients = buildImxApiClients(passportModuleConfiguration);
18471
+ const passportImxProviderFactory = new PassportImxProviderFactory({
18472
+ authManager,
18473
+ config,
18474
+ confirmationScreen,
18475
+ immutableXClient,
18476
+ magicAdapter,
18477
+ passportEventEmitter,
18478
+ imxApiClients,
18479
+ });
18480
+ return {
18481
+ config,
18482
+ authManager,
18483
+ magicAdapter,
18484
+ confirmationScreen,
18485
+ immutableXClient,
18486
+ multiRollupApiClients,
18487
+ passportEventEmitter,
18488
+ passportImxProviderFactory,
18489
+ };
18490
+ };
18445
18491
  class Passport {
18446
18492
  authManager;
18447
18493
  config;
@@ -18452,30 +18498,15 @@ class Passport {
18452
18498
  passportImxProviderFactory;
18453
18499
  passportEventEmitter;
18454
18500
  constructor(passportModuleConfiguration) {
18455
- this.config = new PassportConfiguration(passportModuleConfiguration);
18456
- this.authManager = new AuthManager(this.config);
18457
- this.magicAdapter = new MagicAdapter(this.config);
18458
- this.confirmationScreen = new ConfirmationScreen(this.config);
18459
- this.immutableXClient = passportModuleConfiguration.overrides?.immutableXClient
18460
- || new IMXClient({
18461
- baseConfig: passportModuleConfiguration.baseConfig,
18462
- });
18463
- this.multiRollupApiClients = new MultiRollupApiClients(this.config.multiRollupConfig);
18464
- this.passportEventEmitter = new TypedEventEmitter();
18465
- const imxClientConfig = this.config.baseConfig.environment === Environment$1.PRODUCTION
18466
- ? imxApiConfig.getProduction()
18467
- : imxApiConfig.getSandbox();
18468
- const imxApiClients = passportModuleConfiguration.overrides?.imxApiClients
18469
- || new ImxApiClients(imxClientConfig);
18470
- this.passportImxProviderFactory = new PassportImxProviderFactory({
18471
- authManager: this.authManager,
18472
- config: this.config,
18473
- confirmationScreen: this.confirmationScreen,
18474
- immutableXClient: this.immutableXClient,
18475
- magicAdapter: this.magicAdapter,
18476
- passportEventEmitter: this.passportEventEmitter,
18477
- imxApiClients,
18478
- });
18501
+ const privateVars = buildPrivateVars(passportModuleConfiguration);
18502
+ this.config = privateVars.config;
18503
+ this.authManager = privateVars.authManager;
18504
+ this.magicAdapter = privateVars.magicAdapter;
18505
+ this.confirmationScreen = privateVars.confirmationScreen;
18506
+ this.immutableXClient = privateVars.immutableXClient;
18507
+ this.multiRollupApiClients = privateVars.multiRollupApiClients;
18508
+ this.passportEventEmitter = privateVars.passportEventEmitter;
18509
+ this.passportImxProviderFactory = privateVars.passportImxProviderFactory;
18479
18510
  setPassportClientId(passportModuleConfiguration.clientId);
18480
18511
  track('passport', 'initialised');
18481
18512
  }
@@ -37008,7 +37039,7 @@ const flattenProperties = (properties) => {
37008
37039
  };
37009
37040
 
37010
37041
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
37011
- const SDK_VERSION = '1.4.1-alpha.1';
37042
+ const SDK_VERSION = '1.4.1-alpha.2';
37012
37043
  let initialised = false;
37013
37044
  const isInitialised = () => initialised;
37014
37045
  const getReferrer = () => {
@@ -42113,7 +42144,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
42113
42144
  maxPriorityFeePerGas: BigNumber$1.from(10e9),
42114
42145
  };
42115
42146
 
42116
- const SDK_VERSION_MARKER = '1.4.1-alpha.1';
42147
+ const SDK_VERSION_MARKER = '1.4.1-alpha.2';
42117
42148
  // This SDK version is replaced by the `yarn build` command ran on the root level
42118
42149
  const globalPackageVersion = () => SDK_VERSION_MARKER;
42119
42150
 
package/dist/orderbook.js CHANGED
@@ -126,7 +126,7 @@ const flattenProperties = (properties) => {
126
126
  };
127
127
 
128
128
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
129
- const SDK_VERSION = '1.4.1-alpha.1';
129
+ const SDK_VERSION = '1.4.1-alpha.2';
130
130
  let initialised = false;
131
131
  const isInitialised = () => initialised;
132
132
  const getReferrer = () => {