Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

263
Views
Cannot get results from an object - Error saying does not exits

I have a function that returns an object. I want to be able to take out "results" from that object but I'm having difficulty. My error is

'results' does not exist on type 'SimulationResponse'. Property 'results' does not exist on type 'RelayResponseError'

The code is currently

    const response = await flashbotsProvider.simulate(
      simulateTransaction,
      blockNumber + 1
    );

    console.log(typeof response);
    console.log(response.results);

And if i only console.log(response) then the output is:

object
{
  bundleHash: '0x7765d8cf3063adb1bf9a2e524071a86ddcd3abf96acee689989f0a574073d9ac',
  coinbaseDiff: BigNumber { _hex: '0x02b959fc8d06f000', _isBigNumber: true },
  results: [
    {
      coinbaseDiff: '196287000000000000',
      ethSentToCoinbase: '0',
      fromAddress: '0xd612c9fBc4047E1cd50bf0996B8D277d0bF425F9',
      gasFees: '196287000000000000',
      gasPrice: '2100000000000',
      gasUsed: 93470,
      toAddress: '0x20EE855E43A7af19E407E39E5110c2C1Ee41F64D',
      txHash: '0x883597fc3df0e70bf78383c381394c6b39ca8f8cfe1885ad4b889f37339874dc',
      value: '0x'
    }
  ],
  totalGasUsed: 93470,
  firstRevert: undefined
}

any idea?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

if ("error" in response || response.firstRevert !== undefined) { console.log(Simulation Error: ${response}); process.exit(1); }

I checked it if there is error, and when there is error you can get results by response.results.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!