use types from common

This commit is contained in:
Daniel Lugo 2021-01-10 09:33:30 -04:00
parent f164efd2d0
commit 4665e9332b
2 changed files with 1 additions and 37 deletions

View file

@ -131,35 +131,3 @@ export interface Services {
walletUnlocker: Record<string, LightningMethod> walletUnlocker: Record<string, LightningMethod>
router: Record<string, LightningMethod> router: Record<string, LightningMethod>
} }
export interface Utxo {
/**
* The type of address.
*/
address_type: unknown
/**
* The address.
*/
address: string
/**
* The value of the unspent coin in satoshis.
*/
amount_sat: number
/**
* The pkscript in hex.
*/
pk_script: string
/**
* The outpoint in format txid:n.
*/
outpoint: unknown
/**
* The number of confirmations for the Utxo.
*/
confirmations: number
}

View file

@ -420,14 +420,10 @@ const newAddress = (type = 0) => {
}) })
} }
/**
* @typedef {import('./types').Utxo} Utxo
*/
/** /**
* @param {number} minConfs * @param {number} minConfs
* @param {number} maxConfs * @param {number} maxConfs
* @returns {Promise<Utxo[]>} * @returns {Promise<Common.Utxo[]>}
*/ */
const listUnspent = (minConfs = 3, maxConfs = 6) => const listUnspent = (minConfs = 3, maxConfs = 6) =>
Common.makePromise((res, rej) => { Common.makePromise((res, rej) => {