/** * Hedera Chain Adapter * * Hedera supports a fully EVM-compatible JSON-RPC relay (Hashio), * so this adapter is a thin wrapper around ethers.js pointed at * Hedera's relay endpoint. Builds EIP-1559 transactions, attaches * secp256k1 ECDSA signatures from the FROST threshold signing * network, and broadcasts via the Hedera JSON-RPC relay. * * Curve: secp256k1 (ECDSA) * Native token: HBAR (1 HBAR = 1e8 tinybars, 1e18 weibars via EVM relay) * * Hedera EVM relay uses standard 18-decimal wei denomination * (like Ethereum), even though native HBAR uses 8-decimal tinybars. * All values passed to buildTransaction should be in weibars (1e18). * * No external dependencies beyond ethers.js (already a core SDK dep). */ import { ChainAdapter, HederaTransaction } from '../core/types'; export declare class HederaAdapter implements ChainAdapter { private provider; private network; private chainId; private mirrorUrl; constructor(network?: 'mainnet' | 'testnet', apiUrl?: string); getRpcUrl(): string; /** * Build an unsigned EVM transaction for the Hedera JSON-RPC relay. * * The Hedera EVM relay is fully EIP-1559 compatible. Values are in * weibars (1e18 per HBAR), consistent with standard EVM tooling. * * If a HederaTransaction is passed (with amount in tinybars), it is * automatically converted to weibars for the EVM relay. * * @returns hex-encoded unsigned serialized transaction (RLP) */ buildTransaction(tx: HederaTransaction, fromAddress: string): Promise; /** * Attach a secp256k1 ECDSA signature to the unsigned transaction. * * Expects a 65-byte signature: r (32) || s (32) || v (1). * Same format as Ethereum — the Hedera EVM relay accepts * standard signed EVM transactions. */ attachSignature(unsignedTx: string, signature: string): Promise; /** * Broadcast a signed transaction via the Hedera JSON-RPC relay. * * The relay forwards the EVM transaction to the Hedera network * where it is executed as a native HBAR transfer or contract call. * * @returns transaction hash */ broadcast(signedTx: string): Promise; /** * Get HBAR balance via the EVM relay. * * Returns balance in weibars (1e18 per HBAR), consistent with * the EVM relay denomination. Divide by 1e18 for HBAR. */ getBalance(address: string): Promise; /** * Get HBAR balance in tinybars via the Mirror Node REST API. * * This uses the native Hedera denomination (1 HBAR = 1e8 tinybars) * for applications that need the native format. */ getBalanceTinybars(accountId: string): Promise; /** * Resolve a Hedera account ID (0.0.XXXXX) to an EVM address. * * If the input is already a 0x-prefixed EVM address, returns it as-is. * Otherwise queries the Mirror Node to look up the EVM address. */ resolveAddress(address: string): Promise; /** * Convert a Hedera account ID (0.0.XXXXX) to a "long-zero" EVM address. * * For accounts without an explicit EVM alias, Hedera maps account IDs * to EVM addresses by zero-padding the account number into 20 bytes. * e.g. 0.0.12345 -> 0x0000000000000000000000000000000000003039 * * For accounts with an EVM alias, queries the Mirror Node. */ private accountIdToEvmAddress; /** * Look up account info from the Mirror Node REST API. */ getAccountInfo(accountId: string): Promise | null>; /** * Get transaction details from the Mirror Node REST API. */ getTransactionInfo(txId: string): Promise | null>; /** Estimate gas for a transaction */ estimateGas(tx: HederaTransaction, fromAddress: string): Promise; /** Get current gas price from the relay */ getGasPrice(): Promise<{ maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; }>; /** Get current block number from the relay */ getBlockNumber(): Promise; /** Get transaction receipt from the relay */ getTransactionReceipt(hash: string): Promise; /** Wait for transaction confirmation */ waitForTransaction(hash: string, confirmations?: number): Promise; } /** Create a mainnet Hedera adapter */ export declare function createHederaAdapter(apiUrl?: string): HederaAdapter; /** Create a testnet Hedera adapter */ export declare function createHederaTestnetAdapter(apiUrl?: string): HederaAdapter; //# sourceMappingURL=hedera.d.ts.map