@turnkey/core
Version:
A core JavaScript web and React Native package for interfacing with Turnkey's infrastructure.
49 lines • 2.39 kB
TypeScript
import { CrossPlatformWalletStamper } from "../stamper";
import { CrossPlatformWalletConnector } from "../connector";
import { TWalletManagerConfig, WalletInterface, WalletProvider, WalletInterfaceType, Chain } from "@types";
export declare class WebWalletManager {
private initializers;
private wcClient?;
readonly wallets: Partial<Record<WalletInterfaceType, WalletInterface>>;
private chainToInterfaces;
readonly stamper?: CrossPlatformWalletStamper;
readonly connector?: CrossPlatformWalletConnector;
/**
* Constructs a WebWalletManager instance based on the provided configuration.
*
* - Enables native Ethereum and/or Solana wallet support if configured.
* - Enables WalletConnect support for Ethereum and/or Solana chains if namespaces are provided.
* - Sets up `CrossPlatformWalletStamper` and `CrossPlatformWalletConnector` if auth or connecting features are enabled.
*
* @param cfg - Wallet manager configuration.
*/
constructor(cfg: TWalletManagerConfig);
/**
* Initializes WalletConnect components and any registered wallet interfaces.
*
* - Initializes the low-level WalletConnect client with the provided config.
* - Runs any registered async wallet initializers (currently only `WalletConnectWallet`).
*
* @param cfg - Wallet manager configuration used for initializing the WalletConnect client.
*/
init(cfg: TWalletManagerConfig): Promise<void>;
/**
* Retrieves available wallet providers, optionally filtered by chain.
*
* - If a chain is specified, filters wallet interfaces that support that chain.
* - Aggregates providers across all wallet interfaces and filters WalletConnect results accordingly.
*
* @param chain - Optional chain to filter providers by (e.g., Ethereum, Solana).
* @returns A promise that resolves to an array of `WalletProvider` objects.
* @throws {Error} If no wallet interface is registered for the given chain.
*/
getProviders(chain?: Chain): Promise<WalletProvider[]>;
/**
* Registers a wallet interface type as supporting a specific blockchain chain.
*
* @param chain - Chain (e.g., Ethereum, Solana).
* @param interfaceType - Wallet interface type to associate with the chain.
*/
private addChainInterface;
}
//# sourceMappingURL=manager.d.ts.map