@block-auth.io/blockauth-sdk-react 0.3.2 → 0.4.0
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/bundle.es.js +1 -1
- package/dist/{index-CGpSifh2.js → index-Bak4uhEH.js} +2 -2
- package/dist/index-Bak4uhEH.js.map +1 -0
- package/dist/{index-D-lFhScy.js → index-CLdJ05nx.js} +3 -3
- package/dist/{index-D-lFhScy.js.map → index-CLdJ05nx.js.map} +1 -1
- package/dist/{main-c1hd6K_y.js → main-h-jNMamK.js} +603 -277
- package/dist/{main-c1hd6K_y.js.map → main-h-jNMamK.js.map} +1 -1
- package/dist/{w3m-modal-Dkf4lQ0_.js → w3m-modal-xOVNG6py.js} +5 -5
- package/dist/{w3m-modal-Dkf4lQ0_.js.map → w3m-modal-xOVNG6py.js.map} +1 -1
- package/package.json +1 -1
- package/dist/bundle.cjs.js +0 -2
- package/dist/bundle.cjs.js.map +0 -1
- package/dist/index-BSWVqmGZ.cjs +0 -65
- package/dist/index-BSWVqmGZ.cjs.map +0 -1
- package/dist/index-C0ScBePv.cjs +0 -2
- package/dist/index-C0ScBePv.cjs.map +0 -1
- package/dist/index-CGpSifh2.js.map +0 -1
- package/dist/main-DjvR41j1.cjs +0 -11222
- package/dist/main-DjvR41j1.cjs.map +0 -1
- package/dist/w3m-modal-DHYAl4bG.cjs +0 -142
- package/dist/w3m-modal-DHYAl4bG.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var _a2, _b;
|
|
2
|
-
import require$$0$3, { useState, useEffect, useRef } from "react";
|
|
2
|
+
import require$$0$3, { useState, useEffect, useRef, useMemo } from "react";
|
|
3
3
|
import { BrowserBase as BrowserBase$1, BtnBase, helperUI, ArrowIcon, LifetimeSliderBase, PPTCCheckbox, DividerBase, AnimatedSlideWrapper, ArrowDownIcon, CheckmarkIcon, AnimatedBase, WrapperBaseFM, OvalSpinner, Switcher, InputBase, DropdownBase, BtnArrowDir, useMobile, DropdownArrow, ImgLoader, Progressbar, ModalBase } from "@block-auth.io/blockauth-lib-react";
|
|
4
4
|
import { useGoogleLogin, GoogleOAuthProvider } from "@react-oauth/google";
|
|
5
5
|
import { BiLogoGmail, BiSolidErrorAlt } from "react-icons/bi";
|
|
@@ -1305,14 +1305,14 @@ function requireWithSelector_production() {
|
|
|
1305
1305
|
function is(x3, y4) {
|
|
1306
1306
|
return x3 === y4 && (0 !== x3 || 1 / x3 === 1 / y4) || x3 !== x3 && y4 !== y4;
|
|
1307
1307
|
}
|
|
1308
|
-
var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef2 = React.useRef, useEffect2 = React.useEffect,
|
|
1308
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef2 = React.useRef, useEffect2 = React.useEffect, useMemo2 = React.useMemo, useDebugValue2 = React.useDebugValue;
|
|
1309
1309
|
withSelector_production.useSyncExternalStoreWithSelector = function(subscribe2, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
1310
1310
|
var instRef = useRef2(null);
|
|
1311
1311
|
if (null === instRef.current) {
|
|
1312
1312
|
var inst = { hasValue: false, value: null };
|
|
1313
1313
|
instRef.current = inst;
|
|
1314
1314
|
} else inst = instRef.current;
|
|
1315
|
-
instRef =
|
|
1315
|
+
instRef = useMemo2(
|
|
1316
1316
|
function() {
|
|
1317
1317
|
function memoizedSelector(nextSnapshot) {
|
|
1318
1318
|
if (!hasMemo) {
|
|
@@ -1369,14 +1369,14 @@ function requireWithSelector_development() {
|
|
|
1369
1369
|
return x3 === y4 && (0 !== x3 || 1 / x3 === 1 / y4) || x3 !== x3 && y4 !== y4;
|
|
1370
1370
|
}
|
|
1371
1371
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1372
|
-
var React = require$$0$3, shim2 = requireShim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef2 = React.useRef, useEffect2 = React.useEffect,
|
|
1372
|
+
var React = require$$0$3, shim2 = requireShim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef2 = React.useRef, useEffect2 = React.useEffect, useMemo2 = React.useMemo, useDebugValue2 = React.useDebugValue;
|
|
1373
1373
|
withSelector_development.useSyncExternalStoreWithSelector = function(subscribe2, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
1374
1374
|
var instRef = useRef2(null);
|
|
1375
1375
|
if (null === instRef.current) {
|
|
1376
1376
|
var inst = { hasValue: false, value: null };
|
|
1377
1377
|
instRef.current = inst;
|
|
1378
1378
|
} else inst = instRef.current;
|
|
1379
|
-
instRef =
|
|
1379
|
+
instRef = useMemo2(
|
|
1380
1380
|
function() {
|
|
1381
1381
|
function memoizedSelector(nextSnapshot) {
|
|
1382
1382
|
if (!hasMemo) {
|
|
@@ -1522,6 +1522,10 @@ const initialState$f = {
|
|
|
1522
1522
|
connect: {
|
|
1523
1523
|
es: "Conectar",
|
|
1524
1524
|
en: "Connect"
|
|
1525
|
+
},
|
|
1526
|
+
restore: {
|
|
1527
|
+
es: "Restaurar cuenta",
|
|
1528
|
+
en: "Restore account"
|
|
1525
1529
|
}
|
|
1526
1530
|
},
|
|
1527
1531
|
description: {
|
|
@@ -1609,13 +1613,19 @@ const useStoreUI = create((set2) => ({
|
|
|
1609
1613
|
checkApp: !state2.checkApp,
|
|
1610
1614
|
isCheckingAppActive: true
|
|
1611
1615
|
})),
|
|
1612
|
-
setIsCheckingAppActive: (isCheckingAppActive) => set2((state2) => ({ ...state2, isCheckingAppActive }))
|
|
1616
|
+
setIsCheckingAppActive: (isCheckingAppActive) => set2((state2) => ({ ...state2, isCheckingAppActive })),
|
|
1617
|
+
isOnDeletion: false,
|
|
1618
|
+
setIsOnDeletion: (isOnDeletion) => set2((state2) => ({ ...state2, isOnDeletion })),
|
|
1619
|
+
deletionAddress: "",
|
|
1620
|
+
setDeletionAddress: (deletionAddress) => set2((state2) => ({ ...state2, deletionAddress }))
|
|
1613
1621
|
}));
|
|
1614
1622
|
const initialState$e = {
|
|
1615
1623
|
modals: {
|
|
1616
1624
|
// appCreate: { enabled: false, show: false },
|
|
1617
1625
|
signin: { enabled: true, show: false },
|
|
1618
|
-
signup: { enabled: true, show: false }
|
|
1626
|
+
signup: { enabled: true, show: false },
|
|
1627
|
+
restore: { enabled: true, show: false },
|
|
1628
|
+
restorationExpired: { enabled: true, show: false }
|
|
1619
1629
|
}
|
|
1620
1630
|
};
|
|
1621
1631
|
const useStoreModals = create((set2) => ({
|
|
@@ -1638,16 +1648,16 @@ const useStoreModals = create((set2) => ({
|
|
|
1638
1648
|
}));
|
|
1639
1649
|
const initialState$d = {
|
|
1640
1650
|
defaultText: "Log In",
|
|
1641
|
-
defaultClick: (
|
|
1651
|
+
defaultClick: (_address) => {
|
|
1642
1652
|
},
|
|
1643
1653
|
loadingInterval: 500
|
|
1644
1654
|
};
|
|
1645
1655
|
function BtnSignin({
|
|
1646
1656
|
text = initialState$d.defaultText,
|
|
1647
|
-
onClick = initialState$d.defaultClick,
|
|
1657
|
+
onClick: _onClick = initialState$d.defaultClick,
|
|
1648
1658
|
loadingInterval: loadingInterval2 = initialState$d.loadingInterval,
|
|
1649
1659
|
isDisabled = false,
|
|
1650
|
-
selectedService = "",
|
|
1660
|
+
selectedService: _selectedService = "",
|
|
1651
1661
|
isEditable = false,
|
|
1652
1662
|
...props
|
|
1653
1663
|
}) {
|
|
@@ -1672,10 +1682,10 @@ function BtnSignin({
|
|
|
1672
1682
|
const setModal = useStoreModals((state2) => state2.setModal);
|
|
1673
1683
|
const [isConnecting, setIsConnecting] = useState(false);
|
|
1674
1684
|
useEffect(() => {
|
|
1675
|
-
const handleTxnResponse = () => {
|
|
1685
|
+
const handleTxnResponse = (_event) => {
|
|
1676
1686
|
setIsConnecting(false);
|
|
1677
1687
|
};
|
|
1678
|
-
const handleTxnClosed = () => {
|
|
1688
|
+
const handleTxnClosed = (_event) => {
|
|
1679
1689
|
setIsSigning(false);
|
|
1680
1690
|
setIsConnecting(false);
|
|
1681
1691
|
};
|
|
@@ -1704,7 +1714,6 @@ function BtnSignin({
|
|
|
1704
1714
|
}
|
|
1705
1715
|
};
|
|
1706
1716
|
useEffect(() => {
|
|
1707
|
-
console.log(isSigned, provider2, isServiceConnected);
|
|
1708
1717
|
if (isSigned || !provider2 || !isServiceConnected) return;
|
|
1709
1718
|
const loginInterval = setInterval(async () => {
|
|
1710
1719
|
if (!isSigning) return;
|
|
@@ -6226,19 +6235,19 @@ var __awaiter$b = function(thisArg, _arguments, P2, generator) {
|
|
|
6226
6235
|
resolve(value);
|
|
6227
6236
|
});
|
|
6228
6237
|
}
|
|
6229
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
6238
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
6230
6239
|
function fulfilled(value) {
|
|
6231
6240
|
try {
|
|
6232
6241
|
step(generator.next(value));
|
|
6233
6242
|
} catch (e3) {
|
|
6234
|
-
|
|
6243
|
+
reject2(e3);
|
|
6235
6244
|
}
|
|
6236
6245
|
}
|
|
6237
6246
|
function rejected(value) {
|
|
6238
6247
|
try {
|
|
6239
6248
|
step(generator["throw"](value));
|
|
6240
6249
|
} catch (e3) {
|
|
6241
|
-
|
|
6250
|
+
reject2(e3);
|
|
6242
6251
|
}
|
|
6243
6252
|
}
|
|
6244
6253
|
function step(result) {
|
|
@@ -9195,19 +9204,19 @@ var __awaiter$a = function(thisArg, _arguments, P2, generator) {
|
|
|
9195
9204
|
resolve(value);
|
|
9196
9205
|
});
|
|
9197
9206
|
}
|
|
9198
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
9207
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
9199
9208
|
function fulfilled(value) {
|
|
9200
9209
|
try {
|
|
9201
9210
|
step(generator.next(value));
|
|
9202
9211
|
} catch (e3) {
|
|
9203
|
-
|
|
9212
|
+
reject2(e3);
|
|
9204
9213
|
}
|
|
9205
9214
|
}
|
|
9206
9215
|
function rejected(value) {
|
|
9207
9216
|
try {
|
|
9208
9217
|
step(generator["throw"](value));
|
|
9209
9218
|
} catch (e3) {
|
|
9210
|
-
|
|
9219
|
+
reject2(e3);
|
|
9211
9220
|
}
|
|
9212
9221
|
}
|
|
9213
9222
|
function step(result) {
|
|
@@ -10173,19 +10182,19 @@ var __awaiter$9 = function(thisArg, _arguments, P2, generator) {
|
|
|
10173
10182
|
resolve(value);
|
|
10174
10183
|
});
|
|
10175
10184
|
}
|
|
10176
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
10185
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
10177
10186
|
function fulfilled(value) {
|
|
10178
10187
|
try {
|
|
10179
10188
|
step(generator.next(value));
|
|
10180
10189
|
} catch (e3) {
|
|
10181
|
-
|
|
10190
|
+
reject2(e3);
|
|
10182
10191
|
}
|
|
10183
10192
|
}
|
|
10184
10193
|
function rejected(value) {
|
|
10185
10194
|
try {
|
|
10186
10195
|
step(generator["throw"](value));
|
|
10187
10196
|
} catch (e3) {
|
|
10188
|
-
|
|
10197
|
+
reject2(e3);
|
|
10189
10198
|
}
|
|
10190
10199
|
}
|
|
10191
10200
|
function step(result) {
|
|
@@ -10241,19 +10250,19 @@ var __awaiter$8 = function(thisArg, _arguments, P2, generator) {
|
|
|
10241
10250
|
resolve(value);
|
|
10242
10251
|
});
|
|
10243
10252
|
}
|
|
10244
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
10253
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
10245
10254
|
function fulfilled(value) {
|
|
10246
10255
|
try {
|
|
10247
10256
|
step(generator.next(value));
|
|
10248
10257
|
} catch (e3) {
|
|
10249
|
-
|
|
10258
|
+
reject2(e3);
|
|
10250
10259
|
}
|
|
10251
10260
|
}
|
|
10252
10261
|
function rejected(value) {
|
|
10253
10262
|
try {
|
|
10254
10263
|
step(generator["throw"](value));
|
|
10255
10264
|
} catch (e3) {
|
|
10256
|
-
|
|
10265
|
+
reject2(e3);
|
|
10257
10266
|
}
|
|
10258
10267
|
}
|
|
10259
10268
|
function step(result) {
|
|
@@ -14358,19 +14367,19 @@ var __awaiter$7 = function(thisArg, _arguments, P2, generator) {
|
|
|
14358
14367
|
resolve(value);
|
|
14359
14368
|
});
|
|
14360
14369
|
}
|
|
14361
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
14370
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
14362
14371
|
function fulfilled(value) {
|
|
14363
14372
|
try {
|
|
14364
14373
|
step(generator.next(value));
|
|
14365
14374
|
} catch (e3) {
|
|
14366
|
-
|
|
14375
|
+
reject2(e3);
|
|
14367
14376
|
}
|
|
14368
14377
|
}
|
|
14369
14378
|
function rejected(value) {
|
|
14370
14379
|
try {
|
|
14371
14380
|
step(generator["throw"](value));
|
|
14372
14381
|
} catch (e3) {
|
|
14373
|
-
|
|
14382
|
+
reject2(e3);
|
|
14374
14383
|
}
|
|
14375
14384
|
}
|
|
14376
14385
|
function step(result) {
|
|
@@ -15240,19 +15249,19 @@ function sha256$2(data2) {
|
|
|
15240
15249
|
resolve(value);
|
|
15241
15250
|
});
|
|
15242
15251
|
}
|
|
15243
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
15252
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
15244
15253
|
function fulfilled(value) {
|
|
15245
15254
|
try {
|
|
15246
15255
|
step(generator.next(value));
|
|
15247
15256
|
} catch (e3) {
|
|
15248
|
-
|
|
15257
|
+
reject2(e3);
|
|
15249
15258
|
}
|
|
15250
15259
|
}
|
|
15251
15260
|
function rejected(value) {
|
|
15252
15261
|
try {
|
|
15253
15262
|
step(generator["throw"](value));
|
|
15254
15263
|
} catch (e3) {
|
|
15255
|
-
|
|
15264
|
+
reject2(e3);
|
|
15256
15265
|
}
|
|
15257
15266
|
}
|
|
15258
15267
|
function step(result) {
|
|
@@ -15514,19 +15523,19 @@ var __awaiter$6 = function(thisArg, _arguments, P2, generator) {
|
|
|
15514
15523
|
resolve(value);
|
|
15515
15524
|
});
|
|
15516
15525
|
}
|
|
15517
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
15526
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
15518
15527
|
function fulfilled(value) {
|
|
15519
15528
|
try {
|
|
15520
15529
|
step(generator.next(value));
|
|
15521
15530
|
} catch (e3) {
|
|
15522
|
-
|
|
15531
|
+
reject2(e3);
|
|
15523
15532
|
}
|
|
15524
15533
|
}
|
|
15525
15534
|
function rejected(value) {
|
|
15526
15535
|
try {
|
|
15527
15536
|
step(generator["throw"](value));
|
|
15528
15537
|
} catch (e3) {
|
|
15529
|
-
|
|
15538
|
+
reject2(e3);
|
|
15530
15539
|
}
|
|
15531
15540
|
}
|
|
15532
15541
|
function step(result) {
|
|
@@ -15596,19 +15605,19 @@ var __awaiter$5 = function(thisArg, _arguments, P2, generator) {
|
|
|
15596
15605
|
resolve(value);
|
|
15597
15606
|
});
|
|
15598
15607
|
}
|
|
15599
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
15608
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
15600
15609
|
function fulfilled(value) {
|
|
15601
15610
|
try {
|
|
15602
15611
|
step(generator.next(value));
|
|
15603
15612
|
} catch (e3) {
|
|
15604
|
-
|
|
15613
|
+
reject2(e3);
|
|
15605
15614
|
}
|
|
15606
15615
|
}
|
|
15607
15616
|
function rejected(value) {
|
|
15608
15617
|
try {
|
|
15609
15618
|
step(generator["throw"](value));
|
|
15610
15619
|
} catch (e3) {
|
|
15611
|
-
|
|
15620
|
+
reject2(e3);
|
|
15612
15621
|
}
|
|
15613
15622
|
}
|
|
15614
15623
|
function step(result) {
|
|
@@ -15739,14 +15748,14 @@ function _fetchData(connection, body, processFunc) {
|
|
|
15739
15748
|
options.headers = flatHeaders;
|
|
15740
15749
|
const runningTimeout = function() {
|
|
15741
15750
|
let timer2 = null;
|
|
15742
|
-
const promise = new Promise(function(resolve,
|
|
15751
|
+
const promise = new Promise(function(resolve, reject2) {
|
|
15743
15752
|
if (timeout) {
|
|
15744
15753
|
timer2 = setTimeout(() => {
|
|
15745
15754
|
if (timer2 == null) {
|
|
15746
15755
|
return;
|
|
15747
15756
|
}
|
|
15748
15757
|
timer2 = null;
|
|
15749
|
-
|
|
15758
|
+
reject2(logger$d.makeError("timeout", Logger$3.errors.TIMEOUT, {
|
|
15750
15759
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
15751
15760
|
requestMethod: options.method,
|
|
15752
15761
|
timeout,
|
|
@@ -15909,7 +15918,7 @@ function poll(func, options) {
|
|
|
15909
15918
|
if (options.interval == null) {
|
|
15910
15919
|
options.interval = 250;
|
|
15911
15920
|
}
|
|
15912
|
-
return new Promise(function(resolve,
|
|
15921
|
+
return new Promise(function(resolve, reject2) {
|
|
15913
15922
|
let timer2 = null;
|
|
15914
15923
|
let done2 = false;
|
|
15915
15924
|
const cancel = () => {
|
|
@@ -15925,7 +15934,7 @@ function poll(func, options) {
|
|
|
15925
15934
|
if (options.timeout) {
|
|
15926
15935
|
timer2 = setTimeout(() => {
|
|
15927
15936
|
if (cancel()) {
|
|
15928
|
-
|
|
15937
|
+
reject2(new Error("timeout"));
|
|
15929
15938
|
}
|
|
15930
15939
|
}, options.timeout);
|
|
15931
15940
|
}
|
|
@@ -15945,7 +15954,7 @@ function poll(func, options) {
|
|
|
15945
15954
|
attempt++;
|
|
15946
15955
|
if (attempt > retryLimit) {
|
|
15947
15956
|
if (cancel()) {
|
|
15948
|
-
|
|
15957
|
+
reject2(new Error("retry limit reached"));
|
|
15949
15958
|
}
|
|
15950
15959
|
return;
|
|
15951
15960
|
}
|
|
@@ -15961,7 +15970,7 @@ function poll(func, options) {
|
|
|
15961
15970
|
return null;
|
|
15962
15971
|
}, function(error2) {
|
|
15963
15972
|
if (cancel()) {
|
|
15964
|
-
|
|
15973
|
+
reject2(error2);
|
|
15965
15974
|
}
|
|
15966
15975
|
});
|
|
15967
15976
|
}
|
|
@@ -16527,19 +16536,19 @@ var __awaiter$4 = function(thisArg, _arguments, P2, generator) {
|
|
|
16527
16536
|
resolve(value);
|
|
16528
16537
|
});
|
|
16529
16538
|
}
|
|
16530
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
16539
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
16531
16540
|
function fulfilled(value) {
|
|
16532
16541
|
try {
|
|
16533
16542
|
step(generator.next(value));
|
|
16534
16543
|
} catch (e3) {
|
|
16535
|
-
|
|
16544
|
+
reject2(e3);
|
|
16536
16545
|
}
|
|
16537
16546
|
}
|
|
16538
16547
|
function rejected(value) {
|
|
16539
16548
|
try {
|
|
16540
16549
|
step(generator["throw"](value));
|
|
16541
16550
|
} catch (e3) {
|
|
16542
|
-
|
|
16551
|
+
reject2(e3);
|
|
16543
16552
|
}
|
|
16544
16553
|
}
|
|
16545
16554
|
function step(result) {
|
|
@@ -17469,7 +17478,7 @@ class BaseProvider extends Provider {
|
|
|
17469
17478
|
if ((receipt ? receipt.confirmations : 0) >= confirmations) {
|
|
17470
17479
|
return receipt;
|
|
17471
17480
|
}
|
|
17472
|
-
return new Promise((resolve,
|
|
17481
|
+
return new Promise((resolve, reject2) => {
|
|
17473
17482
|
const cancelFuncs = [];
|
|
17474
17483
|
let done2 = false;
|
|
17475
17484
|
const alreadyDone = function() {
|
|
@@ -17546,7 +17555,7 @@ class BaseProvider extends Provider {
|
|
|
17546
17555
|
} else if (tx.data === "0x" && tx.from === tx.to && tx.value.isZero()) {
|
|
17547
17556
|
reason = "cancelled";
|
|
17548
17557
|
}
|
|
17549
|
-
|
|
17558
|
+
reject2(logger$b.makeError("transaction was replaced", Logger$3.errors.TRANSACTION_REPLACED, {
|
|
17550
17559
|
cancelled: reason === "replaced" || reason === "cancelled",
|
|
17551
17560
|
reason,
|
|
17552
17561
|
replacement: this._wrapTransaction(tx),
|
|
@@ -17583,7 +17592,7 @@ class BaseProvider extends Provider {
|
|
|
17583
17592
|
if (alreadyDone()) {
|
|
17584
17593
|
return;
|
|
17585
17594
|
}
|
|
17586
|
-
|
|
17595
|
+
reject2(logger$b.makeError("timeout exceeded", Logger$3.errors.TIMEOUT, { timeout }));
|
|
17587
17596
|
}, timeout);
|
|
17588
17597
|
if (timer2.unref) {
|
|
17589
17598
|
timer2.unref();
|
|
@@ -18339,19 +18348,19 @@ var __awaiter$3 = function(thisArg, _arguments, P2, generator) {
|
|
|
18339
18348
|
resolve(value);
|
|
18340
18349
|
});
|
|
18341
18350
|
}
|
|
18342
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
18351
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
18343
18352
|
function fulfilled(value) {
|
|
18344
18353
|
try {
|
|
18345
18354
|
step(generator.next(value));
|
|
18346
18355
|
} catch (e3) {
|
|
18347
|
-
|
|
18356
|
+
reject2(e3);
|
|
18348
18357
|
}
|
|
18349
18358
|
}
|
|
18350
18359
|
function rejected(value) {
|
|
18351
18360
|
try {
|
|
18352
18361
|
step(generator["throw"](value));
|
|
18353
18362
|
} catch (e3) {
|
|
18354
|
-
|
|
18363
|
+
reject2(e3);
|
|
18355
18364
|
}
|
|
18356
18365
|
}
|
|
18357
18366
|
function step(result) {
|
|
@@ -18701,12 +18710,12 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
18701
18710
|
constructor(url, network) {
|
|
18702
18711
|
let networkOrReady = network;
|
|
18703
18712
|
if (networkOrReady == null) {
|
|
18704
|
-
networkOrReady = new Promise((resolve,
|
|
18713
|
+
networkOrReady = new Promise((resolve, reject2) => {
|
|
18705
18714
|
setTimeout(() => {
|
|
18706
18715
|
this.detectNetwork().then((network2) => {
|
|
18707
18716
|
resolve(network2);
|
|
18708
18717
|
}, (error2) => {
|
|
18709
|
-
|
|
18718
|
+
reject2(error2);
|
|
18710
18719
|
});
|
|
18711
18720
|
}, 0);
|
|
18712
18721
|
});
|
|
@@ -19009,19 +19018,19 @@ var __awaiter$2 = function(thisArg, _arguments, P2, generator) {
|
|
|
19009
19018
|
resolve(value);
|
|
19010
19019
|
});
|
|
19011
19020
|
}
|
|
19012
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
19021
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
19013
19022
|
function fulfilled(value) {
|
|
19014
19023
|
try {
|
|
19015
19024
|
step(generator.next(value));
|
|
19016
19025
|
} catch (e3) {
|
|
19017
|
-
|
|
19026
|
+
reject2(e3);
|
|
19018
19027
|
}
|
|
19019
19028
|
}
|
|
19020
19029
|
function rejected(value) {
|
|
19021
19030
|
try {
|
|
19022
19031
|
step(generator["throw"](value));
|
|
19023
19032
|
} catch (e3) {
|
|
19024
|
-
|
|
19033
|
+
reject2(e3);
|
|
19025
19034
|
}
|
|
19026
19035
|
}
|
|
19027
19036
|
function step(result) {
|
|
@@ -19145,10 +19154,10 @@ class WebSocketProvider extends JsonRpcProvider {
|
|
|
19145
19154
|
}
|
|
19146
19155
|
send(method2, params) {
|
|
19147
19156
|
const rid = NextId++;
|
|
19148
|
-
return new Promise((resolve,
|
|
19157
|
+
return new Promise((resolve, reject2) => {
|
|
19149
19158
|
function callback(error2, result) {
|
|
19150
19159
|
if (error2) {
|
|
19151
|
-
return
|
|
19160
|
+
return reject2(error2);
|
|
19152
19161
|
}
|
|
19153
19162
|
return resolve(result);
|
|
19154
19163
|
}
|
|
@@ -19279,19 +19288,19 @@ var __awaiter$1 = function(thisArg, _arguments, P2, generator) {
|
|
|
19279
19288
|
resolve(value);
|
|
19280
19289
|
});
|
|
19281
19290
|
}
|
|
19282
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
19291
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
19283
19292
|
function fulfilled(value) {
|
|
19284
19293
|
try {
|
|
19285
19294
|
step(generator.next(value));
|
|
19286
19295
|
} catch (e3) {
|
|
19287
|
-
|
|
19296
|
+
reject2(e3);
|
|
19288
19297
|
}
|
|
19289
19298
|
}
|
|
19290
19299
|
function rejected(value) {
|
|
19291
19300
|
try {
|
|
19292
19301
|
step(generator["throw"](value));
|
|
19293
19302
|
} catch (e3) {
|
|
19294
|
-
|
|
19303
|
+
reject2(e3);
|
|
19295
19304
|
}
|
|
19296
19305
|
}
|
|
19297
19306
|
function step(result) {
|
|
@@ -19476,7 +19485,7 @@ function buildWeb3LegacyFetcher(provider2, sendFunc) {
|
|
|
19476
19485
|
id: _nextId++,
|
|
19477
19486
|
jsonrpc: "2.0"
|
|
19478
19487
|
};
|
|
19479
|
-
return new Promise((resolve,
|
|
19488
|
+
return new Promise((resolve, reject2) => {
|
|
19480
19489
|
this.emit("debug", {
|
|
19481
19490
|
action: "request",
|
|
19482
19491
|
fetcher,
|
|
@@ -19492,7 +19501,7 @@ function buildWeb3LegacyFetcher(provider2, sendFunc) {
|
|
|
19492
19501
|
request,
|
|
19493
19502
|
provider: this
|
|
19494
19503
|
});
|
|
19495
|
-
return
|
|
19504
|
+
return reject2(error2);
|
|
19496
19505
|
}
|
|
19497
19506
|
this.emit("debug", {
|
|
19498
19507
|
action: "response",
|
|
@@ -19505,7 +19514,7 @@ function buildWeb3LegacyFetcher(provider2, sendFunc) {
|
|
|
19505
19514
|
const error3 = new Error(response.error.message);
|
|
19506
19515
|
error3.code = response.error.code;
|
|
19507
19516
|
error3.data = response.error.data;
|
|
19508
|
-
return
|
|
19517
|
+
return reject2(error3);
|
|
19509
19518
|
}
|
|
19510
19519
|
resolve(response.result);
|
|
19511
19520
|
});
|
|
@@ -22679,20 +22688,20 @@ const Metamask = new class Metamask2 {
|
|
|
22679
22688
|
this.ethereum.off("accountsChanged", this.onAccountsChange);
|
|
22680
22689
|
}
|
|
22681
22690
|
async onChainChanged(chainId) {
|
|
22682
|
-
return new Promise((resolve,
|
|
22691
|
+
return new Promise((resolve, reject2) => {
|
|
22683
22692
|
try {
|
|
22684
22693
|
resolve(chainId);
|
|
22685
22694
|
} catch (err) {
|
|
22686
|
-
|
|
22695
|
+
reject2(err);
|
|
22687
22696
|
}
|
|
22688
22697
|
});
|
|
22689
22698
|
}
|
|
22690
22699
|
async onAccountsChange(accounts) {
|
|
22691
|
-
return new Promise((resolve,
|
|
22700
|
+
return new Promise((resolve, reject2) => {
|
|
22692
22701
|
try {
|
|
22693
22702
|
resolve(accounts);
|
|
22694
22703
|
} catch (err) {
|
|
22695
|
-
|
|
22704
|
+
reject2(err);
|
|
22696
22705
|
}
|
|
22697
22706
|
});
|
|
22698
22707
|
}
|
|
@@ -22702,7 +22711,7 @@ const Metamask = new class Metamask2 {
|
|
|
22702
22711
|
return this.ethereum._metamask.isUnlocked();
|
|
22703
22712
|
}
|
|
22704
22713
|
async getProvider(providerType = "rpc") {
|
|
22705
|
-
return new Promise((resolve,
|
|
22714
|
+
return new Promise((resolve, reject2) => {
|
|
22706
22715
|
try {
|
|
22707
22716
|
const typeSelected = {
|
|
22708
22717
|
rpc: new JsonRpcProvider(this.rpcUrl),
|
|
@@ -22710,7 +22719,7 @@ const Metamask = new class Metamask2 {
|
|
|
22710
22719
|
}[providerType];
|
|
22711
22720
|
resolve(typeSelected);
|
|
22712
22721
|
} catch (err) {
|
|
22713
|
-
|
|
22722
|
+
reject2(err);
|
|
22714
22723
|
}
|
|
22715
22724
|
});
|
|
22716
22725
|
}
|
|
@@ -22718,7 +22727,7 @@ const Metamask = new class Metamask2 {
|
|
|
22718
22727
|
* This method just works with extension provider
|
|
22719
22728
|
*/
|
|
22720
22729
|
async getAccount(position = 0) {
|
|
22721
|
-
return new Promise(async (resolve,
|
|
22730
|
+
return new Promise(async (resolve, reject2) => {
|
|
22722
22731
|
try {
|
|
22723
22732
|
const provider2 = await this.getProvider("extension");
|
|
22724
22733
|
const accounts = await provider2.provider.request({
|
|
@@ -22726,17 +22735,17 @@ const Metamask = new class Metamask2 {
|
|
|
22726
22735
|
});
|
|
22727
22736
|
resolve(accounts[position]);
|
|
22728
22737
|
} catch (err) {
|
|
22729
|
-
|
|
22738
|
+
reject2(err);
|
|
22730
22739
|
}
|
|
22731
22740
|
});
|
|
22732
22741
|
}
|
|
22733
22742
|
async getSigner(account, providerType = "rpc") {
|
|
22734
|
-
return new Promise(async (resolve,
|
|
22743
|
+
return new Promise(async (resolve, reject2) => {
|
|
22735
22744
|
try {
|
|
22736
22745
|
const provider2 = await this.getProvider(providerType);
|
|
22737
22746
|
resolve(provider2.getSigner(account));
|
|
22738
22747
|
} catch (err) {
|
|
22739
|
-
|
|
22748
|
+
reject2(err);
|
|
22740
22749
|
}
|
|
22741
22750
|
});
|
|
22742
22751
|
}
|
|
@@ -22744,7 +22753,7 @@ const Metamask = new class Metamask2 {
|
|
|
22744
22753
|
* docs: https://docs.ethers.io/v5/api/providers/provider/#Provider-getBalance
|
|
22745
22754
|
*/
|
|
22746
22755
|
async getBalance(account, providerType = "rpc", blockTag = void 0) {
|
|
22747
|
-
return new Promise(async (resolve,
|
|
22756
|
+
return new Promise(async (resolve, reject2) => {
|
|
22748
22757
|
try {
|
|
22749
22758
|
const provider2 = await this.getProvider(providerType);
|
|
22750
22759
|
let blockTagSelected = {
|
|
@@ -22761,12 +22770,12 @@ const Metamask = new class Metamask2 {
|
|
|
22761
22770
|
});
|
|
22762
22771
|
resolve(formatEther(balance));
|
|
22763
22772
|
} catch (err) {
|
|
22764
|
-
|
|
22773
|
+
reject2(err);
|
|
22765
22774
|
}
|
|
22766
22775
|
});
|
|
22767
22776
|
}
|
|
22768
22777
|
async getContract(contractAddr, contractAbi, providerType = "rpc") {
|
|
22769
|
-
return new Promise(async (resolve,
|
|
22778
|
+
return new Promise(async (resolve, reject2) => {
|
|
22770
22779
|
try {
|
|
22771
22780
|
const provider2 = await this.getProvider(providerType);
|
|
22772
22781
|
const contract = new Contract(
|
|
@@ -22776,23 +22785,23 @@ const Metamask = new class Metamask2 {
|
|
|
22776
22785
|
);
|
|
22777
22786
|
resolve(contract);
|
|
22778
22787
|
} catch (err) {
|
|
22779
|
-
|
|
22788
|
+
reject2(err);
|
|
22780
22789
|
}
|
|
22781
22790
|
});
|
|
22782
22791
|
}
|
|
22783
22792
|
async getContractWithSigner(contractAddr, contractAbi, account, providerType = "rpc") {
|
|
22784
|
-
return new Promise(async (resolve,
|
|
22793
|
+
return new Promise(async (resolve, reject2) => {
|
|
22785
22794
|
try {
|
|
22786
22795
|
const signer = await this.getSigner(account, providerType);
|
|
22787
22796
|
const contract = new Contract(contractAddr, contractAbi, signer);
|
|
22788
22797
|
resolve(contract);
|
|
22789
22798
|
} catch (err) {
|
|
22790
|
-
|
|
22799
|
+
reject2(err);
|
|
22791
22800
|
}
|
|
22792
22801
|
});
|
|
22793
22802
|
}
|
|
22794
22803
|
async getContractFromConfig(contractName, providerType = "rpc") {
|
|
22795
|
-
return new Promise(async (resolve,
|
|
22804
|
+
return new Promise(async (resolve, reject2) => {
|
|
22796
22805
|
try {
|
|
22797
22806
|
const provider2 = await this.getProvider(providerType);
|
|
22798
22807
|
const contract = new Contract(
|
|
@@ -22802,7 +22811,7 @@ const Metamask = new class Metamask2 {
|
|
|
22802
22811
|
);
|
|
22803
22812
|
resolve(contract);
|
|
22804
22813
|
} catch (err) {
|
|
22805
|
-
|
|
22814
|
+
reject2(err);
|
|
22806
22815
|
}
|
|
22807
22816
|
});
|
|
22808
22817
|
}
|
|
@@ -22813,7 +22822,7 @@ const Metamask = new class Metamask2 {
|
|
|
22813
22822
|
currencySymbol = "ETH",
|
|
22814
22823
|
explorerUrl = void 0
|
|
22815
22824
|
}) {
|
|
22816
|
-
return new Promise(async (resolve,
|
|
22825
|
+
return new Promise(async (resolve, reject2) => {
|
|
22817
22826
|
try {
|
|
22818
22827
|
const _explorerUrl = explorerUrl ?? this.rpcExplorerUrl;
|
|
22819
22828
|
const res = await window.ethereum.request({
|
|
@@ -22836,7 +22845,7 @@ const Metamask = new class Metamask2 {
|
|
|
22836
22845
|
});
|
|
22837
22846
|
resolve(res);
|
|
22838
22847
|
} catch (err) {
|
|
22839
|
-
|
|
22848
|
+
reject2(err);
|
|
22840
22849
|
}
|
|
22841
22850
|
});
|
|
22842
22851
|
}
|
|
@@ -22892,8 +22901,8 @@ const Metamask = new class Metamask2 {
|
|
|
22892
22901
|
}
|
|
22893
22902
|
return pageIds;
|
|
22894
22903
|
}
|
|
22895
|
-
async signMessage(message, account, pwd,
|
|
22896
|
-
return new Promise(async (resolve,
|
|
22904
|
+
async signMessage(message, account, pwd, _providerType = "extension") {
|
|
22905
|
+
return new Promise(async (resolve, _reject) => {
|
|
22897
22906
|
try {
|
|
22898
22907
|
const from2 = getAddress(
|
|
22899
22908
|
account || // @ts-ignore
|
|
@@ -22912,8 +22921,8 @@ const Metamask = new class Metamask2 {
|
|
|
22912
22921
|
}
|
|
22913
22922
|
});
|
|
22914
22923
|
}
|
|
22915
|
-
async verifyMessage(message, signature2, account,
|
|
22916
|
-
return new Promise(async (resolve,
|
|
22924
|
+
async verifyMessage(message, signature2, account, _providerType = "extension") {
|
|
22925
|
+
return new Promise(async (resolve, _reject) => {
|
|
22917
22926
|
try {
|
|
22918
22927
|
const from2 = getAddress(
|
|
22919
22928
|
account || // @ts-ignore
|
|
@@ -22935,13 +22944,13 @@ const Metamask = new class Metamask2 {
|
|
|
22935
22944
|
async getChainId(providerType = "extension") {
|
|
22936
22945
|
if (providerType !== "extension")
|
|
22937
22946
|
throw Error("rpc provider is not supported, use extension instead");
|
|
22938
|
-
return new Promise(async (resolve,
|
|
22947
|
+
return new Promise(async (resolve, reject2) => {
|
|
22939
22948
|
try {
|
|
22940
22949
|
const chainId = await window.ethereum.request({ method: "eth_chainId" });
|
|
22941
22950
|
if (!chainId) throw Error("chainId not found");
|
|
22942
22951
|
resolve(chainId);
|
|
22943
22952
|
} catch (err) {
|
|
22944
|
-
|
|
22953
|
+
reject2(err);
|
|
22945
22954
|
}
|
|
22946
22955
|
});
|
|
22947
22956
|
}
|
|
@@ -25514,8 +25523,8 @@ const Phantom = new class Phantom2 {
|
|
|
25514
25523
|
async getChainId() {
|
|
25515
25524
|
return "mainnet-beta";
|
|
25516
25525
|
}
|
|
25517
|
-
async signMessage(message,
|
|
25518
|
-
return new Promise(async (resolve,
|
|
25526
|
+
async signMessage(message, _account) {
|
|
25527
|
+
return new Promise(async (resolve, _reject) => {
|
|
25519
25528
|
try {
|
|
25520
25529
|
const provider2 = await this.getProvider();
|
|
25521
25530
|
const _message = message || "Hello World from the Create React dapp!";
|
|
@@ -25535,7 +25544,7 @@ const Phantom = new class Phantom2 {
|
|
|
25535
25544
|
});
|
|
25536
25545
|
}
|
|
25537
25546
|
async verifyMessage(message, signature2) {
|
|
25538
|
-
return new Promise((resolve,
|
|
25547
|
+
return new Promise((resolve, reject2) => {
|
|
25539
25548
|
try {
|
|
25540
25549
|
if (!this.publicKeyString) throw new Error("Phantom not connected");
|
|
25541
25550
|
const publicKey = new PublicKey(this.publicKeyString);
|
|
@@ -25548,7 +25557,7 @@ const Phantom = new class Phantom2 {
|
|
|
25548
25557
|
resolve(isValid4);
|
|
25549
25558
|
} catch (err) {
|
|
25550
25559
|
console.log(err);
|
|
25551
|
-
|
|
25560
|
+
reject2(err);
|
|
25552
25561
|
}
|
|
25553
25562
|
});
|
|
25554
25563
|
}
|
|
@@ -25797,13 +25806,16 @@ function Txn({
|
|
|
25797
25806
|
lifetimeSign = 28800,
|
|
25798
25807
|
setLifetimeSign = (value) => {
|
|
25799
25808
|
},
|
|
25809
|
+
// eslint-disable-line no-unused-vars
|
|
25800
25810
|
lifetimeData = {},
|
|
25801
25811
|
lifetimeSliderRef = null,
|
|
25802
25812
|
txnLifetimeHovered = false,
|
|
25803
25813
|
setTxnLifetimeHovered = (value) => {
|
|
25804
25814
|
},
|
|
25815
|
+
// eslint-disable-line no-unused-vars
|
|
25805
25816
|
addError = (message) => {
|
|
25806
25817
|
},
|
|
25818
|
+
// eslint-disable-line no-unused-vars
|
|
25807
25819
|
selectedTxnPreParams = {},
|
|
25808
25820
|
permissionsRequiredTxt = "Permissions required",
|
|
25809
25821
|
solicitedDataTxt = "Solicited data",
|
|
@@ -25823,7 +25835,7 @@ function Txn({
|
|
|
25823
25835
|
const socket = useStoreWS((state2) => state2.socket);
|
|
25824
25836
|
const token2 = useStoreWS((state2) => state2.token);
|
|
25825
25837
|
const requests = useStoreWS((state2) => state2.requests);
|
|
25826
|
-
const
|
|
25838
|
+
const setIsAcceptingTxn = useStoreUI((state2) => state2.setIsAcceptingTxn);
|
|
25827
25839
|
const serviceName = useStoreUI((state2) => state2.serviceName);
|
|
25828
25840
|
const [PPTCAccepted, setPPTCAccepted] = useState(false);
|
|
25829
25841
|
const [showLifetime, setShowLifetime] = useState(lifetimeData.isFirstTime);
|
|
@@ -25837,7 +25849,7 @@ function Txn({
|
|
|
25837
25849
|
setLifetimeTimeValue(getTimeBySec(value));
|
|
25838
25850
|
};
|
|
25839
25851
|
const close = () => {
|
|
25840
|
-
|
|
25852
|
+
setIsAcceptingTxn(false);
|
|
25841
25853
|
setPPTCAccepted(false);
|
|
25842
25854
|
closeModal();
|
|
25843
25855
|
};
|
|
@@ -25853,7 +25865,7 @@ function Txn({
|
|
|
25853
25865
|
close();
|
|
25854
25866
|
};
|
|
25855
25867
|
const onTxnAcceptClicked = async () => {
|
|
25856
|
-
|
|
25868
|
+
setIsAcceptingTxn(true);
|
|
25857
25869
|
if (!selectedTxnPreParams) return addError("no_transactions_params_found");
|
|
25858
25870
|
if (!selectedTxnPreParams.appKey) return addError("no_app_key_found");
|
|
25859
25871
|
if (!selectedTxnPreParams.to) return addError("no_contract_address_found");
|
|
@@ -26343,7 +26355,7 @@ function TxnsOverview({
|
|
|
26343
26355
|
const animatedBaseRef = useRef(null);
|
|
26344
26356
|
const txns = useStoreWS((state2) => state2.requests);
|
|
26345
26357
|
const isSigning = useStoreUI((state2) => state2.isSigning);
|
|
26346
|
-
const
|
|
26358
|
+
const setIsAcceptingTxn = useStoreUI((state2) => state2.setIsAcceptingTxn);
|
|
26347
26359
|
const did = useStoreWS((state2) => state2.did);
|
|
26348
26360
|
const [lifetime, setLifetime] = useState(3600);
|
|
26349
26361
|
const [txnLifetimeHovered, setTxnLifetimeHovered] = useState(false);
|
|
@@ -26380,7 +26392,7 @@ function TxnsOverview({
|
|
|
26380
26392
|
};
|
|
26381
26393
|
const addError = (messageSlug = "unknown") => {
|
|
26382
26394
|
setError({ value: true, messageSlug });
|
|
26383
|
-
|
|
26395
|
+
setIsAcceptingTxn(false);
|
|
26384
26396
|
};
|
|
26385
26397
|
useEffect(() => {
|
|
26386
26398
|
if (!txns || txns.length === 0) {
|
|
@@ -28506,12 +28518,12 @@ function renderCanvas$1(renderFunc, canvas2, text, opts, cb) {
|
|
|
28506
28518
|
text = canvas2;
|
|
28507
28519
|
canvas2 = void 0;
|
|
28508
28520
|
}
|
|
28509
|
-
return new Promise(function(resolve,
|
|
28521
|
+
return new Promise(function(resolve, reject2) {
|
|
28510
28522
|
try {
|
|
28511
28523
|
const data2 = QRCode$1.create(text, opts);
|
|
28512
28524
|
resolve(renderFunc(data2, canvas2, opts));
|
|
28513
28525
|
} catch (e3) {
|
|
28514
|
-
|
|
28526
|
+
reject2(e3);
|
|
28515
28527
|
}
|
|
28516
28528
|
});
|
|
28517
28529
|
}
|
|
@@ -28535,7 +28547,7 @@ function WrapperEditables({
|
|
|
28535
28547
|
editableBtnBgColor = "bas-bg-[var(--bal-primary-600)]",
|
|
28536
28548
|
editableBtnSpanBgColor = "bas-bg-[var(--bal-primary-100)]",
|
|
28537
28549
|
isOpen = false,
|
|
28538
|
-
setIsOpen = (
|
|
28550
|
+
setIsOpen = (_value) => {
|
|
28539
28551
|
},
|
|
28540
28552
|
wrapperBaseId = "wrapper-base-id",
|
|
28541
28553
|
variants = {},
|
|
@@ -28595,7 +28607,7 @@ function FiltersEditable({
|
|
|
28595
28607
|
enableWebTypeFilter: false
|
|
28596
28608
|
}
|
|
28597
28609
|
},
|
|
28598
|
-
setUiConfigEditable = (
|
|
28610
|
+
setUiConfigEditable = (_value) => {
|
|
28599
28611
|
},
|
|
28600
28612
|
language = "en",
|
|
28601
28613
|
providersFiltersEnabled = false,
|
|
@@ -28705,6 +28717,7 @@ function ProvidersFilters({
|
|
|
28705
28717
|
openWebType = false,
|
|
28706
28718
|
setOpenWebType = (value) => {
|
|
28707
28719
|
},
|
|
28720
|
+
// eslint-disable-line no-unused-vars
|
|
28708
28721
|
selectedWebType = webTypesDefaultItems$1[0],
|
|
28709
28722
|
webTypesItems = webTypesDefaultItems$1,
|
|
28710
28723
|
onChangeWebType = () => {
|
|
@@ -28814,7 +28827,7 @@ function ProvidersButtonsDnDItem({
|
|
|
28814
28827
|
},
|
|
28815
28828
|
onDragEnd = () => {
|
|
28816
28829
|
},
|
|
28817
|
-
onActiveProviderChange = (
|
|
28830
|
+
onActiveProviderChange = (_name, _value) => {
|
|
28818
28831
|
}
|
|
28819
28832
|
}) {
|
|
28820
28833
|
const y4 = useMotionValue(0);
|
|
@@ -28871,7 +28884,7 @@ function ProvidersButtonsDnDItem({
|
|
|
28871
28884
|
}
|
|
28872
28885
|
function ProvidersButtonsDnD({
|
|
28873
28886
|
uiConfigEditable = {},
|
|
28874
|
-
setUiConfigEditable = (
|
|
28887
|
+
setUiConfigEditable = (_value) => {
|
|
28875
28888
|
},
|
|
28876
28889
|
uiConfigProvidersInfo = {}
|
|
28877
28890
|
}) {
|
|
@@ -28955,7 +28968,7 @@ function ProvidersButtonsDnD({
|
|
|
28955
28968
|
}
|
|
28956
28969
|
function ProvidersButtonsEditable({
|
|
28957
28970
|
uiConfigEditable = {},
|
|
28958
|
-
setUiConfigEditable = (
|
|
28971
|
+
setUiConfigEditable = (_value) => {
|
|
28959
28972
|
},
|
|
28960
28973
|
language = "es",
|
|
28961
28974
|
isOpenProvidersBtnsEditable = false,
|
|
@@ -29152,7 +29165,7 @@ function ProvidersButtons({
|
|
|
29152
29165
|
},
|
|
29153
29166
|
showedProviders = [],
|
|
29154
29167
|
selectedService = "",
|
|
29155
|
-
setSelectedService = (
|
|
29168
|
+
setSelectedService = (_value) => {
|
|
29156
29169
|
},
|
|
29157
29170
|
isEditable = false,
|
|
29158
29171
|
isEditing = false,
|
|
@@ -29412,9 +29425,9 @@ function ProvidersSection({
|
|
|
29412
29425
|
setSelectedService = () => {
|
|
29413
29426
|
},
|
|
29414
29427
|
showedProviders = [],
|
|
29415
|
-
onChangeWebType = (
|
|
29428
|
+
onChangeWebType = (_value) => {
|
|
29416
29429
|
},
|
|
29417
|
-
onChangeProviderSearch = (
|
|
29430
|
+
onChangeProviderSearch = (_value) => {
|
|
29418
29431
|
},
|
|
29419
29432
|
isEditable = false,
|
|
29420
29433
|
isEditing = false,
|
|
@@ -29597,13 +29610,19 @@ const EXTERNAL_SERVICE_CONFIG = JSON.stringify({
|
|
|
29597
29610
|
networkId: ""
|
|
29598
29611
|
});
|
|
29599
29612
|
const BrowserBase = new class BrowserBase2 {
|
|
29600
|
-
reset() {
|
|
29601
|
-
|
|
29602
|
-
|
|
29603
|
-
|
|
29604
|
-
|
|
29605
|
-
|
|
29606
|
-
|
|
29613
|
+
reset(target = "all") {
|
|
29614
|
+
if (target === "all" || target === "ui") {
|
|
29615
|
+
localStorage.removeItem(UI);
|
|
29616
|
+
this.getUI();
|
|
29617
|
+
}
|
|
29618
|
+
if (target === "all" || target === "session") {
|
|
29619
|
+
localStorage.removeItem(SESSION);
|
|
29620
|
+
this.getSession();
|
|
29621
|
+
}
|
|
29622
|
+
if (target === "all" || target === "external") {
|
|
29623
|
+
localStorage.removeItem(EXTERNAL_SERVICE);
|
|
29624
|
+
this.getExternalService();
|
|
29625
|
+
}
|
|
29607
29626
|
}
|
|
29608
29627
|
/**
|
|
29609
29628
|
* Obtains the current configuration of the extension
|
|
@@ -29859,8 +29878,79 @@ const useBlockAuthWs = (apiKey = "", apiSecret = "", wsUrl = "wss://wss.block-au
|
|
|
29859
29878
|
};
|
|
29860
29879
|
}, [ready, provider2, checkApp]);
|
|
29861
29880
|
};
|
|
29881
|
+
const DeletionService = {
|
|
29882
|
+
handleUserDeleted: (forAddress, hookState) => {
|
|
29883
|
+
if (hookState.current.isHandlingDeletion) return;
|
|
29884
|
+
const currentSession = BrowserBase.getSession();
|
|
29885
|
+
const currentExternal = BrowserBase.getExternalService();
|
|
29886
|
+
const sessionDid = currentSession.did;
|
|
29887
|
+
const externalDid = currentExternal.did;
|
|
29888
|
+
const isSessionMatch = forAddress && sessionDid && forAddress.toLowerCase() === sessionDid.toLowerCase();
|
|
29889
|
+
const isExternalMatch = forAddress && externalDid && forAddress.toLowerCase() === externalDid.toLowerCase();
|
|
29890
|
+
if (forAddress && !isSessionMatch && !isExternalMatch) {
|
|
29891
|
+
console.warn(
|
|
29892
|
+
`[sdk][DeletionService] Received deletion event for ${forAddress}, but current DIDs are session:${sessionDid}, external:${externalDid}. Ignoring stale event.`
|
|
29893
|
+
);
|
|
29894
|
+
return;
|
|
29895
|
+
}
|
|
29896
|
+
hookState.current.isHandlingDeletion = true;
|
|
29897
|
+
const wasInstalled = BrowserBase.getUI().installed;
|
|
29898
|
+
if (isExternalMatch && !isSessionMatch) {
|
|
29899
|
+
BrowserBase.reset("external");
|
|
29900
|
+
} else {
|
|
29901
|
+
BrowserBase.reset("all");
|
|
29902
|
+
}
|
|
29903
|
+
if (wasInstalled) {
|
|
29904
|
+
const ui2 = BrowserBase.getUI();
|
|
29905
|
+
ui2.installed = true;
|
|
29906
|
+
localStorage.setItem("blockauth-ui", JSON.stringify(ui2));
|
|
29907
|
+
}
|
|
29908
|
+
try {
|
|
29909
|
+
const event = new CustomEvent("ext:reset", {
|
|
29910
|
+
detail: { address: forAddress }
|
|
29911
|
+
});
|
|
29912
|
+
document.dispatchEvent(event);
|
|
29913
|
+
} catch (e3) {
|
|
29914
|
+
console.warn(
|
|
29915
|
+
"[sdk][DeletionService] Failed to dispatch ext:reset event",
|
|
29916
|
+
e3
|
|
29917
|
+
);
|
|
29918
|
+
}
|
|
29919
|
+
const {
|
|
29920
|
+
setIsOnDeletion,
|
|
29921
|
+
setIsSigning,
|
|
29922
|
+
setIsSigningLoader,
|
|
29923
|
+
setIsServiceConnected,
|
|
29924
|
+
setIsSigned,
|
|
29925
|
+
setIsSignedFirstCheck
|
|
29926
|
+
} = useStoreUI.getState();
|
|
29927
|
+
setIsOnDeletion(false);
|
|
29928
|
+
setIsSigning(false);
|
|
29929
|
+
setIsSigningLoader(false);
|
|
29930
|
+
setIsServiceConnected(false);
|
|
29931
|
+
setIsSigned(false);
|
|
29932
|
+
setIsSignedFirstCheck(true);
|
|
29933
|
+
hookState.current.isSigning = false;
|
|
29934
|
+
hookState.current.isSigned = false;
|
|
29935
|
+
hookState.current.isUnsignTimeoutSet = false;
|
|
29936
|
+
const { provider: provider2, setProvider, setSocket, setReady, setDid, setToken } = useStoreWS.getState();
|
|
29937
|
+
if (provider2) {
|
|
29938
|
+
try {
|
|
29939
|
+
provider2.disconnect();
|
|
29940
|
+
} catch (e3) {
|
|
29941
|
+
console.warn("[sdk][DeletionService] Failed to disconnect provider", e3);
|
|
29942
|
+
}
|
|
29943
|
+
}
|
|
29944
|
+
setProvider(null);
|
|
29945
|
+
setSocket(null);
|
|
29946
|
+
setReady(false);
|
|
29947
|
+
setDid(null);
|
|
29948
|
+
setToken(null);
|
|
29949
|
+
useStoreModals.getState().setModal("restorationExpired", { enabled: true, show: true });
|
|
29950
|
+
}
|
|
29951
|
+
};
|
|
29862
29952
|
let getUserTxnsInterval = null;
|
|
29863
|
-
const useBlockAuthWsData = (onSuccess = async (
|
|
29953
|
+
const useBlockAuthWsData = (onSuccess = async (_address = "") => {
|
|
29864
29954
|
}, onError = async () => {
|
|
29865
29955
|
}, onLogout = async () => {
|
|
29866
29956
|
}) => {
|
|
@@ -29868,7 +29958,8 @@ const useBlockAuthWsData = (onSuccess = async (address = "") => {
|
|
|
29868
29958
|
const hookState = useRef({
|
|
29869
29959
|
isUnsignTimeoutSet: false,
|
|
29870
29960
|
isSigned: false,
|
|
29871
|
-
isSigning: false
|
|
29961
|
+
isSigning: false,
|
|
29962
|
+
lastCheckedDid: null
|
|
29872
29963
|
});
|
|
29873
29964
|
const ready = useStoreWS((state2) => state2.ready);
|
|
29874
29965
|
const provider2 = useStoreWS((state2) => state2.provider);
|
|
@@ -29878,7 +29969,7 @@ const useBlockAuthWsData = (onSuccess = async (address = "") => {
|
|
|
29878
29969
|
const setIsSigned = useStoreUI((state2) => state2.setIsSigned);
|
|
29879
29970
|
const setIsSigning = useStoreUI((state2) => state2.setIsSigning);
|
|
29880
29971
|
const setIsSigningLoader = useStoreUI((state2) => state2.setIsSigningLoader);
|
|
29881
|
-
const
|
|
29972
|
+
const setIsAcceptingTxn = useStoreUI((state2) => state2.setIsAcceptingTxn);
|
|
29882
29973
|
const setIsServiceConnected = useStoreUI(
|
|
29883
29974
|
(state2) => state2.setIsServiceConnected
|
|
29884
29975
|
);
|
|
@@ -29893,6 +29984,7 @@ const useBlockAuthWsData = (onSuccess = async (address = "") => {
|
|
|
29893
29984
|
const setOnSuccess = useStoreUI((state2) => state2.setOnSuccess);
|
|
29894
29985
|
const setOnError = useStoreUI((state2) => state2.setOnError);
|
|
29895
29986
|
const setOnLogout = useStoreUI((state2) => state2.setOnLogout);
|
|
29987
|
+
const setIsOnDeletion = useStoreUI((state2) => state2.setIsOnDeletion);
|
|
29896
29988
|
const closeModal = useStoreModals((state2) => state2.closeModal);
|
|
29897
29989
|
const _onSuccess = async (address) => {
|
|
29898
29990
|
await onSuccess(address);
|
|
@@ -29906,7 +29998,7 @@ const useBlockAuthWsData = (onSuccess = async (address = "") => {
|
|
|
29906
29998
|
setIsSigned(false);
|
|
29907
29999
|
setIsSigning(false);
|
|
29908
30000
|
setIsSigningLoader(false);
|
|
29909
|
-
|
|
30001
|
+
setIsAcceptingTxn(false);
|
|
29910
30002
|
await onError();
|
|
29911
30003
|
};
|
|
29912
30004
|
const _onLogout = async () => {
|
|
@@ -29936,7 +30028,7 @@ const useBlockAuthWsData = (onSuccess = async (address = "") => {
|
|
|
29936
30028
|
setWaitingForSuccessLogInSince(0);
|
|
29937
30029
|
};
|
|
29938
30030
|
const isUserSignedIn = async () => {
|
|
29939
|
-
var _a3, _b2;
|
|
30031
|
+
var _a3, _b2, _c, _d;
|
|
29940
30032
|
const isConnected = BrowserBase.getExternalService().connected;
|
|
29941
30033
|
if (isConnected && ((_b2 = (_a3 = provider2.wsc) == null ? void 0 : _a3.accessToken) == null ? void 0 : _b2.length) > 0) {
|
|
29942
30034
|
const _accessToken = provider2.wsc.accessToken;
|
|
@@ -29948,8 +30040,17 @@ const useBlockAuthWsData = (onSuccess = async (address = "") => {
|
|
|
29948
30040
|
token: _accessToken,
|
|
29949
30041
|
address: currentDid
|
|
29950
30042
|
});
|
|
29951
|
-
} else
|
|
29952
|
-
|
|
30043
|
+
} else {
|
|
30044
|
+
const session = BrowserBase.getSession();
|
|
30045
|
+
if (session.did && ((_d = (_c = provider2.wsc) == null ? void 0 : _c.accessToken) == null ? void 0 : _d.length) > 0) {
|
|
30046
|
+
const _accessToken = provider2.wsc.accessToken;
|
|
30047
|
+
hookState.current.lastCheckedDid = session.did;
|
|
30048
|
+
provider2.wsc.emit("sdk:checkStatus", {
|
|
30049
|
+
token: _accessToken,
|
|
30050
|
+
address: session.did
|
|
30051
|
+
});
|
|
30052
|
+
}
|
|
30053
|
+
if (!isConnected) setIsSignedFirstCheck(true);
|
|
29953
30054
|
}
|
|
29954
30055
|
};
|
|
29955
30056
|
const setUnsignTimeout = (signedExpiredAtDateString = (/* @__PURE__ */ new Date()).toISOString().slice(0, -1), did = "") => {
|
|
@@ -30050,15 +30151,55 @@ const useBlockAuthWsData = (onSuccess = async (address = "") => {
|
|
|
30050
30151
|
} else signinUnsigned();
|
|
30051
30152
|
setIsSignedFirstCheck(true);
|
|
30052
30153
|
};
|
|
30154
|
+
const handleUserDeleted = (forAddress = null) => {
|
|
30155
|
+
DeletionService.handleUserDeleted(forAddress, hookState);
|
|
30156
|
+
};
|
|
30053
30157
|
const onSigninCorrupted = async (data2) => {
|
|
30054
|
-
|
|
30158
|
+
const corruptedAddress = data2 == null ? void 0 : data2.address;
|
|
30159
|
+
if (!corruptedAddress) {
|
|
30160
|
+
console.warn(
|
|
30161
|
+
"[sdk] signin:corrupted received without address, ignoring to protect new accounts"
|
|
30162
|
+
);
|
|
30163
|
+
return;
|
|
30164
|
+
}
|
|
30165
|
+
handleUserDeleted(corruptedAddress);
|
|
30055
30166
|
};
|
|
30056
|
-
const onSigninExpired = async (
|
|
30167
|
+
const onSigninExpired = async (_data) => {
|
|
30057
30168
|
_onError();
|
|
30058
30169
|
};
|
|
30059
|
-
const onSigninUnsigned = async (
|
|
30170
|
+
const onSigninUnsigned = async (_data) => {
|
|
30060
30171
|
signinUnsigned();
|
|
30061
30172
|
};
|
|
30173
|
+
const onSdkCheckStatus = (data2) => {
|
|
30174
|
+
const { success, message } = data2;
|
|
30175
|
+
if (success && message.state === "deleted") {
|
|
30176
|
+
console.log("[sdk] Detected user has been permanently deleted");
|
|
30177
|
+
handleUserDeleted(message.address || hookState.current.lastCheckedDid);
|
|
30178
|
+
return;
|
|
30179
|
+
}
|
|
30180
|
+
if (success && message.state === "on-deletion") {
|
|
30181
|
+
console.log("[sdk] Detected user on-deletion");
|
|
30182
|
+
setIsOnDeletion(true);
|
|
30183
|
+
} else {
|
|
30184
|
+
setIsOnDeletion(false);
|
|
30185
|
+
}
|
|
30186
|
+
};
|
|
30187
|
+
const onSigninOnDeletion = async (data2) => {
|
|
30188
|
+
const { address } = data2 || {};
|
|
30189
|
+
if (address) {
|
|
30190
|
+
useStoreUI.getState().setDeletionAddress(address);
|
|
30191
|
+
}
|
|
30192
|
+
setIsOnDeletion(true);
|
|
30193
|
+
setIsSigning(false);
|
|
30194
|
+
setIsSigningLoader(false);
|
|
30195
|
+
hookState.current.isSigning = false;
|
|
30196
|
+
closeModal();
|
|
30197
|
+
const isLandingPage = window.location.pathname === "/" || window.location.pathname === "/signin";
|
|
30198
|
+
if (!isLandingPage) {
|
|
30199
|
+
window.location.href = "/";
|
|
30200
|
+
}
|
|
30201
|
+
};
|
|
30202
|
+
provider2.wsc.on("sdk:checkStatus", onSdkCheckStatus);
|
|
30062
30203
|
provider2.wsc.on("provider:signup", onProviderSignup);
|
|
30063
30204
|
provider2.wsc.on("provider:signin", onProviderSignin);
|
|
30064
30205
|
provider2.wsc.on("user:txns", onUserTxns);
|
|
@@ -30066,12 +30207,39 @@ const useBlockAuthWsData = (onSuccess = async (address = "") => {
|
|
|
30066
30207
|
provider2.wsc.on("user:txns:create", onUserTxnsCreate);
|
|
30067
30208
|
provider2.wsc.on("sdk:sign", onSdkSign);
|
|
30068
30209
|
provider2.wsc.on("signin:corrupted", onSigninCorrupted);
|
|
30210
|
+
provider2.wsc.on(
|
|
30211
|
+
"signin:userDeleted",
|
|
30212
|
+
(data2) => handleUserDeleted(data2 == null ? void 0 : data2.address)
|
|
30213
|
+
);
|
|
30069
30214
|
provider2.wsc.on("signin:expired", onSigninExpired);
|
|
30070
30215
|
provider2.wsc.on("signin:unsigned", onSigninUnsigned);
|
|
30216
|
+
provider2.wsc.on("signin:onDeletion", onSigninOnDeletion);
|
|
30071
30217
|
provider2.wsc.on("sdk:sign:refresh", () => {
|
|
30072
30218
|
console.log("[sdk] Proactive sign refresh received");
|
|
30073
30219
|
isUserSignedIn();
|
|
30074
30220
|
});
|
|
30221
|
+
provider2.wsc.on("sdk:restore", (data2) => {
|
|
30222
|
+
var _a3;
|
|
30223
|
+
if (data2.success) {
|
|
30224
|
+
console.log("[sdk] Account restored successfully");
|
|
30225
|
+
setIsOnDeletion(false);
|
|
30226
|
+
if ((_a3 = data2.message) == null ? void 0 : _a3.session) {
|
|
30227
|
+
const session = data2.message.session;
|
|
30228
|
+
BrowserBase.setSession({
|
|
30229
|
+
did: session.did,
|
|
30230
|
+
token: session.token,
|
|
30231
|
+
serviceName: "blockauth"
|
|
30232
|
+
});
|
|
30233
|
+
if (session.serviceName && session.serviceName !== "blockauth") {
|
|
30234
|
+
BrowserBase.setSession({
|
|
30235
|
+
...session,
|
|
30236
|
+
serviceName: session.serviceName
|
|
30237
|
+
});
|
|
30238
|
+
}
|
|
30239
|
+
}
|
|
30240
|
+
window.location.reload();
|
|
30241
|
+
}
|
|
30242
|
+
});
|
|
30075
30243
|
isUserSignedIn();
|
|
30076
30244
|
setOnSuccess(_onSuccess);
|
|
30077
30245
|
setOnError(_onError);
|
|
@@ -30154,7 +30322,7 @@ function BtnBlockAuth({
|
|
|
30154
30322
|
},
|
|
30155
30323
|
serviceName: "blockauth"
|
|
30156
30324
|
});
|
|
30157
|
-
const onInitialResponse = (
|
|
30325
|
+
const onInitialResponse = () => {
|
|
30158
30326
|
setIsServiceConnected(true);
|
|
30159
30327
|
setWaitingForSuccessLogInSince(0);
|
|
30160
30328
|
const s2 = BrowserBase.getSession();
|
|
@@ -30507,10 +30675,10 @@ function DropdownProfileBtn({
|
|
|
30507
30675
|
}
|
|
30508
30676
|
const { dropdownContainerVariantsFromTopRight } = helperUI;
|
|
30509
30677
|
function DropdownProfile({
|
|
30510
|
-
|
|
30678
|
+
_mode = "auth-code",
|
|
30511
30679
|
apiKey = "",
|
|
30512
30680
|
apiSecret = "",
|
|
30513
|
-
onSuccess = async (
|
|
30681
|
+
onSuccess = async (_address = "") => {
|
|
30514
30682
|
},
|
|
30515
30683
|
onError = async () => {
|
|
30516
30684
|
},
|
|
@@ -33320,10 +33488,10 @@ const CoreHelperUtil = {
|
|
|
33320
33488
|
Boolean(window.TelegramWebviewProxyProto));
|
|
33321
33489
|
},
|
|
33322
33490
|
async preloadImage(src2) {
|
|
33323
|
-
const imagePromise = new Promise((resolve,
|
|
33491
|
+
const imagePromise = new Promise((resolve, reject2) => {
|
|
33324
33492
|
const image = new Image();
|
|
33325
33493
|
image.onload = resolve;
|
|
33326
|
-
image.onerror =
|
|
33494
|
+
image.onerror = reject2;
|
|
33327
33495
|
image.crossOrigin = "anonymous";
|
|
33328
33496
|
image.src = src2;
|
|
33329
33497
|
});
|
|
@@ -38631,12 +38799,12 @@ class W3mFrame {
|
|
|
38631
38799
|
}
|
|
38632
38800
|
};
|
|
38633
38801
|
this.projectId = projectId;
|
|
38634
|
-
this.frameLoadPromise = new Promise((resolve,
|
|
38635
|
-
this.frameLoadPromiseResolver = { resolve, reject };
|
|
38802
|
+
this.frameLoadPromise = new Promise((resolve, reject2) => {
|
|
38803
|
+
this.frameLoadPromiseResolver = { resolve, reject: reject2 };
|
|
38636
38804
|
});
|
|
38637
38805
|
if (isAppClient) {
|
|
38638
|
-
this.frameLoadPromise = new Promise((resolve,
|
|
38639
|
-
this.frameLoadPromiseResolver = { resolve, reject };
|
|
38806
|
+
this.frameLoadPromise = new Promise((resolve, reject2) => {
|
|
38807
|
+
this.frameLoadPromiseResolver = { resolve, reject: reject2 };
|
|
38640
38808
|
});
|
|
38641
38809
|
if (W3mFrameHelpers.isClient) {
|
|
38642
38810
|
const iframe = document.createElement("iframe");
|
|
@@ -39706,7 +39874,7 @@ class W3mFrameProvider {
|
|
|
39706
39874
|
if (shouldCheckForTimeout && this.onTimeout) {
|
|
39707
39875
|
timer2 = setTimeout(this.onTimeout, 15e3);
|
|
39708
39876
|
}
|
|
39709
|
-
return new Promise((resolve,
|
|
39877
|
+
return new Promise((resolve, reject2) => {
|
|
39710
39878
|
var _a3, _b2;
|
|
39711
39879
|
const id2 = Math.random().toString(36).substring(7);
|
|
39712
39880
|
(_b2 = (_a3 = this.w3mLogger.logger).info) == null ? void 0 : _b2.call(_a3, { event, id: id2 }, "Sending app event");
|
|
@@ -39718,7 +39886,7 @@ class W3mFrameProvider {
|
|
|
39718
39886
|
}
|
|
39719
39887
|
abortController.signal.addEventListener("abort", () => {
|
|
39720
39888
|
if (type2 === "RPC_REQUEST") {
|
|
39721
|
-
|
|
39889
|
+
reject2(new Error("Request was aborted"));
|
|
39722
39890
|
}
|
|
39723
39891
|
});
|
|
39724
39892
|
function handler(framEvent, logger2) {
|
|
@@ -39737,9 +39905,9 @@ class W3mFrameProvider {
|
|
|
39737
39905
|
resolve(void 0);
|
|
39738
39906
|
} else if (framEvent.type === `@w3m-frame/${type2}_ERROR`) {
|
|
39739
39907
|
if ("payload" in framEvent) {
|
|
39740
|
-
|
|
39908
|
+
reject2(new Error(((_c = framEvent.payload) == null ? void 0 : _c.message) || "An error occurred"));
|
|
39741
39909
|
}
|
|
39742
|
-
|
|
39910
|
+
reject2(new Error("An error occurred"));
|
|
39743
39911
|
}
|
|
39744
39912
|
}
|
|
39745
39913
|
this.w3mFrame.events.registerFrameEventHandler(id2, (frameEvent) => handler(frameEvent, this.w3mLogger), abortController.signal);
|
|
@@ -40105,12 +40273,12 @@ const ConnectionController = {
|
|
|
40105
40273
|
state$f.wcUri = link;
|
|
40106
40274
|
return;
|
|
40107
40275
|
}
|
|
40108
|
-
wcConnectionPromise = new Promise(async (resolve,
|
|
40276
|
+
wcConnectionPromise = new Promise(async (resolve, reject2) => {
|
|
40109
40277
|
var _a4, _b3, _c2, _d2;
|
|
40110
40278
|
await ((_d2 = (_c2 = (_b3 = (_a4 = ChainController.state) == null ? void 0 : _a4.universalAdapter) == null ? void 0 : _b3.connectionControllerClient) == null ? void 0 : _c2.connectWalletConnect) == null ? void 0 : _d2.call(_c2, (uri2) => {
|
|
40111
40279
|
state$f.wcUri = uri2;
|
|
40112
40280
|
state$f.wcPairingExpiry = CoreHelperUtil.getPairingExpiry();
|
|
40113
|
-
}).catch(
|
|
40281
|
+
}).catch(reject2));
|
|
40114
40282
|
resolve();
|
|
40115
40283
|
});
|
|
40116
40284
|
this.state.status = "connecting";
|
|
@@ -51978,12 +52146,12 @@ function renderCanvas(renderFunc, canvas2, text, opts, cb) {
|
|
|
51978
52146
|
text = canvas2;
|
|
51979
52147
|
canvas2 = void 0;
|
|
51980
52148
|
}
|
|
51981
|
-
return new Promise(function(resolve,
|
|
52149
|
+
return new Promise(function(resolve, reject2) {
|
|
51982
52150
|
try {
|
|
51983
52151
|
const data2 = QRCode.create(text, opts);
|
|
51984
52152
|
resolve(renderFunc(data2, canvas2, opts));
|
|
51985
52153
|
} catch (e3) {
|
|
51986
|
-
|
|
52154
|
+
reject2(e3);
|
|
51987
52155
|
}
|
|
51988
52156
|
});
|
|
51989
52157
|
}
|
|
@@ -55696,10 +55864,10 @@ function unwrapListeners(arr) {
|
|
|
55696
55864
|
return ret;
|
|
55697
55865
|
}
|
|
55698
55866
|
function once$2(emitter, name) {
|
|
55699
|
-
return new Promise(function(resolve,
|
|
55867
|
+
return new Promise(function(resolve, reject2) {
|
|
55700
55868
|
function errorListener(err) {
|
|
55701
55869
|
emitter.removeListener(name, resolver);
|
|
55702
|
-
|
|
55870
|
+
reject2(err);
|
|
55703
55871
|
}
|
|
55704
55872
|
function resolver() {
|
|
55705
55873
|
if (typeof emitter.removeListener === "function") {
|
|
@@ -55809,19 +55977,19 @@ function __awaiter(thisArg, _arguments, P2, generator) {
|
|
|
55809
55977
|
resolve(value);
|
|
55810
55978
|
});
|
|
55811
55979
|
}
|
|
55812
|
-
return new (P2 || (P2 = Promise))(function(resolve,
|
|
55980
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject2) {
|
|
55813
55981
|
function fulfilled(value) {
|
|
55814
55982
|
try {
|
|
55815
55983
|
step(generator.next(value));
|
|
55816
55984
|
} catch (e3) {
|
|
55817
|
-
|
|
55985
|
+
reject2(e3);
|
|
55818
55986
|
}
|
|
55819
55987
|
}
|
|
55820
55988
|
function rejected(value) {
|
|
55821
55989
|
try {
|
|
55822
55990
|
step(generator["throw"](value));
|
|
55823
55991
|
} catch (e3) {
|
|
55824
|
-
|
|
55992
|
+
reject2(e3);
|
|
55825
55993
|
}
|
|
55826
55994
|
}
|
|
55827
55995
|
function step(result) {
|
|
@@ -55970,12 +56138,12 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
55970
56138
|
}
|
|
55971
56139
|
}
|
|
55972
56140
|
function step(r3) {
|
|
55973
|
-
r3.value instanceof __await ? Promise.resolve(r3.value.v).then(fulfill,
|
|
56141
|
+
r3.value instanceof __await ? Promise.resolve(r3.value.v).then(fulfill, reject2) : settle(q2[0][2], r3);
|
|
55974
56142
|
}
|
|
55975
56143
|
function fulfill(value) {
|
|
55976
56144
|
resume("next", value);
|
|
55977
56145
|
}
|
|
55978
|
-
function
|
|
56146
|
+
function reject2(value) {
|
|
55979
56147
|
resume("throw", value);
|
|
55980
56148
|
}
|
|
55981
56149
|
function settle(f5, v3) {
|
|
@@ -56003,15 +56171,15 @@ function __asyncValues(o3) {
|
|
|
56003
56171
|
}, i5);
|
|
56004
56172
|
function verb(n6) {
|
|
56005
56173
|
i5[n6] = o3[n6] && function(v3) {
|
|
56006
|
-
return new Promise(function(resolve,
|
|
56007
|
-
v3 = o3[n6](v3), settle(resolve,
|
|
56174
|
+
return new Promise(function(resolve, reject2) {
|
|
56175
|
+
v3 = o3[n6](v3), settle(resolve, reject2, v3.done, v3.value);
|
|
56008
56176
|
});
|
|
56009
56177
|
};
|
|
56010
56178
|
}
|
|
56011
|
-
function settle(resolve,
|
|
56179
|
+
function settle(resolve, reject2, d4, v3) {
|
|
56012
56180
|
Promise.resolve(v3).then(function(v4) {
|
|
56013
56181
|
resolve({ value: v4, done: d4 });
|
|
56014
|
-
},
|
|
56182
|
+
}, reject2);
|
|
56015
56183
|
}
|
|
56016
56184
|
}
|
|
56017
56185
|
function __makeTemplateObject(cooked, raw) {
|
|
@@ -58669,9 +58837,9 @@ async function dispose(driver) {
|
|
|
58669
58837
|
}
|
|
58670
58838
|
}
|
|
58671
58839
|
function promisifyRequest(request) {
|
|
58672
|
-
return new Promise((resolve,
|
|
58840
|
+
return new Promise((resolve, reject2) => {
|
|
58673
58841
|
request.oncomplete = request.onsuccess = () => resolve(request.result);
|
|
58674
|
-
request.onabort = request.onerror = () =>
|
|
58842
|
+
request.onabort = request.onerror = () => reject2(request.error);
|
|
58675
58843
|
});
|
|
58676
58844
|
}
|
|
58677
58845
|
function createStore(dbName, storeName) {
|
|
@@ -78426,12 +78594,12 @@ var browserPonyfill = { exports: {} };
|
|
|
78426
78594
|
body.bodyUsed = true;
|
|
78427
78595
|
}
|
|
78428
78596
|
function fileReaderReady(reader) {
|
|
78429
|
-
return new Promise(function(resolve,
|
|
78597
|
+
return new Promise(function(resolve, reject2) {
|
|
78430
78598
|
reader.onload = function() {
|
|
78431
78599
|
resolve(reader.result);
|
|
78432
78600
|
};
|
|
78433
78601
|
reader.onerror = function() {
|
|
78434
|
-
|
|
78602
|
+
reject2(reader.error);
|
|
78435
78603
|
};
|
|
78436
78604
|
});
|
|
78437
78605
|
}
|
|
@@ -78712,10 +78880,10 @@ var browserPonyfill = { exports: {} };
|
|
|
78712
78880
|
exports$12.DOMException.prototype.constructor = exports$12.DOMException;
|
|
78713
78881
|
}
|
|
78714
78882
|
function fetch2(input, init4) {
|
|
78715
|
-
return new Promise(function(resolve,
|
|
78883
|
+
return new Promise(function(resolve, reject2) {
|
|
78716
78884
|
var request = new Request(input, init4);
|
|
78717
78885
|
if (request.signal && request.signal.aborted) {
|
|
78718
|
-
return
|
|
78886
|
+
return reject2(new exports$12.DOMException("Aborted", "AbortError"));
|
|
78719
78887
|
}
|
|
78720
78888
|
var xhr = new XMLHttpRequest();
|
|
78721
78889
|
function abortXhr() {
|
|
@@ -78739,17 +78907,17 @@ var browserPonyfill = { exports: {} };
|
|
|
78739
78907
|
};
|
|
78740
78908
|
xhr.onerror = function() {
|
|
78741
78909
|
setTimeout(function() {
|
|
78742
|
-
|
|
78910
|
+
reject2(new TypeError("Network request failed"));
|
|
78743
78911
|
}, 0);
|
|
78744
78912
|
};
|
|
78745
78913
|
xhr.ontimeout = function() {
|
|
78746
78914
|
setTimeout(function() {
|
|
78747
|
-
|
|
78915
|
+
reject2(new TypeError("Network request timed out"));
|
|
78748
78916
|
}, 0);
|
|
78749
78917
|
};
|
|
78750
78918
|
xhr.onabort = function() {
|
|
78751
78919
|
setTimeout(function() {
|
|
78752
|
-
|
|
78920
|
+
reject2(new exports$12.DOMException("Aborted", "AbortError"));
|
|
78753
78921
|
}, 0);
|
|
78754
78922
|
};
|
|
78755
78923
|
function fixUrl(url) {
|
|
@@ -83000,7 +83168,7 @@ class UniversalAdapterClient {
|
|
|
83000
83168
|
const isProviderSupported = typeof (WalletConnectProvider == null ? void 0 : WalletConnectProvider.authenticate) === "function";
|
|
83001
83169
|
const isSiweParamsValid = siweParams && Object.keys(siweParams || {}).length > 0;
|
|
83002
83170
|
if (siweConfig && isSiweEnabled && siweParams && isProviderSupported && isSiweParamsValid && ChainController.state.activeChain === "eip155") {
|
|
83003
|
-
const { SIWEController, getDidChainId, getDidAddress } = await import("./index-
|
|
83171
|
+
const { SIWEController, getDidChainId, getDidAddress } = await import("./index-CLdJ05nx.js");
|
|
83004
83172
|
const chains = (_h2 = this.caipNetworks) == null ? void 0 : _h2.filter((network) => network.chainNamespace === "eip155").map((chain) => chain.id);
|
|
83005
83173
|
siweParams.chains = (_i2 = this.caipNetworks) == null ? void 0 : _i2.filter((network) => network.chainNamespace === "eip155").map((chain) => chain.chainId);
|
|
83006
83174
|
const result = await WalletConnectProvider.authenticate({
|
|
@@ -83048,7 +83216,7 @@ class UniversalAdapterClient {
|
|
|
83048
83216
|
var _a3, _b2, _c, _d;
|
|
83049
83217
|
SafeLocalStorage.removeItem(SafeLocalStorageKeys.WALLET_ID);
|
|
83050
83218
|
if ((_a3 = siweConfig == null ? void 0 : siweConfig.options) == null ? void 0 : _a3.signOutOnDisconnect) {
|
|
83051
|
-
const { SIWEController } = await import("./index-
|
|
83219
|
+
const { SIWEController } = await import("./index-CLdJ05nx.js");
|
|
83052
83220
|
await SIWEController.signOut();
|
|
83053
83221
|
}
|
|
83054
83222
|
await ((_b2 = this.walletConnectProvider) == null ? void 0 : _b2.disconnect());
|
|
@@ -83622,7 +83790,7 @@ class AppKit {
|
|
|
83622
83790
|
const evmAdapter = (_a3 = options.adapters) == null ? void 0 : _a3.find((adapter) => adapter.chainNamespace === ConstantsUtil$3.CHAIN.EVM);
|
|
83623
83791
|
if (evmAdapter) {
|
|
83624
83792
|
if (options.siweConfig) {
|
|
83625
|
-
const { SIWEController } = await import("./index-
|
|
83793
|
+
const { SIWEController } = await import("./index-CLdJ05nx.js");
|
|
83626
83794
|
SIWEController.setSIWEClient(options.siweConfig);
|
|
83627
83795
|
}
|
|
83628
83796
|
}
|
|
@@ -83680,8 +83848,8 @@ class AppKit {
|
|
|
83680
83848
|
isInitialized = true;
|
|
83681
83849
|
this.initPromise = new Promise(async (resolve) => {
|
|
83682
83850
|
await Promise.all([
|
|
83683
|
-
import("./index-
|
|
83684
|
-
import("./w3m-modal-
|
|
83851
|
+
import("./index-Bak4uhEH.js"),
|
|
83852
|
+
import("./w3m-modal-xOVNG6py.js")
|
|
83685
83853
|
]);
|
|
83686
83854
|
const modal2 = document.createElement("w3m-modal");
|
|
83687
83855
|
if (!OptionsController.state.disableAppend) {
|
|
@@ -92756,7 +92924,7 @@ let W3mHeader = class W3mHeader2 extends i$5 {
|
|
|
92756
92924
|
}
|
|
92757
92925
|
async onClose() {
|
|
92758
92926
|
if (this.isSiweEnabled) {
|
|
92759
|
-
const { SIWEController } = await import("./index-
|
|
92927
|
+
const { SIWEController } = await import("./index-CLdJ05nx.js");
|
|
92760
92928
|
const isApproveSignScreen = RouterController.state.view === "ApproveTransaction";
|
|
92761
92929
|
const isUnauthenticated = SIWEController.state.status !== "success";
|
|
92762
92930
|
if (isUnauthenticated && isApproveSignScreen) {
|
|
@@ -99741,14 +99909,14 @@ function requireAsync_iterator() {
|
|
|
99741
99909
|
process$1.nextTick(readAndResolve, iter);
|
|
99742
99910
|
}
|
|
99743
99911
|
function wrapForNext(lastPromise, iter) {
|
|
99744
|
-
return function(resolve,
|
|
99912
|
+
return function(resolve, reject2) {
|
|
99745
99913
|
lastPromise.then(function() {
|
|
99746
99914
|
if (iter[kEnded]) {
|
|
99747
99915
|
resolve(createIterResult(void 0, true));
|
|
99748
99916
|
return;
|
|
99749
99917
|
}
|
|
99750
|
-
iter[kHandlePromise](resolve,
|
|
99751
|
-
},
|
|
99918
|
+
iter[kHandlePromise](resolve, reject2);
|
|
99919
|
+
}, reject2);
|
|
99752
99920
|
};
|
|
99753
99921
|
}
|
|
99754
99922
|
var AsyncIteratorPrototype = Object.getPrototypeOf(function() {
|
|
@@ -99767,10 +99935,10 @@ function requireAsync_iterator() {
|
|
|
99767
99935
|
return Promise.resolve(createIterResult(void 0, true));
|
|
99768
99936
|
}
|
|
99769
99937
|
if (this[kStream].destroyed) {
|
|
99770
|
-
return new Promise(function(resolve,
|
|
99938
|
+
return new Promise(function(resolve, reject2) {
|
|
99771
99939
|
process$1.nextTick(function() {
|
|
99772
99940
|
if (_this[kError]) {
|
|
99773
|
-
|
|
99941
|
+
reject2(_this[kError]);
|
|
99774
99942
|
} else {
|
|
99775
99943
|
resolve(createIterResult(void 0, true));
|
|
99776
99944
|
}
|
|
@@ -99795,10 +99963,10 @@ function requireAsync_iterator() {
|
|
|
99795
99963
|
return this;
|
|
99796
99964
|
}), _defineProperty2(_Object$setPrototypeO, "return", function _return() {
|
|
99797
99965
|
var _this2 = this;
|
|
99798
|
-
return new Promise(function(resolve,
|
|
99966
|
+
return new Promise(function(resolve, reject2) {
|
|
99799
99967
|
_this2[kStream].destroy(null, function(err) {
|
|
99800
99968
|
if (err) {
|
|
99801
|
-
|
|
99969
|
+
reject2(err);
|
|
99802
99970
|
return;
|
|
99803
99971
|
}
|
|
99804
99972
|
resolve(createIterResult(void 0, true));
|
|
@@ -99823,7 +99991,7 @@ function requireAsync_iterator() {
|
|
|
99823
99991
|
value: stream2._readableState.endEmitted,
|
|
99824
99992
|
writable: true
|
|
99825
99993
|
}), _defineProperty2(_Object$create, kHandlePromise, {
|
|
99826
|
-
value: function value(resolve,
|
|
99994
|
+
value: function value(resolve, reject2) {
|
|
99827
99995
|
var data2 = iterator[kStream].read();
|
|
99828
99996
|
if (data2) {
|
|
99829
99997
|
iterator[kLastPromise] = null;
|
|
@@ -99832,7 +100000,7 @@ function requireAsync_iterator() {
|
|
|
99832
100000
|
resolve(createIterResult(data2, false));
|
|
99833
100001
|
} else {
|
|
99834
100002
|
iterator[kLastResolve] = resolve;
|
|
99835
|
-
iterator[kLastReject] =
|
|
100003
|
+
iterator[kLastReject] = reject2;
|
|
99836
100004
|
}
|
|
99837
100005
|
},
|
|
99838
100006
|
writable: true
|
|
@@ -99840,12 +100008,12 @@ function requireAsync_iterator() {
|
|
|
99840
100008
|
iterator[kLastPromise] = null;
|
|
99841
100009
|
finished(stream2, function(err) {
|
|
99842
100010
|
if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
|
|
99843
|
-
var
|
|
99844
|
-
if (
|
|
100011
|
+
var reject2 = iterator[kLastReject];
|
|
100012
|
+
if (reject2 !== null) {
|
|
99845
100013
|
iterator[kLastPromise] = null;
|
|
99846
100014
|
iterator[kLastResolve] = null;
|
|
99847
100015
|
iterator[kLastReject] = null;
|
|
99848
|
-
|
|
100016
|
+
reject2(err);
|
|
99849
100017
|
}
|
|
99850
100018
|
iterator[kError] = err;
|
|
99851
100019
|
return;
|
|
@@ -101808,7 +101976,7 @@ class WalletLinkCipher {
|
|
|
101808
101976
|
const secret2 = this.secret;
|
|
101809
101977
|
if (secret2.length !== 64)
|
|
101810
101978
|
throw Error(`secret must be 256 bits`);
|
|
101811
|
-
return new Promise((resolve,
|
|
101979
|
+
return new Promise((resolve, reject2) => {
|
|
101812
101980
|
void async function() {
|
|
101813
101981
|
const secretKey = await crypto.subtle.importKey("raw", (0, util_1$8.hexStringToUint8Array)(secret2), { name: "aes-gcm" }, false, ["encrypt", "decrypt"]);
|
|
101814
101982
|
const encrypted = (0, util_1$8.hexStringToUint8Array)(cipherText);
|
|
@@ -101825,7 +101993,7 @@ class WalletLinkCipher {
|
|
|
101825
101993
|
const decoder = new TextDecoder();
|
|
101826
101994
|
resolve(decoder.decode(decrypted));
|
|
101827
101995
|
} catch (err) {
|
|
101828
|
-
|
|
101996
|
+
reject2(err);
|
|
101829
101997
|
}
|
|
101830
101998
|
}();
|
|
101831
101999
|
});
|
|
@@ -101912,20 +102080,20 @@ class WalletLinkWebSocket {
|
|
|
101912
102080
|
if (this.webSocket) {
|
|
101913
102081
|
throw new Error("webSocket object is not null");
|
|
101914
102082
|
}
|
|
101915
|
-
return new Promise((resolve,
|
|
102083
|
+
return new Promise((resolve, reject2) => {
|
|
101916
102084
|
var _a3;
|
|
101917
102085
|
let webSocket;
|
|
101918
102086
|
try {
|
|
101919
102087
|
this.webSocket = webSocket = new this.WebSocketClass(this.url);
|
|
101920
102088
|
} catch (err) {
|
|
101921
|
-
|
|
102089
|
+
reject2(err);
|
|
101922
102090
|
return;
|
|
101923
102091
|
}
|
|
101924
102092
|
(_a3 = this.connectionStateListener) === null || _a3 === void 0 ? void 0 : _a3.call(this, ConnectionState.CONNECTING);
|
|
101925
102093
|
webSocket.onclose = (evt) => {
|
|
101926
102094
|
var _a4;
|
|
101927
102095
|
this.clearWebSocket();
|
|
101928
|
-
|
|
102096
|
+
reject2(new Error(`websocket error ${evt.code}: ${evt.reason}`));
|
|
101929
102097
|
(_a4 = this.connectionStateListener) === null || _a4 === void 0 ? void 0 : _a4.call(this, ConnectionState.DISCONNECTED);
|
|
101930
102098
|
};
|
|
101931
102099
|
webSocket.onopen = (_3) => {
|
|
@@ -102309,9 +102477,9 @@ class WalletLinkConnection {
|
|
|
102309
102477
|
this.sendData(message);
|
|
102310
102478
|
let timeoutId;
|
|
102311
102479
|
return Promise.race([
|
|
102312
|
-
new Promise((_3,
|
|
102480
|
+
new Promise((_3, reject2) => {
|
|
102313
102481
|
timeoutId = window.setTimeout(() => {
|
|
102314
|
-
|
|
102482
|
+
reject2(new Error(`request ${reqId} timed out`));
|
|
102315
102483
|
}, timeout);
|
|
102316
102484
|
}),
|
|
102317
102485
|
new Promise((resolve) => {
|
|
@@ -102645,45 +102813,6 @@ function requireGetProto() {
|
|
|
102645
102813
|
} : null;
|
|
102646
102814
|
return getProto$1;
|
|
102647
102815
|
}
|
|
102648
|
-
var asyncFunction;
|
|
102649
|
-
var hasRequiredAsyncFunction;
|
|
102650
|
-
function requireAsyncFunction() {
|
|
102651
|
-
if (hasRequiredAsyncFunction) return asyncFunction;
|
|
102652
|
-
hasRequiredAsyncFunction = 1;
|
|
102653
|
-
const cached = (
|
|
102654
|
-
/** @type {import('.').AsyncFunctionConstructor} */
|
|
102655
|
-
(async function() {
|
|
102656
|
-
}).constructor
|
|
102657
|
-
);
|
|
102658
|
-
asyncFunction = () => cached;
|
|
102659
|
-
return asyncFunction;
|
|
102660
|
-
}
|
|
102661
|
-
var generatorFunction;
|
|
102662
|
-
var hasRequiredGeneratorFunction;
|
|
102663
|
-
function requireGeneratorFunction() {
|
|
102664
|
-
if (hasRequiredGeneratorFunction) return generatorFunction;
|
|
102665
|
-
hasRequiredGeneratorFunction = 1;
|
|
102666
|
-
const cached = (
|
|
102667
|
-
/** @type {GeneratorFunctionConstructor} */
|
|
102668
|
-
(function* () {
|
|
102669
|
-
}).constructor
|
|
102670
|
-
);
|
|
102671
|
-
generatorFunction = () => cached;
|
|
102672
|
-
return generatorFunction;
|
|
102673
|
-
}
|
|
102674
|
-
var asyncGeneratorFunction;
|
|
102675
|
-
var hasRequiredAsyncGeneratorFunction;
|
|
102676
|
-
function requireAsyncGeneratorFunction() {
|
|
102677
|
-
if (hasRequiredAsyncGeneratorFunction) return asyncGeneratorFunction;
|
|
102678
|
-
hasRequiredAsyncGeneratorFunction = 1;
|
|
102679
|
-
const cached = (
|
|
102680
|
-
/** @type {import('.').AsyncGeneratorFunctionConstructor} */
|
|
102681
|
-
(async function* () {
|
|
102682
|
-
}).constructor
|
|
102683
|
-
);
|
|
102684
|
-
asyncGeneratorFunction = () => cached;
|
|
102685
|
-
return asyncGeneratorFunction;
|
|
102686
|
-
}
|
|
102687
102816
|
var hasown;
|
|
102688
102817
|
var hasRequiredHasown;
|
|
102689
102818
|
function requireHasown() {
|
|
@@ -102711,6 +102840,13 @@ var min = min$1;
|
|
|
102711
102840
|
var pow = pow$1;
|
|
102712
102841
|
var round = round$1;
|
|
102713
102842
|
var sign8 = sign$1;
|
|
102843
|
+
var $Function = Function;
|
|
102844
|
+
var getEvalledConstructor = function(expressionSyntax) {
|
|
102845
|
+
try {
|
|
102846
|
+
return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
|
|
102847
|
+
} catch (e3) {
|
|
102848
|
+
}
|
|
102849
|
+
};
|
|
102714
102850
|
var $gOPD = gopd;
|
|
102715
102851
|
var $defineProperty = esDefineProperty;
|
|
102716
102852
|
var throwTypeError = function() {
|
|
@@ -102766,7 +102902,7 @@ var INTRINSICS = {
|
|
|
102766
102902
|
"%Float32Array%": typeof Float32Array === "undefined" ? undefined$1 : Float32Array,
|
|
102767
102903
|
"%Float64Array%": typeof Float64Array === "undefined" ? undefined$1 : Float64Array,
|
|
102768
102904
|
"%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined$1 : FinalizationRegistry,
|
|
102769
|
-
"%Function%": Function,
|
|
102905
|
+
"%Function%": $Function,
|
|
102770
102906
|
"%GeneratorFunction%": needsEval,
|
|
102771
102907
|
"%Int8Array%": typeof Int8Array === "undefined" ? undefined$1 : Int8Array,
|
|
102772
102908
|
"%Int16Array%": typeof Int16Array === "undefined" ? undefined$1 : Int16Array,
|
|
@@ -102828,17 +102964,14 @@ if (getProto) {
|
|
|
102828
102964
|
INTRINSICS["%Error.prototype%"] = errorProto;
|
|
102829
102965
|
}
|
|
102830
102966
|
}
|
|
102831
|
-
var getAsyncFunction = requireAsyncFunction();
|
|
102832
|
-
var getGeneratorFunction = requireGeneratorFunction();
|
|
102833
|
-
var getAsyncGeneratorFunction = requireAsyncGeneratorFunction();
|
|
102834
102967
|
var doEval = function doEval2(name) {
|
|
102835
102968
|
var value;
|
|
102836
102969
|
if (name === "%AsyncFunction%") {
|
|
102837
|
-
value =
|
|
102970
|
+
value = getEvalledConstructor("async function () {}");
|
|
102838
102971
|
} else if (name === "%GeneratorFunction%") {
|
|
102839
|
-
value =
|
|
102972
|
+
value = getEvalledConstructor("function* () {}");
|
|
102840
102973
|
} else if (name === "%AsyncGeneratorFunction%") {
|
|
102841
|
-
value =
|
|
102974
|
+
value = getEvalledConstructor("async function* () {}");
|
|
102842
102975
|
} else if (name === "%AsyncGenerator%") {
|
|
102843
102976
|
var fn2 = doEval2("%AsyncGeneratorFunction%");
|
|
102844
102977
|
if (fn2) {
|
|
@@ -105554,7 +105687,7 @@ class WalletLinkRelay {
|
|
|
105554
105687
|
this.handleErrorResponse(id2, request.method, error2);
|
|
105555
105688
|
hideSnackbarItem === null || hideSnackbarItem === void 0 ? void 0 : hideSnackbarItem();
|
|
105556
105689
|
};
|
|
105557
|
-
return new Promise((resolve,
|
|
105690
|
+
return new Promise((resolve, reject2) => {
|
|
105558
105691
|
{
|
|
105559
105692
|
hideSnackbarItem = this.ui.showConnecting({
|
|
105560
105693
|
isUnlinkedErrorState: this.isUnlinkedErrorState,
|
|
@@ -105566,7 +105699,7 @@ class WalletLinkRelay {
|
|
|
105566
105699
|
this.relayEventManager.callbacks.set(id2, (response) => {
|
|
105567
105700
|
hideSnackbarItem === null || hideSnackbarItem === void 0 ? void 0 : hideSnackbarItem();
|
|
105568
105701
|
if ((0, Web3Response_1$1.isErrorResponse)(response)) {
|
|
105569
|
-
return
|
|
105702
|
+
return reject2(new Error(response.errorMessage));
|
|
105570
105703
|
}
|
|
105571
105704
|
resolve(response);
|
|
105572
105705
|
});
|
|
@@ -105664,10 +105797,10 @@ class WalletLinkRelay {
|
|
|
105664
105797
|
}
|
|
105665
105798
|
};
|
|
105666
105799
|
const id2 = (0, util_2$1.randomBytesHex)(8);
|
|
105667
|
-
return new Promise((resolve,
|
|
105800
|
+
return new Promise((resolve, reject2) => {
|
|
105668
105801
|
this.relayEventManager.callbacks.set(id2, (response) => {
|
|
105669
105802
|
if ((0, Web3Response_1$1.isErrorResponse)(response)) {
|
|
105670
|
-
return
|
|
105803
|
+
return reject2(new Error(response.errorMessage));
|
|
105671
105804
|
}
|
|
105672
105805
|
resolve(response);
|
|
105673
105806
|
});
|
|
@@ -105704,11 +105837,11 @@ class WalletLinkRelay {
|
|
|
105704
105837
|
// eslint-disable-line @typescript-eslint/unbound-method
|
|
105705
105838
|
});
|
|
105706
105839
|
}
|
|
105707
|
-
return new Promise((resolve,
|
|
105840
|
+
return new Promise((resolve, reject2) => {
|
|
105708
105841
|
this.relayEventManager.callbacks.set(id2, (response) => {
|
|
105709
105842
|
hideSnackbarItem === null || hideSnackbarItem === void 0 ? void 0 : hideSnackbarItem();
|
|
105710
105843
|
if ((0, Web3Response_1$1.isErrorResponse)(response)) {
|
|
105711
|
-
return
|
|
105844
|
+
return reject2(new Error(response.errorMessage));
|
|
105712
105845
|
}
|
|
105713
105846
|
resolve(response);
|
|
105714
105847
|
});
|
|
@@ -105742,11 +105875,11 @@ class WalletLinkRelay {
|
|
|
105742
105875
|
// eslint-disable-line @typescript-eslint/unbound-method
|
|
105743
105876
|
});
|
|
105744
105877
|
}
|
|
105745
|
-
return new Promise((resolve,
|
|
105878
|
+
return new Promise((resolve, reject2) => {
|
|
105746
105879
|
this.relayEventManager.callbacks.set(id2, (response) => {
|
|
105747
105880
|
hideSnackbarItem === null || hideSnackbarItem === void 0 ? void 0 : hideSnackbarItem();
|
|
105748
105881
|
if ((0, Web3Response_1$1.isErrorResponse)(response)) {
|
|
105749
|
-
return
|
|
105882
|
+
return reject2(new Error(response.errorMessage));
|
|
105750
105883
|
}
|
|
105751
105884
|
resolve(response);
|
|
105752
105885
|
});
|
|
@@ -105759,15 +105892,15 @@ class WalletLinkRelay {
|
|
|
105759
105892
|
params: Object.assign({ chainId }, { address })
|
|
105760
105893
|
};
|
|
105761
105894
|
const id2 = (0, util_2$1.randomBytesHex)(8);
|
|
105762
|
-
return new Promise((resolve,
|
|
105895
|
+
return new Promise((resolve, reject2) => {
|
|
105763
105896
|
this.relayEventManager.callbacks.set(id2, (response) => {
|
|
105764
105897
|
if ((0, Web3Response_1$1.isErrorResponse)(response) && response.errorCode) {
|
|
105765
|
-
return
|
|
105898
|
+
return reject2(error_1$6.standardErrors.provider.custom({
|
|
105766
105899
|
code: response.errorCode,
|
|
105767
105900
|
message: `Unrecognized chain ID. Try adding the chain using addEthereumChain first.`
|
|
105768
105901
|
}));
|
|
105769
105902
|
} else if ((0, Web3Response_1$1.isErrorResponse)(response)) {
|
|
105770
|
-
return
|
|
105903
|
+
return reject2(new Error(response.errorMessage));
|
|
105771
105904
|
}
|
|
105772
105905
|
resolve(response);
|
|
105773
105906
|
});
|
|
@@ -105969,7 +106102,7 @@ class WalletLinkSigner {
|
|
|
105969
106102
|
this._storage.setItem(constants_1$1.LOCAL_STORAGE_ADDRESSES_KEY, newAddresses.join(" "));
|
|
105970
106103
|
}
|
|
105971
106104
|
_sendRequestAsync(request) {
|
|
105972
|
-
return new Promise((resolve,
|
|
106105
|
+
return new Promise((resolve, reject2) => {
|
|
105973
106106
|
try {
|
|
105974
106107
|
const syncResult = this._handleSynchronousMethods(request);
|
|
105975
106108
|
if (syncResult !== void 0) {
|
|
@@ -105980,9 +106113,9 @@ class WalletLinkSigner {
|
|
|
105980
106113
|
});
|
|
105981
106114
|
}
|
|
105982
106115
|
} catch (err) {
|
|
105983
|
-
return
|
|
106116
|
+
return reject2(err);
|
|
105984
106117
|
}
|
|
105985
|
-
this._handleAsynchronousMethods(request).then((res) => res && resolve(Object.assign(Object.assign({}, res), { id: request.id }))).catch((err) =>
|
|
106118
|
+
this._handleAsynchronousMethods(request).then((res) => res && resolve(Object.assign(Object.assign({}, res), { id: request.id }))).catch((err) => reject2(err));
|
|
105986
106119
|
});
|
|
105987
106120
|
}
|
|
105988
106121
|
_handleSynchronousMethods(request) {
|
|
@@ -106505,7 +106638,7 @@ class Communicator {
|
|
|
106505
106638
|
return await responsePromise;
|
|
106506
106639
|
};
|
|
106507
106640
|
this.onMessage = async (predicate) => {
|
|
106508
|
-
return new Promise((resolve,
|
|
106641
|
+
return new Promise((resolve, reject2) => {
|
|
106509
106642
|
const listener = (event) => {
|
|
106510
106643
|
if (event.origin !== this.url.origin)
|
|
106511
106644
|
return;
|
|
@@ -106517,14 +106650,14 @@ class Communicator {
|
|
|
106517
106650
|
}
|
|
106518
106651
|
};
|
|
106519
106652
|
window.addEventListener("message", listener);
|
|
106520
|
-
this.listeners.set(listener, { reject });
|
|
106653
|
+
this.listeners.set(listener, { reject: reject2 });
|
|
106521
106654
|
});
|
|
106522
106655
|
};
|
|
106523
106656
|
this.disconnect = () => {
|
|
106524
106657
|
(0, util_1$2.closePopup)(this.popup);
|
|
106525
106658
|
this.popup = null;
|
|
106526
|
-
this.listeners.forEach(({ reject }, listener) => {
|
|
106527
|
-
|
|
106659
|
+
this.listeners.forEach(({ reject: reject2 }, listener) => {
|
|
106660
|
+
reject2(error_1$1.standardErrors.provider.userRejectedRequest("Request rejected"));
|
|
106528
106661
|
window.removeEventListener("message", listener);
|
|
106529
106662
|
});
|
|
106530
106663
|
this.listeners.clear();
|
|
@@ -107005,7 +107138,7 @@ class Ethers5Adapter {
|
|
|
107005
107138
|
const providerId = ProviderUtil.state.providerIds["eip155"];
|
|
107006
107139
|
(_a4 = this.appKit) == null ? void 0 : _a4.setClientId(null);
|
|
107007
107140
|
if ((_d2 = (_c2 = (_b3 = this.options) == null ? void 0 : _b3.siweConfig) == null ? void 0 : _c2.options) == null ? void 0 : _d2.signOutOnDisconnect) {
|
|
107008
|
-
const { SIWEController } = await import("./index-
|
|
107141
|
+
const { SIWEController } = await import("./index-CLdJ05nx.js");
|
|
107009
107142
|
await SIWEController.signOut();
|
|
107010
107143
|
}
|
|
107011
107144
|
const disconnectConfig = {
|
|
@@ -107724,27 +107857,27 @@ const WalletConnect = new class WalletConnect2 {
|
|
|
107724
107857
|
return new Set(this.networks.map((network) => network.id));
|
|
107725
107858
|
}
|
|
107726
107859
|
isConnected() {
|
|
107727
|
-
return new Promise((resolve,
|
|
107860
|
+
return new Promise((resolve, reject2) => {
|
|
107728
107861
|
try {
|
|
107729
107862
|
const isConnected = this.appKit.getIsConnectedState();
|
|
107730
107863
|
resolve(isConnected);
|
|
107731
107864
|
} catch (err) {
|
|
107732
|
-
|
|
107865
|
+
reject2(err);
|
|
107733
107866
|
}
|
|
107734
107867
|
});
|
|
107735
107868
|
}
|
|
107736
107869
|
getConnectors() {
|
|
107737
|
-
return new Promise((resolve,
|
|
107870
|
+
return new Promise((resolve, reject2) => {
|
|
107738
107871
|
try {
|
|
107739
107872
|
const connectors = this.appKit.getConnectors();
|
|
107740
107873
|
resolve(connectors);
|
|
107741
107874
|
} catch (err) {
|
|
107742
|
-
|
|
107875
|
+
reject2(err);
|
|
107743
107876
|
}
|
|
107744
107877
|
});
|
|
107745
107878
|
}
|
|
107746
107879
|
getAccount(walletInfo) {
|
|
107747
|
-
return new Promise(async (resolve,
|
|
107880
|
+
return new Promise(async (resolve, reject2) => {
|
|
107748
107881
|
try {
|
|
107749
107882
|
const connectors = await this.getConnectors();
|
|
107750
107883
|
const walletConnector = connectors.find(
|
|
@@ -107766,12 +107899,12 @@ const WalletConnect = new class WalletConnect2 {
|
|
|
107766
107899
|
resolve(address);
|
|
107767
107900
|
} catch (err) {
|
|
107768
107901
|
console.error("WalletConnect: Connection failed", err);
|
|
107769
|
-
|
|
107902
|
+
reject2(err);
|
|
107770
107903
|
}
|
|
107771
107904
|
});
|
|
107772
107905
|
}
|
|
107773
107906
|
async getChainId() {
|
|
107774
|
-
return new Promise((resolve,
|
|
107907
|
+
return new Promise((resolve, reject2) => {
|
|
107775
107908
|
try {
|
|
107776
107909
|
const activeCaipAddress = this.appKit.getCaipAddress();
|
|
107777
107910
|
console.log("DEBUG:: activeCaipAddress ", activeCaipAddress);
|
|
@@ -107779,7 +107912,7 @@ const WalletConnect = new class WalletConnect2 {
|
|
|
107779
107912
|
const chainId = activeCaipAddress.split(":").slice(0, 2).join(":");
|
|
107780
107913
|
resolve(chainId);
|
|
107781
107914
|
} catch (err) {
|
|
107782
|
-
|
|
107915
|
+
reject2(err);
|
|
107783
107916
|
}
|
|
107784
107917
|
});
|
|
107785
107918
|
}
|
|
@@ -107798,7 +107931,7 @@ const WalletConnect = new class WalletConnect2 {
|
|
|
107798
107931
|
});
|
|
107799
107932
|
}
|
|
107800
107933
|
verifyMessage(message, signature2, publicKeyString) {
|
|
107801
|
-
return new Promise((resolve,
|
|
107934
|
+
return new Promise((resolve, reject2) => {
|
|
107802
107935
|
try {
|
|
107803
107936
|
if (!publicKeyString) throw new Error("WalletConnect not connected");
|
|
107804
107937
|
const recoveredAddress = verifyMessage(message, signature2);
|
|
@@ -107806,18 +107939,18 @@ const WalletConnect = new class WalletConnect2 {
|
|
|
107806
107939
|
resolve(isValid4);
|
|
107807
107940
|
} catch (err) {
|
|
107808
107941
|
console.error(err);
|
|
107809
|
-
|
|
107942
|
+
reject2(err);
|
|
107810
107943
|
}
|
|
107811
107944
|
});
|
|
107812
107945
|
}
|
|
107813
107946
|
disconnect() {
|
|
107814
|
-
return new Promise(async (resolve,
|
|
107947
|
+
return new Promise(async (resolve, reject2) => {
|
|
107815
107948
|
try {
|
|
107816
107949
|
await ConnectionController.disconnect();
|
|
107817
107950
|
resolve();
|
|
107818
107951
|
} catch (error2) {
|
|
107819
107952
|
console.error("WalletConnect: Disconnection failed", error2);
|
|
107820
|
-
|
|
107953
|
+
reject2(error2);
|
|
107821
107954
|
}
|
|
107822
107955
|
});
|
|
107823
107956
|
}
|
|
@@ -108251,11 +108384,11 @@ function ContentSignup({
|
|
|
108251
108384
|
setShowedProviders(filteredProvidersArray);
|
|
108252
108385
|
};
|
|
108253
108386
|
const urlToQR = (url) => {
|
|
108254
|
-
return new Promise((resolve,
|
|
108387
|
+
return new Promise((resolve, reject2) => {
|
|
108255
108388
|
browser$4.toDataURL(url, (err, item) => {
|
|
108256
108389
|
if (err) {
|
|
108257
108390
|
console.log(`[sdk] QR failed to generate from URL: `, err);
|
|
108258
|
-
|
|
108391
|
+
reject2(err);
|
|
108259
108392
|
}
|
|
108260
108393
|
resolve(item);
|
|
108261
108394
|
});
|
|
@@ -108565,6 +108698,7 @@ function ModalSignin({ language, ...props }) {
|
|
|
108565
108698
|
const setModal = useStoreModals((state2) => state2.setModal);
|
|
108566
108699
|
const setIsSigning = useStoreUI((state2) => state2.setIsSigning);
|
|
108567
108700
|
const setIsSigningLoader = useStoreUI((state2) => state2.setIsSigningLoader);
|
|
108701
|
+
const setIsAcceptingTxn = useStoreUI((state2) => state2.setIsAcceptingTxn);
|
|
108568
108702
|
const setShowModal = (value) => {
|
|
108569
108703
|
if (!value) {
|
|
108570
108704
|
socket.emit("user:txns:update", { token: token2, state: "cancelled" });
|
|
@@ -108608,7 +108742,11 @@ const initialState = {
|
|
|
108608
108742
|
};
|
|
108609
108743
|
function ModalSignup({
|
|
108610
108744
|
isSpinner = initialState.isSpinner,
|
|
108611
|
-
|
|
108745
|
+
_setIsSpinner = () => {
|
|
108746
|
+
},
|
|
108747
|
+
_onChangeWebType = (_value) => {
|
|
108748
|
+
},
|
|
108749
|
+
_onChangeProviderSearch = (_value) => {
|
|
108612
108750
|
},
|
|
108613
108751
|
language = "es"
|
|
108614
108752
|
}) {
|
|
@@ -108658,6 +108796,180 @@ function ModalSignup({
|
|
|
108658
108796
|
}
|
|
108659
108797
|
);
|
|
108660
108798
|
}
|
|
108799
|
+
function FaArrowRight(props) {
|
|
108800
|
+
return GenIcon({ "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z" }, "child": [] }] })(props);
|
|
108801
|
+
}
|
|
108802
|
+
function FaTimes(props) {
|
|
108803
|
+
return GenIcon({ "attr": { "viewBox": "0 0 352 512" }, "child": [{ "tag": "path", "attr": { "d": "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z" }, "child": [] }] })(props);
|
|
108804
|
+
}
|
|
108805
|
+
function FaUndo(props) {
|
|
108806
|
+
return GenIcon({ "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z" }, "child": [] }] })(props);
|
|
108807
|
+
}
|
|
108808
|
+
const texts = {
|
|
108809
|
+
title: {
|
|
108810
|
+
en: "Do you want to restore your account?",
|
|
108811
|
+
es: "¿Quieres restaurar tu cuenta?"
|
|
108812
|
+
},
|
|
108813
|
+
yes: {
|
|
108814
|
+
en: "Restore",
|
|
108815
|
+
es: "Restaurar"
|
|
108816
|
+
},
|
|
108817
|
+
no: {
|
|
108818
|
+
en: "No",
|
|
108819
|
+
es: "No"
|
|
108820
|
+
},
|
|
108821
|
+
message: {
|
|
108822
|
+
en: "By continuing you will be able to return to your usual operations.",
|
|
108823
|
+
es: "Al continuar podrás volver a tu operativa habitual"
|
|
108824
|
+
}
|
|
108825
|
+
};
|
|
108826
|
+
function ModalRestore({ language = "es" }) {
|
|
108827
|
+
const { modals, closeModal } = useStoreModals();
|
|
108828
|
+
const provider2 = useStoreWS((state2) => state2.provider);
|
|
108829
|
+
const onNoClicked = () => {
|
|
108830
|
+
closeModal();
|
|
108831
|
+
};
|
|
108832
|
+
const onYesClicked = () => {
|
|
108833
|
+
if (provider2 && provider2.wsc) {
|
|
108834
|
+
const session = BrowserBase.getSession();
|
|
108835
|
+
const deletionAddress = useStoreUI.getState().deletionAddress;
|
|
108836
|
+
const _accessToken = provider2.wsc.accessToken;
|
|
108837
|
+
provider2.wsc.emit("sdk:restore", {
|
|
108838
|
+
token: _accessToken,
|
|
108839
|
+
address: session.did || deletionAddress
|
|
108840
|
+
});
|
|
108841
|
+
}
|
|
108842
|
+
closeModal();
|
|
108843
|
+
};
|
|
108844
|
+
const show = !!(modals["restore"] && modals["restore"].show);
|
|
108845
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
108846
|
+
ModalBase,
|
|
108847
|
+
{
|
|
108848
|
+
open: show,
|
|
108849
|
+
setOpen: (val) => !val && closeModal(),
|
|
108850
|
+
showTitle: false,
|
|
108851
|
+
showCloseButton: false,
|
|
108852
|
+
adaptedToMobile: true,
|
|
108853
|
+
adaptedToMobileClassNames: "flex h-full items-end justify-center md:items-center",
|
|
108854
|
+
ownStyles: `overflow-hidden bg-white rounded-2xl w-[90%] sm:max-w-[540px]`,
|
|
108855
|
+
children: [
|
|
108856
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full border-b-2 border-solid border-[--bal-primary-100] bg-[--bg-200] py-6 px-8 sm:py-10 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-bold text-[--bal-primary-900] sm:text-2xl", children: texts.title[language] }) }),
|
|
108857
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-8 p-8 sm:gap-10 sm:p-12", children: [
|
|
108858
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-4 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-base text-[--bal-primary-800] sm:text-lg", children: texts.message[language] }) }),
|
|
108859
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex w-full flex-col-reverse gap-4 sm:flex-row", children: [
|
|
108860
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108861
|
+
BtnBase,
|
|
108862
|
+
{
|
|
108863
|
+
btnId: "btn-no-restore-account",
|
|
108864
|
+
text: texts.no[language],
|
|
108865
|
+
size: "small",
|
|
108866
|
+
bgClassNames: "bg-blue-900",
|
|
108867
|
+
ringClassNames: "bal-ba-hover-ring-blue-600 bal-ba-focus-ring-blue-600",
|
|
108868
|
+
textClassNames: "text-white font-semibold uppercase tracking-wider",
|
|
108869
|
+
classNames: "w-full justify-center shadow-md",
|
|
108870
|
+
paddingClassNames: "py-3",
|
|
108871
|
+
isIcon: true,
|
|
108872
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FaTimes, { className: "mr-2 text-white" }),
|
|
108873
|
+
onClick: onNoClicked,
|
|
108874
|
+
disabled: !show
|
|
108875
|
+
}
|
|
108876
|
+
),
|
|
108877
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108878
|
+
BtnBase,
|
|
108879
|
+
{
|
|
108880
|
+
btnId: "btn-yes-restore-account",
|
|
108881
|
+
text: texts.yes[language],
|
|
108882
|
+
size: "small",
|
|
108883
|
+
bgClassNames: "bg-green-600 hover:bg-green-700",
|
|
108884
|
+
ringClassNames: "bal-ba-hover-ring-green-600 bal-ba-focus-ring-green-600",
|
|
108885
|
+
textClassNames: "text-white font-semibold tracking-wider uppercase",
|
|
108886
|
+
classNames: "w-full justify-center shadow-lg",
|
|
108887
|
+
paddingClassNames: "py-3",
|
|
108888
|
+
isIcon: true,
|
|
108889
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FaUndo, { className: "mr-2 text-white" }),
|
|
108890
|
+
onClick: onYesClicked,
|
|
108891
|
+
disabled: !show
|
|
108892
|
+
}
|
|
108893
|
+
)
|
|
108894
|
+
] })
|
|
108895
|
+
] })
|
|
108896
|
+
]
|
|
108897
|
+
}
|
|
108898
|
+
);
|
|
108899
|
+
}
|
|
108900
|
+
const TEXTS = {
|
|
108901
|
+
title: {
|
|
108902
|
+
en: "Restoration Period Expired",
|
|
108903
|
+
es: "Período de Restauración Expirado"
|
|
108904
|
+
},
|
|
108905
|
+
message: {
|
|
108906
|
+
en: "Account permanently deleted, please complete the registration again to use Blockauth again",
|
|
108907
|
+
es: "Cuenta eliminada permanentemente, complete el registro de nuevo para volver a usar Blockauth"
|
|
108908
|
+
},
|
|
108909
|
+
button: {
|
|
108910
|
+
en: "Continue",
|
|
108911
|
+
es: "Continuar"
|
|
108912
|
+
}
|
|
108913
|
+
};
|
|
108914
|
+
function ModalRestorationExpired({ language = "es" }) {
|
|
108915
|
+
const { modals, closeModal } = useStoreModals();
|
|
108916
|
+
const setIsOnDeletion = useStoreUI((state2) => state2.setIsOnDeletion);
|
|
108917
|
+
const show = useMemo(
|
|
108918
|
+
() => {
|
|
108919
|
+
var _a3;
|
|
108920
|
+
return !!((_a3 = modals.restorationExpired) == null ? void 0 : _a3.show);
|
|
108921
|
+
},
|
|
108922
|
+
[modals.restorationExpired]
|
|
108923
|
+
);
|
|
108924
|
+
const onOkClicked = () => {
|
|
108925
|
+
setIsOnDeletion(false);
|
|
108926
|
+
closeModal();
|
|
108927
|
+
};
|
|
108928
|
+
const buttonContent = useMemo(
|
|
108929
|
+
() => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
108930
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "uppercase tracking-wider", children: TEXTS.button[language] }),
|
|
108931
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FaArrowRight, { className: "text-white" })
|
|
108932
|
+
] }),
|
|
108933
|
+
[language]
|
|
108934
|
+
);
|
|
108935
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
108936
|
+
ModalBase,
|
|
108937
|
+
{
|
|
108938
|
+
open: show,
|
|
108939
|
+
setOpen: (val) => !val && onOkClicked(),
|
|
108940
|
+
showTitle: false,
|
|
108941
|
+
showCloseButton: false,
|
|
108942
|
+
adaptedToMobile: true,
|
|
108943
|
+
adaptedToMobileClassNames: "flex h-full items-end justify-center md:items-center",
|
|
108944
|
+
ownStyles: "overflow-hidden bg-white rounded-2xl w-[90%] sm:max-w-[540px]",
|
|
108945
|
+
children: [
|
|
108946
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("header", { className: "w-full border-b-2 border-solid border-[--bal-primary-100] bg-[--bg-200] py-6 px-8 text-center sm:py-10", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-bold text-[--bal-primary-900] sm:text-2xl", children: TEXTS.title[language] }) }),
|
|
108947
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("main", { className: "flex flex-col gap-8 p-8 sm:gap-10 sm:p-12", children: [
|
|
108948
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center gap-6 text-center", children: [
|
|
108949
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(PiWarningFill, { className: "h-12 w-12 text-black sm:h-20 sm:w-20" }),
|
|
108950
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("article", { className: "text-sm font-medium leading-relaxed text-black sm:text-base", children: TEXTS.message[language] })
|
|
108951
|
+
] }),
|
|
108952
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("footer", { className: "flex w-full justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108953
|
+
BtnBase,
|
|
108954
|
+
{
|
|
108955
|
+
btnId: "btn-ok-restoration-expired",
|
|
108956
|
+
text: buttonContent,
|
|
108957
|
+
size: "small",
|
|
108958
|
+
bgClassNames: "bg-blue-900",
|
|
108959
|
+
ringClassNames: "bal-ba-hover-ring-blue-600 bal-ba-focus-ring-blue-600",
|
|
108960
|
+
textClassNames: "text-white font-semibold",
|
|
108961
|
+
classNames: "w-full justify-center shadow-md",
|
|
108962
|
+
paddingClassNames: "py-3",
|
|
108963
|
+
isIcon: false,
|
|
108964
|
+
onClick: onOkClicked,
|
|
108965
|
+
disabled: !show
|
|
108966
|
+
}
|
|
108967
|
+
) })
|
|
108968
|
+
] })
|
|
108969
|
+
]
|
|
108970
|
+
}
|
|
108971
|
+
);
|
|
108972
|
+
}
|
|
108661
108973
|
const loadingInterval = 500;
|
|
108662
108974
|
const blockauthIcon = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108663
108975
|
"img",
|
|
@@ -108671,7 +108983,7 @@ const warningIcon = /* @__PURE__ */ jsxRuntimeExports.jsx(PiWarningFill, { class
|
|
|
108671
108983
|
function FlowBlockAuth({
|
|
108672
108984
|
apiKey = "replaceWithYourKey",
|
|
108673
108985
|
apiSecret = "replaceWithYourSecret",
|
|
108674
|
-
onSuccess = async (
|
|
108986
|
+
onSuccess = async (_address) => {
|
|
108675
108987
|
},
|
|
108676
108988
|
onError = async () => {
|
|
108677
108989
|
},
|
|
@@ -108680,7 +108992,7 @@ function FlowBlockAuth({
|
|
|
108680
108992
|
wsUrl = void 0,
|
|
108681
108993
|
language = "es",
|
|
108682
108994
|
showDropdownWhenConnected = true,
|
|
108683
|
-
|
|
108995
|
+
_theme = "light",
|
|
108684
108996
|
// light, dark, OS
|
|
108685
108997
|
isInsideModal = false,
|
|
108686
108998
|
containerRef = null,
|
|
@@ -108688,8 +109000,8 @@ function FlowBlockAuth({
|
|
|
108688
109000
|
// xxs, xs, tiny, small, base, large
|
|
108689
109001
|
btnClassNames = "bas-w-full bas-justify-center",
|
|
108690
109002
|
btnTextClassNames = "bas-font-semibold bas-leading-6 bas-text-base bas-text-white",
|
|
108691
|
-
|
|
108692
|
-
|
|
109003
|
+
_btnBgClassNames = void 0,
|
|
109004
|
+
_btnPaddingClassNames = void 0,
|
|
108693
109005
|
btnLoaderColor = "#fefefe",
|
|
108694
109006
|
dropdownBtnSize = "small",
|
|
108695
109007
|
// xs, small, base, large
|
|
@@ -108722,6 +109034,7 @@ function FlowBlockAuth({
|
|
|
108722
109034
|
const setIsSigningLoader = useStoreUI((state2) => state2.setIsSigningLoader);
|
|
108723
109035
|
const isServiceConnected = useStoreUI((state2) => state2.isServiceConnected);
|
|
108724
109036
|
const isSdkSignedIn = useStoreUI((state2) => state2.isSdkSignedIn);
|
|
109037
|
+
const isOnDeletion = useStoreUI((state2) => state2.isOnDeletion);
|
|
108725
109038
|
const isSigned = useStoreUI((state2) => state2.isSigned);
|
|
108726
109039
|
const isSignedFirstCheck = useStoreUI((state2) => state2.isSignedFirstCheck);
|
|
108727
109040
|
const isSigning = useStoreUI((state2) => state2.isSigning);
|
|
@@ -108741,6 +109054,7 @@ function FlowBlockAuth({
|
|
|
108741
109054
|
return "bas-bg-[rgba(0,78,152,0.8)] hover:bas-bg-[rgba(0,62,121,0.8)]";
|
|
108742
109055
|
} else {
|
|
108743
109056
|
if (isSdkSignedIn2) return void 0;
|
|
109057
|
+
else if (isOnDeletion) return "bas-bg-orange-500 hover:bas-bg-orange-600";
|
|
108744
109058
|
else return "bas-bg-red-500 hover:bas-bg-red-600";
|
|
108745
109059
|
}
|
|
108746
109060
|
};
|
|
@@ -108751,17 +109065,27 @@ function FlowBlockAuth({
|
|
|
108751
109065
|
const getText = (ready2, isUiConfig2, isSignedFirstCheck2, isSdkSignedIn2, isServiceConnected2, isSigned2) => {
|
|
108752
109066
|
if (!(ready2 && isUiConfig2 && isSignedFirstCheck2)) return "";
|
|
108753
109067
|
if (!isSdkSignedIn2) return btnsTexts.reviewApi[language];
|
|
109068
|
+
if (isOnDeletion) {
|
|
109069
|
+
const restoreDefault = {
|
|
109070
|
+
es: "Restaurar cuenta",
|
|
109071
|
+
en: "Restore account"
|
|
109072
|
+
};
|
|
109073
|
+
return btnsTexts.restore && btnsTexts.restore[language] || restoreDefault[language] || restoreDefault.en;
|
|
109074
|
+
}
|
|
108754
109075
|
if (!isServiceConnected2 && !isSigned2) return btnsTexts.signUp[language];
|
|
108755
109076
|
if (isServiceConnected2 && !isSigned2) return btnsTexts.logIn[language];
|
|
108756
109077
|
return "";
|
|
108757
109078
|
};
|
|
108758
109079
|
if (ready && isSdkSignedIn && isServiceConnected && !isSigned) {
|
|
108759
|
-
document.addEventListener("ext:txn:response", (
|
|
109080
|
+
document.addEventListener("ext:txn:response", () => {
|
|
108760
109081
|
});
|
|
108761
109082
|
}
|
|
108762
109083
|
const onFlowBAClicked = async () => {
|
|
108763
109084
|
if (!(isSdkSignedIn && ready)) return;
|
|
108764
|
-
if (
|
|
109085
|
+
if (isOnDeletion) {
|
|
109086
|
+
setModal("restore", { enabled: true, show: true });
|
|
109087
|
+
console.log("[sdk] Restore account clicked");
|
|
109088
|
+
} else if (!isServiceConnected && !isSigned) {
|
|
108765
109089
|
openModal("signup");
|
|
108766
109090
|
} else if (isServiceConnected && !isSigned) {
|
|
108767
109091
|
socket.emit("user:txns:create", {
|
|
@@ -108869,7 +109193,9 @@ function FlowBlockAuth({
|
|
|
108869
109193
|
}
|
|
108870
109194
|
),
|
|
108871
109195
|
modals.signin && modals.signin.enabled && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalSignin, { language }),
|
|
108872
|
-
modals.signup && modals.signup.enabled && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalSignup, { language })
|
|
109196
|
+
modals.signup && modals.signup.enabled && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalSignup, { language }),
|
|
109197
|
+
modals.restore && modals.restore.enabled && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalRestore, { language }),
|
|
109198
|
+
modals.restorationExpired && modals.restorationExpired.enabled && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalRestorationExpired, { language })
|
|
108873
109199
|
]
|
|
108874
109200
|
}
|
|
108875
109201
|
);
|
|
@@ -109005,4 +109331,4 @@ export {
|
|
|
109005
109331
|
WuiIconButton as y,
|
|
109006
109332
|
WuiIconLink as z
|
|
109007
109333
|
};
|
|
109008
|
-
//# sourceMappingURL=main-
|
|
109334
|
+
//# sourceMappingURL=main-h-jNMamK.js.map
|