Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Circular dependency on React-Native #184

@Kamahl19

Description

@Kamahl19

Hi,

I am using bitcore-wallet-client on react native, polyfilling all nodejs dependencies with node-libs-browser. Creating a wallet and generating an address works fine, however I am unable to publish a transaction proposal.

This is an error I am getting.

ExceptionsManager.js:73 TypeError: Right-hand side of 'instanceof' is not callable
    at new Script (script.js:35)
    at new UnspentOutput (unspentoutput.js:46)
    at Transaction._fromNonP2SH (transaction.js:561)
    at Transaction.from (transaction.js:554)
    at transaction.js:540
    at arrayEach (lodash.js:537)
    at Function.forEach (lodash.js:9359)
    at Transaction.from (transaction.js:539)
    at Function.Utils.buildTx (utils.js:196)
    at API.publishTxProposal (api.js:1773)

On this line https://github.com/bitpay/bitcore-lib/blob/master/lib/script/script.js#L35 else if (from instanceof Address) Address is just an empty object so instanceof fails. It seems to me like a circular dependency, or am I wrong?

It would be awesome if bitcore could run on RN. Bitcoinjs-lib already works there but I would like to stick with bitcore. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions