-
Notifications
You must be signed in to change notification settings - Fork 236
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
- Alchemy SDK version: I tested version 3.1.2, 3.2.1 and 3.3.1
Describe the problem
Subscribing to pending transactions via WebSocket functions properly unless address filtering is applied. When filtering is enabled, pending transactions are no longer emitted.
However, based on my tests, mined transactions continue to work seamlessly in both scenarios, as does subscribing to only transaction hashes.
Relevant code or sample repro:
import { Alchemy, Network, AlchemySubscription } from "alchemy-sdk";
const settings = {
apiKey: "<-- ALCHEMY APP API KEY -->",
network: Network.ETH_SEPOLIA,
};
const alchemy = new Alchemy(settings);
const fromAddress ="0x5faB5f7b279bA540Bd54e7A0c46953a61ad5c82b";
const toAddress = "0xAac7A0776a215249dcAB1975a005e17652E2Ef66";
// Ok
alchemy.ws.on(
{
method: AlchemySubscription.PENDING_TRANSACTIONS,
},
(tx) => console.log(tx)
);
// Ok
alchemy.ws.on(
{
method: AlchemySubscription.PENDING_TRANSACTIONS,
hashesOnly: true
},
(tx) => console.log(tx)
);
// Ok
provider.ws.on(
{
method: AlchemySubscription.MINED_TRANSACTIONS,
addresses: [{to: toAddress}]
},
(tx) => console.log(tx)
);
// NOT OK
alchemy.ws.on(
{
method: AlchemySubscription.PENDING_TRANSACTIONS,
toAddress,
},
(tx) => console.log(tx)
);
// NOT OK
alchemy.ws.on(
{
method: AlchemySubscription.PENDING_TRANSACTIONS,
fromAddress,
},
(tx) => console.log(tx)
);
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working