abi-to-solidity-interface
v0.1.1
Published
Convert Ethereum ABI to Solidity Interface
Downloads
5
Maintainers
Readme
Convert Ethereum ABI to Solidity Interface
Install
npm install abi-to-solidity-interface
Usage
import { abiToSolidityInterface } from "abi-to-solidity-interface";
const abi = [
{
inputs: [],
name: "add",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "count",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
];
const contractName = "Counter";
const solidityInterface = abiToSolidityInterface(abi, contractName);
interface Counter {
function add();
function count() external view returns (uint256);
}