@enbox/browser 0.3.43 → 0.3.44

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 (48) hide show
  1. package/dist/browser.mjs +144 -154
  2. package/dist/browser.mjs.map +4 -4
  3. package/dist/esm/browser-connect-handler.js +17 -20
  4. package/dist/esm/browser-connect-handler.js.map +1 -1
  5. package/dist/esm/dweb-connect-client.js +1 -1
  6. package/dist/esm/dweb-connect-client.js.map +1 -1
  7. package/dist/esm/index.js +4 -1
  8. package/dist/esm/index.js.map +1 -1
  9. package/dist/esm/relay-connect-runner.js +127 -0
  10. package/dist/esm/relay-connect-runner.js.map +1 -0
  11. package/dist/esm/ui/connect-modal.js +961 -0
  12. package/dist/esm/ui/connect-modal.js.map +1 -0
  13. package/dist/esm/ui/qr.js +468 -0
  14. package/dist/esm/ui/qr.js.map +1 -0
  15. package/dist/esm/ui/wallet-icon.js +55 -0
  16. package/dist/esm/ui/wallet-icon.js.map +1 -0
  17. package/dist/esm/ui/wallet-well-known.js +61 -0
  18. package/dist/esm/ui/wallet-well-known.js.map +1 -0
  19. package/dist/types/browser-connect-handler.d.ts +32 -7
  20. package/dist/types/browser-connect-handler.d.ts.map +1 -1
  21. package/dist/types/dweb-connect-client.d.ts +3 -1
  22. package/dist/types/dweb-connect-client.d.ts.map +1 -1
  23. package/dist/types/index.d.ts +8 -2
  24. package/dist/types/index.d.ts.map +1 -1
  25. package/dist/types/relay-connect-runner.d.ts +76 -0
  26. package/dist/types/relay-connect-runner.d.ts.map +1 -0
  27. package/dist/types/ui/connect-modal.d.ts +108 -0
  28. package/dist/types/ui/connect-modal.d.ts.map +1 -0
  29. package/dist/types/ui/qr.d.ts +55 -0
  30. package/dist/types/ui/qr.d.ts.map +1 -0
  31. package/dist/types/ui/wallet-icon.d.ts +13 -0
  32. package/dist/types/ui/wallet-icon.d.ts.map +1 -0
  33. package/dist/types/ui/wallet-well-known.d.ts +33 -0
  34. package/dist/types/ui/wallet-well-known.d.ts.map +1 -0
  35. package/package.json +3 -1
  36. package/src/browser-connect-handler.ts +51 -21
  37. package/src/dweb-connect-client.ts +1 -1
  38. package/src/index.ts +8 -2
  39. package/src/relay-connect-runner.ts +201 -0
  40. package/src/ui/connect-modal.ts +1167 -0
  41. package/src/ui/qr.ts +549 -0
  42. package/src/ui/wallet-icon.ts +63 -0
  43. package/src/ui/wallet-well-known.ts +57 -0
  44. package/dist/esm/ui/wallet-selector.js +0 -585
  45. package/dist/esm/ui/wallet-selector.js.map +0 -1
  46. package/dist/types/ui/wallet-selector.d.ts +0 -44
  47. package/dist/types/ui/wallet-selector.d.ts.map +0 -1
  48. package/src/ui/wallet-selector.ts +0 -658
@@ -1,585 +0,0 @@
1
- /**
2
- * Wallet selector modal — a self-contained, framework-agnostic UI component.
3
- *
4
- * Injected into the DOM as a Shadow DOM element to prevent style conflicts.
5
- * Inspired by WalletConnect's Web3Modal pattern.
6
- *
7
- * The modal is a single view with three zones:
8
- *
9
- * 1. **Quick connect** — a one-tap button that connects with the recommended
10
- * (first) wallet without scrolling the grid.
11
- * 2. **Wallet grid** — a scrollable grid of wallet tiles with a search filter.
12
- * Each tile renders the wallet's own favicon, falling back to a letter
13
- * badge (never a third-party favicon proxy).
14
- * 3. **Custom URL** — paste any wallet URL; it is validated against the
15
- * wallet's `/.well-known/enbox-connect` discovery document before the
16
- * selection resolves.
17
- *
18
- * @module
19
- */
20
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
21
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
22
- return new (P || (P = Promise))(function (resolve, reject) {
23
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
24
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
25
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
26
- step((generator = generator.apply(thisArg, _arguments || [])).next());
27
- });
28
- };
29
- /** Path of the wallet's connect discovery document, relative to its origin. */
30
- export const WALLET_WELL_KNOWN_PATH = '/.well-known/enbox-connect';
31
- /** Timeout applied to the well-known validation fetch. */
32
- const WELL_KNOWN_FETCH_TIMEOUT_MS = 6000;
33
- /**
34
- * Fetch a wallet's `/.well-known/enbox-connect` discovery document to confirm
35
- * the origin hosts an Enbox-compatible wallet.
36
- *
37
- * Resolves `true` only when the document is reachable and names a
38
- * `connectServerUrl`. Unreachable origins, non-2xx responses, CORS failures,
39
- * and malformed documents resolve `false`.
40
- */
41
- export function probeWalletWellKnown(origin) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- try {
44
- const wellKnownUrl = new URL(WALLET_WELL_KNOWN_PATH, origin).toString();
45
- const response = yield fetch(wellKnownUrl, { signal: AbortSignal.timeout(WELL_KNOWN_FETCH_TIMEOUT_MS) });
46
- if (!response.ok) {
47
- return false;
48
- }
49
- const payload = yield response.json();
50
- return typeof (payload === null || payload === void 0 ? void 0 : payload.connectServerUrl) === 'string';
51
- }
52
- catch (_a) {
53
- return false;
54
- }
55
- });
56
- }
57
- /** Shows the wallet selector modal and resolves with the chosen wallet URL. */
58
- export function showWalletSelector(wallets, options = {}) {
59
- var _a;
60
- if (typeof window === 'undefined' || typeof document === 'undefined') {
61
- throw new Error('[@enbox/browser] Wallet selector is only available in browser environments.');
62
- }
63
- const validateWalletUrl = (_a = options.validateWalletUrl) !== null && _a !== void 0 ? _a : probeWalletWellKnown;
64
- return new Promise((resolve, reject) => {
65
- var _a, _b, _c;
66
- // Create the host element with Shadow DOM isolation.
67
- const host = document.createElement('div');
68
- host.id = 'enbox-wallet-selector';
69
- const shadow = host.attachShadow({ mode: 'open' });
70
- let onKeydown;
71
- const cleanup = () => {
72
- if (onKeydown !== undefined) {
73
- document.removeEventListener('keydown', onKeydown);
74
- onKeydown = undefined;
75
- }
76
- try {
77
- document.body.removeChild(host);
78
- }
79
- catch ( /* best effort */_a) { /* best effort */ }
80
- };
81
- const settleResolve = (url) => {
82
- cleanup();
83
- resolve(url);
84
- };
85
- const settleReject = () => {
86
- cleanup();
87
- reject(new Error('[@enbox/browser] Wallet selection cancelled.'));
88
- };
89
- // Detect dark mode.
90
- const isDark = (_b = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(prefers-color-scheme: dark)').matches) !== null && _b !== void 0 ? _b : false;
91
- // Build styles.
92
- const style = document.createElement('style');
93
- style.textContent = buildStyles(isDark);
94
- shadow.appendChild(style);
95
- // Build modal DOM.
96
- const overlay = document.createElement('div');
97
- overlay.className = 'overlay';
98
- const modal = document.createElement('div');
99
- modal.className = 'modal';
100
- modal.appendChild(buildHeader(settleReject));
101
- const recommended = wallets[0];
102
- if (recommended !== undefined) {
103
- modal.appendChild(buildQuickConnect(recommended, settleResolve));
104
- }
105
- modal.appendChild(buildWalletGrid(wallets, settleResolve));
106
- modal.appendChild(buildSeparator());
107
- modal.appendChild(buildCustomUrl(validateWalletUrl, settleResolve));
108
- // Close on overlay click.
109
- overlay.addEventListener('click', (e) => {
110
- if (e.target === overlay) {
111
- settleReject();
112
- }
113
- });
114
- // Close on Escape.
115
- onKeydown = (e) => {
116
- if (e.key === 'Escape') {
117
- settleReject();
118
- }
119
- };
120
- document.addEventListener('keydown', onKeydown);
121
- overlay.appendChild(modal);
122
- shadow.appendChild(overlay);
123
- document.body.appendChild(host);
124
- // Focus the search box for keyboard-first users.
125
- (_c = shadow.querySelector('.wallet-search')) === null || _c === void 0 ? void 0 : _c.focus();
126
- });
127
- }
128
- // ─── DOM builders ────────────────────────────────────────────────
129
- function buildHeader(onCancel) {
130
- const header = document.createElement('div');
131
- header.className = 'header';
132
- const title = document.createElement('h2');
133
- title.textContent = 'Connect a wallet';
134
- const closeBtn = document.createElement('button');
135
- closeBtn.className = 'close-btn';
136
- closeBtn.setAttribute('aria-label', 'Close');
137
- closeBtn.innerHTML = '×';
138
- closeBtn.addEventListener('click', onCancel);
139
- header.appendChild(title);
140
- header.appendChild(closeBtn);
141
- return header;
142
- }
143
- function buildQuickConnect(recommended, onSelect) {
144
- const quick = document.createElement('button');
145
- quick.className = 'quick-connect';
146
- const bolt = document.createElement('span');
147
- bolt.className = 'quick-bolt';
148
- bolt.textContent = '⚡'; // ⚡
149
- const text = document.createElement('span');
150
- text.className = 'quick-text';
151
- const label = document.createElement('span');
152
- label.className = 'quick-label';
153
- label.textContent = 'Quick connect';
154
- const sub = document.createElement('span');
155
- sub.className = 'quick-sub';
156
- sub.textContent = `Connect with ${recommended.name}`;
157
- text.appendChild(label);
158
- text.appendChild(sub);
159
- quick.appendChild(bolt);
160
- quick.appendChild(text);
161
- quick.addEventListener('click', () => onSelect(recommended.url));
162
- return quick;
163
- }
164
- function buildWalletGrid(wallets, onSelect) {
165
- const section = document.createElement('div');
166
- section.className = 'grid-section';
167
- const search = document.createElement('input');
168
- search.type = 'search';
169
- search.className = 'wallet-search';
170
- search.placeholder = 'Search wallets…';
171
- const grid = document.createElement('div');
172
- grid.className = 'wallet-grid';
173
- const empty = document.createElement('div');
174
- empty.className = 'grid-empty';
175
- empty.textContent = 'No wallets match your search.';
176
- empty.style.display = 'none';
177
- const tiles = wallets.map((wallet) => {
178
- const tile = buildWalletTile(wallet, onSelect);
179
- grid.appendChild(tile);
180
- return { name: wallet.name.toLowerCase(), tile };
181
- });
182
- search.addEventListener('input', () => {
183
- const query = search.value.trim().toLowerCase();
184
- let visible = 0;
185
- for (const { name, tile } of tiles) {
186
- const match = name.includes(query);
187
- tile.style.display = match ? '' : 'none';
188
- if (match) {
189
- visible += 1;
190
- }
191
- }
192
- empty.style.display = visible === 0 ? '' : 'none';
193
- });
194
- section.appendChild(search);
195
- section.appendChild(grid);
196
- section.appendChild(empty);
197
- return section;
198
- }
199
- function buildWalletTile(wallet, onSelect) {
200
- var _a;
201
- const tile = document.createElement('button');
202
- tile.className = 'wallet-item';
203
- tile.title = (_a = wallet.description) !== null && _a !== void 0 ? _a : wallet.name;
204
- tile.appendChild(buildWalletIcon(wallet));
205
- const name = document.createElement('span');
206
- name.className = 'wallet-name';
207
- name.textContent = wallet.name;
208
- tile.appendChild(name);
209
- tile.addEventListener('click', () => onSelect(wallet.url));
210
- return tile;
211
- }
212
- /**
213
- * Build a wallet icon that prefers the wallet's own favicon and degrades to a
214
- * letter badge. We never call a third-party favicon proxy: those 404 for many
215
- * origins and leak the wallet URL to the proxy.
216
- */
217
- function buildWalletIcon(wallet) {
218
- const wrap = document.createElement('span');
219
- wrap.className = 'wallet-icon';
220
- const badge = document.createElement('span');
221
- badge.className = 'wallet-badge';
222
- badge.textContent = wallet.name.charAt(0).toUpperCase();
223
- wrap.appendChild(badge);
224
- const sources = iconCandidates(wallet);
225
- if (sources.length === 0) {
226
- return wrap;
227
- }
228
- const img = document.createElement('img');
229
- img.className = 'wallet-img';
230
- img.alt = '';
231
- img.width = 40;
232
- img.height = 40;
233
- let index = 0;
234
- img.addEventListener('error', () => {
235
- index += 1;
236
- if (index < sources.length) {
237
- img.src = sources[index];
238
- }
239
- else {
240
- img.remove(); // fall back to the letter badge
241
- }
242
- });
243
- img.src = sources[index];
244
- wrap.appendChild(img);
245
- return wrap;
246
- }
247
- /** Ordered favicon URLs to try for a wallet, most specific first. */
248
- function iconCandidates(wallet) {
249
- if (wallet.icon !== undefined) {
250
- return [wallet.icon];
251
- }
252
- let origin;
253
- try {
254
- origin = new URL(wallet.url).origin;
255
- }
256
- catch (_a) {
257
- return [];
258
- }
259
- return [`${origin}/favicon.svg`, `${origin}/favicon.ico`, `${origin}/favicon.png`];
260
- }
261
- function buildSeparator() {
262
- const sep = document.createElement('div');
263
- sep.className = 'separator';
264
- const line1 = document.createElement('div');
265
- line1.className = 'sep-line';
266
- const sepText = document.createElement('span');
267
- sepText.textContent = 'or';
268
- const line2 = document.createElement('div');
269
- line2.className = 'sep-line';
270
- sep.appendChild(line1);
271
- sep.appendChild(sepText);
272
- sep.appendChild(line2);
273
- return sep;
274
- }
275
- function buildCustomUrl(validateWalletUrl, onSelect) {
276
- const section = document.createElement('div');
277
- section.className = 'custom-section';
278
- const label = document.createElement('label');
279
- label.className = 'custom-label';
280
- label.textContent = 'Have a wallet URL?';
281
- const inputGroup = document.createElement('div');
282
- inputGroup.className = 'input-group';
283
- const input = document.createElement('input');
284
- input.type = 'url';
285
- input.placeholder = 'https://your-wallet.example';
286
- input.className = 'url-input';
287
- const goBtn = document.createElement('button');
288
- goBtn.className = 'go-btn';
289
- goBtn.textContent = 'Connect';
290
- goBtn.disabled = true;
291
- const errorLine = document.createElement('div');
292
- errorLine.className = 'url-error';
293
- errorLine.style.display = 'none';
294
- // When validation fails we let the user override, since the popup handshake
295
- // is the ultimate gate — a valid wallet behind strict CORS should not be
296
- // permanently blocked.
297
- let allowUnverified = false;
298
- const resetState = () => {
299
- allowUnverified = false;
300
- goBtn.textContent = 'Connect';
301
- errorLine.style.display = 'none';
302
- goBtn.disabled = !isValidUrl(input.value);
303
- };
304
- const submit = () => __awaiter(this, void 0, void 0, function* () {
305
- if (!isValidUrl(input.value)) {
306
- return;
307
- }
308
- const origin = normalizeUrl(input.value);
309
- if (allowUnverified) {
310
- onSelect(origin);
311
- return;
312
- }
313
- goBtn.disabled = true;
314
- goBtn.textContent = 'Verifying…';
315
- errorLine.style.display = 'none';
316
- const valid = yield validateWalletUrl(origin);
317
- if (valid) {
318
- onSelect(origin);
319
- return;
320
- }
321
- allowUnverified = true;
322
- goBtn.disabled = false;
323
- goBtn.textContent = 'Connect anyway';
324
- errorLine.textContent = `Couldn't verify an Enbox wallet at ${origin}.`;
325
- errorLine.style.display = '';
326
- });
327
- input.addEventListener('input', resetState);
328
- input.addEventListener('keydown', (e) => {
329
- if (e.key === 'Enter') {
330
- void submit();
331
- }
332
- });
333
- goBtn.addEventListener('click', () => void submit());
334
- inputGroup.appendChild(input);
335
- inputGroup.appendChild(goBtn);
336
- section.appendChild(label);
337
- section.appendChild(inputGroup);
338
- section.appendChild(errorLine);
339
- return section;
340
- }
341
- // ─── Helpers ─────────────────────────────────────────────────────
342
- function isValidUrl(value) {
343
- try {
344
- const url = new URL(value.includes('://') ? value : `https://${value}`);
345
- return url.protocol === 'https:' || url.protocol === 'http:';
346
- }
347
- catch (_a) {
348
- return false;
349
- }
350
- }
351
- function normalizeUrl(value) {
352
- const withScheme = value.includes('://') ? value : `https://${value}`;
353
- // Return origin only (strip path/trailing slash).
354
- return new URL(withScheme).origin;
355
- }
356
- function buildStyles(isDark) {
357
- const bg = isDark ? '#1a1a2e' : '#ffffff';
358
- const text = isDark ? '#e0e0e0' : '#1a1a2e';
359
- const muted = isDark ? '#888' : '#666';
360
- const border = isDark ? '#333' : '#e0e0e0';
361
- const itemBg = isDark ? '#16213e' : '#f8f9fa';
362
- const itemHover = isDark ? '#0f3460' : '#e9ecef';
363
- const accent = isDark ? '#4a9eff' : '#0066cc';
364
- const accentAlt = isDark ? '#7b5cff' : '#5b8def';
365
- const danger = isDark ? '#ff6b6b' : '#c0392b';
366
- const overlayBg = 'rgba(0, 0, 0, 0.5)';
367
- return `
368
- * { box-sizing: border-box; margin: 0; padding: 0; }
369
-
370
- .overlay {
371
- position: fixed;
372
- inset: 0;
373
- z-index: 2147483647;
374
- display: flex;
375
- align-items: center;
376
- justify-content: center;
377
- background: ${overlayBg};
378
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
379
- animation: fadeIn 0.15s ease-out;
380
- }
381
-
382
- @keyframes fadeIn {
383
- from { opacity: 0; }
384
- to { opacity: 1; }
385
- }
386
-
387
- @keyframes slideUp {
388
- from { transform: translateY(20px); opacity: 0; }
389
- to { transform: translateY(0); opacity: 1; }
390
- }
391
-
392
- .modal {
393
- background: ${bg};
394
- color: ${text};
395
- border-radius: 16px;
396
- width: 420px;
397
- max-width: 92vw;
398
- max-height: 86vh;
399
- overflow-y: auto;
400
- padding: 24px;
401
- box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
402
- animation: slideUp 0.2s ease-out;
403
- }
404
-
405
- .header {
406
- display: flex;
407
- justify-content: space-between;
408
- align-items: center;
409
- margin-bottom: 18px;
410
- }
411
-
412
- h2 { font-size: 18px; font-weight: 600; }
413
-
414
- .close-btn {
415
- background: none;
416
- border: none;
417
- font-size: 24px;
418
- cursor: pointer;
419
- color: ${muted};
420
- padding: 4px 8px;
421
- border-radius: 8px;
422
- line-height: 1;
423
- }
424
- .close-btn:hover { color: ${text}; background: ${itemBg}; }
425
-
426
- .quick-connect {
427
- display: flex;
428
- align-items: center;
429
- gap: 12px;
430
- width: 100%;
431
- text-align: left;
432
- padding: 14px 16px;
433
- margin-bottom: 18px;
434
- border: none;
435
- border-radius: 12px;
436
- cursor: pointer;
437
- color: #fff;
438
- background: linear-gradient(135deg, ${accent}, ${accentAlt});
439
- transition: filter 0.15s;
440
- }
441
- .quick-connect:hover { filter: brightness(1.08); }
442
- .quick-bolt { font-size: 22px; line-height: 1; }
443
- .quick-text { display: flex; flex-direction: column; gap: 2px; }
444
- .quick-label { font-weight: 600; font-size: 15px; }
445
- .quick-sub { font-size: 12px; opacity: 0.85; }
446
-
447
- .wallet-search {
448
- width: 100%;
449
- padding: 10px 14px;
450
- margin-bottom: 12px;
451
- border: 1px solid ${border};
452
- border-radius: 10px;
453
- font-size: 14px;
454
- background: ${itemBg};
455
- color: ${text};
456
- outline: none;
457
- }
458
- .wallet-search:focus { border-color: ${accent}; }
459
- .wallet-search::placeholder { color: ${muted}; }
460
-
461
- .wallet-grid {
462
- display: grid;
463
- grid-template-columns: repeat(3, 1fr);
464
- gap: 10px;
465
- max-height: 216px;
466
- overflow-y: auto;
467
- padding: 2px;
468
- }
469
-
470
- .wallet-item {
471
- display: flex;
472
- flex-direction: column;
473
- align-items: center;
474
- justify-content: center;
475
- gap: 8px;
476
- padding: 14px 8px;
477
- background: ${itemBg};
478
- border: 1px solid ${border};
479
- border-radius: 12px;
480
- cursor: pointer;
481
- color: ${text};
482
- transition: background 0.15s, border-color 0.15s;
483
- }
484
- .wallet-item:hover { background: ${itemHover}; border-color: ${accent}; }
485
-
486
- .wallet-icon {
487
- position: relative;
488
- width: 40px;
489
- height: 40px;
490
- display: flex;
491
- align-items: center;
492
- justify-content: center;
493
- }
494
- .wallet-badge {
495
- position: absolute;
496
- inset: 0;
497
- display: flex;
498
- align-items: center;
499
- justify-content: center;
500
- border-radius: 10px;
501
- background: ${itemHover};
502
- color: ${text};
503
- font-size: 18px;
504
- font-weight: 600;
505
- }
506
- .wallet-img {
507
- position: relative;
508
- width: 40px;
509
- height: 40px;
510
- border-radius: 10px;
511
- object-fit: cover;
512
- background: ${bg};
513
- }
514
-
515
- .wallet-name {
516
- font-size: 13px;
517
- font-weight: 500;
518
- max-width: 100%;
519
- overflow: hidden;
520
- text-overflow: ellipsis;
521
- white-space: nowrap;
522
- }
523
-
524
- .grid-empty {
525
- grid-column: 1 / -1;
526
- padding: 16px;
527
- text-align: center;
528
- color: ${muted};
529
- font-size: 13px;
530
- }
531
-
532
- .separator {
533
- display: flex;
534
- align-items: center;
535
- gap: 12px;
536
- margin: 20px 0;
537
- color: ${muted};
538
- font-size: 13px;
539
- }
540
- .sep-line { flex: 1; height: 1px; background: ${border}; }
541
-
542
- .custom-label {
543
- display: block;
544
- font-size: 13px;
545
- color: ${muted};
546
- margin-bottom: 8px;
547
- }
548
-
549
- .input-group { display: flex; gap: 8px; }
550
-
551
- .url-input {
552
- flex: 1;
553
- padding: 10px 14px;
554
- border: 1px solid ${border};
555
- border-radius: 10px;
556
- font-size: 14px;
557
- background: ${itemBg};
558
- color: ${text};
559
- outline: none;
560
- }
561
- .url-input:focus { border-color: ${accent}; }
562
- .url-input::placeholder { color: ${muted}; }
563
-
564
- .go-btn {
565
- padding: 10px 18px;
566
- border: none;
567
- border-radius: 10px;
568
- background: ${accent};
569
- color: #fff;
570
- font-size: 14px;
571
- font-weight: 500;
572
- cursor: pointer;
573
- white-space: nowrap;
574
- }
575
- .go-btn:disabled { opacity: 0.4; cursor: not-allowed; }
576
- .go-btn:not(:disabled):hover { filter: brightness(1.1); }
577
-
578
- .url-error {
579
- margin-top: 8px;
580
- font-size: 12px;
581
- color: ${danger};
582
- }
583
- `;
584
- }
585
- //# sourceMappingURL=wallet-selector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wallet-selector.js","sourceRoot":"","sources":["../../../src/ui/wallet-selector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;AAIH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AAEnE,0DAA0D;AAC1D,MAAM,2BAA2B,GAAG,IAAK,CAAC;AAa1C;;;;;;;GAOG;AACH,MAAM,UAAgB,oBAAoB,CAAC,MAAc;;QACvD,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;YACxE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;YACzG,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,OAAO,KAAK,CAAC;YACf,CAAC;YAED,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAA2C,CAAC;YAC/E,OAAO,OAAO,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,CAAA,KAAK,QAAQ,CAAC;QACvD,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CAAA;AAED,+EAA+E;AAC/E,MAAM,UAAU,kBAAkB,CAChC,OAAuB,EACvB,UAAiC,EAAE;;IAEnC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACrE,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;IACjG,CAAC;IAED,MAAM,iBAAiB,GAAG,MAAA,OAAO,CAAC,iBAAiB,mCA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C,SAAS,CAAC;IAC9C,MAAM,SAAS,GAAG,oBAAoB,CAAC;IAEvC,OAAO;;;;;;;;;;oBAUW,SAAS;;;;;;;;;;;;;;;;oBAgBT,EAAE;eACP,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;eAyBJ,KAAK;;;;;gCAKY,IAAI,iBAAiB,MAAM;;;;;;;;;;;;;;4CAcf,MAAM,KAAK,SAAS;;;;;;;;;;;;;0BAatC,MAAM;;;oBAGZ,MAAM;eACX,IAAI;;;2CAGwB,MAAM;2CACN,KAAK;;;;;;;;;;;;;;;;;;oBAkB5B,MAAM;0BACA,MAAM;;;eAGjB,IAAI;;;uCAGoB,SAAS,mBAAmB,MAAM;;;;;;;;;;;;;;;;;oBAiBrD,SAAS;eACd,IAAI;;;;;;;;;;oBAUC,EAAE;;;;;;;;;;;;;;;;eAgBP,KAAK;;;;;;;;;eASL,KAAK;;;oDAGgC,MAAM;;;;;eAK3C,KAAK;;;;;;;;;0BASM,MAAM;;;oBAGZ,MAAM;eACX,IAAI;;;uCAGoB,MAAM;uCACN,KAAK;;;;;;oBAMxB,MAAM;;;;;;;;;;;;;eAaX,MAAM;;GAElB,CAAC;AACJ,CAAC"}
@@ -1,44 +0,0 @@
1
- /**
2
- * Wallet selector modal — a self-contained, framework-agnostic UI component.
3
- *
4
- * Injected into the DOM as a Shadow DOM element to prevent style conflicts.
5
- * Inspired by WalletConnect's Web3Modal pattern.
6
- *
7
- * The modal is a single view with three zones:
8
- *
9
- * 1. **Quick connect** — a one-tap button that connects with the recommended
10
- * (first) wallet without scrolling the grid.
11
- * 2. **Wallet grid** — a scrollable grid of wallet tiles with a search filter.
12
- * Each tile renders the wallet's own favicon, falling back to a letter
13
- * badge (never a third-party favicon proxy).
14
- * 3. **Custom URL** — paste any wallet URL; it is validated against the
15
- * wallet's `/.well-known/enbox-connect` discovery document before the
16
- * selection resolves.
17
- *
18
- * @module
19
- */
20
- import type { WalletOption } from '../browser-connect-handler.js';
21
- /** Path of the wallet's connect discovery document, relative to its origin. */
22
- export declare const WALLET_WELL_KNOWN_PATH = "/.well-known/enbox-connect";
23
- /** Options controlling {@link showWalletSelector} behavior. */
24
- export interface WalletSelectorOptions {
25
- /**
26
- * Validate a pasted wallet origin before resolving with it.
27
- *
28
- * Defaults to {@link probeWalletWellKnown}, which fetches the wallet's
29
- * `/.well-known/enbox-connect` document. Injectable for testing.
30
- */
31
- validateWalletUrl?: (origin: string) => Promise<boolean>;
32
- }
33
- /**
34
- * Fetch a wallet's `/.well-known/enbox-connect` discovery document to confirm
35
- * the origin hosts an Enbox-compatible wallet.
36
- *
37
- * Resolves `true` only when the document is reachable and names a
38
- * `connectServerUrl`. Unreachable origins, non-2xx responses, CORS failures,
39
- * and malformed documents resolve `false`.
40
- */
41
- export declare function probeWalletWellKnown(origin: string): Promise<boolean>;
42
- /** Shows the wallet selector modal and resolves with the chosen wallet URL. */
43
- export declare function showWalletSelector(wallets: WalletOption[], options?: WalletSelectorOptions): Promise<string>;
44
- //# sourceMappingURL=wallet-selector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wallet-selector.d.ts","sourceRoot":"","sources":["../../../src/ui/wallet-selector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AAKnE,+DAA+D;AAC/D,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1D;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAa3E;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,YAAY,EAAE,EACvB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,MAAM,CAAC,CAiFjB"}