Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd committed Oct 19, 2023
1 parent a0d3295 commit be5972e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ export class CoreClient {
return this.cmd<ScanResults>('scantxoutset', [ action, JSON.stringify(desc) ])
}

async scan_addr (addr : string) {
return this.scan_txout('start', `addr(${addr})`).then(res => {
const { success, unspents } = res
return (success) ? unspents : []
})
}

async mine_blocks (count = 1, addr ?: string) {
if (this.opt.network !== 'regtest') {
throw new Error('You can only generate funds on regtest network!')
Expand Down Expand Up @@ -191,6 +184,13 @@ export class CoreClient {
return { data, hex, status }
}

async get_utxos (addr : string) {
return this.scan_txout('start', `addr(${addr})`).then(res => {
const { success, unspents } = res
return (success) ? unspents : null
})
}

async load_wallet (name : string) {
const wallet = new CoreWallet(this, name)
await wallet.load()
Expand Down

0 comments on commit be5972e

Please sign in to comment.