global: private xpub support part 1

This commit is contained in:
nym21
2026-06-16 23:37:03 +02:00
parent 6f430bdb8c
commit 0c7861071d
70 changed files with 5874 additions and 12510 deletions
+29
View File
@@ -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
*