tek-wallet 0.0.781 → 0.0.783
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/components/TekWallet/components/ui/ActivityItem/index.js +1 -1
- package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +77 -4
- package/dist/components/TekWallet/components/ui/SwiperControlled/index.js +16 -24
- package/dist/components/TekWallet/components/views/ActivityView/index.js +46 -36
- package/dist/components/TekWallet/components/views/ChangePasscodeView/const.js +1 -1
- package/dist/components/TekWallet/providers/TekWalletProvider/index.d.ts +3 -1
- package/dist/components/TekWallet/providers/TekWalletProvider/index.js +2 -2
- package/package.json +1 -1
|
@@ -92,7 +92,7 @@ function ActivityItem(props) {
|
|
|
92
92
|
}, [isIncrease, theme]);
|
|
93
93
|
if (!activityData)
|
|
94
94
|
return null;
|
|
95
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.
|
|
95
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, backgroundColor: theme.palette.background.tertiary, borderRadius: theme.mixins.customRadius.r16, backdropFilter: "blur(12px)", p: theme.mixins.customPadding.p16, flexGrow: "unset" }), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
96
96
|
width: "fit-content",
|
|
97
97
|
height: "fit-content",
|
|
98
98
|
}, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: type === null || type === void 0 ? void 0 : type.link, width: 28, sx: { borderRadius: theme.mixins.customRadius.full } }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityTitle, children: type === null || type === void 0 ? void 0 : type.name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityDescription, children: descriptionElement }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 12, sx: {
|
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
40
|
};
|
|
@@ -19,7 +55,7 @@ var STYLES = {
|
|
|
19
55
|
nodeSize: "10%",
|
|
20
56
|
};
|
|
21
57
|
var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
22
|
-
var sx = props.sx, className = props.className;
|
|
58
|
+
var sx = props.sx, className = props.className, children = props.children, onResult = props.onResult;
|
|
23
59
|
var qrReaderContainer = (0, react_1.useRef)(null);
|
|
24
60
|
var drawerRef = (0, react_1.useRef)(null);
|
|
25
61
|
var _a = (0, react_1.useState)(false), isOpen = _a[0], setIsOpen = _a[1];
|
|
@@ -87,8 +123,45 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
87
123
|
};
|
|
88
124
|
}, []);
|
|
89
125
|
var theme = (0, providers_1.useTheme)();
|
|
90
|
-
var
|
|
91
|
-
|
|
126
|
+
var _d = (0, providers_1.useWalletSetup)(), topOffset = _d.topOffset, overrideQRScanMethod = _d.overrideQRScanMethod;
|
|
127
|
+
if (!!overrideQRScanMethod) {
|
|
128
|
+
var handleOverrideQRScanMethod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
129
|
+
var result, fakeIDetectedBarcode, error_1;
|
|
130
|
+
return __generator(this, function (_a) {
|
|
131
|
+
switch (_a.label) {
|
|
132
|
+
case 0:
|
|
133
|
+
_a.trys.push([0, 2, , 3]);
|
|
134
|
+
return [4 /*yield*/, overrideQRScanMethod()];
|
|
135
|
+
case 1:
|
|
136
|
+
result = _a.sent();
|
|
137
|
+
if (!result) {
|
|
138
|
+
console.warn("🚀 ~ handleOverrideQRScanMethod ~ result:", result);
|
|
139
|
+
return [2 /*return*/];
|
|
140
|
+
}
|
|
141
|
+
fakeIDetectedBarcode = {
|
|
142
|
+
rawValue: result,
|
|
143
|
+
format: "QR_CODE",
|
|
144
|
+
boundingBox: {
|
|
145
|
+
width: 0,
|
|
146
|
+
height: 0,
|
|
147
|
+
x: 0,
|
|
148
|
+
y: 0,
|
|
149
|
+
},
|
|
150
|
+
cornerPoints: [],
|
|
151
|
+
};
|
|
152
|
+
onResult([fakeIDetectedBarcode]);
|
|
153
|
+
return [3 /*break*/, 3];
|
|
154
|
+
case 2:
|
|
155
|
+
error_1 = _a.sent();
|
|
156
|
+
console.error(error_1);
|
|
157
|
+
return [3 /*break*/, 3];
|
|
158
|
+
case 3: return [2 /*return*/];
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}); };
|
|
162
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: sx, className: className, onClick: handleOverrideQRScanMethod, children: children }));
|
|
163
|
+
}
|
|
164
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { trigger: children, ref: drawerRef, onDone: onClose, onOpen: onOpen, sx: sx, className: className, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
|
|
92
165
|
backgroundColor: "transparent !important",
|
|
93
166
|
}, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { hideBack: true, title: "Scan QR code", sx: {
|
|
94
167
|
position: "absolute",
|
|
@@ -181,7 +254,7 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
181
254
|
height: "100%",
|
|
182
255
|
objectFit: "cover",
|
|
183
256
|
},
|
|
184
|
-
}, onScan:
|
|
257
|
+
}, onScan: onResult })] })] })) }) }) }));
|
|
185
258
|
});
|
|
186
259
|
QrCodeReader.displayName = "QrCodeReader";
|
|
187
260
|
exports.default = QrCodeReader;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
2
3
|
var __assign = (this && this.__assign) || function () {
|
|
3
4
|
__assign = Object.assign || function(t) {
|
|
4
5
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -10,15 +11,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
11
|
};
|
|
11
12
|
return __assign.apply(this, arguments);
|
|
12
13
|
};
|
|
13
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
-
if (ar || !(i in from)) {
|
|
16
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
-
ar[i] = from[i];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
-
};
|
|
22
14
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
15
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
16
|
};
|
|
@@ -32,27 +24,24 @@ var useCustomRouter_1 = __importDefault(require("../../../hooks/useCustomRouter"
|
|
|
32
24
|
var navigation_2 = require("next/navigation");
|
|
33
25
|
var createDebounce_1 = __importDefault(require("../../../utils/createDebounce"));
|
|
34
26
|
var providers_1 = require("../../../providers");
|
|
35
|
-
var rememberTabDeBounce = (0, createDebounce_1.default)(
|
|
27
|
+
var rememberTabDeBounce = (0, createDebounce_1.default)(200);
|
|
36
28
|
var SwiperControlled = (0, react_2.forwardRef)(function (props, ref) {
|
|
29
|
+
var swiperProps = props.swiperProps, tabsSx = props.tabsSx, tabs = props.tabs, children = props.children, sx = props.sx, swiperStyle = props.swiperStyle, _a = props.tabParamName, tabParamName = _a === void 0 ? "" : _a, onTabChange = props.onTabChange, disableSwipe = props.disableSwipe, _b = props.initialActiveTab, initialActiveTab = _b === void 0 ? 0 : _b;
|
|
37
30
|
var swiperRef = (0, react_2.useRef)(null);
|
|
38
31
|
var theme = (0, providers_1.useTheme)();
|
|
39
32
|
var router = (0, useCustomRouter_1.default)();
|
|
40
33
|
var pathname = (0, navigation_2.usePathname)();
|
|
41
34
|
var searchParams = (0, navigation_1.useSearchParams)();
|
|
42
|
-
var tabParamName = props.tabParamName || "";
|
|
43
35
|
var initialTab = searchParams.get(tabParamName);
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
|
|
36
|
+
var totalTabs = tabs === null || tabs === void 0 ? void 0 : tabs.length;
|
|
37
|
+
var _c = (0, react_2.useState)(initialTab ? +initialTab : initialActiveTab), activeTab = _c[0], setActiveTab = _c[1];
|
|
38
|
+
var onTabChanged = function (index) {
|
|
47
39
|
setActiveTab(index);
|
|
48
|
-
|
|
40
|
+
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(index);
|
|
49
41
|
};
|
|
50
|
-
(0, react_2.useEffect)(function () {
|
|
51
|
-
onTabChange(activeTab);
|
|
52
|
-
}, []);
|
|
53
42
|
var slideTo = function (index) {
|
|
54
43
|
var _a, _b;
|
|
55
|
-
|
|
44
|
+
onTabChanged(index);
|
|
56
45
|
(_b = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(index);
|
|
57
46
|
};
|
|
58
47
|
var next = function () {
|
|
@@ -81,20 +70,23 @@ var SwiperControlled = (0, react_2.forwardRef)(function (props, ref) {
|
|
|
81
70
|
router.replace("".concat(pathname, "?").concat(params.toString()));
|
|
82
71
|
};
|
|
83
72
|
var handleSlideChange = function (swiper) {
|
|
84
|
-
|
|
73
|
+
onTabChanged(swiper.activeIndex);
|
|
85
74
|
rememberTabDeBounce(function () { return rememberTab(swiper.activeIndex); });
|
|
86
75
|
};
|
|
87
76
|
var handleTabChange = function (event, value) {
|
|
88
77
|
var _a, _b;
|
|
89
|
-
|
|
78
|
+
onTabChanged(value);
|
|
90
79
|
(_b = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(value);
|
|
91
80
|
rememberTabDeBounce(function () { return rememberTab(value); });
|
|
92
81
|
};
|
|
93
|
-
|
|
82
|
+
(0, react_2.useEffect)(function () {
|
|
83
|
+
handleTabChange(null, activeTab);
|
|
84
|
+
}, [totalTabs]);
|
|
85
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ width: "100%", display: "flex", flexDirection: "column" }, sx), children: [props.tabs && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
94
86
|
maxWidth: "100%",
|
|
95
|
-
}, children: (0, jsx_runtime_1.
|
|
87
|
+
}, children: (0, jsx_runtime_1.jsx)(material_1.Tabs, { value: activeTab, onChange: handleTabChange, variant: "scrollable", scrollButtons: "auto", sx: __assign({ "& .MuiTabs-indicator": {
|
|
96
88
|
backgroundColor: theme.palette.background.primary,
|
|
97
|
-
}, minHeight: "unset" },
|
|
89
|
+
}, minHeight: "unset" }, tabsSx), children: tabs }) })), (0, jsx_runtime_1.jsx)(react_1.Swiper, __assign({ speed: 500 }, swiperProps, { onSlideChange: handleSlideChange, ref: swiperRef, initialSlide: activeTab, style: __assign({ width: "100%" }, swiperStyle), allowTouchMove: !disableSwipe, children: children }))] }));
|
|
98
90
|
});
|
|
99
91
|
SwiperControlled.displayName = "SwiperControlled";
|
|
100
92
|
exports.default = SwiperControlled;
|
|
@@ -16,51 +16,61 @@ var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
|
16
16
|
var react_2 = require("swiper/react");
|
|
17
17
|
var ActivitiesTypeSlice_1 = __importDefault(require("../../ui/ActivitiesTypeSlice"));
|
|
18
18
|
var TekWalletProvider_1 = require("../../../providers/TekWalletProvider");
|
|
19
|
+
var const_1 = require("../../../providers/ActivitiesProvider/const");
|
|
20
|
+
var EmptyData_1 = __importDefault(require("../../ui/EmptyData"));
|
|
19
21
|
var ActivityView = function (props) {
|
|
22
|
+
var _a;
|
|
20
23
|
var sx = props.sx;
|
|
21
24
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
22
25
|
var options = (0, TekWalletProvider_1.useWalletSetup)().options;
|
|
23
26
|
var hideBackButtons = (options || {}).hideBackButtons;
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var _a = (0, react_1.useState)(0), activeTab = _a[0], setActiveTab = _a[1];
|
|
27
|
+
var _b = (0, useActivities_1.default)(), activityTypes = _b.activityTypes, activities = _b.activities;
|
|
28
|
+
var _c = (0, react_1.useState)(0), activeTab = _c[0], setActiveTab = _c[1];
|
|
27
29
|
var handleSlideChange = function (index) {
|
|
28
30
|
setActiveTab(index);
|
|
29
31
|
};
|
|
30
|
-
|
|
32
|
+
var hasActivities = (0, react_1.useMemo)(function () {
|
|
33
|
+
var _a;
|
|
34
|
+
return activities && ((_a = Object.values(activities)) === null || _a === void 0 ? void 0 : _a.flat().length) > 0;
|
|
35
|
+
}, [activities]);
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Activities", hideBack: !!(hideBackButtons === null || hideBackButtons === void 0 ? void 0 : hideBackButtons.activity) }), sx: sx, children: [((_a = activities === null || activities === void 0 ? void 0 : activities[const_1.ACTIVITIES_TYPE_ALL.slug]) === null || _a === void 0 ? void 0 : _a.length) === 0 && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { sx: { marginBottom: "auto", marginTop: "4rem" }, description: "You haven't any activity yet" })), (!!hasActivities || !activities) && ((0, jsx_runtime_1.jsx)(SwiperControlled_1.default
|
|
31
37
|
// tabParamName="activity-tab"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
38
|
+
, {
|
|
39
|
+
// tabParamName="activity-tab"
|
|
40
|
+
swiperProps: {
|
|
41
|
+
slidesPerView: 1,
|
|
42
|
+
spaceBetween: 20,
|
|
43
|
+
}, tabsSx: {
|
|
44
|
+
display: hasActivities ? "flex" : "none",
|
|
45
|
+
}, onTabChange: handleSlideChange, tabs: activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.map(function (type, index) {
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Tab, { label: type.name, value: index, "data-index": index, sx: {
|
|
47
|
+
padding: "".concat(theme.mixins.customPadding.p8, " ").concat(theme.mixins.customPadding.p16),
|
|
48
|
+
minHeight: "unset",
|
|
49
|
+
minWidth: "unset",
|
|
50
|
+
textTransform: "capitalize",
|
|
51
|
+
color: theme.palette.text.accent2,
|
|
52
|
+
transition: "all 0.3s linear",
|
|
53
|
+
fontSize: theme.typography.fontSize12,
|
|
54
|
+
borderColor: "currentcolor",
|
|
55
|
+
"&.Mui-selected": {
|
|
56
|
+
color: theme.palette.text.primary,
|
|
57
|
+
},
|
|
58
|
+
"&.Mui-selected::after": {
|
|
59
|
+
content: "''",
|
|
60
|
+
position: "absolute",
|
|
61
|
+
bottom: 0,
|
|
62
|
+
left: 0,
|
|
63
|
+
},
|
|
64
|
+
} }, index));
|
|
65
|
+
}), sx: {
|
|
66
|
+
height: "100%",
|
|
67
|
+
}, swiperStyle: {
|
|
68
|
+
flex: 1,
|
|
69
|
+
}, children: activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.map(function (type, index) {
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { style: {
|
|
71
|
+
position: "relative",
|
|
72
|
+
}, children: (index === activeTab || index === activeTab - 1 || index === activeTab + 1) && ((0, jsx_runtime_1.jsx)(ActivitiesTypeSlice_1.default, { type: type, isActive: activeTab === index })) }, index));
|
|
73
|
+
}) }))] }));
|
|
64
74
|
};
|
|
65
75
|
exports.ActivityView = ActivityView;
|
|
66
76
|
exports.ActivityView.displayName = "Activities";
|
|
@@ -26,7 +26,7 @@ exports.STEPS_CONTENT_FOR_INIT_PASSCODE = (_b = {},
|
|
|
26
26
|
},
|
|
27
27
|
_b[type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE] = {
|
|
28
28
|
title: "Enter Passcode",
|
|
29
|
-
description: "
|
|
29
|
+
description: "This passcode will be required to confirm wallet transactions. Please note that it cannot be recovered if lost, so store it securely to avoid losing access to your assets.",
|
|
30
30
|
},
|
|
31
31
|
_b[type_1.ChangePasscodeViewStep.CONFIRM_NEW_PASSCODE] = {
|
|
32
32
|
title: "Confirm The Passcode",
|
|
@@ -19,14 +19,16 @@ export interface TekWalletProviderProps {
|
|
|
19
19
|
options?: Options;
|
|
20
20
|
onLogout?: () => void;
|
|
21
21
|
topOffset?: number;
|
|
22
|
+
overrideQRScanMethod?: () => Promise<string>;
|
|
22
23
|
}
|
|
23
24
|
export interface TekWalletContextType {
|
|
24
25
|
isSSO: boolean | undefined;
|
|
25
26
|
options?: Options;
|
|
26
27
|
onLogout?: () => void;
|
|
27
28
|
topOffset?: number;
|
|
29
|
+
overrideQRScanMethod?: () => Promise<string>;
|
|
28
30
|
}
|
|
29
31
|
export declare const TekWalletContext: import("react").Context<TekWalletContextType>;
|
|
30
|
-
export declare function TekWalletProvider({ children, isSSO, accessToken, options, topOffset, onLogout, }: TekWalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function TekWalletProvider({ children, isSSO, accessToken, options, topOffset, onLogout, overrideQRScanMethod, }: TekWalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
31
33
|
export default TekWalletProvider;
|
|
32
34
|
export declare const useWalletSetup: () => TekWalletContextType;
|
|
@@ -30,13 +30,13 @@ var initialTekWalletContext = {
|
|
|
30
30
|
};
|
|
31
31
|
exports.TekWalletContext = (0, react_1.createContext)(initialTekWalletContext);
|
|
32
32
|
function TekWalletProvider(_a) {
|
|
33
|
-
var children = _a.children, isSSO = _a.isSSO, accessToken = _a.accessToken, options = _a.options, topOffset = _a.topOffset, onLogout = _a.onLogout;
|
|
33
|
+
var children = _a.children, isSSO = _a.isSSO, accessToken = _a.accessToken, options = _a.options, topOffset = _a.topOffset, onLogout = _a.onLogout, overrideQRScanMethod = _a.overrideQRScanMethod;
|
|
34
34
|
var WalletProvider = isSSO ? WalletDataProviderNoImport_1.default : WalletDataProvider_1.default;
|
|
35
35
|
var _b = (0, react_1.useState)("1"), resetTrigger = _b[0], setResetTrigger = _b[1];
|
|
36
36
|
var onDisconnect = function () {
|
|
37
37
|
setResetTrigger(function (prev) { return prev + "1"; });
|
|
38
38
|
};
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(exports.TekWalletContext.Provider, { value: { isSSO: isSSO, options: options, onLogout: onLogout, topOffset: topOffset }, children: (0, jsx_runtime_1.jsx)(WalletProvider, { accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : "", onDisconnect: onDisconnect, children: (0, jsx_runtime_1.jsx)(ThemeProvider_1.CustomThemeProvider, { children: (0, jsx_runtime_1.jsx)(RealtimeProvider_1.default, { options: options, children: (0, jsx_runtime_1.jsx)(ActivitiesProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ReceiveProvider_1.default, { children: (0, jsx_runtime_1.jsx)(LockTokenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(WithdrawProvider_1.default, { children: (0, jsx_runtime_1.jsx)(SwapProvider_1.default, { children: (0, jsx_runtime_1.jsx)(EventHandlerProvider_1.default, { options: options, children: children }) }) }) }) }) }) }) }) }, resetTrigger) }));
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(exports.TekWalletContext.Provider, { value: { isSSO: isSSO, options: options, onLogout: onLogout, topOffset: topOffset, overrideQRScanMethod: overrideQRScanMethod }, children: (0, jsx_runtime_1.jsx)(WalletProvider, { accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : "", onDisconnect: onDisconnect, children: (0, jsx_runtime_1.jsx)(ThemeProvider_1.CustomThemeProvider, { children: (0, jsx_runtime_1.jsx)(RealtimeProvider_1.default, { options: options, children: (0, jsx_runtime_1.jsx)(ActivitiesProvider_1.default, { children: (0, jsx_runtime_1.jsx)(ReceiveProvider_1.default, { children: (0, jsx_runtime_1.jsx)(LockTokenProvider_1.default, { children: (0, jsx_runtime_1.jsx)(WithdrawProvider_1.default, { children: (0, jsx_runtime_1.jsx)(SwapProvider_1.default, { children: (0, jsx_runtime_1.jsx)(EventHandlerProvider_1.default, { options: options, children: children }) }) }) }) }) }) }) }) }, resetTrigger) }));
|
|
40
40
|
}
|
|
41
41
|
exports.default = TekWalletProvider;
|
|
42
42
|
var useWalletSetup = function () {
|