mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-06-21 20:12:15 -07:00
global: private xpub support part 1
This commit is contained in:
@@ -29,6 +29,18 @@
|
||||
* @property {TypeIndex} typeIndex - Index of this address within its type on the blockchain
|
||||
* @property {Dollars} realizedPrice - Realized price (average cost basis) in USD
|
||||
*/
|
||||
/**
|
||||
* @typedef {Object} AddrHashPrefixMatches
|
||||
* @property {OutputType} addrType
|
||||
* @property {string} prefix
|
||||
* @property {boolean} truncated
|
||||
* @property {Addr[]} addresses
|
||||
*/
|
||||
/**
|
||||
* @typedef {Object} AddrHashPrefixParam
|
||||
* @property {OutputType} addrType
|
||||
* @property {string} prefix
|
||||
*/
|
||||
/**
|
||||
* Address statistics in the mempool (unconfirmed transactions only)
|
||||
*
|
||||
@@ -11476,6 +11488,23 @@ class BrkClient extends BrkClientBase {
|
||||
return this.getJson(path, { signal, onValue, cache });
|
||||
}
|
||||
|
||||
/**
|
||||
* Address hash-prefix matches
|
||||
*
|
||||
* Find addresses by address type and address-payload hash prefix. Intended for privacy-preserving client-side wallet discovery without sending raw addresses or xpubs. Fetch metadata for the returned addresses through `/api/address/{address}`.
|
||||
*
|
||||
* Endpoint: `GET /api/address/hash-prefix/{addr_type}/{prefix}`
|
||||
*
|
||||
* @param {OutputType} addr_type
|
||||
* @param {string} prefix
|
||||
* @param {{ signal?: AbortSignal, onValue?: (value: AddrHashPrefixMatches) => void, cache?: boolean }} [options]
|
||||
* @returns {Promise<AddrHashPrefixMatches>}
|
||||
*/
|
||||
async getAddressHashPrefixMatches(addr_type, prefix, { signal, onValue, cache } = {}) {
|
||||
const path = `/api/address/hash-prefix/${addr_type}/${prefix}`;
|
||||
return this.getJson(path, { signal, onValue, cache });
|
||||
}
|
||||
|
||||
/**
|
||||
* Address information
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user