Skip to content

Commit

Permalink
#1470 Bring over TransactionInput & TransactionOutputfrom BIP174
Browse files Browse the repository at this point in the history
  • Loading branch information
motorina0 committed Nov 26, 2020
1 parent 533d6c2 commit 6661e3d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
13 changes: 11 additions & 2 deletions ts_src/psbt.ts
Expand Up @@ -11,8 +11,6 @@ import {
PsbtOutputUpdate,
Transaction as ITransaction,
TransactionFromBuffer,
TransactionInput,
TransactionOutput,
} from 'bip174/src/lib/interfaces';
import { checkForInput, checkForOutput } from 'bip174/src/lib/utils';
import { fromOutputScript, toOutputScript } from './address';
Expand All @@ -28,10 +26,21 @@ import * as payments from './payments';
import * as bscript from './script';
import { Output, Transaction } from './transaction';

export interface TransactionInput {
hash: string | Buffer;
index: number;
sequence?: number;
}

export interface PsbtTxInput extends TransactionInput {
hash: Buffer;
}

export interface TransactionOutput {
script: Buffer;
value: number;
}

export interface PsbtTxOutput extends TransactionOutput {
address: string | undefined;
}
Expand Down
11 changes: 10 additions & 1 deletion types/psbt.d.ts
@@ -1,11 +1,20 @@
import { Psbt as PsbtBase } from 'bip174';
import { KeyValue, PsbtGlobalUpdate, PsbtInput, PsbtInputUpdate, PsbtOutput, PsbtOutputUpdate, TransactionInput, TransactionOutput } from 'bip174/src/lib/interfaces';
import { KeyValue, PsbtGlobalUpdate, PsbtInput, PsbtInputUpdate, PsbtOutput, PsbtOutputUpdate } from 'bip174/src/lib/interfaces';
import { Signer, SignerAsync } from './ecpair';
import { Network } from './networks';
import { Transaction } from './transaction';
export interface TransactionInput {
hash: string | Buffer;
index: number;
sequence?: number;
}
export interface PsbtTxInput extends TransactionInput {
hash: Buffer;
}
export interface TransactionOutput {
script: Buffer;
value: number;
}
export interface PsbtTxOutput extends TransactionOutput {
address: string | undefined;
}
Expand Down

0 comments on commit 6661e3d

Please sign in to comment.