andrewtoth / BitcoinWallet

Bitcoin wallet in the browser. Send and receive instantly on any web page.
MIT License
3 stars 2 forks source link

older version of bitcoinjs-lib? #2

Open syspect-tech opened 9 years ago

syspect-tech commented 9 years ago

I appologize in advance if my question is silly or obvious. I'm noob to bitcoin and bitcoinjs-lib package, which you are using in your app.

I am attempting to modify the browser wallet for another alt-coin. I wanted to set the network ID bit to something different. So, I downloaded the latest version of bitcoinjs-lib from the github source (https://github.com/bitcoinjs/bitcoinjs-lib), since the library was compressed version in the browser-wallet source code. I thought I would add a different network ID byte then recompress and move the file over. So, I was looking at the function to create a new address and found it in the wallet.js file.

I noticed the line:

var eckey = new Bitcoin.ECKey(false);

However, I could not determine how this object gets created in the bitcionjs-lib packages since there is no function of type Bitcoin. I also could not find a function corresponding to the following line (getBitcoinAddress).

address = eckey.getBitcoinAddress().toString();

So, my question is: what am I missing? Is there another place to find these functions other than the bitcoinjs-lib package? Does this browser wallet use an older version of the bitconjs-lib that has changed?

Again I'm sorry if my question is terrible, maybe there is something I don't understand about javascript. I usually work in Python, or PHP. If you have time to shoot me a response, I'm quite grateful for that!

andrewtoth commented 9 years ago

Yes, the wallet uses an older version of bitcoinjs-lib and is not compatible with new versions. 'Bitcoin' is not a function but an object and in the latest bitcoinjs-lib the object was renamed to 'bitcoin'. You can see examples of what you're trying to do here https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/basic.js.

syspect-tech commented 9 years ago

Thanks, for your response. That's good to know that I was on the right track. Yes, sorry, I meant object not function. :).

Thanks! Joseph

On 15-01-12 01:57 PM, andrewtoth wrote:

Yes, the wallet uses an older version of bitcoinjs-lib and is not compatible with new versions. 'Bitcoin' is not a function but an object and in the latest bitcoinjs-lib the object was renamed to 'bitcoin'. You can see examples of what you're trying to do here https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/basic.js.

— Reply to this email directly or view it on GitHub https://github.com/andrewtoth/BitcoinWallet/issues/2#issuecomment-69623957.

Joseph Lee M.B.A Technology and Innovation Management. - National Chung-Hsing University B.A. Anthropology - University of Saskatchewan Phone: 705-776-1665 Email: joseph.lee.esl@gmail.com