-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample4.js
More file actions
21 lines (18 loc) · 807 Bytes
/
example4.js
File metadata and controls
21 lines (18 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';
const LOCK_UNTIL_BLOCK = 150; // pick a block height above the current tip
const bitcore = require('bitcore-lib'); // bitcore-lib should be in the same folder as the js file
bitcore.Networks.defaultNetwork = bitcore.Networks.testnet;
var privateKey = new bitcore.PrivateKey();
var utxo = {
"txId" : "115e8f72f39fad874cfab0deed11a80f24f967a84079fb56ddf53ea02e308986",
"outputIndex" : 0,
"address" : "17XBj6iFEsf8kzDMGQk5ghZipxX49VXuaV",
"script" : "76a91447862fe165e6121af80d5dde1ecb478ed170565b88ac",
"satoshis" : 50000
};
var scriptPubKey = new bitcore.Script().add(bitcore.Opcode.OP_RIPEMD160).add(Buffer.from("3c92bdfea2bb5fd4e81cba44d3091c331d599090
", "hex")).add(bitcore.Opcode.OP_EQUAL);
var output = new bitcore.Transaction.Output({
"satoshis": 85000000,
"script": scriptPubKey
});