import { ResultAsync } from 'neverthrow'; import { Address } from 'viem'; import { z } from 'zod'; declare class SdkError extends Error { readonly code: TCode; readonly cause?: unknown; readonly context?: Record; constructor(message: string, options: { code: TCode; cause?: unknown; context?: Record; }); } type PricesErrorCode = "VALIDATION_ERROR" | "CONTRACT_READ_ERROR"; declare class PricesError extends SdkError { constructor(message: string, options: { code: PricesErrorCode; cause?: unknown; context?: Record; }); } /** * Minimal viem PublicClient interface — consumers pass their own client. * The SDK uses `readContract` for single reads and `multicall` where available * to batch multiple reads into one RPC round-trip. */ interface PublicClientLike { readContract(args: { address: Address; abi: readonly unknown[]; functionName: string; args: readonly unknown[]; }): Promise; multicall?(args: { contracts: readonly { address: Address; abi: readonly unknown[]; functionName: string; args?: readonly unknown[]; }[]; allowFailure?: boolean; }): Promise; } /** * Shared param shape for every currency-scoped read in this module * (`getPriceConfig`, `getReputationPerUsdcLimit`). All methods take `{ currency }`. */ declare const ZodCurrencyScopedParamsSchema: z.ZodObject<{ currency: z.ZodEnum<{ IDR: "IDR"; INR: "INR"; BRL: "BRL"; ARS: "ARS"; MEX: "MEX"; VEN: "VEN"; BOB: "BOB"; EUR: "EUR"; NGN: "NGN"; USD: "USD"; COP: "COP"; CUP: "CUP"; ECU: "ECU"; PEN: "PEN"; PHP: "PHP"; }>; }, z.core.$strip>; type CurrencyScopedParams = z.infer; interface PricesConfig { readonly publicClient: PublicClientLike; readonly diamondAddress: Address; } interface PriceConfig { readonly buyPrice: bigint; readonly sellPrice: bigint; readonly buyPriceOffset: bigint; readonly baseSpread: bigint; } /** * Per-currency USDC transaction limit granted per Reputation Point (RP). * Default is 1 RP = 2 USDC everywhere except India (INR), which has its own * multiplier set on-chain. * * multiplier = denominator / numerator // USDC per RP */ interface ReputationLimit { readonly numerator: bigint; readonly denominator: bigint; /** USDC per Reputation Point, computed from the rational form. */ readonly multiplier: number; } interface Prices { /** Reads buy/sell price config for a given currency (raw bigint, 6 decimals). */ getPriceConfig(params: CurrencyScopedParams): ResultAsync; /** * Reads the per-currency USDC transaction limit granted per Reputation Point * (RP). Default is 1 RP = 2 USDC everywhere except INR, which uses its own * on-chain multiplier. */ getReputationPerUsdcLimit(params: CurrencyScopedParams): ResultAsync; } /** * Creates a Prices SDK instance for reading per-currency protocol config: * buy/sell prices and the Reputation Points → USDC limit ratio. All reads * are currency-scoped — no user context needed. */ declare function createPrices(config: PricesConfig): Prices; export { type CurrencyScopedParams, type PriceConfig, type Prices, type PricesConfig, PricesError, type PricesErrorCode, type ReputationLimit, createPrices };