diff --git a/typescript/src/electrum.ts b/typescript/src/electrum.ts index d467f42f7..022ccce2a 100644 --- a/typescript/src/electrum.ts +++ b/typescript/src/electrum.ts @@ -2,6 +2,7 @@ import bcoin from "bcoin" import pTimeout from "p-timeout" import { Client as BitcoinClient, + createOutputScriptFromAddress, RawTransaction, Transaction, TransactionHash, @@ -232,7 +233,7 @@ export class Client implements BitcoinClient { ): Promise { return this.withElectrum( async (electrum: Electrum) => { - const script = bcoin.Script.fromAddress(address).toRaw().toString("hex") + const script = createOutputScriptFromAddress(address).toString() // eslint-disable-next-line camelcase type UnspentOutput = { tx_pos: number; value: number; tx_hash: string } @@ -262,7 +263,7 @@ export class Client implements BitcoinClient { limit?: number ): Promise { return this.withElectrum(async (electrum: Electrum) => { - const script = bcoin.Script.fromAddress(address).toRaw().toString("hex") + const script = createOutputScriptFromAddress(address).toString() // eslint-disable-next-line camelcase type HistoryItem = { height: number; tx_hash: string }