Merge pull request #4056 from mempool/mononaut/compressed-p2pk

Add support for compressed p2pk addresses
This commit is contained in:
softsimon
2023-07-29 17:48:26 +09:00
committed by GitHub
6 changed files with 19 additions and 15 deletions

View File

@@ -67,7 +67,8 @@ export class ElectrsApiService {
}
getPubKeyAddress$(pubkey: string): Observable<Address> {
return this.getScriptHash$('41' + pubkey + 'ac').pipe(
const scriptpubkey = (pubkey.length === 130 ? '41' : '21') + pubkey + 'ac';
return this.getScriptHash$(scriptpubkey).pipe(
switchMap((scripthash: ScriptHash) => {
return of({
...scripthash,