@imtbl/sdk 1.5.3-alpha.3 → 1.5.3-alpha.4

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 (33) hide show
  1. package/dist/blockchain_data.js +2 -2
  2. package/dist/browser/checkout/{BridgeWidget-2e0093b4.js → BridgeWidget-895c2ff8.js} +1 -1
  3. package/dist/browser/checkout/{OnRampWidget-444ebe2b.js → OnRampWidget-93e6c462.js} +1 -1
  4. package/dist/browser/checkout/{SaleWidget-5f6ea630.js → SaleWidget-af43a403.js} +1 -1
  5. package/dist/browser/checkout/{SpendingCapHero-a6ef1dcc.js → SpendingCapHero-03968ac0.js} +1 -1
  6. package/dist/browser/checkout/{SwapWidget-aee793d7.js → SwapWidget-61e779d8.js} +1 -1
  7. package/dist/browser/checkout/{TopUpView-def404d5.js → TopUpView-09a61709.js} +1 -1
  8. package/dist/browser/checkout/{WalletWidget-f87f80b4.js → WalletWidget-68b65814.js} +1 -1
  9. package/dist/browser/checkout/{auto-track-e03d4bb9.js → auto-track-7c8945e1.js} +1 -1
  10. package/dist/browser/checkout/{balance-c8477685.js → balance-5343fb20.js} +1 -1
  11. package/dist/browser/checkout/{index-43973ac4.js → index-2657c3d3.js} +1 -1
  12. package/dist/browser/checkout/index-2c059c42.js +1 -0
  13. package/dist/browser/checkout/{index-49582766.js → index-3ef57b96.js} +1 -1
  14. package/dist/browser/checkout/{index-ea3645ce.js → index-8130cf40.js} +3 -3
  15. package/dist/browser/checkout/{index-a8155f8b.js → index-a12ebc45.js} +1 -1
  16. package/dist/browser/checkout/{index-35beb3eb.js → index-d949d325.js} +1 -1
  17. package/dist/browser/checkout/{index-6984b667.js → index-f2726576.js} +1 -1
  18. package/dist/browser/checkout/{index.umd-9e885d58.js → index.umd-31af21e6.js} +1 -1
  19. package/dist/browser/checkout/{retry-fc920719.js → retry-07d04bc8.js} +1 -1
  20. package/dist/browser/checkout/sdk.js +4 -4
  21. package/dist/browser/checkout/{useTransakEvents-cffde72e.js → useTransakEvents-33875f8a.js} +1 -1
  22. package/dist/browser/checkout/widgets.js +1 -1
  23. package/dist/checkout.js +23 -34
  24. package/dist/config.js +1 -1
  25. package/dist/index.browser.js +4 -4
  26. package/dist/index.browser.js.map +1 -1
  27. package/dist/index.cjs +25 -36
  28. package/dist/index.js +25 -36
  29. package/dist/orderbook.js +1 -1
  30. package/dist/passport.js +3 -3
  31. package/dist/x.js +2 -2
  32. package/package.json +1 -1
  33. package/dist/browser/checkout/index-500dddb2.js +0 -1
package/dist/index.cjs CHANGED
@@ -174,7 +174,7 @@ const flattenProperties$1 = (properties) => {
174
174
  };
175
175
 
176
176
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
177
- const SDK_VERSION$1 = '1.5.3-alpha.3';
177
+ const SDK_VERSION$1 = '1.5.3-alpha.4';
178
178
  const getReferrer$1 = () => {
179
179
  if (isNode$1()) {
180
180
  return '';
@@ -11289,7 +11289,7 @@ class MultiRollupApiClients {
11289
11289
  }
11290
11290
 
11291
11291
  // eslint-disable-next-line @typescript-eslint/naming-convention
11292
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.5.3-alpha.3' };
11292
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.5.3-alpha.4' };
11293
11293
  const createConfig = ({ basePath, headers, }) => {
11294
11294
  if (!basePath.trim()) {
11295
11295
  throw Error('basePath can not be empty');
@@ -11361,7 +11361,7 @@ class APIError extends Error {
11361
11361
 
11362
11362
  /* eslint-disable implicit-arrow-linebreak */
11363
11363
  const defaultHeaders = {
11364
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.5.3-alpha.3',
11364
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.5.3-alpha.4',
11365
11365
  };
11366
11366
  /**
11367
11367
  * createAPIConfiguration to create a custom Configuration
@@ -11794,7 +11794,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
11794
11794
  chainID,
11795
11795
  coreContractAddress,
11796
11796
  registrationContractAddress,
11797
- sdkVersion: 'ts-immutable-sdk-1.5.3-alpha.3',
11797
+ sdkVersion: 'ts-immutable-sdk-1.5.3-alpha.4',
11798
11798
  });
11799
11799
  /**
11800
11800
  * Sets `sdkVersion` at the time of build
@@ -37448,7 +37448,7 @@ const flattenProperties = (properties) => {
37448
37448
  };
37449
37449
 
37450
37450
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
37451
- const SDK_VERSION = '1.5.3-alpha.3';
37451
+ const SDK_VERSION = '1.5.3-alpha.4';
37452
37452
  const getReferrer = () => {
37453
37453
  if (isNode()) {
37454
37454
  return '';
@@ -42615,7 +42615,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
42615
42615
  maxPriorityFeePerGas: ethers.BigNumber.from(10e9),
42616
42616
  };
42617
42617
 
42618
- const SDK_VERSION_MARKER = '1.5.3-alpha.3';
42618
+ const SDK_VERSION_MARKER = '1.5.3-alpha.4';
42619
42619
  // This SDK version is replaced by the `yarn build` command ran on the root level
42620
42620
  const globalPackageVersion = () => SDK_VERSION_MARKER;
42621
42621
 
@@ -46237,21 +46237,21 @@ function loadUnresolved(version) {
46237
46237
  if (document === undefined) {
46238
46238
  throw new Error('missing document object: please run Checkout client side');
46239
46239
  }
46240
- const scriptId = 'immutable-checkout-widgets-bundle';
46240
+ // const scriptId = 'immutable-checkout-widgets-bundle';
46241
46241
  const validVersion = validateAndBuildVersion(version);
46242
46242
  // Prevent the script to be loaded more than once
46243
46243
  // by checking the presence of the script and its version.
46244
- const initScript = document.getElementById(scriptId);
46245
- if (initScript)
46246
- return { loaded: true, element: initScript };
46247
- const tag = document.createElement('script');
46248
- let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout/widgets.js`;
46249
- tag.setAttribute('id', scriptId);
46250
- tag.setAttribute('data-version', validVersion);
46251
- tag.setAttribute('type', 'module');
46252
- tag.setAttribute('src', cdnUrl);
46253
- document.head.appendChild(tag);
46254
- return { loaded: false, element: tag };
46244
+ // const initScript = document.getElementById(scriptId) as HTMLScriptElement;
46245
+ // if (initScript) return { loaded: true, element: initScript };
46246
+ // const tag = document.createElement('script');
46247
+ const cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout/widgets.js`;
46248
+ // if (useLocalBundle()) cdnUrl = `http://${window.location.host}/lib/js/widgets.js`;
46249
+ // tag.setAttribute('id', scriptId);
46250
+ // tag.setAttribute('data-version', validVersion);
46251
+ // tag.setAttribute('type', 'module');
46252
+ // tag.setAttribute('src', cdnUrl);
46253
+ // document.head.appendChild(tag);
46254
+ return { loaded: false, cdnUrl };
46255
46255
  }
46256
46256
 
46257
46257
  const PUBLISHABLE_KEY_PREFIX = 'pk_imapik-';
@@ -46330,7 +46330,6 @@ const SANDBOX_CONFIGURATION = {
46330
46330
  },
46331
46331
  passport: undefined,
46332
46332
  };
46333
- const WIDGETS_SCRIPT_TIMEOUT = 100;
46334
46333
  // Checkout SDK
46335
46334
  class Checkout {
46336
46335
  readOnlyProviders;
@@ -46360,29 +46359,19 @@ class Checkout {
46360
46359
  const checkout = this;
46361
46360
  // Preload the configurations
46362
46361
  await checkout.config.remote.getConfig();
46362
+ const load = loadUnresolved(init.version);
46363
+ const checkoutWidgetsModule = await import(load.cdnUrl);
46363
46364
  const factory = new Promise((resolve, reject) => {
46364
- function checkForWidgetsBundleLoaded() {
46365
- if (typeof ImmutableCheckoutWidgets !== 'undefined') {
46366
- resolve(new ImmutableCheckoutWidgets.WidgetsFactory(checkout, init.config));
46367
- }
46368
- else {
46369
- // If ImmutableCheckoutWidgets is not defined, wait for set amount of time.
46370
- // When time has elapsed, check again if ImmutableCheckoutWidgets is defined.
46371
- // Once it's defined, the promise will resolve and setTimeout won't be called again.
46372
- setTimeout(checkForWidgetsBundleLoaded, WIDGETS_SCRIPT_TIMEOUT);
46373
- }
46374
- }
46375
46365
  try {
46376
- const script = loadUnresolved(init.version);
46377
- if (script.loaded && typeof ImmutableCheckoutWidgets !== 'undefined') {
46378
- resolve(new ImmutableCheckoutWidgets.WidgetsFactory(checkout, init.config));
46366
+ if (checkoutWidgetsModule && checkoutWidgetsModule.WidgetsFactory) {
46367
+ resolve(new checkoutWidgetsModule.WidgetsFactory(checkout, init.config));
46379
46368
  }
46380
46369
  else {
46381
- checkForWidgetsBundleLoaded();
46370
+ throw new Error('WidgetsFactory is not found in the imported module.');
46382
46371
  }
46383
46372
  }
46384
- catch (err) {
46385
- reject(new CheckoutError('Failed to load widgets script', CheckoutErrorType.WIDGETS_SCRIPT_LOAD_ERROR, { error: err }));
46373
+ catch (error) {
46374
+ reject(error);
46386
46375
  }
46387
46376
  });
46388
46377
  return factory;
package/dist/index.js CHANGED
@@ -152,7 +152,7 @@ const flattenProperties$1 = (properties) => {
152
152
  };
153
153
 
154
154
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
155
- const SDK_VERSION$1 = '1.5.3-alpha.3';
155
+ const SDK_VERSION$1 = '1.5.3-alpha.4';
156
156
  const getReferrer$1 = () => {
157
157
  if (isNode$1()) {
158
158
  return '';
@@ -11267,7 +11267,7 @@ class MultiRollupApiClients {
11267
11267
  }
11268
11268
 
11269
11269
  // eslint-disable-next-line @typescript-eslint/naming-convention
11270
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.5.3-alpha.3' };
11270
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.5.3-alpha.4' };
11271
11271
  const createConfig = ({ basePath, headers, }) => {
11272
11272
  if (!basePath.trim()) {
11273
11273
  throw Error('basePath can not be empty');
@@ -11339,7 +11339,7 @@ class APIError extends Error {
11339
11339
 
11340
11340
  /* eslint-disable implicit-arrow-linebreak */
11341
11341
  const defaultHeaders = {
11342
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.5.3-alpha.3',
11342
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.5.3-alpha.4',
11343
11343
  };
11344
11344
  /**
11345
11345
  * createAPIConfiguration to create a custom Configuration
@@ -11772,7 +11772,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
11772
11772
  chainID,
11773
11773
  coreContractAddress,
11774
11774
  registrationContractAddress,
11775
- sdkVersion: 'ts-immutable-sdk-1.5.3-alpha.3',
11775
+ sdkVersion: 'ts-immutable-sdk-1.5.3-alpha.4',
11776
11776
  });
11777
11777
  /**
11778
11778
  * Sets `sdkVersion` at the time of build
@@ -37426,7 +37426,7 @@ const flattenProperties = (properties) => {
37426
37426
  };
37427
37427
 
37428
37428
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
37429
- const SDK_VERSION = '1.5.3-alpha.3';
37429
+ const SDK_VERSION = '1.5.3-alpha.4';
37430
37430
  const getReferrer = () => {
37431
37431
  if (isNode()) {
37432
37432
  return '';
@@ -42593,7 +42593,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
42593
42593
  maxPriorityFeePerGas: BigNumber$1.from(10e9),
42594
42594
  };
42595
42595
 
42596
- const SDK_VERSION_MARKER = '1.5.3-alpha.3';
42596
+ const SDK_VERSION_MARKER = '1.5.3-alpha.4';
42597
42597
  // This SDK version is replaced by the `yarn build` command ran on the root level
42598
42598
  const globalPackageVersion = () => SDK_VERSION_MARKER;
42599
42599
 
@@ -46215,21 +46215,21 @@ function loadUnresolved(version) {
46215
46215
  if (document === undefined) {
46216
46216
  throw new Error('missing document object: please run Checkout client side');
46217
46217
  }
46218
- const scriptId = 'immutable-checkout-widgets-bundle';
46218
+ // const scriptId = 'immutable-checkout-widgets-bundle';
46219
46219
  const validVersion = validateAndBuildVersion(version);
46220
46220
  // Prevent the script to be loaded more than once
46221
46221
  // by checking the presence of the script and its version.
46222
- const initScript = document.getElementById(scriptId);
46223
- if (initScript)
46224
- return { loaded: true, element: initScript };
46225
- const tag = document.createElement('script');
46226
- let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout/widgets.js`;
46227
- tag.setAttribute('id', scriptId);
46228
- tag.setAttribute('data-version', validVersion);
46229
- tag.setAttribute('type', 'module');
46230
- tag.setAttribute('src', cdnUrl);
46231
- document.head.appendChild(tag);
46232
- return { loaded: false, element: tag };
46222
+ // const initScript = document.getElementById(scriptId) as HTMLScriptElement;
46223
+ // if (initScript) return { loaded: true, element: initScript };
46224
+ // const tag = document.createElement('script');
46225
+ const cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout/widgets.js`;
46226
+ // if (useLocalBundle()) cdnUrl = `http://${window.location.host}/lib/js/widgets.js`;
46227
+ // tag.setAttribute('id', scriptId);
46228
+ // tag.setAttribute('data-version', validVersion);
46229
+ // tag.setAttribute('type', 'module');
46230
+ // tag.setAttribute('src', cdnUrl);
46231
+ // document.head.appendChild(tag);
46232
+ return { loaded: false, cdnUrl };
46233
46233
  }
46234
46234
 
46235
46235
  const PUBLISHABLE_KEY_PREFIX = 'pk_imapik-';
@@ -46308,7 +46308,6 @@ const SANDBOX_CONFIGURATION = {
46308
46308
  },
46309
46309
  passport: undefined,
46310
46310
  };
46311
- const WIDGETS_SCRIPT_TIMEOUT = 100;
46312
46311
  // Checkout SDK
46313
46312
  class Checkout {
46314
46313
  readOnlyProviders;
@@ -46338,29 +46337,19 @@ class Checkout {
46338
46337
  const checkout = this;
46339
46338
  // Preload the configurations
46340
46339
  await checkout.config.remote.getConfig();
46340
+ const load = loadUnresolved(init.version);
46341
+ const checkoutWidgetsModule = await import(load.cdnUrl);
46341
46342
  const factory = new Promise((resolve, reject) => {
46342
- function checkForWidgetsBundleLoaded() {
46343
- if (typeof ImmutableCheckoutWidgets !== 'undefined') {
46344
- resolve(new ImmutableCheckoutWidgets.WidgetsFactory(checkout, init.config));
46345
- }
46346
- else {
46347
- // If ImmutableCheckoutWidgets is not defined, wait for set amount of time.
46348
- // When time has elapsed, check again if ImmutableCheckoutWidgets is defined.
46349
- // Once it's defined, the promise will resolve and setTimeout won't be called again.
46350
- setTimeout(checkForWidgetsBundleLoaded, WIDGETS_SCRIPT_TIMEOUT);
46351
- }
46352
- }
46353
46343
  try {
46354
- const script = loadUnresolved(init.version);
46355
- if (script.loaded && typeof ImmutableCheckoutWidgets !== 'undefined') {
46356
- resolve(new ImmutableCheckoutWidgets.WidgetsFactory(checkout, init.config));
46344
+ if (checkoutWidgetsModule && checkoutWidgetsModule.WidgetsFactory) {
46345
+ resolve(new checkoutWidgetsModule.WidgetsFactory(checkout, init.config));
46357
46346
  }
46358
46347
  else {
46359
- checkForWidgetsBundleLoaded();
46348
+ throw new Error('WidgetsFactory is not found in the imported module.');
46360
46349
  }
46361
46350
  }
46362
- catch (err) {
46363
- reject(new CheckoutError('Failed to load widgets script', CheckoutErrorType.WIDGETS_SCRIPT_LOAD_ERROR, { error: err }));
46351
+ catch (error) {
46352
+ reject(error);
46364
46353
  }
46365
46354
  });
46366
46355
  return factory;
package/dist/orderbook.js CHANGED
@@ -131,7 +131,7 @@ const flattenProperties = (properties) => {
131
131
  };
132
132
 
133
133
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
134
- const SDK_VERSION = '1.5.3-alpha.3';
134
+ const SDK_VERSION = '1.5.3-alpha.4';
135
135
  const getReferrer = () => {
136
136
  if (isNode()) {
137
137
  return '';
package/dist/passport.js CHANGED
@@ -9138,7 +9138,7 @@ class MultiRollupApiClients {
9138
9138
  }
9139
9139
 
9140
9140
  // eslint-disable-next-line @typescript-eslint/naming-convention
9141
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.5.3-alpha.3' };
9141
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.5.3-alpha.4' };
9142
9142
  const createConfig = ({ basePath, headers, }) => {
9143
9143
  if (!basePath.trim()) {
9144
9144
  throw Error('basePath can not be empty');
@@ -9317,7 +9317,7 @@ const flattenProperties = (properties) => {
9317
9317
  };
9318
9318
 
9319
9319
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
9320
- const SDK_VERSION = '1.5.3-alpha.3';
9320
+ const SDK_VERSION = '1.5.3-alpha.4';
9321
9321
  const getReferrer = () => {
9322
9322
  if (isNode()) {
9323
9323
  return '';
@@ -9529,7 +9529,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
9529
9529
  chainID,
9530
9530
  coreContractAddress,
9531
9531
  registrationContractAddress,
9532
- sdkVersion: 'ts-immutable-sdk-1.5.3-alpha.3',
9532
+ sdkVersion: 'ts-immutable-sdk-1.5.3-alpha.4',
9533
9533
  });
9534
9534
  /**
9535
9535
  * Sets `sdkVersion` at the time of build
package/dist/x.js CHANGED
@@ -136,7 +136,7 @@ const flattenProperties = (properties) => {
136
136
  };
137
137
 
138
138
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
139
- const SDK_VERSION = '1.5.3-alpha.3';
139
+ const SDK_VERSION = '1.5.3-alpha.4';
140
140
  const getReferrer = () => {
141
141
  if (isNode()) {
142
142
  return '';
@@ -327,7 +327,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
327
327
  chainID,
328
328
  coreContractAddress,
329
329
  registrationContractAddress,
330
- sdkVersion: 'ts-immutable-sdk-1.5.3-alpha.3',
330
+ sdkVersion: 'ts-immutable-sdk-1.5.3-alpha.4',
331
331
  });
332
332
  /**
333
333
  * Sets `sdkVersion` at the time of build
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imtbl/sdk",
3
3
  "description": "Immutable Unified SDK",
4
- "version": "1.5.3-alpha.3",
4
+ "version": "1.5.3-alpha.4",
5
5
  "author": "Immutable",
6
6
  "browser": "./dist/index.browser.js",
7
7
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",
@@ -1 +0,0 @@
1
- import{bE as n,bF as t}from"./index-ea3645ce.js";function i(i){return n(this,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,import("./index.umd-9e885d58.js").then((function(n){return n.i}))];case 1:return n=t.sent(),i._plugins=n,[2]}}))}))}export{i as loadLegacyVideoPlugins};