import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
import { T as TransactionLeg, k as TransactionRecord } from './types-Bk7NncQ_.js';
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';

/**
 * Abstract signing interface that decouples the SDK from any specific
 * key management strategy (Ed25519 keypair, zkLogin, multisig, …).
 */
interface TransactionSigner {
    getAddress(): string;
    signTransaction(txBytes: Uint8Array): Promise<{
        signature: string;
    }>;
    /**
     * Sign an arbitrary personal message. Required by `@suimpp/mpp` 0.7+ for
     * grief-protection proofs (sender identity verification on settled payments).
     */
    signPersonalMessage(messageBytes: Uint8Array): Promise<{
        signature: string;
        bytes?: string;
    }>;
}

declare class KeypairSigner implements TransactionSigner {
    private readonly keypair;
    constructor(keypair: Ed25519Keypair);
    getAddress(): string;
    signTransaction(txBytes: Uint8Array): Promise<{
        signature: string;
    }>;
    signPersonalMessage(messageBytes: Uint8Array): Promise<{
        signature: string;
        bytes: string;
    }>;
    /** Access the underlying keypair for APIs that still require it directly. */
    getKeypair(): Ed25519Keypair;
}

interface ZkLoginProof {
    proofPoints: {
        a: string[];
        b: string[][];
        c: string[];
    };
    issBase64Details: {
        indexMod4: number;
        value: string;
    };
    headerBase64: string;
    addressSeed: string;
}
declare class ZkLoginSigner implements TransactionSigner {
    private readonly ephemeralKeypair;
    private readonly zkProof;
    private readonly userAddress;
    private readonly maxEpoch;
    constructor(ephemeralKeypair: Ed25519Keypair, zkProof: ZkLoginProof, userAddress: string, maxEpoch: number);
    getAddress(): string;
    signTransaction(txBytes: Uint8Array): Promise<{
        signature: string;
    }>;
    signPersonalMessage(_messageBytes: Uint8Array): Promise<{
        signature: string;
        bytes: string;
    }>;
    isExpired(currentEpoch: number): boolean;
}

type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'INVALID_ASSET' | 'HEALTH_FACTOR_TOO_LOW' | 'WITHDRAW_WOULD_LIQUIDATE' | 'WITHDRAW_FAILED' | 'NO_COLLATERAL' | 'PROTOCOL_PAUSED' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'SUINS_NOT_REGISTERED' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'CHAIN_MODE_INVALID' | 'UNKNOWN';
interface T2000ErrorData {
    reason?: string;
    [key: string]: unknown;
}
declare class T2000Error extends Error {
    readonly code: T2000ErrorCode;
    readonly data?: T2000ErrorData;
    readonly retryable: boolean;
    constructor(code: T2000ErrorCode, message: string, data?: T2000ErrorData, retryable?: boolean);
    toJSON(): {
        retryable: boolean;
        data?: T2000ErrorData | undefined;
        error: T2000ErrorCode;
        message: string;
    };
}
declare function mapWalletError(error: unknown): T2000Error;
declare function mapMoveAbortCode(code: number): string;

declare const MIST_PER_SUI = 1000000000n;
declare const SUI_DECIMALS = 9;
declare const USDC_DECIMALS = 6;
declare const BPS_DENOMINATOR = 10000n;
declare const SAVE_FEE_BPS = 10n;
declare const BORROW_FEE_BPS = 5n;
declare const CLOCK_ID = "0x6";
declare const SUPPORTED_ASSETS: {
    readonly USDC: {
        readonly type: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
        readonly decimals: 6;
        readonly symbol: "USDC";
        readonly displayName: "USDC";
    };
    readonly USDT: {
        readonly type: "0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT";
        readonly decimals: 6;
        readonly symbol: "USDT";
        readonly displayName: "suiUSDT";
    };
    readonly USDe: {
        readonly type: "0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE";
        readonly decimals: 6;
        readonly symbol: "USDe";
        readonly displayName: "suiUSDe";
    };
    readonly USDsui: {
        readonly type: "0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI";
        readonly decimals: 6;
        readonly symbol: "USDsui";
        readonly displayName: "USDsui";
    };
    readonly SUI: {
        readonly type: "0x2::sui::SUI";
        readonly decimals: 9;
        readonly symbol: "SUI";
        readonly displayName: "SUI";
    };
    readonly WAL: {
        readonly type: "0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL";
        readonly decimals: 9;
        readonly symbol: "WAL";
        readonly displayName: "WAL";
    };
    readonly ETH: {
        readonly type: "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH";
        readonly decimals: 8;
        readonly symbol: "ETH";
        readonly displayName: "suiETH";
    };
    readonly NAVX: {
        readonly type: "0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX";
        readonly decimals: 9;
        readonly symbol: "NAVX";
        readonly displayName: "NAVX";
    };
    readonly GOLD: {
        readonly type: "0x9d297676e7a4b771ab023291377b2adfaa4938fb9080b8d12430e4b108b836a9::xaum::XAUM";
        readonly decimals: 6;
        readonly symbol: "GOLD";
        readonly displayName: "XAUM";
    };
};
type SupportedAsset = keyof typeof SUPPORTED_ASSETS;
type StableAsset = 'USDC';
declare const STABLE_ASSETS: readonly StableAsset[];
declare const ALL_NAVI_ASSETS: readonly SupportedAsset[];
declare const OPERATION_ASSETS: {
    readonly save: readonly ["USDC", "USDsui"];
    readonly borrow: readonly ["USDC", "USDsui"];
    readonly withdraw: "*";
    readonly repay: "*";
    readonly send: "*";
    readonly swap: "*";
};
type Operation = keyof typeof OPERATION_ASSETS;
declare function isAllowedAsset(op: Operation, asset: string): boolean;
/**
 * Throws if the asset is not permitted for the given operation.
 * Passing `undefined` (omitted) is always valid — defaults to USDC.
 */
declare function assertAllowedAsset(op: Operation, asset: string | undefined): void;
declare const T2000_OVERLAY_FEE_WALLET: string;
declare const DEFAULT_NETWORK: "mainnet";
declare const CETUS_USDC_SUI_POOL = "0x51e883ba7c0b566a26cbc8a94cd33eb0abd418a77cc1e60ad22fd9b1f29cd2ab";
declare const GAS_RESERVE_MIN = 0.05;

declare function validateAddress(address: string): string;
declare function truncateAddress(address: string): string;
/**
 * Normalize a Sui coin type to its canonical long-form 64-hex address.
 * `0x2::sui::SUI` → `0x0000…0002::sui::SUI`. Idempotent on already-long
 * forms. Returns the input unchanged if it doesn't look like a coin type
 * (`<address>::<module>::<name>`) so callers can pass arbitrary strings
 * without crashing.
 *
 * Why this exists: BlockVision's `/v2/sui/coin/price/list` endpoint
 * silently returns an empty `prices` map for short-form coin types
 * (notably `0x2::sui::SUI` — the native gas coin). Internal callers must
 * pass the long form, but external callers (LLM tool args, cached
 * coin-type strings, audit logs) commonly use the short form. Normalize
 * before the network call, denormalize back to the caller's input shape
 * after, and short/long become interchangeable.
 */
declare function normalizeCoinType(coinType: string): string;

/**
 * Unified token registry — single source of truth for coin types, decimals, symbols, and tiers.
 *
 * ZERO heavy dependencies. Safe to import from any context (server, browser, Edge).
 *
 * Tier 1: USDC — the financial layer (save, borrow, receive, yield, allowances, marketplace, MPP).
 * Tier 2: 15 curated swap assets — hold, trade, and send only.
 * No tier: Legacy tokens kept for display accuracy (existing NAVI positions). No new operations.
 *
 * To add a new token: add ONE entry to COIN_REGISTRY below. Everything else derives from it.
 * Gate for Tier 2 addition: confirmed deep Cetus liquidity + clear user need.
 */
interface CoinMeta {
    type: string;
    decimals: number;
    symbol: string;
    tier?: 1 | 2;
}
/**
 * Canonical coin registry.
 * Key = user-friendly name (used in swap_execute, CLI, prompts).
 */
declare const COIN_REGISTRY: Record<string, CoinMeta>;
/**
 * Returns the registry metadata for a coin type, or `undefined` if the coin
 * is not in the registry. Use this when you need to distinguish "known coin"
 * from "supported coin" — `isSupported` only flags tiered (active) coins,
 * but legacy coins like USDsui / USDe / USDT are in the registry without a
 * tier and still need canonical-symbol resolution.
 */
declare function getCoinMeta(coinType: string): CoinMeta | undefined;
/**
 * Returns true if the coin type appears anywhere in COIN_REGISTRY (tier 1, 2,
 * OR legacy/no-tier). Different from `isSupported`, which excludes legacy
 * entries. The blockvision-prices canonical-symbol gate uses this looser
 * check so that USDsui (legacy/no-tier today, but with a registry-canonical
 * mixed-case symbol) still wins over BlockVision's uppercase 'USDSUI'.
 */
declare function isInRegistry(coinType: string): boolean;
/** Returns true if the coin type is Tier 1 (USDC — the financial layer). */
declare function isTier1(coinType: string): boolean;
/** Returns true if the coin type is Tier 2 (curated swap asset). */
declare function isTier2(coinType: string): boolean;
/** Returns true if the coin type is actively supported (Tier 1 or Tier 2). */
declare function isSupported(coinType: string): boolean;
/** Returns the tier for a coin type, or undefined if legacy/unknown. */
declare function getTier(coinType: string): 1 | 2 | undefined;
/**
 * Get decimals for any coin type. Checks full type match, then suffix match, then defaults to 9.
 * Works for both tiered and legacy tokens.
 */
declare function getDecimalsForCoinType(coinType: string): number;
/**
 * Resolve a full coin type to a user-friendly symbol.
 * Returns the last `::` segment if not in the registry.
 */
declare function resolveSymbol(coinType: string): string;
/**
 * Name → type map for swap resolution. Derived from COIN_REGISTRY.
 * Contains BOTH original-case and UPPERCASE keys for case-insensitive lookup.
 */
declare const TOKEN_MAP: Record<string, string>;
/**
 * Resolve a user-friendly token name to its full coin type.
 * Returns the input unchanged if already a full coin type (contains "::").
 * Case-insensitive: 'usde', 'USDe', 'USDE' all resolve correctly.
 */
declare function resolveTokenType(nameOrType: string): string | null;
/** Common type constants for direct import. */
declare const SUI_TYPE: string;
declare const USDC_TYPE: string;
declare const USDT_TYPE: string;
declare const USDSUI_TYPE: string;
declare const USDE_TYPE: string;
declare const ETH_TYPE: string;
declare const WBTC_TYPE: string;
declare const WAL_TYPE: string;
declare const NAVX_TYPE: string;
declare const IKA_TYPE: string;
declare const LOFI_TYPE: string;
declare const MANIFEST_TYPE: string;

/**
 * Shared transaction classifier.
 *
 * Consumed by both the SDK's `parseTxRecord` (production agent path) and
 * the engine's `transaction_history` tool (cold-start RPC path). Keeping
 * a single source of truth here prevents the two paths from drifting —
 * see v1.5.3 regression where the SDK path was emitting `action:
 * 'transaction'` (rendered as "On-chain") while the engine path was
 * already producing fine-grained labels.
 */
/**
 * Coarse action bucket — one of `'send' | 'lending' | 'swap' |
 * 'transaction'`. Used by the ACI `action` filter on the
 * `transaction_history` tool. STABLE: downstream queries depend on
 * exactly these values.
 *
 * Order matters: more specific buckets first. Lending patterns precede
 * swap patterns so a NAVI `::swap` helper (if one ever existed) would
 * still bucket as lending.
 */
declare const KNOWN_TARGETS: readonly [RegExp, string][];
/**
 * Finer-grained display labels — derived from MoveCall function names.
 * The card renders `label ?? action`, so when this map matches we get
 * "Deposit" / "Withdraw" / "Borrow" / "Repay" / "Payment link" instead
 * of the generic "Lending" or "Transaction".
 *
 * Order matters: more specific patterns first. Each entry is
 * (regex, label) where the regex is matched against the
 * fully-qualified MoveCall target `pkg::module::function`.
 */
declare const LABEL_PATTERNS: readonly [RegExp, string][];
interface ClassifyBalanceChange {
    owner: {
        AddressOwner?: string;
    } | string;
    coinType: string;
    amount: string;
}
declare function classifyAction(targets: string[], commandTypes: string[]): string;
/**
 * Last-resort fallback when neither `LABEL_PATTERNS` nor the action
 * bucket produces something useful.
 *
 * Returns the first MoveCall's *module* name (e.g. "navi", "spam") so
 * the card shows something better than the literal word "transaction".
 * When no MoveCall exists, returns 'on-chain'.
 *
 * Note: callers should prefer `classifyLabel` which now layers
 * pattern-match → coarse action → module name (see commentary there).
 */
declare function fallbackLabel(targets: string[]): string;
/**
 * Three-tier label resolution for the transaction history card:
 *   1. Specific keyword match in `LABEL_PATTERNS` ("deposit",
 *      "payment_link", …).
 *   2. Coarse action bucket from `classifyAction` ("swap", "send",
 *      "lending") — prevents leaking opaque internal module names like
 *      "router" (Cetus aggregator) or "cross_swap" (third-party DEX
 *      aggregators) for txs that we already classified as a swap.
 *   3. Module name from the first MoveCall (`fallbackLabel`) — only
 *      used when the action bucket itself is the generic "transaction".
 *
 * Pre-v0.46.2 we skipped tier 2, so swaps showed labels like "router",
 * "cross_swap", "scallop_router", etc. instead of the clean "swap".
 */
declare function classifyLabel(targets: string[], commandTypes: string[]): string;
/**
 * Balance-direction tiebreaker for ambiguous lending calls.
 *
 * Many lending modules expose generic entry points (NAVI's bundled
 * flash actions, `lending_core::*::entry_*`, etc.) that don't carry
 * a `deposit`/`withdraw`/`borrow`/`repay` keyword in the function
 * name. When `classifyLabel` falls back to a bare module name like
 * `"lending"` for a known lending tx, infer direction from the user's
 * non-SUI balance change:
 *   - net outflow of the supplied asset → deposit (also covers repay,
 *     but repay-without-keyword is essentially never emitted).
 *   - net inflow of the supplied asset → withdraw (also covers borrow).
 * SUI is excluded so gas-only transactions don't get mislabeled.
 *
 * If `LABEL_PATTERNS` matched a specific keyword, the existing label is
 * returned unchanged.
 */
declare function refineLendingLabel(currentAction: string, currentLabel: string, moveCallTargets: string[], changes: ClassifyBalanceChange[], address: string): string;
interface ClassifyResult {
    action: string;
    label: string;
}
declare function classifyTransaction(moveCallTargets: string[], commandTypes: string[], balanceChanges: ClassifyBalanceChange[], address: string): ClassifyResult;
/**
 * Direction of the user's net non-gas movement for this transaction.
 *
 *   - `'out'` — the user spent the asset (sends, deposits, repays,
 *     swap-in, payment-link payouts).
 *   - `'in'`  — the user received the asset (withdraws, borrows,
 *     swap-out, claims, deposits credited from another wallet).
 *
 * Used by the `TransactionHistoryCard` to choose the `+`/`−` sign and
 * color. Direction is computed from the actual on-chain balance change
 * — never from the textual label — so opaque action types (`'router'`,
 * `'cross_swap'`, …) still render the correct sign.
 */
type TxDirection = 'in' | 'out';
interface ExtractedTransfer {
    amount?: number;
    asset?: string;
    recipient?: string;
    direction?: TxDirection;
}
/**
 * Extracts the principal amount/asset/direction for a transaction
 * from its `balanceChanges`.
 *
 * Algorithm:
 *   1. Restrict to the user's *own* balance changes.
 *   2. Prefer non-SUI changes (gas-only SUI deltas are noise).
 *   3. Pick the change with the largest absolute value — the "principal".
 *   4. If no non-SUI change exists, fall back to the largest SUI change
 *      so pure-SUI transfers (stake/unstake/native send) still render.
 *   5. Direction follows the sign of the principal.
 *   6. Recipient is set only on outflows, by finding a matching inflow
 *      on a *non-user* address with the same coinType.
 *
 * Pre-v0.46.2 this function only inspected outflows, so withdraws,
 * borrows, claims, swap-receives and payment-link receives all
 * rendered with no amount on the rich card (and with a wrong sign,
 * because the card guessed direction from the label string).
 */
declare function extractTransferDetails(changes: ClassifyBalanceChange[] | undefined, sender: string): ExtractedTransfer;
/**
 * Extract every non-zero user balance leg for a transaction — not
 * just the largest one. Order is RPC order; callers responsible for
 * any sorting (e.g. audric sorts by USD value once it's priced).
 *
 * Sui collapses balance changes by coin type, so a 3-step bundle
 * touching USDC three times surfaces as ONE leg of net USDC delta.
 * Distinguishing per-step legs would require parsing the PTB's
 * commands; this helper deliberately stops at the balance-change
 * granularity because that's what's reliably available across all
 * Sui RPC versions.
 *
 * Pre-v1.27.2 the only public API was `extractTransferDetails`,
 * which returned a single "primary" leg and made swap rows
 * unrenderable (showed `Swapped 987.60 MANIFEST` because MANIFEST
 * was the largest raw delta even though USDC was the value side).
 */
declare function extractAllUserLegs(changes: ClassifyBalanceChange[] | undefined, sender: string): TransactionLeg[];

declare function queryHistory(client: SuiJsonRpcClient, address: string, limit?: number): Promise<TransactionRecord[]>;
declare function queryTransaction(client: SuiJsonRpcClient, digest: string, senderAddress: string): Promise<TransactionRecord | null>;
/**
 * Shape of a transaction block as returned by `suix_queryTransactionBlocks`
 * with `showEffects | showInput | showBalanceChanges` enabled. Exported so
 * downstream consumers (audric dashboard `/api/history`, `/api/activity`,
 * etc.) can type their RPC calls without redeclaring the structure.
 */
interface SuiRpcTxBlock {
    digest: string;
    timestampMs?: string;
    transaction?: unknown;
    effects?: {
        gasUsed?: {
            computationCost: string;
            storageCost: string;
            storageRebate: string;
        };
    };
    balanceChanges?: ClassifyBalanceChange[];
}
/**
 * Convert a single Sui RPC transaction block to a {@link TransactionRecord}
 * using the canonical (shared) classifier and balance-change extractor.
 *
 * This is the single source of truth for transaction parsing across the
 * agent-tool path AND the dashboard-API path. Use it instead of writing
 * a bespoke parser per surface.
 *
 * @param tx      Raw RPC tx block (must include `effects`, `input`, `balanceChanges`).
 * @param address Wallet address whose perspective we're parsing from.
 */
declare function parseSuiRpcTx(tx: SuiRpcTxBlock, address: string): TransactionRecord;
/**
 * Extract the sender (signer) address from a raw RPC tx block.
 * Returns `null` if the block shape is unexpected.
 */
declare function extractTxSender(txBlock: unknown): string | null;
/**
 * Extract MoveCall targets (`<pkg>::<module>::<function>`) and the
 * sequence of programmable-transaction command types (e.g. `MoveCall`,
 * `TransferObjects`) from a raw RPC tx block. Tolerates both the
 * legacy `inner.transactions` field and the newer `inner.commands`
 * field.
 */
declare function extractTxCommands(txBlock: unknown): {
    moveCallTargets: string[];
    commandTypes: string[];
};

declare function mistToSui(mist: bigint): number;
declare function suiToMist(sui: number): bigint;
declare function usdcToRaw(amount: number): bigint;
declare function rawToUsdc(raw: bigint): number;
declare function stableToRaw(amount: number, decimals: number): bigint;
declare function rawToStable(raw: bigint, decimals: number): number;
declare function getDecimals(asset: SupportedAsset): number;
declare function formatUsd(amount: number): string;
declare function formatSui(amount: number): string;
declare function formatAssetAmount(amount: number, asset: string): string;
/**
 * Case-insensitive lookup against SUPPORTED_ASSETS keys AND display names.
 * 'usde' → 'USDe', 'suiusde' → 'USDe', 'suiusdt' → 'USDT', 'usdsui' → 'USDsui'.
 * Returns the original input if not found so downstream validation can reject it.
 */
declare function normalizeAsset(input: string): string;

interface SimulationResult {
    success: boolean;
    gasEstimateSui: number;
    error?: {
        moveAbortCode?: number;
        moveModule?: string;
        reason: string;
        rawError: string;
    };
}
declare function simulateTransaction(client: SuiJsonRpcClient, tx: Transaction, sender: string): Promise<SimulationResult>;
declare function throwIfSimulationFailed(sim: SimulationResult): void;

/**
 * Protocol fee primitives — wallet-direct transfer model.
 *
 * Fees are collected by splitting from the payment coin and transferring directly
 * to the treasury wallet inside the same PTB. Atomic with the operation (PTB
 * semantics); the wallet IS the ledger; the server-side indexer reads
 * `balanceChanges` and writes a `ProtocolFeeLedger` row tagged with the operation
 * classified from the tx's moveCall targets.
 *
 * The SDK / CLI never call this helper — they're fee-free by design (t2000 = infra
 * brand, no opinion on fees). Audric's `prepare/route.ts` is the canonical caller.
 */

type FeeOperation = 'save' | 'borrow' | 'swap';
interface ProtocolFeeInfo {
    amount: number;
    asset: string;
    rate: number;
    rawAmount: bigint;
}
/**
 * Compute the fee amount for a given operation against a USD-denominated input.
 * Used pre-tx for receipt display + quote math. Does not modify any tx.
 */
declare function calculateFee(operation: FeeOperation, amount: number): ProtocolFeeInfo;
/**
 * Split a fee from `paymentCoin` and transfer it to `receiver` inside the given PTB.
 *
 * **Order is load-bearing.** Call this BEFORE the protocol operation that consumes
 * `paymentCoin` (e.g. NAVI deposit). `splitCoins` mutates the source coin in place,
 * leaving the remainder for the protocol step. If you split AFTER the deposit,
 * the deposit will have consumed the coin and the split will fail.
 *
 * Atomicity: `splitCoins` + `transferObjects` are PTB ops; if anything later in
 * the PTB reverts, the fee transfer reverts too.
 *
 * @param tx          Active PTB
 * @param paymentCoin Coin to split the fee from (mutated in place)
 * @param feeBps      Fee rate in basis points (e.g. `SAVE_FEE_BPS = 10n` = 0.1%)
 * @param receiver    Treasury wallet address (typically `T2000_OVERLAY_FEE_WALLET`)
 * @param amount      Display-units input amount (matches what was passed to the
 *                    protocol operation; used to compute the raw fee amount)
 * @param decimals    Coin decimals for raw conversion. Defaults to USDC_DECIMALS
 *                    (6). Pass the actual coin decimals when skimming a fee
 *                    from a non-USDC coin (e.g. USDsui = 6, GOLD = 6, ETH = 8,
 *                    SUI = 9). Backward-compatible: existing USDC callers can
 *                    omit. Wrong decimals → wrong raw amount → either fee
 *                    too small (silent loss) or too large (PTB revert from
 *                    insufficient coin balance).
 */
declare function addFeeTransfer(tx: Transaction, paymentCoin: TransactionObjectArgument, feeBps: bigint, receiver: string, amount: number, decimals?: number): void;

type SafeguardRule = 'locked' | 'maxPerTx' | 'maxDailySend';
interface SafeguardErrorDetails {
    attempted?: number;
    limit?: number;
    current?: number;
}
declare class SafeguardError extends T2000Error {
    readonly rule: SafeguardRule;
    readonly details: SafeguardErrorDetails;
    constructor(rule: SafeguardRule, details: SafeguardErrorDetails, message?: string);
    toJSON(): {
        error: "SAFEGUARD_BLOCKED";
        message: string;
        retryable: boolean;
        data: {
            attempted?: number;
            limit?: number;
            current?: number;
            rule: SafeguardRule;
        };
    };
}

interface SafeguardConfig {
    locked: boolean;
    maxPerTx: number;
    maxDailySend: number;
    dailyUsed: number;
    dailyResetDate: string;
    maxLeverage?: number;
    maxPositionSize?: number;
}
interface TxMetadata {
    operation: 'send' | 'save' | 'withdraw' | 'borrow' | 'repay' | 'pay';
    amount?: number;
}
declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "repay" | "send" | "pay">;
declare const DEFAULT_SAFEGUARD_CONFIG: SafeguardConfig;

export { ZkLoginSigner as $, ALL_NAVI_ASSETS as A, BORROW_FEE_BPS as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, type TransactionSigner as H, IKA_TYPE as I, type TxDirection as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, type TxMetadata as Q, USDC_TYPE as R, SAVE_FEE_BPS as S, T2000Error as T, USDC_DECIMALS as U, USDE_TYPE as V, USDSUI_TYPE as W, USDT_TYPE as X, WAL_TYPE as Y, WBTC_TYPE as Z, type ZkLoginProof as _, BPS_DENOMINATOR as a, addFeeTransfer as a0, calculateFee as a1, classifyAction as a2, classifyLabel as a3, classifyTransaction as a4, extractAllUserLegs as a5, extractTransferDetails as a6, extractTxCommands as a7, extractTxSender as a8, fallbackLabel as a9, assertAllowedAsset as aA, getCoinMeta as aB, isAllowedAsset as aC, isInRegistry as aD, normalizeAsset as aE, normalizeCoinType as aF, queryHistory as aG, queryTransaction as aH, simulateTransaction as aI, throwIfSimulationFailed as aJ, formatAssetAmount as aa, formatSui as ab, formatUsd as ac, getDecimals as ad, getDecimalsForCoinType as ae, getTier as af, isSupported as ag, isTier1 as ah, isTier2 as ai, mapMoveAbortCode as aj, mapWalletError as ak, mistToSui as al, parseSuiRpcTx as am, rawToStable as an, rawToUsdc as ao, refineLendingLabel as ap, resolveSymbol as aq, resolveTokenType as ar, stableToRaw as as, suiToMist as at, truncateAddress as au, usdcToRaw as av, validateAddress as aw, CETUS_USDC_SUI_POOL as ax, OPERATION_ASSETS as ay, type Operation as az, COIN_REGISTRY as b, type ClassifyBalanceChange as c, type ClassifyResult as d, type CoinMeta as e, DEFAULT_SAFEGUARD_CONFIG as f, type ExtractedTransfer as g, KeypairSigner as h, LOFI_TYPE as i, MIST_PER_SUI as j, STABLE_ASSETS as k, SUI_DECIMALS as l, SUI_TYPE as m, SUPPORTED_ASSETS as n, type SafeguardConfig as o, SafeguardError as p, type SafeguardErrorDetails as q, type SafeguardRule as r, type SimulationResult as s, type StableAsset as t, type SuiRpcTxBlock as u, type SupportedAsset as v, type T2000ErrorCode as w, type T2000ErrorData as x, T2000_OVERLAY_FEE_WALLET as y, TOKEN_MAP as z };
