bitcore icon indicating copy to clipboard operation
bitcore copied to clipboard

implement standard methods for all objects

Open maraoz opened this issue 12 years ago • 2 comments

All bitcore objects should implement #toString, #toJSON #toBuffer when possible

maraoz avatar Nov 27 '14 16:11 maraoz

fromXXX should be static methods and the constructor should support all those formats.

yemel avatar Dec 09 '14 16:12 yemel

Address:

  • [x] toJSON()
  • [x] fromJSON()

Block:

  • [x] fromString()
  • [x] toString()

BlockHeader:

  • [x] toString()
  • [x] fromString()

HDPublicKey: moved to moved to https://github.com/bitpay/bitcore/issues/741

  • [x] fromBuffer()
  • [x] fromString()
  • [x] fromJSON()
  • [x] toBuffer()

HDPrivateKey: moved to moved to https://github.com/bitpay/bitcore/issues/741

  • [x] fromBuffer()
  • [x] fromString()
  • [x] fromBuffer()
  • [x] toBuffer()

Input: moved to https://github.com/bitpay/bitcore/issues/742

  • [x] fromBuffer()
  • [x] fromString()
  • [x] fromJSON()
  • [x] toBuffer()
  • [x] toString()

Networks:

  • [x] fromString() won't add
  • [x] fromJSON() won't add

Opcode:

  • [x] fromBuffer()
  • [x] fromJSON() won't add
  • [x] toBuffer()
  • [x] toJSON() won't add

Output: moved to https://github.com/bitpay/bitcore/issues/742

  • [x] fromBuffer()
  • [x] fromString()
  • [x] fromJSON()
  • [x] toBuffer()
  • [x] toString()

PrivateKey:

  • [x] toJSON()
  • [x] fromBuffer() moved to https://github.com/bitpay/bitcore/issues/739
  • [x] fromJSON()

PublicKey:

  • [x] toJSON() - should return an object
  • [x] fromJSON()

Script:

  • [x] toJSON() won't add
  • [x] fromJSON() won't add
  • [x] fromBuffer()
  • [x] toBuffer()

Transaction:

  • [x] toString() - moved to https://github.com/bitpay/bitcore/issues/740

Unit:

  • [x] fromString() won't add
  • [x] fromBuffer() won't add
  • [x] fromJSON()
  • [x] toJSON()
  • [x] toBuffer() won't add

URI:

  • [x] fromBuffer()won't add
  • [x] fromString() won't add
  • [x] fromJSON()
  • [x] toJSON()
  • [x] toBuffer() won't add

braydonf avatar Dec 12 '14 02:12 braydonf