Skip to content

Commit

Permalink
adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
killroy192 committed Jul 13, 2024
1 parent 11881e8 commit 15ad9e2
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/libs/proxify/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export function getProxyAgent(update = false) {
maxSockets: 256,
maxFreeSockets: 256,
proxy: getURI(),
rejectUnauthorized: false,
});
}
return agent;
Expand Down
33 changes: 30 additions & 3 deletions src/libs/proxify/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,36 @@ import { headers, axiosInstance } from "./sham";
import { currentTime, markTime } from "src/libs/clock";
import { sleep } from "src/libs/shared";

async function logIpInfo(proxifyAxios: AxiosInstance) {
const res = await proxifyAxios.get("https://ident.me");
console.log(`ip ${res.data}`);
type WhoamiReport = {
hostname: string;
ip: string[];
headers: {
Accept: string[];
"Accept-Encoding": string[];
"Accept-Language": string[];
Priority: string[];
"Sec-Ch-Ua": string[];
"Sec-Ch-Ua-Mobile": string[];
"Sec-Ch-Ua-Platform": string[];
"Sec-Fetch-Dest": string[];
"Sec-Fetch-Mode": string[];
"Sec-Fetch-Site": string[];
"Sec-Fetch-User": string[];
"Upgrade-Insecure-Requests": string[];
"User-Agent": string[];
"X-Forwarded-For": string[];
"X-Forwarded-Host": string[];
"X-Real-Ip": string[];
};
url: string;
host: string;
method: "GET";
remoteAddr: string;
};

async function logIpInfo(axiosInstance: AxiosInstance) {
const res = await axiosInstance.get<WhoamiReport>("https://whoami.lagunovsky.com/api");
console.log(`ip ${res.data.headers["X-Real-Ip"]}`);
}

const httpsAgent = new https.Agent({
Expand Down
5 changes: 2 additions & 3 deletions src/packages/fuel/deposit/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const getExpenses = async (publicClient: PublicClient) => {
args: [zeroAddress, zeroAddress, 0n],
});

return (depositCost + withdrawCost) * 4n * (await publicClient.getGasPrice());
return (depositCost + withdrawCost) * 5n * (await publicClient.getGasPrice());
};

const getAccountToDeposit = async (
Expand All @@ -91,7 +91,6 @@ const getAccountToDeposit = async (
minDeposit: number,
) => {
const expenses = await getExpenses(publicClient);
console.log("expenses", expenses);
const ethPrice = await getPrice(publicClient, chainLinkAddresses.ETHUSD[chains.mainnet.id], 18);
return Promise.all(
decodedEVMAccounts.map(prepare({ publicClient, expenses, ethPrice, minDeposit: parseEther(String(minDeposit)) })),
Expand All @@ -113,7 +112,7 @@ export async function initDeposits(masterKey: string, minDeposit: number) {
deposited: formatEther(accountToDeposit.toDeposit),
txHash,
};
await sleep(getRandomArbitrary(3 * 3600000, 6 * 3600000));
await sleep(getRandomArbitrary(3 * 3600000, 5 * 3600000));
accountToDeposit = await getAccountToDeposit(decodedEVMAccounts, publicClient, minDeposit);
}
saveInFolder(
Expand Down
3 changes: 2 additions & 1 deletion src/packages/scroll/report/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getProfiles, saveInFolder } from "src/libs/shared";

const refreshAndCall = (index: string, address: string) => async (report: any) => {
try {
const axiosInstance = await refreshProxy();
const axiosInstance = await refreshProxy(3000);

axiosRetry(axiosInstance, {
retries: 3,
Expand All @@ -24,6 +24,7 @@ const refreshAndCall = (index: string, address: string) => async (report: any) =
};
return report;
} catch (error) {
console.log(error);
console.log((error as { message: any })?.message);
report[index] = {};
return report;
Expand Down

0 comments on commit 15ad9e2

Please sign in to comment.