Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

156
Visualizações
Ethers contract on method "No mathing event" error

I just started learning ethers, here is my code:

(async () => {
  const connection = new ethers.providers.JsonRpcProvider(
    "https://mainnet.infura.io/v3/key"
  );

  const contract = new ethers.Contract(
    "0x7be8076f4ea4a4ad08075c2508e481d6c946d12b",
    abi,
    connection
  );

  contract.on("atomicMatch_", (...args) => {
    console.log(args);
  });
})();

so the contract is opensea main contract - link I would like to listen to sales transactions/events. As I see in the contract name of that event is probably Atomic Match_ or atomicMatch_ in ABI. For ABI I just copy pasted whole contract to https://remix.ethereum.org/ website and copied abi code. The problem is I am getting this error now:

Error: no matching event (argument="name", value="atomicMatch_", code=INVALID_ARGUMENT, version=abi/5.5.0)

What is wrong here? I tried both names of event but I get the same error over and over...

@edit here is sandbox for it, what is weird when I change event name to OrdersMatched for example it works totally fine...

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Ethers contract.on() (docs) is invoked when an event with the specified name is emitted.

Your snippet is passing a function name (atomicMatch_), not an event name.

The atomicMatch_ function effectively emits the event named OrdersMatched. That's why changing the handler to contract.on('OrdersMatched') fixes the issue.


Also, the sandbox is using a built-in provider under the getDefaultProvider(), which is communicating with the app over WSS. Your snippet is using a HTTPS provider that is by design unable to listen to events. You'll need to use a WSS provider as well (they are supported by Infura).

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda