@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/index.js
CHANGED
|
@@ -35,7 +35,7 @@ const production = () => Config.createConfig({
|
|
|
35
35
|
chainID: 1,
|
|
36
36
|
coreContractAddress: '0x5FDCCA53617f4d2b9134B29090C87D01058e27e9',
|
|
37
37
|
registrationContractAddress: '0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c',
|
|
38
|
-
sdkVersion: 'ts-immutable-sdk-0.1.
|
|
38
|
+
sdkVersion: 'ts-immutable-sdk-0.1.6-alpha',
|
|
39
39
|
});
|
|
40
40
|
/**
|
|
41
41
|
* Set `sdkVersion` on config
|
|
@@ -45,7 +45,7 @@ const sandbox = () => Config.createConfig({
|
|
|
45
45
|
chainID: 5,
|
|
46
46
|
coreContractAddress: '0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623',
|
|
47
47
|
registrationContractAddress: '0x1C97Ada273C9A52253f463042f29117090Cd7D83',
|
|
48
|
-
sdkVersion: 'ts-immutable-sdk-0.1.
|
|
48
|
+
sdkVersion: 'ts-immutable-sdk-0.1.6-alpha',
|
|
49
49
|
});
|
|
50
50
|
class ImxConfiguration {
|
|
51
51
|
immutableXConfig;
|
|
@@ -3157,13 +3157,16 @@ function $parcel$export(e, n, v, s) {
|
|
|
3157
3157
|
var $207ed853f11d19d5$exports = {};
|
|
3158
3158
|
|
|
3159
3159
|
$parcel$export($207ed853f11d19d5$exports, "IMTBLWidgetEvents", () => $207ed853f11d19d5$export$5a0ace85cae72d45);
|
|
3160
|
-
|
|
3160
|
+
/**
|
|
3161
|
+
* Enum representing the events emitted by the widgets.
|
|
3162
|
+
*/ let $207ed853f11d19d5$export$5a0ace85cae72d45;
|
|
3161
3163
|
(function(IMTBLWidgetEvents) {
|
|
3162
3164
|
IMTBLWidgetEvents["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
|
|
3163
3165
|
IMTBLWidgetEvents["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
|
|
3164
3166
|
IMTBLWidgetEvents["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
|
|
3165
3167
|
IMTBLWidgetEvents["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
|
|
3166
3168
|
IMTBLWidgetEvents["IMTBL_BUY_WIDGET_EVENT"] = "imtbl-buy-widget";
|
|
3169
|
+
IMTBLWidgetEvents["IMTBL_ONRAMP_WIDGET_EVENT"] = "imtbl-onramp-widget";
|
|
3167
3170
|
})($207ed853f11d19d5$export$5a0ace85cae72d45 || ($207ed853f11d19d5$export$5a0ace85cae72d45 = {}));
|
|
3168
3171
|
|
|
3169
3172
|
|
|
@@ -3181,18 +3184,25 @@ let $a85ecdbd885c58ad$export$e72e7f9969a47dd3;
|
|
|
3181
3184
|
var $77b6aac5c353d4a9$exports = {};
|
|
3182
3185
|
|
|
3183
3186
|
$parcel$export($77b6aac5c353d4a9$exports, "WalletEventType", () => $77b6aac5c353d4a9$export$d9be06b70b28c742);
|
|
3184
|
-
//wallet widget events
|
|
3185
3187
|
let $77b6aac5c353d4a9$export$d9be06b70b28c742;
|
|
3186
3188
|
(function(WalletEventType) {
|
|
3187
3189
|
WalletEventType["CLOSE_WIDGET"] = "close-widget";
|
|
3188
3190
|
WalletEventType["NETWORK_SWITCH"] = "network-switch";
|
|
3191
|
+
WalletEventType["ADD_COINS"] = "add-coins";
|
|
3192
|
+
WalletEventType["REQUEST_SWAP"] = "request-swap";
|
|
3193
|
+
WalletEventType["REQUEST_BRIDGE"] = "request-bridge";
|
|
3194
|
+
WalletEventType["REQUEST_ONRAMP"] = "request-onramp";
|
|
3189
3195
|
})($77b6aac5c353d4a9$export$d9be06b70b28c742 || ($77b6aac5c353d4a9$export$d9be06b70b28c742 = {}));
|
|
3190
3196
|
|
|
3191
3197
|
|
|
3192
3198
|
var $53d219e7f6bf0cd6$exports = {};
|
|
3193
3199
|
|
|
3194
3200
|
$parcel$export($53d219e7f6bf0cd6$exports, "SwapEventType", () => $53d219e7f6bf0cd6$export$140a49745ab55563);
|
|
3195
|
-
|
|
3201
|
+
/**
|
|
3202
|
+
* Represents an event object emitted by the Swap Widget.
|
|
3203
|
+
* @property {SwapEventType} type - The type of the event.
|
|
3204
|
+
* @property {T} data - The data contained in the event.
|
|
3205
|
+
*/ let $53d219e7f6bf0cd6$export$140a49745ab55563;
|
|
3196
3206
|
(function(SwapEventType) {
|
|
3197
3207
|
SwapEventType["SUCCESS"] = "success";
|
|
3198
3208
|
SwapEventType["FAILURE"] = "failure";
|
|
@@ -3202,7 +3212,11 @@ let $53d219e7f6bf0cd6$export$140a49745ab55563;
|
|
|
3202
3212
|
var $15cc9e120aa6f3bf$exports = {};
|
|
3203
3213
|
|
|
3204
3214
|
$parcel$export($15cc9e120aa6f3bf$exports, "BridgeEventType", () => $15cc9e120aa6f3bf$export$d1bfa21f7c76447a);
|
|
3205
|
-
|
|
3215
|
+
/**
|
|
3216
|
+
* Represents an event object emitted by the Bridge Widget.
|
|
3217
|
+
* @property {BridgeEventType} type - The type of the event.
|
|
3218
|
+
* @property {T} data - The data associated with the event.
|
|
3219
|
+
*/ let $15cc9e120aa6f3bf$export$d1bfa21f7c76447a;
|
|
3206
3220
|
(function(BridgeEventType) {
|
|
3207
3221
|
BridgeEventType["CLOSE_WIDGET"] = "close-widget";
|
|
3208
3222
|
BridgeEventType["SUCCESS"] = "success";
|
|
@@ -3213,7 +3227,11 @@ let $15cc9e120aa6f3bf$export$d1bfa21f7c76447a;
|
|
|
3213
3227
|
var $98cbcca465beec95$exports = {};
|
|
3214
3228
|
|
|
3215
3229
|
$parcel$export($98cbcca465beec95$exports, "BuyEventType", () => $98cbcca465beec95$export$90db5fe1be5993c1);
|
|
3216
|
-
|
|
3230
|
+
/**
|
|
3231
|
+
* Represents an event object emitted by the Buy Widget.
|
|
3232
|
+
* @property {BuyEventType} type - The type of the event.
|
|
3233
|
+
* @property {T} data - The data contained in the event.
|
|
3234
|
+
*/ let $98cbcca465beec95$export$90db5fe1be5993c1;
|
|
3217
3235
|
(function(BuyEventType) {
|
|
3218
3236
|
BuyEventType["SUCCESS"] = "success";
|
|
3219
3237
|
BuyEventType["FAILURE"] = "failure";
|
|
@@ -3222,13 +3240,22 @@ let $98cbcca465beec95$export$90db5fe1be5993c1;
|
|
|
3222
3240
|
})($98cbcca465beec95$export$90db5fe1be5993c1 || ($98cbcca465beec95$export$90db5fe1be5993c1 = {}));
|
|
3223
3241
|
|
|
3224
3242
|
|
|
3243
|
+
var $66ceef112c0ee49e$exports = {};
|
|
3244
|
+
|
|
3245
|
+
$parcel$export($66ceef112c0ee49e$exports, "OnRampEventType", () => $66ceef112c0ee49e$export$66ec39c0924078d8);
|
|
3246
|
+
let $66ceef112c0ee49e$export$66ec39c0924078d8;
|
|
3247
|
+
$66ceef112c0ee49e$export$66ec39c0924078d8 || ($66ceef112c0ee49e$export$66ec39c0924078d8 = {});
|
|
3248
|
+
|
|
3249
|
+
|
|
3225
3250
|
var $14d7a2bbb79e0dae$exports = {};
|
|
3226
3251
|
|
|
3227
3252
|
$parcel$export($14d7a2bbb79e0dae$exports, "Network", () => $14d7a2bbb79e0dae$export$95be4ae94445245a);
|
|
3228
3253
|
$parcel$export($14d7a2bbb79e0dae$exports, "WidgetTheme", () => $14d7a2bbb79e0dae$export$c88931fdc51854eb);
|
|
3229
3254
|
$parcel$export($14d7a2bbb79e0dae$exports, "WidgetConnectionProviders", () => $14d7a2bbb79e0dae$export$2f61dde3bdc320cb);
|
|
3230
3255
|
$parcel$export($14d7a2bbb79e0dae$exports, "CheckoutWidgetTagNames", () => $14d7a2bbb79e0dae$export$75be0f6af9650f2c);
|
|
3231
|
-
|
|
3256
|
+
/**
|
|
3257
|
+
* Enum representing the networks supported by Checkout.
|
|
3258
|
+
*/ let $14d7a2bbb79e0dae$export$95be4ae94445245a;
|
|
3232
3259
|
(function(Network) {
|
|
3233
3260
|
Network["ETHEREUM"] = "Ethereum";
|
|
3234
3261
|
Network["GOERLI"] = "Goerli";
|
|
@@ -3251,7 +3278,7 @@ let $14d7a2bbb79e0dae$export$75be0f6af9650f2c;
|
|
|
3251
3278
|
CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
|
|
3252
3279
|
CheckoutWidgetTagNames["BUY"] = "imtbl-buy";
|
|
3253
3280
|
CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
|
|
3254
|
-
CheckoutWidgetTagNames["
|
|
3281
|
+
CheckoutWidgetTagNames["EXAMPLE"] = "imtbl-example";
|
|
3255
3282
|
})($14d7a2bbb79e0dae$export$75be0f6af9650f2c || ($14d7a2bbb79e0dae$export$75be0f6af9650f2c = {}));
|
|
3256
3283
|
|
|
3257
3284
|
|
|
@@ -3291,47 +3318,6 @@ function $f22931ca9e2f35b6$export$d13582032b79b401(props) {
|
|
|
3291
3318
|
}
|
|
3292
3319
|
|
|
3293
3320
|
|
|
3294
|
-
var $fa90757d8d7a0962$exports = {};
|
|
3295
|
-
|
|
3296
|
-
$parcel$export($fa90757d8d7a0962$exports, "CheckoutWidgets", () => $fa90757d8d7a0962$export$af210a0808087845);
|
|
3297
|
-
$parcel$export($fa90757d8d7a0962$exports, "UpdateConfig", () => $fa90757d8d7a0962$export$bf1548ba7e61c17f);
|
|
3298
|
-
$parcel$export($fa90757d8d7a0962$exports, "SetProvider", () => $fa90757d8d7a0962$export$931068bc678f0d73);
|
|
3299
|
-
function $fa90757d8d7a0962$export$af210a0808087845(config) {
|
|
3300
|
-
var checkoutWidgetJS = document.createElement("script");
|
|
3301
|
-
checkoutWidgetJS.setAttribute("src", "http://localhost:3000/lib/js/imtbl-checkout.js");
|
|
3302
|
-
document.head.appendChild(checkoutWidgetJS);
|
|
3303
|
-
window.ImtblCheckoutWidgetConfig = config;
|
|
3304
|
-
}
|
|
3305
|
-
function $fa90757d8d7a0962$export$bf1548ba7e61c17f(config) {
|
|
3306
|
-
window.ImtblCheckoutWidgetConfig = config;
|
|
3307
|
-
}
|
|
3308
|
-
function $fa90757d8d7a0962$export$931068bc678f0d73(tagName, provider) {
|
|
3309
|
-
if (!provider) {
|
|
3310
|
-
console.error("no provider parsed");
|
|
3311
|
-
return;
|
|
3312
|
-
}
|
|
3313
|
-
const elements = document.getElementsByTagName(tagName);
|
|
3314
|
-
const widget = elements[0];
|
|
3315
|
-
let attempts = 0;
|
|
3316
|
-
const maxAttempts = 10;
|
|
3317
|
-
let timer;
|
|
3318
|
-
const attemptToSetProvider = ()=>{
|
|
3319
|
-
try {
|
|
3320
|
-
widget.setProvider(provider);
|
|
3321
|
-
window.clearInterval(timer);
|
|
3322
|
-
} catch (err) {
|
|
3323
|
-
attempts++;
|
|
3324
|
-
if (attempts >= maxAttempts) {
|
|
3325
|
-
window.clearInterval(timer);
|
|
3326
|
-
console.error("failed to set the provider");
|
|
3327
|
-
}
|
|
3328
|
-
}
|
|
3329
|
-
};
|
|
3330
|
-
timer = window.setInterval(attemptToSetProvider, 10);
|
|
3331
|
-
attemptToSetProvider();
|
|
3332
|
-
}
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
3321
|
var $f2083cd30e2f5c56$exports = {};
|
|
3336
3322
|
|
|
3337
3323
|
$parcel$export($f2083cd30e2f5c56$exports, "ConnectReact", () => $f2083cd30e2f5c56$export$49d62957f420a1e2);
|
|
@@ -3374,11 +3360,16 @@ $parcel$export($89d55ace0f8f1c07$exports, "WalletReact", () => $89d55ace0f8f1c07
|
|
|
3374
3360
|
|
|
3375
3361
|
|
|
3376
3362
|
function $89d55ace0f8f1c07$export$ceaac94f34dba154(props) {
|
|
3377
|
-
const { providerPreference: providerPreference } = props;
|
|
3363
|
+
const { providerPreference: providerPreference , isBridgeEnabled: isBridgeEnabled , isOnRampEnabled: isOnRampEnabled , isSwapEnabled: isSwapEnabled } = props;
|
|
3378
3364
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
3365
|
+
// isOnRampEnabled, isBridgeEnabled, isSwapEnabled is a boolean type for better devExp
|
|
3366
|
+
// converting them to string for compatible webComponent properties
|
|
3379
3367
|
return /*#__PURE__*/ (jsx)("imtbl-wallet", {
|
|
3380
3368
|
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
3381
|
-
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK
|
|
3369
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK,
|
|
3370
|
+
isBridgeEnabled: isBridgeEnabled?.toString(),
|
|
3371
|
+
isSwapEnabled: isSwapEnabled?.toString(),
|
|
3372
|
+
isOnRampEnabled: isOnRampEnabled?.toString()
|
|
3382
3373
|
});
|
|
3383
3374
|
}
|
|
3384
3375
|
|
|
@@ -3398,4 +3389,45 @@ function $d087956fd1002f80$export$fa517eee6594d26c(props) {
|
|
|
3398
3389
|
});
|
|
3399
3390
|
}
|
|
3400
3391
|
|
|
3401
|
-
|
|
3392
|
+
|
|
3393
|
+
var $fa90757d8d7a0962$exports = {};
|
|
3394
|
+
|
|
3395
|
+
$parcel$export($fa90757d8d7a0962$exports, "CheckoutWidgets", () => $fa90757d8d7a0962$export$af210a0808087845);
|
|
3396
|
+
$parcel$export($fa90757d8d7a0962$exports, "UpdateConfig", () => $fa90757d8d7a0962$export$bf1548ba7e61c17f);
|
|
3397
|
+
$parcel$export($fa90757d8d7a0962$exports, "SetProvider", () => $fa90757d8d7a0962$export$931068bc678f0d73);
|
|
3398
|
+
function $fa90757d8d7a0962$export$af210a0808087845(config) {
|
|
3399
|
+
var checkoutWidgetJS = document.createElement("script");
|
|
3400
|
+
checkoutWidgetJS.setAttribute("src", "http://localhost:3000/lib/js/imtbl-checkout.js");
|
|
3401
|
+
document.head.appendChild(checkoutWidgetJS);
|
|
3402
|
+
window.ImtblCheckoutWidgetConfig = config;
|
|
3403
|
+
}
|
|
3404
|
+
function $fa90757d8d7a0962$export$bf1548ba7e61c17f(config) {
|
|
3405
|
+
window.ImtblCheckoutWidgetConfig = config;
|
|
3406
|
+
}
|
|
3407
|
+
function $fa90757d8d7a0962$export$931068bc678f0d73(tagName, provider) {
|
|
3408
|
+
if (!provider) {
|
|
3409
|
+
console.error("no provider parsed");
|
|
3410
|
+
return;
|
|
3411
|
+
}
|
|
3412
|
+
const elements = document.getElementsByTagName(tagName);
|
|
3413
|
+
const widget = elements[0];
|
|
3414
|
+
let attempts = 0;
|
|
3415
|
+
const maxAttempts = 10;
|
|
3416
|
+
let timer;
|
|
3417
|
+
const attemptToSetProvider = ()=>{
|
|
3418
|
+
try {
|
|
3419
|
+
widget.setProvider(provider);
|
|
3420
|
+
window.clearInterval(timer);
|
|
3421
|
+
} catch (err) {
|
|
3422
|
+
attempts++;
|
|
3423
|
+
if (attempts >= maxAttempts) {
|
|
3424
|
+
window.clearInterval(timer);
|
|
3425
|
+
console.error("failed to set the provider");
|
|
3426
|
+
}
|
|
3427
|
+
}
|
|
3428
|
+
};
|
|
3429
|
+
timer = window.setInterval(attemptToSetProvider, 10);
|
|
3430
|
+
attemptToSetProvider();
|
|
3431
|
+
}
|
|
3432
|
+
|
|
3433
|
+
export { $15cc9e120aa6f3bf$export$d1bfa21f7c76447a as BridgeEventType, $1f969328e5988c99$export$30f61ebf204c69f6 as BridgeReact, $98cbcca465beec95$export$90db5fe1be5993c1 as BuyEventType, $f22931ca9e2f35b6$export$d13582032b79b401 as BuyReact, $a47e48dd2c04791b$export$c06e1e7429de6283 as ChainId, $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 as Checkout, $a8bc256d81a5e2c1$export$e3dc0620abde7f5a as CheckoutErrorType, $14d7a2bbb79e0dae$export$75be0f6af9650f2c as CheckoutWidgetTagNames, $fa90757d8d7a0962$export$af210a0808087845 as CheckoutWidgets, $a85ecdbd885c58ad$export$e72e7f9969a47dd3 as ConnectEventType, $f2083cd30e2f5c56$export$49d62957f420a1e2 as ConnectReact, $d176a05e966364ba$export$3bfad4d03ada24c4 as ConnectionProviders, Environment, $d087956fd1002f80$export$fa517eee6594d26c as ExampleReact, GenericIMXProvider, $207ed853f11d19d5$export$5a0ace85cae72d45 as IMTBLWidgetEvents, ImmutableConfiguration, ImmutableXClient, MetaMaskIMXProvider, $14d7a2bbb79e0dae$export$95be4ae94445245a as Network, $a47e48dd2c04791b$export$1f05a55fe0680cc7 as NetworkFilterTypes, $66ceef112c0ee49e$export$66ec39c0924078d8 as OnRampEventType, Passport, PassportError, ProviderConfiguration, $fa90757d8d7a0962$export$931068bc678f0d73 as SetProvider, $090d3502d165f17d$export$c5ab8fbcabac8c11 as SupportedFiatCurrencies, $53d219e7f6bf0cd6$export$140a49745ab55563 as SwapEventType, $a4fbb8e3a6aeff58$export$971e031379577f4 as SwapReact, $08d5ddc39acd6833$export$fd9b17d87f4121d2 as TokenFilterTypes, $fa90757d8d7a0962$export$bf1548ba7e61c17f as UpdateConfig, $77b6aac5c353d4a9$export$d9be06b70b28c742 as WalletEventType, $4f91c5f280efe242$export$a75605c67ea83a5a as WalletFilterTypes, $89d55ace0f8f1c07$export$ceaac94f34dba154 as WalletReact, $14d7a2bbb79e0dae$export$2f61dde3bdc320cb as WidgetConnectionProviders, $14d7a2bbb79e0dae$export$c88931fdc51854eb as WidgetTheme };
|
package/dist/passport.js
CHANGED
|
@@ -20,7 +20,7 @@ const production = () => Config.createConfig({
|
|
|
20
20
|
chainID: 1,
|
|
21
21
|
coreContractAddress: '0x5FDCCA53617f4d2b9134B29090C87D01058e27e9',
|
|
22
22
|
registrationContractAddress: '0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c',
|
|
23
|
-
sdkVersion: 'ts-immutable-sdk-0.1.
|
|
23
|
+
sdkVersion: 'ts-immutable-sdk-0.1.6-alpha',
|
|
24
24
|
});
|
|
25
25
|
/**
|
|
26
26
|
* Set `sdkVersion` on config
|
|
@@ -30,7 +30,7 @@ const sandbox = () => Config.createConfig({
|
|
|
30
30
|
chainID: 5,
|
|
31
31
|
coreContractAddress: '0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623',
|
|
32
32
|
registrationContractAddress: '0x1C97Ada273C9A52253f463042f29117090Cd7D83',
|
|
33
|
-
sdkVersion: 'ts-immutable-sdk-0.1.
|
|
33
|
+
sdkVersion: 'ts-immutable-sdk-0.1.6-alpha',
|
|
34
34
|
});
|
|
35
35
|
class ImxConfiguration {
|
|
36
36
|
immutableXConfig;
|