-
Notifications
You must be signed in to change notification settings - Fork 186
/
Copy pathtransactions.ts
45 lines (34 loc) · 1.18 KB
/
transactions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import mempoolJS from "./../../../src/index";
const init = async () => {
try {
const {
bitcoin: { transactions },
} = mempoolJS();
const txid =
'15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txStatus = await transactions.getTxStatus({ txid });
console.log(txStatus);
const txHex = await transactions.getTxHex({ txid });
console.log(txHex);
const txRaw = await transactions.getTxRaw({ txid });
console.log(txRaw);
const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({ txid });
console.log(txMerkleBlockProof);
const txMerkleProof = await transactions.getTxMerkleProof({ txid });
console.log(txMerkleProof);
const txOutspend = await transactions.getTxOutspend({
txid,
vout: 3,
});
console.log(txOutspend);
const txOutspends = await transactions.getTxOutspends({ txid });
console.log(txOutspends);
// const postTx = await transactions.postTx({ txhex });
// console.log(postTx);
} catch (error) {
console.log(error);
}
};
init();