|
@ -141,6 +141,18 @@ app.get('/-/request', function(req, res, next) { |
|
|
// number of satoshis to be paid
|
|
|
// number of satoshis to be paid
|
|
|
po.set('amount', value); |
|
|
po.set('amount', value); |
|
|
// a TxOut script where the payment should be sent. similar to OP_CHECKSIG
|
|
|
// a TxOut script where the payment should be sent. similar to OP_CHECKSIG
|
|
|
|
|
|
if (argv.pubkey || argv.address) { |
|
|
|
|
|
var pubKey; |
|
|
|
|
|
if (argv.address) { |
|
|
|
|
|
pubKey = bitcore.Base58Check.decode(new Buffer(argv.address)); |
|
|
|
|
|
} else { |
|
|
|
|
|
pubKey = new Buffer(argv.pubkey, 'hex'); |
|
|
|
|
|
} |
|
|
|
|
|
var pubKeyHash = bitcore.util.sha256ripe160(pubKey); |
|
|
|
|
|
var address = new bitcore.Address(pubKeyHash, 'testnet'); |
|
|
|
|
|
var scriptPubKey = addr.getScriptPubKey(); |
|
|
|
|
|
po.set('script', scriptPubKey.getBuffer()); |
|
|
|
|
|
} else { |
|
|
po.set('script', new Buffer([ |
|
|
po.set('script', new Buffer([ |
|
|
118, // OP_DUP
|
|
|
118, // OP_DUP
|
|
|
169, // OP_HASH160
|
|
|
169, // OP_HASH160
|
|
@ -169,6 +181,7 @@ app.get('/-/request', function(req, res, next) { |
|
|
136, // OP_EQUALVERIFY
|
|
|
136, // OP_EQUALVERIFY
|
|
|
172 // OP_CHECKSIG
|
|
|
172 // OP_CHECKSIG
|
|
|
])); |
|
|
])); |
|
|
|
|
|
} |
|
|
outputs.push(po.message); |
|
|
outputs.push(po.message); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|