Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/montyanderson/ethereum-abi
Fully-tested, lightweight Ethereum ABI encoder/decoder
https://github.com/montyanderson/ethereum-abi
abi contract decoder encoder ethereum javascript rpc serial smart
Last synced: 16 days ago
JSON representation
Fully-tested, lightweight Ethereum ABI encoder/decoder
- Host: GitHub
- URL: https://github.com/montyanderson/ethereum-abi
- Owner: montyanderson
- License: mit
- Created: 2017-07-25T14:28:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-25T16:48:09.000Z (over 7 years ago)
- Last Synced: 2024-11-17T05:25:27.061Z (3 months ago)
- Topics: abi, contract, decoder, encoder, ethereum, javascript, rpc, serial, smart
- Language: JavaScript
- Homepage:
- Size: 65.4 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ethereum-abi
Fully-tested, lightweight Ethereum ABI encoder/decoder ([ethereumjs-abi](https://github.com/ethereumjs/ethereumjs-abi/) comes to **500k+** in browserify)
Currently supports:
* all `uint`/`int` types
* `string`
* `bytes`
* `bool`To do:
* Fixed-size arrays
* Dynamic arrays of all types## Usage
``` javascript
const abi = require("ethereum-abi");
```* Get a method signature
``` javascript
abi.methodID("test", [ "uint" ]);
```* Encode arguments
``` javascript
abi.rawEncode([ "uint", "int32" ], [ 12, 300 ]);
```* Decode arguments
``` javascript
abi.rawDecode([ "int64" ], Buffer.from("ffffffffffffffffffffffffffffffffffffffffffffffffffffb29c26f344fe", "hex"));
```