import { ServerKeyringHttp } from "./ServerKeyringHttp"; import { type ByokChainAdapter, type ByokWalletInfo, type ByokWalletRef, ChainNamespace, type CreateByokWalletOpts, type MnemonicKeyringInput } from "./types"; import { type WalletRegistrationConfig } from "./walletRegistration"; /** * Function that constructs a `ByokChainAdapter`. The factory pattern keeps * the API symmetric with server adapters (which need keyring-provided deps) * and lets callers customize per-chain adapter configuration via closure. */ export type ByokChainAdapterFactory = (deps: { http: ServerKeyringHttp; projectId: string; }) => ByokChainAdapter; export type ByokKeyringCreateOpts = MnemonicKeyringInput & { adapters: ByokChainAdapterFactory[]; /** Default namespace used by `createWallet` when none is given. Defaults to EVM. */ defaultNamespace?: ChainNamespace; /** Newly derived wallets are registered with the remote service. */ registration: WalletRegistrationConfig; }; /** * Concrete mnemonic-backed BYOK keyring. Owns the mnemonic and the wallet roster; * delegates derivation and chain-specific signing to per-namespace adapters * registered at construction. * * Wallet clients reach chain-typed signing methods by passing the keyring to * a per-chain helper (`evmSigner(keyring)`, `solanaSigner(keyring)`, …) * exported from each chain's module. The keyring itself stays chain-agnostic. */ export declare class ByokKeyring { #private; readonly kind: "byok"; private constructor(); static create(opts: ByokKeyringCreateOpts): Promise; getAdapter(namespace: N): ByokChainAdapter; getAccounts(): string[]; getWallets(namespace?: ChainNamespace): ByokWalletInfo[]; getWallet(ref: ByokWalletRef): ByokWalletInfo | undefined; /** * Derive and register a new mnemonic-backed wallet. Returns both the new * wallet and the post-create roster so callers can persist in one step * regardless of keyring kind. */ createWallet(opts?: CreateByokWalletOpts): Promise<{ wallet: ByokWalletInfo; wallets: ByokWalletInfo[]; }>; addWallet(info: ByokWalletInfo): Promise; /** * Persistable roster snapshot. Kind-agnostic counterpart to * `ServerKeyring.snapshot()` — callers that hold an {@link IFoxKeyring} * can serialize without branching on `kind`. */ snapshot(): ByokWalletInfo[]; /** * Register an existing roster wallet with the remote service (challenge + sign + save). */ registerWallet(address: string): Promise; }