Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

114
Vistas
How to send TX in the same block with emitted event in ethers.js

I am listening to a specific contract on the blockchain and when a certain event occurs on the contract, I send a TX. In the best case my TX is mined in the next block of the specific event that I am using as my trigger.

In blockchain explorer I see some addresses whose TX's are mined in the exact same block as their trigger events.

My question is how can I send a TX to be mined in the same block as the emitted contract event that I am using as my trigger?

I am currently using ethers.js as follows

filter = {address: "0x...."}   // Contract address that I am listening to

// Start listening
provider.on(filter,  async (_event) => {

// Do something with _event when a TX is emitted

// Sign a raw TX if certain criteria is met
    await send_tx(tx_data, gasPrice, gasLimit)
})
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda