@lukso/transaction-view-core 0.3.1-dev.a8c9315

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 (62) hide show
  1. package/.turbo/turbo-build.log +33 -0
  2. package/CHANGELOG.md +104 -0
  3. package/LICENSE +201 -0
  4. package/README.md +264 -0
  5. package/dist/index.cjs +4573 -0
  6. package/dist/index.cjs.map +1 -0
  7. package/dist/index.d.cts +493 -0
  8. package/dist/index.d.ts +493 -0
  9. package/dist/index.js +4534 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/shared/index.cjs +2480 -0
  12. package/dist/shared/index.cjs.map +1 -0
  13. package/dist/shared/index.d.cts +887 -0
  14. package/dist/shared/index.d.ts +887 -0
  15. package/dist/shared/index.js +2437 -0
  16. package/dist/shared/index.js.map +1 -0
  17. package/dist/styles/index.cjs +58 -0
  18. package/dist/styles/index.cjs.map +1 -0
  19. package/dist/styles/index.d.cts +9 -0
  20. package/dist/styles/index.d.ts +9 -0
  21. package/dist/styles/index.js +31 -0
  22. package/dist/styles/index.js.map +1 -0
  23. package/package.json +57 -0
  24. package/publish.log +0 -0
  25. package/src/components/asset-card.ts +426 -0
  26. package/src/components/contract-card.ts +238 -0
  27. package/src/components/description-view.ts +605 -0
  28. package/src/components/index.ts +20 -0
  29. package/src/components/info-panel.ts +437 -0
  30. package/src/components/permissions-block.ts +138 -0
  31. package/src/components/transaction-playback.ts +429 -0
  32. package/src/components/universal-token-view.ts +281 -0
  33. package/src/declaration.d.ts +4 -0
  34. package/src/examples/INTEGRATION_GUIDE.md +240 -0
  35. package/src/examples/TransactionContentWithReplacement.vue +269 -0
  36. package/src/index.ts +38 -0
  37. package/src/registry/index.ts +31 -0
  38. package/src/registry/lit-view-loader.ts +191 -0
  39. package/src/shared/address-display.ts +370 -0
  40. package/src/shared/address-view.ts +385 -0
  41. package/src/shared/custom-select.ts +164 -0
  42. package/src/shared/function-name-view.ts +89 -0
  43. package/src/shared/gas-provider-view.ts +218 -0
  44. package/src/shared/icon-view.ts +288 -0
  45. package/src/shared/image-list.ts +261 -0
  46. package/src/shared/image-loader-controller.ts +160 -0
  47. package/src/shared/index.ts +34 -0
  48. package/src/shared/load-web-components.ts +56 -0
  49. package/src/shared/notification-view.ts +132 -0
  50. package/src/shared/progress-view.ts +86 -0
  51. package/src/shared/safe-custom-element.ts +35 -0
  52. package/src/shared/scroll-to-bottom-button.ts +55 -0
  53. package/src/shared/signal-controller.ts +124 -0
  54. package/src/shared/transaction-view-controller.ts +345 -0
  55. package/src/shared/url-view.ts +129 -0
  56. package/src/shared/value-view.ts +510 -0
  57. package/src/styles/index.ts +28 -0
  58. package/src/styles/styles.css +1 -0
  59. package/src/vue-entry.ts +15 -0
  60. package/tailwind.config.cjs +9 -0
  61. package/tsconfig.json +22 -0
  62. package/tsup.config.ts +90 -0
@@ -0,0 +1,887 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement, ReactiveController, ReactiveControllerHost } from 'lit';
3
+ import { CoreLitElement } from '../styles/index.cjs';
4
+ import { ImageResult, ImageLoadOptions, AddressImageData, UseTransactionViewOptions, ViewMatch } from '@lukso/transaction-view-headless';
5
+ import { Signal } from '@preact/signals-core';
6
+ import { DecoderResult } from '@lukso/transaction-decoder';
7
+
8
+ /**
9
+ * Address data interface for display
10
+ */
11
+ interface AddressData$1 {
12
+ address: string;
13
+ name?: string;
14
+ lsp4TokenName?: string;
15
+ lsp4TokenSymbol?: string;
16
+ baseAsset?: {
17
+ lsp4TokenName?: string;
18
+ lsp4TokenSymbol?: string;
19
+ };
20
+ profileImages?: any[];
21
+ avatar?: any[];
22
+ icon?: any[];
23
+ images?: any[];
24
+ __gqltype?: string;
25
+ __identity?: string;
26
+ identity?: string;
27
+ }
28
+ /**
29
+ * Universal address display component with profile resolution
30
+ *
31
+ * Displays an address with profile image and name, supporting both
32
+ * Universal Profiles and contract addresses with proper styling.
33
+ *
34
+ * @example
35
+ * ```html
36
+ * <address-display
37
+ * address="0x1234..."
38
+ * .resolved="${resolvedData}"
39
+ * size="medium"
40
+ * show-copy-button
41
+ * ></address-display>
42
+ * ```
43
+ */
44
+ declare class AddressDisplay extends LitElement {
45
+ /**
46
+ * The address to display (required)
47
+ */
48
+ value: string;
49
+ /**
50
+ * @deprecated Use `value` instead
51
+ */
52
+ address?: string;
53
+ /**
54
+ * Resolved address data (profile, images, etc.)
55
+ */
56
+ resolved?: AddressData$1;
57
+ /**
58
+ * Display size
59
+ */
60
+ size: 'x-small' | 'small' | 'medium' | 'large';
61
+ /**
62
+ * Optional label to display above the address
63
+ */
64
+ label?: string;
65
+ /**
66
+ * Whether to show the copy button
67
+ */
68
+ showCopyButton: boolean;
69
+ /**
70
+ * Whether to show the full address or just the name
71
+ */
72
+ nameOnly: boolean;
73
+ /**
74
+ * Maximum width for the name display (in pixels)
75
+ */
76
+ maxWidth: number;
77
+ /**
78
+ * Get the effective address value (supports both `value` and legacy `address` props)
79
+ */
80
+ private get effectiveAddress();
81
+ private imageData?;
82
+ private isLoadingImage;
83
+ private imageLoader;
84
+ private addressResolver;
85
+ private imageTask;
86
+ /**
87
+ * Get pixel size for the current size setting
88
+ */
89
+ private getSizePixels;
90
+ /**
91
+ * Get display name for the address
92
+ */
93
+ private getDisplayName;
94
+ /**
95
+ * Check if this is a contract address (shows square icon)
96
+ */
97
+ private get isContract();
98
+ /**
99
+ * Get prefix for the address display
100
+ */
101
+ private get addressPrefix();
102
+ /**
103
+ * Check if should show name colors
104
+ */
105
+ private get shouldShowNameColor();
106
+ /**
107
+ * Handle copy button click
108
+ */
109
+ private handleCopy;
110
+ /**
111
+ * Handle address click
112
+ */
113
+ private handleAddressClick;
114
+ render(): lit.TemplateResult<1>;
115
+ static styles: lit.CSSResult;
116
+ }
117
+ declare global {
118
+ interface HTMLElementTagNameMap {
119
+ 'address-display': AddressDisplay;
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Address text view component (text only, no image)
125
+ *
126
+ * A text-only address display component that shows name and/or address.
127
+ * Use alongside <icon-view> for complete address presentation.
128
+ *
129
+ * @example
130
+ * ```html
131
+ * <address-view
132
+ * address="0x1234..."
133
+ * size="medium"
134
+ * ></address-view>
135
+ * ```
136
+ */
137
+ declare class AddressView extends CoreLitElement {
138
+ /**
139
+ * The address to display (required)
140
+ */
141
+ address: string;
142
+ /**
143
+ * Display size
144
+ */
145
+ size: 'x-small' | 'small' | 'medium' | 'large';
146
+ /**
147
+ * Whether to show only the name (no address)
148
+ */
149
+ nameOnly: boolean;
150
+ /**
151
+ * Whether to show only the address (no name)
152
+ */
153
+ addressOnly: boolean;
154
+ /**
155
+ * Card view: render with bordered container, header label and copy button
156
+ */
157
+ isCardView: boolean;
158
+ /**
159
+ * Optional label to show in card header (only when isCardView)
160
+ */
161
+ label?: string;
162
+ /**
163
+ * Whether to show a copy button (only relevant for card view)
164
+ */
165
+ showCopyButton: boolean;
166
+ /**
167
+ * Maximum width for the display (in pixels)
168
+ */
169
+ maxWidth: number;
170
+ /**
171
+ * Whether to show the small identicon next to the name/address
172
+ */
173
+ showIdenticon: boolean;
174
+ /**
175
+ * Address text color token (e.g., "red-55")
176
+ */
177
+ addressColor?: string;
178
+ /**
179
+ * Name text color token (e.g., "blue-50")
180
+ */
181
+ nameColor?: string;
182
+ private isLoadingAddress;
183
+ private identicon?;
184
+ private addressResolver;
185
+ private addressTask;
186
+ /**
187
+ * Get the display address (first segment only for compound addresses)
188
+ * e.g., "0x123...-0x456..." becomes "0x123..."
189
+ */
190
+ private get displayAddress();
191
+ /**
192
+ * Get display name for the address
193
+ */
194
+ private getDisplayName;
195
+ /**
196
+ * Check if this is a contract address (non-profile)
197
+ */
198
+ private get isContract();
199
+ /**
200
+ * Check if this should show the address hash (profiles show hash, contracts don't)
201
+ */
202
+ private get shouldShowAddressHash();
203
+ /**
204
+ * Get prefix for the address display
205
+ */
206
+ private get addressPrefix();
207
+ /**
208
+ * Check if should show name colors
209
+ */
210
+ private get shouldShowNameColor();
211
+ /**
212
+ * Handle address click
213
+ */
214
+ private handleClick;
215
+ /** Generate identicon when address changes */
216
+ protected willUpdate(changed: Map<string, unknown>): void;
217
+ /** Copy the display address to clipboard (card view) */
218
+ private handleCopy;
219
+ /** ========== RENDER HELPERS (Use Cases) ========== */
220
+ /** Pixel size mapping for identicon based on component size */
221
+ private getIdenticonSizePx;
222
+ /**
223
+ * Render only the name (and optionally the address hash when allowed for profiles)
224
+ */
225
+ private renderNameOnly;
226
+ /**
227
+ * Render only the raw address (no name)
228
+ */
229
+ private renderAddressOnly;
230
+ /**
231
+ * Render both name and (conditionally) the address hash (profiles show hash, contracts may hide it)
232
+ */
233
+ private renderNameAndAddress;
234
+ private renderIdenticon;
235
+ /** Map size to a typography class for the label */
236
+ private getLabelClass;
237
+ private renderDisplayName;
238
+ /**
239
+ * Decide which of the three core inline variants to render
240
+ */
241
+ private renderInlineVariant;
242
+ render(): lit.TemplateResult<1>;
243
+ }
244
+ declare global {
245
+ interface HTMLElementTagNameMap {
246
+ 'address-view': AddressView;
247
+ }
248
+ }
249
+
250
+ interface SelectOption {
251
+ value: string;
252
+ label: string;
253
+ disabled: boolean;
254
+ }
255
+ declare class CustomOption extends CoreLitElement {
256
+ selected: boolean;
257
+ disabled: boolean;
258
+ hoverable: boolean;
259
+ render(): lit.TemplateResult<1>;
260
+ }
261
+ declare class CustomSelect extends CoreLitElement {
262
+ value?: string;
263
+ open: boolean;
264
+ options: SelectOption[];
265
+ size: 'x-small' | 'small' | 'medium' | 'large';
266
+ private toggleOpen;
267
+ private close;
268
+ private onOptionClick;
269
+ private onKeyDown;
270
+ private onOutsideClick;
271
+ connectedCallback(): void;
272
+ disconnectedCallback(): void;
273
+ updated(): void;
274
+ private getSelectedOption;
275
+ private getIdenticonSizePx;
276
+ private renderIdenticon;
277
+ private renderOptionLabel;
278
+ render(): lit.TemplateResult<1>;
279
+ }
280
+ declare global {
281
+ interface HTMLElementTagNameMap {
282
+ 'custom-select': CustomSelect;
283
+ 'custom-option': CustomOption;
284
+ }
285
+ }
286
+
287
+ /**
288
+ * Compact function name badge with icon
289
+ * Props:
290
+ * - label (deprecated): text to display; use default slot instead
291
+ * - icon: lukso-icon name
292
+ * - size: x-small | small | medium | large (affects paddings and font)
293
+ * - color: optional lukso-icon color token (e.g., "blue-50")
294
+ */
295
+ declare class FunctionNameView extends CoreLitElement {
296
+ /**
297
+ * Deprecated: Prefer slot content for the label. Will be used as fallback
298
+ * when no slot is provided to maintain backward compatibility.
299
+ */
300
+ label: string;
301
+ icon: string;
302
+ size: 'x-small' | 'small' | 'medium' | 'large';
303
+ color?: string;
304
+ private getPadding;
305
+ private getFontSize;
306
+ private getIconSize;
307
+ private getHeight;
308
+ render(): lit.TemplateResult<1>;
309
+ }
310
+ declare global {
311
+ interface HTMLElementTagNameMap {
312
+ 'function-name-view': FunctionNameView;
313
+ }
314
+ }
315
+
316
+ type GasProvider = {
317
+ type: 'relayer' | 'controller';
318
+ id: string;
319
+ };
320
+ type Relayer = {
321
+ id: string;
322
+ name: string;
323
+ isCustom: boolean;
324
+ apiUrl: string;
325
+ chainIds: string[];
326
+ createdAt: number;
327
+ website?: string;
328
+ };
329
+ declare class GasProviderView extends CoreLitElement {
330
+ allRelayers: Relayer[];
331
+ balance: number;
332
+ selectedGasProvider?: GasProvider;
333
+ controllerAddress?: string;
334
+ controllerName?: string;
335
+ symbol: string;
336
+ decimals: number;
337
+ transactionFee: number;
338
+ relayerAvailable: number;
339
+ relayerUsed: number;
340
+ relayerToBeUsed: number;
341
+ relayerResetDate: string;
342
+ private formatToken;
343
+ private onSelectChanged;
344
+ private renderProgress;
345
+ private renderControllerProgress;
346
+ private renderRelayerProgress;
347
+ private displayRelayerResetDate;
348
+ render(): lit.TemplateResult<1>;
349
+ }
350
+ declare global {
351
+ interface HTMLElementTagNameMap {
352
+ 'gas-provider-view': GasProviderView;
353
+ }
354
+ }
355
+
356
+ /**
357
+ * Address data interface for display
358
+ */
359
+ interface AddressData {
360
+ address: string;
361
+ name?: string;
362
+ lsp4TokenName?: string;
363
+ lsp4TokenSymbol?: string;
364
+ baseAsset?: {
365
+ lsp4TokenName?: string;
366
+ lsp4TokenSymbol?: string;
367
+ };
368
+ profileImages?: any[];
369
+ avatar?: any[];
370
+ icon?: any[];
371
+ images?: any[];
372
+ __gqltype?: string;
373
+ __identity?: string;
374
+ identity?: string;
375
+ }
376
+ /**
377
+ * Icon/Avatar display component for addresses
378
+ *
379
+ * Displays just the profile image/avatar for an address with proper styling.
380
+ * Supports both Universal Profiles and contract addresses.
381
+ *
382
+ * @example
383
+ * ```html
384
+ * <icon-view
385
+ * address="0x1234..."
386
+ * .resolved="${resolvedData}"
387
+ * size="medium"
388
+ * ></icon-view>
389
+ * ```
390
+ */
391
+ declare class IconView extends CoreLitElement {
392
+ /**
393
+ * The address to display (required)
394
+ */
395
+ address: string;
396
+ /**
397
+ * Resolved address data (profile, images, etc.)
398
+ */
399
+ resolved?: AddressData;
400
+ /**
401
+ * Display size
402
+ */
403
+ size: 'x-small' | 'small' | 'medium' | 'large' | '2x-large';
404
+ /**
405
+ * Optional label to display above the icon
406
+ */
407
+ label?: string;
408
+ /**
409
+ * Whether to show the resolved display name below/beside the icon
410
+ */
411
+ showName: boolean;
412
+ /**
413
+ * Name placement relative to the icon: 'below' (stacked) or 'beside' (inline)
414
+ */
415
+ namePosition: 'below' | 'beside';
416
+ /**
417
+ * Maximum width for the name label (pixels)
418
+ */
419
+ maxWidth: number;
420
+ /**
421
+ * Whether to show small identicon badge on the avatar
422
+ */
423
+ showIconIdenticon: boolean;
424
+ /**
425
+ * Whether to show small identicon badge on the label
426
+ */
427
+ showLabelIdenticon: boolean;
428
+ /**
429
+ * Force unresolved display (for testing)
430
+ */
431
+ forceUnresolved: boolean;
432
+ /**
433
+ * Property name to use for loading images (e.g., 'images', 'icons', 'profileImages')
434
+ * If not set, uses default image loading logic
435
+ */
436
+ imageHint?: string;
437
+ /**
438
+ * Index to use when loading from an image array (e.g., images[0])
439
+ * Only used when imageHint points to an array property
440
+ */
441
+ imageIndex?: number;
442
+ private imageData?;
443
+ private isLoadingImage;
444
+ private isLoadingAddress;
445
+ private imageLoader;
446
+ private addressResolver;
447
+ private addressTask;
448
+ private imageTask;
449
+ /**
450
+ * Get pixel size for the current size setting
451
+ */
452
+ private getSizePixels;
453
+ /**
454
+ * Check if this is a contract address (shows square icon)
455
+ */
456
+ private get isContract();
457
+ /**
458
+ * Handle icon click
459
+ */
460
+ private handleClick;
461
+ render(): lit.TemplateResult<1>;
462
+ }
463
+ declare global {
464
+ interface HTMLElementTagNameMap {
465
+ 'icon-view': IconView;
466
+ }
467
+ }
468
+
469
+ /**
470
+ * Lit controller state for image loading
471
+ */
472
+ interface ImageLoadState {
473
+ result: ImageResult | null;
474
+ loading: boolean;
475
+ error: string | null;
476
+ }
477
+ /**
478
+ * Lit Reactive Controller for image loading functionality
479
+ * Integrates the headless image loader with Lit elements
480
+ */
481
+ declare class ImageLoaderController implements ReactiveController {
482
+ private host;
483
+ private headlessLoader;
484
+ private _state;
485
+ constructor(host: ReactiveControllerHost);
486
+ hostConnected(): void;
487
+ hostDisconnected(): void;
488
+ get state(): ImageLoadState;
489
+ get isLoading(): boolean;
490
+ get error(): string | null;
491
+ get result(): ImageResult | null;
492
+ /**
493
+ * Load image from data array
494
+ */
495
+ loadImage(imageData: any[], options?: ImageLoadOptions): Promise<ImageResult | null>;
496
+ /**
497
+ * Load profile image from address data
498
+ */
499
+ loadProfileImage(addressData: AddressImageData, options?: ImageLoadOptions): Promise<ImageResult | null>;
500
+ /**
501
+ * Load image from address signal (reactive)
502
+ */
503
+ loadFromSignal(addressSignal: Signal<{
504
+ data?: AddressImageData;
505
+ }>, options?: ImageLoadOptions): void;
506
+ /**
507
+ * Get fallback image synchronously
508
+ */
509
+ getFallbackImage(addressData: AddressImageData): ImageResult;
510
+ /**
511
+ * Check if address is a contract
512
+ */
513
+ isContractAddress(addressData: AddressImageData): boolean;
514
+ /**
515
+ * Clear current state
516
+ */
517
+ clear(): void;
518
+ private updateState;
519
+ }
520
+ /**
521
+ * Utility function to create an image loader controller
522
+ */
523
+ declare function useImageLoader(host: ReactiveControllerHost): ImageLoaderController;
524
+
525
+ declare class NotificationView extends CoreLitElement {
526
+ /** Variant controls background/emphasis */
527
+ variant: 'success' | 'warning' | 'error' | 'info';
528
+ /** Notification message content */
529
+ message: string;
530
+ /** Optional title shown above the description */
531
+ title: string;
532
+ /** Whether the acknowledge button is shown */
533
+ acknowledgeable: boolean;
534
+ /** Text shown next to acknowledge checkbox */
535
+ acknowledgeText: string;
536
+ /** Internal acknowledged state (for default behavior) */
537
+ private acknowledged;
538
+ /** External control for acknowledge checkbox */
539
+ checked: boolean;
540
+ private handleAcknowledgeChange;
541
+ render(): lit.TemplateResult<1>;
542
+ private renderIcon;
543
+ private getVariantColor;
544
+ private getVariantBackgroundClass;
545
+ }
546
+ declare global {
547
+ interface HTMLElementTagNameMap {
548
+ 'notification-view': NotificationView;
549
+ }
550
+ }
551
+
552
+ type ProgressSegment = {
553
+ value: number;
554
+ color?: string;
555
+ title?: string;
556
+ };
557
+ declare class ProgressView extends CoreLitElement {
558
+ data: ProgressSegment[];
559
+ label?: string;
560
+ unit?: string;
561
+ address?: string;
562
+ labelPosition: 'left' | 'right';
563
+ private renderGasProviderLabel;
564
+ private renderAddressLabel;
565
+ render(): lit.TemplateResult<1>;
566
+ }
567
+ declare global {
568
+ interface HTMLElementTagNameMap {
569
+ 'progress-view': ProgressView;
570
+ }
571
+ }
572
+
573
+ /**
574
+ * ScrollToBottomButton (core) - reusable scroll helper.
575
+ * Emits `scroll-to-bottom` when clicked.
576
+ */
577
+ declare class ScrollToBottomButton extends CoreLitElement {
578
+ /** Controls visibility */
579
+ show: boolean;
580
+ /** Icon color (CSS var or token) */
581
+ color: string;
582
+ /** Icon size token */
583
+ iconSize: 'x-small' | 'small' | 'medium' | 'large';
584
+ /** Icon name (attribute: icon-name) */
585
+ iconName: string;
586
+ private handleClick;
587
+ render(): lit.TemplateResult<1>;
588
+ }
589
+ declare global {
590
+ interface HTMLElementTagNameMap {
591
+ 'scroll-to-bottom-button': ScrollToBottomButton;
592
+ }
593
+ }
594
+
595
+ /**
596
+ * Lit Reactive Controller for @preact/signals-core integration
597
+ * This controller allows Lit elements to reactively update when signals change
598
+ */
599
+ declare class SignalController<T = any> implements ReactiveController {
600
+ private host;
601
+ private signal;
602
+ private unsubscribe?;
603
+ constructor(host: ReactiveControllerHost, signal: Signal<T>);
604
+ hostConnected(): void;
605
+ hostDisconnected(): void;
606
+ get value(): T;
607
+ /**
608
+ * Create a new SignalController for a different signal
609
+ */
610
+ static create<U>(host: ReactiveControllerHost, signal: Signal<U>): SignalController<U>;
611
+ }
612
+ /**
613
+ * Lit Reactive Controller for multiple signals
614
+ * Updates the host when any of the tracked signals change
615
+ */
616
+ declare class MultiSignalController implements ReactiveController {
617
+ private host;
618
+ private signals;
619
+ private unsubscribes;
620
+ constructor(host: ReactiveControllerHost, signals: Signal<any>[]);
621
+ hostConnected(): void;
622
+ hostDisconnected(): void;
623
+ getValue(index: number): any;
624
+ getValues(): any[];
625
+ }
626
+ /**
627
+ * Utility function to create a signal controller
628
+ */
629
+ declare function useSignal<T>(host: ReactiveControllerHost, signal: Signal<T>): SignalController<T>;
630
+ /**
631
+ * Utility function to create a multi-signal controller
632
+ */
633
+ declare function useSignals(host: ReactiveControllerHost, signals: Signal<any>[]): MultiSignalController;
634
+
635
+ /**
636
+ * Lit controller state for transaction view
637
+ */
638
+ interface TransactionViewState {
639
+ matches: ViewMatch[];
640
+ bestMatch: ViewMatch | null;
641
+ component: any;
642
+ loading: boolean;
643
+ error: Error | null;
644
+ isResolvingAddresses: boolean;
645
+ resolvedAddresses: Record<string, any>;
646
+ }
647
+ /**
648
+ * Lit Reactive Controller for transaction view functionality
649
+ * Integrates the headless transaction view system with Lit elements
650
+ */
651
+ declare class TransactionViewController implements ReactiveController {
652
+ private transaction;
653
+ private options;
654
+ private host;
655
+ private headlessInstance;
656
+ private _state;
657
+ private syncInterval?;
658
+ constructor(host: ReactiveControllerHost, transaction: DecoderResult, options: UseTransactionViewOptions);
659
+ hostConnected(): void;
660
+ hostDisconnected(): void;
661
+ get state(): TransactionViewState;
662
+ get matches(): ViewMatch[];
663
+ get bestMatch(): ViewMatch | null;
664
+ get component(): any;
665
+ get isLoading(): boolean;
666
+ get error(): Error | null;
667
+ get isResolvingAddresses(): boolean;
668
+ get resolvedAddresses(): Record<string, any>;
669
+ /**
670
+ * Load a specific match
671
+ */
672
+ loadMatch(match: ViewMatch): Promise<any>;
673
+ /**
674
+ * Load the best match
675
+ */
676
+ loadBestMatch(): Promise<any>;
677
+ /**
678
+ * Refresh matches
679
+ */
680
+ refreshMatches(): void;
681
+ /**
682
+ * Resolve addresses
683
+ */
684
+ resolveAddresses(): Promise<void>;
685
+ /**
686
+ * Update transaction and options
687
+ */
688
+ update(transaction: DecoderResult, options: UseTransactionViewOptions): void;
689
+ /**
690
+ * Get the best matching view without loading
691
+ */
692
+ static findBestMatch(transaction: DecoderResult, framework?: 'lit' | 'rn'): ViewMatch | null;
693
+ /**
694
+ * Get all matching views without loading
695
+ */
696
+ static findAllMatches(transaction: DecoderResult, framework?: 'lit' | 'rn'): ViewMatch[];
697
+ private initialize;
698
+ private setupSync;
699
+ private syncState;
700
+ private updateState;
701
+ }
702
+ /**
703
+ * Utility function to create a transaction view controller
704
+ */
705
+ declare function useTransactionView(host: ReactiveControllerHost, transaction: DecoderResult, options: UseTransactionViewOptions): TransactionViewController;
706
+ /**
707
+ * Controller for working with transaction signals from the decoder
708
+ */
709
+ declare class TransactionSignalController<T = any> implements ReactiveController {
710
+ private host;
711
+ private signal;
712
+ private unsubscribe?;
713
+ private _data;
714
+ private _loading;
715
+ private _error;
716
+ constructor(host: ReactiveControllerHost, signal: Signal<{
717
+ data: DecoderResult;
718
+ loading: boolean;
719
+ error?: string;
720
+ }>);
721
+ hostConnected(): void;
722
+ hostDisconnected(): void;
723
+ get data(): DecoderResult | null;
724
+ get loading(): boolean;
725
+ get error(): string | null;
726
+ get isReady(): boolean;
727
+ private setupSignalSync;
728
+ }
729
+ /**
730
+ * Utility function to create a transaction signal controller
731
+ */
732
+ declare function useTransactionSignal(host: ReactiveControllerHost, signal: Signal<{
733
+ data: DecoderResult;
734
+ loading: boolean;
735
+ error?: string;
736
+ }>): TransactionSignalController;
737
+
738
+ /**
739
+ * UrlView - display a URL with favicon/logo and human-friendly name
740
+ *
741
+ * Props:
742
+ * - url (required): full URL like https://example.com/path
743
+ * - size: x-small | small | medium | large
744
+ * - label?: optional label displayed above
745
+ * - showLogo: whether to show favicon/logo (default true)
746
+ * - logoUrl?: explicit logo URL to use instead of favicon
747
+ * - maxWidth: name truncation width in px
748
+ */
749
+ declare class UrlView extends CoreLitElement {
750
+ url: string;
751
+ size: 'x-small' | 'small' | 'medium' | 'large';
752
+ label?: string;
753
+ showLogo: boolean;
754
+ logoUrl?: string;
755
+ maxWidth: number;
756
+ private favicon?;
757
+ private displayName;
758
+ private faviconCandidates;
759
+ private faviconIndex;
760
+ protected willUpdate(changed: Map<string, unknown>): void;
761
+ private computeMeta;
762
+ private handleImageError;
763
+ private getSizePixels;
764
+ render(): lit.TemplateResult<1>;
765
+ }
766
+ declare global {
767
+ interface HTMLElementTagNameMap {
768
+ 'url-view': UrlView;
769
+ }
770
+ }
771
+
772
+ /**
773
+ * Value display component
774
+ *
775
+ * Displays various types of values with appropriate formatting and styling.
776
+ * Supports numbers, strings, booleans, BigInt values, and special handling
777
+ * for Ethereum values with currency symbols.
778
+ *
779
+ * @example
780
+ * ```html
781
+ * <value-view
782
+ * value="1000000000000000000"
783
+ * type="currency"
784
+ * currency-symbol="LYX"
785
+ * decimals="18"
786
+ * ></value-view>
787
+ * ```
788
+ */
789
+ declare class ValueView extends CoreLitElement {
790
+ /**
791
+ * The value to display (required)
792
+ * Can be string, number, boolean, or bigint
793
+ */
794
+ value?: string | number | boolean | bigint | null;
795
+ /**
796
+ * The key name (used for special formatting logic)
797
+ */
798
+ keyName?: string;
799
+ containerClassNames?: string;
800
+ /**
801
+ * Value type for formatting
802
+ */
803
+ type: 'string' | 'number' | 'boolean' | 'currency' | 'bigint' | 'address' | 'auto';
804
+ /**
805
+ * Currency symbol for currency type
806
+ */
807
+ currencySymbol: string;
808
+ /**
809
+ * Number of decimals for currency formatting
810
+ */
811
+ decimals: number;
812
+ /**
813
+ * Display size
814
+ */
815
+ size: 'x-small' | 'small' | 'medium' | 'large';
816
+ /**
817
+ * Whether to show copy button
818
+ */
819
+ showCopyButton: boolean;
820
+ /**
821
+ * Render as a card with bordered container and label
822
+ */
823
+ isCardView: boolean;
824
+ /**
825
+ * Optional label to show in card header
826
+ */
827
+ label?: string;
828
+ /**
829
+ * Maximum width for truncation
830
+ */
831
+ maxWidth?: number;
832
+ /**
833
+ * Token/contract address for automatic metadata resolution
834
+ * When provided, ValueView will automatically resolve token symbol and decimals
835
+ */
836
+ address?: string;
837
+ private resolvedMetadata?;
838
+ private _hasSlotContent;
839
+ private _onSlotChange;
840
+ protected firstUpdated(): void;
841
+ private get addressResolver();
842
+ private addressTask;
843
+ /**
844
+ * Get the effective type for the value
845
+ */
846
+ private getEffectiveType;
847
+ /**
848
+ * Get CSS class for the value type
849
+ */
850
+ private getValueClass;
851
+ /**
852
+ * Format the value for display
853
+ */
854
+ private getFormattedValue;
855
+ /**
856
+ * Compute currency display parts: numeric portion and symbol
857
+ */
858
+ private getCurrencyParts;
859
+ /** Typography class for numeric value based on size */
860
+ private getNumericClass;
861
+ /** Typography class for currency symbol based on size */
862
+ private getCurrencyClass;
863
+ /**
864
+ * Get size-appropriate font size
865
+ */
866
+ private getContainerTextClass;
867
+ /**
868
+ * Handle copy to clipboard
869
+ */
870
+ private handleCopy;
871
+ /**
872
+ * Handle value click
873
+ */
874
+ private handleClick;
875
+ render(): lit.TemplateResult<1>;
876
+ /** Whether to use monospace font for the value content */
877
+ private getUseMonospace;
878
+ /** Map size to a typography class for the label */
879
+ private getLabelClass;
880
+ }
881
+ declare global {
882
+ interface HTMLElementTagNameMap {
883
+ 'value-view': ValueView;
884
+ }
885
+ }
886
+
887
+ export { type AddressData$1 as AddressData, AddressDisplay, AddressView, CustomOption, CustomSelect, FunctionNameView, GasProviderView, IconView, type ImageLoadState, ImageLoaderController, MultiSignalController, NotificationView, type ProgressSegment, ProgressView, ScrollToBottomButton, type SelectOption, SignalController, TransactionSignalController, TransactionViewController, type TransactionViewState, UrlView, ValueView, useImageLoader, useSignal, useSignals, useTransactionSignal, useTransactionView };