Commit Graph

36 Commits

Author SHA1 Message Date
Braydon Fuller a50fccef4d Changes behavior of `toJSON` to work as expected with `JSON.stringify`
- see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON%28%29_behavior
- Updates CONTRIBUTING with changes to Stardard Methods
- Aliases toJSON for toObject
- Removes all `fromJSON` methods, and many cases replaces with `fromObject`
- Constructors expect an object parsed via `JSON.parse` for JSON input
2015-08-13 10:46:08 -04:00
Manuel Araoz e331c4ea49 allow addresses to have surrounding whitespace in validation 2015-03-31 17:54:06 -03:00
Braydon Fuller f034a71929 Network Fixes
- Fixed Address classification for a custom network
- Added ability to remove a custom network
- Increased test coverage for Address
2015-03-28 19:09:58 -04:00
Manuel Araoz e0b1ca0e10 move some script logic from Address to Script 2015-03-18 17:59:09 -03:00
Manuel Araoz 62ea45a524 refactor Address<->Script relation 2015-03-18 16:54:16 -03:00
eordano 1a5780e35e Script/Address: Add check for valid number of threshold needed 2015-02-18 11:53:22 -03:00
Esteban Ordano 41191a285f Add alternative to create an Address
* When by error one has two instances of an address, an address
can't be instantiated from the other
2015-01-10 14:16:51 -03:00
Esteban Ordano d053599fd2 Improve test coverage 2015-01-08 17:24:29 -03:00
Yemel Jardi 5f59fd0d05 Merge pull request #903 from eordano/fix/addchange
Add `change` when serializing transaction
2015-01-08 17:00:14 -03:00
Esteban Ordano fe86abc093 Add `change` when serializing transaction 2015-01-08 16:39:53 -03:00
Braydon Fuller 8b505f0cfa Fixed tests to handle a `defaultNetwork` change
- Updated tests to work for both 'testnet' and 'livenet' as the default network.
- Fixed a bug in Address where the network property was being set as a string.
- Fixed a bug in HDKeys to handle serialized keys when the defaultNetwork changed.
2015-01-06 18:51:31 -05:00
Esteban Ordano d688222769 Add toAddress(network) functionality to scripts 2014-12-30 15:23:09 -03:00
Esteban Ordano 1ec4c7f512 Minor improvements on Address
* Update JSDocs
* Branch coverage 100%
* Removed duplicated test
* Updated names of tests
2014-12-19 15:41:20 -03:00
Esteban Ordano 5f5cf15241 Add capability to instantiate an Address from public keys and a threshold 2014-12-16 22:36:50 -03:00
Braydon Fuller 920f25b58e Tests: Added bitcoind base58 key data and tests 2014-12-13 16:10:41 -05:00
Braydon Fuller 354c03987a Address: Added toObject method and changed toJSON to return a string 2014-12-12 18:22:31 -05:00
Braydon Fuller 1858766627 Standardized toJSON, fromJSON, toString and fromString interfaces 2014-12-12 09:51:59 -05:00
Braydon Fuller 3b061b057f Address: Added documentation and refactored to accept both a string and network object. 2014-12-10 23:44:17 -05:00
Esteban Ordano 1816ba197f Add check functions to Address 2014-12-09 17:25:36 -03:00
Manuel Araoz 66e96e5fa4 make tests pass with Script refactor 2014-12-02 14:20:02 -03:00
Braydon Fuller 2cbcf7da1c Tests: Check that an Address is using the defaultNetwork 2014-12-01 18:19:17 -05:00
Braydon Fuller 4adf1fcb14 Network: Replaced all instances of mainnet with livenet for consistency 2014-12-01 17:31:39 -05:00
Braydon Fuller 85ce140aeb Keys: Renamed Privkey to PrivateKey and Pubkey to PublicKey 2014-11-25 13:21:53 -05:00
Braydon Fuller 35d0cbc5a6 Keys: Modified interface of Pubkey and Privkey so that an instance can be relied upon as valid. 2014-11-25 12:30:52 -05:00
Braydon Fuller deb54c5a20 Address: Return new instance if `this` isn't already instantiated. 2014-11-24 15:47:30 -05:00
Braydon Fuller 9863b123c0 Address: Increase test coverage 2014-11-23 15:34:19 -05:00
Braydon Fuller 3c9cc23501 Address: Improved error messages and type, and added inspect prototype for console output. 2014-11-21 22:20:44 -05:00
Braydon Fuller 0df97a42fe Address: Fix indentation, typos and simplify isValid 2014-11-21 19:02:58 -05:00
Braydon Fuller 90341f2ab6 Address: Modified interface so that any instance of Address can be assumed to be valid. 2014-11-21 14:18:31 -05:00
Manuel Araoz a9d029341d remove extras 2014-11-20 13:31:51 -03:00
Manuel Araoz 6f2913eed4 fix references 2014-11-20 11:50:23 -03:00
Ryan X. Charles f17d604e44 Address().fromHashbuf() convenience method
...useful for when you have the pubkeyhash, but not the version byte.
2014-09-18 15:18:53 -07:00
Ryan X. Charles ac85264a28 Address().fromBuffer(buf); 2014-09-17 14:22:18 -07:00
Ryan X. Charles 4a027e260a Address().fromScript(script)
It is convenient to be able to derive an address directly from a script for
p2sh transactions.
2014-09-12 17:49:01 -07:00
Ryan X. Charles 6a26813955 p2sh -> scripthash
more appealing and memorable name
2014-09-01 12:06:18 -07:00
Ryan X. Charles bdb8daaf07 remove redundant "test." from test names 2014-08-29 13:01:05 -07:00