Update @types/node and fix problems with types

This commit is contained in:
junderw 2019-09-12 15:20:33 +09:00
parent f376913a4c
commit 34b0b525fc
No known key found for this signature in database
GPG key ID: B256185D3A971908
32 changed files with 14 additions and 34 deletions

13
package-lock.json generated
View file

@ -156,9 +156,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "10.12.18", "version": "12.7.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz",
"integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==" "integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w=="
}, },
"@types/proxyquire": { "@types/proxyquire": {
"version": "1.3.28", "version": "1.3.28",
@ -261,6 +261,13 @@
"tiny-secp256k1": "^1.1.0", "tiny-secp256k1": "^1.1.0",
"typeforce": "^1.11.5", "typeforce": "^1.11.5",
"wif": "^2.0.6" "wif": "^2.0.6"
},
"dependencies": {
"@types/node": {
"version": "10.12.18",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz",
"integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ=="
}
} }
}, },
"bip39": { "bip39": {

View file

@ -48,7 +48,7 @@
"types" "types"
], ],
"dependencies": { "dependencies": {
"@types/node": "10.12.18", "@types/node": "12.7.5",
"bech32": "^1.1.2", "bech32": "^1.1.2",
"bip174": "^1.0.1", "bip174": "^1.0.1",
"bip32": "^2.0.4", "bip32": "^2.0.4",

View file

@ -10,7 +10,7 @@ function toOutputScript(address: string): Buffer {
} }
function idToHash(txid: string): Buffer { function idToHash(txid: string): Buffer {
return Buffer.from(txid, 'hex').reverse() as Buffer; return Buffer.from(txid, 'hex').reverse();
} }
const alice = bitcoin.ECPair.fromWIF( const alice = bitcoin.ECPair.fromWIF(

View file

@ -10,7 +10,7 @@ function toOutputScript(address: string): Buffer {
} }
function idToHash(txid: string): Buffer { function idToHash(txid: string): Buffer {
return Buffer.from(txid, 'hex').reverse() as Buffer; return Buffer.from(txid, 'hex').reverse();
} }
const alice = bitcoin.ECPair.fromWIF( const alice = bitcoin.ECPair.fromWIF(

View file

@ -14,7 +14,7 @@ const initBuffers = (object: any): typeof preFixtures =>
const data = result[1]; const data = result[1];
const encoding = result[2]; const encoding = result[2];
return Buffer.from(data, encoding); return Buffer.from(data, encoding as any);
}); });
const fixtures = initBuffers(preFixtures); const fixtures = initBuffers(preFixtures);

1
types/address.d.ts vendored
View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Network } from './networks'; import { Network } from './networks';
export interface Base58CheckResult { export interface Base58CheckResult {
hash: Buffer; hash: Buffer;

1
types/block.d.ts vendored
View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Transaction } from './transaction'; import { Transaction } from './transaction';
export declare class Block { export declare class Block {
static fromBuffer(buffer: Buffer): Block; static fromBuffer(buffer: Buffer): Block;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
export declare function readUInt64LE(buffer: Buffer, offset: number): number; export declare function readUInt64LE(buffer: Buffer, offset: number): number;
export declare function writeUInt64LE(buffer: Buffer, value: number, offset: number): number; export declare function writeUInt64LE(buffer: Buffer, value: number, offset: number): number;
export declare function reverseBuffer(buffer: Buffer): Buffer; export declare function reverseBuffer(buffer: Buffer): Buffer;

1
types/classify.d.ts vendored
View file

@ -1,4 +1,3 @@
/// <reference types="node" />
declare const types: { declare const types: {
P2MS: string; P2MS: string;
NONSTANDARD: string; NONSTANDARD: string;

1
types/crypto.d.ts vendored
View file

@ -1,4 +1,3 @@
/// <reference types="node" />
export declare function ripemd160(buffer: Buffer): Buffer; export declare function ripemd160(buffer: Buffer): Buffer;
export declare function sha1(buffer: Buffer): Buffer; export declare function sha1(buffer: Buffer): Buffer;
export declare function sha256(buffer: Buffer): Buffer; export declare function sha256(buffer: Buffer): Buffer;

1
types/ecpair.d.ts vendored
View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Network } from './networks'; import { Network } from './networks';
interface ECPairOptions { interface ECPairOptions {
compressed?: boolean; compressed?: boolean;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Network } from '../networks'; import { Network } from '../networks';
import { p2data as embed } from './embed'; import { p2data as embed } from './embed';
import { p2ms } from './p2ms'; import { p2ms } from './p2ms';

1
types/psbt.d.ts vendored
View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Psbt as PsbtBase } from 'bip174'; import { Psbt as PsbtBase } from 'bip174';
import { KeyValue, PsbtGlobalUpdate, PsbtInput, PsbtInputUpdate, PsbtOutput, PsbtOutputUpdate, TransactionInput } from 'bip174/src/lib/interfaces'; import { KeyValue, PsbtGlobalUpdate, PsbtInput, PsbtInputUpdate, PsbtOutput, PsbtOutputUpdate, TransactionInput } from 'bip174/src/lib/interfaces';
import { Signer, SignerAsync } from './ecpair'; import { Signer, SignerAsync } from './ecpair';

1
types/script.d.ts vendored
View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Stack } from './payments'; import { Stack } from './payments';
import * as scriptNumber from './script_number'; import * as scriptNumber from './script_number';
import * as scriptSignature from './script_signature'; import * as scriptSignature from './script_signature';

View file

@ -1,3 +1,2 @@
/// <reference types="node" />
export declare function decode(buffer: Buffer, maxLength?: number, minimal?: boolean): number; export declare function decode(buffer: Buffer, maxLength?: number, minimal?: boolean): number;
export declare function encode(_number: number): Buffer; export declare function encode(_number: number): Buffer;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
interface ScriptSignature { interface ScriptSignature {
signature: Buffer; signature: Buffer;
hashType: number; hashType: number;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Stack } from '../../payments'; import { Stack } from '../../payments';
export declare function check(script: Buffer | Stack, allowIncomplete?: boolean): boolean; export declare function check(script: Buffer | Stack, allowIncomplete?: boolean): boolean;
export declare namespace check { export declare namespace check {

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Stack } from '../../payments'; import { Stack } from '../../payments';
export declare function check(script: Buffer | Stack, allowIncomplete?: boolean): boolean; export declare function check(script: Buffer | Stack, allowIncomplete?: boolean): boolean;
export declare namespace check { export declare namespace check {

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
export declare function check(script: Buffer | Array<number | Buffer>): boolean; export declare function check(script: Buffer | Array<number | Buffer>): boolean;
export declare namespace check { export declare namespace check {
var toJSON: () => string; var toJSON: () => string;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Stack } from '../../payments'; import { Stack } from '../../payments';
export declare function check(script: Buffer | Stack): boolean; export declare function check(script: Buffer | Stack): boolean;
export declare namespace check { export declare namespace check {

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Stack } from '../../payments'; import { Stack } from '../../payments';
export declare function check(script: Buffer | Stack): boolean; export declare function check(script: Buffer | Stack): boolean;
export declare namespace check { export declare namespace check {

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Stack } from '../../payments'; import { Stack } from '../../payments';
export declare function check(script: Buffer | Stack): boolean; export declare function check(script: Buffer | Stack): boolean;
export declare namespace check { export declare namespace check {

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
export declare function check(script: Buffer | Array<number | Buffer>): boolean; export declare function check(script: Buffer | Array<number | Buffer>): boolean;
export declare namespace check { export declare namespace check {
var toJSON: () => string; var toJSON: () => string;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
export declare function check(script: Buffer | Array<number | Buffer>, allowIncomplete?: boolean): boolean; export declare function check(script: Buffer | Array<number | Buffer>, allowIncomplete?: boolean): boolean;
export declare namespace check { export declare namespace check {
var toJSON: () => string; var toJSON: () => string;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
export declare function check(script: Buffer | Array<number | Buffer>): boolean; export declare function check(script: Buffer | Array<number | Buffer>): boolean;
export declare namespace check { export declare namespace check {
var toJSON: () => string; var toJSON: () => string;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
export declare function check(script: Buffer | Array<number | Buffer>): boolean; export declare function check(script: Buffer | Array<number | Buffer>): boolean;
export declare namespace check { export declare namespace check {
var toJSON: () => string; var toJSON: () => string;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Stack } from '../../payments'; import { Stack } from '../../payments';
export declare function check(script: Buffer | Stack): boolean; export declare function check(script: Buffer | Stack): boolean;
export declare namespace check { export declare namespace check {

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
export declare function check(script: Buffer | Array<number | Buffer>): boolean; export declare function check(script: Buffer | Array<number | Buffer>): boolean;
export declare namespace check { export declare namespace check {
var toJSON: () => string; var toJSON: () => string;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
export declare function check(chunks: Buffer[], allowIncomplete?: boolean): boolean; export declare function check(chunks: Buffer[], allowIncomplete?: boolean): boolean;
export declare namespace check { export declare namespace check {
var toJSON: () => string; var toJSON: () => string;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
export declare function check(script: Buffer | Array<number | Buffer>): boolean; export declare function check(script: Buffer | Array<number | Buffer>): boolean;
export declare namespace check { export declare namespace check {
var toJSON: () => string; var toJSON: () => string;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
export interface BlankOutput { export interface BlankOutput {
script: Buffer; script: Buffer;
valueBuffer: Buffer; valueBuffer: Buffer;

View file

@ -1,4 +1,3 @@
/// <reference types="node" />
import { Signer } from './ecpair'; import { Signer } from './ecpair';
import { Network } from './networks'; import { Network } from './networks';
import { Transaction } from './transaction'; import { Transaction } from './transaction';