@imtbl/sdk 0.27.15-alpha.1 → 0.27.15-alpha.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.
@@ -20599,7 +20599,7 @@ class APIError extends Error {
20599
20599
 
20600
20600
  /* eslint-disable implicit-arrow-linebreak */
20601
20601
  const defaultHeaders = {
20602
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.15-alpha.1',
20602
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.15-alpha.3',
20603
20603
  };
20604
20604
  /**
20605
20605
  * createAPIConfiguration to create a custom Configuration
@@ -25266,7 +25266,7 @@ async function getItemRequirementsFromRequirements(provider, requirements) {
25266
25266
  return itemRequirements;
25267
25267
  }
25268
25268
 
25269
- const SDK_VERSION_MARKER = '0.27.15-alpha.1';
25269
+ const SDK_VERSION_MARKER = '0.27.15-alpha.3';
25270
25270
  // This SDK version is replaced by the `yarn build` command ran on the root level
25271
25271
  const globalPackageVersion = () => SDK_VERSION_MARKER;
25272
25272
 
@@ -25333,31 +25333,12 @@ function loadUnresolved(version) {
25333
25333
  return { loaded: true, element: initScript };
25334
25334
  const tag = document.createElement('script');
25335
25335
  let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout/widgets.js`;
25336
- cdnUrl = `http://${window.location.host}/lib/js/widgets.js`;
25337
25336
  tag.setAttribute('data-product', 'checkout');
25338
25337
  tag.setAttribute('data-version', validVersion);
25339
25338
  tag.setAttribute('src', cdnUrl);
25340
25339
  document.head.appendChild(tag);
25341
25340
  return { loaded: false, element: tag };
25342
25341
  }
25343
- /**
25344
- * Creates and appends a checkout widget script to the document head.
25345
- * @param version - The desired widgets bundle version.
25346
- */
25347
- const load = (version) => new Promise((resolve, reject) => {
25348
- try {
25349
- const script = loadUnresolved(version);
25350
- if (script.loaded) {
25351
- resolve();
25352
- }
25353
- else {
25354
- script.element.onload = () => resolve();
25355
- }
25356
- }
25357
- catch (err) {
25358
- reject(err);
25359
- }
25360
- });
25361
25342
 
25362
25343
  const SANDBOX_CONFIGURATION = {
25363
25344
  baseConfig: {
@@ -25385,8 +25366,24 @@ class Checkout {
25385
25366
  * @param {WidgetsInit} init - The initialisation parameters for loading the widgets bundle and applying configuration
25386
25367
  */
25387
25368
  async widgets(init) {
25388
- await load(init.version);
25389
- return new ImmutableCheckoutWidgets.WidgetsFactory(this, init.config);
25369
+ const checkout = this;
25370
+ const factory = new Promise((resolve, reject) => {
25371
+ try {
25372
+ const script = loadUnresolved(init.version);
25373
+ if (script.loaded) {
25374
+ resolve(new ImmutableCheckoutWidgets.WidgetsFactory(checkout, init.config));
25375
+ }
25376
+ else {
25377
+ script.element.onload = () => resolve(new ImmutableCheckoutWidgets.WidgetsFactory(checkout, init.config));
25378
+ }
25379
+ }
25380
+ catch (err) {
25381
+ reject(err);
25382
+ }
25383
+ });
25384
+ // eslint-disable-next-line no-console
25385
+ console.log('factory', factory);
25386
+ return factory;
25390
25387
  }
25391
25388
  /**
25392
25389
  * Creates a provider using the given parameters.
@@ -16,7 +16,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
16
16
  chainID,
17
17
  coreContractAddress,
18
18
  registrationContractAddress,
19
- sdkVersion: 'ts-immutable-sdk-0.27.15-alpha.1',
19
+ sdkVersion: 'ts-immutable-sdk-0.27.15-alpha.3',
20
20
  });
21
21
  /**
22
22
  * Sets `sdkVersion` at the time of build