otterscan/src/address/DecodedABI.tsx

21 lines
488 B
TypeScript
Raw Normal View History

2021-10-25 04:29:50 +00:00
import { Interface } from "@ethersproject/abi";
import React from "react";
import DecodedFragment from "./DecodedFragment";
type DecodedABIProps = {
abi: any[];
};
const DecodedABI: React.FC<DecodedABIProps> = ({ abi }) => {
const intf = new Interface(abi);
return (
2021-10-25 17:49:17 +00:00
<div className="border overflow-x-auto">
2021-10-25 04:29:50 +00:00
{intf.fragments.map((f, i) => (
<DecodedFragment key={i} intf={intf} fragment={f} />
))}
</div>
);
};
export default React.memo(DecodedABI);