当前位置:网站首页>Monitoring pancakeswap new token
Monitoring pancakeswap new token
2022-06-25 03:57:00 【Blockchain research】
Need to use ethers This library
Go straight to the code
const ethers = require('ethers');
const addresses = {
WBNB: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
router: "0x10ED43C718714eb63d5aA57B78B54704E256024E",
factory: "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73",
me: "YOUR_WALLET_ADDRESS"
}
const provider = new ethers.providers.WebSocketProvider("wss://bsc-ws-node.nariox.org:443");
let privateKey = ` Your wallet private key `;
const wallet = new ethers.Wallet(privateKey);
const account = wallet.connect(provider);
const factory = new ethers.Contract(
addresses.factory,
['event PairCreated(address indexed token0, address indexed token1, address pair, uint)'],
account,
);
const router = new ethers.Contract(
addresses.router,
[
'function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts)',
'function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)',
],
account,
);
factory.on("PairCreated", async (token0, token1, addressPair) => {
console.log('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
console.log('token0', token0);
console.log('token1', token1);
console.log('addressPair', addressPair);
});边栏推荐
- Winxp kernel driver debugging
- Two common OEE monitoring methods for equipment utilization
- Work assessment of Biopharmaceutics of Jilin University in March of the 22nd spring -00005
- Sleep more, you can lose weight. According to the latest research from the University of Chicago, sleeping more than 1 hour a day is equivalent to eating less than one fried chicken leg
- 用CPU方案打破内存墙?学PayPal堆傲腾扩容量,漏查欺诈交易量可降至1/30
- Mobile mall project operation
- 吴恩达机器学习新课程又来了!旁听免费,小白友好
- [team learning] SQL programming language notes - task04
- 亚马逊在中国的另一面
- Break the memory wall with CPU scheme? Learn from PayPal stack to expand capacity, and the volume of missed fraud transactions can be reduced to 1/30
猜你喜欢

zabbix的安装避坑指南

How to use crawlers to capture bullet screen and comment data of station B?

严重的PHP缺陷可导致QNAP NAS 设备遭RCE攻击

Deveco studio 3.0 editor configuration tips

(ultra detailed onenet TCP protocol access) arduino+esp8266-01s accesses the Internet of things platform, uploads real-time collected data /tcp transparent transmission (and how to obtain and write Lu

China's SkyEye found suspicious signals of extraterrestrial civilization. Musk said that the Starship began its orbital test flight in July. Netinfo office: app should not force users to agree to proc

TensorFlow,危!抛弃者正是谷歌自己

Redis related-01

9 necessary soft skills for program ape career development

Interview with Mo Tianlun | ivorysql wangzhibin - ivorysql, an Oracle compatible open source database based on PostgreSQL
随机推荐
(ultra detailed onenet TCP protocol access) arduino+esp8266-01s accesses the Internet of things platform, uploads real-time collected data /tcp transparent transmission (and how to obtain and write Lu
MySQL根据表前缀批量修改、删除表
How to play well in the PMP Exam?
Jilin University 22 spring March "official document writing" assignment assessment-00029
Jilin University 22 spring March "technical economics" assignment assessment-00073
OpenSUSE environment PHP connection Oracle
Serious PHP defects can lead to rce attacks on QNAP NAS devices
Redis related-02
Jilin University 22 spring March "official document writing" assignment assessment-00084
现在,耳朵也要进入元宇宙了
windows 2003 64位系统php运行报错:1% 不是有效的 win32 应用程序
马斯克被诉传销索赔2580亿美元,台积电公布2nm制程,中科院发现月壤中含有羟基形式的水,今日更多大新闻在此...
Crawler crawls Sina Weibo data
The era of copilot free is over! The official version is 67 yuan / month, and the student party and the defenders of popular open source projects can prostitute for nothing
【Rust投稿】从零实现消息中间件(6)-CLIENT
ASP. Net conference room booking applet source code booking applet source code
Background page production 01 production of IVX low code sign in system
opencv 红色区域在哪里?
Zuckerberg's latest VR prototype is coming. It is necessary to confuse virtual reality with reality
TC object structure and abbreviation