Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscribe to pending transactions with from/toAddress does not work anymore #448

Open
peterpeterparker opened this issue Aug 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@peterpeterparker
Copy link

peterpeterparker commented Aug 15, 2024

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)
);
@AntonioVentilii-DFINITY

@deric-alchemy Hi! Please some help/support here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants