@imtbl/sdk 1.6.0-alpha.1 → 1.6.0
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.js +2 -2
- package/dist/browser/checkout/sdk.js +4 -4
- package/dist/browser/checkout/widgets.js +51 -50
- package/dist/checkout.d.ts +1 -3
- package/dist/checkout.js +8 -43
- package/dist/config.js +1 -1
- package/dist/index.browser.js +13 -13
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +10 -45
- package/dist/index.d.ts +1 -3
- package/dist/index.js +10 -45
- package/dist/orderbook.js +1 -1
- package/dist/passport.js +3 -3
- package/dist/x.js +2 -2
- package/package.json +1 -1
- package/dist/browser/checkout/BridgeWidget-38c8cacb.js +0 -1
- package/dist/browser/checkout/OnRampWidget-1c8e54ce.js +0 -1
- package/dist/browser/checkout/SaleWidget-cc5aa51c.js +0 -2
- package/dist/browser/checkout/SpendingCapHero-fdeb2fc6.js +0 -1
- package/dist/browser/checkout/SwapWidget-acbacee2.js +0 -1
- package/dist/browser/checkout/TopUpView-a4425aa3.js +0 -1
- package/dist/browser/checkout/WalletWidget-4528b0a7.js +0 -1
- package/dist/browser/checkout/auto-track-c91d2967.js +0 -1
- package/dist/browser/checkout/balance-17fd7166.js +0 -1
- package/dist/browser/checkout/index-008f3a1f.js +0 -1
- package/dist/browser/checkout/index-1b56d53b.js +0 -1
- package/dist/browser/checkout/index-1ba3ec23.js +0 -106
- package/dist/browser/checkout/index-21a40c88.js +0 -1
- package/dist/browser/checkout/index-5728dc7e.js +0 -1
- package/dist/browser/checkout/index-bc18091f.js +0 -773
- package/dist/browser/checkout/index-e5599662.js +0 -1
- package/dist/browser/checkout/index.umd-fb0326ca.js +0 -1
- package/dist/browser/checkout/is-plan-event-enabled-80f76ce6.js +0 -1
- package/dist/browser/checkout/retry-2fc63d32.js +0 -1
- package/dist/browser/checkout/useTransakEvents-140c22fb.js +0 -2
- package/dist/browser/checkout/widgets-esm.js +0 -1
package/dist/checkout.d.ts
CHANGED
|
@@ -23736,7 +23736,7 @@ type CheckoutWidgetsConfig = {
|
|
|
23736
23736
|
/**
|
|
23737
23737
|
* Represents the configuration options for instantiating the Checkout Widgets factory.
|
|
23738
23738
|
* @property {WidgetConfiguration} config - global configuration options for the widgets.
|
|
23739
|
-
* @property {SemanticVersion | undefined} version - version of the Checkout widgets bundle(default latest version will be used).
|
|
23739
|
+
* @property {SemanticVersion | undefined} version - version of the Checkout widgets bundle (default latest version will be used).
|
|
23740
23740
|
*/
|
|
23741
23741
|
type WidgetsInit = {
|
|
23742
23742
|
config: WidgetConfiguration;
|
|
@@ -23760,8 +23760,6 @@ declare class Checkout {
|
|
|
23760
23760
|
* @param {WidgetsInit} init - The initialisation parameters for loading the widgets bundle and applying configuration
|
|
23761
23761
|
*/
|
|
23762
23762
|
widgets(init: WidgetsInit): Promise<ImmutableCheckoutWidgets.WidgetsFactory>;
|
|
23763
|
-
private loadUmdBundle;
|
|
23764
|
-
private loadEsModules;
|
|
23765
23763
|
/**
|
|
23766
23764
|
* Creates a provider using the given parameters.
|
|
23767
23765
|
* @param {CreateProviderParams} params - The parameters for creating the provider.
|
package/dist/checkout.js
CHANGED
|
@@ -139,7 +139,7 @@ const flattenProperties$1 = (properties) => {
|
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
142
|
-
const SDK_VERSION$1 = '1.6.0
|
|
142
|
+
const SDK_VERSION$1 = '1.6.0';
|
|
143
143
|
const getReferrer$1 = () => {
|
|
144
144
|
if (isNode$1()) {
|
|
145
145
|
return '';
|
|
@@ -17478,7 +17478,7 @@ const flattenProperties = (properties) => {
|
|
|
17478
17478
|
};
|
|
17479
17479
|
|
|
17480
17480
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
17481
|
-
const SDK_VERSION = '1.6.0
|
|
17481
|
+
const SDK_VERSION = '1.6.0';
|
|
17482
17482
|
const getReferrer = () => {
|
|
17483
17483
|
if (isNode()) {
|
|
17484
17484
|
return '';
|
|
@@ -27723,7 +27723,7 @@ class APIError extends Error {
|
|
|
27723
27723
|
|
|
27724
27724
|
/* eslint-disable implicit-arrow-linebreak */
|
|
27725
27725
|
const defaultHeaders = {
|
|
27726
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.6.0
|
|
27726
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.6.0',
|
|
27727
27727
|
};
|
|
27728
27728
|
/**
|
|
27729
27729
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -29090,7 +29090,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
29090
29090
|
maxPriorityFeePerGas: BigNumber$1.from(10e9),
|
|
29091
29091
|
};
|
|
29092
29092
|
|
|
29093
|
-
const SDK_VERSION_MARKER = '1.6.0
|
|
29093
|
+
const SDK_VERSION_MARKER = '1.6.0';
|
|
29094
29094
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
29095
29095
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
29096
29096
|
|
|
@@ -32705,8 +32705,7 @@ function validateAndBuildVersion(version) {
|
|
|
32705
32705
|
return validatedVersion;
|
|
32706
32706
|
}
|
|
32707
32707
|
|
|
32708
|
-
|
|
32709
|
-
function loadUnresolvedBundle(version) {
|
|
32708
|
+
function loadUnresolved(version) {
|
|
32710
32709
|
if (window === undefined) {
|
|
32711
32710
|
throw new Error('missing window object: please run Checkout client side');
|
|
32712
32711
|
}
|
|
@@ -32728,12 +32727,6 @@ function loadUnresolvedBundle(version) {
|
|
|
32728
32727
|
document.head.appendChild(tag);
|
|
32729
32728
|
return { loaded: false, element: tag };
|
|
32730
32729
|
}
|
|
32731
|
-
// Gets the CDN url for the split checkout widgets bundle
|
|
32732
|
-
function getWidgetsEsmUrl(version) {
|
|
32733
|
-
const validVersion = validateAndBuildVersion(version);
|
|
32734
|
-
let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout/widgets-esm.js`;
|
|
32735
|
-
return cdnUrl;
|
|
32736
|
-
}
|
|
32737
32730
|
|
|
32738
32731
|
const PUBLISHABLE_KEY_PREFIX = 'pk_imapik-';
|
|
32739
32732
|
const publishableKeyDomainAllowlist = [
|
|
@@ -32841,20 +32834,10 @@ class Checkout {
|
|
|
32841
32834
|
const checkout = this;
|
|
32842
32835
|
// Preload the configurations
|
|
32843
32836
|
await checkout.config.remote.getConfig();
|
|
32844
|
-
try {
|
|
32845
|
-
const factory = await this.loadEsModules(init.config, init.version);
|
|
32846
|
-
return factory;
|
|
32847
|
-
}
|
|
32848
|
-
catch (err) {
|
|
32849
|
-
throw new CheckoutError('Failed to load widgets script', CheckoutErrorType.WIDGETS_SCRIPT_LOAD_ERROR, { error: err });
|
|
32850
|
-
}
|
|
32851
|
-
}
|
|
32852
|
-
async loadUmdBundle(config, version) {
|
|
32853
|
-
const checkout = this;
|
|
32854
32837
|
const factory = new Promise((resolve, reject) => {
|
|
32855
32838
|
function checkForWidgetsBundleLoaded() {
|
|
32856
32839
|
if (typeof ImmutableCheckoutWidgets !== 'undefined') {
|
|
32857
|
-
resolve(new ImmutableCheckoutWidgets.WidgetsFactory(checkout, config));
|
|
32840
|
+
resolve(new ImmutableCheckoutWidgets.WidgetsFactory(checkout, init.config));
|
|
32858
32841
|
}
|
|
32859
32842
|
else {
|
|
32860
32843
|
// If ImmutableCheckoutWidgets is not defined, wait for set amount of time.
|
|
@@ -32864,9 +32847,9 @@ class Checkout {
|
|
|
32864
32847
|
}
|
|
32865
32848
|
}
|
|
32866
32849
|
try {
|
|
32867
|
-
const script =
|
|
32850
|
+
const script = loadUnresolved(init.version);
|
|
32868
32851
|
if (script.loaded && typeof ImmutableCheckoutWidgets !== 'undefined') {
|
|
32869
|
-
resolve(new ImmutableCheckoutWidgets.WidgetsFactory(checkout, config));
|
|
32852
|
+
resolve(new ImmutableCheckoutWidgets.WidgetsFactory(checkout, init.config));
|
|
32870
32853
|
}
|
|
32871
32854
|
else {
|
|
32872
32855
|
checkForWidgetsBundleLoaded();
|
|
@@ -32878,24 +32861,6 @@ class Checkout {
|
|
|
32878
32861
|
});
|
|
32879
32862
|
return factory;
|
|
32880
32863
|
}
|
|
32881
|
-
async loadEsModules(config, version) {
|
|
32882
|
-
const checkout = this;
|
|
32883
|
-
try {
|
|
32884
|
-
const cdnUrl = getWidgetsEsmUrl(version);
|
|
32885
|
-
// WebpackIgnore comment required to prevent webpack modifying the import statement and
|
|
32886
|
-
// breaking the dynamic import in certain applications integrating checkout
|
|
32887
|
-
const checkoutWidgetsModule = await import(/* webpackIgnore: true */ cdnUrl);
|
|
32888
|
-
if (checkoutWidgetsModule && checkoutWidgetsModule.WidgetsFactory) {
|
|
32889
|
-
return new checkoutWidgetsModule.WidgetsFactory(checkout, config);
|
|
32890
|
-
}
|
|
32891
|
-
}
|
|
32892
|
-
catch (err) {
|
|
32893
|
-
// eslint-disable-next-line no-console
|
|
32894
|
-
console.warn(`Failed to resolve checkout widgets module, falling back to UMD bundle. Error: ${err.message}`);
|
|
32895
|
-
}
|
|
32896
|
-
// Fallback to UMD bundle if esm bundle fails to load
|
|
32897
|
-
return await checkout.loadUmdBundle(config, version);
|
|
32898
|
-
}
|
|
32899
32864
|
/**
|
|
32900
32865
|
* Creates a provider using the given parameters.
|
|
32901
32866
|
* @param {CreateProviderParams} params - The parameters for creating the provider.
|
package/dist/config.js
CHANGED
|
@@ -128,7 +128,7 @@ const flattenProperties = (properties) => {
|
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
131
|
-
const SDK_VERSION = '1.6.0
|
|
131
|
+
const SDK_VERSION = '1.6.0';
|
|
132
132
|
const getReferrer = () => {
|
|
133
133
|
if (isNode()) {
|
|
134
134
|
return '';
|