Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Fix address.*OutputScript and ECPairOptions rng
Browse files Browse the repository at this point in the history
  • Loading branch information
junderw committed Apr 11, 2019
1 parent 848c819 commit 329809f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ts_src/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function toBech32(
return bech32.encode(prefix, words);
}

export function fromOutputScript(output: Buffer, network: Network): string {
export function fromOutputScript(output: Buffer, network?: Network): string {
// TODO: Network
network = network || networks.bitcoin;

Expand All @@ -84,7 +84,7 @@ export function fromOutputScript(output: Buffer, network: Network): string {
throw new Error(bscript.toASM(output) + ' has no matching Address');
}

export function toOutputScript(address: string, network: Network): Buffer {
export function toOutputScript(address: string, network?: Network): Buffer {
network = network || networks.bitcoin;

let decodeBase58: Base58CheckResult | undefined;
Expand Down
2 changes: 1 addition & 1 deletion ts_src/ecpair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const isOptions = typeforce.maybe(
interface ECPairOptions {
compressed?: boolean;
network?: Network;
rng?(arg0: Buffer): Buffer;
rng?(arg0: number): Buffer;
}

export interface ECPairInterface {
Expand Down
4 changes: 2 additions & 2 deletions types/address.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export declare function fromBase58Check(address: string): Base58CheckResult;
export declare function fromBech32(address: string): Bech32Result;
export declare function toBase58Check(hash: Buffer, version: number): string;
export declare function toBech32(data: Buffer, version: number, prefix: string): string;
export declare function fromOutputScript(output: Buffer, network: Network): string;
export declare function toOutputScript(address: string, network: Network): Buffer;
export declare function fromOutputScript(output: Buffer, network?: Network): string;
export declare function toOutputScript(address: string, network?: Network): Buffer;
2 changes: 1 addition & 1 deletion types/ecpair.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Network } from './networks';
interface ECPairOptions {
compressed?: boolean;
network?: Network;
rng?(arg0: Buffer): Buffer;
rng?(arg0: number): Buffer;
}
export interface ECPairInterface {
compressed: boolean;
Expand Down

0 comments on commit 329809f

Please sign in to comment.