eth-typed-data
Version:
A library to simplifiy interacting with and signing EIP712 typed data
38 lines (33 loc) • 831 B
JavaScript
import React, { Component } from 'react'
import JSONInput from 'react-json-editor-ajrm';
import locale from 'react-json-editor-ajrm/locale/en';
const sampleObject = {
}
export const TypeCreator = ({ create }) => {
return (
<div>
<select>
{types.map(() =>
<option></option>
)}
</select>
<JSONInput
placeholder={sampleObject}
colors={darktheme}
locale={locale}
height="550px" />
<button onClick={create()}>+</button>
</div>
)
}
/**
* Component to display a type's encoding and hash
*/
export const TypeViewer = ({ typeclass: TypeClass }) => {
return (
<div className="type-class">
<div className="name">{TypeClass.encodeType()}</div>
<div className="hash">{TypeClass.typeHash()}</div>
</div>
)
}