escwdev / kucoin-node-api

Node.js KuCoin Cryptocurrency Exchange v2 API Wrapper/SDK
89 stars 60 forks source link

^ TypeError: Cannot read properties of undefined (reading 'init') #61

Closed mshamsi502 closed 10 months ago

mshamsi502 commented 10 months ago

i get the error after to init api.init(initConfig) ^ TypeError: Cannot read properties of undefined (reading 'init') cannot read api after import.

import api  from 'kucoin-node-api';

  const config = {
      apiKey: kucoinApiKey,
      secretKey: kucoinApiSecret,
      passphrase: kucoinApiPassphrase,
      environment: productionEnv() ? "live" : 'sandbox'
    };
 api.init(config )
mshamsi502 commented 10 months ago

after change import api from 'kucoin-node-api'; to import * as api from 'kucoin-node-api'; fix that in ES6 and typescript.