@imtbl/sdk 0.6.0-alpha → 0.6.1-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.d.ts +18 -3
- package/dist/checkout_sdk.js +2182 -123
- package/dist/checkout_widgets.d.ts +10496 -153
- package/dist/checkout_widgets.js +57 -8
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +8 -8
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +176 -42
- package/dist/index.d.ts +29 -7
- package/dist/index.js +176 -42
- package/dist/orderbook.d.ts +1 -3
- package/dist/orderbook.js +1 -3
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/checkout_widgets.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useEffect } from 'react';
|
|
|
4
4
|
function $parcel$export(e, n, v, s) {
|
|
5
5
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
6
6
|
}
|
|
7
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.6.
|
|
7
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.6.1-alpha";
|
|
8
8
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
9
9
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
10
10
|
|
|
@@ -197,12 +197,48 @@ function $77ec335383336bdd$export$931068bc678f0d73(tagName, provider) {
|
|
|
197
197
|
|
|
198
198
|
|
|
199
199
|
|
|
200
|
+
function $b222a8f062090058$export$fae4199086a966a3(tagName, passport) {
|
|
201
|
+
if (!passport) {
|
|
202
|
+
// eslint-disable-next-line no-console
|
|
203
|
+
console.error("no passport provided");
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (window === undefined) {
|
|
207
|
+
// eslint-disable-next-line no-console
|
|
208
|
+
console.error("missing window object: please run Checkout client side");
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
let attempts = 0;
|
|
212
|
+
const maxAttempts = 10;
|
|
213
|
+
let timer;
|
|
214
|
+
const attemptToAddPassport = ()=>{
|
|
215
|
+
try {
|
|
216
|
+
const elements = document.getElementsByTagName(tagName);
|
|
217
|
+
const widget = elements[0];
|
|
218
|
+
widget.addPassportOption(passport);
|
|
219
|
+
window.clearInterval(timer);
|
|
220
|
+
} catch (err) {
|
|
221
|
+
attempts++;
|
|
222
|
+
if (attempts >= maxAttempts) {
|
|
223
|
+
window.clearInterval(timer);
|
|
224
|
+
// eslint-disable-next-line no-console
|
|
225
|
+
console.error("failed to set the provider");
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
timer = window.setInterval(attemptToAddPassport, 10);
|
|
230
|
+
attemptToAddPassport();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
|
|
200
234
|
function $1f969328e5988c99$export$30f61ebf204c69f6(props) {
|
|
201
|
-
const { walletProvider: walletProvider, fromContractAddress: fromContractAddress, amount: amount, provider: provider } = props;
|
|
235
|
+
const { walletProvider: walletProvider, fromContractAddress: fromContractAddress, amount: amount, provider: provider, passport: passport } = props;
|
|
202
236
|
(useEffect)(()=>{
|
|
203
237
|
if (provider) ($77ec335383336bdd$export$931068bc678f0d73)(($045213b18e9f1f94$export$75be0f6af9650f2c).BRIDGE, provider);
|
|
238
|
+
if (passport) ($b222a8f062090058$export$fae4199086a966a3)(($045213b18e9f1f94$export$75be0f6af9650f2c).BRIDGE, passport);
|
|
204
239
|
}, [
|
|
205
|
-
provider
|
|
240
|
+
provider,
|
|
241
|
+
passport
|
|
206
242
|
]);
|
|
207
243
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
208
244
|
return /*#__PURE__*/ (jsx)("imtbl-bridge", {
|
|
@@ -219,8 +255,15 @@ var $f2083cd30e2f5c56$exports = {};
|
|
|
219
255
|
$parcel$export($f2083cd30e2f5c56$exports, "ConnectReact", () => $f2083cd30e2f5c56$export$49d62957f420a1e2);
|
|
220
256
|
|
|
221
257
|
|
|
222
|
-
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
function $f2083cd30e2f5c56$export$49d62957f420a1e2({ passport: passport }) {
|
|
223
261
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
262
|
+
(useEffect)(()=>{
|
|
263
|
+
if (passport) ($b222a8f062090058$export$fae4199086a966a3)(($045213b18e9f1f94$export$75be0f6af9650f2c).CONNECT, passport);
|
|
264
|
+
}, [
|
|
265
|
+
passport
|
|
266
|
+
]);
|
|
224
267
|
return /*#__PURE__*/ (jsx)("imtbl-connect", {
|
|
225
268
|
widgetConfig: config
|
|
226
269
|
});
|
|
@@ -234,12 +277,15 @@ $parcel$export($a4fbb8e3a6aeff58$exports, "SwapReact", () => $a4fbb8e3a6aeff58$e
|
|
|
234
277
|
|
|
235
278
|
|
|
236
279
|
|
|
280
|
+
|
|
237
281
|
function $a4fbb8e3a6aeff58$export$971e031379577f4(props) {
|
|
238
|
-
const { walletProvider: walletProvider, fromContractAddress: fromContractAddress, amount: amount, toContractAddress: toContractAddress, provider: provider } = props;
|
|
282
|
+
const { walletProvider: walletProvider, fromContractAddress: fromContractAddress, amount: amount, toContractAddress: toContractAddress, provider: provider, passport: passport } = props;
|
|
239
283
|
(useEffect)(()=>{
|
|
240
284
|
if (provider) ($77ec335383336bdd$export$931068bc678f0d73)(($045213b18e9f1f94$export$75be0f6af9650f2c).SWAP, provider);
|
|
285
|
+
if (passport) ($b222a8f062090058$export$fae4199086a966a3)(($045213b18e9f1f94$export$75be0f6af9650f2c).SWAP, passport);
|
|
241
286
|
}, [
|
|
242
|
-
provider
|
|
287
|
+
provider,
|
|
288
|
+
passport
|
|
243
289
|
]);
|
|
244
290
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
245
291
|
return /*#__PURE__*/ (jsx)("imtbl-swap", {
|
|
@@ -259,12 +305,15 @@ $parcel$export($89d55ace0f8f1c07$exports, "WalletReact", () => $89d55ace0f8f1c07
|
|
|
259
305
|
|
|
260
306
|
|
|
261
307
|
|
|
308
|
+
|
|
262
309
|
function $89d55ace0f8f1c07$export$ceaac94f34dba154(props) {
|
|
263
|
-
const { walletProvider: walletProvider, provider: provider } = props;
|
|
310
|
+
const { walletProvider: walletProvider, provider: provider, passport: passport } = props;
|
|
264
311
|
(useEffect)(()=>{
|
|
265
312
|
if (provider) ($77ec335383336bdd$export$931068bc678f0d73)(($045213b18e9f1f94$export$75be0f6af9650f2c).WALLET, provider);
|
|
313
|
+
if (passport) ($b222a8f062090058$export$fae4199086a966a3)(($045213b18e9f1f94$export$75be0f6af9650f2c).WALLET, passport);
|
|
266
314
|
}, [
|
|
267
|
-
provider
|
|
315
|
+
provider,
|
|
316
|
+
passport
|
|
268
317
|
]);
|
|
269
318
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
270
319
|
return /*#__PURE__*/ (jsx)("imtbl-wallet", {
|
|
@@ -16,7 +16,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
16
16
|
chainID,
|
|
17
17
|
coreContractAddress,
|
|
18
18
|
registrationContractAddress,
|
|
19
|
-
sdkVersion: 'ts-immutable-sdk-0.6.
|
|
19
|
+
sdkVersion: 'ts-immutable-sdk-0.6.1-alpha',
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
22
22
|
* Sets `sdkVersion` at the time of build
|