You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
);
The text was updated successfully, but these errors were encountered:
Environment
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:
The text was updated successfully, but these errors were encountered: