Skip to content

Commit 51bd0aa

Browse files
committed
fix: changed rpc end endpoint for node provider to websocket, shifted to alchemy
1 parent 94b7576 commit 51bd0aa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

routes/nftMint.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ let isEventListenerCreated = false
1111
module.exports.nftMintListener = function nftMintListener () {
1212
return (req: Request, res: Response) => {
1313
try {
14-
const customHttpProvider = new ethers.JsonRpcProvider('https://sepolia.infura.io/v3/0b88ff4d03a647b8a4649e9bfdf6644f')
15-
const contract = new ethers.Contract(nftAddress, nftABI, customHttpProvider)
14+
const provider = new ethers.WebSocketProvider('wss://eth-sepolia.g.alchemy.com/v2/FZDapFZSs1l6yhHW4VnQqsi18qSd-3GJ')
15+
const contract = new ethers.Contract(nftAddress, nftABI, provider)
1616
if (!isEventListenerCreated) {
1717
contract.on('NFTMinted', (minter: string) => {
1818
if (!addressesMinted.has(minter)) {

routes/web3Wallet.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports.contractExploitListener = function contractExploitListener () {
1313
const metamaskAddress = req.body.walletAddress
1414
walletsConnected.add(metamaskAddress)
1515
try {
16-
const provider = new ethers.WebSocketProvider('wss://sepolia.infura.io/ws/v3/0b88ff4d03a647b8a4649e9bfdf6644f')
16+
const provider = new ethers.WebSocketProvider('wss://eth-sepolia.g.alchemy.com/v2/FZDapFZSs1l6yhHW4VnQqsi18qSd-3GJ')
1717
const contract = new ethers.Contract(web3WalletAddress, web3WalletABI, provider)
1818
if (!isEventListenerCreated) {
1919
contract.on('ContractExploited', (exploiter: string) => {

0 commit comments

Comments
 (0)