diff --git a/src/lib/client.ts b/src/lib/client.ts index 9f02bff..ae39686 100644 --- a/src/lib/client.ts +++ b/src/lib/client.ts @@ -156,13 +156,6 @@ export class CoreClient { return this.cmd('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!') @@ -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()