From ca61e7a06903d2fe2e23ee1aac3edfa9914eaa77 Mon Sep 17 00:00:00 2001 From: Daniel Lebrecht Date: Fri, 7 Jul 2017 22:44:31 +0200 Subject: [PATCH] changed [] for Array on complex types --- types/bitcoinjs-lib/bitcoinjs-lib-tests.ts | 0 types/bitcoinjs-lib/index.d.ts | 22 +++++++++------------- 2 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 types/bitcoinjs-lib/bitcoinjs-lib-tests.ts diff --git a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index a5e5c6179b..8e5cdcf9fa 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -60,7 +60,7 @@ export class Block { toHex(headersOnly?: boolean): string; - static calculateMerkleRoot(transactions: Transaction[] | { getHash(): Buffer; }[]): Buffer; + static calculateMerkleRoot(transactions: Transaction[] | Array<{ getHash(): Buffer; }>): Buffer; static calculateTarget(bits: number): Buffer; @@ -70,7 +70,6 @@ export class Block { } export class ECPair { - constructor(d: BigInteger, Q?: null | undefined, options?: { compressed?: boolean, network?: Network }); constructor(d: null | undefined, Q: any, options?: { compressed?: boolean, network?: Network }); // Q should be ECPoint, but not sure how to define such type @@ -95,7 +94,6 @@ export class ECPair { } export class ECSignature { - constructor(r: BigInteger, s: BigInteger); toCompact(i: number, compressed: boolean): Buffer; @@ -109,7 +107,6 @@ export class ECSignature { static parseCompact(buffer: Buffer): { compressed: boolean, i: number, signature: ECSignature }; static parseScriptSignature(buffer: Buffer): { signature: ECSignature, hashType: number }; - } export class HDNode { @@ -154,7 +151,6 @@ export class HDNode { static fromSeedHex(hex: string, network?: Network): HDNode; static MASTER_SECRET: Buffer; - } export class Transaction { @@ -402,16 +398,16 @@ export namespace crypto { } export namespace script { + function classifyInput(script: Buffer | Array, allowIncomplete: boolean): "pubkeyhash" | "scripthash" | "multisig" | "pubkey" | "nonstandard"; - function classifyInput(script: Buffer | (Buffer | number)[], allowIncomplete: boolean): "pubkeyhash" | "scripthash" | "multisig" | "pubkey" | "nonstandard"; + function classifyOutput(script: Buffer | Array): "witnesspubkeyhash" | "witnessscripthash" | "pubkeyhash" + | "scripthash" | "multisig" | "pubkey" | "witnesscommitment" | "nulldata" | "nonstandard"; - function classifyOutput(script: Buffer | (Buffer | number)[]): "witnesspubkeyhash" | "witnessscripthash" | "pubkeyhash" | "scripthash" | "multisig" | "pubkey" | "witnesscommitment" | "nulldata" | "nonstandard"; + function classifyWitness(script: Buffer | Array, allowIncomplete: boolean): "witnesspubkeyhash" | "witnessscripthash" | "nonstandard"; - function classifyWitness(script: Buffer | (Buffer | number)[], allowIncomplete: boolean): "witnesspubkeyhash" | "witnessscripthash" | "nonstandard"; + function compile(chunks: Array): Buffer; - function compile(chunks: (Buffer | number)[]): Buffer; - - function decompile(buffer: Buffer): (Buffer | number)[]; + function decompile(buffer: Buffer): Array; function fromASM(asm: string): Buffer; @@ -423,9 +419,9 @@ export namespace script { function isPushOnly(value: any): boolean; - function toASM(chunks: Buffer | (Buffer | number)[]): string; + function toASM(chunks: Buffer | Array): string; - function toStack(chunks: Buffer | (Buffer | number)[]): Buffer[]; + function toStack(chunks: Buffer | Array): Buffer[]; namespace number { function decode(buffer: Buffer, maxLength: number, minimal: boolean): number;