fix electrum /scripthash/.../utxo

This commit is contained in:
Mononaut 2025-10-10 08:19:58 +00:00
parent 5a30e99f74
commit b924142458
No known key found for this signature in database
GPG key ID: A3F058E41374C04E

View file

@ -165,7 +165,8 @@ class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi {
if (!addressInfo || !addressInfo.isvalid) {
return [];
}
return await this.$getScriptHashUtxos(addressInfo.scriptPubKey);
const scripthash = this.encodeScriptHash(addressInfo.scriptPubKey);
return this.$getScriptHashUtxos(scripthash);
}
async $getScriptHashTransactions(scripthash: string, lastSeenTxId?: string): Promise<IEsploraApi.Transaction[]> {
@ -240,7 +241,7 @@ class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi {
}
private $getScriptHashUnspent(scriptHash: string): Promise<IElectrumApi.ScriptHashUtxos[]> {
return this.electrumClient.blockchainScripthash_listunspent(this.encodeScriptHash(scriptHash));
return this.electrumClient.blockchainScripthash_listunspent(scriptHash);
}
async $getTransactionMerkleProof(txId: string): Promise<IEsploraApi.MerkleProof> {