I was wondering, if it's possible to use this library in the browser. Currently, I use bitcoinjs-lib in a VUE.js app to build transactions and I intend to use bitcoin-core for connecting to the network and broadcast the already signed transactions.
To test the integration, I'm using this simple code:
a VUE app => I get an error in the browser, whenever I call functions on the bitcoin core client:
TypeError: Failed to fetch
at _bluebird.default.try (webpack-internal:///./node_modules/bitcoin-core/dist/src/index.js:168:27)
From previous event:
at Client.command (webpack-internal:///./node_modules/bitcoin-core/dist/src/index.js:154:33)
at apply (webpack-internal:///./node_modules/lodash/lodash.js:475:27)
at Client.wrapper [as getBlockchainInfo] (webpack-internal:///./node_modules/lodash/lodash.js:5323:16)
at eval (webpack-internal:///./src/services/wallet/btc-wallet.service.ts:78:8)
at Module../src/services/wallet/btc-wallet.service.ts (http://localhost:8080/app.js:14817:1)
at __webpack_require__ (http://localhost:8080/app.js:768:30)
at fn (http://localhost:8080/app.js:131:20)
// etc.
an angular app => I get this error, which occur, when node packages are used in the browser, that depend on certain node functions, which the browser doesn't implement, as explained here
I was wondering, if it's possible to use this library in the browser. Currently, I use bitcoinjs-lib in a VUE.js app to build transactions and I intend to use bitcoin-core for connecting to the network and broadcast the already signed transactions.
To test the integration, I'm using this simple code:
For testing, I ran it in 3 different apps: