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

109
Views
how to get the results of this class in console.log?

How to get the results "_pathsArr (including the mid id), bestPath and amounts_out" in console.log?

Basically i need the arrPaths including their id and the amount_out of each.

Also i need to know where to input manually the amount_in for temporary tests.

Thanks.

This is my code:

    import { toFixed, accDiv } from './public';
// import Worker from './worker'
// import VueWorker from 'vue-worker'
class swapRouter {
  constructor() {
    this.markets = [];
    this.pair_market_map = {};
    this.mid_market_map = {};
    this.tokens = [];
    this.paths = [];
    this.isInit = false;
    this._pathsArr = [];
    this.bestPath = '';
  }
  init(data, vThis) {
    this.markets = data || [];
    this._pathsArr = [];
    this.bestPath = '';
    if (this.paths.length) {
      return
    }
    if (window.Worker) {
      this.workerToInitPath(vThis)
    } else {
      this.initPath()
    }
  }

  workerToInitPath(vThis) {
    
HERE GOES THE CODE THAT FINDS THE PATHS AND AMOUNTS_OUT

}
 const d = [{ here are the data correctly organized }

const swapRouter1 = new swapRouter()
 swapRouter1.init(d)
console.log(swapRouter1);

Is this correctly declared?

this.bestPath = '';

Or must be:

this.bestPath = [];

Because get only markets, tokens and paths in the result (console.log), but don't get_pathsArr and bestPath.

I also need that the path results includes the "mid" (the id number).

about 4 years ago · Juan Pablo Isaza
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!