#1470 Bring over TransactionInput & TransactionOutputfrom BIP174

This commit is contained in:
Vlad Stan 2020-11-26 19:23:01 +02:00
parent 533d6c2e6d
commit 6661e3d5c4
2 changed files with 21 additions and 3 deletions

View file

@ -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';
@ -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;
}

11
types/psbt.d.ts vendored
View file

@ -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;
}