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

108
Vistas
import external js library to ionic 2 app

i would like to import the poloniex api into my service to use the returnTicker() function but whenever i console log the received data it's always undefined

that's my Poloniex.ts code :

import {Injectable,Inject} from '@angular/core';
import {Observable} from 'rxjs/Obervable';
import 'rxjs/Rx';
import Poloniex from 'poloniex-api-node';

@Injectable()
export class PoloniexService{
  apiKey:string;
  secretKey:string;
  poloniex;
  constructor(){
    console.log('service is ready...');
    this.apiKey = 'api_key';
    this.secretKey = 'secret_key';

    this.poloniex = new Poloniex(this.apiKey, this.secretKey);
    //test returnTicker function
    this.poloniex.ticker((err, response) => {
      if (err) {
        // Log error message
        console.log("An error occurred: " + err.msg);

        // Disconnect
        return true;
      }

      // Log raw response
      console.log(response);
    });

  }

}
over 4 years ago · Santiago Trujillo
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