import { NetworkId } from '@phantom/constants'; import { Transaction as Transaction$1 } from '@solana/transactions'; import { Transaction, VersionedTransaction } from '@solana/web3.js'; /** * Chain-specific transaction and message response parsing * This module contains the specific parsing logic for each blockchain network */ interface ParsedSignatureResult { signature: string; rawSignature: string; blockExplorer?: string; } interface ParsedTransactionResult { hash?: string; rawTransaction: string; blockExplorer?: string; } /** * Parse a signed message response from base64 to human-readable format */ declare function parseSignMessageResponse(base64Response: string, networkId: NetworkId): ParsedSignatureResult; /** * Parse a transaction response from base64 rawTransaction to extract hash * For Ethereum chains, converts base64url to hex format */ declare function parseTransactionResponse(base64RawTransaction: string, networkId: NetworkId, hash?: string): ParsedTransactionResult; /** * Parse Solana signed transaction from base64url encoded transaction bytes * Supports both legacy Transaction and VersionedTransaction formats */ declare function parseSolanaSignedTransaction(base64RawTransaction: string): Transaction | VersionedTransaction | null; /** * Deserialize Solana transaction from Uint8Array bytes * Supports both legacy Transaction and VersionedTransaction formats */ declare function deserializeSolanaTransaction(transactionBytes: Uint8Array): Transaction | VersionedTransaction; interface ParsedTransaction { /** The parsed transaction string (base64url for Solana/Sui/Bitcoin, RLP-encoded hex for EVM) */ parsed?: string; /** Original format of the input transaction */ originalFormat: string; } /** * EIP-712 typed data structure. * See: https://eips.ethereum.org/EIPS/eip-712 */ interface Eip712TypedData { types: Record; primaryType: string; domain: Record; message: Record; } /** * Validate that a value conforms to the EIP-712 typed data structure. * Throws a descriptive error if the structure is invalid. * * @param data - Value to validate * @throws Error if data is not a valid EIP-712 typed data object */ declare function validateEip712TypedData(data: unknown): asserts data is Eip712TypedData; /** * Parse a transaction to KMS format based on network type * - Solana: base64url encoding * - EVM chains: hex encoding * - Sui, Bitcoin: base64url encoding */ declare function parseToKmsTransaction(transaction: any, networkId: NetworkId): Promise; declare function parseSolanaKitTransactionToSolanaWeb3js(transaction: Transaction$1): any; export { Eip712TypedData, ParsedSignatureResult, ParsedTransaction, ParsedTransactionResult, deserializeSolanaTransaction, parseSignMessageResponse, parseSolanaKitTransactionToSolanaWeb3js, parseSolanaSignedTransaction, parseToKmsTransaction, parseTransactionResponse, validateEip712TypedData };