@openzeppelin/ui-types 1.10.0 → 1.11.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 +14 -6
- package/dist/index.d.cts +437 -250
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +437 -250
- package/dist/index.d.mts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -472,6 +472,442 @@ interface RelayerExecutionConfig {
|
|
|
472
472
|
*/
|
|
473
473
|
type ExecutionConfig = EoaExecutionConfig | RelayerExecutionConfig | MultisigExecutionConfig;
|
|
474
474
|
//#endregion
|
|
475
|
+
//#region src/networks/config.d.ts
|
|
476
|
+
/**
|
|
477
|
+
* Base interface with common properties shared across all network configurations
|
|
478
|
+
*/
|
|
479
|
+
interface BaseNetworkConfig {
|
|
480
|
+
/**
|
|
481
|
+
* Unique identifier for the network, e.g., 'ethereum-mainnet', 'polygon-amoy'
|
|
482
|
+
*/
|
|
483
|
+
id: string;
|
|
484
|
+
/**
|
|
485
|
+
* User-friendly network name, e.g., 'Ethereum Mainnet'
|
|
486
|
+
*/
|
|
487
|
+
name: string;
|
|
488
|
+
/**
|
|
489
|
+
* The blockchain ecosystem this network belongs to (discriminant for the union type)
|
|
490
|
+
*/
|
|
491
|
+
ecosystem: Ecosystem;
|
|
492
|
+
/**
|
|
493
|
+
* Parent network name, e.g., 'ethereum', 'polygon'
|
|
494
|
+
*/
|
|
495
|
+
network: string;
|
|
496
|
+
/**
|
|
497
|
+
* Network type/environment: 'mainnet', 'testnet', or 'devnet'
|
|
498
|
+
*/
|
|
499
|
+
type: NetworkType;
|
|
500
|
+
/**
|
|
501
|
+
* Explicit flag for easy filtering of test networks
|
|
502
|
+
*/
|
|
503
|
+
isTestnet: boolean;
|
|
504
|
+
/**
|
|
505
|
+
* The constant name under which this specific network configuration object
|
|
506
|
+
* is exported from its adapter package's network index file.
|
|
507
|
+
* Used by the export system to dynamically import the correct config.
|
|
508
|
+
* Example: 'ethereumMainnet', 'ethereumSepolia'
|
|
509
|
+
*/
|
|
510
|
+
exportConstName: string;
|
|
511
|
+
/**
|
|
512
|
+
* Base URL for the block explorer (common across ecosystems)
|
|
513
|
+
*/
|
|
514
|
+
explorerUrl?: string;
|
|
515
|
+
/**
|
|
516
|
+
* Optional React component for the network icon.
|
|
517
|
+
* This allows embedding the icon component directly in the network config,
|
|
518
|
+
* avoiding dynamic imports and improving build performance.
|
|
519
|
+
* If provided, this takes precedence over the icon string.
|
|
520
|
+
*/
|
|
521
|
+
iconComponent?: React$1.ComponentType<{
|
|
522
|
+
size?: number;
|
|
523
|
+
className?: string;
|
|
524
|
+
variant?: 'mono' | 'branded';
|
|
525
|
+
}>;
|
|
526
|
+
/**
|
|
527
|
+
* A unique identifier for the specific explorer API service used by this network.
|
|
528
|
+
* This is used by the AppConfigService to fetch the correct API key.
|
|
529
|
+
* Examples: "etherscan-mainnet", "polygonscan-mainnet", "bscscan-mainnet"
|
|
530
|
+
* Should align with keys in AppRuntimeConfig.networkServiceConfigs
|
|
531
|
+
*/
|
|
532
|
+
primaryExplorerApiIdentifier?: string;
|
|
533
|
+
/**
|
|
534
|
+
* Optional indexer GraphQL HTTP endpoint
|
|
535
|
+
* Used for querying historical blockchain data (e.g., access control events)
|
|
536
|
+
*/
|
|
537
|
+
indexerUri?: string;
|
|
538
|
+
/**
|
|
539
|
+
* Optional indexer GraphQL WebSocket endpoint
|
|
540
|
+
* Used for real-time blockchain data subscriptions
|
|
541
|
+
*/
|
|
542
|
+
indexerWsUri?: string;
|
|
543
|
+
/**
|
|
544
|
+
* Optional GraphQL endpoint for the access control indexer.
|
|
545
|
+
* Used by the access control module for historical queries and role discovery.
|
|
546
|
+
* Feature-specific field — distinct from the general-purpose `indexerUri` which
|
|
547
|
+
* may serve different purposes per ecosystem (e.g., Midnight chain indexer).
|
|
548
|
+
*/
|
|
549
|
+
accessControlIndexerUrl?: string;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* EVM-specific network configuration
|
|
553
|
+
*/
|
|
554
|
+
interface EvmNetworkConfig extends BaseNetworkConfig {
|
|
555
|
+
ecosystem: 'evm';
|
|
556
|
+
/**
|
|
557
|
+
* EVM chain ID, e.g., 1 for Ethereum Mainnet, 11155111 for Sepolia
|
|
558
|
+
*/
|
|
559
|
+
chainId: number;
|
|
560
|
+
/**
|
|
561
|
+
* JSON-RPC endpoint for the network (can be a base URL if API key is resolved from env)
|
|
562
|
+
*/
|
|
563
|
+
rpcUrl: string;
|
|
564
|
+
/**
|
|
565
|
+
* Native currency information
|
|
566
|
+
*/
|
|
567
|
+
nativeCurrency: {
|
|
568
|
+
name: string;
|
|
569
|
+
symbol: string;
|
|
570
|
+
decimals: number;
|
|
571
|
+
};
|
|
572
|
+
/**
|
|
573
|
+
* Optional icon name for the network (for use with @web3icons/react or similar)
|
|
574
|
+
* If not provided, the network property will be used as a fallback
|
|
575
|
+
*/
|
|
576
|
+
apiUrl?: string;
|
|
577
|
+
/**
|
|
578
|
+
* Whether this network supports Etherscan V2 API (default: true for all Etherscan-compatible explorers)
|
|
579
|
+
*/
|
|
580
|
+
supportsEtherscanV2?: boolean;
|
|
581
|
+
/**
|
|
582
|
+
* Whether this network's explorer requires an API key for basic operations (default: true)
|
|
583
|
+
* Some explorers like routescan.io provide free access without API keys
|
|
584
|
+
*/
|
|
585
|
+
requiresExplorerApiKey?: boolean;
|
|
586
|
+
/**
|
|
587
|
+
* Optional chain-specific configuration object for this network.
|
|
588
|
+
* For EVM networks, this should be a Viem Chain object.
|
|
589
|
+
* If provided, this will be used directly by the chain's clients.
|
|
590
|
+
* If not provided, a fallback or minimal custom chain object might be used.
|
|
591
|
+
*/
|
|
592
|
+
viemChain?: unknown;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Solana-specific network configuration
|
|
596
|
+
*/
|
|
597
|
+
interface SolanaNetworkConfig extends BaseNetworkConfig {
|
|
598
|
+
ecosystem: 'solana';
|
|
599
|
+
/**
|
|
600
|
+
* RPC endpoint for Solana network
|
|
601
|
+
*/
|
|
602
|
+
rpcEndpoint: string;
|
|
603
|
+
/**
|
|
604
|
+
* Solana transaction confirmation commitment level
|
|
605
|
+
*/
|
|
606
|
+
commitment: 'confirmed' | 'finalized';
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Stellar-specific network configuration
|
|
610
|
+
*/
|
|
611
|
+
interface StellarNetworkConfig extends BaseNetworkConfig {
|
|
612
|
+
ecosystem: 'stellar';
|
|
613
|
+
/**
|
|
614
|
+
* Horizon server URL (for Stellar Classic operations)
|
|
615
|
+
*/
|
|
616
|
+
horizonUrl: string;
|
|
617
|
+
/**
|
|
618
|
+
* Soroban RPC server URL (for smart contract operations)
|
|
619
|
+
*/
|
|
620
|
+
sorobanRpcUrl: string;
|
|
621
|
+
/**
|
|
622
|
+
* Stellar network passphrase
|
|
623
|
+
*/
|
|
624
|
+
networkPassphrase: string;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Midnight-specific network configuration
|
|
628
|
+
*/
|
|
629
|
+
interface MidnightNetworkConfig extends BaseNetworkConfig {
|
|
630
|
+
ecosystem: 'midnight';
|
|
631
|
+
/**
|
|
632
|
+
* Midnight Network ID enum value
|
|
633
|
+
* Maps to @midnight-ntwrk/midnight-js-network-id NetworkId enum
|
|
634
|
+
* Single source of truth for network identity when mapping is not provided.
|
|
635
|
+
*/
|
|
636
|
+
/**
|
|
637
|
+
* Mapping of numeric network ID to its enum name.
|
|
638
|
+
* Example: { 2: 'TestNet' }
|
|
639
|
+
*/
|
|
640
|
+
networkId: Partial<Record<2 | 3 | 1 | 0, 'TestNet' | 'MainNet' | 'DevNet' | 'Undeployed'>>;
|
|
641
|
+
/**
|
|
642
|
+
* RPC endpoints for the Midnight network
|
|
643
|
+
*/
|
|
644
|
+
rpcEndpoints?: {
|
|
645
|
+
default?: string;
|
|
646
|
+
[key: string]: string | undefined;
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Polkadot execution type - currently supports EVM, with future Substrate support planned
|
|
651
|
+
*/
|
|
652
|
+
type PolkadotExecutionType = 'evm' | 'substrate';
|
|
653
|
+
/**
|
|
654
|
+
* Polkadot network category for UI grouping
|
|
655
|
+
*/
|
|
656
|
+
type PolkadotNetworkCategory = 'hub' | 'parachain';
|
|
657
|
+
/**
|
|
658
|
+
* Polkadot relay chain identifier
|
|
659
|
+
*/
|
|
660
|
+
type PolkadotRelayChain = 'polkadot' | 'kusama';
|
|
661
|
+
/**
|
|
662
|
+
* Polkadot-specific network configuration
|
|
663
|
+
* Extends EVM config since all current Polkadot networks are EVM-compatible.
|
|
664
|
+
* Adds Polkadot-specific fields for execution type routing and UI grouping.
|
|
665
|
+
*/
|
|
666
|
+
interface PolkadotNetworkConfig extends Omit<EvmNetworkConfig, 'ecosystem'> {
|
|
667
|
+
ecosystem: 'polkadot';
|
|
668
|
+
/**
|
|
669
|
+
* Execution type for this network
|
|
670
|
+
* - 'evm': EVM-compatible (current support)
|
|
671
|
+
* - 'substrate': Native Substrate/Wasm (future support)
|
|
672
|
+
*/
|
|
673
|
+
executionType: PolkadotExecutionType;
|
|
674
|
+
/**
|
|
675
|
+
* Network category for UI grouping
|
|
676
|
+
* - 'hub': Polkadot/Kusama Hub (Asset Hub) - prioritized in UI
|
|
677
|
+
* - 'parachain': Parachains like Moonbeam, Moonriver
|
|
678
|
+
*/
|
|
679
|
+
networkCategory: PolkadotNetworkCategory;
|
|
680
|
+
/**
|
|
681
|
+
* Optional relay chain identifier
|
|
682
|
+
* - 'polkadot': Connected to Polkadot relay chain
|
|
683
|
+
* - 'kusama': Connected to Kusama relay chain
|
|
684
|
+
* - undefined: Testnet or standalone
|
|
685
|
+
*/
|
|
686
|
+
relayChain?: PolkadotRelayChain;
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* Union type for all network configurations
|
|
690
|
+
* This allows us to handle network configurations in a type-safe manner
|
|
691
|
+
*/
|
|
692
|
+
type NetworkConfig = EvmNetworkConfig | SolanaNetworkConfig | StellarNetworkConfig | MidnightNetworkConfig | PolkadotNetworkConfig;
|
|
693
|
+
/**
|
|
694
|
+
* Type guard to check if a network config is for EVM
|
|
695
|
+
* @param config The network configuration to check
|
|
696
|
+
* @returns True if the config is for EVM
|
|
697
|
+
*/
|
|
698
|
+
declare const isEvmNetworkConfig: (config: NetworkConfig) => config is EvmNetworkConfig;
|
|
699
|
+
/**
|
|
700
|
+
* Type guard to check if a network config is for Solana
|
|
701
|
+
* @param config The network configuration to check
|
|
702
|
+
* @returns True if the config is for Solana
|
|
703
|
+
*/
|
|
704
|
+
declare const isSolanaNetworkConfig: (config: NetworkConfig) => config is SolanaNetworkConfig;
|
|
705
|
+
/**
|
|
706
|
+
* Type guard to check if a network config is for Stellar
|
|
707
|
+
* @param config The network configuration to check
|
|
708
|
+
* @returns True if the config is for Stellar
|
|
709
|
+
*/
|
|
710
|
+
declare const isStellarNetworkConfig: (config: NetworkConfig) => config is StellarNetworkConfig;
|
|
711
|
+
/**
|
|
712
|
+
* Type guard to check if a network config is for Midnight
|
|
713
|
+
* @param config The network configuration to check
|
|
714
|
+
* @returns True if the config is for Midnight
|
|
715
|
+
*/
|
|
716
|
+
declare const isMidnightNetworkConfig: (config: NetworkConfig) => config is MidnightNetworkConfig;
|
|
717
|
+
/**
|
|
718
|
+
* Type guard to check if a network config is for Polkadot
|
|
719
|
+
* @param config The network configuration to check
|
|
720
|
+
* @returns True if the config is for Polkadot
|
|
721
|
+
*/
|
|
722
|
+
declare const isPolkadotNetworkConfig: (config: NetworkConfig) => config is PolkadotNetworkConfig;
|
|
723
|
+
//#endregion
|
|
724
|
+
//#region src/common/address-book-widget.d.ts
|
|
725
|
+
/**
|
|
726
|
+
* A single alias record as consumed by the Address Book widget.
|
|
727
|
+
*
|
|
728
|
+
* Intentionally a plain data shape (no storage-specific fields) so the
|
|
729
|
+
* widget stays storage-agnostic.
|
|
730
|
+
*/
|
|
731
|
+
interface AddressBookAlias {
|
|
732
|
+
id: string;
|
|
733
|
+
address: string;
|
|
734
|
+
alias: string;
|
|
735
|
+
networkId?: string;
|
|
736
|
+
createdAt: Date;
|
|
737
|
+
updatedAt: Date;
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Props accepted by `AddressBookWidget` in `@openzeppelin/ui-renderer`.
|
|
741
|
+
*
|
|
742
|
+
* All data and mutations are provided via props (dependency injection),
|
|
743
|
+
* keeping the widget free of storage dependencies. The bridge hook
|
|
744
|
+
* `useAddressBookWidgetProps` in `@openzeppelin/ui-storage` returns this
|
|
745
|
+
* exact shape, ready to spread:
|
|
746
|
+
*
|
|
747
|
+
* @example
|
|
748
|
+
* ```tsx
|
|
749
|
+
* const widgetProps = useAddressBookWidgetProps(db, { networkId });
|
|
750
|
+
* <AddressBookWidget {...widgetProps} />
|
|
751
|
+
* ```
|
|
752
|
+
*/
|
|
753
|
+
interface AddressBookWidgetProps {
|
|
754
|
+
/** All alias records — `undefined` while the initial load is in progress */
|
|
755
|
+
aliases: AddressBookAlias[] | undefined;
|
|
756
|
+
/** `true` during the initial data load */
|
|
757
|
+
isLoading: boolean;
|
|
758
|
+
/** Create or update an alias. Returns the record ID. */
|
|
759
|
+
onSave: (input: {
|
|
760
|
+
address: string;
|
|
761
|
+
alias: string;
|
|
762
|
+
networkId?: string;
|
|
763
|
+
}) => Promise<string>;
|
|
764
|
+
/** Remove an alias by ID */
|
|
765
|
+
onRemove: (id: string) => Promise<void>;
|
|
766
|
+
/** Clear all aliases */
|
|
767
|
+
onClear: () => Promise<void>;
|
|
768
|
+
/** Export aliases as a downloadable JSON file */
|
|
769
|
+
onExport: (ids?: string[]) => Promise<void>;
|
|
770
|
+
/** Import aliases from a user-selected File */
|
|
771
|
+
onImport: (file: File) => Promise<string[]>;
|
|
772
|
+
/** Current network ID for scoping display */
|
|
773
|
+
currentNetworkId?: string;
|
|
774
|
+
/** Resolve a network ID to its full config (for network badge display) */
|
|
775
|
+
resolveNetwork?: (networkId: string) => NetworkConfig | undefined;
|
|
776
|
+
/** Resolve a full explorer URL for an address (ecosystem-aware) */
|
|
777
|
+
resolveExplorerUrl?: (address: string, networkId?: string) => string | undefined;
|
|
778
|
+
/** Adapter for chain-specific address validation (used as default when no network selected) */
|
|
779
|
+
adapter?: ContractAdapter;
|
|
780
|
+
/** Resolve an adapter for a given network (enables validation when user changes network) */
|
|
781
|
+
resolveAdapter?: (network: NetworkConfig) => Promise<ContractAdapter | undefined>;
|
|
782
|
+
/** Ecosystem-aware address placeholder (used as default when no network selected) */
|
|
783
|
+
addressPlaceholder?: string;
|
|
784
|
+
/** Resolve an address placeholder for a given network (e.g. "0x..." for EVM, "G..." for Stellar) */
|
|
785
|
+
resolveAddressPlaceholder?: (network: NetworkConfig) => string | undefined;
|
|
786
|
+
/** All available networks (enables network selection and filtering) */
|
|
787
|
+
networks?: NetworkConfig[];
|
|
788
|
+
/** Currently active network filter (multi-select) — empty means show all */
|
|
789
|
+
filterNetworkIds?: string[];
|
|
790
|
+
/** Callback when the user changes the network filter selection */
|
|
791
|
+
onFilterNetworkIdsChange?: (networkIds: string[]) => void;
|
|
792
|
+
/** Custom title displayed in the card header (defaults to "Address Book") */
|
|
793
|
+
title?: string;
|
|
794
|
+
/** Additional CSS classes */
|
|
795
|
+
className?: string;
|
|
796
|
+
}
|
|
797
|
+
//#endregion
|
|
798
|
+
//#region src/common/address-label.d.ts
|
|
799
|
+
/**
|
|
800
|
+
* Address Label Resolution Types
|
|
801
|
+
*
|
|
802
|
+
* Generic interface for resolving human-readable labels for blockchain addresses.
|
|
803
|
+
* Consumed by `AddressDisplay` via `AddressLabelContext` in `@openzeppelin/ui-components`.
|
|
804
|
+
*
|
|
805
|
+
* Implementations may use alias storage, ENS, a REST API, or any other source.
|
|
806
|
+
* The interface is intentionally storage-agnostic to preserve the library's
|
|
807
|
+
* layered architecture (ui-types → ui-components → ui-storage).
|
|
808
|
+
*
|
|
809
|
+
* @see {@link AddressLabelResolver} for the main resolver interface
|
|
810
|
+
*/
|
|
811
|
+
/**
|
|
812
|
+
* Generic interface for resolving human-readable labels for blockchain addresses.
|
|
813
|
+
*
|
|
814
|
+
* The `resolveLabel` function **must be synchronous** because it is called during
|
|
815
|
+
* React render. Implementations should maintain an in-memory cache or reactive
|
|
816
|
+
* data source (e.g., Dexie `useLiveQuery`) and resolve from it synchronously.
|
|
817
|
+
*
|
|
818
|
+
* @example
|
|
819
|
+
* ```typescript
|
|
820
|
+
* // Minimal implementation backed by a static map
|
|
821
|
+
* const resolver: AddressLabelResolver = {
|
|
822
|
+
* resolveLabel: (address) => addressBook.get(address.toLowerCase()),
|
|
823
|
+
* };
|
|
824
|
+
*
|
|
825
|
+
* // Full implementation with edit support
|
|
826
|
+
* const resolver: AddressLabelResolver = {
|
|
827
|
+
* resolveLabel: (address, networkId) =>
|
|
828
|
+
* aliases.find(a => a.address === address && a.networkId === networkId)?.alias,
|
|
829
|
+
* onEditLabel: (address, networkId) => openEditDialog(address, networkId),
|
|
830
|
+
* };
|
|
831
|
+
* ```
|
|
832
|
+
*/
|
|
833
|
+
interface AddressLabelResolver {
|
|
834
|
+
/**
|
|
835
|
+
* Synchronously resolve an address to a human-readable label.
|
|
836
|
+
*
|
|
837
|
+
* @param address - The blockchain address to resolve
|
|
838
|
+
* @param networkId - Optional network identifier (e.g., 'ethereum-mainnet')
|
|
839
|
+
* @returns The label string, or `undefined` if no label exists for this address
|
|
840
|
+
*/
|
|
841
|
+
resolveLabel: (address: string, networkId?: string) => string | undefined;
|
|
842
|
+
/**
|
|
843
|
+
* Optional callback to trigger label editing UI for the given address.
|
|
844
|
+
* When provided, `AddressDisplay` renders an edit affordance (e.g., pencil icon).
|
|
845
|
+
*
|
|
846
|
+
* @param address - The blockchain address to edit the label for
|
|
847
|
+
* @param networkId - Optional network identifier
|
|
848
|
+
*/
|
|
849
|
+
onEditLabel?: (address: string, networkId?: string) => void;
|
|
850
|
+
}
|
|
851
|
+
//#endregion
|
|
852
|
+
//#region src/common/address-suggestion.d.ts
|
|
853
|
+
/**
|
|
854
|
+
* Address Suggestion Types
|
|
855
|
+
*
|
|
856
|
+
* Generic interface for providing address autocomplete suggestions.
|
|
857
|
+
* Consumed by `AddressField` via `AddressSuggestionContext` in `@openzeppelin/ui-components`.
|
|
858
|
+
*
|
|
859
|
+
* Implementations may use alias storage, ENS, an address book API, or any other source.
|
|
860
|
+
* The interface is intentionally storage-agnostic to preserve the library's
|
|
861
|
+
* layered architecture (ui-types → ui-components → ui-storage).
|
|
862
|
+
*/
|
|
863
|
+
/**
|
|
864
|
+
* A single address suggestion displayed in the autocomplete dropdown.
|
|
865
|
+
*
|
|
866
|
+
* @example
|
|
867
|
+
* ```typescript
|
|
868
|
+
* const suggestion: AddressSuggestion = {
|
|
869
|
+
* label: 'Treasury',
|
|
870
|
+
* value: '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18',
|
|
871
|
+
* description: 'Main treasury wallet',
|
|
872
|
+
* };
|
|
873
|
+
* ```
|
|
874
|
+
*/
|
|
875
|
+
interface AddressSuggestion {
|
|
876
|
+
/** Human-readable label for the suggestion (e.g., alias name) */
|
|
877
|
+
label: string;
|
|
878
|
+
/** The blockchain address to fill when selected */
|
|
879
|
+
value: string;
|
|
880
|
+
/** Optional secondary text (e.g., network name or description) */
|
|
881
|
+
description?: string;
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* Generic interface for resolving address suggestions from a query string.
|
|
885
|
+
*
|
|
886
|
+
* The `resolveSuggestions` function is called on every input change (after
|
|
887
|
+
* debouncing) and **must be synchronous**. Implementations should maintain
|
|
888
|
+
* an in-memory data source (e.g., Dexie `useLiveQuery`) and filter from it.
|
|
889
|
+
*
|
|
890
|
+
* @example
|
|
891
|
+
* ```typescript
|
|
892
|
+
* const resolver: AddressSuggestionResolver = {
|
|
893
|
+
* resolveSuggestions: (query) =>
|
|
894
|
+
* aliases
|
|
895
|
+
* .filter(a => a.alias.toLowerCase().includes(query.toLowerCase()))
|
|
896
|
+
* .map(a => ({ label: a.alias, value: a.address })),
|
|
897
|
+
* };
|
|
898
|
+
* ```
|
|
899
|
+
*/
|
|
900
|
+
interface AddressSuggestionResolver {
|
|
901
|
+
/**
|
|
902
|
+
* Synchronously resolve a query string into a list of address suggestions.
|
|
903
|
+
*
|
|
904
|
+
* @param query - The current input value to match against
|
|
905
|
+
* @param networkId - Optional network identifier for scoping results
|
|
906
|
+
* @returns Array of matching suggestions, ordered by relevance
|
|
907
|
+
*/
|
|
908
|
+
resolveSuggestions: (query: string, networkId?: string) => AddressSuggestion[];
|
|
909
|
+
}
|
|
910
|
+
//#endregion
|
|
475
911
|
//#region src/common/enum.d.ts
|
|
476
912
|
/**
|
|
477
913
|
* Chain-Agnostic Enum Types
|
|
@@ -1004,255 +1440,6 @@ interface TransactionFormProps {
|
|
|
1004
1440
|
executionConfig?: ExecutionConfig;
|
|
1005
1441
|
}
|
|
1006
1442
|
//#endregion
|
|
1007
|
-
//#region src/networks/config.d.ts
|
|
1008
|
-
/**
|
|
1009
|
-
* Base interface with common properties shared across all network configurations
|
|
1010
|
-
*/
|
|
1011
|
-
interface BaseNetworkConfig {
|
|
1012
|
-
/**
|
|
1013
|
-
* Unique identifier for the network, e.g., 'ethereum-mainnet', 'polygon-amoy'
|
|
1014
|
-
*/
|
|
1015
|
-
id: string;
|
|
1016
|
-
/**
|
|
1017
|
-
* User-friendly network name, e.g., 'Ethereum Mainnet'
|
|
1018
|
-
*/
|
|
1019
|
-
name: string;
|
|
1020
|
-
/**
|
|
1021
|
-
* The blockchain ecosystem this network belongs to (discriminant for the union type)
|
|
1022
|
-
*/
|
|
1023
|
-
ecosystem: Ecosystem;
|
|
1024
|
-
/**
|
|
1025
|
-
* Parent network name, e.g., 'ethereum', 'polygon'
|
|
1026
|
-
*/
|
|
1027
|
-
network: string;
|
|
1028
|
-
/**
|
|
1029
|
-
* Network type/environment: 'mainnet', 'testnet', or 'devnet'
|
|
1030
|
-
*/
|
|
1031
|
-
type: NetworkType;
|
|
1032
|
-
/**
|
|
1033
|
-
* Explicit flag for easy filtering of test networks
|
|
1034
|
-
*/
|
|
1035
|
-
isTestnet: boolean;
|
|
1036
|
-
/**
|
|
1037
|
-
* The constant name under which this specific network configuration object
|
|
1038
|
-
* is exported from its adapter package's network index file.
|
|
1039
|
-
* Used by the export system to dynamically import the correct config.
|
|
1040
|
-
* Example: 'ethereumMainnet', 'ethereumSepolia'
|
|
1041
|
-
*/
|
|
1042
|
-
exportConstName: string;
|
|
1043
|
-
/**
|
|
1044
|
-
* Base URL for the block explorer (common across ecosystems)
|
|
1045
|
-
*/
|
|
1046
|
-
explorerUrl?: string;
|
|
1047
|
-
/**
|
|
1048
|
-
* Optional React component for the network icon.
|
|
1049
|
-
* This allows embedding the icon component directly in the network config,
|
|
1050
|
-
* avoiding dynamic imports and improving build performance.
|
|
1051
|
-
* If provided, this takes precedence over the icon string.
|
|
1052
|
-
*/
|
|
1053
|
-
iconComponent?: React$1.ComponentType<{
|
|
1054
|
-
size?: number;
|
|
1055
|
-
className?: string;
|
|
1056
|
-
variant?: 'mono' | 'branded';
|
|
1057
|
-
}>;
|
|
1058
|
-
/**
|
|
1059
|
-
* A unique identifier for the specific explorer API service used by this network.
|
|
1060
|
-
* This is used by the AppConfigService to fetch the correct API key.
|
|
1061
|
-
* Examples: "etherscan-mainnet", "polygonscan-mainnet", "bscscan-mainnet"
|
|
1062
|
-
* Should align with keys in AppRuntimeConfig.networkServiceConfigs
|
|
1063
|
-
*/
|
|
1064
|
-
primaryExplorerApiIdentifier?: string;
|
|
1065
|
-
/**
|
|
1066
|
-
* Optional indexer GraphQL HTTP endpoint
|
|
1067
|
-
* Used for querying historical blockchain data (e.g., access control events)
|
|
1068
|
-
*/
|
|
1069
|
-
indexerUri?: string;
|
|
1070
|
-
/**
|
|
1071
|
-
* Optional indexer GraphQL WebSocket endpoint
|
|
1072
|
-
* Used for real-time blockchain data subscriptions
|
|
1073
|
-
*/
|
|
1074
|
-
indexerWsUri?: string;
|
|
1075
|
-
/**
|
|
1076
|
-
* Optional GraphQL endpoint for the access control indexer.
|
|
1077
|
-
* Used by the access control module for historical queries and role discovery.
|
|
1078
|
-
* Feature-specific field — distinct from the general-purpose `indexerUri` which
|
|
1079
|
-
* may serve different purposes per ecosystem (e.g., Midnight chain indexer).
|
|
1080
|
-
*/
|
|
1081
|
-
accessControlIndexerUrl?: string;
|
|
1082
|
-
}
|
|
1083
|
-
/**
|
|
1084
|
-
* EVM-specific network configuration
|
|
1085
|
-
*/
|
|
1086
|
-
interface EvmNetworkConfig extends BaseNetworkConfig {
|
|
1087
|
-
ecosystem: 'evm';
|
|
1088
|
-
/**
|
|
1089
|
-
* EVM chain ID, e.g., 1 for Ethereum Mainnet, 11155111 for Sepolia
|
|
1090
|
-
*/
|
|
1091
|
-
chainId: number;
|
|
1092
|
-
/**
|
|
1093
|
-
* JSON-RPC endpoint for the network (can be a base URL if API key is resolved from env)
|
|
1094
|
-
*/
|
|
1095
|
-
rpcUrl: string;
|
|
1096
|
-
/**
|
|
1097
|
-
* Native currency information
|
|
1098
|
-
*/
|
|
1099
|
-
nativeCurrency: {
|
|
1100
|
-
name: string;
|
|
1101
|
-
symbol: string;
|
|
1102
|
-
decimals: number;
|
|
1103
|
-
};
|
|
1104
|
-
/**
|
|
1105
|
-
* Optional icon name for the network (for use with @web3icons/react or similar)
|
|
1106
|
-
* If not provided, the network property will be used as a fallback
|
|
1107
|
-
*/
|
|
1108
|
-
apiUrl?: string;
|
|
1109
|
-
/**
|
|
1110
|
-
* Whether this network supports Etherscan V2 API (default: true for all Etherscan-compatible explorers)
|
|
1111
|
-
*/
|
|
1112
|
-
supportsEtherscanV2?: boolean;
|
|
1113
|
-
/**
|
|
1114
|
-
* Whether this network's explorer requires an API key for basic operations (default: true)
|
|
1115
|
-
* Some explorers like routescan.io provide free access without API keys
|
|
1116
|
-
*/
|
|
1117
|
-
requiresExplorerApiKey?: boolean;
|
|
1118
|
-
/**
|
|
1119
|
-
* Optional chain-specific configuration object for this network.
|
|
1120
|
-
* For EVM networks, this should be a Viem Chain object.
|
|
1121
|
-
* If provided, this will be used directly by the chain's clients.
|
|
1122
|
-
* If not provided, a fallback or minimal custom chain object might be used.
|
|
1123
|
-
*/
|
|
1124
|
-
viemChain?: unknown;
|
|
1125
|
-
}
|
|
1126
|
-
/**
|
|
1127
|
-
* Solana-specific network configuration
|
|
1128
|
-
*/
|
|
1129
|
-
interface SolanaNetworkConfig extends BaseNetworkConfig {
|
|
1130
|
-
ecosystem: 'solana';
|
|
1131
|
-
/**
|
|
1132
|
-
* RPC endpoint for Solana network
|
|
1133
|
-
*/
|
|
1134
|
-
rpcEndpoint: string;
|
|
1135
|
-
/**
|
|
1136
|
-
* Solana transaction confirmation commitment level
|
|
1137
|
-
*/
|
|
1138
|
-
commitment: 'confirmed' | 'finalized';
|
|
1139
|
-
}
|
|
1140
|
-
/**
|
|
1141
|
-
* Stellar-specific network configuration
|
|
1142
|
-
*/
|
|
1143
|
-
interface StellarNetworkConfig extends BaseNetworkConfig {
|
|
1144
|
-
ecosystem: 'stellar';
|
|
1145
|
-
/**
|
|
1146
|
-
* Horizon server URL (for Stellar Classic operations)
|
|
1147
|
-
*/
|
|
1148
|
-
horizonUrl: string;
|
|
1149
|
-
/**
|
|
1150
|
-
* Soroban RPC server URL (for smart contract operations)
|
|
1151
|
-
*/
|
|
1152
|
-
sorobanRpcUrl: string;
|
|
1153
|
-
/**
|
|
1154
|
-
* Stellar network passphrase
|
|
1155
|
-
*/
|
|
1156
|
-
networkPassphrase: string;
|
|
1157
|
-
}
|
|
1158
|
-
/**
|
|
1159
|
-
* Midnight-specific network configuration
|
|
1160
|
-
*/
|
|
1161
|
-
interface MidnightNetworkConfig extends BaseNetworkConfig {
|
|
1162
|
-
ecosystem: 'midnight';
|
|
1163
|
-
/**
|
|
1164
|
-
* Midnight Network ID enum value
|
|
1165
|
-
* Maps to @midnight-ntwrk/midnight-js-network-id NetworkId enum
|
|
1166
|
-
* Single source of truth for network identity when mapping is not provided.
|
|
1167
|
-
*/
|
|
1168
|
-
/**
|
|
1169
|
-
* Mapping of numeric network ID to its enum name.
|
|
1170
|
-
* Example: { 2: 'TestNet' }
|
|
1171
|
-
*/
|
|
1172
|
-
networkId: Partial<Record<2 | 3 | 1 | 0, 'TestNet' | 'MainNet' | 'DevNet' | 'Undeployed'>>;
|
|
1173
|
-
/**
|
|
1174
|
-
* RPC endpoints for the Midnight network
|
|
1175
|
-
*/
|
|
1176
|
-
rpcEndpoints?: {
|
|
1177
|
-
default?: string;
|
|
1178
|
-
[key: string]: string | undefined;
|
|
1179
|
-
};
|
|
1180
|
-
}
|
|
1181
|
-
/**
|
|
1182
|
-
* Polkadot execution type - currently supports EVM, with future Substrate support planned
|
|
1183
|
-
*/
|
|
1184
|
-
type PolkadotExecutionType = 'evm' | 'substrate';
|
|
1185
|
-
/**
|
|
1186
|
-
* Polkadot network category for UI grouping
|
|
1187
|
-
*/
|
|
1188
|
-
type PolkadotNetworkCategory = 'hub' | 'parachain';
|
|
1189
|
-
/**
|
|
1190
|
-
* Polkadot relay chain identifier
|
|
1191
|
-
*/
|
|
1192
|
-
type PolkadotRelayChain = 'polkadot' | 'kusama';
|
|
1193
|
-
/**
|
|
1194
|
-
* Polkadot-specific network configuration
|
|
1195
|
-
* Extends EVM config since all current Polkadot networks are EVM-compatible.
|
|
1196
|
-
* Adds Polkadot-specific fields for execution type routing and UI grouping.
|
|
1197
|
-
*/
|
|
1198
|
-
interface PolkadotNetworkConfig extends Omit<EvmNetworkConfig, 'ecosystem'> {
|
|
1199
|
-
ecosystem: 'polkadot';
|
|
1200
|
-
/**
|
|
1201
|
-
* Execution type for this network
|
|
1202
|
-
* - 'evm': EVM-compatible (current support)
|
|
1203
|
-
* - 'substrate': Native Substrate/Wasm (future support)
|
|
1204
|
-
*/
|
|
1205
|
-
executionType: PolkadotExecutionType;
|
|
1206
|
-
/**
|
|
1207
|
-
* Network category for UI grouping
|
|
1208
|
-
* - 'hub': Polkadot/Kusama Hub (Asset Hub) - prioritized in UI
|
|
1209
|
-
* - 'parachain': Parachains like Moonbeam, Moonriver
|
|
1210
|
-
*/
|
|
1211
|
-
networkCategory: PolkadotNetworkCategory;
|
|
1212
|
-
/**
|
|
1213
|
-
* Optional relay chain identifier
|
|
1214
|
-
* - 'polkadot': Connected to Polkadot relay chain
|
|
1215
|
-
* - 'kusama': Connected to Kusama relay chain
|
|
1216
|
-
* - undefined: Testnet or standalone
|
|
1217
|
-
*/
|
|
1218
|
-
relayChain?: PolkadotRelayChain;
|
|
1219
|
-
}
|
|
1220
|
-
/**
|
|
1221
|
-
* Union type for all network configurations
|
|
1222
|
-
* This allows us to handle network configurations in a type-safe manner
|
|
1223
|
-
*/
|
|
1224
|
-
type NetworkConfig = EvmNetworkConfig | SolanaNetworkConfig | StellarNetworkConfig | MidnightNetworkConfig | PolkadotNetworkConfig;
|
|
1225
|
-
/**
|
|
1226
|
-
* Type guard to check if a network config is for EVM
|
|
1227
|
-
* @param config The network configuration to check
|
|
1228
|
-
* @returns True if the config is for EVM
|
|
1229
|
-
*/
|
|
1230
|
-
declare const isEvmNetworkConfig: (config: NetworkConfig) => config is EvmNetworkConfig;
|
|
1231
|
-
/**
|
|
1232
|
-
* Type guard to check if a network config is for Solana
|
|
1233
|
-
* @param config The network configuration to check
|
|
1234
|
-
* @returns True if the config is for Solana
|
|
1235
|
-
*/
|
|
1236
|
-
declare const isSolanaNetworkConfig: (config: NetworkConfig) => config is SolanaNetworkConfig;
|
|
1237
|
-
/**
|
|
1238
|
-
* Type guard to check if a network config is for Stellar
|
|
1239
|
-
* @param config The network configuration to check
|
|
1240
|
-
* @returns True if the config is for Stellar
|
|
1241
|
-
*/
|
|
1242
|
-
declare const isStellarNetworkConfig: (config: NetworkConfig) => config is StellarNetworkConfig;
|
|
1243
|
-
/**
|
|
1244
|
-
* Type guard to check if a network config is for Midnight
|
|
1245
|
-
* @param config The network configuration to check
|
|
1246
|
-
* @returns True if the config is for Midnight
|
|
1247
|
-
*/
|
|
1248
|
-
declare const isMidnightNetworkConfig: (config: NetworkConfig) => config is MidnightNetworkConfig;
|
|
1249
|
-
/**
|
|
1250
|
-
* Type guard to check if a network config is for Polkadot
|
|
1251
|
-
* @param config The network configuration to check
|
|
1252
|
-
* @returns True if the config is for Polkadot
|
|
1253
|
-
*/
|
|
1254
|
-
declare const isPolkadotNetworkConfig: (config: NetworkConfig) => config is PolkadotNetworkConfig;
|
|
1255
|
-
//#endregion
|
|
1256
1443
|
//#region src/networks/validation.d.ts
|
|
1257
1444
|
/**
|
|
1258
1445
|
* Validate a network configuration
|
|
@@ -3246,5 +3433,5 @@ declare class OperationFailed extends AccessControlError {
|
|
|
3246
3433
|
*/
|
|
3247
3434
|
type FullContractAdapter = ContractAdapter & ContractStateCapabilities;
|
|
3248
3435
|
//#endregion
|
|
3249
|
-
export { AccessControlCapabilities, AccessControlError, AccessControlService, AccessSnapshot, AdapterConfig, AdapterExportBootstrap, AdapterExportContext, AdminDelayInfo, AdminInfo, AdminState, AppRuntimeConfig, AvailableUiKit, BaseComponentProps, BaseNetworkConfig, BuilderFormConfigLike, CommonFormProperties, ComponentExclusionConfig, ConfigurationInvalid, Connector, ContractAdapter, ContractDefinitionComparisonResult, ContractDefinitionDifference, ContractDefinitionMetadata, ContractDefinitionValidationResult, ContractEvent, ContractFunction, ContractSchema, ContractStateCapabilities, DynamicTypePattern, ECOSYSTEM_WALLET_COMPONENT_KEYS, Ecosystem, EcosystemExport, EcosystemFeatureConfig, EcosystemMetadata, EcosystemReactUiProviderProps, EcosystemSpecificReactHooks, EcosystemWalletComponentKey, EcosystemWalletComponents, EnrichedRoleAssignment, EnrichedRoleMember, EnumValue, EoaExecutionConfig, EvmNetworkConfig, ExecutionConfig, ExecutionMethodDetail, ExecutionMethodType, ExpirationMetadata, ExplorerApiConfig, FeatureFlags, FieldCondition, FieldTransforms, FieldType, FieldValidation, FieldValue, FormError, FormFieldType, FormLayout, FormValues, FullContractAdapter, FunctionBadge, FunctionBadgeVariant, FunctionDecoration, FunctionDecorationsMap, FunctionParameter, GlobalServiceConfigs, HistoryChangeType, HistoryEntry, HistoryQueryOptions, IndexerEndpointConfig, IndexerUnavailable, MapEntry, MidnightNetworkConfig, MultisigExecutionConfig, NativeConfigLoader, NetworkConfig, NetworkServiceConfigs, NetworkServiceForm, NetworkSpecificIndexerEndpoints, NetworkSpecificRpcEndpoints, NetworkType, OperationFailed, OperationResult, OwnershipInfo, OwnershipState, PageInfo, PaginatedHistoryResult, PendingAdminTransfer, PendingOwnershipTransfer, PermissionDenied, PolkadotExecutionType, PolkadotNetworkCategory, PolkadotNetworkConfig, PolkadotRelayChain, ProxyInfo, RelayerDetails, RelayerDetailsRich, RelayerExecutionConfig, RenderFormSchema, RoleAssignment, RoleIdentifier, RpcEndpointConfig, RuntimeSecretPropertyInput, ServiceParameterConfig, SolanaNetworkConfig, StellarNetworkConfig, SubmitButtonConfig, TransactionFormProps, TransactionStatusUpdate, TxStatus, TypeMappingInfo, UiKitConfiguration, UiKitName, UnsupportedContractFeatures, UserExplorerConfig, UserRpcProviderConfig, ViteConfigInfo, WalletComponentSize, WalletComponentVariant, WalletConnectionStatus, isEnumValue, isEvmEcosystem, isEvmNetworkConfig, isMapEntry, isMapEntryArray, isMidnightEcosystem, isMidnightNetworkConfig, isPolkadotEcosystem, isPolkadotNetworkConfig, isSolanaEcosystem, isSolanaNetworkConfig, isStellarEcosystem, isStellarNetworkConfig, validateNetworkConfig };
|
|
3436
|
+
export { AccessControlCapabilities, AccessControlError, AccessControlService, AccessSnapshot, AdapterConfig, AdapterExportBootstrap, AdapterExportContext, AddressBookAlias, AddressBookWidgetProps, AddressLabelResolver, AddressSuggestion, AddressSuggestionResolver, AdminDelayInfo, AdminInfo, AdminState, AppRuntimeConfig, AvailableUiKit, BaseComponentProps, BaseNetworkConfig, BuilderFormConfigLike, CommonFormProperties, ComponentExclusionConfig, ConfigurationInvalid, Connector, ContractAdapter, ContractDefinitionComparisonResult, ContractDefinitionDifference, ContractDefinitionMetadata, ContractDefinitionValidationResult, ContractEvent, ContractFunction, ContractSchema, ContractStateCapabilities, DynamicTypePattern, ECOSYSTEM_WALLET_COMPONENT_KEYS, Ecosystem, EcosystemExport, EcosystemFeatureConfig, EcosystemMetadata, EcosystemReactUiProviderProps, EcosystemSpecificReactHooks, EcosystemWalletComponentKey, EcosystemWalletComponents, EnrichedRoleAssignment, EnrichedRoleMember, EnumValue, EoaExecutionConfig, EvmNetworkConfig, ExecutionConfig, ExecutionMethodDetail, ExecutionMethodType, ExpirationMetadata, ExplorerApiConfig, FeatureFlags, FieldCondition, FieldTransforms, FieldType, FieldValidation, FieldValue, FormError, FormFieldType, FormLayout, FormValues, FullContractAdapter, FunctionBadge, FunctionBadgeVariant, FunctionDecoration, FunctionDecorationsMap, FunctionParameter, GlobalServiceConfigs, HistoryChangeType, HistoryEntry, HistoryQueryOptions, IndexerEndpointConfig, IndexerUnavailable, MapEntry, MidnightNetworkConfig, MultisigExecutionConfig, NativeConfigLoader, NetworkConfig, NetworkServiceConfigs, NetworkServiceForm, NetworkSpecificIndexerEndpoints, NetworkSpecificRpcEndpoints, NetworkType, OperationFailed, OperationResult, OwnershipInfo, OwnershipState, PageInfo, PaginatedHistoryResult, PendingAdminTransfer, PendingOwnershipTransfer, PermissionDenied, PolkadotExecutionType, PolkadotNetworkCategory, PolkadotNetworkConfig, PolkadotRelayChain, ProxyInfo, RelayerDetails, RelayerDetailsRich, RelayerExecutionConfig, RenderFormSchema, RoleAssignment, RoleIdentifier, RpcEndpointConfig, RuntimeSecretPropertyInput, ServiceParameterConfig, SolanaNetworkConfig, StellarNetworkConfig, SubmitButtonConfig, TransactionFormProps, TransactionStatusUpdate, TxStatus, TypeMappingInfo, UiKitConfiguration, UiKitName, UnsupportedContractFeatures, UserExplorerConfig, UserRpcProviderConfig, ViteConfigInfo, WalletComponentSize, WalletComponentVariant, WalletConnectionStatus, isEnumValue, isEvmEcosystem, isEvmNetworkConfig, isMapEntry, isMapEntryArray, isMidnightEcosystem, isMidnightNetworkConfig, isPolkadotEcosystem, isPolkadotNetworkConfig, isSolanaEcosystem, isSolanaNetworkConfig, isStellarEcosystem, isStellarNetworkConfig, validateNetworkConfig };
|
|
3250
3437
|
//# sourceMappingURL=index.d.mts.map
|