0.0.4 • Published 1 year ago

@ethui/abiparse v0.0.4

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

@ethui/abiparse

A parser for translating raw input into usable Ethereum ABI parameters

Features

  • Parses strings of deeply nested arrays
  • Understands the native ethereum types
  • Output structure is compatible with viem ABI parameters

Usage

Install the package...

yarn add @ethui/abiparser

...and use it:

import { parse } from "@ethui/abiparser";

parse("-1");
// => -1

parse("[[1], 2]");
// => [[1n], 2n]

parse('[0x1234, "foo", [1, 2, 3]]');
// => ["0x1234", "foo", [1n, 2n, 3n]]

TODO

  • fixed-length arrays
  • tuples / structs
  • parse "1 ether", "1 gwei" into the corresponding numbers
  • support ENS addresses somehow
0.0.4

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago