import React from 'react' import Window from "./Window"; class State extends React.Component { constructor(props) { super(props) this.state = {Balance: -2, State: {}} } async componentDidMount() { const tipset = await this.props.client.call("Filecoin.ChainHead", []) // TODO: from props const actstate = await this.props.client.call('Filecoin.StateReadState', [this.props.actor, tipset]) this.setState(actstate) } render() { const content =
Balance: {this.state.Balance}
---
{Object.keys(this.state.State).map(k =>
{k}: {JSON.stringify(this.state.State[k])}
)}
return {content} } } export default State