当前位置:网站首页>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);
});边栏推荐
- [harmony OS] [arkui] ETS development graphics and animation drawing
- 【组队学习】SQL编程语言笔记——Task04
- redis
- 教你如何在winpe里安装win11系统
- 完美洗牌问题
- 香蕉为什么能做随机数生成器?因为,它是水果界的“辐射之王”
- Work assessment of Biopharmaceutics of Jilin University in March of the 22nd spring -00005
- The problem that only the home page can be accessed under openSUSE Apache laravel
- 陆奇首次出手投资量子计算
- Amazon's other side in China
猜你喜欢

Randla net: efficient semantic segmentation of large scale point clouds

Now, the ear is going into the metauniverse

Two common OEE monitoring methods for equipment utilization

The more AI evolves, the more it resembles the human brain! Meta found the "prefrontal cortex" of the machine. AI scholars and neuroscientists were surprised

Lu Qi invests in quantum computing for the first time

【Harmony OS】【ArkUI】ets开发 图形与动画绘制

ZABBIX installation pit avoidance Guide

Lao Ye's blessing

Void* pointer

用CPU方案打破内存墙?学PayPal堆傲腾扩容量,漏查欺诈交易量可降至1/30
随机推荐
Musk: Twitter should learn from wechat and make 1billion people "live on it" into a super app
Teach you how to install win11 system in winpe
[rust submission] review impl trail and dyn trail in rust
【Rust投稿】从零实现消息中间件(6)-CLIENT
zabbix的安装避坑指南
Internet Explorer died, and netizens started to build a true tombstone
PHP代码审计2—这些函数必知必会
BGP biplane architecture
Huawei failed to appeal and was prohibited from selling 5g equipment in Sweden; Apple regained the first place in the world in terms of market value; DeNO completes round a financing of USD 21million
Background page production 01 production of IVX low code sign in system
Xidian AI ranked higher than Qingbei in terms of AI majors, and Nantah ranked the first in China in 2022 in terms of soft science majors
太极图形60行代码实现经典论文,0.7秒搞定泊松盘采样,比Numpy实现快100倍
Jilin University 22 spring March "career design" assignment assessment-00072
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
【Rust投稿】捋捋 Rust 中的 impl Trait 和 dyn Trait
Serious PHP defects can lead to rce attacks on QNAP NAS devices
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
AI越进化越跟人类大脑像!Meta找到了机器的“前额叶皮层”,AI学者和神经科学家都惊了...
About PLSQL error initialization failure
Program. Launch (xxx) open file