3.9 KiB
2.0.0
In this release we have strived to simplify the API, using native types wherevever possible to encourage cross-compatibility with other open source community modules.
The ecdsa module has been removed in lieu of using a new ECDSA module (for performance and safety reasons) during the 2.x.y major release.
Several other cumbersome modules have been removed, with their new independent modules recommended for usage instead for greater modularity in your projects.
Backward incompatible changes:
added
- export
address, foraddressbased utility functions, most compatible, just withoutAddressinstantiation, see #401, #444 - export
script, forscriptbased utility functions, mostly compatible, just withoutScriptinstantiation, see #438, #444 - export
ECPair, a merged replacement forECKey/ECPubKey, invalid types will throw viatypeforce
changed
-
address.toOutputScript,ECPair.prototype.fromWIFandHDNode.prototype.fromBase58no longer automatically detect the network,networks.bitcoinis always assumed unless given. -
assertwas used for type checking, now replaced bytypeforce -
BIP66compliant strict DER signature validation was added toECSignature.fromDER, changing the exact exception messages slightly, see #448. -
new HDNode(d/Q, chainCode, network)->new HDNode(keyPair, chainCode), now usesECPair -
HDNode.prototype.toBase58(false)->HDNode.prototype.neutered().toBase58()for exporting an extended public key -
HDNode.prototype.toBase58(true)->HDNode.prototype.toBase58()for exporting an extended private key -
Transaction.prototype.hashForSignature(prevOutScript, inIndex, hashType)->Transaction.prototype.hashForSignature(inIndex, prevOutScript, hashType) -
Transaction.prototype.addInput(hash, ...):hashcould be a string, Transaction or Buffer ->hashcan now only be aBuffer. -
Transaction.prototype.addOutput(scriptPubKey, ...):scriptPubKeycould be a string,Addressor aBuffer->scriptPubKeycan now only be aBuffer. -
TransactionBuilderAPI unchanged.
removed
-
export
Address,stringsare now used, benchwith no performance loss for most use cases -
export
base58check, usebs58checkinstead -
export
ecdsa, useecurveinstead -
export
ECKey, use new exportECPairinstead -
export
ECPubKey, use new exportECPairinstead -
export
Wallet, see README.md#complementing-libraries instead -
export
Script, use new utility exportscriptinstead (#438 for more information) -
crypto.HmacSHA256, use node crypto instead -
crypto.HmacSHA512, use node crypto instead -
Transaction.prototype.sign, useTransactionBuilder.prototype.sign -
Transaction.prototype.signInput, useTransactionBuilder.prototype.sign -
Transaction.prototype.validateInput, useTransaction.prototype.hashForSignatureandECPair.verify -
HDNode.fromBuffer, useHDNode.fromBase58instead -
HDNode.fromHex, useHDNode.fromBase58instead -
HDNode.toBuffer, useHDNode.prototype.toBase58instead -
HDNode.toHex, useHDNode.prototype.toBase58instead -
networks.*.magic, see the comment here -
networks.[viacoin|viacointestnet|gamerscoin|jumbucks|zetacoin], import these yourself (see #383/a0e6ee7) -
networks.*.estimateFee, out-dated
renamed
Message->messagescripts->scriptscripts.dataOutput->script.nullDataOutput(per convention)