Skip to content

Commit

Permalink
Updated rawTransactions types for POST endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jcramer committed Feb 2, 2019
1 parent c727d5b commit 161a0c3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
20 changes: 17 additions & 3 deletions lib/RawTransactions.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
export declare interface RawTransactions {
//constructor(restURL:string);
export interface RawTransactions {
decodeRawTransaction(hex:string):Promise<any>;
decodeScript(hex: string):Promise<any>;
getRawTransaction(txid: string, verbose?:boolean): Promise<string>;
getRawTransaction(txids: string[]): Promise<string[]>;
getRawTransaction(txids: string[], verbose:boolean): Promise<VerboseRawTransaction[]>; // verbose must be set to true
sendRawTransaction(hex: string, allowhighfees?:boolean): Promise<string>;
}

export interface VerboseRawTransaction {
hex: string;
txid: string;
size: number;
version: number;
locktime: number;
vin: [{ coinbase: string; sequence: number }]
vout: [{value: number; n: number; scriptPubKey: { asm: string; hex: string; reqSigs: number; type: string; addresses: string[] }}]
blockhash: string;
confirmations: number;
time: number;
blocktime: number;
}
20 changes: 17 additions & 3 deletions typings/RawTransactions.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
export declare interface RawTransactions {
//constructor(restURL:string);
export interface RawTransactions {
decodeRawTransaction(hex:string):Promise<any>;
decodeScript(hex: string):Promise<any>;
getRawTransaction(txid: string, verbose?:boolean): Promise<string>;
getRawTransaction(txids: string[]): Promise<string[]>;
getRawTransaction(txids: string[], verbose:boolean): Promise<VerboseRawTransaction[]>; // verbose must be set to true
sendRawTransaction(hex: string, allowhighfees?:boolean): Promise<string>;
}

export interface VerboseRawTransaction {
hex: string;
txid: string;
size: number;
version: number;
locktime: number;
vin: [{ coinbase: string; sequence: number }]
vout: [{value: number; n: number; scriptPubKey: { asm: string; hex: string; reqSigs: number; type: string; addresses: string[] }}]
blockhash: string;
confirmations: number;
time: number;
blocktime: number;
}

0 comments on commit 161a0c3

Please sign in to comment.