@imtbl/sdk 0.22.3 → 0.23.1
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.d.ts +19 -41
- package/dist/checkout_sdk.js +2 -2
- 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 +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +104 -33
- package/dist/index.d.ts +66 -59
- package/dist/index.js +104 -33
- package/dist/passport.js +2 -2
- package/package.json +1 -1
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.1' };
|
|
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.1',
|
|
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.1',
|
|
3337
3337
|
});
|
|
3338
3338
|
/**
|
|
3339
3339
|
* Sets `sdkVersion` at the time of build
|
|
@@ -32073,10 +32073,12 @@ var checkout_sdk = /*#__PURE__*/Object.freeze({
|
|
|
32073
32073
|
get CheckoutErrorType () { return $a8bc256d81a5e2c1$export$e3dc0620abde7f5a; },
|
|
32074
32074
|
get CheckoutStatus () { return $4b58188d47aafe8d$export$de7bcda3c490bf18; },
|
|
32075
32075
|
get ExchangeType () { return $e055e79256bbc1dd$export$80f4da0d409a629d; },
|
|
32076
|
+
get FundingStepType () { return $4b58188d47aafe8d$export$6fbaa98ee06d03e8; },
|
|
32076
32077
|
get GasEstimateType () { return $de275b98d2b651c3$export$788b1fd17f3dad84; },
|
|
32077
32078
|
get GasTokenType () { return $4b58188d47aafe8d$export$537fa3efd10ed435; },
|
|
32078
32079
|
get ItemType () { return $4b58188d47aafe8d$export$1fc8f52ad1810e52; },
|
|
32079
32080
|
get NetworkFilterTypes () { return $a47e48dd2c04791b$export$1f05a55fe0680cc7; },
|
|
32081
|
+
get RoutingOutcomeType () { return $4b58188d47aafe8d$export$d0616bd3e995b8be; },
|
|
32080
32082
|
get TokenFilterTypes () { return $08d5ddc39acd6833$export$fd9b17d87f4121d2; },
|
|
32081
32083
|
get TransactionOrGasType () { return $4b58188d47aafe8d$export$65c64e46348ee3c1; },
|
|
32082
32084
|
get WalletFilterTypes () { return $4f91c5f280efe242$export$a75605c67ea83a5a; },
|
|
@@ -32086,11 +32088,54 @@ var checkout_sdk = /*#__PURE__*/Object.freeze({
|
|
|
32086
32088
|
function $parcel$export(e, n, v, s) {
|
|
32087
32089
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
32088
32090
|
}
|
|
32089
|
-
|
|
32091
|
+
var $045213b18e9f1f94$exports = {};
|
|
32092
|
+
|
|
32093
|
+
$parcel$export($045213b18e9f1f94$exports, "WidgetTheme", () => $045213b18e9f1f94$export$c88931fdc51854eb);
|
|
32094
|
+
$parcel$export($045213b18e9f1f94$exports, "CheckoutWidgetTagNames", () => $045213b18e9f1f94$export$75be0f6af9650f2c);
|
|
32095
|
+
/**
|
|
32096
|
+
* Enum representing the themes for the Checkout widgets.
|
|
32097
|
+
*/ var $045213b18e9f1f94$export$c88931fdc51854eb;
|
|
32098
|
+
(function(WidgetTheme) {
|
|
32099
|
+
WidgetTheme["LIGHT"] = "light";
|
|
32100
|
+
WidgetTheme["DARK"] = "dark";
|
|
32101
|
+
})($045213b18e9f1f94$export$c88931fdc51854eb || ($045213b18e9f1f94$export$c88931fdc51854eb = {}));
|
|
32102
|
+
var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
32103
|
+
(function(CheckoutWidgetTagNames) {
|
|
32104
|
+
CheckoutWidgetTagNames["CONNECT"] = "imtbl-connect";
|
|
32105
|
+
CheckoutWidgetTagNames["WALLET"] = "imtbl-wallet";
|
|
32106
|
+
CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
|
|
32107
|
+
CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
|
|
32108
|
+
CheckoutWidgetTagNames["ONRAMP"] = "imtbl-onramp";
|
|
32109
|
+
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
32110
|
+
|
|
32111
|
+
|
|
32112
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.23.1";
|
|
32090
32113
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
32091
32114
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
32092
32115
|
|
|
32093
32116
|
|
|
32117
|
+
function $430e3eda76fa4d5f$var$getWidgetConfig(element) {
|
|
32118
|
+
const config = element.getAttribute("widgetconfig");
|
|
32119
|
+
if (!config) return null;
|
|
32120
|
+
try {
|
|
32121
|
+
return JSON.parse(config);
|
|
32122
|
+
} catch (err) {
|
|
32123
|
+
// eslint-disable-next-line no-console
|
|
32124
|
+
console.warn(`Unable to decode widgetconfig for ${element}: `, err);
|
|
32125
|
+
}
|
|
32126
|
+
return null;
|
|
32127
|
+
}
|
|
32128
|
+
function $430e3eda76fa4d5f$var$setWidgetConfig(element, config) {
|
|
32129
|
+
element.setAttribute("widgetconfig", JSON.stringify(config));
|
|
32130
|
+
}
|
|
32131
|
+
function $430e3eda76fa4d5f$var$saveConfig(config) {
|
|
32132
|
+
if (window === undefined) {
|
|
32133
|
+
// eslint-disable-next-line no-console
|
|
32134
|
+
console.error("missing window object: please run Checkout client side");
|
|
32135
|
+
return;
|
|
32136
|
+
}
|
|
32137
|
+
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
32138
|
+
}
|
|
32094
32139
|
function $430e3eda76fa4d5f$export$46b1ae20f762ad4c(version) {
|
|
32095
32140
|
const defaultPackageVersion = ($d663162fd5a0853f$export$1169f5475725171b)();
|
|
32096
32141
|
if (version === undefined || version.major === undefined) return defaultPackageVersion;
|
|
@@ -32112,6 +32157,29 @@ function $430e3eda76fa4d5f$export$46b1ae20f762ad4c(version) {
|
|
|
32112
32157
|
if (Number.isInteger(version.build) && version.build >= 0) validatedVersion += `.${version.build.toString()}`;
|
|
32113
32158
|
return validatedVersion;
|
|
32114
32159
|
}
|
|
32160
|
+
function $430e3eda76fa4d5f$var$loadScript(config) {
|
|
32161
|
+
if (document === undefined) {
|
|
32162
|
+
// eslint-disable-next-line no-console
|
|
32163
|
+
console.error("missing document object: please run Checkout client side");
|
|
32164
|
+
return;
|
|
32165
|
+
}
|
|
32166
|
+
const validVersion = $430e3eda76fa4d5f$export$46b1ae20f762ad4c(config?.version);
|
|
32167
|
+
// Prevent the script to be loaded more than once
|
|
32168
|
+
// by checking the presence of the script and its version.
|
|
32169
|
+
const initScript = document.querySelector('[data-product="checkout"]');
|
|
32170
|
+
if (initScript) {
|
|
32171
|
+
// eslint-disable-next-line no-console
|
|
32172
|
+
console.warn("checkout script has already been loaded, it can only be loaded once.");
|
|
32173
|
+
return;
|
|
32174
|
+
}
|
|
32175
|
+
const tag = document.createElement("script");
|
|
32176
|
+
let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout.js`;
|
|
32177
|
+
if (($d663162fd5a0853f$export$83bf90b30cdfd29f)()) cdnUrl = "http://localhost:3000/lib/js/imtbl-checkout.js";
|
|
32178
|
+
tag.setAttribute("data-product", "checkout");
|
|
32179
|
+
tag.setAttribute("data-version", validVersion);
|
|
32180
|
+
tag.setAttribute("src", cdnUrl);
|
|
32181
|
+
document.head.appendChild(tag);
|
|
32182
|
+
}
|
|
32115
32183
|
function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
32116
32184
|
if (window === undefined) {
|
|
32117
32185
|
// eslint-disable-next-line no-console
|
|
@@ -32123,21 +32191,45 @@ function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
|
32123
32191
|
console.error("missing document object: please run Checkout client side");
|
|
32124
32192
|
return;
|
|
32125
32193
|
}
|
|
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);
|
|
32194
|
+
$430e3eda76fa4d5f$var$loadScript(config || {});
|
|
32195
|
+
$430e3eda76fa4d5f$var$saveConfig(config || {});
|
|
32133
32196
|
}
|
|
32134
32197
|
function $430e3eda76fa4d5f$export$bf1548ba7e61c17f(config) {
|
|
32135
32198
|
if (window === undefined) {
|
|
32199
|
+
// eslint-disable-next-line no-console
|
|
32200
|
+
console.error("missing window object: please run Checkout client side");
|
|
32201
|
+
return;
|
|
32202
|
+
}
|
|
32203
|
+
if (document === undefined) {
|
|
32136
32204
|
// eslint-disable-next-line no-console
|
|
32137
32205
|
console.error("missing document object: please run Checkout client side");
|
|
32138
32206
|
return;
|
|
32139
32207
|
}
|
|
32140
|
-
|
|
32208
|
+
let globalConfig = {};
|
|
32209
|
+
try {
|
|
32210
|
+
globalConfig = JSON.parse(window.ImtblCheckoutWidgetConfig);
|
|
32211
|
+
} catch (err) {
|
|
32212
|
+
// eslint-disable-next-line no-console
|
|
32213
|
+
console.warn("Unable to decode window.ImtblCheckoutWidgetConfig: ", err);
|
|
32214
|
+
}
|
|
32215
|
+
Object.values(($045213b18e9f1f94$export$75be0f6af9650f2c)).forEach((elem)=>{
|
|
32216
|
+
const widgets = document.getElementsByTagName(elem);
|
|
32217
|
+
if (!widgets) return;
|
|
32218
|
+
// Loop through all the widgets to ensure that the script
|
|
32219
|
+
// get the correct local configs for the DOM elements and
|
|
32220
|
+
// simply update the global configurations.
|
|
32221
|
+
for (const e of widgets){
|
|
32222
|
+
const widgetConf = $430e3eda76fa4d5f$var$getWidgetConfig(e) || {};
|
|
32223
|
+
$430e3eda76fa4d5f$var$setWidgetConfig(e, {
|
|
32224
|
+
...widgetConf,
|
|
32225
|
+
...config
|
|
32226
|
+
});
|
|
32227
|
+
}
|
|
32228
|
+
});
|
|
32229
|
+
$430e3eda76fa4d5f$var$saveConfig({
|
|
32230
|
+
...globalConfig,
|
|
32231
|
+
...config
|
|
32232
|
+
});
|
|
32141
32233
|
}
|
|
32142
32234
|
|
|
32143
32235
|
|
|
@@ -32244,27 +32336,6 @@ $parcel$export($d882ddc5600b1284$exports, "OnRampEventType", () => $d882ddc5600b
|
|
|
32244
32336
|
OnRampEventType["SUCCESS"] = "success";
|
|
32245
32337
|
OnRampEventType["FAILURE"] = "failure";
|
|
32246
32338
|
})($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
32339
|
|
|
32269
32340
|
|
|
32270
32341
|
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.1' };
|
|
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.1',
|
|
1845
1845
|
});
|
|
1846
1846
|
/**
|
|
1847
1847
|
* Sets `sdkVersion` at the time of build
|
package/package.json
CHANGED