@sip-protocol/react 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -14
- package/dist/index.d.mts +1224 -6
- package/dist/index.d.ts +1224 -6
- package/dist/index.js +5783 -10
- package/dist/index.mjs +5777 -9
- package/package.json +9 -8
- package/src/components/ethereum/index.ts +55 -0
- package/src/components/ethereum/privacy-toggle.tsx +822 -0
- package/src/components/ethereum/stealth-address-display.tsx +1050 -0
- package/src/components/ethereum/transaction-history.tsx +1187 -0
- package/src/components/ethereum/transaction-tracker.tsx +302 -0
- package/src/components/ethereum/viewing-key-manager.tsx +228 -0
- package/src/components/index.ts +107 -0
- package/src/components/privacy-toggle.tsx +548 -0
- package/src/components/stealth-address-display.tsx +770 -0
- package/src/components/transaction-history.tsx +651 -0
- package/src/components/transaction-tracker.tsx +1079 -0
- package/src/components/viewing-key-manager.tsx +1576 -0
- package/src/hooks/index.ts +61 -0
- package/src/hooks/use-privacy-advisor.ts +371 -0
- package/src/hooks/use-private-swap.ts +5 -5
- package/src/hooks/use-proof-composition.ts +654 -0
- package/src/hooks/use-scan-payments.ts +504 -0
- package/src/hooks/use-stealth-address.ts +23 -7
- package/src/hooks/use-stealth-transfer.ts +284 -0
- package/src/hooks/use-transaction-history.ts +435 -0
- package/src/index.ts +75 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import * as _sip_protocol_sdk from '@sip-protocol/sdk';
|
|
3
3
|
import { SIPConfig, SIP } from '@sip-protocol/sdk';
|
|
4
|
-
import { ChainId, Quote, PrivacyLevel, ViewingKey, EncryptedTransaction } from '@sip-protocol/types';
|
|
4
|
+
import { ChainId, Quote, PrivacyLevel as PrivacyLevel$1, ViewingKey as ViewingKey$1, EncryptedTransaction, HexString } from '@sip-protocol/types';
|
|
5
5
|
|
|
6
6
|
interface SIPProviderProps {
|
|
7
7
|
config: SIPConfig;
|
|
@@ -198,8 +198,10 @@ declare function useStealthAddress(chain: ChainId): {
|
|
|
198
198
|
metaAddress: string | null;
|
|
199
199
|
stealthAddress: string | null;
|
|
200
200
|
isGenerating: boolean;
|
|
201
|
+
error: Error | null;
|
|
201
202
|
regenerate: () => void;
|
|
202
203
|
copyToClipboard: () => Promise<void>;
|
|
204
|
+
clearError: () => void;
|
|
203
205
|
};
|
|
204
206
|
|
|
205
207
|
/**
|
|
@@ -221,7 +223,7 @@ interface QuoteParams {
|
|
|
221
223
|
/** Input amount (as string, in smallest unit) */
|
|
222
224
|
inputAmount: string;
|
|
223
225
|
/** Privacy level (optional) */
|
|
224
|
-
privacyLevel?: PrivacyLevel;
|
|
226
|
+
privacyLevel?: PrivacyLevel$1;
|
|
225
227
|
/** Maximum acceptable slippage (0-1, e.g. 0.01 = 1%) */
|
|
226
228
|
maxSlippage?: number;
|
|
227
229
|
}
|
|
@@ -242,7 +244,7 @@ interface SwapParams {
|
|
|
242
244
|
minAmount: bigint;
|
|
243
245
|
};
|
|
244
246
|
/** Privacy level */
|
|
245
|
-
privacyLevel: PrivacyLevel;
|
|
247
|
+
privacyLevel: PrivacyLevel$1;
|
|
246
248
|
/** Maximum acceptable slippage (0-1, e.g. 0.01 = 1%) */
|
|
247
249
|
maxSlippage?: number;
|
|
248
250
|
}
|
|
@@ -390,15 +392,1231 @@ interface AuditorShare {
|
|
|
390
392
|
*/
|
|
391
393
|
declare function useViewingKey(): {
|
|
392
394
|
/** Current viewing key (null if not generated) */
|
|
393
|
-
viewingKey: ViewingKey | null;
|
|
395
|
+
viewingKey: ViewingKey$1 | null;
|
|
394
396
|
/** List of auditors who have been given access */
|
|
395
397
|
sharedWith: AuditorShare[];
|
|
396
398
|
/** Generate a new viewing key */
|
|
397
|
-
generate: (path?: string) => ViewingKey;
|
|
399
|
+
generate: (path?: string) => ViewingKey$1;
|
|
398
400
|
/** Decrypt encrypted transaction data */
|
|
399
401
|
decrypt: (encrypted: EncryptedTransaction) => Promise<_sip_protocol_sdk.TransactionData>;
|
|
400
402
|
/** Share viewing key with an auditor */
|
|
401
403
|
share: (auditorId: string) => Promise<void>;
|
|
402
404
|
};
|
|
403
405
|
|
|
404
|
-
|
|
406
|
+
/**
|
|
407
|
+
* Privacy level options
|
|
408
|
+
*/
|
|
409
|
+
type PrivacyLevel = 'off' | 'shielded' | 'compliant';
|
|
410
|
+
/**
|
|
411
|
+
* Gas estimate for different privacy levels
|
|
412
|
+
*/
|
|
413
|
+
interface GasEstimate {
|
|
414
|
+
/** Gas in native units (e.g., yoctoNEAR, gwei) */
|
|
415
|
+
gas: string;
|
|
416
|
+
/** Formatted cost in native token */
|
|
417
|
+
cost: string;
|
|
418
|
+
/** Formatted cost in USD (optional) */
|
|
419
|
+
costUsd?: string;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Privacy level metadata
|
|
423
|
+
*/
|
|
424
|
+
interface PrivacyLevelInfo {
|
|
425
|
+
level: PrivacyLevel;
|
|
426
|
+
label: string;
|
|
427
|
+
description: string;
|
|
428
|
+
icon: React.ReactNode;
|
|
429
|
+
gasEstimate?: GasEstimate;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* PrivacyToggle component props
|
|
433
|
+
*/
|
|
434
|
+
interface PrivacyToggleProps {
|
|
435
|
+
/** Current privacy level (controlled mode) */
|
|
436
|
+
value?: PrivacyLevel;
|
|
437
|
+
/** Default privacy level (uncontrolled mode) */
|
|
438
|
+
defaultValue?: PrivacyLevel;
|
|
439
|
+
/** Callback when privacy level changes */
|
|
440
|
+
onChange?: (level: PrivacyLevel) => void;
|
|
441
|
+
/** Whether the toggle is disabled */
|
|
442
|
+
disabled?: boolean;
|
|
443
|
+
/** Gas estimates for each level */
|
|
444
|
+
gasEstimates?: Partial<Record<PrivacyLevel, GasEstimate>>;
|
|
445
|
+
/** Show gas/fee difference */
|
|
446
|
+
showGasEstimate?: boolean;
|
|
447
|
+
/** Show tooltips */
|
|
448
|
+
showTooltips?: boolean;
|
|
449
|
+
/** Custom class name */
|
|
450
|
+
className?: string;
|
|
451
|
+
/** Size variant */
|
|
452
|
+
size?: 'sm' | 'md' | 'lg';
|
|
453
|
+
/** Chain identifier for context */
|
|
454
|
+
chain?: string;
|
|
455
|
+
/** Aria label for the toggle group */
|
|
456
|
+
'aria-label'?: string;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* PrivacyToggle - Toggle component for selecting privacy level
|
|
460
|
+
*
|
|
461
|
+
* A three-state toggle for controlling transaction privacy on NEAR and other chains.
|
|
462
|
+
* Supports controlled and uncontrolled modes, accessibility features, and gas estimates.
|
|
463
|
+
*
|
|
464
|
+
* @example Basic usage
|
|
465
|
+
* ```tsx
|
|
466
|
+
* import { PrivacyToggle } from '@sip-protocol/react'
|
|
467
|
+
*
|
|
468
|
+
* function SendForm() {
|
|
469
|
+
* const [privacy, setPrivacy] = useState<PrivacyLevel>('shielded')
|
|
470
|
+
*
|
|
471
|
+
* return (
|
|
472
|
+
* <PrivacyToggle
|
|
473
|
+
* value={privacy}
|
|
474
|
+
* onChange={setPrivacy}
|
|
475
|
+
* />
|
|
476
|
+
* )
|
|
477
|
+
* }
|
|
478
|
+
* ```
|
|
479
|
+
*
|
|
480
|
+
* @example With gas estimates
|
|
481
|
+
* ```tsx
|
|
482
|
+
* <PrivacyToggle
|
|
483
|
+
* value={privacy}
|
|
484
|
+
* onChange={setPrivacy}
|
|
485
|
+
* showGasEstimate
|
|
486
|
+
* gasEstimates={{
|
|
487
|
+
* off: { gas: '2500000000000', cost: '0.00025 NEAR' },
|
|
488
|
+
* shielded: { gas: '30000000000000', cost: '0.003 NEAR' },
|
|
489
|
+
* compliant: { gas: '35000000000000', cost: '0.0035 NEAR' },
|
|
490
|
+
* }}
|
|
491
|
+
* />
|
|
492
|
+
* ```
|
|
493
|
+
*
|
|
494
|
+
* @example Uncontrolled mode
|
|
495
|
+
* ```tsx
|
|
496
|
+
* <PrivacyToggle
|
|
497
|
+
* defaultValue="shielded"
|
|
498
|
+
* onChange={(level) => console.log('Selected:', level)}
|
|
499
|
+
* />
|
|
500
|
+
* ```
|
|
501
|
+
*/
|
|
502
|
+
declare function PrivacyToggle({ value, defaultValue, onChange, disabled, gasEstimates, showGasEstimate, showTooltips, className, size, chain, 'aria-label': ariaLabel, }: PrivacyToggleProps): React.JSX.Element;
|
|
503
|
+
/**
|
|
504
|
+
* Hook to use with PrivacyToggle for managing privacy state
|
|
505
|
+
*/
|
|
506
|
+
declare function usePrivacyToggle(initialValue?: PrivacyLevel): {
|
|
507
|
+
privacyLevel: PrivacyLevel;
|
|
508
|
+
setPrivacyLevel: React.Dispatch<React.SetStateAction<PrivacyLevel>>;
|
|
509
|
+
isPrivate: boolean;
|
|
510
|
+
isCompliant: boolean;
|
|
511
|
+
isShielded: boolean;
|
|
512
|
+
setPublic: () => void;
|
|
513
|
+
setShielded: () => void;
|
|
514
|
+
setCompliant: () => void;
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Ownership status for stealth addresses
|
|
519
|
+
*/
|
|
520
|
+
type OwnershipStatus = 'yours' | 'others' | 'unknown';
|
|
521
|
+
/**
|
|
522
|
+
* Network configuration for explorer links
|
|
523
|
+
*/
|
|
524
|
+
interface NetworkConfig {
|
|
525
|
+
name: string;
|
|
526
|
+
explorerUrl: string;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Default NEAR network configurations
|
|
530
|
+
*/
|
|
531
|
+
declare const NEAR_NETWORKS: Record<string, NetworkConfig>;
|
|
532
|
+
/**
|
|
533
|
+
* StealthAddressDisplay component props
|
|
534
|
+
*/
|
|
535
|
+
interface StealthAddressDisplayProps {
|
|
536
|
+
/** The stealth address to display (64-char hex or implicit account) */
|
|
537
|
+
address: string;
|
|
538
|
+
/** Optional stealth meta-address for QR code (full sip: format) */
|
|
539
|
+
metaAddress?: string;
|
|
540
|
+
/** Ownership status of the address */
|
|
541
|
+
ownership?: OwnershipStatus;
|
|
542
|
+
/** Whether the address is validated */
|
|
543
|
+
isValid?: boolean;
|
|
544
|
+
/** Network for explorer links */
|
|
545
|
+
network?: 'mainnet' | 'testnet';
|
|
546
|
+
/** Custom network configuration */
|
|
547
|
+
networkConfig?: NetworkConfig;
|
|
548
|
+
/** Whether to show the QR code button */
|
|
549
|
+
showQrCode?: boolean;
|
|
550
|
+
/** Whether to show the explorer link */
|
|
551
|
+
showExplorerLink?: boolean;
|
|
552
|
+
/** Whether to show the copy button */
|
|
553
|
+
showCopyButton?: boolean;
|
|
554
|
+
/** Whether to show the ownership badge */
|
|
555
|
+
showOwnership?: boolean;
|
|
556
|
+
/** Whether to show the validation indicator */
|
|
557
|
+
showValidation?: boolean;
|
|
558
|
+
/** Custom class name */
|
|
559
|
+
className?: string;
|
|
560
|
+
/** Size variant */
|
|
561
|
+
size?: 'sm' | 'md' | 'lg';
|
|
562
|
+
/** Callback when address is copied */
|
|
563
|
+
onCopy?: (address: string) => void;
|
|
564
|
+
/** Callback when QR code is shown */
|
|
565
|
+
onShowQr?: (address: string) => void;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Validates a NEAR stealth address format
|
|
569
|
+
*/
|
|
570
|
+
declare function isValidStealthAddress(address: string): boolean;
|
|
571
|
+
/**
|
|
572
|
+
* Truncates an address for display
|
|
573
|
+
*/
|
|
574
|
+
declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
|
|
575
|
+
/**
|
|
576
|
+
* StealthAddressDisplay - Component for displaying NEAR stealth addresses
|
|
577
|
+
*
|
|
578
|
+
* Displays stealth addresses with visual distinction from regular NEAR addresses,
|
|
579
|
+
* including copy functionality, explorer links, and QR code generation.
|
|
580
|
+
*
|
|
581
|
+
* @example Basic usage
|
|
582
|
+
* ```tsx
|
|
583
|
+
* import { StealthAddressDisplay } from '@sip-protocol/react'
|
|
584
|
+
*
|
|
585
|
+
* function WalletView() {
|
|
586
|
+
* return (
|
|
587
|
+
* <StealthAddressDisplay
|
|
588
|
+
* address="a1b2c3d4e5f6..."
|
|
589
|
+
* ownership="yours"
|
|
590
|
+
* />
|
|
591
|
+
* )
|
|
592
|
+
* }
|
|
593
|
+
* ```
|
|
594
|
+
*
|
|
595
|
+
* @example With meta-address for QR
|
|
596
|
+
* ```tsx
|
|
597
|
+
* <StealthAddressDisplay
|
|
598
|
+
* address="a1b2c3d4e5f6..."
|
|
599
|
+
* metaAddress="sip:near:0x02abc...123:0x03def...456"
|
|
600
|
+
* showQrCode
|
|
601
|
+
* showExplorerLink
|
|
602
|
+
* network="mainnet"
|
|
603
|
+
* />
|
|
604
|
+
* ```
|
|
605
|
+
*/
|
|
606
|
+
declare function StealthAddressDisplay({ address, metaAddress, ownership, isValid, network, networkConfig, showQrCode, showExplorerLink, showCopyButton, showOwnership, showValidation, className, size, onCopy, onShowQr, }: StealthAddressDisplayProps): React.JSX.Element;
|
|
607
|
+
/**
|
|
608
|
+
* Hook to manage stealth address display state
|
|
609
|
+
*/
|
|
610
|
+
declare function useStealthAddressDisplay(address: string, options?: {
|
|
611
|
+
checkOwnership?: (address: string) => OwnershipStatus;
|
|
612
|
+
validateAddress?: (address: string) => boolean;
|
|
613
|
+
}): {
|
|
614
|
+
address: string;
|
|
615
|
+
truncated: string;
|
|
616
|
+
ownership: OwnershipStatus;
|
|
617
|
+
isValid: boolean;
|
|
618
|
+
isStealth: boolean;
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Transaction status types
|
|
623
|
+
*/
|
|
624
|
+
type TransactionStatus = 'pending' | 'processing' | 'confirmed' | 'finalized' | 'failed' | 'cancelled';
|
|
625
|
+
/**
|
|
626
|
+
* Privacy-specific verification status
|
|
627
|
+
*/
|
|
628
|
+
type PrivacyVerificationStatus = 'pending' | 'verified' | 'failed' | 'not_applicable';
|
|
629
|
+
/**
|
|
630
|
+
* Transaction action types
|
|
631
|
+
*/
|
|
632
|
+
type TransactionActionType = 'transfer' | 'stealth_transfer' | 'function_call' | 'create_account' | 'stake' | 'unstake';
|
|
633
|
+
/**
|
|
634
|
+
* Transaction action
|
|
635
|
+
*/
|
|
636
|
+
interface TransactionAction {
|
|
637
|
+
type: TransactionActionType;
|
|
638
|
+
receiver: string;
|
|
639
|
+
amount?: string;
|
|
640
|
+
methodName?: string;
|
|
641
|
+
args?: Record<string, unknown>;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Privacy verification details
|
|
645
|
+
*/
|
|
646
|
+
interface PrivacyVerification {
|
|
647
|
+
stealthAddressResolved: PrivacyVerificationStatus;
|
|
648
|
+
commitmentVerified: PrivacyVerificationStatus;
|
|
649
|
+
viewingKeyGenerated: PrivacyVerificationStatus;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Transaction details
|
|
653
|
+
*/
|
|
654
|
+
interface PrivacyTransaction {
|
|
655
|
+
/** Transaction hash */
|
|
656
|
+
hash: string;
|
|
657
|
+
/** Transaction status */
|
|
658
|
+
status: TransactionStatus;
|
|
659
|
+
/** Block number (null if pending) */
|
|
660
|
+
blockHeight?: number;
|
|
661
|
+
/** Number of confirmations */
|
|
662
|
+
confirmations: number;
|
|
663
|
+
/** Required confirmations for finality */
|
|
664
|
+
requiredConfirmations: number;
|
|
665
|
+
/** Timestamp of transaction (ms) */
|
|
666
|
+
timestamp: number;
|
|
667
|
+
/** Sender account */
|
|
668
|
+
sender: string;
|
|
669
|
+
/** Receiver account or stealth address */
|
|
670
|
+
receiver: string;
|
|
671
|
+
/** Whether receiver is a stealth address */
|
|
672
|
+
isStealthReceiver: boolean;
|
|
673
|
+
/** Amount transferred (in native token units) */
|
|
674
|
+
amount?: string;
|
|
675
|
+
/** Gas used */
|
|
676
|
+
gasUsed?: string;
|
|
677
|
+
/** Transaction fee */
|
|
678
|
+
fee?: string;
|
|
679
|
+
/** Transaction actions */
|
|
680
|
+
actions: TransactionAction[];
|
|
681
|
+
/** Privacy verification status */
|
|
682
|
+
privacyVerification?: PrivacyVerification;
|
|
683
|
+
/** Error message if failed */
|
|
684
|
+
errorMessage?: string;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* TransactionTracker component props
|
|
688
|
+
*/
|
|
689
|
+
interface TransactionTrackerProps {
|
|
690
|
+
/** Transaction data */
|
|
691
|
+
transaction: PrivacyTransaction;
|
|
692
|
+
/** Callback to refresh transaction status */
|
|
693
|
+
onRefresh?: () => void;
|
|
694
|
+
/** Callback to retry failed transaction */
|
|
695
|
+
onRetry?: () => void;
|
|
696
|
+
/** Callback to cancel pending transaction */
|
|
697
|
+
onCancel?: () => void;
|
|
698
|
+
/** Whether to show expanded details by default */
|
|
699
|
+
defaultExpanded?: boolean;
|
|
700
|
+
/** Polling interval in ms (0 to disable) */
|
|
701
|
+
pollingInterval?: number;
|
|
702
|
+
/** Network name for display */
|
|
703
|
+
networkName?: string;
|
|
704
|
+
/** Explorer URL template (use {hash} placeholder) */
|
|
705
|
+
explorerUrlTemplate?: string;
|
|
706
|
+
/** Custom class name */
|
|
707
|
+
className?: string;
|
|
708
|
+
/** Size variant */
|
|
709
|
+
size?: 'sm' | 'md' | 'lg';
|
|
710
|
+
/** Whether to show privacy verification status */
|
|
711
|
+
showPrivacyStatus?: boolean;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* TransactionTracker - Component for tracking NEAR privacy transactions
|
|
715
|
+
*
|
|
716
|
+
* @example Basic usage
|
|
717
|
+
* ```tsx
|
|
718
|
+
* import { TransactionTracker } from '@sip-protocol/react'
|
|
719
|
+
*
|
|
720
|
+
* function TransactionView({ txHash }) {
|
|
721
|
+
* const [tx, setTx] = useState(null)
|
|
722
|
+
*
|
|
723
|
+
* return (
|
|
724
|
+
* <TransactionTracker
|
|
725
|
+
* transaction={tx}
|
|
726
|
+
* onRefresh={() => fetchTransaction(txHash)}
|
|
727
|
+
* />
|
|
728
|
+
* )
|
|
729
|
+
* }
|
|
730
|
+
* ```
|
|
731
|
+
*/
|
|
732
|
+
declare function TransactionTracker({ transaction, onRefresh, onRetry, onCancel, defaultExpanded, pollingInterval, networkName, explorerUrlTemplate, className, size, showPrivacyStatus, }: TransactionTrackerProps): React.JSX.Element;
|
|
733
|
+
/**
|
|
734
|
+
* Hook to manage transaction tracking state
|
|
735
|
+
*/
|
|
736
|
+
declare function useTransactionTracker(initialTransaction?: PrivacyTransaction, options?: {
|
|
737
|
+
pollingInterval?: number;
|
|
738
|
+
onStatusChange?: (status: TransactionStatus) => void;
|
|
739
|
+
}): {
|
|
740
|
+
transaction: PrivacyTransaction | null;
|
|
741
|
+
setTransaction: React.Dispatch<React.SetStateAction<PrivacyTransaction | null>>;
|
|
742
|
+
updateTransaction: (updates: Partial<PrivacyTransaction>) => void;
|
|
743
|
+
isPolling: boolean;
|
|
744
|
+
startPolling: () => void;
|
|
745
|
+
stopPolling: () => void;
|
|
746
|
+
isFinal: boolean;
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Viewing key status
|
|
751
|
+
*/
|
|
752
|
+
type ViewingKeyStatus = 'active' | 'revoked' | 'expired' | 'pending';
|
|
753
|
+
/**
|
|
754
|
+
* Key export format
|
|
755
|
+
*/
|
|
756
|
+
type KeyExportFormat = 'encrypted_file' | 'qr_code' | 'plaintext';
|
|
757
|
+
/**
|
|
758
|
+
* Key import source
|
|
759
|
+
*/
|
|
760
|
+
type KeyImportSource = 'file' | 'qr_code' | 'text';
|
|
761
|
+
/**
|
|
762
|
+
* Viewing key usage entry
|
|
763
|
+
*/
|
|
764
|
+
interface ViewingKeyUsage {
|
|
765
|
+
timestamp: number;
|
|
766
|
+
action: 'created' | 'shared' | 'used' | 'revoked' | 'exported' | 'imported';
|
|
767
|
+
details?: string;
|
|
768
|
+
recipient?: string;
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Viewing key data
|
|
772
|
+
*/
|
|
773
|
+
interface ViewingKey {
|
|
774
|
+
id: string;
|
|
775
|
+
publicKey: string;
|
|
776
|
+
privateKey?: string;
|
|
777
|
+
label?: string;
|
|
778
|
+
status: ViewingKeyStatus;
|
|
779
|
+
createdAt: number;
|
|
780
|
+
expiresAt?: number;
|
|
781
|
+
usageHistory: ViewingKeyUsage[];
|
|
782
|
+
sharedWith?: string[];
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* ViewingKeyManager component props
|
|
786
|
+
*/
|
|
787
|
+
interface ViewingKeyManagerProps {
|
|
788
|
+
/** List of viewing keys */
|
|
789
|
+
keys: ViewingKey[];
|
|
790
|
+
/** Callback to generate a new key */
|
|
791
|
+
onGenerateKey?: (label?: string) => Promise<ViewingKey>;
|
|
792
|
+
/** Callback to export a key */
|
|
793
|
+
onExportKey?: (keyId: string, format: KeyExportFormat, password?: string) => Promise<string | Blob>;
|
|
794
|
+
/** Callback to import a key */
|
|
795
|
+
onImportKey?: (source: KeyImportSource, data: string | File) => Promise<ViewingKey>;
|
|
796
|
+
/** Callback to share a key */
|
|
797
|
+
onShareKey?: (keyId: string, recipient: string) => Promise<void>;
|
|
798
|
+
/** Callback to revoke a key */
|
|
799
|
+
onRevokeKey?: (keyId: string) => Promise<void>;
|
|
800
|
+
/** Callback when backup is acknowledged */
|
|
801
|
+
onBackupAcknowledged?: (keyId: string) => void;
|
|
802
|
+
/** Whether to show backup reminder */
|
|
803
|
+
showBackupReminder?: boolean;
|
|
804
|
+
/** Custom class name */
|
|
805
|
+
className?: string;
|
|
806
|
+
/** Size variant */
|
|
807
|
+
size?: 'sm' | 'md' | 'lg';
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* ViewingKeyManager - Component for managing NEAR viewing keys
|
|
811
|
+
*
|
|
812
|
+
* @example Basic usage
|
|
813
|
+
* ```tsx
|
|
814
|
+
* import { ViewingKeyManager } from '@sip-protocol/react'
|
|
815
|
+
*
|
|
816
|
+
* function KeyManagement() {
|
|
817
|
+
* const [keys, setKeys] = useState<ViewingKey[]>([])
|
|
818
|
+
*
|
|
819
|
+
* return (
|
|
820
|
+
* <ViewingKeyManager
|
|
821
|
+
* keys={keys}
|
|
822
|
+
* onGenerateKey={async (label) => {
|
|
823
|
+
* const newKey = await generateViewingKey(label)
|
|
824
|
+
* setKeys([...keys, newKey])
|
|
825
|
+
* return newKey
|
|
826
|
+
* }}
|
|
827
|
+
* />
|
|
828
|
+
* )
|
|
829
|
+
* }
|
|
830
|
+
* ```
|
|
831
|
+
*/
|
|
832
|
+
declare function ViewingKeyManager({ keys, onGenerateKey, onExportKey, onImportKey, onShareKey, onRevokeKey, onBackupAcknowledged: _onBackupAcknowledged, showBackupReminder, className, size, }: ViewingKeyManagerProps): React.JSX.Element;
|
|
833
|
+
/**
|
|
834
|
+
* Hook to manage viewing keys
|
|
835
|
+
*/
|
|
836
|
+
declare function useViewingKeyManager(initialKeys?: ViewingKey[]): {
|
|
837
|
+
keys: ViewingKey[];
|
|
838
|
+
setKeys: React.Dispatch<React.SetStateAction<ViewingKey[]>>;
|
|
839
|
+
addKey: (key: ViewingKey) => void;
|
|
840
|
+
removeKey: (keyId: string) => void;
|
|
841
|
+
updateKey: (keyId: string, updates: Partial<ViewingKey>) => void;
|
|
842
|
+
revokeKey: (keyId: string) => void;
|
|
843
|
+
activeKeys: ViewingKey[];
|
|
844
|
+
revokedKeys: ViewingKey[];
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Privacy level options for Ethereum
|
|
849
|
+
*/
|
|
850
|
+
type EthereumPrivacyLevel = 'public' | 'stealth' | 'compliant';
|
|
851
|
+
/**
|
|
852
|
+
* Supported Ethereum networks
|
|
853
|
+
*/
|
|
854
|
+
type EthereumNetworkId = 'mainnet' | 'arbitrum' | 'optimism' | 'base' | 'polygon' | 'sepolia';
|
|
855
|
+
/**
|
|
856
|
+
* Gas estimate for Ethereum privacy operations
|
|
857
|
+
*/
|
|
858
|
+
interface EthereumGasEstimate {
|
|
859
|
+
/** Gas units required */
|
|
860
|
+
gasUnits: bigint;
|
|
861
|
+
/** Gas price in gwei */
|
|
862
|
+
gasPriceGwei: number;
|
|
863
|
+
/** Total cost in ETH */
|
|
864
|
+
costEth: string;
|
|
865
|
+
/** Approximate cost in USD */
|
|
866
|
+
costUsd?: string;
|
|
867
|
+
/** L1 data cost (for L2s) */
|
|
868
|
+
l1DataCost?: string;
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Network-specific gas configuration
|
|
872
|
+
*/
|
|
873
|
+
interface NetworkGasConfig {
|
|
874
|
+
network: EthereumNetworkId;
|
|
875
|
+
displayName: string;
|
|
876
|
+
nativeSymbol: string;
|
|
877
|
+
gasMultiplier: number;
|
|
878
|
+
isL2: boolean;
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* Privacy level metadata for Ethereum
|
|
882
|
+
*/
|
|
883
|
+
interface EthereumPrivacyLevelInfo {
|
|
884
|
+
level: EthereumPrivacyLevel;
|
|
885
|
+
label: string;
|
|
886
|
+
description: string;
|
|
887
|
+
eipReference?: string;
|
|
888
|
+
icon: React.ReactNode;
|
|
889
|
+
gasEstimate?: EthereumGasEstimate;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* EthereumPrivacyToggle component props
|
|
893
|
+
*/
|
|
894
|
+
interface EthereumPrivacyToggleProps {
|
|
895
|
+
/** Current privacy level (controlled mode) */
|
|
896
|
+
value?: EthereumPrivacyLevel;
|
|
897
|
+
/** Default privacy level (uncontrolled mode) */
|
|
898
|
+
defaultValue?: EthereumPrivacyLevel;
|
|
899
|
+
/** Callback when privacy level changes */
|
|
900
|
+
onChange?: (level: EthereumPrivacyLevel) => void;
|
|
901
|
+
/** Whether the toggle is disabled */
|
|
902
|
+
disabled?: boolean;
|
|
903
|
+
/** Network for gas estimates */
|
|
904
|
+
network?: EthereumNetworkId;
|
|
905
|
+
/** Custom gas estimates */
|
|
906
|
+
gasEstimates?: Partial<Record<EthereumPrivacyLevel, EthereumGasEstimate>>;
|
|
907
|
+
/** Show gas/fee estimates */
|
|
908
|
+
showGasEstimate?: boolean;
|
|
909
|
+
/** Show EIP references */
|
|
910
|
+
showEipReferences?: boolean;
|
|
911
|
+
/** Show tooltips */
|
|
912
|
+
showTooltips?: boolean;
|
|
913
|
+
/** Custom class name */
|
|
914
|
+
className?: string;
|
|
915
|
+
/** Size variant */
|
|
916
|
+
size?: 'sm' | 'md' | 'lg';
|
|
917
|
+
/** Compact mode (icon only) */
|
|
918
|
+
compact?: boolean;
|
|
919
|
+
/** Show L2 savings badge */
|
|
920
|
+
showL2Savings?: boolean;
|
|
921
|
+
/** Aria label for the toggle group */
|
|
922
|
+
'aria-label'?: string;
|
|
923
|
+
}
|
|
924
|
+
/**
|
|
925
|
+
* EthereumPrivacyToggle - Toggle for selecting Ethereum privacy level
|
|
926
|
+
*
|
|
927
|
+
* A three-state toggle for EIP-5564 stealth address privacy on Ethereum and L2s.
|
|
928
|
+
* Shows gas estimates, L2 savings, and EIP references.
|
|
929
|
+
*
|
|
930
|
+
* @example Basic usage
|
|
931
|
+
* ```tsx
|
|
932
|
+
* import { EthereumPrivacyToggle } from '@sip-protocol/react'
|
|
933
|
+
*
|
|
934
|
+
* function SendForm() {
|
|
935
|
+
* const [privacy, setPrivacy] = useState<EthereumPrivacyLevel>('stealth')
|
|
936
|
+
*
|
|
937
|
+
* return (
|
|
938
|
+
* <EthereumPrivacyToggle
|
|
939
|
+
* value={privacy}
|
|
940
|
+
* onChange={setPrivacy}
|
|
941
|
+
* network="base"
|
|
942
|
+
* />
|
|
943
|
+
* )
|
|
944
|
+
* }
|
|
945
|
+
* ```
|
|
946
|
+
*
|
|
947
|
+
* @example With gas estimates and L2 savings
|
|
948
|
+
* ```tsx
|
|
949
|
+
* <EthereumPrivacyToggle
|
|
950
|
+
* value={privacy}
|
|
951
|
+
* onChange={setPrivacy}
|
|
952
|
+
* network="arbitrum"
|
|
953
|
+
* showGasEstimate
|
|
954
|
+
* showL2Savings
|
|
955
|
+
* />
|
|
956
|
+
* ```
|
|
957
|
+
*
|
|
958
|
+
* @example Compact mode for toolbars
|
|
959
|
+
* ```tsx
|
|
960
|
+
* <EthereumPrivacyToggle
|
|
961
|
+
* value={privacy}
|
|
962
|
+
* onChange={setPrivacy}
|
|
963
|
+
* compact
|
|
964
|
+
* size="sm"
|
|
965
|
+
* />
|
|
966
|
+
* ```
|
|
967
|
+
*/
|
|
968
|
+
declare function EthereumPrivacyToggle({ value, defaultValue, onChange, disabled, network, gasEstimates, showGasEstimate, showEipReferences, showTooltips, className, size, compact, showL2Savings, 'aria-label': ariaLabel, }: EthereumPrivacyToggleProps): React.JSX.Element;
|
|
969
|
+
/**
|
|
970
|
+
* Hook to use with EthereumPrivacyToggle for managing privacy state
|
|
971
|
+
*/
|
|
972
|
+
declare function useEthereumPrivacyToggle(initialValue?: EthereumPrivacyLevel): {
|
|
973
|
+
privacyLevel: EthereumPrivacyLevel;
|
|
974
|
+
setPrivacyLevel: React.Dispatch<React.SetStateAction<EthereumPrivacyLevel>>;
|
|
975
|
+
isPrivate: boolean;
|
|
976
|
+
isCompliant: boolean;
|
|
977
|
+
isStealth: boolean;
|
|
978
|
+
setPublic: () => void;
|
|
979
|
+
setStealth: () => void;
|
|
980
|
+
setCompliant: () => void;
|
|
981
|
+
eipStandard: string | null;
|
|
982
|
+
};
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* Ethereum Transaction Tracker
|
|
986
|
+
*
|
|
987
|
+
* Preset configuration for tracking Ethereum privacy transactions.
|
|
988
|
+
*
|
|
989
|
+
* @module components/ethereum/transaction-tracker
|
|
990
|
+
*/
|
|
991
|
+
|
|
992
|
+
/**
|
|
993
|
+
* Ethereum network configuration
|
|
994
|
+
*/
|
|
995
|
+
interface EthereumNetwork {
|
|
996
|
+
name: string;
|
|
997
|
+
chainId: number;
|
|
998
|
+
explorerUrl: string;
|
|
999
|
+
/** Average block time in seconds */
|
|
1000
|
+
blockTime: number;
|
|
1001
|
+
/** Confirmations required for finality */
|
|
1002
|
+
requiredConfirmations: number;
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* Predefined Ethereum networks
|
|
1006
|
+
*/
|
|
1007
|
+
declare const ETHEREUM_NETWORKS: Record<string, EthereumNetwork>;
|
|
1008
|
+
/**
|
|
1009
|
+
* Get network by chain ID
|
|
1010
|
+
*/
|
|
1011
|
+
declare function getNetworkByChainId(chainId: number): EthereumNetwork | undefined;
|
|
1012
|
+
/**
|
|
1013
|
+
* EthereumTransactionTracker props
|
|
1014
|
+
*/
|
|
1015
|
+
interface EthereumTransactionTrackerProps extends Omit<TransactionTrackerProps, 'networkName' | 'explorerUrlTemplate'> {
|
|
1016
|
+
/** Network name or chain ID */
|
|
1017
|
+
network?: string | number;
|
|
1018
|
+
/** Custom network configuration */
|
|
1019
|
+
customNetwork?: EthereumNetwork;
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* EthereumTransactionTracker - Ethereum-configured transaction tracker
|
|
1023
|
+
*
|
|
1024
|
+
* @example Basic usage
|
|
1025
|
+
* ```tsx
|
|
1026
|
+
* import { EthereumTransactionTracker } from '@sip-protocol/react'
|
|
1027
|
+
*
|
|
1028
|
+
* function TransactionView({ tx }) {
|
|
1029
|
+
* return (
|
|
1030
|
+
* <EthereumTransactionTracker
|
|
1031
|
+
* transaction={tx}
|
|
1032
|
+
* network="mainnet"
|
|
1033
|
+
* />
|
|
1034
|
+
* )
|
|
1035
|
+
* }
|
|
1036
|
+
* ```
|
|
1037
|
+
*
|
|
1038
|
+
* @example With L2 network
|
|
1039
|
+
* ```tsx
|
|
1040
|
+
* <EthereumTransactionTracker
|
|
1041
|
+
* transaction={tx}
|
|
1042
|
+
* network="arbitrum"
|
|
1043
|
+
* showPrivacyStatus
|
|
1044
|
+
* />
|
|
1045
|
+
* ```
|
|
1046
|
+
*/
|
|
1047
|
+
declare function EthereumTransactionTracker({ network, customNetwork, transaction, ...props }: EthereumTransactionTrackerProps): React.JSX.Element;
|
|
1048
|
+
/**
|
|
1049
|
+
* Hook for managing Ethereum transaction tracking
|
|
1050
|
+
*
|
|
1051
|
+
* @example
|
|
1052
|
+
* ```tsx
|
|
1053
|
+
* const {
|
|
1054
|
+
* transaction,
|
|
1055
|
+
* updateTransaction,
|
|
1056
|
+
* startPolling,
|
|
1057
|
+
* stopPolling,
|
|
1058
|
+
* estimatedTimeToFinality,
|
|
1059
|
+
* } = useEthereumTransactionTracker(tx, {
|
|
1060
|
+
* network: 'mainnet',
|
|
1061
|
+
* pollingInterval: 3000,
|
|
1062
|
+
* onConfirmed: (tx) => console.log('Confirmed!', tx),
|
|
1063
|
+
* })
|
|
1064
|
+
* ```
|
|
1065
|
+
*/
|
|
1066
|
+
declare function useEthereumTransactionTracker(initialTransaction?: PrivacyTransaction, options?: {
|
|
1067
|
+
network?: string | number;
|
|
1068
|
+
pollingInterval?: number;
|
|
1069
|
+
onStatusChange?: (status: TransactionStatus) => void;
|
|
1070
|
+
onConfirmed?: (tx: PrivacyTransaction) => void;
|
|
1071
|
+
onFinalized?: (tx: PrivacyTransaction) => void;
|
|
1072
|
+
onFailed?: (tx: PrivacyTransaction) => void;
|
|
1073
|
+
}): {
|
|
1074
|
+
networkConfig: EthereumNetwork;
|
|
1075
|
+
estimatedTimeToFinality: number | null;
|
|
1076
|
+
formattedTimeToFinality: string | null;
|
|
1077
|
+
explorerUrl: string | null;
|
|
1078
|
+
transaction: PrivacyTransaction | null;
|
|
1079
|
+
setTransaction: React.Dispatch<React.SetStateAction<PrivacyTransaction | null>>;
|
|
1080
|
+
updateTransaction: (updates: Partial<PrivacyTransaction>) => void;
|
|
1081
|
+
isPolling: boolean;
|
|
1082
|
+
startPolling: () => void;
|
|
1083
|
+
stopPolling: () => void;
|
|
1084
|
+
isFinal: boolean;
|
|
1085
|
+
};
|
|
1086
|
+
|
|
1087
|
+
/**
|
|
1088
|
+
* Ethereum Viewing Key Manager
|
|
1089
|
+
*
|
|
1090
|
+
* Preset configuration for managing Ethereum viewing keys.
|
|
1091
|
+
*
|
|
1092
|
+
* @module components/ethereum/viewing-key-manager
|
|
1093
|
+
*/
|
|
1094
|
+
|
|
1095
|
+
/**
|
|
1096
|
+
* Ethereum-specific viewing key data
|
|
1097
|
+
*/
|
|
1098
|
+
interface EthereumViewingKey extends ViewingKey {
|
|
1099
|
+
/** Chain ID the key is associated with */
|
|
1100
|
+
chainId?: number;
|
|
1101
|
+
/** Stealth meta-address associated with this key */
|
|
1102
|
+
stealthMetaAddress?: string;
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* EthereumViewingKeyManager props
|
|
1106
|
+
*/
|
|
1107
|
+
interface EthereumViewingKeyManagerProps extends Omit<ViewingKeyManagerProps, 'keys' | 'onGenerateKey' | 'onExportKey' | 'onImportKey' | 'onShareKey' | 'onRevokeKey'> {
|
|
1108
|
+
/** List of Ethereum viewing keys */
|
|
1109
|
+
keys: EthereumViewingKey[];
|
|
1110
|
+
/** Callback to generate a new key */
|
|
1111
|
+
onGenerateKey?: (label?: string, chainId?: number) => Promise<EthereumViewingKey>;
|
|
1112
|
+
/** Callback to export a key */
|
|
1113
|
+
onExportKey?: (keyId: string, format: KeyExportFormat, password?: string) => Promise<string | Blob>;
|
|
1114
|
+
/** Callback to import a key */
|
|
1115
|
+
onImportKey?: (source: KeyImportSource, data: string | File) => Promise<EthereumViewingKey>;
|
|
1116
|
+
/** Callback to share a key */
|
|
1117
|
+
onShareKey?: (keyId: string, recipient: string) => Promise<void>;
|
|
1118
|
+
/** Callback to revoke a key */
|
|
1119
|
+
onRevokeKey?: (keyId: string) => Promise<void>;
|
|
1120
|
+
/** Default chain ID for new keys */
|
|
1121
|
+
defaultChainId?: number;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* EthereumViewingKeyManager - Ethereum-configured viewing key manager
|
|
1125
|
+
*
|
|
1126
|
+
* @example Basic usage
|
|
1127
|
+
* ```tsx
|
|
1128
|
+
* import { EthereumViewingKeyManager } from '@sip-protocol/react'
|
|
1129
|
+
*
|
|
1130
|
+
* function KeyManagement() {
|
|
1131
|
+
* const [keys, setKeys] = useState<EthereumViewingKey[]>([])
|
|
1132
|
+
*
|
|
1133
|
+
* return (
|
|
1134
|
+
* <EthereumViewingKeyManager
|
|
1135
|
+
* keys={keys}
|
|
1136
|
+
* onGenerateKey={async (label, chainId) => {
|
|
1137
|
+
* const key = await generateEthereumViewingKey(label, chainId)
|
|
1138
|
+
* setKeys([...keys, key])
|
|
1139
|
+
* return key
|
|
1140
|
+
* }}
|
|
1141
|
+
* />
|
|
1142
|
+
* )
|
|
1143
|
+
* }
|
|
1144
|
+
* ```
|
|
1145
|
+
*/
|
|
1146
|
+
declare function EthereumViewingKeyManager({ keys, onGenerateKey, onExportKey, onImportKey, onShareKey, onRevokeKey, defaultChainId, ...props }: EthereumViewingKeyManagerProps): React.JSX.Element;
|
|
1147
|
+
/**
|
|
1148
|
+
* Hook for managing Ethereum viewing keys
|
|
1149
|
+
*
|
|
1150
|
+
* @example
|
|
1151
|
+
* ```tsx
|
|
1152
|
+
* const {
|
|
1153
|
+
* keys,
|
|
1154
|
+
* activeKeys,
|
|
1155
|
+
* generateKey,
|
|
1156
|
+
* exportKey,
|
|
1157
|
+
* revokeKey,
|
|
1158
|
+
* } = useEthereumViewingKey({
|
|
1159
|
+
* chainId: 1,
|
|
1160
|
+
* onKeyGenerated: (key) => console.log('Generated:', key),
|
|
1161
|
+
* })
|
|
1162
|
+
* ```
|
|
1163
|
+
*/
|
|
1164
|
+
declare function useEthereumViewingKey(options?: {
|
|
1165
|
+
chainId?: number;
|
|
1166
|
+
initialKeys?: EthereumViewingKey[];
|
|
1167
|
+
onKeyGenerated?: (key: EthereumViewingKey) => void;
|
|
1168
|
+
onKeyRevoked?: (keyId: string) => void;
|
|
1169
|
+
}): {
|
|
1170
|
+
keys: EthereumViewingKey[];
|
|
1171
|
+
activeKeys: EthereumViewingKey[];
|
|
1172
|
+
revokedKeys: EthereumViewingKey[];
|
|
1173
|
+
generateKey: (label?: string) => Promise<EthereumViewingKey>;
|
|
1174
|
+
revokeKey: (keyId: string) => void;
|
|
1175
|
+
keysForChain: (targetChainId: number) => EthereumViewingKey[];
|
|
1176
|
+
formatViewingKeyAddress: (key: EthereumViewingKey) => string;
|
|
1177
|
+
currentChainId: number;
|
|
1178
|
+
setKeys: React.Dispatch<React.SetStateAction<ViewingKey[]>>;
|
|
1179
|
+
addKey: (key: ViewingKey) => void;
|
|
1180
|
+
removeKey: (keyId: string) => void;
|
|
1181
|
+
updateKey: (keyId: string, updates: Partial<ViewingKey>) => void;
|
|
1182
|
+
};
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* EthereumStealthAddressDisplay Component
|
|
1186
|
+
*
|
|
1187
|
+
* Displays EIP-5564 stealth addresses with Ethereum-specific features including
|
|
1188
|
+
* network support for mainnet and L2s, Etherscan integration, and EIP-5564 validation.
|
|
1189
|
+
*
|
|
1190
|
+
* @module components/ethereum/stealth-address-display
|
|
1191
|
+
*/
|
|
1192
|
+
/**
|
|
1193
|
+
* Ownership status for stealth addresses
|
|
1194
|
+
*/
|
|
1195
|
+
type EthereumOwnershipStatus = 'yours' | 'others' | 'unknown';
|
|
1196
|
+
/**
|
|
1197
|
+
* Ethereum network IDs
|
|
1198
|
+
*/
|
|
1199
|
+
type EthereumStealthNetworkId = 'mainnet' | 'arbitrum' | 'optimism' | 'base' | 'polygon' | 'sepolia';
|
|
1200
|
+
/**
|
|
1201
|
+
* Network configuration for explorer links
|
|
1202
|
+
*/
|
|
1203
|
+
interface EthereumStealthNetworkConfig {
|
|
1204
|
+
name: string;
|
|
1205
|
+
chainId: number;
|
|
1206
|
+
explorerUrl: string;
|
|
1207
|
+
explorerName: string;
|
|
1208
|
+
isL2: boolean;
|
|
1209
|
+
color: string;
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Default Ethereum network configurations
|
|
1213
|
+
*/
|
|
1214
|
+
declare const ETHEREUM_STEALTH_NETWORKS: Record<EthereumStealthNetworkId, EthereumStealthNetworkConfig>;
|
|
1215
|
+
/**
|
|
1216
|
+
* EthereumStealthAddressDisplay component props
|
|
1217
|
+
*/
|
|
1218
|
+
interface EthereumStealthAddressDisplayProps {
|
|
1219
|
+
/** The stealth address to display (0x prefixed, 42 chars) */
|
|
1220
|
+
address: string;
|
|
1221
|
+
/** Optional stealth meta-address for QR code (full sip: format) */
|
|
1222
|
+
metaAddress?: string;
|
|
1223
|
+
/** Optional ephemeral public key (EIP-5564) */
|
|
1224
|
+
ephemeralPublicKey?: string;
|
|
1225
|
+
/** View tag for the stealth address (EIP-5564) */
|
|
1226
|
+
viewTag?: number;
|
|
1227
|
+
/** Ownership status of the address */
|
|
1228
|
+
ownership?: EthereumOwnershipStatus;
|
|
1229
|
+
/** Whether the address is validated */
|
|
1230
|
+
isValid?: boolean;
|
|
1231
|
+
/** Network for explorer links */
|
|
1232
|
+
network?: EthereumStealthNetworkId;
|
|
1233
|
+
/** Custom network configuration */
|
|
1234
|
+
networkConfig?: EthereumStealthNetworkConfig;
|
|
1235
|
+
/** Whether to show the QR code button */
|
|
1236
|
+
showQrCode?: boolean;
|
|
1237
|
+
/** Whether to show the explorer link */
|
|
1238
|
+
showExplorerLink?: boolean;
|
|
1239
|
+
/** Whether to show the copy button */
|
|
1240
|
+
showCopyButton?: boolean;
|
|
1241
|
+
/** Whether to show the ownership badge */
|
|
1242
|
+
showOwnership?: boolean;
|
|
1243
|
+
/** Whether to show the validation indicator */
|
|
1244
|
+
showValidation?: boolean;
|
|
1245
|
+
/** Whether to show the network badge */
|
|
1246
|
+
showNetworkBadge?: boolean;
|
|
1247
|
+
/** Whether to show the EIP-5564 badge */
|
|
1248
|
+
showEipBadge?: boolean;
|
|
1249
|
+
/** Whether to show the view tag */
|
|
1250
|
+
showViewTag?: boolean;
|
|
1251
|
+
/** Custom class name */
|
|
1252
|
+
className?: string;
|
|
1253
|
+
/** Size variant */
|
|
1254
|
+
size?: 'sm' | 'md' | 'lg';
|
|
1255
|
+
/** Callback when address is copied */
|
|
1256
|
+
onCopy?: (address: string) => void;
|
|
1257
|
+
/** Callback when QR code is shown */
|
|
1258
|
+
onShowQr?: (address: string) => void;
|
|
1259
|
+
/** Callback when ephemeral key is copied */
|
|
1260
|
+
onCopyEphemeralKey?: (key: string) => void;
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Validates an Ethereum address format
|
|
1264
|
+
*/
|
|
1265
|
+
declare function isValidEthereumAddress(address: string): boolean;
|
|
1266
|
+
/**
|
|
1267
|
+
* Validates an EIP-5564 stealth address
|
|
1268
|
+
* Stealth addresses are valid Ethereum addresses generated from EIP-5564
|
|
1269
|
+
*/
|
|
1270
|
+
declare function isValidEthereumStealthAddress(address: string): boolean;
|
|
1271
|
+
/**
|
|
1272
|
+
* Validates an ephemeral public key (compressed secp256k1)
|
|
1273
|
+
*/
|
|
1274
|
+
declare function isValidEphemeralPublicKey(key: string): boolean;
|
|
1275
|
+
/**
|
|
1276
|
+
* Truncates an address for display
|
|
1277
|
+
*/
|
|
1278
|
+
declare function truncateEthereumAddress(address: string, startChars?: number, endChars?: number): string;
|
|
1279
|
+
/**
|
|
1280
|
+
* EthereumStealthAddressDisplay - Component for displaying EIP-5564 stealth addresses
|
|
1281
|
+
*
|
|
1282
|
+
* Displays stealth addresses with Ethereum-specific visual styling,
|
|
1283
|
+
* including network support, Etherscan links, and EIP-5564 metadata.
|
|
1284
|
+
*
|
|
1285
|
+
* @example Basic usage
|
|
1286
|
+
* ```tsx
|
|
1287
|
+
* import { EthereumStealthAddressDisplay } from '@sip-protocol/react'
|
|
1288
|
+
*
|
|
1289
|
+
* function WalletView() {
|
|
1290
|
+
* return (
|
|
1291
|
+
* <EthereumStealthAddressDisplay
|
|
1292
|
+
* address="0x742d35Cc6634C0532925a3b844Bc9e7595f2..."
|
|
1293
|
+
* ownership="yours"
|
|
1294
|
+
* />
|
|
1295
|
+
* )
|
|
1296
|
+
* }
|
|
1297
|
+
* ```
|
|
1298
|
+
*
|
|
1299
|
+
* @example With EIP-5564 metadata
|
|
1300
|
+
* ```tsx
|
|
1301
|
+
* <EthereumStealthAddressDisplay
|
|
1302
|
+
* address="0x742d35Cc6634C0532925a3b844Bc9e7595f2..."
|
|
1303
|
+
* ephemeralPublicKey="0x02abc...123"
|
|
1304
|
+
* viewTag={42}
|
|
1305
|
+
* network="arbitrum"
|
|
1306
|
+
* showEipBadge
|
|
1307
|
+
* showViewTag
|
|
1308
|
+
* />
|
|
1309
|
+
* ```
|
|
1310
|
+
*/
|
|
1311
|
+
declare function EthereumStealthAddressDisplay({ address, metaAddress, ephemeralPublicKey, viewTag, ownership, isValid, network, networkConfig, showQrCode, showExplorerLink, showCopyButton, showOwnership, showValidation, showNetworkBadge, showEipBadge, showViewTag, className, size, onCopy, onShowQr, onCopyEphemeralKey, }: EthereumStealthAddressDisplayProps): React.JSX.Element;
|
|
1312
|
+
/**
|
|
1313
|
+
* Hook to manage Ethereum stealth address display state
|
|
1314
|
+
*/
|
|
1315
|
+
declare function useEthereumStealthAddressDisplay(address: string, options?: {
|
|
1316
|
+
checkOwnership?: (address: string) => EthereumOwnershipStatus;
|
|
1317
|
+
validateAddress?: (address: string) => boolean;
|
|
1318
|
+
network?: EthereumStealthNetworkId;
|
|
1319
|
+
}): {
|
|
1320
|
+
address: string;
|
|
1321
|
+
truncated: string;
|
|
1322
|
+
ownership: EthereumOwnershipStatus;
|
|
1323
|
+
isValid: boolean;
|
|
1324
|
+
isStealth: boolean;
|
|
1325
|
+
network: EthereumStealthNetworkId;
|
|
1326
|
+
networkConfig: EthereumStealthNetworkConfig;
|
|
1327
|
+
explorerUrl: string;
|
|
1328
|
+
isL2: boolean;
|
|
1329
|
+
};
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* Ethereum Privacy Transaction History
|
|
1333
|
+
*
|
|
1334
|
+
* Component for displaying history of Ethereum privacy transactions.
|
|
1335
|
+
*
|
|
1336
|
+
* @module components/ethereum/transaction-history
|
|
1337
|
+
*/
|
|
1338
|
+
|
|
1339
|
+
/**
|
|
1340
|
+
* Transaction direction
|
|
1341
|
+
*/
|
|
1342
|
+
type TransactionDirection = 'sent' | 'received' | 'claimed';
|
|
1343
|
+
/**
|
|
1344
|
+
* Transaction type
|
|
1345
|
+
*/
|
|
1346
|
+
type TransactionType = 'stealth_transfer' | 'standard_transfer' | 'claim';
|
|
1347
|
+
/**
|
|
1348
|
+
* Privacy transaction history item
|
|
1349
|
+
*/
|
|
1350
|
+
interface PrivacyTransactionHistoryItem {
|
|
1351
|
+
/** Transaction hash */
|
|
1352
|
+
hash: string;
|
|
1353
|
+
/** Transaction direction */
|
|
1354
|
+
direction: TransactionDirection;
|
|
1355
|
+
/** Transaction type */
|
|
1356
|
+
type: TransactionType;
|
|
1357
|
+
/** Timestamp in milliseconds */
|
|
1358
|
+
timestamp: number;
|
|
1359
|
+
/** Block number */
|
|
1360
|
+
blockNumber?: number;
|
|
1361
|
+
/** From address */
|
|
1362
|
+
from: string;
|
|
1363
|
+
/** To address (may be stealth address) */
|
|
1364
|
+
to: string;
|
|
1365
|
+
/** Whether to address is stealth */
|
|
1366
|
+
isStealthAddress: boolean;
|
|
1367
|
+
/** Amount in token units (string for precision) */
|
|
1368
|
+
amount: string;
|
|
1369
|
+
/** Token symbol */
|
|
1370
|
+
tokenSymbol: string;
|
|
1371
|
+
/** Token decimals */
|
|
1372
|
+
tokenDecimals: number;
|
|
1373
|
+
/** USD value at time of transaction */
|
|
1374
|
+
usdValue?: string;
|
|
1375
|
+
/** Current USD value */
|
|
1376
|
+
currentUsdValue?: string;
|
|
1377
|
+
/** Gas used */
|
|
1378
|
+
gasUsed?: string;
|
|
1379
|
+
/** Gas price in gwei */
|
|
1380
|
+
gasPrice?: string;
|
|
1381
|
+
/** Transaction fee in ETH */
|
|
1382
|
+
fee?: string;
|
|
1383
|
+
/** Status */
|
|
1384
|
+
status: 'pending' | 'confirmed' | 'failed';
|
|
1385
|
+
/** Ephemeral public key for stealth transactions */
|
|
1386
|
+
ephemeralPublicKey?: string;
|
|
1387
|
+
/** View tag for efficient scanning */
|
|
1388
|
+
viewTag?: number;
|
|
1389
|
+
/** Claim key (only for received/claimed) */
|
|
1390
|
+
claimKey?: string;
|
|
1391
|
+
}
|
|
1392
|
+
/**
|
|
1393
|
+
* Filter options for transaction history
|
|
1394
|
+
*/
|
|
1395
|
+
interface TransactionHistoryFilter {
|
|
1396
|
+
direction?: TransactionDirection | 'all';
|
|
1397
|
+
type?: TransactionType | 'all';
|
|
1398
|
+
status?: 'pending' | 'confirmed' | 'failed' | 'all';
|
|
1399
|
+
tokenSymbol?: string;
|
|
1400
|
+
fromDate?: Date;
|
|
1401
|
+
toDate?: Date;
|
|
1402
|
+
minAmount?: string;
|
|
1403
|
+
maxAmount?: string;
|
|
1404
|
+
}
|
|
1405
|
+
/**
|
|
1406
|
+
* Sort options for transaction history
|
|
1407
|
+
*/
|
|
1408
|
+
interface TransactionHistorySort {
|
|
1409
|
+
field: 'timestamp' | 'amount' | 'usdValue';
|
|
1410
|
+
direction: 'asc' | 'desc';
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1413
|
+
* TransactionHistory component props
|
|
1414
|
+
*/
|
|
1415
|
+
interface TransactionHistoryProps {
|
|
1416
|
+
/** List of transactions */
|
|
1417
|
+
transactions: PrivacyTransactionHistoryItem[];
|
|
1418
|
+
/** Loading state */
|
|
1419
|
+
isLoading?: boolean;
|
|
1420
|
+
/** Error message */
|
|
1421
|
+
error?: string | null;
|
|
1422
|
+
/** Filter options */
|
|
1423
|
+
filter?: TransactionHistoryFilter;
|
|
1424
|
+
/** Sort options */
|
|
1425
|
+
sort?: TransactionHistorySort;
|
|
1426
|
+
/** Callback when filter changes */
|
|
1427
|
+
onFilterChange?: (filter: TransactionHistoryFilter) => void;
|
|
1428
|
+
/** Callback when sort changes */
|
|
1429
|
+
onSortChange?: (sort: TransactionHistorySort) => void;
|
|
1430
|
+
/** Callback to load more transactions */
|
|
1431
|
+
onLoadMore?: () => void;
|
|
1432
|
+
/** Whether more transactions are available */
|
|
1433
|
+
hasMore?: boolean;
|
|
1434
|
+
/** Callback to export transactions */
|
|
1435
|
+
onExport?: (format: 'csv' | 'json') => void;
|
|
1436
|
+
/** Callback when transaction is selected */
|
|
1437
|
+
onTransactionSelect?: (tx: PrivacyTransactionHistoryItem) => void;
|
|
1438
|
+
/** Network configuration */
|
|
1439
|
+
network?: string | EthereumNetwork;
|
|
1440
|
+
/** Items per page for pagination */
|
|
1441
|
+
pageSize?: number;
|
|
1442
|
+
/** Custom class name */
|
|
1443
|
+
className?: string;
|
|
1444
|
+
/** Size variant */
|
|
1445
|
+
size?: 'sm' | 'md' | 'lg';
|
|
1446
|
+
/** Show USD values */
|
|
1447
|
+
showUsdValues?: boolean;
|
|
1448
|
+
/** Show filters */
|
|
1449
|
+
showFilters?: boolean;
|
|
1450
|
+
/** Show export button */
|
|
1451
|
+
showExport?: boolean;
|
|
1452
|
+
}
|
|
1453
|
+
/**
|
|
1454
|
+
* TransactionHistory - Display privacy transaction history
|
|
1455
|
+
*
|
|
1456
|
+
* @example Basic usage
|
|
1457
|
+
* ```tsx
|
|
1458
|
+
* import { TransactionHistory } from '@sip-protocol/react'
|
|
1459
|
+
*
|
|
1460
|
+
* function HistoryView() {
|
|
1461
|
+
* const [transactions, setTransactions] = useState([])
|
|
1462
|
+
*
|
|
1463
|
+
* return (
|
|
1464
|
+
* <TransactionHistory
|
|
1465
|
+
* transactions={transactions}
|
|
1466
|
+
* onTransactionSelect={(tx) => console.log('Selected:', tx)}
|
|
1467
|
+
* network="mainnet"
|
|
1468
|
+
* showFilters
|
|
1469
|
+
* showExport
|
|
1470
|
+
* />
|
|
1471
|
+
* )
|
|
1472
|
+
* }
|
|
1473
|
+
* ```
|
|
1474
|
+
*/
|
|
1475
|
+
declare function TransactionHistory({ transactions, isLoading, error, filter, sort, onFilterChange, onSortChange, onLoadMore, hasMore, onExport, onTransactionSelect, network, pageSize, className, size, showUsdValues, showFilters, showExport, }: TransactionHistoryProps): React.JSX.Element;
|
|
1476
|
+
/**
|
|
1477
|
+
* Hook for managing transaction history
|
|
1478
|
+
*
|
|
1479
|
+
* @example
|
|
1480
|
+
* ```tsx
|
|
1481
|
+
* const {
|
|
1482
|
+
* transactions,
|
|
1483
|
+
* isLoading,
|
|
1484
|
+
* filter,
|
|
1485
|
+
* setFilter,
|
|
1486
|
+
* loadMore,
|
|
1487
|
+
* refresh,
|
|
1488
|
+
* exportHistory,
|
|
1489
|
+
* } = useTransactionHistory({
|
|
1490
|
+
* viewingPrivateKey,
|
|
1491
|
+
* spendingPublicKey,
|
|
1492
|
+
* network: 'mainnet',
|
|
1493
|
+
* })
|
|
1494
|
+
* ```
|
|
1495
|
+
*/
|
|
1496
|
+
declare function useTransactionHistory(options?: {
|
|
1497
|
+
initialTransactions?: PrivacyTransactionHistoryItem[];
|
|
1498
|
+
fetchTransactions?: () => Promise<PrivacyTransactionHistoryItem[]>;
|
|
1499
|
+
pageSize?: number;
|
|
1500
|
+
}): {
|
|
1501
|
+
transactions: PrivacyTransactionHistoryItem[];
|
|
1502
|
+
setTransactions: React.Dispatch<React.SetStateAction<PrivacyTransactionHistoryItem[]>>;
|
|
1503
|
+
isLoading: boolean;
|
|
1504
|
+
error: string | null;
|
|
1505
|
+
filter: TransactionHistoryFilter;
|
|
1506
|
+
setFilter: React.Dispatch<React.SetStateAction<TransactionHistoryFilter>>;
|
|
1507
|
+
sort: TransactionHistorySort;
|
|
1508
|
+
setSort: React.Dispatch<React.SetStateAction<TransactionHistorySort>>;
|
|
1509
|
+
hasMore: boolean;
|
|
1510
|
+
setHasMore: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1511
|
+
loadTransactions: () => Promise<void>;
|
|
1512
|
+
addTransaction: (tx: PrivacyTransactionHistoryItem) => void;
|
|
1513
|
+
updateTransaction: (hash: string, updates: Partial<PrivacyTransactionHistoryItem>) => void;
|
|
1514
|
+
exportHistory: (format: "csv" | "json") => void;
|
|
1515
|
+
summary: {
|
|
1516
|
+
total: number;
|
|
1517
|
+
sent: number;
|
|
1518
|
+
received: number;
|
|
1519
|
+
claimed: number;
|
|
1520
|
+
stealthCount: number;
|
|
1521
|
+
stealthPercentage: number;
|
|
1522
|
+
};
|
|
1523
|
+
};
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* Transaction type for NEAR privacy operations
|
|
1527
|
+
*/
|
|
1528
|
+
type NEARTransactionType = 'send' | 'receive' | 'contract_call';
|
|
1529
|
+
/**
|
|
1530
|
+
* Export format options
|
|
1531
|
+
*/
|
|
1532
|
+
type NEARExportFormat = 'csv' | 'json';
|
|
1533
|
+
/**
|
|
1534
|
+
* Historical transaction structure
|
|
1535
|
+
*/
|
|
1536
|
+
interface NEARHistoricalTransaction {
|
|
1537
|
+
hash: string;
|
|
1538
|
+
timestamp: number;
|
|
1539
|
+
blockHeight: number;
|
|
1540
|
+
type: NEARTransactionType;
|
|
1541
|
+
stealthAddress: string;
|
|
1542
|
+
stealthPublicKey: HexString;
|
|
1543
|
+
ephemeralPublicKey: HexString;
|
|
1544
|
+
viewTag: number;
|
|
1545
|
+
amount: string;
|
|
1546
|
+
amountFormatted: string;
|
|
1547
|
+
token: string;
|
|
1548
|
+
tokenContract: string | null;
|
|
1549
|
+
decimals: number;
|
|
1550
|
+
privacyLevel: 'transparent' | 'shielded' | 'compliant';
|
|
1551
|
+
amountRevealed: boolean;
|
|
1552
|
+
sender?: string;
|
|
1553
|
+
receiver?: string;
|
|
1554
|
+
fee?: string;
|
|
1555
|
+
explorerUrl: string;
|
|
1556
|
+
recipientLabel?: string;
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
* Transaction history view component props
|
|
1560
|
+
*/
|
|
1561
|
+
interface TransactionHistoryViewProps {
|
|
1562
|
+
/** NEAR RPC URL */
|
|
1563
|
+
rpcUrl: string;
|
|
1564
|
+
/** Viewing private key (hex) */
|
|
1565
|
+
viewingPrivateKey: HexString;
|
|
1566
|
+
/** Spending private key (hex) */
|
|
1567
|
+
spendingPrivateKey: HexString;
|
|
1568
|
+
/** Network type */
|
|
1569
|
+
network?: 'mainnet' | 'testnet';
|
|
1570
|
+
/** Number of transactions per page */
|
|
1571
|
+
pageSize?: number;
|
|
1572
|
+
/** Auto-refresh interval in milliseconds (0 = disabled) */
|
|
1573
|
+
refreshInterval?: number;
|
|
1574
|
+
/** Whether to show filter controls */
|
|
1575
|
+
showFilters?: boolean;
|
|
1576
|
+
/** Whether to show export button */
|
|
1577
|
+
showExport?: boolean;
|
|
1578
|
+
/** Whether to show summary statistics */
|
|
1579
|
+
showSummary?: boolean;
|
|
1580
|
+
/** Whether to show search */
|
|
1581
|
+
showSearch?: boolean;
|
|
1582
|
+
/** Callback when transaction is clicked */
|
|
1583
|
+
onTransactionClick?: (tx: NEARHistoricalTransaction) => void;
|
|
1584
|
+
/** Callback when export is triggered */
|
|
1585
|
+
onExport?: (format: NEARExportFormat, data: string) => void;
|
|
1586
|
+
/** Custom class name */
|
|
1587
|
+
className?: string;
|
|
1588
|
+
/** Theme */
|
|
1589
|
+
theme?: 'light' | 'dark';
|
|
1590
|
+
}
|
|
1591
|
+
/**
|
|
1592
|
+
* TransactionHistoryView - Display NEAR privacy transaction history
|
|
1593
|
+
*
|
|
1594
|
+
* A comprehensive component for viewing, filtering, and exporting
|
|
1595
|
+
* NEAR privacy transaction history.
|
|
1596
|
+
*
|
|
1597
|
+
* @example Basic usage
|
|
1598
|
+
* ```tsx
|
|
1599
|
+
* <TransactionHistoryView
|
|
1600
|
+
* rpcUrl="https://rpc.mainnet.near.org"
|
|
1601
|
+
* viewingPrivateKey="0x..."
|
|
1602
|
+
* spendingPrivateKey="0x..."
|
|
1603
|
+
* />
|
|
1604
|
+
* ```
|
|
1605
|
+
*
|
|
1606
|
+
* @example With callbacks
|
|
1607
|
+
* ```tsx
|
|
1608
|
+
* <TransactionHistoryView
|
|
1609
|
+
* rpcUrl="https://rpc.mainnet.near.org"
|
|
1610
|
+
* viewingPrivateKey="0x..."
|
|
1611
|
+
* spendingPrivateKey="0x..."
|
|
1612
|
+
* onTransactionClick={(tx) => openInExplorer(tx.explorerUrl)}
|
|
1613
|
+
* onExport={(format, data) => downloadFile(`transactions.${format}`, data)}
|
|
1614
|
+
* showFilters
|
|
1615
|
+
* showExport
|
|
1616
|
+
* showSummary
|
|
1617
|
+
* />
|
|
1618
|
+
* ```
|
|
1619
|
+
*/
|
|
1620
|
+
declare function TransactionHistoryView({ rpcUrl, viewingPrivateKey, spendingPrivateKey, network, pageSize, refreshInterval, showFilters, showExport, showSummary, showSearch, onTransactionClick, onExport, className, theme, }: TransactionHistoryViewProps): React.JSX.Element;
|
|
1621
|
+
|
|
1622
|
+
export { ETHEREUM_NETWORKS, ETHEREUM_STEALTH_NETWORKS, type EthereumGasEstimate, type EthereumNetwork, type EthereumNetworkId, type EthereumOwnershipStatus, type EthereumPrivacyLevel, type EthereumPrivacyLevelInfo, EthereumPrivacyToggle, type EthereumPrivacyToggleProps, EthereumStealthAddressDisplay, type EthereumStealthAddressDisplayProps, type EthereumStealthNetworkConfig, type EthereumStealthNetworkId, EthereumTransactionTracker, type EthereumTransactionTrackerProps, type EthereumViewingKey, EthereumViewingKeyManager, type EthereumViewingKeyManagerProps, type GasEstimate, type KeyExportFormat, type KeyImportSource, TransactionHistoryView as NEARTransactionHistoryView, type TransactionHistoryViewProps as NEARTransactionHistoryViewProps, NEAR_NETWORKS, type NetworkConfig, type NetworkGasConfig, type OwnershipStatus, type PrivacyLevel, type PrivacyLevelInfo, PrivacyToggle, type PrivacyToggleProps, type PrivacyTransaction, type PrivacyTransactionHistoryItem, type PrivacyVerification, type PrivacyVerificationStatus, SIPProvider, type SIPProviderProps, StealthAddressDisplay, type StealthAddressDisplayProps, type TransactionAction, type TransactionActionType, TransactionHistory, type TransactionHistoryFilter, type TransactionHistoryProps, type TransactionHistorySort, type TransactionStatus, TransactionTracker, type TransactionTrackerProps, type ViewingKey, ViewingKeyManager, type ViewingKeyManagerProps, type ViewingKeyStatus, type ViewingKeyUsage, getNetworkByChainId, isValidEphemeralPublicKey, isValidEthereumAddress, isValidEthereumStealthAddress, isValidStealthAddress, truncateAddress, truncateEthereumAddress, useEthereumPrivacyToggle, useEthereumStealthAddressDisplay, useTransactionHistory as useEthereumTransactionHistory, useEthereumTransactionTracker, useEthereumViewingKey, usePrivacyToggle, usePrivateSwap, useSIP, useStealthAddress, useStealthAddressDisplay, useTransactionTracker, useViewingKey, useViewingKeyManager };
|