@solarity/hardhat-migrate
Version:
The simplest way to deploy smart contracts
24 lines • 852 B
JavaScript
import { isAxiosError } from "axios";
import { networkManager } from "./NetworkManager.js";
export async function sendGetRequest(url) {
try {
const response = await networkManager.axios.get(url, {
proxy: process.env.http_proxy
? {
host: new URL(process.env.http_proxy).hostname,
port: parseInt(new URL(process.env.http_proxy).port),
}
: false,
});
return { status: response.status, data: response.data }; // Returning only status and data
}
catch (error) {
if (isAxiosError(error) && error.response) {
return { status: error.response.status, data: error.response.data };
}
else {
return { status: 0, data: null };
}
}
}
//# sourceMappingURL=requests.js.map