Fix txOutputs

This commit is contained in:
junderw 2020-09-12 00:35:57 +09:00
parent 3a54c73817
commit 5e3442b74b
No known key found for this signature in database
GPG key ID: B256185D3A971908
2 changed files with 7 additions and 7 deletions

View file

@ -32,8 +32,8 @@ export interface PsbtTxInput extends TransactionInput {
hash: Buffer; hash: Buffer;
} }
export interface PsbtTxOutput extends Output { export interface PsbtTxOutput extends TransactionOutput {
address: string; address: string | undefined;
} }
/** /**
@ -171,7 +171,7 @@ export class Psbt {
})); }));
} }
get txOutputs(): TransactionOutput[] { get txOutputs(): PsbtTxOutput[] {
return this.__CACHE.__TX.outs.map(output => { return this.__CACHE.__TX.outs.map(output => {
let address; let address;
try { try {

8
types/psbt.d.ts vendored
View file

@ -1,13 +1,13 @@
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, TransactionOutput } from 'bip174/src/lib/interfaces';
import { Signer, SignerAsync } from './ecpair'; import { Signer, SignerAsync } from './ecpair';
import { Network } from './networks'; import { Network } from './networks';
import { Output, Transaction } from './transaction'; import { Transaction } from './transaction';
export interface PsbtTxInput extends TransactionInput { export interface PsbtTxInput extends TransactionInput {
hash: Buffer; hash: Buffer;
} }
export interface PsbtTxOutput extends Output { export interface PsbtTxOutput extends TransactionOutput {
address: string; address: string | undefined;
} }
/** /**
* Psbt class can parse and generate a PSBT binary based off of the BIP174. * Psbt class can parse and generate a PSBT binary based off of the BIP174.