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

111
Vistas
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
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