import { SolFunderRole } from '@halliday-sdk/payments'; /** * Structural, dependency-free mirror of the pieces of the * [Solana Wallet Standard](https://docs.phantom.com/developer-powertools/wallet-standard) this * adapter needs. Declared locally on purpose so neither `@wallet-standard/base` nor * `@solana/web3.js` becomes a dependency of the SDK — the feature takes raw bytes, so nothing here * ever deserializes a `VersionedTransaction`. */ interface SolWalletAccount { address: string; } interface SolSignAndSendTransactionOutput { signature: Uint8Array; } interface SolWalletStandardWallet { accounts: readonly SolWalletAccount[]; features: { "solana:signAndSendTransaction": { signAndSendTransaction(input: { account: SolWalletAccount; transaction: Uint8Array; chain: string; }): Promise; }; }; } /** * Connect a Solana wallet as a funder — the SOL analog of `connectSigner` (`./ethers`) and * `connectWalletClient` (`./viem`), and like them it takes a *getter* for the live connection so the * host can reconnect without re-registering. * * The transaction is built server-side (`POST /payments/transfer-tx`) and arrives base64-encoded, so * this adapter only decodes it to bytes and hands it to the wallet's `solana:signAndSendTransaction` * feature. That feature broadcasts via the wallet's own RPC, so there is no `Connection`, no * blockhash handling and no confirmation wait here — payment-status polling detects the transfer. * * The wallet must come from the wallet-standard registry (`getWallets()` in `@wallet-standard/app`), * NOT from a legacy injected provider like `window.solana` — see `asWalletStandard`. * * @param {function} getWallet Function returning the live wallet-standard wallet. * @returns {SolFunderRole} ``walletType`` The literal `"SOL"` that discriminates the `FunderRole` union. * @returns {function} ``getAddress`` Function that returns the connected account's base58 address. * @returns {SolSendTransaction} ``sendTransaction`` Function that signs and sends a prepared transaction. */ declare function connectSolWallet(getWallet: () => SolWalletStandardWallet): SolFunderRole; export { connectSolWallet }; export type { SolSignAndSendTransactionOutput, SolWalletAccount, SolWalletStandardWallet };