Skip to content

Commit 1630311

Browse files
committed
Merge branch 'master' into issue_1477
2 parents ec61b99 + 9267387 commit 1630311

File tree

7 files changed

+109
-39
lines changed

7 files changed

+109
-39
lines changed

.github/workflows/main_ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Run Tests
2+
3+
on: [push]
4+
5+
jobs:
6+
unit:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-node@v1
11+
with:
12+
node-version: 12
13+
registry-url: https://registry.npmjs.org/
14+
- run: npm ci
15+
- run: npm run unit
16+
coverage:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: actions/setup-node@v1
21+
with:
22+
node-version: 12
23+
registry-url: https://registry.npmjs.org/
24+
- run: npm ci
25+
- run: npm run coverage
26+
integration:
27+
runs-on: ubuntu-latest
28+
services:
29+
regtest:
30+
image: junderw/bitcoinjs-regtest-server@sha256:a46ec1a651ca5b1a5408f2b2526ea5f435421dd2bc2f28fae3bc33e1fd614552
31+
ports:
32+
- 8080:8080
33+
steps:
34+
- uses: actions/checkout@v2
35+
- uses: actions/setup-node@v1
36+
with:
37+
node-version: 12
38+
registry-url: https://registry.npmjs.org/
39+
- run: npm ci
40+
- run: APIURL=http://127.0.0.1:8080/1 npm run integration
41+
format:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v2
45+
- uses: actions/setup-node@v1
46+
with:
47+
node-version: 12
48+
registry-url: https://registry.npmjs.org/
49+
- run: npm ci
50+
- run: npm run format:ci
51+
gitdiff:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
- uses: actions/setup-node@v1
56+
with:
57+
node-version: 12
58+
registry-url: https://registry.npmjs.org/
59+
- run: npm ci
60+
- run: npm run gitdiff:ci
61+
lint:
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v2
65+
- uses: actions/setup-node@v1
66+
with:
67+
node-version: 12
68+
registry-url: https://registry.npmjs.org/
69+
- run: npm ci
70+
- run: npm run lint
71+
lint-tests:
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v2
75+
- uses: actions/setup-node@v1
76+
with:
77+
node-version: 12
78+
registry-url: https://registry.npmjs.org/
79+
- run: npm ci
80+
- run: npm run lint:tests

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Mistakes and bugs happen, but with your help in resolving and reporting [issues]
3030
## Documentation
3131
Presently, we do not have any formal documentation other than our [examples](#examples), please [ask for help](https://github.com/bitcoinjs/bitcoinjs-lib/issues/new) if our examples aren't enough to guide you.
3232

33+
You can find a [Web UI](https://bitcoincore.tech/apps/bitcoinjs-ui/index.html) that covers most of the `psbt.ts`, `transaction.ts` and `p2*.ts` APIs [here](https://bitcoincore.tech/apps/bitcoinjs-ui/index.html).
3334

3435
## Installation
3536
``` bash

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)