import { v4 as uuidv4 } from 'uuid';
class BaseMessage {
    buildRequest(params) {
        this.request = Object.assign({ jsonrpc: '2.0', id: uuidv4() }, params);
    }
}
class Request extends BaseMessage {
    constructor(method, data) {
        super();
        this.buildRequest({ method: method, params: data });
    }
}
class Result extends BaseMessage {
    constructor(id, method) {
        super();
        this.buildRequest({ id, result: { method } });
    }
    toString() {
        return this.method;
    }
}
export { BaseMessage, Request, Result };
