UNPKG

@0x/0x-parser

Version:

🧾 Designed for 0x integrators: This library parses 0x transactions on EVM blockchains into a format that is both user-friendly and easy to understand.

37 lines (36 loc) • 1.1 kB
import type { Address } from "viem"; import type { Trace, EnrichedLog, EnrichLogsArgs, SupportedChainId } from "../types"; export declare function isChainIdSupported(chainId: number): chainId is SupportedChainId; export declare function calculateNativeTransfer(trace: Trace, options: { recipient: Address; direction?: "to" | "from"; }): string; export declare function transferLogs({ publicClient, transactionReceipt, }: EnrichLogsArgs): Promise<EnrichedLog[]>; export declare function parseSmartContractWalletTx({ logs, trace, chainId, smartContractWallet, }: { logs: EnrichedLog[]; trace: Trace; chainId: SupportedChainId; smartContractWallet: Address; }): { tokenIn: { address: `0x${string}`; amount: string; symbol: string; }; tokenOut: { address: string; amount: string; symbol: string; }; } | { tokenIn: { address: string; amount: string; symbol: string; }; tokenOut: { address: `0x${string}`; amount: string; symbol: string; }; } | null;