CodeChain-io/codechain-sdk-js

Mixing multiple versions of codechain-primitives makes weird errors.

Opened this issue · 1 comments

Expected either PlatformAddress or string but found cccqyhk4388mymckk40ctf0skgkl8nf89f6sgpzwzke
       at Function.ensure (.../node_modules/codechain-sdk/node_modules/codechain-primitives/src/address/PlatformAddress.ts:105:19)
       at .../node_modules/codechain-sdk/lib/rpc/chain.js:473:98
       at new Promise (<anonymous>)
       at ChainRpc.getBalance (.../node_modules/codechain-sdk/lib/rpc/chain.js:471:16)
       at Promise.all.addresses.map.address (.../src/CCC.ts:9:48)
       at Array.map (<anonymous>)
       at Object.getCCCBalances (.../src/CCC.ts:9:19)
       at main (.../src/index.ts:94:46)
       at processTicksAndRejections (internal/process/next_tick.js:81:5)

How about using peer dependencies?

An Article about Peer dependencies
The above article shows an example of "winston" and "winston-mail" package.
It seems very similar to our "codechain-sdk" and "codechain-primitive"'s relationship.