Javascript-форум (https://javascript.ru/forum/)
-   Node.JS (https://javascript.ru/forum/node-js-io-js/)
-   -   помогите пожалуйста с ошибкой (https://javascript.ru/forum/node-js-io-js/74485-pomogite-pozhalujjsta-s-oshibkojj.html)

V.universe 16.07.2018 10:57

помогите пожалуйста с ошибкой
 
const TradeAPI = require ("btc-e3");
const PublicAPI = require ("btc-e3");
const api = new TradeAPI({
key: "sekret",
secret: "sekret",
baseUrl: "sekret", // any url with this api specification
});
api.getInfo().then((info)=>{
console.log(info.transaction_count);
});

TypeError: TradeAPI is not a constructor
at Object.<anonymous> (/Users/tasheehoo/Documents/bot/bot.js:3:13)
at Module._compile (internal/modules/cjs/loader.js:686:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:236:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:560:3)

как исправить :help: :cray:

ruslan_mart 16.07.2018 12:22

const {TradeAPI, PublicAPI} = require("btc-e3");

const api = new TradeAPI({
key: "sekret",
secret: "sekret",
baseUrl: "sekret", // any url with this api specification
});
api.getInfo().then((info)=>{
console.log(info.transaction_count);
});


Часовой пояс GMT +3, время: 02:56.