import { CircleDeveloperControlledWalletsClient } from '@circle-fin/developer-controlled-wallets'; import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js'; /** * Solana mainnet. */ declare const SOL: { readonly blockchainId: "SOL"; readonly cluster: "mainnet-beta"; }; /** * Solana devnet. */ declare const SOL_DEVNET: { readonly blockchainId: "SOL-DEVNET"; readonly cluster: "devnet"; }; /** * Maps accepted `chain` inputs (Circle `Blockchain` wire values and Solana * cluster names per https://solana.com/docs/references/clusters) to the * Circle `Blockchain` wire value the Signing API expects. */ declare const SolanaBlockchain: { readonly SOL: "SOL"; readonly "mainnet-beta": "SOL"; readonly "SOL-DEVNET": "SOL-DEVNET"; readonly devnet: "SOL-DEVNET"; }; type SolanaBlockchain = keyof typeof SolanaBlockchain; /** * Wallet-adapter-style signer for `@solana/web3.js` v1 transactions. Supports * both legacy `Transaction` and `VersionedTransaction` instances. */ interface SolanaTransactionSigner { readonly publicKey: PublicKey; signTransaction(transaction: T): Promise; signAllTransactions(transactions: T[]): Promise; } interface CreateTransactionSignerInput { client: CircleDeveloperControlledWalletsClient; address: PublicKey; chain: SolanaBlockchain; } /** * Create a `@solana/web3.js` v1 wallet-adapter-style signer backed by a Circle * developer-controlled wallet. Supports both legacy `Transaction` and * `VersionedTransaction`; the two are discriminated structurally at runtime * via the presence of a `version` property, so the adapter's bundle keeps * its type-only `@solana/web3.js` import. * @category Signing * @throws UnsupportedChainError if `chain` is not a Circle Solana `Blockchain` value or a supported Solana cluster alias. */ declare function createTransactionSigner({ client, address: publicKey, chain, }: CreateTransactionSignerInput): SolanaTransactionSigner; /** Thrown when the requested chain is not supported. */ declare class UnsupportedChainError extends Error { } export { SOL, SOL_DEVNET, SolanaBlockchain, UnsupportedChainError, createTransactionSigner }; export type { CreateTransactionSignerInput, SolanaTransactionSigner };