forked from gemlink/electrum-client-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripthash.js
22 lines (21 loc) · 957 Bytes
/
scripthash.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const ElectrumClient = require('..')
const main = async () => {
const ecl = new ElectrumClient('fortress.qtornado.com', 50002, 'tls')
await ecl.connect()
try {
const ver = await ecl.server_version('3.0.5', '1.4')
console.log(ver)
const balance = await ecl.blockchain_scripthash_getBalance('676ca8550e249787290b987e12cebdb2e9b26d88c003d836ffb1cb03ffcbea7c')
console.log(balance)
const unspent = await ecl.blockchain_scripthash_listunspent('676ca8550e249787290b987e12cebdb2e9b26d88c003d836ffb1cb03ffcbea7c')
console.log(unspent)
const history = await ecl.blockchain_scripthash_getHistory('676ca8550e249787290b987e12cebdb2e9b26d88c003d836ffb1cb03ffcbea7c')
console.log(history)
const mempool = await ecl.blockchain_scripthash_getMempool('676ca8550e249787290b987e12cebdb2e9b26d88c003d836ffb1cb03ffcbea7c')
console.log(mempool)
} catch (e) {
console.log(e)
}
await ecl.close()
}
main().catch(console.log)