Skip to content

Commit

Permalink
Use createOutputScriptFromAddress where applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-zimnoch committed Jul 12, 2023
1 parent 0e369b2 commit 056cac5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions typescript/src/electrum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import bcoin from "bcoin"
import pTimeout from "p-timeout"
import {
Client as BitcoinClient,
createOutputScriptFromAddress,
RawTransaction,
Transaction,
TransactionHash,
Expand Down Expand Up @@ -232,7 +233,7 @@ export class Client implements BitcoinClient {
): Promise<UnspentTransactionOutput[]> {
return this.withElectrum<UnspentTransactionOutput[]>(
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 }
Expand Down Expand Up @@ -262,7 +263,7 @@ export class Client implements BitcoinClient {
limit?: number
): Promise<Transaction[]> {
return this.withElectrum<Transaction[]>(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 }
Expand Down

0 comments on commit 056cac5

Please sign in to comment.