Bitcoin-com / bitbox-sdk

BITBOX SDK for Bitcoin Cash
https://developer.bitcoin.com/bitbox
MIT License
89 stars 62 forks source link

Import example not working #189

Open mariusk opened 4 years ago

mariusk commented 4 years ago

According to the "Getting Started" document at:

https://developer.bitcoin.com/bitbox/docs/getting-started

To use the SDK with import, the following syntax should be used:

import { BITBOX } from 'bitbox-sdk'
let bitbox = new BITBOX();
bitbox.Mnemonic.generate();

Well, that does not work. This does however:

import BITBOX from 'bitbox-sdk';
const bitbox = new BITBOX.BITBOX();
bitbox.Mnemonic.generate();

I'm not sure if it's TypeScript that messes up these interfaces, if it's done incorrectly or if the docs are out of date. But I do believe it is important to have "Getting Started" documents that work. I tested this on Node 12 btw.