/** * Open Wallet Standard (OWS) integration. * * Provides an optional, additive signing path that delegates to the `ows` CLI * for policy-gated, key-isolated transaction signing. When an `owsWallet` * parameter is supplied, transfers and staking tools use an OWS-backed signer * instead of the local keypair. If OWS is not installed, callers get a clear * error — existing keypair flows are unaffected. * * The adapter implements the same duck-typed signer interface that @solana/kit * expects ({ address, signTransactions, signMessages }), so it plugs directly * into the Helius SDK's sendTransactionWithSender / sendSmartTransaction * without losing priority-fee estimation, SWQoS routing, or Jito tips. * * NOTE: The CLI helpers (isOwsInstalled, getOwsSolanaAddress) are mirrored in * helius-cli/src/lib/ows.ts. Keep the two copies in sync when changing * argument handling, CAIP-2 lookup logic, or OWS CLI flags. */ import { type Address } from '@solana/kit'; import { mcpError } from './errors.js'; /** * True when the `ows` binary is reachable on PATH. */ export declare function isOwsInstalled(): Promise; /** * Return the Solana address for the named OWS wallet. * Uses the current MCP session network (mainnet or devnet) to select * the correct CAIP-2 chain key. */ export declare function getOwsSolanaAddress(walletName: string): Promise; /** * A duck-typed @solana/kit TransactionPartialSigner backed by OWS. * * Passes `isTransactionSigner()` checks and works with * `setTransactionMessageFeePayerSigner`, `signTransactionMessageWithSigners`, * `sendTransactionWithSender`, and `sendSmartTransaction`. * * IMPORTANT: `signTransactions` and `signMessages` return **partial signature * maps** (`{ [address]: signatureBytes }`), NOT full transaction/message objects. * This matches the contract that `@solana/kit`'s `signTransactionMessageWithSigners` * expects — it merges the partial maps back into the compiled transaction itself. */ export interface OwsSigner { address: Address; signTransactions: (transactions: readonly { messageBytes: Uint8Array; }[]) => Promise[]>; signMessages: (messages: readonly { content: Uint8Array; }[]) => Promise[]>; } /** * Resolve a signer from an OWS wallet name or the local Helius keypair. * Returns a result-union so callers can return the MCP error directly. * * The returned `signer` is typed as `any` to avoid @solana/kit branded-type * friction — it satisfies `isTransactionSigner()` at runtime. * * ⚠ If @solana/kit changes its signer interface (signTransactions / * signMessages argument or return shapes), these casts will pass type-checking * but fail at runtime. After any @solana/kit upgrade, verify the OWS signer * still passes `isTransactionSigner()` and produces valid signatures in the * full `signTransactionMessageWithSigners` pipeline. */ export declare function resolveOwsOrKeypairSigner(owsWallet?: string): Promise<{ ok: true; signer: any; walletAddress: string; owsWallet?: string; } | { ok: false; error: ReturnType; }>; export declare function createOwsSigner(walletName: string): Promise;