tek-wallet 0.0.1

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.
Files changed (125) hide show
  1. package/dist/app/api/auth/[...nextauth]/functions/refreshTokenKeycloak.d.ts +6 -0
  2. package/dist/app/api/auth/[...nextauth]/functions/refreshTokenKeycloak.js +84 -0
  3. package/dist/app/api/auth/[...nextauth]/route.d.ts +2 -0
  4. package/dist/app/api/auth/[...nextauth]/route.js +148 -0
  5. package/dist/app/api/auth/[...nextauth]/type.d.ts +4 -0
  6. package/dist/app/api/auth/[...nextauth]/type.js +8 -0
  7. package/dist/components/layouts/ChildPageLayout/index.d.ts +15 -0
  8. package/dist/components/layouts/ChildPageLayout/index.js +37 -0
  9. package/dist/components/layouts/DefaultPageLayout/index.d.ts +5 -0
  10. package/dist/components/layouts/DefaultPageLayout/index.js +12 -0
  11. package/dist/components/layouts/MainLayout/index.d.ts +5 -0
  12. package/dist/components/layouts/MainLayout/index.js +13 -0
  13. package/dist/components/ui/BackArrow/index.d.ts +5 -0
  14. package/dist/components/ui/BackArrow/index.js +36 -0
  15. package/dist/components/ui/BackHeader/index.d.ts +8 -0
  16. package/dist/components/ui/BackHeader/index.js +24 -0
  17. package/dist/components/ui/Button/index.d.ts +15 -0
  18. package/dist/components/ui/Button/index.js +60 -0
  19. package/dist/components/ui/DrawerComponent/index.d.ts +19 -0
  20. package/dist/components/ui/DrawerComponent/index.js +48 -0
  21. package/dist/components/ui/Icon/index.d.ts +7 -0
  22. package/dist/components/ui/Icon/index.js +36 -0
  23. package/dist/components/ui/Image/index.d.ts +8 -0
  24. package/dist/components/ui/Image/index.js +13 -0
  25. package/dist/components/ui/OTP/index.d.ts +11 -0
  26. package/dist/components/ui/OTP/index.js +54 -0
  27. package/dist/components/ui/PageHeader/index.d.ts +7 -0
  28. package/dist/components/ui/PageHeader/index.js +14 -0
  29. package/dist/components/ui/RequireConnect/index.d.ts +6 -0
  30. package/dist/components/ui/RequireConnect/index.js +66 -0
  31. package/dist/components/ui/StatusDisplay/index.d.ts +14 -0
  32. package/dist/components/ui/StatusDisplay/index.js +30 -0
  33. package/dist/components/ui/SwiperControlled/index.d.ts +18 -0
  34. package/dist/components/ui/SwiperControlled/index.js +64 -0
  35. package/dist/components/ui/Text/index.d.ts +8 -0
  36. package/dist/components/ui/Text/index.js +37 -0
  37. package/dist/components/ui/TheBackground/index.d.ts +6 -0
  38. package/dist/components/ui/TheBackground/index.js +14 -0
  39. package/dist/components/views/AuthView/index.d.ts +5 -0
  40. package/dist/components/views/AuthView/index.js +65 -0
  41. package/dist/components/views/CreateWalletView/index.d.ts +10 -0
  42. package/dist/components/views/CreateWalletView/index.js +188 -0
  43. package/dist/components/views/ImportWalletView/index.d.ts +10 -0
  44. package/dist/components/views/ImportWalletView/index.js +102 -0
  45. package/dist/configs/app/index.d.ts +3 -0
  46. package/dist/configs/app/index.js +11 -0
  47. package/dist/configs/app/type.d.ts +5 -0
  48. package/dist/configs/app/type.js +7 -0
  49. package/dist/hooks/useCustomRouter.d.ts +3 -0
  50. package/dist/hooks/useCustomRouter.js +23 -0
  51. package/dist/hooks/useFormatter.d.ts +4 -0
  52. package/dist/hooks/useFormatter.js +28 -0
  53. package/dist/hooks/useTekWallet.d.ts +7 -0
  54. package/dist/hooks/useTekWallet.js +25 -0
  55. package/dist/hooks/useVibrateEffect.d.ts +5 -0
  56. package/dist/hooks/useVibrateEffect.js +12 -0
  57. package/dist/index.d.ts +5 -0
  58. package/dist/index.js +14 -0
  59. package/dist/providers/AuthProvider/index.d.ts +5 -0
  60. package/dist/providers/AuthProvider/index.js +45 -0
  61. package/dist/providers/AuthProvider/type.d.ts +4 -0
  62. package/dist/providers/AuthProvider/type.js +8 -0
  63. package/dist/providers/TekWalletProvider/index.d.ts +8 -0
  64. package/dist/providers/TekWalletProvider/index.js +15 -0
  65. package/dist/services/axios/clients/generalRequest.d.ts +2 -0
  66. package/dist/services/axios/clients/generalRequest.js +11 -0
  67. package/dist/services/axios/clients/userClientRequest.d.ts +3 -0
  68. package/dist/services/axios/clients/userClientRequest.js +25 -0
  69. package/dist/services/axios/create-wallet-service/createWalletService.d.ts +7 -0
  70. package/dist/services/axios/create-wallet-service/createWalletService.js +54 -0
  71. package/dist/services/axios/create-wallet-service/type.d.ts +43 -0
  72. package/dist/services/axios/create-wallet-service/type.js +2 -0
  73. package/dist/services/axios/get-balance-service/getBalanceService.d.ts +3 -0
  74. package/dist/services/axios/get-balance-service/getBalanceService.js +61 -0
  75. package/dist/services/axios/get-balance-service/type.d.ts +37 -0
  76. package/dist/services/axios/get-balance-service/type.js +2 -0
  77. package/dist/services/axios/import-wallet-service/importWalletService.d.ts +7 -0
  78. package/dist/services/axios/import-wallet-service/importWalletService.js +54 -0
  79. package/dist/services/axios/import-wallet-service/type.d.ts +28 -0
  80. package/dist/services/axios/import-wallet-service/type.js +2 -0
  81. package/dist/store/Provider.d.ts +4 -0
  82. package/dist/store/Provider.js +11 -0
  83. package/dist/store/auth/authSlice.d.ts +4 -0
  84. package/dist/store/auth/authSlice.js +26 -0
  85. package/dist/store/auth/authThunk.d.ts +10 -0
  86. package/dist/store/auth/authThunk.js +62 -0
  87. package/dist/store/auth/type.d.ts +4 -0
  88. package/dist/store/auth/type.js +2 -0
  89. package/dist/store/hooks.d.ts +7 -0
  90. package/dist/store/hooks.js +7 -0
  91. package/dist/store/store.d.ts +11 -0
  92. package/dist/store/store.js +16 -0
  93. package/dist/store/tokens/tokenThunk.d.ts +10 -0
  94. package/dist/store/tokens/tokenThunk.js +55 -0
  95. package/dist/store/tokens/tokensSlice.d.ts +4 -0
  96. package/dist/store/tokens/tokensSlice.js +26 -0
  97. package/dist/store/tokens/type.d.ts +8 -0
  98. package/dist/store/tokens/type.js +2 -0
  99. package/dist/theme/mui/index.d.ts +4 -0
  100. package/dist/theme/mui/index.js +14 -0
  101. package/dist/theme/mui/theme.d.ts +2 -0
  102. package/dist/theme/mui/theme.js +14 -0
  103. package/dist/types/ui.d.ts +6 -0
  104. package/dist/types/ui.js +2 -0
  105. package/dist/utils/cn.d.ts +2 -0
  106. package/dist/utils/cn.js +15 -0
  107. package/dist/utils/formatDate.d.ts +18 -0
  108. package/dist/utils/formatDate.js +121 -0
  109. package/dist/utils/formatter.d.ts +4 -0
  110. package/dist/utils/formatter.js +66 -0
  111. package/dist/utils/getIcon.d.ts +1 -0
  112. package/dist/utils/getIcon.js +6 -0
  113. package/dist/utils/getImage.d.ts +1 -0
  114. package/dist/utils/getImage.js +7 -0
  115. package/dist/utils/getMaxTime.d.ts +5 -0
  116. package/dist/utils/getMaxTime.js +16 -0
  117. package/dist/utils/getStandardNumber.d.ts +1 -0
  118. package/dist/utils/getStandardNumber.js +20 -0
  119. package/dist/utils/lengthFromDotToFirstNonZero.d.ts +1 -0
  120. package/dist/utils/lengthFromDotToFirstNonZero.js +18 -0
  121. package/dist/utils/reduceZeroNoNecessary.d.ts +1 -0
  122. package/dist/utils/reduceZeroNoNecessary.js +18 -0
  123. package/dist/utils/roundToTwoSignificantDecimals.d.ts +1 -0
  124. package/dist/utils/roundToTwoSignificantDecimals.js +26 -0
  125. package/package.json +62 -0
@@ -0,0 +1,54 @@
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
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ var generalRequest_1 = __importDefault(require("../clients/generalRequest"));
43
+ var createWalletService = function (body) { return __awaiter(void 0, void 0, void 0, function () {
44
+ var response;
45
+ return __generator(this, function (_a) {
46
+ switch (_a.label) {
47
+ case 0: return [4 /*yield*/, generalRequest_1.default.post("/wallets/create/master", body)];
48
+ case 1:
49
+ response = _a.sent();
50
+ return [2 /*return*/, response === null || response === void 0 ? void 0 : response.data];
51
+ }
52
+ });
53
+ }); };
54
+ exports.default = createWalletService;
@@ -0,0 +1,43 @@
1
+ export interface CreateWalletServiceResponse {
2
+ success: boolean;
3
+ message: string;
4
+ data: Data;
5
+ timestamp: string;
6
+ }
7
+ interface Data {
8
+ id: string;
9
+ user_updated: string;
10
+ date_created: string;
11
+ date_updated: null;
12
+ user_created: string;
13
+ address: string;
14
+ app_slug: string[];
15
+ balances: Balance[];
16
+ blockchain_wallets: Blockchainwallet[];
17
+ seed_pharse: string;
18
+ user: User;
19
+ }
20
+ interface User {
21
+ action_token_url: string;
22
+ user_id: string;
23
+ access_token: string;
24
+ refresh_token: string;
25
+ }
26
+ interface Blockchainwallet {
27
+ master_address: string;
28
+ blockchain_address: string;
29
+ network_slug: string;
30
+ }
31
+ interface Balance {
32
+ id: string;
33
+ master_wallet_id: string;
34
+ currency_slug: string;
35
+ current_value: string;
36
+ total_value: string;
37
+ user_created: string;
38
+ user_updated: string;
39
+ date_created: string;
40
+ date_updated: null;
41
+ currency_name: string;
42
+ }
43
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { GetBalanceServiceResponse } from "./type";
2
+ declare const getBalanceService: () => Promise<GetBalanceServiceResponse>;
3
+ export default getBalanceService;
@@ -0,0 +1,61 @@
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
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ var userClientRequest_1 = __importDefault(require("../clients/userClientRequest"));
43
+ var getBalanceService = function () { return __awaiter(void 0, void 0, void 0, function () {
44
+ var response;
45
+ var _a;
46
+ return __generator(this, function (_b) {
47
+ switch (_b.label) {
48
+ case 0: return [4 /*yield*/, userClientRequest_1.default.get("/wallets/detail", {
49
+ headers: {
50
+ "app-slug": process.env.NEXT_PUBLIC_G_WALLET_APP_SLUG || "",
51
+ "content-type": "application/json",
52
+ accept: "application/json",
53
+ },
54
+ })];
55
+ case 1:
56
+ response = _b.sent();
57
+ return [2 /*return*/, (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.data];
58
+ }
59
+ });
60
+ }); };
61
+ exports.default = getBalanceService;
@@ -0,0 +1,37 @@
1
+ export interface GetBalanceServiceResponse {
2
+ id: string;
3
+ user_updated: string;
4
+ date_created: string;
5
+ date_updated: null;
6
+ user_created: string;
7
+ address: string;
8
+ app_slug: string[];
9
+ balances: Balance[];
10
+ blockchain_wallets: Blockchainwallet[];
11
+ }
12
+ interface Blockchainwallet {
13
+ master_address: string;
14
+ blockchain_address: string;
15
+ network_slug: string;
16
+ }
17
+ export interface Balance {
18
+ id: string;
19
+ master_wallet_id: string;
20
+ currency_slug: string;
21
+ current_value: string;
22
+ total_value: string;
23
+ user_created: string;
24
+ user_updated: string;
25
+ date_created: string;
26
+ date_updated: null;
27
+ currency: Currency;
28
+ }
29
+ interface Currency {
30
+ id: number;
31
+ name: string;
32
+ slug: string;
33
+ full_name: string;
34
+ icon: string;
35
+ link: string;
36
+ }
37
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { ImportWalletServiceResponse } from "./type";
2
+ export interface importWalletServiceBody {
3
+ seed_pharse: string;
4
+ app_slugs: string[];
5
+ }
6
+ declare const importWalletService: (body: importWalletServiceBody) => Promise<ImportWalletServiceResponse>;
7
+ export default importWalletService;
@@ -0,0 +1,54 @@
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
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ var generalRequest_1 = __importDefault(require("../clients/generalRequest"));
43
+ var importWalletService = function (body) { return __awaiter(void 0, void 0, void 0, function () {
44
+ var response;
45
+ return __generator(this, function (_a) {
46
+ switch (_a.label) {
47
+ case 0: return [4 /*yield*/, generalRequest_1.default.post("/wallets/import-into-apps", body)];
48
+ case 1:
49
+ response = _a.sent();
50
+ return [2 /*return*/, response === null || response === void 0 ? void 0 : response.data];
51
+ }
52
+ });
53
+ }); };
54
+ exports.default = importWalletService;
@@ -0,0 +1,28 @@
1
+ export interface ImportWalletServiceResponse {
2
+ success: boolean;
3
+ message: string;
4
+ data: Data;
5
+ timestamp: string;
6
+ }
7
+ interface Data {
8
+ id: string;
9
+ user_updated: string;
10
+ date_created: string;
11
+ date_updated: null;
12
+ user_created: string;
13
+ address: string;
14
+ app_slug: string[];
15
+ balances: null[][];
16
+ assets: number;
17
+ blockchain_wallets: null[][];
18
+ tokens: Tokens;
19
+ }
20
+ interface Tokens {
21
+ access_token: string;
22
+ expires_in: number;
23
+ refresh_expires_in: number;
24
+ refresh_token: string;
25
+ token_type: string;
26
+ session_state: string;
27
+ }
28
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ declare function ReduxToolkitProvider({ children }: {
2
+ children: React.ReactNode;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export default ReduxToolkitProvider;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ var jsx_runtime_1 = require("react/jsx-runtime");
5
+ var react_redux_1 = require("react-redux");
6
+ var store_1 = require("./store");
7
+ function ReduxToolkitProvider(_a) {
8
+ var children = _a.children;
9
+ return (0, jsx_runtime_1.jsx)(react_redux_1.Provider, { store: store_1.store, children: children });
10
+ }
11
+ exports.default = ReduxToolkitProvider;
@@ -0,0 +1,4 @@
1
+ import { AuthState } from "./type";
2
+ export declare const setAccessToken: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "auth/setAccessToken">, setIsAuthenticated: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "auth/setIsAuthenticated">;
3
+ declare const _default: import("redux").Reducer<AuthState>;
4
+ export default _default;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.setIsAuthenticated = exports.setAccessToken = void 0;
5
+ var toolkit_1 = require("@reduxjs/toolkit");
6
+ var userClientRequest_1 = require("../../services/axios/clients/userClientRequest");
7
+ var initialState = {
8
+ accessToken: undefined,
9
+ isAuthenticated: false,
10
+ };
11
+ var authSlice = (0, toolkit_1.createSlice)({
12
+ name: "auth",
13
+ initialState: initialState,
14
+ reducers: {
15
+ setAccessToken: function (state, action) {
16
+ var token = action.payload || "";
17
+ state.accessToken = token;
18
+ (0, userClientRequest_1.setAuthToken)(token);
19
+ },
20
+ setIsAuthenticated: function (state, action) {
21
+ state.isAuthenticated = action.payload;
22
+ },
23
+ },
24
+ });
25
+ exports.setAccessToken = (_a = authSlice.actions, _a.setAccessToken), exports.setIsAuthenticated = _a.setIsAuthenticated;
26
+ exports.default = authSlice.reducer;
@@ -0,0 +1,10 @@
1
+ export declare const createWallet: import("@reduxjs/toolkit").AsyncThunk<import("../../services/axios/create-wallet-service/type").CreateWalletServiceResponse, any, {
2
+ state?: unknown;
3
+ dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction>;
4
+ extra?: unknown;
5
+ rejectValue?: unknown;
6
+ serializedErrorType?: unknown;
7
+ pendingMeta?: unknown;
8
+ fulfilledMeta?: unknown;
9
+ rejectedMeta?: unknown;
10
+ }>;
@@ -0,0 +1,62 @@
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
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.createWallet = void 0;
43
+ var toolkit_1 = require("@reduxjs/toolkit");
44
+ var createWalletService_1 = __importDefault(require("../../services/axios/create-wallet-service/createWalletService"));
45
+ exports.createWallet = (0, toolkit_1.createAsyncThunk)("auth/createWallet", function (payload_1, _a) { return __awaiter(void 0, [payload_1, _a], void 0, function (payload, _b) {
46
+ var response, error_1;
47
+ var rejectWithValue = _b.rejectWithValue;
48
+ return __generator(this, function (_c) {
49
+ switch (_c.label) {
50
+ case 0:
51
+ _c.trys.push([0, 2, , 3]);
52
+ return [4 /*yield*/, (0, createWalletService_1.default)(payload)];
53
+ case 1:
54
+ response = _c.sent();
55
+ return [2 /*return*/, response];
56
+ case 2:
57
+ error_1 = _c.sent();
58
+ return [2 /*return*/, rejectWithValue(error_1)];
59
+ case 3: return [2 /*return*/];
60
+ }
61
+ });
62
+ }); });
@@ -0,0 +1,4 @@
1
+ export interface AuthState {
2
+ accessToken?: string;
3
+ isAuthenticated?: boolean;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { TypedUseSelectorHook } from "react-redux";
2
+ import type { RootState } from "./store";
3
+ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
4
+ auth: import("./auth/type").AuthState;
5
+ tokens: import("./tokens/type").TokenState;
6
+ }, undefined, import("redux").UnknownAction> & import("redux").Dispatch<import("redux").UnknownAction>;
7
+ export declare const useAppSelector: TypedUseSelectorHook<RootState>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useAppSelector = exports.useAppDispatch = void 0;
4
+ var react_redux_1 = require("react-redux");
5
+ var useAppDispatch = function () { return (0, react_redux_1.useDispatch)(); };
6
+ exports.useAppDispatch = useAppDispatch;
7
+ exports.useAppSelector = react_redux_1.useSelector;
@@ -0,0 +1,11 @@
1
+ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
2
+ auth: import("./auth/type").AuthState;
3
+ tokens: import("./tokens/type").TokenState;
4
+ }, import("redux").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
5
+ dispatch: import("redux-thunk").ThunkDispatch<{
6
+ auth: import("./auth/type").AuthState;
7
+ tokens: import("./tokens/type").TokenState;
8
+ }, undefined, import("redux").UnknownAction>;
9
+ }>, import("redux").StoreEnhancer]>>;
10
+ export type RootState = ReturnType<typeof store.getState>;
11
+ export type AppDispatch = typeof store.dispatch;
@@ -0,0 +1,16 @@
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
+ exports.store = void 0;
7
+ var toolkit_1 = require("@reduxjs/toolkit");
8
+ var authSlice_1 = __importDefault(require("./auth/authSlice"));
9
+ var tokensSlice_1 = __importDefault(require("./tokens/tokensSlice"));
10
+ exports.store = (0, toolkit_1.configureStore)({
11
+ reducer: {
12
+ auth: authSlice_1.default,
13
+ tokens: tokensSlice_1.default,
14
+ },
15
+ devTools: process.env.NODE_ENV !== "production",
16
+ });
@@ -0,0 +1,10 @@
1
+ export declare const getBalanceThunk: import("@reduxjs/toolkit").AsyncThunk<import("../../services/axios/get-balance-service/type").GetBalanceServiceResponse, void, {
2
+ state?: unknown;
3
+ dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction>;
4
+ extra?: unknown;
5
+ rejectValue?: unknown;
6
+ serializedErrorType?: unknown;
7
+ pendingMeta?: unknown;
8
+ fulfilledMeta?: unknown;
9
+ rejectedMeta?: unknown;
10
+ }>;
@@ -0,0 +1,55 @@
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
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.getBalanceThunk = void 0;
43
+ var toolkit_1 = require("@reduxjs/toolkit");
44
+ var getBalanceService_1 = __importDefault(require("../../services/axios/get-balance-service/getBalanceService"));
45
+ exports.getBalanceThunk = (0, toolkit_1.createAsyncThunk)("user/getBalance", function () { return __awaiter(void 0, void 0, void 0, function () {
46
+ var response;
47
+ return __generator(this, function (_a) {
48
+ switch (_a.label) {
49
+ case 0: return [4 /*yield*/, (0, getBalanceService_1.default)()];
50
+ case 1:
51
+ response = _a.sent();
52
+ return [2 /*return*/, response];
53
+ }
54
+ });
55
+ }); });
@@ -0,0 +1,4 @@
1
+ import { TokenState } from "./type";
2
+ export declare const setTokens: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "tokens/setTokens">;
3
+ declare const tokensReducer: import("redux").Reducer<TokenState>;
4
+ export default tokensReducer;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setTokens = void 0;
4
+ var toolkit_1 = require("@reduxjs/toolkit");
5
+ var tokenThunk_1 = require("./tokenThunk");
6
+ var initialState = {
7
+ tokens: undefined,
8
+ };
9
+ var tokensSlice = (0, toolkit_1.createSlice)({
10
+ name: "tokens",
11
+ initialState: initialState,
12
+ reducers: {
13
+ setTokens: function (state, action) {
14
+ state.tokens = action.payload;
15
+ },
16
+ },
17
+ extraReducers: function (builder) {
18
+ builder.addCase(tokenThunk_1.getBalanceThunk.fulfilled, function (state, action) {
19
+ var _a;
20
+ state.tokens = (_a = action.payload) === null || _a === void 0 ? void 0 : _a.balances;
21
+ });
22
+ },
23
+ });
24
+ exports.setTokens = tokensSlice.actions.setTokens;
25
+ var tokensReducer = tokensSlice.reducer;
26
+ exports.default = tokensReducer;
@@ -0,0 +1,8 @@
1
+ import { Balance } from "../../services/axios/get-balance-service/type";
2
+ export interface NetworkData {
3
+ name: string;
4
+ icon: string;
5
+ }
6
+ export interface TokenState {
7
+ tokens?: Balance[];
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ declare function MuiThemeProvider({ children }: {
2
+ children: React.ReactNode;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export default MuiThemeProvider;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ "use client";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ var jsx_runtime_1 = require("react/jsx-runtime");
8
+ var styles_1 = require("@mui/material/styles");
9
+ var theme_1 = __importDefault(require("./theme"));
10
+ function MuiThemeProvider(_a) {
11
+ var children = _a.children;
12
+ return (0, jsx_runtime_1.jsx)(styles_1.ThemeProvider, { theme: theme_1.default, children: children });
13
+ }
14
+ exports.default = MuiThemeProvider;
@@ -0,0 +1,2 @@
1
+ declare const theme: import("@mui/material/styles").Theme;
2
+ export default theme;