Replies: 1 comment 2 replies
-
As far as I know it should work. I haven’t used matic myself, but believe it is Ethereum compatible. Have you tried? Did it not work? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As the tile, can we use ethers.js functions by merely changing the provider? Or I need to use maticjs instead. I want to do a trading bot on quickswap. Sorry if this question is unorganized.
const ethers = require('ethers');
const addresses = {
WMATIC: '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
factory: '0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32',
router: '0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff',
recipient: '0xDe1FD04317492130A9ca13945c078bA3F5A673DC'
}
const mnemonic = 'XXXX';
const provider = new ethers.providers.WebSocketProvider('wss://rpc-mainnet.maticvigil.com/ws/v1/XXXXXX');
const wallet = ethers.Wallet.fromMnemonic(mnemonic);
const account = wallet.connect(provider);
Beta Was this translation helpful? Give feedback.
All reactions