Но тут победитель уже я
Осталось только viem добить и будет опять непонятно с какой либой работать
import { HttpsProxyAgent } from 'https-proxy-agent';
import Web3HttpProvider from 'web3-providers-http';
import Web3 from 'web3';
(async () => {
const proxy = '';
const rpc = '';
const httpProxyAgent = new HttpsProxyAgent(proxy);
const options = {
providerOptions: {
agent: httpProxyAgent,
keepAlive: true,
withCredentials: false,
timeout: 20000,
headers: [
['Access-Control-Allow-Origin', '*'],
['accept', '*/*'],
] as [string, string][]
}
};
const provider = new Web3HttpProvider(rpc, options);
const web3 = new Web3(provider);
console.log(await web3.eth.getChainId());
})();
SemolinaCode | Chat | YouTube | Arbuzers | HowToCode | Prop