import { ProtocolType, Chain, WalletProvider } from '@swing.xyz/sdk'; import { Connector } from 'wagmi'; /** * Extends the WalletConnector type with additional properties for internal use. * @internal */ interface WalletConnectorInternal extends WalletConnector { __internal?: { isRainbowKitConnector?: boolean; isWalletConnectModalConnector?: boolean; getWagmiConnector?: () => Connector; getQrCodeUri?: (uri: string) => Promise; }; } interface WalletConnector { /** * Unquie identifier for the wallet */ id: string; /** * Wallet name */ name: string; /** * Wallet logo */ logo: string; /** * Type of the connector such as injected, walletconnect, etc. */ type: string; /** * Protocols supported by the wallet such as evm, ibc, solana, bitcoin, etc */ protocols: ProtocolType[]; /** * Get the chains supported by the wallet. */ getSupportedChains: () => string[]; /** * Get the provider for the connector. */ getProvider: (chain?: Chain) => Promise | WalletProvider | undefined; /** * Connect to the wallet. If a chain is provided, the wallet will switch to the chain. */ connect: (chain?: Chain) => Promise<{ accounts: string[]; chainId: string | number; }>; /** * Disconnect from the wallet */ disconnect: () => Promise | void; /** * Switch the current chain of the wallet */ switchChain: (chain: Chain) => Promise; } /** * Get a connector by ID. * * @param connectorId - The ID of the connector. * @returns The connector. */ declare function getConnector(connectorId: string): WalletConnector | undefined; /** * Get configured connectors. * * @param params.protocolTypes - Optionally filter connectors by protocol type. * @param params.chains - Optionally filter connectors by chains. */ declare function getConnectors(params?: { protocolTypes?: ProtocolType[]; chains?: Chain[]; }): WalletConnector[]; /** * Get default connectors. */ declare function getDefaultConnectors(): WalletConnectorInternal[]; declare function createConnector(connector: WalletConnector): WalletConnector; export { type WalletConnector, createConnector, getConnector, getConnectors, getDefaultConnectors };