0.0.1 • Published 2 years ago

abi2sols v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

abi2solidity

Convert an ABI to a Solidity interface, updated for version 0.8.4

Install

$ npm install --save abi2sols
# OR
$ yarn add abi2sols

Code Usage

import abi2sols from "abi2sols";

const ABI = `
[
  {
    "constant": false,
    "inputs": [],
    "name": "f",
    "outputs": [
      {
        "name": "",
        "type": "uint256"
      }
    ],
    "payable": false,
    "stateMutability": "nonpayable",
    "type": "function"
  }
]
`;

const solidity = abi2sols(ABI);
console.log(solidity);
// Will print out:
// interface GeneratedInterface {
//   function f (  ) external returns ( uint256 );
// }

License

MIT