/** * TRON blockchain integration via TronGrid. * Read incoming TRX/TRC20 transfers and broadcast outbound transactions. */ /** PostgreSQL signed BIGINT upper bound. */ export declare const PG_BIGINT_MAX = 9223372036854775807n; /** * Parses a TRC20 transfer `value` from TronGrid into smallest token units. * Rejects non-decimal strings, floats, negative values, and amounts that do not fit in PG BIGINT. */ export declare function parseTrc20TokenAmount(raw: unknown): bigint | null; /** * Returns the current TRON block number from the node. * @returns Latest block height */ export declare function getCurrentBlock(): Promise; /** * Returns the block timestamp in Unix ms for a given block height. */ export declare function getBlockTimestamp(blockNumber: number): Promise; /** Incoming native TRX transfer parsed from TronGrid account transactions. */ export interface TronIncomingTx { txId: string; from: string; to: string; amount: number; block: number; confirmations: number; } /** * Fetches confirmed incoming TRX transfers to an address since an optional timestamp. * @param address TRON base58 deposit address * @param minTimestamp Optional minimum block timestamp in ms (filters older txs) * @returns Parsed incoming transactions with estimated confirmations (~3s per block) */ export declare function getTrxTransactionsToAddress(address: string, minTimestamp?: number): Promise; /** Incoming TRC20 token transfer from TronGrid TRC20 endpoint. */ export interface Trc20Transfer { txId: string; from: string; to: string; value: string; block: number; block_timestamp: number; /** Confirmations estimated from elapsed time (~3s per block). */ confirmations: number; } /** * Fetches confirmed incoming TRC20 transfers to an address for a given contract. * @param address TRON base58 deposit address * @param contractAddress TRC20 contract address (e.g. USDT) * @param minTimestamp Optional minimum event timestamp in ms * @returns Transfers where `to` matches the address, with raw token value as string */ export declare function getTrc20TransfersToAddress(address: string, contractAddress: string, minTimestamp?: number): Promise; /** * Sends native TRX from a hot wallet private key. * @param fromPrivateKeyHex Sender private key in hex * @param toAddress Recipient base58 address * @param amountSun Amount in sun (1 TRX = 1e6 sun) * @returns Broadcast transaction ID * @throws {Error} When broadcast returns no txid */ export declare function sendTrx(fromPrivateKeyHex: string, toAddress: string, amountSun: bigint): Promise; /** * Sends TRC20 tokens via contract transfer from a hot wallet. * @param fromPrivateKeyHex Sender private key in hex * @param contractAddress TRC20 contract address * @param toAddress Recipient base58 address * @param amountRaw Token amount in smallest unit (string passed to contract) * @returns Transaction ID from broadcast result */ export declare function sendTrc20(fromPrivateKeyHex: string, contractAddress: string, toAddress: string, amountRaw: bigint): Promise; /** * Returns native TRX balance in sun for an address. */ export declare function getTrxBalanceSun(address: string): Promise; /** * Returns TRC20 token balance in smallest units for an address. */ export declare function getTrc20BalanceRaw(address: string, contractAddress: string): Promise; //# sourceMappingURL=tronService.d.ts.map