Telegram Group & Telegram Channel
Semolina Code (Python / TypeScript)
Конкурс Сейчас один знакомый написал, что в web3 софтах на JS/TS нельзя добавить прокси к rpc вызовам Пробовал на либах web3.js, ethers.js, viem Мб тут есть сильные JSеры, которые смогут показать пример как добавить http прокси в одну из библиотек (web3.js…
Конкурс закрывается

Победитель @fraggdiller 🏆
https://www.oklink.com/ru/arbitrum/tx/0x6d0e1196aef639b2b2f6aa75bab962ab9fe626bfee233e15d0ce61ee129f2940

Получилось прикрутить прокси к ethers.js:

import { HttpsProxyAgent } from 'https-proxy-agent';
import { ethers } from 'ethers';

(async () => {
const proxy = '';
const rpc = '';

let fetchRequest: ethers.FetchRequest;
const agent = new HttpsProxyAgent(proxy);

fetchRequest = new ethers.FetchRequest(rpc);
// fetchRequest.setHeader('user-agent', userAgent);
fetchRequest.getUrlFunc = ethers.FetchRequest.createGetUrlFunc({ agent: agent });

let provider = new ethers.JsonRpcProvider(fetchRequest);
console.log(await provider.getBlockNumber());
})();


SemolinaCode | Chat | YouTube | Arbuzers | HowToCode | Prop



tg-me.com/semolina_code_python/87
Create:
Last Update:

Конкурс закрывается

Победитель @fraggdiller 🏆
https://www.oklink.com/ru/arbitrum/tx/0x6d0e1196aef639b2b2f6aa75bab962ab9fe626bfee233e15d0ce61ee129f2940

Получилось прикрутить прокси к ethers.js:


import { HttpsProxyAgent } from 'https-proxy-agent';
import { ethers } from 'ethers';

(async () => {
const proxy = '';
const rpc = '';

let fetchRequest: ethers.FetchRequest;
const agent = new HttpsProxyAgent(proxy);

fetchRequest = new ethers.FetchRequest(rpc);
// fetchRequest.setHeader('user-agent', userAgent);
fetchRequest.getUrlFunc = ethers.FetchRequest.createGetUrlFunc({ agent: agent });

let provider = new ethers.JsonRpcProvider(fetchRequest);
console.log(await provider.getBlockNumber());
})();


SemolinaCode | Chat | YouTube | Arbuzers | HowToCode | Prop

BY Semolina Code (Python / TypeScript)


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/semolina_code_python/87

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

telegram from us


Telegram Semolina Code (Python / TypeScript)
FROM USA