import { WalletClient, Account } from 'viem'; export { S as SdkTransactionResult, a as SdkTransactionStatus, t as transactionResultFromReceipt } from './transaction-BiLcoXyx.cjs'; /** Parses a canonical unsigned decimal token amount into integer base units. */ declare function parseAmount(value: string, decimals: number): bigint; /** Formats an unsigned base-unit token amount without introducing floating-point rounding. */ declare function formatAmount(value: bigint, decimals: number): string; type ChainRegistry = Readonly>; /** Resolves a chain-scoped configuration value or throws a stable unsupported-chain error. */ declare function resolveChainValue(registry: ChainRegistry, chainId: number): T; /** Requires a Wallet Client with an attached account before a signing or write operation. */ declare function requireWalletClient(walletClient: WalletClient | undefined): WalletClient; type PeachSdkErrorCode = "INVALID_AMOUNT" | "MISSING_ACCOUNT" | "MISSING_CHAIN" | "UNSUPPORTED_CHAIN" | "USER_REJECTED" | "TRANSPORT_ERROR" | "CONTRACT_ERROR" | "UNKNOWN_ERROR"; /** Base error carrying a stable machine-readable code and structured diagnostic metadata. */ declare class PeachSdkError extends Error { readonly code: PeachSdkErrorCode; readonly metadata: Readonly>; constructor(code: PeachSdkErrorCode, message: string, options?: { cause?: unknown; metadata?: Readonly>; }); } declare class UnsupportedChainError extends PeachSdkError { constructor(chainId: number); } declare class MissingChainError extends PeachSdkError { constructor(); } declare class MissingAccountError extends PeachSdkError { constructor(); } /** * Recognizes a shared SDK error regardless of which product SDK created it. * * Prefer this over `instanceof PeachSdkError` whenever an application depends on more than one * MasterPeach SDK: each package carries its own copy of the class, so `instanceof` only matches * errors that happened to originate from the same package. Pass a `code` to narrow in one step. */ declare function isPeachSdkError(value: unknown): value is PeachSdkError; declare function isPeachSdkError(value: unknown, code: TCode): value is PeachSdkError & { readonly code: TCode; }; /** Normalizes wallet rejection and unknown failures at a shared SDK boundary. */ declare function toPeachSdkError(error: unknown): PeachSdkError; /** Public inspection shape shared by product-specific prepared transaction types. */ interface PreparedTransactionSnapshot { readonly request: Readonly; readonly preview: Preview; readonly context: Context; } /** A module-local provenance store. Its canonical requests are never exposed to consumers. */ interface PreparedTransactionStore { create(request: Request, preview: Preview, context: Context): PreparedTransactionSnapshot; has(value: object): boolean; getCanonical(value: object): Request | undefined; } /** * Copies and freezes plain Viem request data, retaining cycles, symbols, prototypes and functions. * Accessor descriptors are preserved without invoking them. */ declare function immutableClone(value: Value, seen?: WeakMap): Value; /** * Creates an isolated prepared-request registry for one product module. * * Sharing the factory removes duplicated security logic without sharing registry state: a value * prepared by one SDK can never become valid in another SDK's store. */ declare function createPreparedTransactionStore(): PreparedTransactionStore; /** * Resolves the wallet's live account after proving its current chain. * * Product SDKs provide their own chain-mismatch error factory so this shared state-transition * check does not erase protocol-specific error contracts. */ declare function resolveLiveWalletAccount(walletClient: WalletClient | undefined, expectedChainId: number, chainMismatch: (expectedChainId: number, actualChainId: number) => Error): Promise; interface RequestAbortScope { readonly signal: AbortSignal; readonly timedOut: () => boolean; /** Races work that cannot consume an AbortSignal, such as async credential resolution. */ readonly waitFor: (operation: PromiseLike) => Promise; readonly release: () => void; } /** Links caller cancellation and an SDK deadline while keeping their causes distinguishable. */ declare function createRequestAbortScope(timeoutMs: number, callerSignal?: AbortSignal): RequestAbortScope; export { type ChainRegistry, MissingAccountError, MissingChainError, PeachSdkError, type PeachSdkErrorCode, type PreparedTransactionSnapshot, type PreparedTransactionStore, type RequestAbortScope, UnsupportedChainError, createPreparedTransactionStore, createRequestAbortScope, formatAmount, immutableClone, isPeachSdkError, parseAmount, requireWalletClient, resolveChainValue, resolveLiveWalletAccount, toPeachSdkError };