{"size": 1406, "ext": "js", "max_stars_repo_path": "example/src/App.js", "max_stars_repo_name": "crownemmanuel/libra-web", "max_stars_repo_stars_event_min_datetime": "2019-07-08T14:36:22.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-08T13:24:21.000Z", "max_issues_repo_path": "example/src/App.js", "max_issues_repo_name": "crownemmanuel/libra-web", "max_issues_repo_issues_event_min_datetime": "2019-07-10T07:03:39.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T14:53:43.000Z", "max_forks_repo_path": "example/src/App.js", "max_forks_repo_name": "crownemmanuel/libra-web", "max_forks_repo_forks_event_min_datetime": "2019-07-08T14:36:30.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-05T13:35:10.000Z"}
{"max_stars_count": 28, "max_issues_count": 17, "max_forks_count": 16, "avg_line_length": 27.0384615385, "max_line_length": 160, "alphanum_fraction": 0.6187766714}
import React from 'react'
import logo from './logo.svg'
import './App.css'

import { LibraClient, LibraNetwork, LibraWallet } from 'libra-web'

class App extends React.Component {
  onTransfer = async () => {
    const client = new LibraClient()
    const wallet = new LibraWallet(
      'silk rural awake receive timber bronze mutual message squeeze rug result shoot settle guide wheat believe dune fall share syrup picture true offer slow',
    )

    // TEST ACCOUNT CREATION
    const account1 = wallet.getAccount()
    const account1Address = account1.getAddress().toHex()
    console.log('User 1 address is', account1Address)

    const yAmount = 1e6
    const transferResult = await client.transferCoins(
      account1,
      '1dc70740d8ef845095db2cc1af5be777ff1fbfe4361cff36ff4c6952072b9296',
      yAmount,
    )

    console.log(transferResult)
  }

  render() {
    return (
      <div className="App">
        <header className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <p style={{ textAlign: 'center' }}>
            <button onClick={this.onTransfer}>Transfer</button>
          </p>
          <a
            className="App-link"
            href="https://reactjs.org"
            target="_blank"
            rel="noopener noreferrer"
          >
            Learn React
          </a>
        </header>
      </div>
    )
  }
}

export default App
