Skip to content

Commit 56ebf9c

Browse files
committed
Fix timechain and initial txo
1 parent 8d88a2a commit 56ebf9c

2 files changed

Lines changed: 39 additions & 2 deletions

File tree

src/bitcoin/timechain.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,6 @@ class DLC {
9999
}
100100

101101
printContractDetails() {
102-
console.log('Contract ID:', this.contractId
103-
102+
console.log('Contract ID:', this.contractId)
103+
};
104+
}

src/bitcoin/txo.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const { Transaction, UTXO, Input, Output } = require('bitcoinjs-lib');
2+
3+
module.exports = {
4+
Transaction,
5+
UTXO,
6+
Input,
7+
Output
8+
};
9+
10+
const tx = new Transaction();
11+
tx.Inputs.push(new Input());
12+
tx.Outputs.push(new Output());
13+
14+
console.log(tx);
15+
16+
const tx2 = Transaction.fromHex(tx.toHex());
17+
console.log(tx2);
18+
19+
const tx3 = Transaction.fromBuffer(tx.toBuffer());
20+
console.log(tx3);
21+
22+
const tx4 = Transaction.fromObject(tx.toObject());
23+
console.log(tx4);
24+
25+
const tx5 = Transaction.fromTransaction(tx);
26+
console.log(tx5);
27+
28+
const tx6 = Transaction.fromTransaction(tx, true);
29+
console.log(tx6);
30+
31+
const tx7 = Transaction.fromTransaction(tx, false, true);
32+
console.log(tx7);
33+
34+
const tx8 = Transaction.fromTransaction(tx, true, true);
35+
36+
console.log(tx8);

0 commit comments

Comments
 (0)