/** * SolanaManager * * Owns the two ways the SDK learns about Solana wallets: * * 1. `SolanaWalletStandardRegistry`: discovers wallets through the Wallet * Standard and reports detect / connect / disconnect. On by default, so * compatible wallets registered by Solana Kit, wallet-adapter, * framework-kit, or another host are covered with no configuration, * exactly like EVM wallets through EIP-6963. `solana: false` turns it off. * 2. `SolanaStoreHandler`: subscribes to framework-kit's zustand store for * connect / disconnect / cluster changes AND the transaction lifecycle. * Opt-in through `solana: { store }` or `formo.solana.setStore()`. * * Both observe the same Wallet Standard connection when a framework-kit app * connects. A store, whether supplied at initialization or attached later, * takes ownership of wallet events when it observes its first connection * and adopts any connect the registry already reported. Until then the * registry reports, so a connection the store never sees is not lost. One * connect per connection, whichever path an app is on. * * For signMessage/signTransaction tracking (not captured by either path), * use formo.signature() directly with the address and chainId. * * For manual event tracking, use the core API directly: * formo.transaction(), formo.signature(), formo.connect(), formo.disconnect(). */ import { FormoAnalytics } from "../FormoAnalytics"; import { SolanaCluster, SolanaOptions } from "./types"; import { SolanaClientStore } from "./storeTypes"; export declare class SolanaManager { private formo; private readonly enabled; private storeHandler?; private registry?; /** The cluster the app named, through options or setCluster(). Outlives any store. */ private cluster?; private storeOwnsWalletEvents; /** * @param formo - The SDK instance events are reported to. * @param options - `options.solana` as passed to the SDK, if an object. * @param enabled - Whether Solana tracking is enabled. False only when the * host app passed `solana: false`; both discovery and stores then stay off. */ constructor(formo: FormoAnalytics, options?: SolanaOptions, enabled?: boolean); /** * The SDK surface both capture paths share. Neither takes the SDK class * itself: naming the surface keeps this module from depending on the class * that owns it, and lets a test build one without it. */ private captureDeps; private attachStore; /** * Set the framework-kit zustand store for automatic event tracking. * This enables autocapture mode — connect/disconnect and transaction events * are tracked automatically by subscribing to store state changes. * * @param store - The framework-kit client store (client.store) * @param options - Optional configuration * * @example * ```tsx * import { createClient, autoDiscover } from '@solana/client'; * * const client = createClient({ endpoint: '...', walletConnectors: autoDiscover() }); * formo.solana.setStore(client.store); * ``` */ setStore(store: SolanaClientStore, options?: { cluster?: SolanaCluster; }): void; /** * Update the cluster/network. * * With a framework-kit store, only needed if the store endpoint doesn't * contain a recognizable cluster name (e.g. custom RPC URLs). Without one, * this is how a non-mainnet app tells the SDK which cluster its Wallet * Standard connections are on, since the standard itself cannot say. */ setCluster(cluster: SolanaCluster): void; /** @see SolanaWalletStandardRegistry.restorableFrom */ onReset(): void; /** Names of the Wallet Standard wallets discovered so far. */ get discoveredWallets(): string[]; cleanup(): void; } //# sourceMappingURL=SolanaManager.d.ts.map