@imtbl/sdk 0.1.5-alpha → 0.1.6-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/checkout_widgets.d.ts +312 -16
- package/dist/checkout_widgets.js +83 -51
- package/dist/immutablex_client.js +2 -2
- package/dist/index.cjs +82 -50
- package/dist/index.d.ts +284 -16
- package/dist/index.js +85 -53
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/checkout_widgets.js
CHANGED
|
@@ -7,13 +7,16 @@ function $parcel$export(e, n, v, s) {
|
|
|
7
7
|
var $207ed853f11d19d5$exports = {};
|
|
8
8
|
|
|
9
9
|
$parcel$export($207ed853f11d19d5$exports, "IMTBLWidgetEvents", () => $207ed853f11d19d5$export$5a0ace85cae72d45);
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Enum representing the events emitted by the widgets.
|
|
12
|
+
*/ let $207ed853f11d19d5$export$5a0ace85cae72d45;
|
|
11
13
|
(function(IMTBLWidgetEvents) {
|
|
12
14
|
IMTBLWidgetEvents["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
|
|
13
15
|
IMTBLWidgetEvents["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
|
|
14
16
|
IMTBLWidgetEvents["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
|
|
15
17
|
IMTBLWidgetEvents["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
|
|
16
18
|
IMTBLWidgetEvents["IMTBL_BUY_WIDGET_EVENT"] = "imtbl-buy-widget";
|
|
19
|
+
IMTBLWidgetEvents["IMTBL_ONRAMP_WIDGET_EVENT"] = "imtbl-onramp-widget";
|
|
17
20
|
})($207ed853f11d19d5$export$5a0ace85cae72d45 || ($207ed853f11d19d5$export$5a0ace85cae72d45 = {}));
|
|
18
21
|
|
|
19
22
|
|
|
@@ -31,18 +34,25 @@ let $a85ecdbd885c58ad$export$e72e7f9969a47dd3;
|
|
|
31
34
|
var $77b6aac5c353d4a9$exports = {};
|
|
32
35
|
|
|
33
36
|
$parcel$export($77b6aac5c353d4a9$exports, "WalletEventType", () => $77b6aac5c353d4a9$export$d9be06b70b28c742);
|
|
34
|
-
//wallet widget events
|
|
35
37
|
let $77b6aac5c353d4a9$export$d9be06b70b28c742;
|
|
36
38
|
(function(WalletEventType) {
|
|
37
39
|
WalletEventType["CLOSE_WIDGET"] = "close-widget";
|
|
38
40
|
WalletEventType["NETWORK_SWITCH"] = "network-switch";
|
|
41
|
+
WalletEventType["ADD_COINS"] = "add-coins";
|
|
42
|
+
WalletEventType["REQUEST_SWAP"] = "request-swap";
|
|
43
|
+
WalletEventType["REQUEST_BRIDGE"] = "request-bridge";
|
|
44
|
+
WalletEventType["REQUEST_ONRAMP"] = "request-onramp";
|
|
39
45
|
})($77b6aac5c353d4a9$export$d9be06b70b28c742 || ($77b6aac5c353d4a9$export$d9be06b70b28c742 = {}));
|
|
40
46
|
|
|
41
47
|
|
|
42
48
|
var $53d219e7f6bf0cd6$exports = {};
|
|
43
49
|
|
|
44
50
|
$parcel$export($53d219e7f6bf0cd6$exports, "SwapEventType", () => $53d219e7f6bf0cd6$export$140a49745ab55563);
|
|
45
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Represents an event object emitted by the Swap Widget.
|
|
53
|
+
* @property {SwapEventType} type - The type of the event.
|
|
54
|
+
* @property {T} data - The data contained in the event.
|
|
55
|
+
*/ let $53d219e7f6bf0cd6$export$140a49745ab55563;
|
|
46
56
|
(function(SwapEventType) {
|
|
47
57
|
SwapEventType["SUCCESS"] = "success";
|
|
48
58
|
SwapEventType["FAILURE"] = "failure";
|
|
@@ -52,7 +62,11 @@ let $53d219e7f6bf0cd6$export$140a49745ab55563;
|
|
|
52
62
|
var $15cc9e120aa6f3bf$exports = {};
|
|
53
63
|
|
|
54
64
|
$parcel$export($15cc9e120aa6f3bf$exports, "BridgeEventType", () => $15cc9e120aa6f3bf$export$d1bfa21f7c76447a);
|
|
55
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Represents an event object emitted by the Bridge Widget.
|
|
67
|
+
* @property {BridgeEventType} type - The type of the event.
|
|
68
|
+
* @property {T} data - The data associated with the event.
|
|
69
|
+
*/ let $15cc9e120aa6f3bf$export$d1bfa21f7c76447a;
|
|
56
70
|
(function(BridgeEventType) {
|
|
57
71
|
BridgeEventType["CLOSE_WIDGET"] = "close-widget";
|
|
58
72
|
BridgeEventType["SUCCESS"] = "success";
|
|
@@ -63,7 +77,11 @@ let $15cc9e120aa6f3bf$export$d1bfa21f7c76447a;
|
|
|
63
77
|
var $98cbcca465beec95$exports = {};
|
|
64
78
|
|
|
65
79
|
$parcel$export($98cbcca465beec95$exports, "BuyEventType", () => $98cbcca465beec95$export$90db5fe1be5993c1);
|
|
66
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Represents an event object emitted by the Buy Widget.
|
|
82
|
+
* @property {BuyEventType} type - The type of the event.
|
|
83
|
+
* @property {T} data - The data contained in the event.
|
|
84
|
+
*/ let $98cbcca465beec95$export$90db5fe1be5993c1;
|
|
67
85
|
(function(BuyEventType) {
|
|
68
86
|
BuyEventType["SUCCESS"] = "success";
|
|
69
87
|
BuyEventType["FAILURE"] = "failure";
|
|
@@ -72,13 +90,22 @@ let $98cbcca465beec95$export$90db5fe1be5993c1;
|
|
|
72
90
|
})($98cbcca465beec95$export$90db5fe1be5993c1 || ($98cbcca465beec95$export$90db5fe1be5993c1 = {}));
|
|
73
91
|
|
|
74
92
|
|
|
93
|
+
var $66ceef112c0ee49e$exports = {};
|
|
94
|
+
|
|
95
|
+
$parcel$export($66ceef112c0ee49e$exports, "OnRampEventType", () => $66ceef112c0ee49e$export$66ec39c0924078d8);
|
|
96
|
+
let $66ceef112c0ee49e$export$66ec39c0924078d8;
|
|
97
|
+
$66ceef112c0ee49e$export$66ec39c0924078d8 || ($66ceef112c0ee49e$export$66ec39c0924078d8 = {});
|
|
98
|
+
|
|
99
|
+
|
|
75
100
|
var $14d7a2bbb79e0dae$exports = {};
|
|
76
101
|
|
|
77
102
|
$parcel$export($14d7a2bbb79e0dae$exports, "Network", () => $14d7a2bbb79e0dae$export$95be4ae94445245a);
|
|
78
103
|
$parcel$export($14d7a2bbb79e0dae$exports, "WidgetTheme", () => $14d7a2bbb79e0dae$export$c88931fdc51854eb);
|
|
79
104
|
$parcel$export($14d7a2bbb79e0dae$exports, "WidgetConnectionProviders", () => $14d7a2bbb79e0dae$export$2f61dde3bdc320cb);
|
|
80
105
|
$parcel$export($14d7a2bbb79e0dae$exports, "CheckoutWidgetTagNames", () => $14d7a2bbb79e0dae$export$75be0f6af9650f2c);
|
|
81
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Enum representing the networks supported by Checkout.
|
|
108
|
+
*/ let $14d7a2bbb79e0dae$export$95be4ae94445245a;
|
|
82
109
|
(function(Network) {
|
|
83
110
|
Network["ETHEREUM"] = "Ethereum";
|
|
84
111
|
Network["GOERLI"] = "Goerli";
|
|
@@ -101,7 +128,7 @@ let $14d7a2bbb79e0dae$export$75be0f6af9650f2c;
|
|
|
101
128
|
CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
|
|
102
129
|
CheckoutWidgetTagNames["BUY"] = "imtbl-buy";
|
|
103
130
|
CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
|
|
104
|
-
CheckoutWidgetTagNames["
|
|
131
|
+
CheckoutWidgetTagNames["EXAMPLE"] = "imtbl-example";
|
|
105
132
|
})($14d7a2bbb79e0dae$export$75be0f6af9650f2c || ($14d7a2bbb79e0dae$export$75be0f6af9650f2c = {}));
|
|
106
133
|
|
|
107
134
|
|
|
@@ -141,47 +168,6 @@ function $f22931ca9e2f35b6$export$d13582032b79b401(props) {
|
|
|
141
168
|
}
|
|
142
169
|
|
|
143
170
|
|
|
144
|
-
var $fa90757d8d7a0962$exports = {};
|
|
145
|
-
|
|
146
|
-
$parcel$export($fa90757d8d7a0962$exports, "CheckoutWidgets", () => $fa90757d8d7a0962$export$af210a0808087845);
|
|
147
|
-
$parcel$export($fa90757d8d7a0962$exports, "UpdateConfig", () => $fa90757d8d7a0962$export$bf1548ba7e61c17f);
|
|
148
|
-
$parcel$export($fa90757d8d7a0962$exports, "SetProvider", () => $fa90757d8d7a0962$export$931068bc678f0d73);
|
|
149
|
-
function $fa90757d8d7a0962$export$af210a0808087845(config) {
|
|
150
|
-
var checkoutWidgetJS = document.createElement("script");
|
|
151
|
-
checkoutWidgetJS.setAttribute("src", "http://localhost:3000/lib/js/imtbl-checkout.js");
|
|
152
|
-
document.head.appendChild(checkoutWidgetJS);
|
|
153
|
-
window.ImtblCheckoutWidgetConfig = config;
|
|
154
|
-
}
|
|
155
|
-
function $fa90757d8d7a0962$export$bf1548ba7e61c17f(config) {
|
|
156
|
-
window.ImtblCheckoutWidgetConfig = config;
|
|
157
|
-
}
|
|
158
|
-
function $fa90757d8d7a0962$export$931068bc678f0d73(tagName, provider) {
|
|
159
|
-
if (!provider) {
|
|
160
|
-
console.error("no provider parsed");
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
const elements = document.getElementsByTagName(tagName);
|
|
164
|
-
const widget = elements[0];
|
|
165
|
-
let attempts = 0;
|
|
166
|
-
const maxAttempts = 10;
|
|
167
|
-
let timer;
|
|
168
|
-
const attemptToSetProvider = ()=>{
|
|
169
|
-
try {
|
|
170
|
-
widget.setProvider(provider);
|
|
171
|
-
window.clearInterval(timer);
|
|
172
|
-
} catch (err) {
|
|
173
|
-
attempts++;
|
|
174
|
-
if (attempts >= maxAttempts) {
|
|
175
|
-
window.clearInterval(timer);
|
|
176
|
-
console.error("failed to set the provider");
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
timer = window.setInterval(attemptToSetProvider, 10);
|
|
181
|
-
attemptToSetProvider();
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
171
|
var $f2083cd30e2f5c56$exports = {};
|
|
186
172
|
|
|
187
173
|
$parcel$export($f2083cd30e2f5c56$exports, "ConnectReact", () => $f2083cd30e2f5c56$export$49d62957f420a1e2);
|
|
@@ -224,11 +210,16 @@ $parcel$export($89d55ace0f8f1c07$exports, "WalletReact", () => $89d55ace0f8f1c07
|
|
|
224
210
|
|
|
225
211
|
|
|
226
212
|
function $89d55ace0f8f1c07$export$ceaac94f34dba154(props) {
|
|
227
|
-
const { providerPreference: providerPreference } = props;
|
|
213
|
+
const { providerPreference: providerPreference , isBridgeEnabled: isBridgeEnabled , isOnRampEnabled: isOnRampEnabled , isSwapEnabled: isSwapEnabled } = props;
|
|
228
214
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
215
|
+
// isOnRampEnabled, isBridgeEnabled, isSwapEnabled is a boolean type for better devExp
|
|
216
|
+
// converting them to string for compatible webComponent properties
|
|
229
217
|
return /*#__PURE__*/ (jsx)("imtbl-wallet", {
|
|
230
218
|
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
231
|
-
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK
|
|
219
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK,
|
|
220
|
+
isBridgeEnabled: isBridgeEnabled?.toString(),
|
|
221
|
+
isSwapEnabled: isSwapEnabled?.toString(),
|
|
222
|
+
isOnRampEnabled: isOnRampEnabled?.toString()
|
|
232
223
|
});
|
|
233
224
|
}
|
|
234
225
|
|
|
@@ -248,4 +239,45 @@ function $d087956fd1002f80$export$fa517eee6594d26c(props) {
|
|
|
248
239
|
});
|
|
249
240
|
}
|
|
250
241
|
|
|
251
|
-
|
|
242
|
+
|
|
243
|
+
var $fa90757d8d7a0962$exports = {};
|
|
244
|
+
|
|
245
|
+
$parcel$export($fa90757d8d7a0962$exports, "CheckoutWidgets", () => $fa90757d8d7a0962$export$af210a0808087845);
|
|
246
|
+
$parcel$export($fa90757d8d7a0962$exports, "UpdateConfig", () => $fa90757d8d7a0962$export$bf1548ba7e61c17f);
|
|
247
|
+
$parcel$export($fa90757d8d7a0962$exports, "SetProvider", () => $fa90757d8d7a0962$export$931068bc678f0d73);
|
|
248
|
+
function $fa90757d8d7a0962$export$af210a0808087845(config) {
|
|
249
|
+
var checkoutWidgetJS = document.createElement("script");
|
|
250
|
+
checkoutWidgetJS.setAttribute("src", "http://localhost:3000/lib/js/imtbl-checkout.js");
|
|
251
|
+
document.head.appendChild(checkoutWidgetJS);
|
|
252
|
+
window.ImtblCheckoutWidgetConfig = config;
|
|
253
|
+
}
|
|
254
|
+
function $fa90757d8d7a0962$export$bf1548ba7e61c17f(config) {
|
|
255
|
+
window.ImtblCheckoutWidgetConfig = config;
|
|
256
|
+
}
|
|
257
|
+
function $fa90757d8d7a0962$export$931068bc678f0d73(tagName, provider) {
|
|
258
|
+
if (!provider) {
|
|
259
|
+
console.error("no provider parsed");
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const elements = document.getElementsByTagName(tagName);
|
|
263
|
+
const widget = elements[0];
|
|
264
|
+
let attempts = 0;
|
|
265
|
+
const maxAttempts = 10;
|
|
266
|
+
let timer;
|
|
267
|
+
const attemptToSetProvider = ()=>{
|
|
268
|
+
try {
|
|
269
|
+
widget.setProvider(provider);
|
|
270
|
+
window.clearInterval(timer);
|
|
271
|
+
} catch (err) {
|
|
272
|
+
attempts++;
|
|
273
|
+
if (attempts >= maxAttempts) {
|
|
274
|
+
window.clearInterval(timer);
|
|
275
|
+
console.error("failed to set the provider");
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
timer = window.setInterval(attemptToSetProvider, 10);
|
|
280
|
+
attemptToSetProvider();
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export { $15cc9e120aa6f3bf$export$d1bfa21f7c76447a as BridgeEventType, $1f969328e5988c99$export$30f61ebf204c69f6 as BridgeReact, $98cbcca465beec95$export$90db5fe1be5993c1 as BuyEventType, $f22931ca9e2f35b6$export$d13582032b79b401 as BuyReact, $14d7a2bbb79e0dae$export$75be0f6af9650f2c as CheckoutWidgetTagNames, $fa90757d8d7a0962$export$af210a0808087845 as CheckoutWidgets, $a85ecdbd885c58ad$export$e72e7f9969a47dd3 as ConnectEventType, $f2083cd30e2f5c56$export$49d62957f420a1e2 as ConnectReact, $d087956fd1002f80$export$fa517eee6594d26c as ExampleReact, $207ed853f11d19d5$export$5a0ace85cae72d45 as IMTBLWidgetEvents, $14d7a2bbb79e0dae$export$95be4ae94445245a as Network, $66ceef112c0ee49e$export$66ec39c0924078d8 as OnRampEventType, $fa90757d8d7a0962$export$931068bc678f0d73 as SetProvider, $53d219e7f6bf0cd6$export$140a49745ab55563 as SwapEventType, $a4fbb8e3a6aeff58$export$971e031379577f4 as SwapReact, $fa90757d8d7a0962$export$bf1548ba7e61c17f as UpdateConfig, $77b6aac5c353d4a9$export$d9be06b70b28c742 as WalletEventType, $89d55ace0f8f1c07$export$ceaac94f34dba154 as WalletReact, $14d7a2bbb79e0dae$export$2f61dde3bdc320cb as WidgetConnectionProviders, $14d7a2bbb79e0dae$export$c88931fdc51854eb as WidgetTheme };
|
|
@@ -15,7 +15,7 @@ const production = () => Config.createConfig({
|
|
|
15
15
|
chainID: 1,
|
|
16
16
|
coreContractAddress: '0x5FDCCA53617f4d2b9134B29090C87D01058e27e9',
|
|
17
17
|
registrationContractAddress: '0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c',
|
|
18
|
-
sdkVersion: 'ts-immutable-sdk-0.1.
|
|
18
|
+
sdkVersion: 'ts-immutable-sdk-0.1.6-alpha',
|
|
19
19
|
});
|
|
20
20
|
/**
|
|
21
21
|
* Set `sdkVersion` on config
|
|
@@ -25,7 +25,7 @@ const sandbox = () => Config.createConfig({
|
|
|
25
25
|
chainID: 5,
|
|
26
26
|
coreContractAddress: '0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623',
|
|
27
27
|
registrationContractAddress: '0x1C97Ada273C9A52253f463042f29117090Cd7D83',
|
|
28
|
-
sdkVersion: 'ts-immutable-sdk-0.1.
|
|
28
|
+
sdkVersion: 'ts-immutable-sdk-0.1.6-alpha',
|
|
29
29
|
});
|
|
30
30
|
class ImxConfiguration {
|
|
31
31
|
immutableXConfig;
|
package/dist/index.cjs
CHANGED
|
@@ -3177,13 +3177,16 @@ function $parcel$export(e, n, v, s) {
|
|
|
3177
3177
|
var $207ed853f11d19d5$exports = {};
|
|
3178
3178
|
|
|
3179
3179
|
$parcel$export($207ed853f11d19d5$exports, "IMTBLWidgetEvents", () => exports.IMTBLWidgetEvents);
|
|
3180
|
-
|
|
3180
|
+
/**
|
|
3181
|
+
* Enum representing the events emitted by the widgets.
|
|
3182
|
+
*/ exports.IMTBLWidgetEvents = void 0;
|
|
3181
3183
|
(function(IMTBLWidgetEvents) {
|
|
3182
3184
|
IMTBLWidgetEvents["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
|
|
3183
3185
|
IMTBLWidgetEvents["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
|
|
3184
3186
|
IMTBLWidgetEvents["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
|
|
3185
3187
|
IMTBLWidgetEvents["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
|
|
3186
3188
|
IMTBLWidgetEvents["IMTBL_BUY_WIDGET_EVENT"] = "imtbl-buy-widget";
|
|
3189
|
+
IMTBLWidgetEvents["IMTBL_ONRAMP_WIDGET_EVENT"] = "imtbl-onramp-widget";
|
|
3187
3190
|
})(exports.IMTBLWidgetEvents || (exports.IMTBLWidgetEvents = {}));
|
|
3188
3191
|
|
|
3189
3192
|
|
|
@@ -3201,18 +3204,25 @@ exports.ConnectEventType = void 0;
|
|
|
3201
3204
|
var $77b6aac5c353d4a9$exports = {};
|
|
3202
3205
|
|
|
3203
3206
|
$parcel$export($77b6aac5c353d4a9$exports, "WalletEventType", () => exports.WalletEventType);
|
|
3204
|
-
//wallet widget events
|
|
3205
3207
|
exports.WalletEventType = void 0;
|
|
3206
3208
|
(function(WalletEventType) {
|
|
3207
3209
|
WalletEventType["CLOSE_WIDGET"] = "close-widget";
|
|
3208
3210
|
WalletEventType["NETWORK_SWITCH"] = "network-switch";
|
|
3211
|
+
WalletEventType["ADD_COINS"] = "add-coins";
|
|
3212
|
+
WalletEventType["REQUEST_SWAP"] = "request-swap";
|
|
3213
|
+
WalletEventType["REQUEST_BRIDGE"] = "request-bridge";
|
|
3214
|
+
WalletEventType["REQUEST_ONRAMP"] = "request-onramp";
|
|
3209
3215
|
})(exports.WalletEventType || (exports.WalletEventType = {}));
|
|
3210
3216
|
|
|
3211
3217
|
|
|
3212
3218
|
var $53d219e7f6bf0cd6$exports = {};
|
|
3213
3219
|
|
|
3214
3220
|
$parcel$export($53d219e7f6bf0cd6$exports, "SwapEventType", () => exports.SwapEventType);
|
|
3215
|
-
|
|
3221
|
+
/**
|
|
3222
|
+
* Represents an event object emitted by the Swap Widget.
|
|
3223
|
+
* @property {SwapEventType} type - The type of the event.
|
|
3224
|
+
* @property {T} data - The data contained in the event.
|
|
3225
|
+
*/ exports.SwapEventType = void 0;
|
|
3216
3226
|
(function(SwapEventType) {
|
|
3217
3227
|
SwapEventType["SUCCESS"] = "success";
|
|
3218
3228
|
SwapEventType["FAILURE"] = "failure";
|
|
@@ -3222,7 +3232,11 @@ exports.SwapEventType = void 0;
|
|
|
3222
3232
|
var $15cc9e120aa6f3bf$exports = {};
|
|
3223
3233
|
|
|
3224
3234
|
$parcel$export($15cc9e120aa6f3bf$exports, "BridgeEventType", () => exports.BridgeEventType);
|
|
3225
|
-
|
|
3235
|
+
/**
|
|
3236
|
+
* Represents an event object emitted by the Bridge Widget.
|
|
3237
|
+
* @property {BridgeEventType} type - The type of the event.
|
|
3238
|
+
* @property {T} data - The data associated with the event.
|
|
3239
|
+
*/ exports.BridgeEventType = void 0;
|
|
3226
3240
|
(function(BridgeEventType) {
|
|
3227
3241
|
BridgeEventType["CLOSE_WIDGET"] = "close-widget";
|
|
3228
3242
|
BridgeEventType["SUCCESS"] = "success";
|
|
@@ -3233,7 +3247,11 @@ exports.BridgeEventType = void 0;
|
|
|
3233
3247
|
var $98cbcca465beec95$exports = {};
|
|
3234
3248
|
|
|
3235
3249
|
$parcel$export($98cbcca465beec95$exports, "BuyEventType", () => exports.BuyEventType);
|
|
3236
|
-
|
|
3250
|
+
/**
|
|
3251
|
+
* Represents an event object emitted by the Buy Widget.
|
|
3252
|
+
* @property {BuyEventType} type - The type of the event.
|
|
3253
|
+
* @property {T} data - The data contained in the event.
|
|
3254
|
+
*/ exports.BuyEventType = void 0;
|
|
3237
3255
|
(function(BuyEventType) {
|
|
3238
3256
|
BuyEventType["SUCCESS"] = "success";
|
|
3239
3257
|
BuyEventType["FAILURE"] = "failure";
|
|
@@ -3242,13 +3260,22 @@ exports.BuyEventType = void 0;
|
|
|
3242
3260
|
})(exports.BuyEventType || (exports.BuyEventType = {}));
|
|
3243
3261
|
|
|
3244
3262
|
|
|
3263
|
+
var $66ceef112c0ee49e$exports = {};
|
|
3264
|
+
|
|
3265
|
+
$parcel$export($66ceef112c0ee49e$exports, "OnRampEventType", () => exports.OnRampEventType);
|
|
3266
|
+
exports.OnRampEventType = void 0;
|
|
3267
|
+
exports.OnRampEventType || (exports.OnRampEventType = {});
|
|
3268
|
+
|
|
3269
|
+
|
|
3245
3270
|
var $14d7a2bbb79e0dae$exports = {};
|
|
3246
3271
|
|
|
3247
3272
|
$parcel$export($14d7a2bbb79e0dae$exports, "Network", () => exports.Network);
|
|
3248
3273
|
$parcel$export($14d7a2bbb79e0dae$exports, "WidgetTheme", () => exports.WidgetTheme);
|
|
3249
3274
|
$parcel$export($14d7a2bbb79e0dae$exports, "WidgetConnectionProviders", () => exports.WidgetConnectionProviders);
|
|
3250
3275
|
$parcel$export($14d7a2bbb79e0dae$exports, "CheckoutWidgetTagNames", () => exports.CheckoutWidgetTagNames);
|
|
3251
|
-
|
|
3276
|
+
/**
|
|
3277
|
+
* Enum representing the networks supported by Checkout.
|
|
3278
|
+
*/ exports.Network = void 0;
|
|
3252
3279
|
(function(Network) {
|
|
3253
3280
|
Network["ETHEREUM"] = "Ethereum";
|
|
3254
3281
|
Network["GOERLI"] = "Goerli";
|
|
@@ -3271,7 +3298,7 @@ exports.CheckoutWidgetTagNames = void 0;
|
|
|
3271
3298
|
CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
|
|
3272
3299
|
CheckoutWidgetTagNames["BUY"] = "imtbl-buy";
|
|
3273
3300
|
CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
|
|
3274
|
-
CheckoutWidgetTagNames["
|
|
3301
|
+
CheckoutWidgetTagNames["EXAMPLE"] = "imtbl-example";
|
|
3275
3302
|
})(exports.CheckoutWidgetTagNames || (exports.CheckoutWidgetTagNames = {}));
|
|
3276
3303
|
|
|
3277
3304
|
|
|
@@ -3311,47 +3338,6 @@ function $f22931ca9e2f35b6$export$d13582032b79b401(props) {
|
|
|
3311
3338
|
}
|
|
3312
3339
|
|
|
3313
3340
|
|
|
3314
|
-
var $fa90757d8d7a0962$exports = {};
|
|
3315
|
-
|
|
3316
|
-
$parcel$export($fa90757d8d7a0962$exports, "CheckoutWidgets", () => $fa90757d8d7a0962$export$af210a0808087845);
|
|
3317
|
-
$parcel$export($fa90757d8d7a0962$exports, "UpdateConfig", () => $fa90757d8d7a0962$export$bf1548ba7e61c17f);
|
|
3318
|
-
$parcel$export($fa90757d8d7a0962$exports, "SetProvider", () => $fa90757d8d7a0962$export$931068bc678f0d73);
|
|
3319
|
-
function $fa90757d8d7a0962$export$af210a0808087845(config) {
|
|
3320
|
-
var checkoutWidgetJS = document.createElement("script");
|
|
3321
|
-
checkoutWidgetJS.setAttribute("src", "http://localhost:3000/lib/js/imtbl-checkout.js");
|
|
3322
|
-
document.head.appendChild(checkoutWidgetJS);
|
|
3323
|
-
window.ImtblCheckoutWidgetConfig = config;
|
|
3324
|
-
}
|
|
3325
|
-
function $fa90757d8d7a0962$export$bf1548ba7e61c17f(config) {
|
|
3326
|
-
window.ImtblCheckoutWidgetConfig = config;
|
|
3327
|
-
}
|
|
3328
|
-
function $fa90757d8d7a0962$export$931068bc678f0d73(tagName, provider) {
|
|
3329
|
-
if (!provider) {
|
|
3330
|
-
console.error("no provider parsed");
|
|
3331
|
-
return;
|
|
3332
|
-
}
|
|
3333
|
-
const elements = document.getElementsByTagName(tagName);
|
|
3334
|
-
const widget = elements[0];
|
|
3335
|
-
let attempts = 0;
|
|
3336
|
-
const maxAttempts = 10;
|
|
3337
|
-
let timer;
|
|
3338
|
-
const attemptToSetProvider = ()=>{
|
|
3339
|
-
try {
|
|
3340
|
-
widget.setProvider(provider);
|
|
3341
|
-
window.clearInterval(timer);
|
|
3342
|
-
} catch (err) {
|
|
3343
|
-
attempts++;
|
|
3344
|
-
if (attempts >= maxAttempts) {
|
|
3345
|
-
window.clearInterval(timer);
|
|
3346
|
-
console.error("failed to set the provider");
|
|
3347
|
-
}
|
|
3348
|
-
}
|
|
3349
|
-
};
|
|
3350
|
-
timer = window.setInterval(attemptToSetProvider, 10);
|
|
3351
|
-
attemptToSetProvider();
|
|
3352
|
-
}
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
3341
|
var $f2083cd30e2f5c56$exports = {};
|
|
3356
3342
|
|
|
3357
3343
|
$parcel$export($f2083cd30e2f5c56$exports, "ConnectReact", () => $f2083cd30e2f5c56$export$49d62957f420a1e2);
|
|
@@ -3394,11 +3380,16 @@ $parcel$export($89d55ace0f8f1c07$exports, "WalletReact", () => $89d55ace0f8f1c07
|
|
|
3394
3380
|
|
|
3395
3381
|
|
|
3396
3382
|
function $89d55ace0f8f1c07$export$ceaac94f34dba154(props) {
|
|
3397
|
-
const { providerPreference: providerPreference } = props;
|
|
3383
|
+
const { providerPreference: providerPreference , isBridgeEnabled: isBridgeEnabled , isOnRampEnabled: isOnRampEnabled , isSwapEnabled: isSwapEnabled } = props;
|
|
3398
3384
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
3385
|
+
// isOnRampEnabled, isBridgeEnabled, isSwapEnabled is a boolean type for better devExp
|
|
3386
|
+
// converting them to string for compatible webComponent properties
|
|
3399
3387
|
return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-wallet", {
|
|
3400
3388
|
providerPreference: providerPreference ?? (exports.WidgetConnectionProviders).METAMASK,
|
|
3401
|
-
theme: config.theme ?? (exports.WidgetTheme).DARK
|
|
3389
|
+
theme: config.theme ?? (exports.WidgetTheme).DARK,
|
|
3390
|
+
isBridgeEnabled: isBridgeEnabled?.toString(),
|
|
3391
|
+
isSwapEnabled: isSwapEnabled?.toString(),
|
|
3392
|
+
isOnRampEnabled: isOnRampEnabled?.toString()
|
|
3402
3393
|
});
|
|
3403
3394
|
}
|
|
3404
3395
|
|
|
@@ -3418,6 +3409,47 @@ function $d087956fd1002f80$export$fa517eee6594d26c(props) {
|
|
|
3418
3409
|
});
|
|
3419
3410
|
}
|
|
3420
3411
|
|
|
3412
|
+
|
|
3413
|
+
var $fa90757d8d7a0962$exports = {};
|
|
3414
|
+
|
|
3415
|
+
$parcel$export($fa90757d8d7a0962$exports, "CheckoutWidgets", () => $fa90757d8d7a0962$export$af210a0808087845);
|
|
3416
|
+
$parcel$export($fa90757d8d7a0962$exports, "UpdateConfig", () => $fa90757d8d7a0962$export$bf1548ba7e61c17f);
|
|
3417
|
+
$parcel$export($fa90757d8d7a0962$exports, "SetProvider", () => $fa90757d8d7a0962$export$931068bc678f0d73);
|
|
3418
|
+
function $fa90757d8d7a0962$export$af210a0808087845(config) {
|
|
3419
|
+
var checkoutWidgetJS = document.createElement("script");
|
|
3420
|
+
checkoutWidgetJS.setAttribute("src", "http://localhost:3000/lib/js/imtbl-checkout.js");
|
|
3421
|
+
document.head.appendChild(checkoutWidgetJS);
|
|
3422
|
+
window.ImtblCheckoutWidgetConfig = config;
|
|
3423
|
+
}
|
|
3424
|
+
function $fa90757d8d7a0962$export$bf1548ba7e61c17f(config) {
|
|
3425
|
+
window.ImtblCheckoutWidgetConfig = config;
|
|
3426
|
+
}
|
|
3427
|
+
function $fa90757d8d7a0962$export$931068bc678f0d73(tagName, provider) {
|
|
3428
|
+
if (!provider) {
|
|
3429
|
+
console.error("no provider parsed");
|
|
3430
|
+
return;
|
|
3431
|
+
}
|
|
3432
|
+
const elements = document.getElementsByTagName(tagName);
|
|
3433
|
+
const widget = elements[0];
|
|
3434
|
+
let attempts = 0;
|
|
3435
|
+
const maxAttempts = 10;
|
|
3436
|
+
let timer;
|
|
3437
|
+
const attemptToSetProvider = ()=>{
|
|
3438
|
+
try {
|
|
3439
|
+
widget.setProvider(provider);
|
|
3440
|
+
window.clearInterval(timer);
|
|
3441
|
+
} catch (err) {
|
|
3442
|
+
attempts++;
|
|
3443
|
+
if (attempts >= maxAttempts) {
|
|
3444
|
+
window.clearInterval(timer);
|
|
3445
|
+
console.error("failed to set the provider");
|
|
3446
|
+
}
|
|
3447
|
+
}
|
|
3448
|
+
};
|
|
3449
|
+
timer = window.setInterval(attemptToSetProvider, 10);
|
|
3450
|
+
attemptToSetProvider();
|
|
3451
|
+
}
|
|
3452
|
+
|
|
3421
3453
|
Object.defineProperty(exports, 'imxClientCreateStarkSigner', {
|
|
3422
3454
|
enumerable: true,
|
|
3423
3455
|
get: function () { return coreSdk.createStarkSigner; }
|