{"size": 588, "ext": "js", "max_stars_repo_path": "examples/service_jsonrpc/src/index.js", "max_stars_repo_name": "nbltrust/filecoin-signing-tools", "max_stars_repo_stars_event_min_datetime": "2020-07-11T10:57:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-28T14:37:03.000Z", "max_issues_repo_path": "examples/service_jsonrpc/src/index.js", "max_issues_repo_name": "nbltrust/filecoin-signing-tools", "max_issues_repo_issues_event_min_datetime": "2020-07-08T12:10:03.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T15:41:45.000Z", "max_forks_repo_path": "examples/service_jsonrpc/src/index.js", "max_forks_repo_name": "nbltrust/filecoin-signing-tools", "max_forks_repo_forks_event_min_datetime": "2020-07-09T14:44:28.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-30T13:46:47.000Z"}
{"max_stars_count": 71, "max_issues_count": 164, "max_forks_count": 34, "avg_line_length": 18.375, "max_line_length": 69, "alphanum_fraction": 0.5697278912}
const axios = require('axios')

export async function callMethod(url, method, params, id, jwt = '') {
  const config = {
    headers: {
      'Content-Type': 'application/json',
      Accept: '*/*',
    },
  }

  // Include JWT
  if (jwt.length > 0) {
        config.headers['Authorization'] = `Bearer ${jwt}`
  }

  const postData = {
    jsonrpc: '2.0',
    method: `${method}`,
    params,
    id,
  }

  console.log("=================")
  console.log(url, postData, config)

  const answer = await axios.post(url, postData, config)

  console.log(answer.data)

  return answer.data
}
