@abstraxn/signer-react 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -0
- package/dist/src/AbstraxnProvider.d.ts +9 -0
- package/dist/src/AbstraxnProvider.js +21 -0
- package/dist/src/AbstraxnProvider.js.map +1 -0
- package/dist/src/ConnectButton.css +217 -0
- package/dist/src/ConnectButton.d.ts +71 -0
- package/dist/src/ConnectButton.js +102 -0
- package/dist/src/ConnectButton.js.map +1 -0
- package/dist/src/ExternalWalletButtons.css +319 -0
- package/dist/src/ExternalWalletButtons.d.ts +56 -0
- package/dist/src/ExternalWalletButtons.js +272 -0
- package/dist/src/ExternalWalletButtons.js.map +1 -0
- package/dist/src/OnboardingUI.d.ts +63 -0
- package/dist/src/OnboardingUI.js +66 -0
- package/dist/src/OnboardingUI.js.map +1 -0
- package/dist/src/WalletModal.css +2319 -0
- package/dist/src/WalletModal.d.ts +7 -0
- package/dist/src/WalletModal.js +322 -0
- package/dist/src/WalletModal.js.map +1 -0
- package/dist/src/chains.d.ts +56 -0
- package/dist/src/chains.js +291 -0
- package/dist/src/chains.js.map +1 -0
- package/dist/src/components/AbstraxnProvider/AbstraxnProvider.d.ts +12 -0
- package/dist/src/components/AbstraxnProvider/AbstraxnProvider.js +146 -0
- package/dist/src/components/AbstraxnProvider/AbstraxnProvider.js.map +1 -0
- package/dist/src/components/AbstraxnProvider/AbstraxnProviderInner.d.ts +25 -0
- package/dist/src/components/AbstraxnProvider/AbstraxnProviderInner.js +3086 -0
- package/dist/src/components/AbstraxnProvider/AbstraxnProviderInner.js.map +1 -0
- package/dist/src/components/AbstraxnProvider/AbstraxnProviderWithWagmi.d.ts +8 -0
- package/dist/src/components/AbstraxnProvider/AbstraxnProviderWithWagmi.js +46 -0
- package/dist/src/components/AbstraxnProvider/AbstraxnProviderWithWagmi.js.map +1 -0
- package/dist/src/components/AbstraxnProvider/AbstraxnProviderWithoutWagmi.d.ts +8 -0
- package/dist/src/components/AbstraxnProvider/AbstraxnProviderWithoutWagmi.js +12 -0
- package/dist/src/components/AbstraxnProvider/AbstraxnProviderWithoutWagmi.js.map +1 -0
- package/dist/src/components/AbstraxnProvider/context.d.ts +2 -0
- package/dist/src/components/AbstraxnProvider/context.js +6 -0
- package/dist/src/components/AbstraxnProvider/context.js.map +1 -0
- package/dist/src/components/AbstraxnProvider/index.d.ts +6 -0
- package/dist/src/components/AbstraxnProvider/index.js +7 -0
- package/dist/src/components/AbstraxnProvider/index.js.map +1 -0
- package/dist/src/components/AbstraxnProvider/useAbstraxnProviderBase.d.ts +30 -0
- package/dist/src/components/AbstraxnProvider/useAbstraxnProviderBase.js +49 -0
- package/dist/src/components/AbstraxnProvider/useAbstraxnProviderBase.js.map +1 -0
- package/dist/src/components/AbstraxnProvider/useAbstraxnWallet.d.ts +2 -0
- package/dist/src/components/AbstraxnProvider/useAbstraxnWallet.js +13 -0
- package/dist/src/components/AbstraxnProvider/useAbstraxnWallet.js.map +1 -0
- package/dist/src/components/AbstraxnProvider/useOAuthCallbacks.d.ts +22 -0
- package/dist/src/components/AbstraxnProvider/useOAuthCallbacks.js +242 -0
- package/dist/src/components/AbstraxnProvider/useOAuthCallbacks.js.map +1 -0
- package/dist/src/components/AbstraxnProvider/useWalletInitialization.d.ts +25 -0
- package/dist/src/components/AbstraxnProvider/useWalletInitialization.js +539 -0
- package/dist/src/components/AbstraxnProvider/useWalletInitialization.js.map +1 -0
- package/dist/src/components/AbstraxnProvider/utils.d.ts +41 -0
- package/dist/src/components/AbstraxnProvider/utils.js +139 -0
- package/dist/src/components/AbstraxnProvider/utils.js.map +1 -0
- package/dist/src/components/OnboardingUI/OnboardingUI.css +1062 -0
- package/dist/src/components/OnboardingUI/OnboardingUIReact.d.ts +15 -0
- package/dist/src/components/OnboardingUI/OnboardingUIReact.js +318 -0
- package/dist/src/components/OnboardingUI/OnboardingUIReact.js.map +1 -0
- package/dist/src/components/OnboardingUI/OnboardingUIWeb.d.ts +265 -0
- package/dist/src/components/OnboardingUI/OnboardingUIWeb.js +3782 -0
- package/dist/src/components/OnboardingUI/OnboardingUIWeb.js.map +1 -0
- package/dist/src/components/OnboardingUI/components/EmailForm.d.ts +16 -0
- package/dist/src/components/OnboardingUI/components/EmailForm.js +27 -0
- package/dist/src/components/OnboardingUI/components/EmailForm.js.map +1 -0
- package/dist/src/components/OnboardingUI/components/Modal.d.ts +14 -0
- package/dist/src/components/OnboardingUI/components/Modal.js +61 -0
- package/dist/src/components/OnboardingUI/components/Modal.js.map +1 -0
- package/dist/src/components/OnboardingUI/components/OtpForm.d.ts +20 -0
- package/dist/src/components/OnboardingUI/components/OtpForm.js +72 -0
- package/dist/src/components/OnboardingUI/components/OtpForm.js.map +1 -0
- package/dist/src/components/OnboardingUI/components/PasskeyButton.d.ts +14 -0
- package/dist/src/components/OnboardingUI/components/PasskeyButton.js +22 -0
- package/dist/src/components/OnboardingUI/components/PasskeyButton.js.map +1 -0
- package/dist/src/components/OnboardingUI/components/SocialButtons.d.ts +15 -0
- package/dist/src/components/OnboardingUI/components/SocialButtons.js +20 -0
- package/dist/src/components/OnboardingUI/components/SocialButtons.js.map +1 -0
- package/dist/src/components/OnboardingUI/components/index.d.ts +13 -0
- package/dist/src/components/OnboardingUI/components/index.js +9 -0
- package/dist/src/components/OnboardingUI/components/index.js.map +1 -0
- package/dist/src/components/OnboardingUI/hooks/index.d.ts +7 -0
- package/dist/src/components/OnboardingUI/hooks/index.js +6 -0
- package/dist/src/components/OnboardingUI/hooks/index.js.map +1 -0
- package/dist/src/components/OnboardingUI/hooks/useAuthMethods.d.ts +11 -0
- package/dist/src/components/OnboardingUI/hooks/useAuthMethods.js +243 -0
- package/dist/src/components/OnboardingUI/hooks/useAuthMethods.js.map +1 -0
- package/dist/src/components/OnboardingUI/hooks/useOnboarding.d.ts +21 -0
- package/dist/src/components/OnboardingUI/hooks/useOnboarding.js +153 -0
- package/dist/src/components/OnboardingUI/hooks/useOnboarding.js.map +1 -0
- package/dist/src/components/OnboardingUI/index.d.ts +12 -0
- package/dist/src/components/OnboardingUI/index.js +15 -0
- package/dist/src/components/OnboardingUI/index.js.map +1 -0
- package/dist/src/components/QRCode.d.ts +13 -0
- package/dist/src/components/QRCode.js +6 -0
- package/dist/src/components/QRCode.js.map +1 -0
- package/dist/src/components/WalletModal/components/ChainSelector.css +327 -0
- package/dist/src/components/WalletModal/components/ChainSelector.d.ts +11 -0
- package/dist/src/components/WalletModal/components/ChainSelector.js +75 -0
- package/dist/src/components/WalletModal/components/ChainSelector.js.map +1 -0
- package/dist/src/components/WalletModal/components/ExportKeyModal.css +134 -0
- package/dist/src/components/WalletModal/components/ExportKeyModal.d.ts +14 -0
- package/dist/src/components/WalletModal/components/ExportKeyModal.js +26 -0
- package/dist/src/components/WalletModal/components/ExportKeyModal.js.map +1 -0
- package/dist/src/components/WalletModal/components/ExportWarningModal.css +107 -0
- package/dist/src/components/WalletModal/components/ExportWarningModal.d.ts +17 -0
- package/dist/src/components/WalletModal/components/ExportWarningModal.js +20 -0
- package/dist/src/components/WalletModal/components/ExportWarningModal.js.map +1 -0
- package/dist/src/components/WalletModal/components/ManageWalletModal.css +246 -0
- package/dist/src/components/WalletModal/components/ManageWalletModal.d.ts +12 -0
- package/dist/src/components/WalletModal/components/ManageWalletModal.js +36 -0
- package/dist/src/components/WalletModal/components/ManageWalletModal.js.map +1 -0
- package/dist/src/components/WalletModal/components/PreviewTransactionModal.css +127 -0
- package/dist/src/components/WalletModal/components/PreviewTransactionModal.d.ts +17 -0
- package/dist/src/components/WalletModal/components/PreviewTransactionModal.js +10 -0
- package/dist/src/components/WalletModal/components/PreviewTransactionModal.js.map +1 -0
- package/dist/src/components/WalletModal/components/ReceiveModal.css +136 -0
- package/dist/src/components/WalletModal/components/ReceiveModal.d.ts +8 -0
- package/dist/src/components/WalletModal/components/ReceiveModal.js +22 -0
- package/dist/src/components/WalletModal/components/ReceiveModal.js.map +1 -0
- package/dist/src/components/WalletModal/components/SendModal.css +277 -0
- package/dist/src/components/WalletModal/components/SendModal.d.ts +16 -0
- package/dist/src/components/WalletModal/components/SendModal.js +219 -0
- package/dist/src/components/WalletModal/components/SendModal.js.map +1 -0
- package/dist/src/components/WalletModal/components/SuccessModal.css +85 -0
- package/dist/src/components/WalletModal/components/SuccessModal.d.ts +13 -0
- package/dist/src/components/WalletModal/components/SuccessModal.js +8 -0
- package/dist/src/components/WalletModal/components/SuccessModal.js.map +1 -0
- package/dist/src/components/WalletModal/components/TokenSelectorModal.css +240 -0
- package/dist/src/components/WalletModal/components/TokenSelectorModal.d.ts +21 -0
- package/dist/src/components/WalletModal/components/TokenSelectorModal.js +44 -0
- package/dist/src/components/WalletModal/components/TokenSelectorModal.js.map +1 -0
- package/dist/src/components/WalletModal/components/UserAvatar.d.ts +9 -0
- package/dist/src/components/WalletModal/components/UserAvatar.js +31 -0
- package/dist/src/components/WalletModal/components/UserAvatar.js.map +1 -0
- package/dist/src/components/WalletModal/components/index.d.ts +23 -0
- package/dist/src/components/WalletModal/components/index.js +14 -0
- package/dist/src/components/WalletModal/components/index.js.map +1 -0
- package/dist/src/components/WalletModal/hooks/index.d.ts +6 -0
- package/dist/src/components/WalletModal/hooks/index.js +7 -0
- package/dist/src/components/WalletModal/hooks/index.js.map +1 -0
- package/dist/src/components/WalletModal/hooks/useAddressValidation.d.ts +4 -0
- package/dist/src/components/WalletModal/hooks/useAddressValidation.js +17 -0
- package/dist/src/components/WalletModal/hooks/useAddressValidation.js.map +1 -0
- package/dist/src/components/WalletModal/hooks/useAmountValidation.d.ts +4 -0
- package/dist/src/components/WalletModal/hooks/useAmountValidation.js +29 -0
- package/dist/src/components/WalletModal/hooks/useAmountValidation.js.map +1 -0
- package/dist/src/components/WalletModal/hooks/useSendTransaction.d.ts +20 -0
- package/dist/src/components/WalletModal/hooks/useSendTransaction.js +55 -0
- package/dist/src/components/WalletModal/hooks/useSendTransaction.js.map +1 -0
- package/dist/src/components/WalletModal/index.d.ts +5 -0
- package/dist/src/components/WalletModal/index.js +7 -0
- package/dist/src/components/WalletModal/index.js.map +1 -0
- package/dist/src/components/WalletModal/utils/addressUtils.d.ts +19 -0
- package/dist/src/components/WalletModal/utils/addressUtils.js +62 -0
- package/dist/src/components/WalletModal/utils/addressUtils.js.map +1 -0
- package/dist/src/components/WalletModal/utils/formatUtils.d.ts +20 -0
- package/dist/src/components/WalletModal/utils/formatUtils.js +47 -0
- package/dist/src/components/WalletModal/utils/formatUtils.js.map +1 -0
- package/dist/src/components/WalletModal/utils/index.d.ts +5 -0
- package/dist/src/components/WalletModal/utils/index.js +6 -0
- package/dist/src/components/WalletModal/utils/index.js.map +1 -0
- package/dist/src/connectors.d.ts +27 -0
- package/dist/src/connectors.js +70 -0
- package/dist/src/connectors.js.map +1 -0
- package/dist/src/hooks.d.ts +13136 -0
- package/dist/src/hooks.js +1358 -0
- package/dist/src/hooks.js.map +1 -0
- package/dist/src/index.d.ts +17 -0
- package/dist/src/index.js +14 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/types.d.ts +224 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/wagmiConfig.d.ts +16 -0
- package/dist/src/wagmiConfig.js +103 -0
- package/dist/src/wagmiConfig.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/* Select Network View */
|
|
2
|
+
.wallet-modal-chain-selector-view {
|
|
3
|
+
position: relative;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
min-height: 450px;
|
|
7
|
+
background: #ffffff;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
animation: slideInRight 0.3s ease-out;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@keyframes slideInRight {
|
|
14
|
+
from { transform: translateX(100%); }
|
|
15
|
+
to { transform: translateX(0); }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.wallet-modal-chain-selector-header {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
padding: 0;
|
|
23
|
+
border-bottom: 1px solid #f1f5f9;
|
|
24
|
+
padding-bottom: 16px;
|
|
25
|
+
margin-bottom: 16px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.wallet-modal-chain-selector-back,
|
|
29
|
+
.wallet-modal-chain-selector-close {
|
|
30
|
+
background: transparent;
|
|
31
|
+
border: none;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
padding: 8px;
|
|
34
|
+
border-radius: 8px;
|
|
35
|
+
color: #64748b;
|
|
36
|
+
transition: all 0.2s;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
pointer-events: auto;
|
|
41
|
+
user-select: none;
|
|
42
|
+
-webkit-user-select: none;
|
|
43
|
+
width: 36px;
|
|
44
|
+
height: 36px;
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.wallet-modal-chain-selector-back:hover,
|
|
49
|
+
.wallet-modal-chain-selector-close:hover {
|
|
50
|
+
background: #f1f5f9;
|
|
51
|
+
color: #111827;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.wallet-modal-chain-selector-back:active,
|
|
55
|
+
.wallet-modal-chain-selector-close:active {
|
|
56
|
+
transform: scale(0.95);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.wallet-modal-content .wallet-modal-chain-selector-title {
|
|
60
|
+
font-size: 18px;
|
|
61
|
+
font-weight: 500;
|
|
62
|
+
margin: 0;
|
|
63
|
+
color: #111827;
|
|
64
|
+
flex: 1;
|
|
65
|
+
text-align: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.wallet-modal-chain-selector-content {
|
|
69
|
+
flex: 1;
|
|
70
|
+
overflow-y: auto;
|
|
71
|
+
padding: 0;
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
gap: 16px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Custom Scrollbar */
|
|
78
|
+
.wallet-modal-chain-selector-content::-webkit-scrollbar {
|
|
79
|
+
width: 8px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.wallet-modal-chain-selector-content::-webkit-scrollbar-track {
|
|
83
|
+
background: transparent;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.wallet-modal-chain-selector-content::-webkit-scrollbar-thumb {
|
|
87
|
+
background: #cbd5e1;
|
|
88
|
+
border-radius: 10px;
|
|
89
|
+
border: 2px solid transparent;
|
|
90
|
+
background-clip: content-box;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.wallet-modal-chain-selector-content::-webkit-scrollbar-thumb:hover {
|
|
94
|
+
background: #94a3b8;
|
|
95
|
+
background-clip: content-box;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.wallet-modal-theme-dark .wallet-modal-chain-selector-content::-webkit-scrollbar-thumb {
|
|
99
|
+
background: #475569;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Tabs */
|
|
103
|
+
.wallet-modal-chain-tabs {
|
|
104
|
+
display: flex;
|
|
105
|
+
gap: 12px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.wallet-modal-chain-tab {
|
|
109
|
+
padding: 8px 16px;
|
|
110
|
+
border-radius: 10px;
|
|
111
|
+
border: none;
|
|
112
|
+
background: transparent;
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
font-size: 14px;
|
|
115
|
+
font-weight: 600;
|
|
116
|
+
color: #64748b;
|
|
117
|
+
transition: all 0.2s;
|
|
118
|
+
pointer-events: auto;
|
|
119
|
+
user-select: none;
|
|
120
|
+
-webkit-user-select: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.wallet-modal-chain-tab:hover {
|
|
124
|
+
color: #111827;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.wallet-modal-chain-tab.active {
|
|
128
|
+
background: #f1f5f9;
|
|
129
|
+
color: #111827;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Search */
|
|
133
|
+
.wallet-modal-chain-search-container {
|
|
134
|
+
position: relative;
|
|
135
|
+
width: 100%;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.wallet-modal-chain-search-icon {
|
|
139
|
+
position: absolute;
|
|
140
|
+
left: 16px;
|
|
141
|
+
top: 50%;
|
|
142
|
+
transform: translateY(-50%);
|
|
143
|
+
color: #94a3b8;
|
|
144
|
+
pointer-events: none;
|
|
145
|
+
display: flex;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.wallet-modal-chain-search-input {
|
|
149
|
+
width: 100%;
|
|
150
|
+
padding: 12px 16px 12px 48px;
|
|
151
|
+
border-radius: 12px;
|
|
152
|
+
border: 1px solid #e2e8f0;
|
|
153
|
+
background: #ffffff;
|
|
154
|
+
font-size: 15px;
|
|
155
|
+
outline: none;
|
|
156
|
+
transition: all 0.2s;
|
|
157
|
+
color: #111827;
|
|
158
|
+
box-sizing: border-box;
|
|
159
|
+
pointer-events: auto;
|
|
160
|
+
user-select: text;
|
|
161
|
+
-webkit-user-select: text;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.wallet-modal-chain-search-input:focus {
|
|
165
|
+
border-color: #9333ea;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.wallet-modal-chain-search-input::placeholder {
|
|
169
|
+
color: #94a3b8;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* List */
|
|
173
|
+
.wallet-modal-chain-list-container {
|
|
174
|
+
display: flex;
|
|
175
|
+
flex-direction: column;
|
|
176
|
+
gap: 8px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.wallet-modal-chain-list-header {
|
|
180
|
+
font-size: 13px;
|
|
181
|
+
font-weight: 600;
|
|
182
|
+
color: #94a3b8;
|
|
183
|
+
text-transform: uppercase;
|
|
184
|
+
letter-spacing: 0.05em;
|
|
185
|
+
padding-left: 0;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.wallet-modal-chain-list {
|
|
189
|
+
display: flex;
|
|
190
|
+
flex-direction: column;
|
|
191
|
+
gap: 4px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.wallet-modal-chain-item {
|
|
195
|
+
width: 100%;
|
|
196
|
+
padding: 10px 12px;
|
|
197
|
+
border-radius: 12px;
|
|
198
|
+
border: none;
|
|
199
|
+
background: transparent;
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
transition: all 0.2s;
|
|
202
|
+
display: flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
gap: 16px;
|
|
205
|
+
text-align: left;
|
|
206
|
+
pointer-events: auto;
|
|
207
|
+
user-select: none;
|
|
208
|
+
-webkit-user-select: none;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.wallet-modal-chain-item:hover {
|
|
212
|
+
background: #f8fafc;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.wallet-modal-chain-item.active {
|
|
216
|
+
background: rgba(147, 51, 234, 0.05);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.wallet-modal-chain-item:active {
|
|
220
|
+
transform: scale(0.98);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.wallet-modal-chain-item:disabled {
|
|
224
|
+
opacity: 0.5;
|
|
225
|
+
cursor: not-allowed;
|
|
226
|
+
pointer-events: none;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.wallet-modal-chain-item.switching {
|
|
230
|
+
opacity: 0.7;
|
|
231
|
+
pointer-events: none;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.wallet-modal-chain-item-icon-wrapper {
|
|
235
|
+
position: relative;
|
|
236
|
+
width: 36px;
|
|
237
|
+
height: 36px;
|
|
238
|
+
flex-shrink: 0;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.wallet-modal-chain-item-icon-img {
|
|
242
|
+
width: 100%;
|
|
243
|
+
height: 100%;
|
|
244
|
+
border-radius: 50%;
|
|
245
|
+
object-fit: cover;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.wallet-modal-chain-item-icon-placeholder {
|
|
249
|
+
width: 100%;
|
|
250
|
+
height: 100%;
|
|
251
|
+
border-radius: 50%;
|
|
252
|
+
background: #f1f5f9;
|
|
253
|
+
display: flex;
|
|
254
|
+
align-items: center;
|
|
255
|
+
justify-content: center;
|
|
256
|
+
font-weight: 700;
|
|
257
|
+
color: #64748b;
|
|
258
|
+
font-size: 14px;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.wallet-modal-chain-item-status {
|
|
262
|
+
position: absolute;
|
|
263
|
+
bottom: -2px;
|
|
264
|
+
right: -2px;
|
|
265
|
+
width: 10px;
|
|
266
|
+
height: 10px;
|
|
267
|
+
border-radius: 50%;
|
|
268
|
+
background: #10b981;
|
|
269
|
+
border: 2px solid #ffffff;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.wallet-modal-chain-item-name {
|
|
273
|
+
flex: 1;
|
|
274
|
+
font-size: 16px;
|
|
275
|
+
font-weight: 600;
|
|
276
|
+
color: #111827;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.wallet-modal-chain-item-checkmark {
|
|
280
|
+
color: #10b981;
|
|
281
|
+
display: flex;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.wallet-modal-chain-no-results {
|
|
285
|
+
padding: 40px 20px;
|
|
286
|
+
text-align: center;
|
|
287
|
+
color: #64748b;
|
|
288
|
+
font-size: 15px;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* Dark Theme Support */
|
|
292
|
+
.wallet-modal-theme-dark.wallet-modal-chain-selector-view {
|
|
293
|
+
background: #1a1a1a;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.wallet-modal-theme-dark .wallet-modal-chain-selector-header {
|
|
297
|
+
border-color: #2a2a2a;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.wallet-modal-content.wallet-modal-theme-dark .wallet-modal-chain-selector-title {
|
|
301
|
+
color: #ffffff;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.wallet-modal-theme-dark .wallet-modal-chain-tab.active {
|
|
305
|
+
background: #2a2a2a;
|
|
306
|
+
color: #ffffff;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.wallet-modal-theme-dark .wallet-modal-chain-search-input {
|
|
310
|
+
background: #2a2a2a;
|
|
311
|
+
border-color: #3a3a3a;
|
|
312
|
+
color: #ffffff;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.wallet-modal-theme-dark .wallet-modal-chain-item:hover {
|
|
316
|
+
background: #2a2a2a;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.wallet-modal-theme-dark .wallet-modal-chain-item-name {
|
|
320
|
+
color: #ffffff;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.wallet-modal-theme-dark .wallet-modal-chain-item-status {
|
|
324
|
+
border-color: #1a1a1a;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ChainData } from "../../../chains";
|
|
2
|
+
import "./ChainSelector.css";
|
|
3
|
+
export interface ChainSelectorProps {
|
|
4
|
+
currentChain: ChainData | null;
|
|
5
|
+
availableChains: ChainData[];
|
|
6
|
+
onChainSelect: (chainId: number) => Promise<void> | void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
theme?: "light" | "dark";
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function ChainSelector({ currentChain, availableChains, onChainSelect, onClose, theme, isOpen, }: ChainSelectorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Chain Selector Component
|
|
4
|
+
*/
|
|
5
|
+
import { useState, useEffect, useMemo } from "react";
|
|
6
|
+
import "./ChainSelector.css";
|
|
7
|
+
export function ChainSelector({ currentChain, availableChains, onChainSelect, onClose, theme = "dark", isOpen, }) {
|
|
8
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
9
|
+
const [filterType, setFilterType] = useState("all");
|
|
10
|
+
const [isSwitching, setIsSwitching] = useState(false);
|
|
11
|
+
const [switchingChainId, setSwitchingChainId] = useState(null);
|
|
12
|
+
// Reset state when opened
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (isOpen) {
|
|
15
|
+
setSearchQuery("");
|
|
16
|
+
setFilterType("all");
|
|
17
|
+
setIsSwitching(false);
|
|
18
|
+
setSwitchingChainId(null);
|
|
19
|
+
}
|
|
20
|
+
}, [isOpen]);
|
|
21
|
+
const filteredChains = useMemo(() => {
|
|
22
|
+
return availableChains.filter((chain) => {
|
|
23
|
+
const matchesSearch = chain.displayName.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
|
24
|
+
chain.id.toString().includes(searchQuery);
|
|
25
|
+
const matchesFilter = filterType === "all" ||
|
|
26
|
+
(filterType === "mainnet" && !chain.isTestnet) ||
|
|
27
|
+
(filterType === "testnet" && chain.isTestnet);
|
|
28
|
+
return matchesSearch && matchesFilter;
|
|
29
|
+
});
|
|
30
|
+
}, [availableChains, searchQuery, filterType]);
|
|
31
|
+
if (!isOpen)
|
|
32
|
+
return null;
|
|
33
|
+
return (_jsxs("div", { className: `wallet-modal-chain-selector-view wallet-modal-theme-${theme}`, onClick: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "wallet-modal-chain-selector-header", children: [_jsx("button", { className: "wallet-modal-chain-selector-back", onClick: (e) => {
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
onClose();
|
|
36
|
+
}, children: _jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("polyline", { points: "15 18 9 12 15 6" }) }) }), _jsx("h2", { className: "wallet-modal-chain-selector-title", children: "Select Network" }), _jsx("button", { className: "wallet-modal-chain-selector-close", onClick: (e) => {
|
|
37
|
+
e.stopPropagation();
|
|
38
|
+
onClose();
|
|
39
|
+
}, children: _jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }), _jsxs("div", { className: "wallet-modal-chain-selector-content", children: [_jsxs("div", { className: "wallet-modal-chain-tabs", children: [_jsx("button", { className: `wallet-modal-chain-tab ${filterType === "all" ? "active" : ""}`, onClick: (e) => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
setFilterType("all");
|
|
42
|
+
}, children: "All" }), _jsx("button", { className: `wallet-modal-chain-tab ${filterType === "mainnet" ? "active" : ""}`, onClick: (e) => {
|
|
43
|
+
e.stopPropagation();
|
|
44
|
+
setFilterType("mainnet");
|
|
45
|
+
}, children: "Mainnets" }), _jsx("button", { className: `wallet-modal-chain-tab ${filterType === "testnet" ? "active" : ""}`, onClick: (e) => {
|
|
46
|
+
e.stopPropagation();
|
|
47
|
+
setFilterType("testnet");
|
|
48
|
+
}, children: "Testnets" })] }), _jsxs("div", { className: "wallet-modal-chain-search-container", children: [_jsx("div", { className: "wallet-modal-chain-search-icon", children: _jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("circle", { cx: "11", cy: "11", r: "8" }), _jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })] }) }), _jsx("input", { type: "text", className: "wallet-modal-chain-search-input", placeholder: "Search Network or Chain ID", value: searchQuery, onChange: (e) => {
|
|
49
|
+
e.stopPropagation();
|
|
50
|
+
setSearchQuery(e.target.value);
|
|
51
|
+
}, onClick: (e) => e.stopPropagation(), autoFocus: true })] }), _jsxs("div", { className: "wallet-modal-chain-list-container", children: [_jsx("div", { className: "wallet-modal-chain-list-header", children: filterType === "all"
|
|
52
|
+
? "ALL NETWORKS"
|
|
53
|
+
: filterType === "mainnet"
|
|
54
|
+
? "MAINNETS"
|
|
55
|
+
: "TESTNETS" }), _jsxs("div", { className: "wallet-modal-chain-list", children: [filteredChains.map((chain) => (_jsxs("button", { className: `wallet-modal-chain-item ${currentChain?.id === chain.id ? "active" : ""} ${isSwitching && switchingChainId === chain.id
|
|
56
|
+
? "switching"
|
|
57
|
+
: ""}`, disabled: isSwitching, onClick: async (e) => {
|
|
58
|
+
e.stopPropagation();
|
|
59
|
+
if (isSwitching)
|
|
60
|
+
return;
|
|
61
|
+
try {
|
|
62
|
+
setIsSwitching(true);
|
|
63
|
+
setSwitchingChainId(chain.id);
|
|
64
|
+
await onChainSelect(chain.id);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
console.error("Chain switch error:", error);
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
setIsSwitching(false);
|
|
71
|
+
setSwitchingChainId(null);
|
|
72
|
+
}
|
|
73
|
+
}, children: [_jsxs("div", { className: "wallet-modal-chain-item-icon-wrapper", children: [chain.iconUrl ? (_jsx("img", { src: chain.iconUrl, alt: chain.displayName, className: "wallet-modal-chain-item-icon-img" })) : (_jsx("div", { className: "wallet-modal-chain-item-icon-placeholder", children: chain.displayName.charAt(0) })), currentChain?.id === chain.id && (_jsx("span", { className: "wallet-modal-chain-item-status" }))] }), _jsx("span", { className: "wallet-modal-chain-item-name", children: chain.displayName }), currentChain?.id === chain.id && (_jsx("div", { className: "wallet-modal-chain-item-checkmark", children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }))] }, chain.id))), filteredChains.length === 0 && (_jsxs("div", { className: "wallet-modal-chain-no-results", children: ["No networks found for \"", searchQuery, "\""] }))] })] })] })] }));
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=ChainSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChainSelector.js","sourceRoot":"","sources":["../../../../../src/components/WalletModal/components/ChainSelector.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,qBAAqB,CAAC;AAW7B,MAAM,UAAU,aAAa,CAAC,EAC5B,YAAY,EACZ,eAAe,EACf,aAAa,EACb,OAAO,EACP,KAAK,GAAG,MAAM,EACd,MAAM,GACa;IACnB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACnD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAC1C,KAAK,CACN,CAAC;IACF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAE9E,0BAA0B;IAC1B,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,EAAE,CAAC;YACX,cAAc,CAAC,EAAE,CAAC,CAAC;YACnB,aAAa,CAAC,KAAK,CAAC,CAAC;YACrB,cAAc,CAAC,KAAK,CAAC,CAAC;YACtB,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,EA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,GACb,EACN,YAAY,EAAE,EAAE,KAAK,KAAK,CAAC,EAAE,IAAI,CAChC,cAAK,SAAS,EAAC,mCAAmC,YAChD,cACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,YAEtB,mBAAU,MAAM,EAAC,gBAAgB,GAAY,GACzC,GACF,CACP,KA3DI,KAAK,CAAC,EAAE,CA4DN,CACV,CAAC,EACD,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,CAC9B,eAAK,SAAS,EAAC,+BAA+B,yCACpB,WAAW,UAC/B,CACP,IACG,IACF,IACF,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/* Export Key Modal Styles - extracted from WalletModal.css */
|
|
2
|
+
.wallet-modal-export-key-body {
|
|
3
|
+
width: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: 16px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.wallet-modal-export-key-warning {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
gap: 12px;
|
|
13
|
+
padding: 12px 14px;
|
|
14
|
+
border-radius: 12px;
|
|
15
|
+
border: 1px solid;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.wallet-modal-theme-light .wallet-modal-export-key-warning {
|
|
19
|
+
background: #f3f4f6;
|
|
20
|
+
border-color: #e5e7eb;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.wallet-modal-theme-dark .wallet-modal-export-key-warning {
|
|
24
|
+
background: #2a2a2a;
|
|
25
|
+
border-color: #3a3a3a;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.wallet-modal-export-key-warning-icon {
|
|
29
|
+
flex-shrink: 0;
|
|
30
|
+
margin-top: 2px;
|
|
31
|
+
color: #2563eb;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.wallet-modal-theme-dark .wallet-modal-export-key-warning-icon {
|
|
35
|
+
color: #60a5fa;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.wallet-modal-export-key-warning-text {
|
|
39
|
+
min-width: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.wallet-modal-export-key-warning-title {
|
|
43
|
+
font-size: 13px;
|
|
44
|
+
font-weight: 700;
|
|
45
|
+
line-height: 1.35;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.wallet-modal-export-key-warning-subtitle {
|
|
49
|
+
margin-top: 2px;
|
|
50
|
+
font-size: 12px;
|
|
51
|
+
line-height: 1.35;
|
|
52
|
+
opacity: 0.85;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.wallet-modal-theme-light .wallet-modal-export-key-warning-title,
|
|
56
|
+
.wallet-modal-theme-light .wallet-modal-export-key-warning-subtitle {
|
|
57
|
+
color: #111827;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.wallet-modal-theme-dark .wallet-modal-export-key-warning-title,
|
|
61
|
+
.wallet-modal-theme-dark .wallet-modal-export-key-warning-subtitle {
|
|
62
|
+
color: #ffffff;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.wallet-modal-export-key-field {
|
|
66
|
+
width: 100%;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 10px;
|
|
70
|
+
padding: 12px 14px;
|
|
71
|
+
border-radius: 12px;
|
|
72
|
+
border: 1px solid;
|
|
73
|
+
box-sizing: border-box;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.wallet-modal-theme-light .wallet-modal-export-key-field {
|
|
77
|
+
background: #ffffff;
|
|
78
|
+
border-color: #e5e7eb;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.wallet-modal-theme-dark .wallet-modal-export-key-field {
|
|
82
|
+
background: #2a2a2a;
|
|
83
|
+
border-color: #3a3a3a;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.wallet-modal-export-key-value {
|
|
87
|
+
flex: 1;
|
|
88
|
+
min-width: 0;
|
|
89
|
+
font-family: 'GeistMono', 'SF Mono', monospace;
|
|
90
|
+
font-size: 13px;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
text-overflow: ellipsis;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.wallet-modal-theme-light .wallet-modal-export-key-value {
|
|
97
|
+
color: #111827;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.wallet-modal-theme-dark .wallet-modal-export-key-value {
|
|
101
|
+
color: #ffffff;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.wallet-modal-export-key-inline-copy {
|
|
105
|
+
background: transparent;
|
|
106
|
+
border: none;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
padding: 6px;
|
|
109
|
+
border-radius: 8px;
|
|
110
|
+
transition: background 0.15s ease;
|
|
111
|
+
color: inherit;
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
flex-shrink: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.wallet-modal-theme-light .wallet-modal-export-key-inline-copy {
|
|
119
|
+
color: #6b7280;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.wallet-modal-theme-dark .wallet-modal-export-key-inline-copy {
|
|
123
|
+
color: #9ca3af;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.wallet-modal-theme-light .wallet-modal-export-key-inline-copy:hover {
|
|
127
|
+
background: rgba(17, 24, 39, 0.06);
|
|
128
|
+
color: #111827;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.wallet-modal-theme-dark .wallet-modal-export-key-inline-copy:hover {
|
|
132
|
+
background: rgba(255, 255, 255, 0.08);
|
|
133
|
+
color: #ffffff;
|
|
134
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export Key Modal Component
|
|
3
|
+
*/
|
|
4
|
+
import { type CSSProperties } from 'react';
|
|
5
|
+
import './ExportKeyModal.css';
|
|
6
|
+
import '../../../WalletModal.css';
|
|
7
|
+
export interface ExportKeyModalProps {
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
privateKey: string;
|
|
11
|
+
theme?: 'light' | 'dark';
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
}
|
|
14
|
+
export declare function ExportKeyModal({ isOpen, onClose, privateKey, theme, style, }: ExportKeyModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Export Key Modal Component
|
|
4
|
+
*/
|
|
5
|
+
import { useState, useCallback } from 'react';
|
|
6
|
+
import './ExportKeyModal.css';
|
|
7
|
+
import '../../../WalletModal.css';
|
|
8
|
+
import { FiInfo } from 'react-icons/fi';
|
|
9
|
+
export function ExportKeyModal({ isOpen, onClose, privateKey, theme = 'dark', style, }) {
|
|
10
|
+
const [copied, setCopied] = useState(false);
|
|
11
|
+
const handleCopy = useCallback(() => {
|
|
12
|
+
if (privateKey) {
|
|
13
|
+
navigator.clipboard.writeText(privateKey);
|
|
14
|
+
setCopied(true);
|
|
15
|
+
setTimeout(() => setCopied(false), 2000);
|
|
16
|
+
}
|
|
17
|
+
}, [privateKey]);
|
|
18
|
+
const handleClose = useCallback(() => {
|
|
19
|
+
setCopied(false);
|
|
20
|
+
onClose();
|
|
21
|
+
}, [onClose]);
|
|
22
|
+
if (!isOpen)
|
|
23
|
+
return null;
|
|
24
|
+
return (_jsx("div", { className: `wallet-modal-overlay wallet-modal-theme-${theme}`, onClick: handleClose, style: style, children: _jsxs("div", { className: `wallet-modal-content wallet-modal-theme-${theme} wallet-modal-export-key`, onClick: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "wallet-modal-receive-header", children: [_jsx("button", { className: "wallet-modal-back", onClick: handleClose, children: _jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: _jsx("path", { d: "M12.5 15L7.5 10L12.5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), _jsx("h2", { className: "wallet-modal-receive-title", children: "Export Private Key" }), _jsx("button", { className: "wallet-modal-close", onClick: handleClose, "aria-label": "Close", children: _jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M18 6L6 18M6 6L18 18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] }), _jsxs("div", { className: "wallet-modal-export-key-body", children: [_jsxs("div", { className: "wallet-modal-export-key-warning", role: "note", children: [_jsx("div", { className: "wallet-modal-export-key-warning-icon", "aria-hidden": "true", children: _jsx(FiInfo, { size: 18 }) }), _jsxs("div", { className: "wallet-modal-export-key-warning-text", children: [_jsx("div", { className: "wallet-modal-export-key-warning-title", children: "Don't share your private key with anyone." }), _jsx("div", { className: "wallet-modal-export-key-warning-subtitle", children: "This private key grants full access to your wallet and all held assets." })] })] }), _jsxs("div", { className: "wallet-modal-export-key-field", children: [_jsx("div", { className: "wallet-modal-export-key-value", title: privateKey, children: privateKey }), _jsx("button", { className: "wallet-modal-export-key-inline-copy", onClick: handleCopy, type: "button", "aria-label": "Copy private key", children: _jsxs("svg", { width: "18", height: "18", viewBox: "0 0 16 16", fill: "none", children: [_jsx("path", { d: "M5.5 3.5H3.5C2.67157 3.5 2 4.17157 2 5V12.5C2 13.3284 2.67157 14 3.5 14H11C11.8284 14 12.5 13.3284 12.5 12.5V10.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M5.5 3.5C5.5 2.67157 6.17157 2 7 2H12.5C13.3284 2 14 2.67157 14 3.5V9C14 9.82843 13.3284 10.5 12.5 10.5H7C6.17157 10.5 5.5 9.82843 5.5 9V3.5Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }) })] }), _jsx("button", { className: "wallet-modal-primary-btn", onClick: handleCopy, type: "button", children: copied ? "Copied" : "Copy" })] })] }) }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=ExportKeyModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportKeyModal.js","sourceRoot":"","sources":["../../../../../src/components/WalletModal/components/ExportKeyModal.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAsB,MAAM,OAAO,CAAC;AAClE,OAAO,sBAAsB,CAAC;AAC9B,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAUxC,MAAM,UAAU,cAAc,CAAC,EAC7B,MAAM,EACN,OAAO,EACP,UAAU,EACV,KAAK,GAAG,MAAM,EACd,KAAK,GACe;IACpB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE;QAClC,IAAI,UAAU,EAAE,CAAC;YACf,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YAC1C,SAAS,CAAC,IAAI,CAAC,CAAC;YAChB,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACnC,SAAS,CAAC,KAAK,C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