import { I as InvestmentTrade, S as StrategyDefinition, A as AutoInvestSchedule, a as AutoInvestStatus, T as T2000Options, b as SendResult, B as BalanceResponse, c as TransactionRecord, D as DepositInfo, L as LendingAdapter, d as SwapAdapter, e as SaveResult, W as WithdrawResult, M as MaxWithdrawResult, f as BorrowResult, R as RepayResult, g as MaxBorrowResult, H as HealthFactorResult, h as SwapResult, i as InvestResult, j as InvestEarnResult, k as InvestRebalanceResult, P as PendingReward, C as ClaimRewardsResult, l as StrategyBuyResult, m as StrategySellResult, n as StrategyRebalanceResult, o as StrategyStatusResult, p as AutoInvestRunResult, q as PortfolioResult, r as InvestmentPosition, s as PositionsResult, t as RatesResult, u as LendingRates, v as RebalanceResult, E as EarningsResult, F as FundStatusResult, w as SentinelAgent, x as SentinelAttackResult, G as GasMethod } from './index-HADTiik7.js';
export { y as AdapterCapability, z as AdapterPositions, J as AdapterTxResult, K as AssetRates, N as CetusAdapter, O as GasReserve, Q as HealthInfo, U as InvestRebalanceMove, V as NaviAdapter, X as PerpsAdapter, Y as PerpsPosition, Z as PositionEntry, _ as PositionSide, $ as ProtocolDescriptor, a0 as ProtocolRegistry, a1 as RebalanceStep, a2 as SentinelVerdict, a3 as SuilendAdapter, a4 as SwapQuote, a5 as TradePositionsResult, a6 as TradeResult, a7 as allDescriptors, a8 as cetusDescriptor, a9 as getSentinelInfo, aa as listSentinels, ab as naviDescriptor, ac as requestAttack, ad as sentinelAttack, ae as sentinelDescriptor, af as settleAttack, ag as submitPrompt, ah as suilendDescriptor } from './index-HADTiik7.js';
import { EventEmitter } from 'eventemitter3';
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';

type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'SPONSOR_FAILED' | 'SPONSOR_RATE_LIMITED' | 'GAS_STATION_UNAVAILABLE' | 'GAS_FEE_EXCEEDED' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'SWAP_FAILED' | 'SLIPPAGE_EXCEEDED' | 'HEALTH_FACTOR_TOO_LOW' | 'WITHDRAW_WOULD_LIQUIDATE' | 'NO_COLLATERAL' | 'PROTOCOL_PAUSED' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'SPONSOR_UNAVAILABLE' | 'AUTO_TOPUP_FAILED' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'FACILITATOR_TIMEOUT' | 'SENTINEL_API_ERROR' | 'SENTINEL_NOT_FOUND' | 'SENTINEL_TX_FAILED' | 'SENTINEL_TEE_ERROR' | 'SAFEGUARD_BLOCKED' | 'INSUFFICIENT_INVESTMENT' | 'INVESTMENT_LOCKED' | 'INVEST_ALREADY_EARNING' | 'INVEST_NOT_EARNING' | 'BORROW_GUARD_INVESTMENT' | 'STRATEGY_NOT_FOUND' | 'STRATEGY_INVALID_ALLOCATIONS' | 'STRATEGY_HAS_POSITIONS' | 'STRATEGY_BUILTIN' | 'STRATEGY_MIN_AMOUNT' | 'AUTO_INVEST_NOT_FOUND' | 'AUTO_INVEST_INSUFFICIENT' | 'MARKET_NOT_SUPPORTED' | 'LEVERAGE_EXCEEDED' | 'POSITION_SIZE_EXCEEDED' | 'BLUEFIN_AUTH_FAILED' | 'BLUEFIN_API_ERROR' | 'POSITION_NOT_FOUND' | '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 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 BTC: {
        readonly type: "0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC";
        readonly decimals: 8;
        readonly symbol: "BTC";
        readonly displayName: "Bitcoin";
    };
    readonly ETH: {
        readonly type: "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH";
        readonly decimals: 8;
        readonly symbol: "ETH";
        readonly displayName: "Ethereum";
    };
    readonly GOLD: {
        readonly type: "0x9d297676e7a4b771ab023291377b2adfaa4938fb9080b8d12430e4b108b836a9::xaum::XAUM";
        readonly decimals: 9;
        readonly symbol: "GOLD";
        readonly displayName: "Gold";
    };
};
type SupportedAsset = keyof typeof SUPPORTED_ASSETS;
type StableAsset = Exclude<SupportedAsset, 'SUI' | 'BTC' | 'ETH' | 'GOLD'>;
declare const STABLE_ASSETS: readonly StableAsset[];
declare const DEFAULT_NETWORK: "mainnet";
declare const INVESTMENT_ASSETS: {
    readonly SUI: {
        readonly type: "0x2::sui::SUI";
        readonly decimals: 9;
        readonly symbol: "SUI";
        readonly displayName: "SUI";
    };
    readonly BTC: {
        readonly type: "0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC";
        readonly decimals: 8;
        readonly symbol: "BTC";
        readonly displayName: "Bitcoin";
    };
    readonly ETH: {
        readonly type: "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH";
        readonly decimals: 8;
        readonly symbol: "ETH";
        readonly displayName: "Ethereum";
    };
    readonly GOLD: {
        readonly type: "0x9d297676e7a4b771ab023291377b2adfaa4938fb9080b8d12430e4b108b836a9::xaum::XAUM";
        readonly decimals: 9;
        readonly symbol: "GOLD";
        readonly displayName: "Gold";
    };
};
type InvestmentAsset = keyof typeof INVESTMENT_ASSETS;
declare const DEFAULT_STRATEGIES: {
    readonly bluechip: {
        readonly name: "Bluechip / Large-Cap";
        readonly allocations: {
            readonly BTC: 50;
            readonly ETH: 30;
            readonly SUI: 20;
        };
        readonly description: "Large-cap crypto index";
        readonly custom: false;
    };
    readonly layer1: {
        readonly name: "Smart Contract Platforms";
        readonly allocations: {
            readonly ETH: 50;
            readonly SUI: 50;
        };
        readonly description: "Smart contract platforms";
        readonly custom: false;
    };
    readonly 'sui-heavy': {
        readonly name: "Sui-Weighted Portfolio";
        readonly allocations: {
            readonly BTC: 20;
            readonly ETH: 20;
            readonly SUI: 60;
        };
        readonly description: "Sui-weighted portfolio";
        readonly custom: false;
    };
    readonly 'all-weather': {
        readonly name: "All-Weather Portfolio";
        readonly allocations: {
            readonly BTC: 30;
            readonly ETH: 20;
            readonly SUI: 20;
            readonly GOLD: 30;
        };
        readonly description: "Crypto and commodities";
        readonly custom: false;
    };
    readonly 'safe-haven': {
        readonly name: "Safe Haven";
        readonly allocations: {
            readonly BTC: 50;
            readonly GOLD: 50;
        };
        readonly description: "Store-of-value assets";
        readonly custom: false;
    };
};
declare const PERPS_MARKETS: readonly ["SUI-PERP"];
type PerpsMarket = (typeof PERPS_MARKETS)[number];
declare const DEFAULT_MAX_LEVERAGE = 5;
declare const DEFAULT_MAX_POSITION_SIZE = 1000;
declare const GAS_RESERVE_MIN = 0.05;
declare const SENTINEL: {
    readonly PACKAGE: "0x88b83f36dafcd5f6dcdcf1d2cb5889b03f61264ab3cee9cae35db7aa940a21b7";
    readonly AGENT_REGISTRY: "0xc47564f5f14c12b31e0dfa1a3dc99a6380a1edf8929c28cb0eaa3359c8db36ac";
    readonly ENCLAVE: "0xfb1261aeb9583514cb1341a548a5ec12d1231bd96af22215f1792617a93e1213";
    readonly PROTOCOL_CONFIG: "0x2fa4fa4a1dd0498612304635ff9334e1b922e78af325000e9d9c0e88adea459f";
    readonly TEE_API: "https://app.suisentinel.xyz/api/consume-prompt";
    readonly SENTINELS_API: "https://api.suisentinel.xyz/agents/mainnet";
    readonly RANDOM: "0x8";
    readonly MIN_FEE_MIST: 100000000n;
    readonly MAX_PROMPT_TOKENS: 600;
};

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

declare class SafeguardEnforcer {
    private config;
    private readonly configPath;
    constructor(configDir?: string);
    load(): void;
    assertNotLocked(): void;
    check(metadata: TxMetadata): void;
    recordUsage(amount: number): void;
    lock(): void;
    unlock(): void;
    set(key: string, value: unknown): void;
    getConfig(): SafeguardConfig;
    isConfigured(): boolean;
    private resetDailyIfNewDay;
    private save;
}

interface Contact {
    name: string;
    address: string;
}
type ContactMap = Record<string, Contact>;
declare class ContactManager {
    private contacts;
    private readonly filePath;
    private readonly dir;
    constructor(configDir?: string);
    private load;
    private save;
    add(name: string, address: string): {
        action: 'added' | 'updated';
    };
    remove(name: string): boolean;
    get(name: string): Contact | undefined;
    list(): Contact[];
    resolve(nameOrAddress: string): {
        address: string;
        contactName?: string;
    };
    private validateName;
}

interface StoredPosition {
    totalAmount: number;
    costBasis: number;
    avgPrice: number;
    trades: InvestmentTrade[];
    earning?: boolean;
    earningProtocol?: string;
    earningApy?: number;
}
declare class PortfolioManager {
    private data;
    private readonly filePath;
    private readonly dir;
    constructor(configDir?: string);
    private load;
    private save;
    recordBuy(trade: InvestmentTrade): void;
    recordSell(trade: InvestmentTrade): number;
    getPosition(asset: string): StoredPosition | undefined;
    getPositions(): Array<{
        asset: string;
    } & StoredPosition>;
    recordEarn(asset: string, protocol: string, apy: number): void;
    recordUnearn(asset: string): void;
    closePosition(asset: string): void;
    isEarning(asset: string): boolean;
    getRealizedPnL(): number;
    recordStrategyBuy(strategyKey: string, trade: InvestmentTrade): void;
    recordStrategySell(strategyKey: string, trade: InvestmentTrade): number;
    getStrategyPositions(strategyKey: string): Array<{
        asset: string;
    } & StoredPosition>;
    getAllStrategyKeys(): string[];
    clearStrategy(strategyKey: string): void;
    hasStrategyPositions(strategyKey: string): boolean;
}

declare class StrategyManager {
    private data;
    private readonly filePath;
    private readonly dir;
    private seeded;
    constructor(configDir?: string);
    private load;
    private save;
    private seedDefaults;
    getAll(): Record<string, StrategyDefinition>;
    get(name: string): StrategyDefinition;
    create(params: {
        name: string;
        allocations: Record<string, number>;
        description?: string;
    }): StrategyDefinition;
    delete(name: string): void;
    validateAllocations(allocations: Record<string, number>): void;
    validateMinAmount(allocations: Record<string, number>, totalUsd: number): void;
}

declare class AutoInvestManager {
    private data;
    private readonly filePath;
    private readonly dir;
    constructor(configDir?: string);
    private load;
    private save;
    setup(params: {
        amount: number;
        frequency: 'daily' | 'weekly' | 'monthly';
        strategy?: string;
        asset?: string;
        dayOfWeek?: number;
        dayOfMonth?: number;
    }): AutoInvestSchedule;
    getStatus(): AutoInvestStatus;
    getSchedule(id: string): AutoInvestSchedule;
    recordRun(id: string, amountInvested: number): void;
    stop(id: string): void;
    remove(id: string): void;
}

interface T2000Events {
    balanceChange: (event: {
        asset: string;
        previous: number;
        current: number;
        cause: string;
        tx?: string;
    }) => void;
    healthWarning: (event: {
        healthFactor: number;
        threshold: number;
        severity: 'warning';
    }) => void;
    healthCritical: (event: {
        healthFactor: number;
        threshold: number;
        severity: 'critical';
    }) => void;
    yield: (event: {
        earned: number;
        total: number;
        apy: number;
        timestamp: number;
    }) => void;
    gasAutoTopUp: (result: {
        usdcSpent: number;
        suiReceived: number;
    }) => void;
    gasStationFallback: (event: {
        reason: string;
        method: string;
        suiUsed: number;
    }) => void;
    error: (error: T2000Error) => void;
}
declare class T2000 extends EventEmitter<T2000Events> {
    private readonly keypair;
    private readonly client;
    private readonly _address;
    private readonly registry;
    readonly enforcer: SafeguardEnforcer;
    readonly contacts: ContactManager;
    readonly portfolio: PortfolioManager;
    readonly strategies: StrategyManager;
    readonly autoInvest: AutoInvestManager;
    private constructor();
    private static createDefaultRegistry;
    static create(options?: T2000Options): Promise<T2000>;
    static fromPrivateKey(privateKey: string, options?: {
        network?: 'mainnet' | 'testnet';
        rpcUrl?: string;
    }): T2000;
    static init(options: {
        pin: string;
        passphrase?: string;
        keyPath?: string;
        name?: string;
        sponsored?: boolean;
    }): Promise<{
        agent: T2000;
        address: string;
        sponsored: boolean;
    }>;
    /** SuiJsonRpcClient used by this agent — exposed for x402 and other integrations. */
    get suiClient(): SuiJsonRpcClient;
    /** Ed25519Keypair used by this agent — exposed for x402 and other integrations. */
    get signer(): Ed25519Keypair;
    address(): string;
    send(params: {
        to: string;
        amount: number;
        asset?: string;
    }): Promise<SendResult>;
    balance(): Promise<BalanceResponse>;
    history(params?: {
        limit?: number;
    }): Promise<TransactionRecord[]>;
    deposit(): Promise<DepositInfo>;
    exportKey(): string;
    registerAdapter(adapter: LendingAdapter | SwapAdapter): Promise<void>;
    save(params: {
        amount: number | 'all';
        protocol?: string;
    }): Promise<SaveResult>;
    withdraw(params: {
        amount: number | 'all';
        protocol?: string;
    }): Promise<WithdrawResult>;
    private withdrawAllProtocols;
    private _fetchCoins;
    private _mergeCoinsInTx;
    private _swapToUsdc;
    private _swapFromUsdc;
    private _convertWalletStablesToUsdc;
    maxWithdraw(): Promise<MaxWithdrawResult>;
    private adjustMaxBorrowForInvestments;
    borrow(params: {
        amount: number;
        protocol?: string;
    }): Promise<BorrowResult>;
    repay(params: {
        amount: number | 'all';
        protocol?: string;
    }): Promise<RepayResult>;
    private _repayAllBorrows;
    maxBorrow(): Promise<MaxBorrowResult>;
    healthFactor(): Promise<HealthFactorResult>;
    exchange(params: {
        from: string;
        to: string;
        amount: number;
        maxSlippage?: number;
        _bypassInvestmentGuard?: boolean;
    }): Promise<SwapResult>;
    exchangeQuote(params: {
        from: string;
        to: string;
        amount: number;
    }): Promise<{
        expectedOutput: number;
        priceImpact: number;
        poolPrice: number;
        fee: {
            amount: number;
            rate: number;
        };
    }>;
    investBuy(params: {
        asset: InvestmentAsset;
        usdAmount: number;
        maxSlippage?: number;
    }): Promise<InvestResult>;
    investSell(params: {
        asset: InvestmentAsset;
        usdAmount: number | 'all';
        maxSlippage?: number;
        _strategyOnly?: boolean;
    }): Promise<InvestResult>;
    investEarn(params: {
        asset: InvestmentAsset;
        protocol?: string;
    }): Promise<InvestEarnResult>;
    investUnearn(params: {
        asset: InvestmentAsset;
    }): Promise<InvestEarnResult>;
    investRebalance(opts?: {
        dryRun?: boolean;
        minYieldDiff?: number;
    }): Promise<InvestRebalanceResult>;
    getPendingRewards(): Promise<PendingReward[]>;
    claimRewards(): Promise<ClaimRewardsResult>;
    private swapRewardTokensToUsdc;
    investStrategy(params: {
        strategy: string;
        usdAmount: number;
        dryRun?: boolean;
    }): Promise<StrategyBuyResult>;
    sellStrategy(params: {
        strategy: string;
    }): Promise<StrategySellResult>;
    rebalanceStrategy(params: {
        strategy: string;
    }): Promise<StrategyRebalanceResult>;
    getStrategyStatus(name: string): Promise<StrategyStatusResult>;
    setupAutoInvest(params: {
        amount: number;
        frequency: 'daily' | 'weekly' | 'monthly';
        strategy?: string;
        asset?: string;
        dayOfWeek?: number;
        dayOfMonth?: number;
    }): AutoInvestSchedule;
    getAutoInvestStatus(): AutoInvestStatus;
    runAutoInvest(): Promise<AutoInvestRunResult>;
    stopAutoInvest(id: string): void;
    getPortfolio(): Promise<PortfolioResult & {
        strategyPositions?: Record<string, InvestmentPosition[]>;
    }>;
    positions(): Promise<PositionsResult>;
    rates(): Promise<RatesResult>;
    allRates(asset?: string): Promise<{
        protocol: string;
        protocolId: string;
        rates: LendingRates;
    }[]>;
    allRatesAcrossAssets(): Promise<{
        protocol: string;
        protocolId: string;
        asset: string;
        rates: LendingRates;
    }[]>;
    rebalance(opts?: {
        dryRun?: boolean;
        minYieldDiff?: number;
        maxBreakEven?: number;
    }): Promise<RebalanceResult>;
    earnings(): Promise<EarningsResult>;
    fundStatus(): Promise<FundStatusResult>;
    sentinelList(): Promise<SentinelAgent[]>;
    sentinelInfo(id: string): Promise<SentinelAgent>;
    sentinelAttack(id: string, prompt: string, fee?: bigint): Promise<SentinelAttackResult>;
    private getFreeBalance;
    private resolveLending;
    private emitBalanceChange;
}

declare function validateAddress(address: string): string;
declare function truncateAddress(address: string): 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;

declare function generateKeypair(): Ed25519Keypair;
declare function keypairFromPrivateKey(privateKey: string): Ed25519Keypair;
declare function saveKey(keypair: Ed25519Keypair, passphrase: string, keyPath?: string): Promise<string>;
declare function loadKey(passphrase: string, keyPath?: string): Promise<Ed25519Keypair>;
declare function walletExists(keyPath?: string): Promise<boolean>;
declare function exportPrivateKey(keypair: Ed25519Keypair): string;
declare function getAddress(keypair: Ed25519Keypair): string;

declare function solveHashcash(challenge: string): string;

type FeeOperation = 'save' | 'swap' | 'borrow';
interface ProtocolFeeInfo {
    amount: number;
    asset: string;
    rate: number;
    rawAmount: bigint;
}
declare function calculateFee(operation: FeeOperation, amount: number): ProtocolFeeInfo;
/**
 * Add on-chain fee collection to an existing PTB via t2000::treasury::collect_fee().
 * The Move function splits the fee from the payment coin and stores it in the
 * Treasury's internal Balance<T>. Atomic — reverts with the operation if it fails.
 */
declare function addCollectFeeToTx(tx: Transaction, paymentCoin: TransactionObjectArgument, operation: FeeOperation): void;

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;

declare function getPoolPrice(client: SuiJsonRpcClient): Promise<number>;

declare function getRates(client: SuiJsonRpcClient): Promise<RatesResult>;

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 GasExecutionResult {
    digest: string;
    effects: unknown;
    gasMethod: GasMethod;
    gasCostSui: number;
}
/**
 * Gas resolution chain:
 * 1. Self-funded (agent has enough SUI)
 * 2. Auto-topup (swap USDC→SUI, then self-fund)
 * 3. Gas Station sponsored (fallback)
 * 4. Fail with INSUFFICIENT_GAS
 */
declare function executeWithGas(client: SuiJsonRpcClient, keypair: Ed25519Keypair, buildTx: () => Transaction | Promise<Transaction>, options?: {
    metadata?: TxMetadata;
    enforcer?: SafeguardEnforcer;
}): Promise<GasExecutionResult>;

interface AutoTopUpResult {
    success: boolean;
    tx: string;
    usdcSpent: number;
    suiReceived: number;
}
declare function shouldAutoTopUp(client: SuiJsonRpcClient, address: string): Promise<boolean>;
/**
 * Self-fund a USDC→SUI swap to replenish gas.
 *
 * Uses the agent's remaining SUI to pay for the swap gas (~0.007 SUI).
 * This avoids the chicken-and-egg problem of needing gas station sponsorship
 * to get gas, and works even when the gas station is down.
 */
declare function executeAutoTopUp(client: SuiJsonRpcClient, keypair: Ed25519Keypair): Promise<AutoTopUpResult>;

type GasRequestType = 'bootstrap' | 'auto-topup' | 'fallback';
interface GasSponsorResponse {
    txBytes: string;
    sponsorSignature: string;
    gasEstimateUsd: number;
    type: GasRequestType;
}
interface GasStatusResponse {
    circuitBreaker: boolean;
    suiPrice: number;
    bootstrapUsed?: number;
    bootstrapRemaining?: number;
}
declare function getGasStatus(address?: string): Promise<GasStatusResponse>;

export { AutoInvestManager, AutoInvestRunResult, AutoInvestSchedule, AutoInvestStatus, type AutoTopUpResult, BPS_DENOMINATOR, BalanceResponse, BorrowResult, CLOCK_ID, ClaimRewardsResult, type Contact, ContactManager, type ContactMap, DEFAULT_MAX_LEVERAGE, DEFAULT_MAX_POSITION_SIZE, DEFAULT_NETWORK, DEFAULT_SAFEGUARD_CONFIG, DEFAULT_STRATEGIES, DepositInfo, EarningsResult, type FeeOperation, FundStatusResult, GAS_RESERVE_MIN, type GasExecutionResult, GasMethod, type GasRequestType, type GasSponsorResponse, type GasStatusResponse, HealthFactorResult, INVESTMENT_ASSETS, InvestEarnResult, InvestRebalanceResult, InvestResult, type InvestmentAsset, InvestmentPosition, InvestmentTrade, LendingAdapter, LendingRates, MIST_PER_SUI, MaxBorrowResult, MaxWithdrawResult, OUTBOUND_OPS, PERPS_MARKETS, PendingReward, type PerpsMarket, PortfolioManager, PortfolioResult, PositionsResult, type ProtocolFeeInfo, RatesResult, RebalanceResult, RepayResult, SENTINEL, STABLE_ASSETS, SUI_DECIMALS, SUPPORTED_ASSETS, type SafeguardConfig, SafeguardEnforcer, SafeguardError, type SafeguardErrorDetails, type SafeguardRule, SaveResult, SendResult, SentinelAgent, SentinelAttackResult, type SimulationResult, type StableAsset, StrategyBuyResult, StrategyDefinition, StrategyManager, StrategyRebalanceResult, StrategySellResult, StrategyStatusResult, type SupportedAsset, SwapAdapter, SwapResult, T2000, T2000Error, type T2000ErrorCode, type T2000ErrorData, T2000Options, TransactionRecord, type TxMetadata, USDC_DECIMALS, WithdrawResult, addCollectFeeToTx, calculateFee, executeAutoTopUp, executeWithGas, exportPrivateKey, formatAssetAmount, formatSui, formatUsd, generateKeypair, getAddress, getDecimals, getGasStatus, getPoolPrice, getRates, keypairFromPrivateKey, loadKey, mapMoveAbortCode, mapWalletError, mistToSui, rawToStable, rawToUsdc, saveKey, shouldAutoTopUp, simulateTransaction, solveHashcash, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, walletExists };
