@n1xyz/wallet-widget 0.0.1 → 0.0.4

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 (100) hide show
  1. package/LICENSE +44 -0
  2. package/README.md +45 -0
  3. package/dist/Logic/utils.d.ts +1 -0
  4. package/dist/Logic/utils.js +47 -9
  5. package/dist/Modal/BackButton.js +14 -1
  6. package/dist/Modal/ConnectView.js +20 -23
  7. package/dist/Modal/CreateSessionView.js +23 -11
  8. package/dist/Modal/CreateUserView.js +1 -1
  9. package/dist/Modal/ModalHeader.js +14 -3
  10. package/dist/Modal/N1WalletModal.js +35 -30
  11. package/dist/Modal/NoWhitelistView.js +14 -1
  12. package/dist/Modal/Sidebar/N1Sidebar.js +152 -13
  13. package/dist/Modal/SigningView.js +1 -1
  14. package/dist/Provider/LazyWalletProvider.js +6 -2
  15. package/dist/Provider/N1WalletProvider.js +10 -7
  16. package/dist/Provider/types.d.ts +8 -0
  17. package/dist/components/Logo.d.ts +7 -0
  18. package/dist/components/Logo.js +118 -0
  19. package/dist/components/QRCodeLoader.d.ts +4 -0
  20. package/dist/components/QRCodeLoader.js +8 -0
  21. package/dist/components/WalletDeposit/AnimatedButton.d.ts +17 -0
  22. package/dist/components/WalletDeposit/AnimatedButton.js +29 -0
  23. package/dist/components/WalletDeposit/components/ChainButton.d.ts +7 -0
  24. package/dist/components/WalletDeposit/components/ChainButton.js +5 -0
  25. package/dist/components/WalletDeposit/components/LoadingSquares.d.ts +1 -0
  26. package/dist/components/WalletDeposit/components/LoadingSquares.js +5 -0
  27. package/dist/components/WalletDeposit/components/TransactionTable.d.ts +6 -0
  28. package/dist/components/WalletDeposit/components/TransactionTable.js +8 -0
  29. package/dist/components/WalletDeposit/components/WaitingMessage.d.ts +6 -0
  30. package/dist/components/WalletDeposit/components/WaitingMessage.js +6 -0
  31. package/dist/components/WalletDeposit/constants.d.ts +15 -0
  32. package/dist/components/WalletDeposit/constants.js +32 -0
  33. package/dist/components/WalletDeposit/hooks.d.ts +9 -0
  34. package/dist/components/WalletDeposit/hooks.js +185 -0
  35. package/dist/components/WalletDeposit/index.d.ts +1 -0
  36. package/dist/components/WalletDeposit/index.js +136 -0
  37. package/dist/components/WalletDeposit/screens/AmountInputScreen.d.ts +12 -0
  38. package/dist/components/WalletDeposit/screens/AmountInputScreen.js +18 -0
  39. package/dist/components/WalletDeposit/screens/AppsTableScreen.d.ts +8 -0
  40. package/dist/components/WalletDeposit/screens/AppsTableScreen.js +28 -0
  41. package/dist/components/WalletDeposit/screens/ChainSelectionScreen.d.ts +5 -0
  42. package/dist/components/WalletDeposit/screens/ChainSelectionScreen.js +8 -0
  43. package/dist/components/WalletDeposit/screens/InitialScreen.d.ts +9 -0
  44. package/dist/components/WalletDeposit/screens/InitialScreen.js +18 -0
  45. package/dist/components/WalletDeposit/screens/SigningScreen.d.ts +6 -0
  46. package/dist/components/WalletDeposit/screens/SigningScreen.js +6 -0
  47. package/dist/components/WalletDeposit/screens/SuccessScreen.d.ts +12 -0
  48. package/dist/components/WalletDeposit/screens/SuccessScreen.js +7 -0
  49. package/dist/components/WalletDeposit/types.d.ts +43 -0
  50. package/dist/index.d.ts +2 -0
  51. package/dist/index.js +2 -0
  52. package/dist/main.css +1 -1
  53. package/dist/utils/dynamicImports.d.ts +24 -0
  54. package/dist/utils/dynamicImports.js +41 -0
  55. package/dist/utils/shortenString.d.ts +2 -0
  56. package/dist/utils/shortenString.js +8 -0
  57. package/package.json +13 -9
  58. package/.eslintrc.js +0 -29
  59. package/dist/Common/NIcon.js +0 -7
  60. package/dist/components/AnimatedButton.d.ts +0 -9
  61. package/dist/components/AnimatedButton.js +0 -5
  62. package/postcss.config.js +0 -6
  63. package/src/Logic/getPseudoName.ts +0 -5832
  64. package/src/Logic/utils.ts +0 -162
  65. package/src/Logic/words.ts +0 -93571
  66. package/src/Modal/BackButton.tsx +0 -23
  67. package/src/Modal/ConnectView.tsx +0 -88
  68. package/src/Modal/CreateSessionView.tsx +0 -242
  69. package/src/Modal/CreateUserView.tsx +0 -195
  70. package/src/Modal/ModalHeader.tsx +0 -64
  71. package/src/Modal/N1WalletModal.tsx +0 -275
  72. package/src/Modal/NoWhitelistView.tsx +0 -61
  73. package/src/Modal/Sidebar/N1Sidebar.tsx +0 -172
  74. package/src/Modal/SigningView.tsx +0 -18
  75. package/src/Modal/SuccessView.tsx +0 -36
  76. package/src/Provider/LazyWalletProvider.tsx +0 -136
  77. package/src/Provider/N1WalletProvider.tsx +0 -208
  78. package/src/Provider/context.ts +0 -11
  79. package/src/Provider/hooks.ts +0 -22
  80. package/src/Provider/icons/CoinbaseWalletIcon.tsx +0 -27
  81. package/src/Provider/icons/ConnectionDotsSVG.tsx +0 -19
  82. package/src/Provider/icons/MetamaskIcon.tsx +0 -58
  83. package/src/Provider/icons/PhantomIcon.tsx +0 -26
  84. package/src/Provider/icons/UserIcon.tsx +0 -15
  85. package/src/Provider/icons/WalletConnectIcon.tsx +0 -15
  86. package/src/Provider/index.ts +0 -3
  87. package/src/Provider/types.ts +0 -77
  88. package/src/WidgetButton/N1ConnectButton.tsx +0 -72
  89. package/src/components/LazyLoadWrapper.tsx +0 -19
  90. package/src/config.ts +0 -2
  91. package/src/errors/types.ts +0 -49
  92. package/src/index.ts +0 -5
  93. package/src/main.css +0 -3
  94. package/src/styles/main.css +0 -3
  95. package/src/utils/lazyLoad.ts +0 -12
  96. package/src/utils/logger.ts +0 -98
  97. package/src/utils/react-shim.js +0 -8
  98. package/tailwind.config.js +0 -44
  99. package/tsconfig.json +0 -21
  100. /package/dist/{Common/NIcon.d.ts → components/WalletDeposit/types.js} +0 -0
@@ -1,21 +1,87 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ 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);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ 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;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
38
  import BlockiesSvg from 'blockies-react-svg';
39
+ import QRCodeLoader from '../../components/QRCodeLoader';
40
+ import { ArrowDown, ArrowUp, X, ArrowLeft } from 'lucide-react';
3
41
  import { useEffect, useState } from 'react';
4
42
  import { N1ModalViewMode } from '../../Provider/types';
43
+ import { shortenAddress } from '../../utils/shortenString';
5
44
  import { useN1WalletContext, useN1WalletInternalContext, } from '../../Provider/hooks';
45
+ import { importNTSSDK } from '../../utils/dynamicImports';
46
+ import { getUserBalances } from '../../Logic/utils';
47
+ import { logger } from '../../utils/logger';
6
48
  export function N1Sidebar(_) {
49
+ var _this = this;
50
+ // State management
7
51
  var _a = useState(false), closing = _a[0], setClosing = _a[1];
8
- var _b = useN1WalletContext(), username = _b.username, isConnected = _b.isConnected, address = _b.address;
9
- var _c = useN1WalletInternalContext(), setShowSidebar = _c.setShowSidebar, showSidebar = _c.showSidebar, setStartClosingLogin = _c.setStartClosingLogin, dynamicHandleLogOut = _c.dynamicHandleLogOut;
10
- var addressText = isConnected && address.substring(0, 9) + '...' + address.slice(-3);
11
- var _d = useN1WalletInternalContext(), setViewMode = _d.setViewMode, setIsConnected = _d.setIsConnected;
12
- function disconnect() {
52
+ var _b = useState(false), sending = _b[0], setSending = _b[1];
53
+ var _c = useState(false), receiving = _c[0], setReceiving = _c[1];
54
+ var _d = useState(''), success = _d[0], setSuccess = _d[1];
55
+ var _e = useState(false), activeSending = _e[0], setActiveSending = _e[1];
56
+ var _f = useState(''), tokenToSend = _f[0], setTokenToSend = _f[1];
57
+ var _g = useState(''), appIdAction = _g[0], setAppIdAction = _g[1];
58
+ var _h = useState(''), amount = _h[0], setAmount = _h[1];
59
+ var _j = useState(''), recipientAddress = _j[0], setRecipientAddress = _j[1];
60
+ var _k = useState(''), error = _k[0], setError = _k[1];
61
+ var _l = useState('balances'), currentView = _l[0], setCurrentView = _l[1];
62
+ // Context hooks
63
+ var _m = useN1WalletContext(), username = _m.username, isConnected = _m.isConnected, address = _m.address, balances = _m.balances, walletPubKey = _m.walletPubKey, sessionPubKey = _m.sessionPubKey, signMessageWithSessionKey = _m.signMessageWithSessionKey;
64
+ var _o = useN1WalletInternalContext(), setShowSidebar = _o.setShowSidebar, showSidebar = _o.showSidebar, setStartClosingLogin = _o.setStartClosingLogin, dynamicHandleLogOut = _o.dynamicHandleLogOut, setBalances = _o.setBalances, setViewMode = _o.setViewMode, setIsConnected = _o.setIsConnected;
65
+ // Utility functions
66
+ var clearSendingForm = function () {
67
+ setAmount('');
68
+ setTokenToSend('');
69
+ setRecipientAddress('');
70
+ setAppIdAction('');
71
+ setSuccess('');
72
+ setError('');
73
+ };
74
+ var handleClose = function () {
75
+ setClosing(true);
76
+ setStartClosingLogin(true);
77
+ };
78
+ var disconnect = function () {
13
79
  dynamicHandleLogOut();
14
80
  setViewMode(N1ModalViewMode.Connect);
15
81
  setIsConnected(false);
16
- setClosing(true);
17
- setStartClosingLogin(true);
18
- }
82
+ handleClose();
83
+ };
84
+ // Effects
19
85
  useEffect(function () {
20
86
  if (showSidebar) {
21
87
  setClosing(false);
@@ -31,8 +97,81 @@ export function N1Sidebar(_) {
31
97
  }
32
98
  return function () { return clearTimeout(timeout); };
33
99
  }, [closing, setShowSidebar]);
34
- return (_jsxs("div", { className: 'fixed inset-0 bg-neutral-400/45 dark:bg-neutral-700/45 h-screen w-screen duration-500 ease-in-out z-[9999] flex items-center justify-end py-3 backdrop-blur-sm ' +
35
- (!showSidebar && 'hidden pointer-events-none') +
36
- (closing ? ' opacity-0' : ' opacity-100'), children: [showSidebar && (_jsx("div", { className: 'w-screen h-screen fixed top-0 left-0', onClick: function () { return setClosing(true); } })), showSidebar && (_jsx("div", { className: 'relative h-full py-6 pl-6 pr-8 bg-white dark:bg-neutral-900 shadow-xl border-2 border-neutral-200 dark:border-neutral-700 rounded-l-2xl rounded-b-2xl rounded-t-2xl duration-500 ease-in-out overflow-hidden ' +
37
- (closing ? 'translate-x-full' : 'translate-x-0'), children: _jsxs("div", { className: 'flex flex-col', children: [_jsxs("div", { className: "flex w-full mb-4", children: [_jsx("div", { className: "w-16 h-16 bg-neutral-200 dark:bg-neutral-800 rounded-full flex items-center justify-center relative", children: _jsx("div", { className: "overflow-hidden rounded-full w-16 h-16", children: _jsx(BlockiesSvg, { address: address, className: "drop-shadow w-full h-full rounded-[20px]" }) }) }), _jsxs("div", { className: 'flex flex-col pl-3 py-2', children: [_jsx("div", { className: 'font-extrabold text-neutral-900 dark:text-stone-200', children: username }), _jsx("div", { className: 'font-extrabold text-neutral-400 dark:text-neutral-500', children: addressText })] })] }), _jsxs("div", { className: 'mt-4 rounded-2xl flex flex-col items-center justify-center h-24 w-full p-2 bg-red-50 dark:bg-red-900/20 hover:bg-red-100 dark:hover:bg-red-900/30 border-neutral-200 dark:border-neutral-700 border text-neutral-700 dark:text-neutral-300 cursor-pointer', onClick: disconnect, children: [_jsx("div", { className: 'bg-red-400 rounded-sm h-4 w-4 mb-2 rotate-45' }), _jsx("div", { className: 'font-bold', children: "Disconnect" }), _jsx("div", { className: 'text-xs', children: "Log out from the application" })] }), _jsxs("div", { className: 'justify-center w-full flex text-xs mt-8 mb-6 items-center', children: [_jsx("div", { className: 'h-0.5 bg-neutral-300 dark:bg-neutral-700 w-16 mx-2' }), _jsx("div", { className: 'text-neutral-600 dark:text-neutral-400 font-bold', children: "Other apps" }), _jsx("div", { className: 'h-0.5 bg-neutral-300 dark:bg-neutral-700 w-16 mx-2' })] }), _jsx("div", { className: 'flex flex-col gap-y-2', children: _jsx("div", { className: "cursor-pointer flex flex-col flex-shrink-0 mr-6 w-full h-48 bg-neutral-900 dark:bg-black rounded-xl overflow-hidden relative", children: _jsx("div", { className: 'absolute flex flex-row items-center justify-between bottom-0 w-full bg-gradient-to-t px-5 py-3 from-neutral-900 dark:from-black', children: _jsxs("div", { className: "flex flex-row gap-3 items-center", children: [_jsx("div", { className: "w-10 h-10 relative rounded-lg overflow-hidden" }), _jsxs("div", { className: "flex flex-col leading-none", children: [_jsx("div", { className: "text-white", children: "Nos" }), _jsx("div", { className: "text-neutral-200", children: "Perp Dex" })] })] }) }) }) })] }) }))] }));
100
+ useEffect(function () {
101
+ if (!isConnected && showSidebar) {
102
+ setShowSidebar(false);
103
+ }
104
+ }, [isConnected, showSidebar]);
105
+ // Send tokens handler
106
+ var handleSend = function (e) { return __awaiter(_this, void 0, void 0, function () {
107
+ var sdk, nts, idl, appClient, balances_1, error_1;
108
+ return __generator(this, function (_a) {
109
+ switch (_a.label) {
110
+ case 0:
111
+ e.preventDefault();
112
+ setError('');
113
+ if (!sessionPubKey || !signMessageWithSessionKey || !walletPubKey)
114
+ return [2 /*return*/];
115
+ if (!tokenToSend || !amount || !recipientAddress) {
116
+ setError('All fields are required.');
117
+ setTimeout(function () { return setError(''); }, 2000);
118
+ return [2 /*return*/];
119
+ }
120
+ if (isNaN(Number(amount)) || Number(amount) <= 0) {
121
+ setError('Amount must be a positive number.');
122
+ setTimeout(function () { return setError(''); }, 2000);
123
+ return [2 /*return*/];
124
+ }
125
+ setActiveSending(true);
126
+ _a.label = 1;
127
+ case 1:
128
+ _a.trys.push([1, 6, , 7]);
129
+ return [4 /*yield*/, importNTSSDK()];
130
+ case 2:
131
+ sdk = _a.sent();
132
+ nts = new sdk.NTSInterface(process.env.NTS_URL);
133
+ return [4 /*yield*/, nts.getAppIdl(appIdAction)];
134
+ case 3:
135
+ idl = _a.sent();
136
+ appClient = new sdk.NAppClient(process.env.NTS_URL, appIdAction, idl, walletPubKey, sessionPubKey, signMessageWithSessionKey);
137
+ return [4 /*yield*/, appClient['transfer'](amount, tokenToSend, recipientAddress)];
138
+ case 4:
139
+ _a.sent();
140
+ return [4 /*yield*/, getUserBalances(address)];
141
+ case 5:
142
+ balances_1 = _a.sent();
143
+ setBalances(balances_1);
144
+ setActiveSending(false);
145
+ setSuccess('Tokens sent successfully!');
146
+ setTimeout(function () {
147
+ setSending(false);
148
+ clearSendingForm();
149
+ }, 2000);
150
+ return [3 /*break*/, 7];
151
+ case 6:
152
+ error_1 = _a.sent();
153
+ logger.error('Error sending tokens:', error_1);
154
+ setError('Error sending tokens. Please try again.');
155
+ setActiveSending(false);
156
+ setTimeout(function () { return setError(''); }, 2000);
157
+ return [3 /*break*/, 7];
158
+ case 7: return [2 /*return*/];
159
+ }
160
+ });
161
+ }); };
162
+ return (_jsxs("div", { className: "fixed inset-0 bg-white/45 dark:bg-black/45 h-screen w-screen duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] z-[9999] flex items-stretch justify-end backdrop-blur-sm ".concat(!showSidebar ? 'hidden pointer-events-none' : '', " ").concat(closing ? 'opacity-0' : 'opacity-100'), children: [showSidebar && (_jsx("div", { className: "w-screen h-screen fixed top-0 left-0", onClick: function () { return setClosing(true); } })), showSidebar && (_jsxs("div", { className: "relative h-screen w-[420px] bg-gray-50 dark:bg-gray-950 shadow-xl border-l border-gray-200 dark:border-gray-800 duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] overflow-hidden ".concat(closing ? 'translate-x-full' : 'translate-x-0'), children: [_jsxs("div", { className: "flex justify-between items-center px-6 py-4 border-b border-gray-200 dark:border-gray-800", children: [_jsxs("div", { className: "flex items-center gap-4", children: [currentView !== 'balances' && (_jsx("button", { onClick: function () {
163
+ setCurrentView('balances');
164
+ clearSendingForm();
165
+ }, className: "text-gray-500 hover:text-red-500 dark:text-gray-400 dark:hover:text-red-500 transition-colors duration-200", children: _jsx(ArrowLeft, { size: 20 }) })), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(BlockiesSvg, { address: address, className: "w-10 h-10 rounded-full" }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "font-medium text-gray-900 dark:text-gray-50", children: username }), _jsx("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: shortenAddress(address) })] })] })] }), _jsx("button", { onClick: handleClose, className: "text-gray-400 hover:text-red-500 transition-colors duration-200 h-6 flex items-center", children: _jsx(X, { size: 20 }) })] }), _jsxs("div", { className: "p-6 overflow-y-auto h-[calc(100vh-144px)]", children: [currentView === 'balances' && (_jsxs("div", { className: "flex justify-center gap-4 mb-6", children: [_jsxs("button", { onClick: function () { return setCurrentView('receive'); }, className: "flex flex-col items-center gap-2 group", children: [_jsx("div", { className: "w-12 h-12 flex items-center justify-center rounded-full bg-white dark:bg-neutral-950 border-2 border-gray-100 dark:border-neutral-800 group-hover:border-main dark:group-hover:border-main transition-colors duration-200", children: _jsx(ArrowDown, { size: 20, className: "text-gray-500 dark:text-neutral-400 group-hover:text-main dark:group-hover:text-main transition-colors duration-200" }) }), _jsx("span", { className: "text-sm text-gray-500 dark:text-neutral-400 group-hover:text-main dark:group-hover:text-main transition-colors duration-200", children: "Receive" })] }), balances.length > 0 && (_jsxs("button", { onClick: function () { return setCurrentView('send'); }, className: "flex flex-col items-center gap-2 group", children: [_jsx("div", { className: "w-12 h-12 flex items-center justify-center rounded-full bg-white dark:bg-neutral-950 border-2 border-gray-100 dark:border-neutral-800 group-hover:border-main dark:group-hover:border-main transition-colors duration-200", children: _jsx(ArrowUp, { size: 20, className: "text-gray-500 dark:text-neutral-400 group-hover:text-main dark:group-hover:text-main transition-colors duration-200" }) }), _jsx("span", { className: "text-sm text-gray-500 dark:text-neutral-400 group-hover:text-main dark:group-hover:text-main transition-colors duration-200", children: "Send" })] }))] })), _jsxs("div", { className: "space-y-4", children: [currentView === 'balances' && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between mb-4", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900 dark:text-gray-50", children: "Tokens" }), _jsx("div", { className: "h-px flex-1 mx-4 bg-gray-200 dark:bg-gray-800" })] }), _jsx("div", { className: "space-y-3", children: balances
166
+ .sort(function (a, b) { return Number(b.balance) - Number(a.balance); })
167
+ .map(function (balance) { return (_jsx("div", { className: "p-4 bg-gray-50 dark:bg-gray-950 rounded-xl border-2 border-gray-100 dark:border-gray-800 hover:border-red-400 dark:hover:border-[#ff2b1f] transition-colors duration-200", children: _jsx("div", { className: "flex items-center justify-between", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(BlockiesSvg, { address: balance.mint, className: "w-10 h-10 rounded-lg" }), _jsxs("div", { children: [_jsx("div", { className: "font-medium text-gray-900 dark:text-gray-50", children: shortenAddress(balance.mint) }), _jsxs("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: ["Balance: ", balance.balance.toLocaleString()] })] })] }) }) }, balance.mint)); }) })] })), currentView === 'send' && (_jsxs("form", { onSubmit: handleSend, className: "space-y-4", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2", children: "Select Token" }), _jsxs("select", { onChange: function (e) {
168
+ var value = e.target.value.split('-');
169
+ setAppIdAction(value[0]);
170
+ setTokenToSend(value[1]);
171
+ setAmount('');
172
+ }, className: "w-full bg-white dark:bg-neutral-950 border-2 border-gray-100 dark:border-neutral-800 rounded-xl px-4 py-3 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-0 focus:border-red-400 dark:focus:border-[#ff2b1f] transition-colors duration-200", children: [_jsx("option", { value: "", children: "Select Token" }), balances.map(function (token) { return (_jsx("option", { value: token.appId + '-' + token.mint, children: shortenAddress(token.mint) }, token.mint)); })] })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2", children: "Amount" }), _jsx("input", { type: "number", placeholder: "0.00", value: amount, onChange: function (e) { return setAmount(e.target.value); }, className: "w-full bg-white dark:bg-neutral-950 border-2 border-gray-100 dark:border-neutral-800 rounded-xl px-4 py-3 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-0 focus:border-red-400 dark:focus:border-[#ff2b1f] transition-colors duration-200" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2", children: "Recipient Address" }), _jsx("input", { type: "text", placeholder: "Enter recipient address", value: recipientAddress, onChange: function (e) { return setRecipientAddress(e.target.value); }, className: "w-full bg-white dark:bg-neutral-950 border-2 border-gray-100 dark:border-neutral-800 rounded-xl px-4 py-3 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-0 focus:border-red-400 dark:focus:border-[#ff2b1f] transition-colors duration-200" })] }), error && (_jsx("div", { className: "text-red-500 text-sm text-center", children: error })), success && (_jsx("div", { className: "text-green-500 text-sm text-center", children: success })), _jsx("button", { type: "submit", disabled: activeSending, className: "w-full px-6 py-3 rounded-xl bg-main hover:bg-main/90 text-white font-medium disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200 flex items-center justify-center gap-2", children: activeSending ? (_jsxs(_Fragment, { children: [_jsx("span", { children: "Sending" }), _jsx("div", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" })] })) : ('Send Tokens') })] })), currentView === 'receive' && (_jsxs("div", { className: "flex flex-col items-center gap-6", children: [_jsx("div", { className: "w-64 h-64 p-4 bg-white dark:bg-neutral-950 border-2 border-gray-100 dark:border-neutral-800 rounded-xl", children: _jsx(QRCodeLoader, { address: address }) }), _jsxs("div", { className: "text-center", children: [_jsx("p", { className: "text-sm text-gray-500 dark:text-neutral-400 mb-2", children: "Your wallet address" }), _jsx("p", { className: "font-medium text-gray-900 dark:text-white break-all px-4", children: address })] }), _jsx("button", { onClick: function () {
173
+ navigator.clipboard.writeText(address);
174
+ setSuccess('Address copied!');
175
+ setTimeout(function () { return setSuccess(''); }, 2000);
176
+ }, className: "px-6 py-3 rounded-xl bg-white dark:bg-neutral-950 border-2 border-gray-100 dark:border-neutral-800 hover:border-main dark:hover:border-main text-gray-900 dark:text-white font-medium transition-colors duration-200", children: success === 'Address copied!' ? 'Copied!' : 'Copy Address' })] }))] })] }), _jsx("div", { className: "absolute bottom-0 left-0 right-0 p-6 border-t border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-950", children: _jsx("button", { onClick: disconnect, className: "w-full px-6 py-3 rounded-xl bg-red-100 dark:bg-red-900/20 hover:bg-red-200 dark:hover:bg-red-900/30 text-red-600 dark:text-red-400 font-medium transition-colors duration-200", children: "Disconnect" }) })] }))] }));
38
177
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ModalHeader } from './ModalHeader';
3
3
  export function SigningView() {
4
- return (_jsxs("div", { className: "rounded-[25px] shadow-lg w-96 p-5 bg-white dark:bg-neutral-900 text-neutral-900 dark:text-stone-200", children: [_jsx(ModalHeader, {}), _jsxs("div", { className: "flex flex-col items-center justify-center", children: [_jsx("div", { className: "animate-spin-slow w-16 h-16 border-4 rounded-full border-neutral-200 dark:border-neutral-700 border-t-neutral-900 dark:border-t-white" }), _jsx("p", { className: "text-sm mb-4 mt-6 text-neutral-500 dark:text-neutral-400", children: "Please sign the message to authenticate" })] })] }));
4
+ return (_jsxs("div", { className: "bg-gray-50 dark:bg-gray-950 relative border border-gray-200 dark:border-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full max-w-sm m-4 origin-center will-change-[max-width,transform,opacity]", children: [_jsx("div", { className: "p-6 border-b border-gray-200 dark:border-gray-800", children: _jsx(ModalHeader, {}) }), _jsx("div", { className: "p-6 overflow-hidden relative", children: _jsxs("div", { className: "flex flex-col items-center justify-center py-12 space-y-6", children: [_jsx("div", { className: "relative", children: _jsx("div", { className: "animate-spin rounded-full h-16 w-16 border-2 border-gray-200 dark:border-gray-800", children: _jsx("div", { className: "absolute inset-0 rounded-full border-t-2 border-main" }) }) }), _jsxs("div", { className: "space-y-2 text-center w-[300px]", children: [_jsxs("h3", { className: "text-xl text-gray-900 dark:text-white transition-all duration-300 h-[32px] flex items-center justify-center relative font-semibold", children: [_jsx("span", { className: "opacity-0 absolute select-none", "aria-hidden": "true", children: "Waiting for signature" }), _jsx("div", { className: "absolute min-w-[280px]", children: "Waiting for signature" })] }), _jsxs("p", { className: "text-sm text-gray-600 dark:text-neutral-400 h-[20px] flex items-center justify-center relative", children: [_jsx("span", { className: "opacity-0 absolute select-none", "aria-hidden": "true", children: "Please sign the message in your wallet" }), _jsx("div", { className: "absolute min-w-[280px]", children: "Please sign the message in your wallet" })] })] })] }) })] }));
5
5
  }
@@ -49,6 +49,7 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
49
49
  import { useEffect, useState, useRef } from 'react';
50
50
  import { useN1WalletInternalContext } from './hooks';
51
51
  import { logger } from '../utils/logger';
52
+ import { N1ModalViewMode } from './types';
52
53
  var getSettings = function (darkMode) { return ({
53
54
  initialAuthenticationMode: 'connect-only',
54
55
  environmentId: '9a47561c-6a0b-4a5b-ace1-12621c11cebd',
@@ -63,7 +64,7 @@ var getSettings = function (darkMode) { return ({
63
64
  }); };
64
65
  function DynamicContextConsumer(_a) {
65
66
  var children = _a.children;
66
- var _b = useN1WalletInternalContext(), setDynamicWallet = _b.setDynamicWallet, setAddress = _b.setAddress, setDynamicSdkHasLoaded = _b.setDynamicSdkHasLoaded, setShowDynamicWidget = _b.setShowDynamicWidget, darkMode = _b.darkMode, setDynamicHandleLogOut = _b.setDynamicHandleLogOut;
67
+ var _b = useN1WalletInternalContext(), setDynamicWallet = _b.setDynamicWallet, setAddress = _b.setAddress, setDynamicSdkHasLoaded = _b.setDynamicSdkHasLoaded, setShowDynamicWidget = _b.setShowDynamicWidget, setDynamicHandleLogOut = _b.setDynamicHandleLogOut, setViewMode = _b.setViewMode;
67
68
  var _c = useState(null), DynamicContext = _c[0], setDynamicContext = _c[1];
68
69
  var showAuthFlowRef = useRef(null);
69
70
  useEffect(function () {
@@ -75,6 +76,8 @@ function DynamicContextConsumer(_a) {
75
76
  // Set up a stable widget function that uses the ref
76
77
  useEffect(function () {
77
78
  setShowDynamicWidget(function () { return function (show) {
79
+ console.log('yeeyyeye', showAuthFlowRef);
80
+ console.log('yeeyyeye', showAuthFlowRef.current, show);
78
81
  if (showAuthFlowRef.current) {
79
82
  showAuthFlowRef.current(show);
80
83
  }
@@ -99,6 +102,7 @@ function DynamicContextConsumer(_a) {
99
102
  logger.debug('No primary wallet found');
100
103
  setDynamicWallet(null);
101
104
  setAddress('');
105
+ setViewMode(N1ModalViewMode.Connect);
102
106
  }
103
107
  }, [primaryWallet]);
104
108
  useEffect(function () {
@@ -152,7 +156,7 @@ function LazyInternal(props) {
152
156
  return null;
153
157
  }
154
158
  var dynamicSettings = __assign(__assign({}, getSettings(darkMode)), { walletConnectors: walletConnectors });
155
- return (_jsx(Provider, { settings: dynamicSettings, children: _jsx(DynamicContextConsumer, { children: props.children }) }));
159
+ return (_jsx(Provider, { settings: dynamicSettings, theme: darkMode ? 'dark' : 'light', children: _jsx(DynamicContextConsumer, { children: props.children }) }));
156
160
  }
157
161
  export function LazyWalletProvider(_a) {
158
162
  var children = _a.children;
@@ -55,7 +55,7 @@ import React, { Suspense, useCallback, useEffect, useState } from 'react';
55
55
  import { N1WalletModal } from '../Modal/N1WalletModal';
56
56
  import { WalletError, WalletErrorCode } from '../errors/types';
57
57
  import { N1InternalWalletContext, N1WalletContext } from './context';
58
- import { N1ModalViewMode, N1SessionMode } from './types';
58
+ import { N1ModalViewMode, N1SessionMode, } from './types';
59
59
  var LazyWalletProvider = React.lazy(function () {
60
60
  return import('./LazyWalletProvider').then(function (mod) { return ({
61
61
  default: mod.LazyWalletProvider,
@@ -104,12 +104,13 @@ export function N1WalletProvider(_a) {
104
104
  }, []);
105
105
  // dynamic
106
106
  var _r = useState(''), address = _r[0], setAddress = _r[1];
107
- var _s = useState(''), chain = _s[0], setChain = _s[1];
108
- var _t = useState(null), dynamicSdkHasLoaded = _t[0], setDynamicSdkHasLoaded = _t[1];
109
- var _u = useState(null), dynamicHandleLogOut = _u[0], setDynamicHandleLogOut = _u[1];
110
- var _v = useState(null), sessionMode = _v[0], setSessionMode = _v[1];
111
- var _w = useState(null), dynamicWallet = _w[0], setDynamicWallet = _w[1];
112
- var _x = useState(null), showDynamicWidget = _x[0], setShowDynamicWidget = _x[1];
107
+ var _s = useState([]), balances = _s[0], setBalances = _s[1];
108
+ var _t = useState(''), chain = _t[0], setChain = _t[1];
109
+ var _u = useState(null), dynamicSdkHasLoaded = _u[0], setDynamicSdkHasLoaded = _u[1];
110
+ var _v = useState(null), dynamicHandleLogOut = _v[0], setDynamicHandleLogOut = _v[1];
111
+ var _w = useState(null), sessionMode = _w[0], setSessionMode = _w[1];
112
+ var _x = useState(null), dynamicWallet = _x[0], setDynamicWallet = _x[1];
113
+ var _y = useState(null), showDynamicWidget = _y[0], setShowDynamicWidget = _y[1];
113
114
  // Combine SDK loading and initialization into a single effect
114
115
  useEffect(function () {
115
116
  var mounted = true;
@@ -171,6 +172,7 @@ export function N1WalletProvider(_a) {
171
172
  }); };
172
173
  return (_jsx(WalletErrorBoundary, { onError: handleError, children: _jsx(N1WalletContext.Provider, { value: {
173
174
  address: address,
175
+ balances: balances,
174
176
  appId: appId,
175
177
  chain: chain,
176
178
  isConnected: isConnected,
@@ -194,6 +196,7 @@ export function N1WalletProvider(_a) {
194
196
  handleError: handleError,
195
197
  setDynamicSdkHasLoaded: setDynamicSdkHasLoaded,
196
198
  setAddress: setAddress,
199
+ setBalances: setBalances,
197
200
  setChain: setChain,
198
201
  setDynamicHandleLogOut: setDynamicHandleLogOut,
199
202
  setDynamicWallet: setDynamicWallet,
@@ -18,9 +18,16 @@ export interface N1WalletProviderProps {
18
18
  darkMode?: boolean;
19
19
  onError?: (error: WalletError) => void;
20
20
  }
21
+ export interface Balance {
22
+ mint: string;
23
+ balance: bigint;
24
+ appId: string;
25
+ appType: string;
26
+ }
21
27
  export interface N1WalletState {
22
28
  address: string;
23
29
  appId: string | null;
30
+ balances: Balance[];
24
31
  chain: string;
25
32
  isConnected: boolean;
26
33
  ntsInterface: any;
@@ -44,6 +51,7 @@ export interface N1InternalWalletState {
44
51
  handleError: (error: WalletError) => void;
45
52
  setDynamicSdkHasLoaded: (loaded: any) => void;
46
53
  setAddress: (address: string) => void;
54
+ setBalances: (balances: Balance[]) => void;
47
55
  setChain: (chain: string) => void;
48
56
  setDynamicHandleLogOut: (handler: any) => void;
49
57
  setDynamicWallet: (wallet: any) => void;
@@ -0,0 +1,7 @@
1
+ interface LogoProps {
2
+ size?: number;
3
+ outlined?: boolean;
4
+ fillOpacity?: number;
5
+ }
6
+ export default function Logo({ size, outlined, fillOpacity, }: LogoProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,118 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ export default function Logo(_a) {
4
+ var _b = _a.size, size = _b === void 0 ? 24 : _b, _c = _a.outlined, outlined = _c === void 0 ? false : _c, _d = _a.fillOpacity, fillOpacity = _d === void 0 ? 1 : _d;
5
+ // Calculate width based on the SVG's aspect ratio (1347.5/838)
6
+ var width = size * (1347.5 / 838);
7
+ return (_jsx("div", { className: "cursor-pointer text-black dark:text-white", style: { height: size, width: "".concat(width, "px") }, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", version: "1.1", viewBox: "0 0 1347.5 838", className: "h-full w-full", preserveAspectRatio: "xMidYMid meet", children: _jsxs("g", { children: [_jsxs("g", { id: "Layer_1", children: [_jsx("path", { style: {
8
+ stroke: 'currentColor',
9
+ strokeMiterlimit: 10,
10
+ strokeWidth: outlined || fillOpacity !== 1 ? '2px' : '0.5px',
11
+ fill: outlined ? 'none' : 'currentColor',
12
+ fillOpacity: outlined ? 0 : fillOpacity,
13
+ transition: outlined || fillOpacity !== 1
14
+ ? 'fill-opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1)'
15
+ : undefined,
16
+ }, d: "M965.4,1497.9h-133.8v133.8h133.8v-133.8Z" }), _jsx("path", { style: {
17
+ stroke: 'currentColor',
18
+ strokeMiterlimit: 10,
19
+ strokeWidth: outlined || fillOpacity !== 1 ? '2px' : '0.5px',
20
+ fill: outlined ? 'none' : 'currentColor',
21
+ fillOpacity: outlined ? 0 : fillOpacity,
22
+ transition: outlined || fillOpacity !== 1
23
+ ? 'fill-opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1)'
24
+ : undefined,
25
+ }, d: "M394.9,1497.9h-126.3l-134.9,134.9v435.7h134.9v-435.7h70.4l435.7,435.7h190.7l-435.7-435.7-134.9-134.9Z" }), _jsx("path", { style: {
26
+ stroke: 'currentColor',
27
+ strokeMiterlimit: 10,
28
+ strokeWidth: outlined || fillOpacity !== 1 ? '2px' : '0.5px',
29
+ fill: outlined ? 'none' : 'currentColor',
30
+ fillOpacity: outlined ? 0 : fillOpacity,
31
+ transition: outlined || fillOpacity !== 1
32
+ ? 'fill-opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1)'
33
+ : undefined,
34
+ }, d: "M1078.9,1632.8v435.7h134.9v-570.5l-134.9,134.9Z" }), _jsx("rect", { style: {
35
+ stroke: 'currentColor',
36
+ strokeMiterlimit: 10,
37
+ strokeWidth: outlined || fillOpacity !== 1 ? '2px' : '0.5px',
38
+ fill: outlined ? 'none' : 'currentColor',
39
+ fillOpacity: outlined ? 0 : fillOpacity,
40
+ transition: outlined || fillOpacity !== 1
41
+ ? 'fill-opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1)'
42
+ : undefined,
43
+ }, x: "831.7", y: "133.8", width: "133.8", height: "133.8" }), _jsx("polygon", { style: {
44
+ stroke: 'currentColor',
45
+ strokeMiterlimit: 10,
46
+ strokeWidth: outlined || fillOpacity !== 1 ? '2px' : '0.5px',
47
+ fill: outlined ? 'none' : 'currentColor',
48
+ fillOpacity: outlined ? 0 : fillOpacity,
49
+ transition: outlined || fillOpacity !== 1
50
+ ? 'fill-opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1)'
51
+ : undefined,
52
+ }, points: "394.9 133.8 268.6 133.8 133.8 268.6 133.8 704.3 268.6 704.3 268.6 268.6 339 268.6 774.7 704.3 965.4 704.3 529.8 268.6 394.9 133.8" }), _jsx("polygon", { style: {
53
+ stroke: 'currentColor',
54
+ strokeMiterlimit: 10,
55
+ strokeWidth: outlined || fillOpacity !== 1 ? '2px' : '0.5px',
56
+ fill: outlined ? 'none' : 'currentColor',
57
+ fillOpacity: outlined ? 0 : fillOpacity,
58
+ transition: outlined || fillOpacity !== 1
59
+ ? 'fill-opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1)'
60
+ : undefined,
61
+ }, points: "1078.9 268.6 1078.9 704.3 1213.8 704.3 1213.8 268.6 1213.8 198.2 1213.8 133.8 1078.9 268.6" })] }), _jsxs("g", { id: "Gridlines", children: [_jsx("line", { style: {
62
+ stroke: 'currentColor',
63
+ strokeMiterlimit: 10,
64
+ strokeWidth: '0.5px',
65
+ }, x1: "965.4", y1: "1232", x2: "965.4", y2: "2334.3" }), _jsx("line", { style: {
66
+ stroke: 'currentColor',
67
+ strokeMiterlimit: 10,
68
+ strokeWidth: '0.5px',
69
+ }, x1: "-359.4", y1: "1631.7", x2: "1707.2", y2: "1631.7" }), _jsx("line", { style: {
70
+ stroke: 'currentColor',
71
+ strokeMiterlimit: 10,
72
+ strokeWidth: '0.5px',
73
+ }, x1: "831.7", y1: "1232", x2: "831.7", y2: "2334.3" }), _jsx("line", { style: {
74
+ stroke: 'currentColor',
75
+ strokeMiterlimit: 10,
76
+ strokeWidth: '0.5px',
77
+ }, x1: "129", y1: "1232", x2: "1231.2", y2: "2334.3" }), _jsx("line", { style: {
78
+ stroke: 'currentColor',
79
+ strokeMiterlimit: 10,
80
+ strokeWidth: '0.5px',
81
+ }, x1: "-61.7", y1: "1232", x2: "1040.5", y2: "2334.3" }), _jsx("line", { style: {
82
+ stroke: 'currentColor',
83
+ strokeMiterlimit: 10,
84
+ strokeWidth: '0.5px',
85
+ }, x1: "-359.4", y1: "1632.8", x2: "1707.2", y2: "1632.8" }), _jsx("line", { style: {
86
+ stroke: 'currentColor',
87
+ strokeMiterlimit: 10,
88
+ strokeWidth: '0.5px',
89
+ }, x1: "268.6", y1: "1232", x2: "268.6", y2: "2334.3" }), _jsx("line", { style: {
90
+ stroke: 'currentColor',
91
+ strokeMiterlimit: 10,
92
+ strokeWidth: '0.5px',
93
+ }, x1: "133.8", y1: "1232", x2: "133.8", y2: "2334.3" }), _jsx("line", { style: {
94
+ stroke: 'currentColor',
95
+ strokeMiterlimit: 10,
96
+ strokeWidth: '0.5px',
97
+ }, x1: "534.5", y1: "1232", x2: "-359.4", y2: "2126" }), _jsx("line", { style: {
98
+ stroke: 'currentColor',
99
+ strokeMiterlimit: 10,
100
+ strokeWidth: '0.5px',
101
+ }, x1: "-359.4", y1: "1497.9", x2: "1707.2", y2: "1497.9" }), _jsx("line", { style: {
102
+ stroke: 'currentColor',
103
+ strokeMiterlimit: 10,
104
+ strokeWidth: '0.5px',
105
+ }, x1: "1479.7", y1: "1232", x2: "377.4", y2: "2334.3" }), _jsx("line", { style: {
106
+ stroke: 'currentColor',
107
+ strokeMiterlimit: 10,
108
+ strokeWidth: '0.5px',
109
+ }, x1: "1213.8", y1: "1232", x2: "1213.8", y2: "2334.3" }), _jsx("line", { style: {
110
+ stroke: 'currentColor',
111
+ strokeMiterlimit: 10,
112
+ strokeWidth: '0.5px',
113
+ }, x1: "-359.4", y1: "2068.5", x2: "1707.2", y2: "2068.5" }), _jsx("line", { style: {
114
+ stroke: 'currentColor',
115
+ strokeMiterlimit: 10,
116
+ strokeWidth: '0.5px',
117
+ }, x1: "1078.9", y1: "1232", x2: "1078.9", y2: "2334.3" })] })] }) }) }));
118
+ }
@@ -0,0 +1,4 @@
1
+ declare const QRCodeLoader: ({ address }: {
2
+ address: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default QRCodeLoader;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ var QRCodeLoader = function (_a) {
4
+ var address = _a.address;
5
+ var _b = useState(true), isLoading = _b[0], setIsLoading = _b[1];
6
+ return (_jsxs("div", { className: "relative w-36 h-36", children: [isLoading && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: _jsx("div", { className: "w-8 h-8 border-4 border-orange-500 border-t-transparent rounded-full animate-spin" }) })), _jsx("img", { src: "https://api.qrserver.com/v1/create-qr-code/?data=".concat(address, "&size=150x150"), alt: "QR Code", className: "w-full h-full", onLoad: function () { return setIsLoading(false); } })] }));
7
+ };
8
+ export default QRCodeLoader;
@@ -0,0 +1,17 @@
1
+ export type ButtonKey = 'deposit' | 'continue' | 'openApp';
2
+ export interface ButtonState {
3
+ text: string;
4
+ isTyping: boolean;
5
+ showCursor: boolean;
6
+ }
7
+ export type ButtonStates = Record<ButtonKey, ButtonState>;
8
+ interface AnimatedButtonProps {
9
+ onClick: () => void;
10
+ text: string;
11
+ isTyping: boolean;
12
+ disabled?: boolean;
13
+ onMouseEnter?: () => void;
14
+ onMouseLeave?: () => void;
15
+ }
16
+ export declare const AnimatedButton: ({ onClick, text, isTyping, disabled, onMouseEnter, onMouseLeave, }: AnimatedButtonProps) => import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { ANIMATION_EASE } from './constants';
4
+ var formatButtonText = function (text) {
5
+ return text.split('').join(' ');
6
+ };
7
+ export var AnimatedButton = function (_a) {
8
+ var onClick = _a.onClick, text = _a.text, isTyping = _a.isTyping, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave;
9
+ var _c = useState(false), isHovered = _c[0], setIsHovered = _c[1];
10
+ var _d = useState(false), isPressed = _d[0], setIsPressed = _d[1];
11
+ var handleMouseEnter = function () {
12
+ setIsHovered(true);
13
+ onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter();
14
+ };
15
+ var handleMouseLeave = function () {
16
+ setIsHovered(false);
17
+ setIsPressed(false);
18
+ onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
19
+ };
20
+ return (_jsxs("button", { onClick: disabled ? undefined : onClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onMouseDown: function () { return setIsPressed(true); }, onMouseUp: function () { return setIsPressed(false); }, disabled: disabled, className: "\n group relative w-full overflow-hidden rounded-md border-2 bg-gray-100 dark:bg-neutral-950 py-4 text-center \n transition-all duration-300 ".concat(ANIMATION_EASE, "\n ").concat(disabled
21
+ ? 'cursor-not-allowed border-gray-200 dark:border-neutral-800 opacity-50'
22
+ : 'cursor-pointer border-gray-200 dark:border-neutral-800 hover:border-gray-400 dark:hover:border-white/60', "\n "), style: {
23
+ transform: isPressed
24
+ ? 'scale(0.98)'
25
+ : isHovered
26
+ ? 'scale(0.99)'
27
+ : 'scale(1)',
28
+ }, children: [_jsx("div", { className: "relative z-[200] pl-4 isolate", children: _jsx("div", { className: "flex items-center", children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n ").concat(isTyping ? 'text-gray-900 dark:text-white' : 'text-gray-500 dark:text-neutral-400', "\n ").concat(isHovered ? '!text-gray-900 dark:!text-white' : '', "\n "), children: formatButtonText(text) }) }) }), _jsx("div", { className: "\n absolute inset-0 z-10 bg-gradient-to-r from-gray-400/0 via-gray-400/10 dark:from-white/0 dark:via-white/10 to-gray-400/0 dark:to-white/0\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n ").concat(isHovered ? 'opacity-100 translate-x-full' : 'opacity-0 -translate-x-full', "\n ") }), _jsx("div", { className: "\n absolute inset-0 z-20 \n bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzIiBoZWlnaHQ9IjMiPgo8cmVjdCB3aWR0aD0iMC41IiBoZWlnaHQ9IjAuNSIgZmlsbD0iI2ZmZmZmZiI+PC9yZWN0Pgo8L3N2Zz4=')]\n [background-size:3px_3px]\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n ").concat(isHovered ? 'opacity-10 scale-125' : 'opacity-0 scale-100', "\n ").concat(isHovered ? '' : 'animate-grain', "\n pointer-events-none\n ") }), _jsx("div", { className: "\n absolute inset-0 z-10 \n bg-gradient-to-br from-gray-400/15 via-gray-400/5 to-gray-400/10 dark:from-white/15 dark:via-white/5 dark:to-white/10\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n ").concat(isHovered ? 'opacity-100' : 'opacity-0', "\n pointer-events-none\n ") }), _jsx("div", { className: "\n absolute inset-0 z-30\n bg-gray-400/3 dark:bg-white/3\n transition-opacity duration-300 ".concat(ANIMATION_EASE, "\n ").concat(isHovered ? 'opacity-100' : 'opacity-0', "\n pointer-events-none\n ") })] }));
29
+ };
@@ -0,0 +1,7 @@
1
+ import { Chain } from '../types';
2
+ interface ChainButtonProps {
3
+ chain: Chain;
4
+ onClick: (chainId: string) => void;
5
+ }
6
+ export declare function ChainButton({ chain, onClick }: ChainButtonProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function ChainButton(_a) {
3
+ var chain = _a.chain, onClick = _a.onClick;
4
+ return (_jsxs("button", { onClick: function () { return onClick(chain.id); }, className: "flex flex-col items-center justify-center p-6 bg-gray-50 dark:bg-gray-950 border-2 border-gray-100 dark:border-gray-800 hover:border-red-500 dark:hover:border-red-500 hover:bg-red-50/50 dark:hover:bg-gray-900 transition-all duration-200 group rounded-lg", children: [_jsx("img", { src: chain.logo, width: 48, height: 48, alt: chain.name, className: "opacity-90 grayscale group-hover:grayscale-0 group-hover:scale-105 transition-all duration-200" }), _jsx("span", { className: "mt-4 font-medium text-gray-600 dark:text-gray-400 group-hover:text-red-500 dark:group-hover:text-gray-50 transition-colors duration-200", children: chain.name })] }));
5
+ }
@@ -0,0 +1 @@
1
+ export declare function LoadingSquares(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ export function LoadingSquares() {
4
+ return (_jsx("div", { className: "relative w-32 h-32 animate-fade-up", style: { animationDelay: '0.2s' }, children: _jsxs("div", { className: "absolute inset-0 grid grid-cols-2 gap-2", children: [_jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-main/40 dark:bg-main/20 animate-square-loader" }) }), _jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-main/40 dark:bg-main/20 animate-square-loader", style: { animationDelay: '0.2s' } }) }), _jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-main/40 dark:bg-main/20 animate-square-loader", style: { animationDelay: '0.4s' } }) }), _jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-main/40 dark:bg-main/20 animate-square-loader", style: { animationDelay: '0.6s' } }) })] }) }));
5
+ }
@@ -0,0 +1,6 @@
1
+ import { TableValues } from '../types';
2
+ interface TransactionTableProps {
3
+ tableValues: TableValues;
4
+ }
5
+ export declare function TransactionTable({ tableValues }: TransactionTableProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function TransactionTable(_a) {
3
+ var tableValues = _a.tableValues;
4
+ return (_jsx("div", { className: "w-1/2 bg-gray-100 dark:bg-gray-950 border border-gray-200 dark:border-gray-800 p-5 rounded-sm h-full", children: _jsx("div", { className: "space-y-4 text-sm", children: Object.entries(tableValues).map(function (_a) {
5
+ var key = _a[0], value = _a[1];
6
+ return (_jsxs("div", { className: "flex justify-between items-center", children: [_jsx("span", { className: "text-gray-500 dark:text-gray-400", children: key }), _jsxs("div", { className: "relative transition-opacity duration-300 ".concat(value.visible ? 'opacity-100' : 'opacity-0'), children: [_jsx("span", { className: "text-gray-900 dark:text-gray-50", children: value.text }), value.typing && (_jsx("span", { className: "absolute right-[-12px] top-1/2 -translate-y-1/2 w-[4px] h-[24px] bg-red-500 dark:bg-red-500" }))] })] }, key));
7
+ }) }) }));
8
+ }
@@ -0,0 +1,6 @@
1
+ import { WaitingMessageState } from '../types';
2
+ interface WaitingMessageProps {
3
+ message: WaitingMessageState;
4
+ }
5
+ export declare function WaitingMessage({ message }: WaitingMessageProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { LoadingSquares } from './LoadingSquares';
3
+ export function WaitingMessage(_a) {
4
+ var message = _a.message;
5
+ return (_jsxs("div", { className: "flex flex-col items-center justify-center py-12 space-y-6", children: [_jsx(LoadingSquares, {}), _jsxs("div", { className: "space-y-2 text-center w-[300px]", children: [_jsxs("h3", { className: "text-xl text-gray-800 dark:text-white transition-all duration-300 h-[32px] flex items-center justify-center relative font-semibold", children: [_jsx("span", { className: "opacity-0 absolute select-none", "aria-hidden": "true", children: "Waiting for transaction" }), _jsx("div", { className: "absolute min-w-[280px]", children: message.visible && message.title })] }), _jsxs("p", { className: "text-sm text-gray-600 dark:text-neutral-400 h-[20px] flex items-center justify-center relative", children: [_jsx("span", { className: "opacity-0 absolute select-none", "aria-hidden": "true", children: "Please sign the transaction in your wallet" }), _jsx("div", { className: "absolute min-w-[280px]", children: message.visible && message.subtitle })] })] })] }));
6
+ }
@@ -0,0 +1,15 @@
1
+ export declare const ANIMATION_EASE = "cubic-bezier(0.16, 1, 0.3, 1)";
2
+ export declare const TYPING_INTERVAL = 50;
3
+ export declare const ANIMATION_DURATION = 3000;
4
+ export declare const MIN_DEPOSIT = 1;
5
+ export declare const MAX_DEPOSIT = 10000;
6
+ export declare const INITIAL_APPS: {
7
+ name: string;
8
+ color: string;
9
+ progress: number;
10
+ }[];
11
+ export declare const CHAINS: {
12
+ id: string;
13
+ name: string;
14
+ logo: string;
15
+ }[];