@ledgerhq/coin-hedera
Version:
Ledger Hedera Coin integration
21 lines • 1.83 kB
TypeScript
import { TransactionId } from "@hashgraph/sdk";
import type { Operation } from "@ledgerhq/types-live";
import BigNumber from "bignumber.js";
import type { HederaConfig } from "../config";
import type { HederaMirrorTokenTransfer, HederaMirrorCoinTransfer, HederaThirdwebTransaction, HederaThirdwebDecodedTransferParams, OperationERC20, HederaERC20TokenBalance, ERC20TokenTransfer, EnrichedERC20Transfer } from "../types";
export declare function createTransactionId(accountId: string, config: HederaConfig): Promise<TransactionId>;
export declare function parseTransfers(mirrorTransfers: (HederaMirrorCoinTransfer | HederaMirrorTokenTransfer)[], address: string, stakingReward?: BigNumber): Pick<Operation, "type" | "value" | "senders" | "recipients">;
export declare function getERC20BalancesForAccount(evmAccountId: string, supportedTokenIds?: string[]): Promise<HederaERC20TokenBalance[]>;
export declare function getERC20BalancesForAccountV2(address: string): Promise<HederaERC20TokenBalance[]>;
export declare const getERC20Operations: (latestERC20Transactions: HederaThirdwebTransaction[]) => Promise<OperationERC20[]>;
export declare function parseThirdwebTransactionParams(transaction: HederaThirdwebTransaction): HederaThirdwebDecodedTransferParams | null;
/**
* Enriches raw ERC20 transfers from Hgraph with additional data needed for operations:
* - fetches contract call result containing gas metrics and block hash
* - finds the corresponding Mirror Node transaction by consensus timestamp
*
* @param erc20Transfers - Raw ERC20 transfers from Hgraph API
* @returns Array of enriched transfers with complete operation data, filtered to supported tokens only
*/
export declare const enrichERC20Transfers: (erc20Transfers: ERC20TokenTransfer[]) => Promise<EnrichedERC20Transfer[]>;
//# sourceMappingURL=utils.d.ts.map