@lodestar/prover
Version:
A Typescript implementation of the Ethereum Consensus light client
33 lines • 820 B
JavaScript
export const fetchRequestPayload = async (req) => {
return new Promise((resolve, reject) => {
let body = "";
req.on("data", (chunk) => {
body += chunk;
});
req.on("end", () => {
try {
resolve(JSON.parse(body));
}
catch (err) {
reject(err);
}
});
});
};
export const fetchResponseBody = async (res) => {
return new Promise((resolve, reject) => {
let body = "";
res.on("data", (chunk) => {
body += chunk;
});
res.on("end", () => {
try {
resolve(JSON.parse(body));
}
catch (err) {
reject(err);
}
});
});
};
//# sourceMappingURL=req_resp.js.map