tek-wallet 0.0.813 → 0.0.822
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/AssetsBoard/index.d.ts +2 -0
- package/dist/components/TekWallet/components/ui/AssetsBoard/index.js +60 -0
- package/dist/components/TekWallet/components/ui/ChangePasscode/index.js +1 -1
- package/dist/components/TekWallet/components/ui/ConfirmByPasscode/index.js +4 -4
- package/dist/components/TekWallet/components/ui/ConfirmSendExternal/index.d.ts +2 -2
- package/dist/components/TekWallet/components/ui/ConfirmSendExternal/index.js +1 -1
- package/dist/components/TekWallet/components/ui/ConfirmSendNft/Result.d.ts +10 -0
- package/dist/components/TekWallet/components/ui/ConfirmSendNft/Result.js +87 -0
- package/dist/components/TekWallet/components/ui/ConfirmSendNft/index.d.ts +17 -0
- package/dist/components/TekWallet/components/ui/ConfirmSendNft/index.js +133 -0
- package/dist/components/TekWallet/components/ui/ConfirmSwapToken/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/ConfirmSwapToken/index.js +1 -1
- package/dist/components/TekWallet/components/ui/DrawerComponent/index.d.ts +1 -1
- package/dist/components/TekWallet/components/ui/DrawerComponent/index.js +2 -1
- package/dist/components/TekWallet/components/ui/LoadingLayout/index.js +1 -1
- package/dist/components/TekWallet/components/ui/NftDetail/index.d.ts +6 -0
- package/dist/components/TekWallet/components/ui/NftDetail/index.js +47 -0
- package/dist/components/TekWallet/components/ui/NftItem/index.d.ts +8 -0
- package/dist/components/TekWallet/components/ui/NftItem/index.js +74 -0
- package/dist/components/TekWallet/components/ui/NftsBoard/index.d.ts +2 -0
- package/dist/components/TekWallet/components/ui/NftsBoard/index.js +118 -0
- package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +1 -1
- package/dist/components/TekWallet/components/ui/ReceiveDirectly/index.js +1 -1
- package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +2 -2
- package/dist/components/TekWallet/components/ui/ReceiveHistory/index.js +1 -1
- package/dist/components/TekWallet/components/ui/TokensBoard/index.js +21 -44
- package/dist/components/TekWallet/components/ui/WithdrawFunction/index.js +1 -1
- package/dist/components/TekWallet/components/views/AssetView/index.js +2 -2
- package/dist/components/TekWallet/components/views/NftDetailView/LoadingView.d.ts +2 -0
- package/dist/components/TekWallet/components/views/NftDetailView/LoadingView.js +29 -0
- package/dist/components/TekWallet/components/views/NftDetailView/index.d.ts +8 -0
- package/dist/components/TekWallet/components/views/NftDetailView/index.js +20 -0
- package/dist/components/TekWallet/components/views/SendExternalView/index.js +1 -1
- package/dist/components/TekWallet/components/views/SendNftView/components/Form.d.ts +12 -0
- package/dist/components/TekWallet/components/views/SendNftView/components/Form.js +268 -0
- package/dist/components/TekWallet/components/views/SendNftView/index.d.ts +2 -0
- package/dist/components/TekWallet/components/views/SendNftView/index.js +32 -0
- package/dist/components/TekWallet/components/views/SwapView/index.js +1 -1
- package/dist/components/TekWallet/components/views/TekWalletView/index.d.ts +1 -0
- package/dist/components/TekWallet/components/views/TekWalletView/index.js +5 -0
- package/dist/components/TekWallet/hooks/data/useNfts/api.d.ts +5 -0
- package/dist/components/TekWallet/hooks/data/useNfts/api.js +83 -0
- package/dist/components/TekWallet/hooks/data/useNfts/index.d.ts +213 -0
- package/dist/components/TekWallet/hooks/data/useNfts/index.js +55 -0
- package/dist/components/TekWallet/hooks/data/useNfts/nftQueryKey.d.ts +5 -0
- package/dist/components/TekWallet/hooks/data/useNfts/nftQueryKey.js +18 -0
- package/dist/components/TekWallet/hooks/data/useNfts/service.type.d.ts +84 -0
- package/dist/components/TekWallet/hooks/data/useNfts/service.type.js +10 -0
- package/dist/components/TekWallet/hooks/data/useNfts/state.type.d.ts +4 -0
- package/dist/components/TekWallet/hooks/data/useNfts/state.type.js +2 -0
- package/dist/components/TekWallet/hooks/data/useNfts/useNft.d.ts +22 -0
- package/dist/components/TekWallet/hooks/data/useNfts/useNft.js +213 -0
- package/dist/components/TekWallet/hooks/data/useVouchers/service.type.d.ts +22 -0
- package/dist/components/TekWallet/hooks/data/useVouchers/service.type.js +14 -0
- package/dist/components/TekWallet/hooks/store/useQueryKeys/index.d.ts +3 -0
- package/dist/components/TekWallet/hooks/store/useQueryKeys/index.js +86 -0
- package/dist/components/TekWallet/hooks/store/useQueryKeys/type.d.ts +27 -0
- package/dist/components/TekWallet/hooks/store/useQueryKeys/type.js +29 -0
- package/dist/components/TekWallet/hooks/store/useQueryKeys/useQueryKeyDependence.d.ts +11 -0
- package/dist/components/TekWallet/hooks/store/useQueryKeys/useQueryKeyDependence.js +35 -0
- package/dist/components/TekWallet/hooks/store/useQueryKeys/useQueryKeyDependenceOnAccount.d.ts +6 -0
- package/dist/components/TekWallet/hooks/store/useQueryKeys/useQueryKeyDependenceOnAccount.js +25 -0
- package/dist/components/TekWallet/hooks/useCustomRouter.js +7 -3
- package/dist/components/TekWallet/hooks/utils/useEditPageQuery.d.ts +9 -0
- package/dist/components/TekWallet/hooks/utils/useEditPageQuery.js +86 -0
- package/dist/components/TekWallet/hooks/utils/useEditSinglePageQuery.d.ts +4 -0
- package/dist/components/TekWallet/hooks/utils/useEditSinglePageQuery.js +75 -0
- package/dist/components/TekWallet/providers/TanstackReactQuery/index.d.ts +4 -0
- package/dist/components/TekWallet/providers/TanstackReactQuery/index.js +30 -0
- package/dist/components/TekWallet/providers/TanstackReactQuery/query.config.d.ts +2 -0
- package/dist/components/TekWallet/providers/TanstackReactQuery/query.config.js +18 -0
- package/dist/components/TekWallet/providers/TekWalletProvider/index.d.ts +1 -0
- package/dist/components/TekWallet/providers/TekWalletProvider/index.js +3 -1
- package/dist/components/TekWallet/services/axios/clients/userClientRequest.d.ts +2 -2
- package/dist/components/TekWallet/services/axios/clients/userClientRequest.js +3 -3
- package/dist/components/TekWallet/services/axios/type.d.ts +11 -0
- package/dist/components/TekWallet/theme/mui/components/index.d.ts +1 -15
- package/dist/components/TekWallet/theme/mui/components/overrides/Button.d.ts +1 -15
- package/dist/components/TekWallet/theme/mui/components/overrides/Button.js +3 -8
- package/dist/components/TekWallet/theme/mui/palette.d.ts +10 -4
- package/dist/components/TekWallet/theme/mui/palette.js +6 -1
- package/dist/components/TekWallet/utils/getContractColor.d.ts +1 -1
- package/package.json +5 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = require("react");
|
|
7
|
+
var _1 = __importDefault(require("./"));
|
|
8
|
+
var providers_1 = require("../../../providers");
|
|
9
|
+
function useQueryKeyDependenceOnAccount(name) {
|
|
10
|
+
var accessToken = (0, providers_1.useWalletSetup)().accessToken;
|
|
11
|
+
var queryKey = (0, _1.default)(function (state) { return state.getQueryKey(name); });
|
|
12
|
+
var queryKeyMap = (0, _1.default)(function (state) { return state.getQueryKeyMap(name); });
|
|
13
|
+
var setQueryFields = (0, _1.default)(function (state) { return state.setQueryFields; });
|
|
14
|
+
var isReady = queryKeyMap.has("accessToken");
|
|
15
|
+
(0, react_1.useEffect)(function () {
|
|
16
|
+
setQueryFields(name, {
|
|
17
|
+
accessToken: accessToken,
|
|
18
|
+
});
|
|
19
|
+
}, [accessToken, name, setQueryFields]);
|
|
20
|
+
return {
|
|
21
|
+
queryKey: queryKey,
|
|
22
|
+
isReady: isReady,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
exports.default = useQueryKeyDependenceOnAccount;
|
|
@@ -12,12 +12,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
var navigation_1 = require("next/navigation");
|
|
15
|
+
var react_1 = require("react");
|
|
15
16
|
function useCustomRouter() {
|
|
16
17
|
var router = (0, navigation_1.useRouter)();
|
|
17
|
-
var push = function (path) {
|
|
18
|
+
var push = (0, react_1.useCallback)(function (path) {
|
|
18
19
|
//some logic (play sound, vibrate...)
|
|
19
20
|
router.push(path);
|
|
20
|
-
};
|
|
21
|
-
|
|
21
|
+
}, [router]);
|
|
22
|
+
var appRouter = (0, react_1.useMemo)(function () {
|
|
23
|
+
return __assign(__assign({}, router), { push: push });
|
|
24
|
+
}, [router, push]);
|
|
25
|
+
return appRouter;
|
|
22
26
|
}
|
|
23
27
|
exports.default = useCustomRouter;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InfiniteData } from "@tanstack/react-query";
|
|
2
|
+
interface EditPageQueryResponse<T> {
|
|
3
|
+
previousData: InfiniteData<T> | undefined;
|
|
4
|
+
newData: InfiniteData<T> | undefined;
|
|
5
|
+
}
|
|
6
|
+
declare function useEditPageQuery(): {
|
|
7
|
+
editPageQuery: <T>(queryKey: unknown[], editFunction: (page: T, index?: number, pages?: T[], old?: InfiniteData<T>) => T | undefined | null) => Promise<EditPageQueryResponse<T>>;
|
|
8
|
+
};
|
|
9
|
+
export default useEditPageQuery;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
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);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
var react_query_1 = require("@tanstack/react-query");
|
|
51
|
+
var react_1 = require("react");
|
|
52
|
+
function useEditPageQuery() {
|
|
53
|
+
var _this = this;
|
|
54
|
+
var queryClient = (0, react_query_1.useQueryClient)();
|
|
55
|
+
var editPageQuery = (0, react_1.useCallback)(function (queryKey, editFunction) { return __awaiter(_this, void 0, void 0, function () {
|
|
56
|
+
var previousData, newData, isDefined;
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
switch (_a.label) {
|
|
59
|
+
case 0: return [4 /*yield*/, queryClient.cancelQueries({ queryKey: queryKey })];
|
|
60
|
+
case 1:
|
|
61
|
+
_a.sent();
|
|
62
|
+
return [4 /*yield*/, queryClient.getQueryData(queryKey)];
|
|
63
|
+
case 2:
|
|
64
|
+
previousData = _a.sent();
|
|
65
|
+
isDefined = function (value) { return value != null; };
|
|
66
|
+
queryClient.setQueryData(queryKey, function (old) {
|
|
67
|
+
try {
|
|
68
|
+
if (!old)
|
|
69
|
+
return old;
|
|
70
|
+
var newPages = old.pages
|
|
71
|
+
.map(function (page, index, pages) { return editFunction(page, index, pages, old); })
|
|
72
|
+
.filter(isDefined);
|
|
73
|
+
newData = __assign(__assign({}, old), { pages: newPages });
|
|
74
|
+
return newData;
|
|
75
|
+
}
|
|
76
|
+
catch (_a) {
|
|
77
|
+
return old;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return [2 /*return*/, { previousData: previousData, newData: newData }];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}); }, [queryClient]);
|
|
84
|
+
return { editPageQuery: editPageQuery };
|
|
85
|
+
}
|
|
86
|
+
exports.default = useEditPageQuery;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
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);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
var react_query_1 = require("@tanstack/react-query");
|
|
51
|
+
var react_1 = require("react");
|
|
52
|
+
function useEditSinglePageQuery() {
|
|
53
|
+
var _this = this;
|
|
54
|
+
var queryClient = (0, react_query_1.useQueryClient)();
|
|
55
|
+
var editSinglePageQuery = (0, react_1.useCallback)(function (queryKey, editFunction) { return __awaiter(_this, void 0, void 0, function () {
|
|
56
|
+
return __generator(this, function (_a) {
|
|
57
|
+
switch (_a.label) {
|
|
58
|
+
case 0: return [4 /*yield*/, queryClient.cancelQueries({ queryKey: queryKey })];
|
|
59
|
+
case 1:
|
|
60
|
+
_a.sent();
|
|
61
|
+
queryClient.setQueryData(queryKey, function (old) {
|
|
62
|
+
try {
|
|
63
|
+
return __assign(__assign({}, (old || {})), editFunction(old));
|
|
64
|
+
}
|
|
65
|
+
catch (_a) {
|
|
66
|
+
return old;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return [2 /*return*/];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}); }, [queryClient]);
|
|
73
|
+
return { editSinglePageQuery: editSinglePageQuery };
|
|
74
|
+
}
|
|
75
|
+
exports.default = useEditSinglePageQuery;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var _a;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = require("react");
|
|
7
|
+
var react_query_1 = require("@tanstack/react-query");
|
|
8
|
+
var react_query_persist_client_1 = require("@tanstack/react-query-persist-client");
|
|
9
|
+
var query_sync_storage_persister_1 = require("@tanstack/query-sync-storage-persister");
|
|
10
|
+
var query_config_1 = require("./query.config");
|
|
11
|
+
var CACHE_MAX_AGE = 1000 * 60 * 60 * 24 * 30; // 30 days
|
|
12
|
+
var RELEASE_BUSTER = (_a = process.env.NEXT_PUBLIC_RELEASE_ID) !== null && _a !== void 0 ? _a : "default";
|
|
13
|
+
function TanstackReactQuery(_a) {
|
|
14
|
+
var children = _a.children;
|
|
15
|
+
var persister = (0, react_1.useMemo)(function () {
|
|
16
|
+
if (typeof window === "undefined") {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return (0, query_sync_storage_persister_1.createSyncStoragePersister)({ storage: window.localStorage });
|
|
20
|
+
}, []);
|
|
21
|
+
if (!persister) {
|
|
22
|
+
return (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: query_config_1.queryClient, children: children });
|
|
23
|
+
}
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(react_query_persist_client_1.PersistQueryClientProvider, { client: query_config_1.queryClient, persistOptions: {
|
|
25
|
+
persister: persister,
|
|
26
|
+
maxAge: CACHE_MAX_AGE,
|
|
27
|
+
buster: RELEASE_BUSTER,
|
|
28
|
+
}, children: children }));
|
|
29
|
+
}
|
|
30
|
+
exports.default = TanstackReactQuery;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.queryClient = void 0;
|
|
4
|
+
var react_query_1 = require("@tanstack/react-query");
|
|
5
|
+
exports.queryClient = new react_query_1.QueryClient({
|
|
6
|
+
defaultOptions: {
|
|
7
|
+
queries: {
|
|
8
|
+
retry: 3,
|
|
9
|
+
retryDelay: 2000,
|
|
10
|
+
staleTime: 0,
|
|
11
|
+
gcTime: 0,
|
|
12
|
+
},
|
|
13
|
+
mutations: {
|
|
14
|
+
retry: 0,
|
|
15
|
+
retryDelay: 2000,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -37,6 +37,7 @@ export interface TekWalletContextType {
|
|
|
37
37
|
themeMode?: ThemeModes;
|
|
38
38
|
overrideQRScanMethod?: () => Promise<string>;
|
|
39
39
|
NotFoundPage?: ReactNode;
|
|
40
|
+
accessToken?: string;
|
|
40
41
|
}
|
|
41
42
|
export declare const TekWalletContext: import("react").Context<TekWalletContextType>;
|
|
42
43
|
export declare function TekWalletProvider({ children, isSSO, accessToken, options, topOffset, onLogout, overrideQRScanMethod, theme, themeMode, NotFoundPage, }: TekWalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -20,6 +20,7 @@ var WalletDataProvider_1 = __importDefault(require("../WalletDataProvider"));
|
|
|
20
20
|
var type_1 = require("../../theme/mui/type");
|
|
21
21
|
var xhub_keyboard_1 = require("xhub-keyboard");
|
|
22
22
|
var mui_1 = __importDefault(require("../../theme/mui"));
|
|
23
|
+
var TanstackReactQuery_1 = __importDefault(require("../TanstackReactQuery"));
|
|
23
24
|
var Views;
|
|
24
25
|
(function (Views) {
|
|
25
26
|
Views["ACTIVITY"] = "activity";
|
|
@@ -47,7 +48,8 @@ function TekWalletProvider(_a) {
|
|
|
47
48
|
theme: theme,
|
|
48
49
|
themeMode: themeMode,
|
|
49
50
|
NotFoundPage: NotFoundPage,
|
|
50
|
-
|
|
51
|
+
accessToken: accessToken,
|
|
52
|
+
}, children: (0, jsx_runtime_1.jsx)(TanstackReactQuery_1.default, { children: (0, jsx_runtime_1.jsx)(WalletProvider, { accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : "", onDisconnect: onDisconnect, children: (0, jsx_runtime_1.jsx)(mui_1.default, { 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) }) }));
|
|
51
53
|
}
|
|
52
54
|
exports.default = TekWalletProvider;
|
|
53
55
|
var useWalletSetup = function () {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const authClientRequest: import("axios").AxiosInstance;
|
|
2
2
|
export declare const setAuthToken: (token: string) => void;
|
|
3
|
-
export default
|
|
3
|
+
export default authClientRequest;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.setAuthToken = void 0;
|
|
7
7
|
var axios_1 = __importDefault(require("axios"));
|
|
8
8
|
var currentAccessToken = "";
|
|
9
|
-
var
|
|
9
|
+
var authClientRequest = axios_1.default.create({
|
|
10
10
|
baseURL: "".concat(process.env.NEXT_PUBLIC_TEK_WALLET_SERVER_URL),
|
|
11
11
|
timeout: 600000,
|
|
12
12
|
headers: {
|
|
@@ -17,7 +17,7 @@ var setAuthToken = function (token) {
|
|
|
17
17
|
currentAccessToken = token;
|
|
18
18
|
};
|
|
19
19
|
exports.setAuthToken = setAuthToken;
|
|
20
|
-
|
|
20
|
+
authClientRequest.interceptors.request.use(function (config) {
|
|
21
21
|
if (currentAccessToken) {
|
|
22
22
|
config.headers.Authorization = "Bearer ".concat(currentAccessToken);
|
|
23
23
|
}
|
|
@@ -25,4 +25,4 @@ userClientRequest.interceptors.request.use(function (config) {
|
|
|
25
25
|
}, function (error) {
|
|
26
26
|
return Promise.reject(error);
|
|
27
27
|
});
|
|
28
|
-
exports.default =
|
|
28
|
+
exports.default = authClientRequest;
|
|
@@ -11,6 +11,11 @@ export interface Paginated {
|
|
|
11
11
|
has_prev: boolean;
|
|
12
12
|
has_next: boolean;
|
|
13
13
|
}
|
|
14
|
+
export interface Cursor {
|
|
15
|
+
cursor: string;
|
|
16
|
+
has_next: boolean;
|
|
17
|
+
total: number;
|
|
18
|
+
}
|
|
14
19
|
export interface NetworkData {
|
|
15
20
|
id: number;
|
|
16
21
|
status: string;
|
|
@@ -35,3 +40,9 @@ export interface Currency {
|
|
|
35
40
|
icon_svg: string;
|
|
36
41
|
decimal?: number;
|
|
37
42
|
}
|
|
43
|
+
export interface ServerResponse<T> {
|
|
44
|
+
success: boolean;
|
|
45
|
+
message: string;
|
|
46
|
+
data: T;
|
|
47
|
+
timestamp: string;
|
|
48
|
+
}
|
|
@@ -10,6 +10,7 @@ declare const OverrideComponents: (theme: Theme) => {
|
|
|
10
10
|
root: {
|
|
11
11
|
textTransform: string;
|
|
12
12
|
minWidth: string;
|
|
13
|
+
lineHeight: string;
|
|
13
14
|
};
|
|
14
15
|
};
|
|
15
16
|
variants: ({
|
|
@@ -52,21 +53,6 @@ declare const OverrideComponents: (theme: Theme) => {
|
|
|
52
53
|
lineHeight?: undefined;
|
|
53
54
|
backgroundImage?: undefined;
|
|
54
55
|
};
|
|
55
|
-
} | {
|
|
56
|
-
props: {
|
|
57
|
-
size: string;
|
|
58
|
-
variant?: undefined;
|
|
59
|
-
color?: undefined;
|
|
60
|
-
};
|
|
61
|
-
style: {
|
|
62
|
-
padding: string;
|
|
63
|
-
fontWeight: number;
|
|
64
|
-
boxShadow?: undefined;
|
|
65
|
-
borderRadius?: undefined;
|
|
66
|
-
fontSize?: undefined;
|
|
67
|
-
lineHeight?: undefined;
|
|
68
|
-
backgroundImage?: undefined;
|
|
69
|
-
};
|
|
70
56
|
} | {
|
|
71
57
|
props: {
|
|
72
58
|
size: string;
|
|
@@ -19,6 +19,7 @@ declare const Button: (theme: Theme) => {
|
|
|
19
19
|
root: {
|
|
20
20
|
textTransform: string;
|
|
21
21
|
minWidth: string;
|
|
22
|
+
lineHeight: string;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
25
|
variants: ({
|
|
@@ -61,21 +62,6 @@ declare const Button: (theme: Theme) => {
|
|
|
61
62
|
lineHeight?: undefined;
|
|
62
63
|
backgroundImage?: undefined;
|
|
63
64
|
};
|
|
64
|
-
} | {
|
|
65
|
-
props: {
|
|
66
|
-
size: string;
|
|
67
|
-
variant?: undefined;
|
|
68
|
-
color?: undefined;
|
|
69
|
-
};
|
|
70
|
-
style: {
|
|
71
|
-
padding: string;
|
|
72
|
-
fontWeight: number;
|
|
73
|
-
boxShadow?: undefined;
|
|
74
|
-
borderRadius?: undefined;
|
|
75
|
-
fontSize?: undefined;
|
|
76
|
-
lineHeight?: undefined;
|
|
77
|
-
backgroundImage?: undefined;
|
|
78
|
-
};
|
|
79
65
|
} | {
|
|
80
66
|
props: {
|
|
81
67
|
size: string;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// const getColorCode = (colorKeys: string[], colors: Theme["palette"]): string => {
|
|
4
|
-
// const firstKey = colorKeys[0];
|
|
5
|
-
// const colorValue = colors?.[firstKey as keyof Theme["palette"]];
|
|
6
|
-
// return typeof colorValue == "object"
|
|
7
|
-
// ? getColorCode(colorKeys?.slice(1), colorValue as unknown as Theme["palette"])
|
|
8
|
-
// : (colorValue as string);
|
|
9
|
-
// };
|
|
10
3
|
var Button = function (theme) {
|
|
11
4
|
return {
|
|
12
5
|
MuiButton: {
|
|
@@ -19,6 +12,7 @@ var Button = function (theme) {
|
|
|
19
12
|
root: {
|
|
20
13
|
textTransform: "none",
|
|
21
14
|
minWidth: "auto",
|
|
15
|
+
lineHeight: "100%",
|
|
22
16
|
},
|
|
23
17
|
},
|
|
24
18
|
variants: [
|
|
@@ -44,8 +38,9 @@ var Button = function (theme) {
|
|
|
44
38
|
{
|
|
45
39
|
props: { size: "small" },
|
|
46
40
|
style: {
|
|
47
|
-
padding: "".concat(theme.spacing(1,
|
|
41
|
+
padding: "".concat(theme.spacing(1.5, 3)),
|
|
48
42
|
fontWeight: 400,
|
|
43
|
+
borderRadius: theme.spacing(2),
|
|
49
44
|
},
|
|
50
45
|
},
|
|
51
46
|
{
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { PaletteColorOptions, PaletteOptions } from "@mui/material";
|
|
1
|
+
import { PaletteColor, PaletteColorOptions, PaletteOptions } from "@mui/material/styles";
|
|
2
2
|
import { ThemeModes } from "./type";
|
|
3
|
-
export declare const customPalette: {
|
|
3
|
+
export declare const customPalette: {
|
|
4
|
+
tertiary: {
|
|
5
|
+
main: string;
|
|
6
|
+
contrastText: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
4
9
|
export declare const palette: PaletteOptions;
|
|
5
10
|
export declare const darkPalette: PaletteOptions;
|
|
6
11
|
export declare const palettes: Record<ThemeModes, PaletteOptions>;
|
|
7
12
|
export type CustomPaletteName = keyof typeof customPalette;
|
|
8
|
-
export type
|
|
13
|
+
export type CustomPaletteOptions = Record<CustomPaletteName, PaletteColorOptions>;
|
|
14
|
+
export type CustomPalette = Record<CustomPaletteName, PaletteColor>;
|
|
9
15
|
declare module "@mui/material/styles" {
|
|
10
|
-
interface PaletteOptions extends
|
|
16
|
+
interface PaletteOptions extends CustomPaletteOptions {
|
|
11
17
|
}
|
|
12
18
|
interface Palette extends CustomPalette {
|
|
13
19
|
}
|
|
@@ -15,7 +15,12 @@ var _a;
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.palettes = exports.darkPalette = exports.palette = exports.customPalette = void 0;
|
|
17
17
|
var type_1 = require("./type");
|
|
18
|
-
exports.customPalette = {
|
|
18
|
+
exports.customPalette = {
|
|
19
|
+
tertiary: {
|
|
20
|
+
main: "#FA6E43",
|
|
21
|
+
contrastText: "#FFFFFF",
|
|
22
|
+
},
|
|
23
|
+
};
|
|
19
24
|
exports.palette = __assign(__assign({}, exports.customPalette), { primary: {
|
|
20
25
|
main: "#1C461D",
|
|
21
26
|
contrastText: "#bbf49c",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getContrastingColor: (color: string) => "#
|
|
1
|
+
export declare const getContrastingColor: (color: string) => "#FFFFFF" | "#000000";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tek-wallet",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.822",
|
|
4
4
|
"description": "A custom React provider with TypeScript support",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -62,7 +62,10 @@
|
|
|
62
62
|
"usehooks-ts": "^3.1.1",
|
|
63
63
|
"uuid": "^11.1.0",
|
|
64
64
|
"xhub-keyboard": "^0.0.23",
|
|
65
|
-
"zustand": "^5.0.8"
|
|
65
|
+
"zustand": "^5.0.8",
|
|
66
|
+
"@tanstack/query-sync-storage-persister": "^5.90.14",
|
|
67
|
+
"@tanstack/react-query": "^5.90.2",
|
|
68
|
+
"@tanstack/react-query-persist-client": "^5.90.14"
|
|
66
69
|
},
|
|
67
70
|
"peerDependencies": {
|
|
68
71
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|