diff --git a/src/address.js b/src/address.js index d1d7b82..5457e52 100644 --- a/src/address.js +++ b/src/address.js @@ -16,7 +16,6 @@ Address.fromBase58Check = function(string) { return new Address(decode.payload, decode.version) } -Address.prototype.fromString = Address.prototype.fromBase58Check // Export functions Address.prototype.toBase58Check = function () { diff --git a/src/script.js b/src/script.js index 8f3cd2c..f550878 100644 --- a/src/script.js +++ b/src/script.js @@ -23,32 +23,6 @@ Script.fromHex = function(hex) { return Script.fromBuffer(new Buffer(hex, 'hex')) } -Script.fromPubKey = function(str) { - var script = new Script() - var s = str.split(' ') - for (var i in s) { - if (Opcode.map.hasOwnProperty(s[i])) { - script.writeOp(Opcode.map[s[i]]) - } else { - script.writeBytes(convert.hexToBytes(s[i])) - } - } - return script -} - -Script.fromScriptSig = function(str) { - var script = new Script() - var s = str.split(' ') - for (var i in s) { - if (Opcode.map.hasOwnProperty(s[i])) { - script.writeOp(Opcode.map[s[i]]) - } else { - script.writeBytes(convert.hexToBytes(s[i])) - } - } - return script -} - /** * Update the parsed script representation. * @@ -399,16 +373,6 @@ Script.createOutputScript = function(address, network) { return script } -/** - * Extract pubkeys from a multisig script - */ - -Script.prototype.extractPubkeys = function() { - return this.chunks.filter(function(chunk) { - return(chunk[0] == 4 && chunk.length == 65 || chunk[0] < 4 && chunk.length == 33) - }) -} - // m [pubKeys ...] n OP_CHECKMULTISIG Script.createMultisigOutputScript = function(m, pubKeys) { var script = new Script() diff --git a/src/transaction.js b/src/transaction.js index 64bb41a..0b346a4 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -380,40 +380,6 @@ Transaction.prototype.sign = function(index, key, type, network) { this.setScriptSig(index, scriptSig) } -// Takes outputs of the form [{ output: 'txhash:index', address: 'address' },...] -Transaction.prototype.signWithKeys = function(keys, outputs, type) { - type = type || SIGHASH_ALL - - var addrdata = keys.map(function(key) { - assert(key instanceof ECKey) - - return { - key: key, - address: key.getAddress().toString() - } - }) - - var hmap = {} - outputs.forEach(function(o) { - hmap[o.output] = o - }) - - for (var i = 0; i < this.ins.length; i++) { - var outpoint = this.ins[i].outpoint.hash + ':' + this.ins[i].outpoint.index - var histItem = hmap[outpoint] - - if (!histItem) continue; - - var thisInputAddrdata = addrdata.filter(function(a) { - return a.address == histItem.address - }) - - if (thisInputAddrdata.length === 0) continue; - - this.sign(i,thisInputAddrdata[0].key) - } -} - Transaction.prototype.signScriptSig = function(index, script, key, type) { type = type || SIGHASH_ALL