UNPKG

@eco-foundation/routes

Version:

The Eco Routes Protocol is a decentralized intent based system that allows users to submit their intent to the network and have it fulfilled by a solver on the destination rollup of their choice.

21 lines (20 loc) 919 B
/** * @file utils.ts * * Utility functions for working with Solidity ABI structures in TypeScript. * Provides tools to extract, parse, and manipulate ABI definitions for type-safe * interaction with smart contracts. */ import { Abi, AbiParameter } from 'viem'; /** * Extracts the ABI struct definition with the given name from a contract ABI * * This function enables type-safe extraction of Solidity struct definitions from * contract ABIs, which is essential for encoding and decoding complex data structures. * * @param abi - The contract ABI containing the struct definition * @param structName - The name of the struct to extract * @returns The struct component definition with proper typing * @throws Error if the struct is not found in the ABI */ export declare function extractAbiStruct<AbiExt extends Abi, AbiReturn extends readonly AbiParameter[]>(abi: AbiExt, structName: string): AbiReturn;