Skip to content

Commit 9267387

Browse files
authored
Merge pull request #1656 from bitcoincoretech/issue_1470b
#1470 Bring over TransactionInput & TransactionOutputfrom BIP174; update tiny-secp256k1 to v1.1.5
2 parents 1368b82 + 14cfb55 commit 9267387

File tree

4 files changed

+28
-10
lines changed

4 files changed

+28
-10
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"merkle-lib": "^2.0.10",
6161
"pushdata-bitcoin": "^1.0.1",
6262
"randombytes": "^2.0.1",
63-
"tiny-secp256k1": "^1.1.1",
63+
"tiny-secp256k1": "^1.1.6",
6464
"typeforce": "^1.11.3",
6565
"varuint-bitcoin": "^1.0.4",
6666
"wif": "^2.0.1"

ts_src/psbt.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import {
1111
PsbtOutputUpdate,
1212
Transaction as ITransaction,
1313
TransactionFromBuffer,
14-
TransactionInput,
15-
TransactionOutput,
1614
} from 'bip174/src/lib/interfaces';
1715
import { checkForInput, checkForOutput } from 'bip174/src/lib/utils';
1816
import { fromOutputScript, toOutputScript } from './address';
@@ -28,10 +26,21 @@ import * as payments from './payments';
2826
import * as bscript from './script';
2927
import { Output, Transaction } from './transaction';
3028

29+
export interface TransactionInput {
30+
hash: string | Buffer;
31+
index: number;
32+
sequence?: number;
33+
}
34+
3135
export interface PsbtTxInput extends TransactionInput {
3236
hash: Buffer;
3337
}
3438

39+
export interface TransactionOutput {
40+
script: Buffer;
41+
value: number;
42+
}
43+
3544
export interface PsbtTxOutput extends TransactionOutput {
3645
address: string | undefined;
3746
}

types/psbt.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
import { Psbt as PsbtBase } from 'bip174';
2-
import { KeyValue, PsbtGlobalUpdate, PsbtInput, PsbtInputUpdate, PsbtOutput, PsbtOutputUpdate, TransactionInput, TransactionOutput } from 'bip174/src/lib/interfaces';
2+
import { KeyValue, PsbtGlobalUpdate, PsbtInput, PsbtInputUpdate, PsbtOutput, PsbtOutputUpdate } from 'bip174/src/lib/interfaces';
33
import { Signer, SignerAsync } from './ecpair';
44
import { Network } from './networks';
55
import { Transaction } from './transaction';
6+
export interface TransactionInput {
7+
hash: string | Buffer;
8+
index: number;
9+
sequence?: number;
10+
}
611
export interface PsbtTxInput extends TransactionInput {
712
hash: Buffer;
813
}
14+
export interface TransactionOutput {
15+
script: Buffer;
16+
value: number;
17+
}
918
export interface PsbtTxOutput extends TransactionOutput {
1019
address: string | undefined;
1120
}

0 commit comments

Comments
 (0)