@imtbl/sdk 0.27.15-alpha.2 → 0.27.15-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.
@@ -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.2',
20602
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.15-alpha.4',
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.2';
25269
+ const SDK_VERSION_MARKER = '0.27.15-alpha.4';
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
 
@@ -25339,24 +25339,6 @@ function loadUnresolved(version) {
25339
25339
  document.head.appendChild(tag);
25340
25340
  return { loaded: false, element: tag };
25341
25341
  }
25342
- /**
25343
- * Creates and appends a checkout widget script to the document head.
25344
- * @param version - The desired widgets bundle version.
25345
- */
25346
- const load = (version) => new Promise((resolve, reject) => {
25347
- try {
25348
- const script = loadUnresolved(version);
25349
- if (script.loaded) {
25350
- resolve();
25351
- }
25352
- else {
25353
- script.element.onload = () => resolve();
25354
- }
25355
- }
25356
- catch (err) {
25357
- reject(err);
25358
- }
25359
- });
25360
25342
 
25361
25343
  const SANDBOX_CONFIGURATION = {
25362
25344
  baseConfig: {
@@ -25384,8 +25366,40 @@ class Checkout {
25384
25366
  * @param {WidgetsInit} init - The initialisation parameters for loading the widgets bundle and applying configuration
25385
25367
  */
25386
25368
  async widgets(init) {
25387
- await load(init.version);
25388
- 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
+ // eslint-disable-next-line no-constant-condition
25375
+ while (true) {
25376
+ try {
25377
+ const f = new ImmutableCheckoutWidgets.WidgetsFactory(checkout, init.config);
25378
+ resolve(f);
25379
+ }
25380
+ catch { /* Empty */ }
25381
+ }
25382
+ }
25383
+ else {
25384
+ script.element.onload = () => {
25385
+ // eslint-disable-next-line no-constant-condition
25386
+ while (true) {
25387
+ try {
25388
+ const f = new ImmutableCheckoutWidgets.WidgetsFactory(checkout, init.config);
25389
+ resolve(f);
25390
+ }
25391
+ catch { /* Empty */ }
25392
+ }
25393
+ };
25394
+ }
25395
+ }
25396
+ catch (err) {
25397
+ reject(err);
25398
+ }
25399
+ });
25400
+ // eslint-disable-next-line no-console
25401
+ console.log('factory', factory);
25402
+ return factory;
25389
25403
  }
25390
25404
  /**
25391
25405
  * 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.2',
19
+ sdkVersion: 'ts-immutable-sdk-0.27.15-alpha.4',
20
20
  });
21
21
  /**
22
22
  * Sets `sdkVersion` at the time of build