import { Axios } from 'axios' export default class RequestModule { protected _http: Axios constructor(http: Axios) { this._http = http } async post( method: string, query?: Record ): Promise { const res = await this._http.post('', { method: method, jsonrpc: '2.0', id: this._reqId(), params: { query: query, }, }) return res.data } private _reqId() { const min = 1 const max = Date.now(); return Math.floor(Math.random() * (max - min + 1)) + min } }