From 8454d9b464f8acd9e4c1c988a15234672690685d Mon Sep 17 00:00:00 2001 From: James Cramer Date: Tue, 31 Mar 2020 16:19:38 -0400 Subject: [PATCH] fix typings --- README.md | 3 +++ lib/vendors.d.ts | 22 ++++++++++++++++++++-- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7af9ae40..ca97bbc2 100644 --- a/README.md +++ b/README.md @@ -835,6 +835,9 @@ Running the unit tests require node.js v8.15+. # Change Log +### 0.25.2 +- Update typings for bitcore-cash-lib + ### 0.25.1 - Update typings for BchdNetwork diff --git a/lib/vendors.d.ts b/lib/vendors.d.ts index 60b9d19e..059adda4 100644 --- a/lib/vendors.d.ts +++ b/lib/vendors.d.ts @@ -55,6 +55,7 @@ declare module "bitcore-lib-cash" { export class Transaction { inputs: Input[]; outputs: Output[]; + toObject(): any; readonly id: string; readonly hash: string; nid: string; @@ -119,6 +120,7 @@ declare module "bitcore-lib-cash" { } export interface Output { + satoshis: number; _scriptBuffer: Buffer; readonly script: any; } @@ -131,8 +133,22 @@ declare module "bitcore-lib-cash" { } export class Script { - static fromAddress(arg0: string): any; - constructor(any: any); + fromBuffer(buffer: Buffer): Script; + toBuffer(): Buffer; + toAddress(network: any): Address; + fromAddress(address: Address): Script; + fromString(hex: string): Script; + fromASM(asm: string): string; + toASM(): string; + fromHex(hex: string): string + toHex(): string; + chunks: Chunk[]; + } + + export interface Chunk { + buf: Buffer; + len: number; + opcodenum: number; } export interface Util { @@ -161,9 +177,11 @@ declare module "bitcore-lib-cash" { export class Input { output: any; prevTxId: any; + script: Script; outputIndex: number; getSignatures(txn: Transaction, privateKey: PrivateKey, input_index: number, sigHashType: number): any; setScript(script: Script): void; + _scriptBuffer: Buffer; } } diff --git a/package-lock.json b/package-lock.json index e6a70bdd..7342af55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "slpjs", - "version": "0.25.1", + "version": "0.25.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a1f16b0c..2ffc2645 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slpjs", - "version": "0.25.1", + "version": "0.25.2", "description": "Simple Ledger Protocol (SLP) JavaScript Library", "main": "index.js", "files": [