Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/openchainxyz/abi-guesser


https://github.com/openchainxyz/abi-guesser

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# ABI Guesser

This package allows you to take any ABI-encoded blob of data, such as calldata, return data, or anything else that can be parsed with `abi.decode()`, and reverse-engineer the types of the values inside that blob.

Note that this package will not be able to guess the types for any data which was encoded in a non-standard manner.

## Installation

```bash
npm i @openchainxyz/abi-guesser
```

## Usage

```javascript
import { guessAbiEncodedData, guessFragment } from '@openchainxyz/abi-guesser'

const paramTypes: ParamType[] = guessAbiEncodedData(calldata)!;

const fragment: FunctionFragment = guessFragment(calldata)!;
```