@imtbl/sdk 0.22.3 → 0.23.0-alpha
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 +1 -1
- package/dist/browser/checkout.js +2 -2
- package/dist/checkout_sdk.js +1 -1
- package/dist/checkout_widgets.d.ts +1 -1
- package/dist/checkout_widgets.js +99 -30
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +3 -3
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +102 -33
- package/dist/index.d.ts +1 -1
- package/dist/index.js +102 -33
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3009,7 +3009,7 @@ class MultiRollupApiClients {
|
|
|
3009
3009
|
}
|
|
3010
3010
|
|
|
3011
3011
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3012
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.
|
|
3012
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.23.0-alpha' };
|
|
3013
3013
|
const createConfig = ({ basePath, headers, }) => {
|
|
3014
3014
|
if (!basePath.trim()) {
|
|
3015
3015
|
throw Error('basePath can not be empty');
|
|
@@ -3069,7 +3069,7 @@ class APIError extends Error {
|
|
|
3069
3069
|
|
|
3070
3070
|
/* eslint-disable implicit-arrow-linebreak */
|
|
3071
3071
|
const defaultHeaders = {
|
|
3072
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.
|
|
3072
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.23.0-alpha',
|
|
3073
3073
|
};
|
|
3074
3074
|
/**
|
|
3075
3075
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -3355,7 +3355,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
3355
3355
|
chainID,
|
|
3356
3356
|
coreContractAddress,
|
|
3357
3357
|
registrationContractAddress,
|
|
3358
|
-
sdkVersion: 'ts-immutable-sdk-0.
|
|
3358
|
+
sdkVersion: 'ts-immutable-sdk-0.23.0-alpha',
|
|
3359
3359
|
});
|
|
3360
3360
|
/**
|
|
3361
3361
|
* Sets `sdkVersion` at the time of build
|
|
@@ -32108,11 +32108,54 @@ var checkout_sdk = /*#__PURE__*/Object.freeze({
|
|
|
32108
32108
|
function $parcel$export(e, n, v, s) {
|
|
32109
32109
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
32110
32110
|
}
|
|
32111
|
-
|
|
32111
|
+
var $045213b18e9f1f94$exports = {};
|
|
32112
|
+
|
|
32113
|
+
$parcel$export($045213b18e9f1f94$exports, "WidgetTheme", () => $045213b18e9f1f94$export$c88931fdc51854eb);
|
|
32114
|
+
$parcel$export($045213b18e9f1f94$exports, "CheckoutWidgetTagNames", () => $045213b18e9f1f94$export$75be0f6af9650f2c);
|
|
32115
|
+
/**
|
|
32116
|
+
* Enum representing the themes for the Checkout widgets.
|
|
32117
|
+
*/ var $045213b18e9f1f94$export$c88931fdc51854eb;
|
|
32118
|
+
(function(WidgetTheme) {
|
|
32119
|
+
WidgetTheme["LIGHT"] = "light";
|
|
32120
|
+
WidgetTheme["DARK"] = "dark";
|
|
32121
|
+
})($045213b18e9f1f94$export$c88931fdc51854eb || ($045213b18e9f1f94$export$c88931fdc51854eb = {}));
|
|
32122
|
+
var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
32123
|
+
(function(CheckoutWidgetTagNames) {
|
|
32124
|
+
CheckoutWidgetTagNames["CONNECT"] = "imtbl-connect";
|
|
32125
|
+
CheckoutWidgetTagNames["WALLET"] = "imtbl-wallet";
|
|
32126
|
+
CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
|
|
32127
|
+
CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
|
|
32128
|
+
CheckoutWidgetTagNames["ONRAMP"] = "imtbl-onramp";
|
|
32129
|
+
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
32130
|
+
|
|
32131
|
+
|
|
32132
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.23.0-alpha";
|
|
32112
32133
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
32113
32134
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
32114
32135
|
|
|
32115
32136
|
|
|
32137
|
+
function $430e3eda76fa4d5f$var$getWidgetConfig(element) {
|
|
32138
|
+
const config = element.getAttribute("widgetconfig");
|
|
32139
|
+
if (!config) return null;
|
|
32140
|
+
try {
|
|
32141
|
+
return JSON.parse(config);
|
|
32142
|
+
} catch (err) {
|
|
32143
|
+
// eslint-disable-next-line no-console
|
|
32144
|
+
console.warn(`Unable to decode widgetconfig for ${element}: `, err);
|
|
32145
|
+
}
|
|
32146
|
+
return null;
|
|
32147
|
+
}
|
|
32148
|
+
function $430e3eda76fa4d5f$var$setWidgetConfig(element, config) {
|
|
32149
|
+
element.setAttribute("widgetconfig", JSON.stringify(config));
|
|
32150
|
+
}
|
|
32151
|
+
function $430e3eda76fa4d5f$var$saveConfig(config) {
|
|
32152
|
+
if (window === undefined) {
|
|
32153
|
+
// eslint-disable-next-line no-console
|
|
32154
|
+
console.error("missing window object: please run Checkout client side");
|
|
32155
|
+
return;
|
|
32156
|
+
}
|
|
32157
|
+
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
32158
|
+
}
|
|
32116
32159
|
function $430e3eda76fa4d5f$export$46b1ae20f762ad4c(version) {
|
|
32117
32160
|
const defaultPackageVersion = ($d663162fd5a0853f$export$1169f5475725171b)();
|
|
32118
32161
|
if (version === undefined || version.major === undefined) return defaultPackageVersion;
|
|
@@ -32134,6 +32177,29 @@ function $430e3eda76fa4d5f$export$46b1ae20f762ad4c(version) {
|
|
|
32134
32177
|
if (Number.isInteger(version.build) && version.build >= 0) validatedVersion += `.${version.build.toString()}`;
|
|
32135
32178
|
return validatedVersion;
|
|
32136
32179
|
}
|
|
32180
|
+
function $430e3eda76fa4d5f$var$loadScript(config) {
|
|
32181
|
+
if (document === undefined) {
|
|
32182
|
+
// eslint-disable-next-line no-console
|
|
32183
|
+
console.error("missing document object: please run Checkout client side");
|
|
32184
|
+
return;
|
|
32185
|
+
}
|
|
32186
|
+
const validVersion = $430e3eda76fa4d5f$export$46b1ae20f762ad4c(config?.version);
|
|
32187
|
+
// Prevent the script to be loaded more than once
|
|
32188
|
+
// by checking the presence of the script and its version.
|
|
32189
|
+
const initScript = document.querySelector('[data-product="checkout"]');
|
|
32190
|
+
if (initScript) {
|
|
32191
|
+
// eslint-disable-next-line no-console
|
|
32192
|
+
console.warn("checkout script has already been loaded, it can only be loaded once.");
|
|
32193
|
+
return;
|
|
32194
|
+
}
|
|
32195
|
+
const tag = document.createElement("script");
|
|
32196
|
+
let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout.js`;
|
|
32197
|
+
if (($d663162fd5a0853f$export$83bf90b30cdfd29f)()) cdnUrl = "http://localhost:3000/lib/js/imtbl-checkout.js";
|
|
32198
|
+
tag.setAttribute("data-product", "checkout");
|
|
32199
|
+
tag.setAttribute("data-version", validVersion);
|
|
32200
|
+
tag.setAttribute("src", cdnUrl);
|
|
32201
|
+
document.head.appendChild(tag);
|
|
32202
|
+
}
|
|
32137
32203
|
function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
32138
32204
|
if (window === undefined) {
|
|
32139
32205
|
// eslint-disable-next-line no-console
|
|
@@ -32145,21 +32211,45 @@ function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
|
32145
32211
|
console.error("missing document object: please run Checkout client side");
|
|
32146
32212
|
return;
|
|
32147
32213
|
}
|
|
32148
|
-
|
|
32149
|
-
|
|
32150
|
-
let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout.js`;
|
|
32151
|
-
if (($d663162fd5a0853f$export$83bf90b30cdfd29f)()) cdnUrl = "http://localhost:3000/lib/js/imtbl-checkout.js";
|
|
32152
|
-
checkoutWidgetJS.setAttribute("src", cdnUrl);
|
|
32153
|
-
document.head.appendChild(checkoutWidgetJS);
|
|
32154
|
-
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
32214
|
+
$430e3eda76fa4d5f$var$loadScript(config || {});
|
|
32215
|
+
$430e3eda76fa4d5f$var$saveConfig(config || {});
|
|
32155
32216
|
}
|
|
32156
32217
|
function $430e3eda76fa4d5f$export$bf1548ba7e61c17f(config) {
|
|
32157
32218
|
if (window === undefined) {
|
|
32219
|
+
// eslint-disable-next-line no-console
|
|
32220
|
+
console.error("missing window object: please run Checkout client side");
|
|
32221
|
+
return;
|
|
32222
|
+
}
|
|
32223
|
+
if (document === undefined) {
|
|
32158
32224
|
// eslint-disable-next-line no-console
|
|
32159
32225
|
console.error("missing document object: please run Checkout client side");
|
|
32160
32226
|
return;
|
|
32161
32227
|
}
|
|
32162
|
-
|
|
32228
|
+
let globalConfig = {};
|
|
32229
|
+
try {
|
|
32230
|
+
globalConfig = JSON.parse(window.ImtblCheckoutWidgetConfig);
|
|
32231
|
+
} catch (err) {
|
|
32232
|
+
// eslint-disable-next-line no-console
|
|
32233
|
+
console.warn("Unable to decode window.ImtblCheckoutWidgetConfig: ", err);
|
|
32234
|
+
}
|
|
32235
|
+
Object.values(($045213b18e9f1f94$export$75be0f6af9650f2c)).forEach((elem)=>{
|
|
32236
|
+
const widgets = document.getElementsByTagName(elem);
|
|
32237
|
+
if (!widgets) return;
|
|
32238
|
+
// Loop through all the widgets to ensure that the script
|
|
32239
|
+
// get the correct local configs for the DOM elements and
|
|
32240
|
+
// simply update the global configurations.
|
|
32241
|
+
for (const e of widgets){
|
|
32242
|
+
const widgetConf = $430e3eda76fa4d5f$var$getWidgetConfig(e) || {};
|
|
32243
|
+
$430e3eda76fa4d5f$var$setWidgetConfig(e, {
|
|
32244
|
+
...widgetConf,
|
|
32245
|
+
...config
|
|
32246
|
+
});
|
|
32247
|
+
}
|
|
32248
|
+
});
|
|
32249
|
+
$430e3eda76fa4d5f$var$saveConfig({
|
|
32250
|
+
...globalConfig,
|
|
32251
|
+
...config
|
|
32252
|
+
});
|
|
32163
32253
|
}
|
|
32164
32254
|
|
|
32165
32255
|
|
|
@@ -32266,27 +32356,6 @@ $parcel$export($d882ddc5600b1284$exports, "OnRampEventType", () => $d882ddc5600b
|
|
|
32266
32356
|
OnRampEventType["SUCCESS"] = "success";
|
|
32267
32357
|
OnRampEventType["FAILURE"] = "failure";
|
|
32268
32358
|
})($d882ddc5600b1284$export$66ec39c0924078d8 || ($d882ddc5600b1284$export$66ec39c0924078d8 = {}));
|
|
32269
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
32270
|
-
|
|
32271
|
-
var $045213b18e9f1f94$exports = {};
|
|
32272
|
-
|
|
32273
|
-
$parcel$export($045213b18e9f1f94$exports, "WidgetTheme", () => $045213b18e9f1f94$export$c88931fdc51854eb);
|
|
32274
|
-
$parcel$export($045213b18e9f1f94$exports, "CheckoutWidgetTagNames", () => $045213b18e9f1f94$export$75be0f6af9650f2c);
|
|
32275
|
-
/**
|
|
32276
|
-
* Enum representing the themes for the Checkout widgets.
|
|
32277
|
-
*/ var $045213b18e9f1f94$export$c88931fdc51854eb;
|
|
32278
|
-
(function(WidgetTheme) {
|
|
32279
|
-
WidgetTheme["LIGHT"] = "light";
|
|
32280
|
-
WidgetTheme["DARK"] = "dark";
|
|
32281
|
-
})($045213b18e9f1f94$export$c88931fdc51854eb || ($045213b18e9f1f94$export$c88931fdc51854eb = {}));
|
|
32282
|
-
var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
32283
|
-
(function(CheckoutWidgetTagNames) {
|
|
32284
|
-
CheckoutWidgetTagNames["CONNECT"] = "imtbl-connect";
|
|
32285
|
-
CheckoutWidgetTagNames["WALLET"] = "imtbl-wallet";
|
|
32286
|
-
CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
|
|
32287
|
-
CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
|
|
32288
|
-
CheckoutWidgetTagNames["ONRAMP"] = "imtbl-onramp";
|
|
32289
|
-
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
32290
32359
|
|
|
32291
32360
|
|
|
32292
32361
|
var $1f969328e5988c99$exports = {};
|
package/dist/index.d.ts
CHANGED
|
@@ -30214,7 +30214,7 @@ declare function CheckoutWidgets(config?: CheckoutWidgetsConfig): void;
|
|
|
30214
30214
|
/**
|
|
30215
30215
|
* Updates the configuration for the checkout widgets by setting the global variable
|
|
30216
30216
|
* `window.ImtblCheckoutWidgetConfig` to the JSON string representation of the given
|
|
30217
|
-
* `config` object.
|
|
30217
|
+
* `config` object and update all the Checkout web components configuration.
|
|
30218
30218
|
* @param {CheckoutWidgetsConfig} config - The new configuration object for the checkout widgets.
|
|
30219
30219
|
* @returns None
|
|
30220
30220
|
*/
|
package/dist/index.js
CHANGED
|
@@ -2987,7 +2987,7 @@ class MultiRollupApiClients {
|
|
|
2987
2987
|
}
|
|
2988
2988
|
|
|
2989
2989
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2990
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.
|
|
2990
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.23.0-alpha' };
|
|
2991
2991
|
const createConfig = ({ basePath, headers, }) => {
|
|
2992
2992
|
if (!basePath.trim()) {
|
|
2993
2993
|
throw Error('basePath can not be empty');
|
|
@@ -3047,7 +3047,7 @@ class APIError extends Error {
|
|
|
3047
3047
|
|
|
3048
3048
|
/* eslint-disable implicit-arrow-linebreak */
|
|
3049
3049
|
const defaultHeaders = {
|
|
3050
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.
|
|
3050
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.23.0-alpha',
|
|
3051
3051
|
};
|
|
3052
3052
|
/**
|
|
3053
3053
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -3333,7 +3333,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
3333
3333
|
chainID,
|
|
3334
3334
|
coreContractAddress,
|
|
3335
3335
|
registrationContractAddress,
|
|
3336
|
-
sdkVersion: 'ts-immutable-sdk-0.
|
|
3336
|
+
sdkVersion: 'ts-immutable-sdk-0.23.0-alpha',
|
|
3337
3337
|
});
|
|
3338
3338
|
/**
|
|
3339
3339
|
* Sets `sdkVersion` at the time of build
|
|
@@ -32086,11 +32086,54 @@ var checkout_sdk = /*#__PURE__*/Object.freeze({
|
|
|
32086
32086
|
function $parcel$export(e, n, v, s) {
|
|
32087
32087
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
32088
32088
|
}
|
|
32089
|
-
|
|
32089
|
+
var $045213b18e9f1f94$exports = {};
|
|
32090
|
+
|
|
32091
|
+
$parcel$export($045213b18e9f1f94$exports, "WidgetTheme", () => $045213b18e9f1f94$export$c88931fdc51854eb);
|
|
32092
|
+
$parcel$export($045213b18e9f1f94$exports, "CheckoutWidgetTagNames", () => $045213b18e9f1f94$export$75be0f6af9650f2c);
|
|
32093
|
+
/**
|
|
32094
|
+
* Enum representing the themes for the Checkout widgets.
|
|
32095
|
+
*/ var $045213b18e9f1f94$export$c88931fdc51854eb;
|
|
32096
|
+
(function(WidgetTheme) {
|
|
32097
|
+
WidgetTheme["LIGHT"] = "light";
|
|
32098
|
+
WidgetTheme["DARK"] = "dark";
|
|
32099
|
+
})($045213b18e9f1f94$export$c88931fdc51854eb || ($045213b18e9f1f94$export$c88931fdc51854eb = {}));
|
|
32100
|
+
var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
32101
|
+
(function(CheckoutWidgetTagNames) {
|
|
32102
|
+
CheckoutWidgetTagNames["CONNECT"] = "imtbl-connect";
|
|
32103
|
+
CheckoutWidgetTagNames["WALLET"] = "imtbl-wallet";
|
|
32104
|
+
CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
|
|
32105
|
+
CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
|
|
32106
|
+
CheckoutWidgetTagNames["ONRAMP"] = "imtbl-onramp";
|
|
32107
|
+
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
32108
|
+
|
|
32109
|
+
|
|
32110
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.23.0-alpha";
|
|
32090
32111
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
32091
32112
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
32092
32113
|
|
|
32093
32114
|
|
|
32115
|
+
function $430e3eda76fa4d5f$var$getWidgetConfig(element) {
|
|
32116
|
+
const config = element.getAttribute("widgetconfig");
|
|
32117
|
+
if (!config) return null;
|
|
32118
|
+
try {
|
|
32119
|
+
return JSON.parse(config);
|
|
32120
|
+
} catch (err) {
|
|
32121
|
+
// eslint-disable-next-line no-console
|
|
32122
|
+
console.warn(`Unable to decode widgetconfig for ${element}: `, err);
|
|
32123
|
+
}
|
|
32124
|
+
return null;
|
|
32125
|
+
}
|
|
32126
|
+
function $430e3eda76fa4d5f$var$setWidgetConfig(element, config) {
|
|
32127
|
+
element.setAttribute("widgetconfig", JSON.stringify(config));
|
|
32128
|
+
}
|
|
32129
|
+
function $430e3eda76fa4d5f$var$saveConfig(config) {
|
|
32130
|
+
if (window === undefined) {
|
|
32131
|
+
// eslint-disable-next-line no-console
|
|
32132
|
+
console.error("missing window object: please run Checkout client side");
|
|
32133
|
+
return;
|
|
32134
|
+
}
|
|
32135
|
+
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
32136
|
+
}
|
|
32094
32137
|
function $430e3eda76fa4d5f$export$46b1ae20f762ad4c(version) {
|
|
32095
32138
|
const defaultPackageVersion = ($d663162fd5a0853f$export$1169f5475725171b)();
|
|
32096
32139
|
if (version === undefined || version.major === undefined) return defaultPackageVersion;
|
|
@@ -32112,6 +32155,29 @@ function $430e3eda76fa4d5f$export$46b1ae20f762ad4c(version) {
|
|
|
32112
32155
|
if (Number.isInteger(version.build) && version.build >= 0) validatedVersion += `.${version.build.toString()}`;
|
|
32113
32156
|
return validatedVersion;
|
|
32114
32157
|
}
|
|
32158
|
+
function $430e3eda76fa4d5f$var$loadScript(config) {
|
|
32159
|
+
if (document === undefined) {
|
|
32160
|
+
// eslint-disable-next-line no-console
|
|
32161
|
+
console.error("missing document object: please run Checkout client side");
|
|
32162
|
+
return;
|
|
32163
|
+
}
|
|
32164
|
+
const validVersion = $430e3eda76fa4d5f$export$46b1ae20f762ad4c(config?.version);
|
|
32165
|
+
// Prevent the script to be loaded more than once
|
|
32166
|
+
// by checking the presence of the script and its version.
|
|
32167
|
+
const initScript = document.querySelector('[data-product="checkout"]');
|
|
32168
|
+
if (initScript) {
|
|
32169
|
+
// eslint-disable-next-line no-console
|
|
32170
|
+
console.warn("checkout script has already been loaded, it can only be loaded once.");
|
|
32171
|
+
return;
|
|
32172
|
+
}
|
|
32173
|
+
const tag = document.createElement("script");
|
|
32174
|
+
let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout.js`;
|
|
32175
|
+
if (($d663162fd5a0853f$export$83bf90b30cdfd29f)()) cdnUrl = "http://localhost:3000/lib/js/imtbl-checkout.js";
|
|
32176
|
+
tag.setAttribute("data-product", "checkout");
|
|
32177
|
+
tag.setAttribute("data-version", validVersion);
|
|
32178
|
+
tag.setAttribute("src", cdnUrl);
|
|
32179
|
+
document.head.appendChild(tag);
|
|
32180
|
+
}
|
|
32115
32181
|
function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
32116
32182
|
if (window === undefined) {
|
|
32117
32183
|
// eslint-disable-next-line no-console
|
|
@@ -32123,21 +32189,45 @@ function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
|
32123
32189
|
console.error("missing document object: please run Checkout client side");
|
|
32124
32190
|
return;
|
|
32125
32191
|
}
|
|
32126
|
-
|
|
32127
|
-
|
|
32128
|
-
let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout.js`;
|
|
32129
|
-
if (($d663162fd5a0853f$export$83bf90b30cdfd29f)()) cdnUrl = "http://localhost:3000/lib/js/imtbl-checkout.js";
|
|
32130
|
-
checkoutWidgetJS.setAttribute("src", cdnUrl);
|
|
32131
|
-
document.head.appendChild(checkoutWidgetJS);
|
|
32132
|
-
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
32192
|
+
$430e3eda76fa4d5f$var$loadScript(config || {});
|
|
32193
|
+
$430e3eda76fa4d5f$var$saveConfig(config || {});
|
|
32133
32194
|
}
|
|
32134
32195
|
function $430e3eda76fa4d5f$export$bf1548ba7e61c17f(config) {
|
|
32135
32196
|
if (window === undefined) {
|
|
32197
|
+
// eslint-disable-next-line no-console
|
|
32198
|
+
console.error("missing window object: please run Checkout client side");
|
|
32199
|
+
return;
|
|
32200
|
+
}
|
|
32201
|
+
if (document === undefined) {
|
|
32136
32202
|
// eslint-disable-next-line no-console
|
|
32137
32203
|
console.error("missing document object: please run Checkout client side");
|
|
32138
32204
|
return;
|
|
32139
32205
|
}
|
|
32140
|
-
|
|
32206
|
+
let globalConfig = {};
|
|
32207
|
+
try {
|
|
32208
|
+
globalConfig = JSON.parse(window.ImtblCheckoutWidgetConfig);
|
|
32209
|
+
} catch (err) {
|
|
32210
|
+
// eslint-disable-next-line no-console
|
|
32211
|
+
console.warn("Unable to decode window.ImtblCheckoutWidgetConfig: ", err);
|
|
32212
|
+
}
|
|
32213
|
+
Object.values(($045213b18e9f1f94$export$75be0f6af9650f2c)).forEach((elem)=>{
|
|
32214
|
+
const widgets = document.getElementsByTagName(elem);
|
|
32215
|
+
if (!widgets) return;
|
|
32216
|
+
// Loop through all the widgets to ensure that the script
|
|
32217
|
+
// get the correct local configs for the DOM elements and
|
|
32218
|
+
// simply update the global configurations.
|
|
32219
|
+
for (const e of widgets){
|
|
32220
|
+
const widgetConf = $430e3eda76fa4d5f$var$getWidgetConfig(e) || {};
|
|
32221
|
+
$430e3eda76fa4d5f$var$setWidgetConfig(e, {
|
|
32222
|
+
...widgetConf,
|
|
32223
|
+
...config
|
|
32224
|
+
});
|
|
32225
|
+
}
|
|
32226
|
+
});
|
|
32227
|
+
$430e3eda76fa4d5f$var$saveConfig({
|
|
32228
|
+
...globalConfig,
|
|
32229
|
+
...config
|
|
32230
|
+
});
|
|
32141
32231
|
}
|
|
32142
32232
|
|
|
32143
32233
|
|
|
@@ -32244,27 +32334,6 @@ $parcel$export($d882ddc5600b1284$exports, "OnRampEventType", () => $d882ddc5600b
|
|
|
32244
32334
|
OnRampEventType["SUCCESS"] = "success";
|
|
32245
32335
|
OnRampEventType["FAILURE"] = "failure";
|
|
32246
32336
|
})($d882ddc5600b1284$export$66ec39c0924078d8 || ($d882ddc5600b1284$export$66ec39c0924078d8 = {}));
|
|
32247
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
32248
|
-
|
|
32249
|
-
var $045213b18e9f1f94$exports = {};
|
|
32250
|
-
|
|
32251
|
-
$parcel$export($045213b18e9f1f94$exports, "WidgetTheme", () => $045213b18e9f1f94$export$c88931fdc51854eb);
|
|
32252
|
-
$parcel$export($045213b18e9f1f94$exports, "CheckoutWidgetTagNames", () => $045213b18e9f1f94$export$75be0f6af9650f2c);
|
|
32253
|
-
/**
|
|
32254
|
-
* Enum representing the themes for the Checkout widgets.
|
|
32255
|
-
*/ var $045213b18e9f1f94$export$c88931fdc51854eb;
|
|
32256
|
-
(function(WidgetTheme) {
|
|
32257
|
-
WidgetTheme["LIGHT"] = "light";
|
|
32258
|
-
WidgetTheme["DARK"] = "dark";
|
|
32259
|
-
})($045213b18e9f1f94$export$c88931fdc51854eb || ($045213b18e9f1f94$export$c88931fdc51854eb = {}));
|
|
32260
|
-
var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
32261
|
-
(function(CheckoutWidgetTagNames) {
|
|
32262
|
-
CheckoutWidgetTagNames["CONNECT"] = "imtbl-connect";
|
|
32263
|
-
CheckoutWidgetTagNames["WALLET"] = "imtbl-wallet";
|
|
32264
|
-
CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
|
|
32265
|
-
CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
|
|
32266
|
-
CheckoutWidgetTagNames["ONRAMP"] = "imtbl-onramp";
|
|
32267
|
-
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
32268
32337
|
|
|
32269
32338
|
|
|
32270
32339
|
var $1f969328e5988c99$exports = {};
|
package/dist/passport.js
CHANGED
|
@@ -1785,7 +1785,7 @@ class MultiRollupApiClients {
|
|
|
1785
1785
|
}
|
|
1786
1786
|
|
|
1787
1787
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1788
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.
|
|
1788
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.23.0-alpha' };
|
|
1789
1789
|
const createConfig = ({ basePath, headers, }) => {
|
|
1790
1790
|
if (!basePath.trim()) {
|
|
1791
1791
|
throw Error('basePath can not be empty');
|
|
@@ -1841,7 +1841,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
1841
1841
|
chainID,
|
|
1842
1842
|
coreContractAddress,
|
|
1843
1843
|
registrationContractAddress,
|
|
1844
|
-
sdkVersion: 'ts-immutable-sdk-0.
|
|
1844
|
+
sdkVersion: 'ts-immutable-sdk-0.23.0-alpha',
|
|
1845
1845
|
});
|
|
1846
1846
|
/**
|
|
1847
1847
|
* Sets `sdkVersion` at the time of build
|
package/package.json
CHANGED