Skip to content

Commit

Permalink
Split library into different files to simplify maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Mar 24, 2024
1 parent e7c5cf9 commit 3d1c60e
Show file tree
Hide file tree
Showing 10 changed files with 3,150 additions and 3,069 deletions.
3,067 changes: 0 additions & 3,067 deletions index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
},
"scripts": {
"build": "tsc && tsc -p tsconfig.esm.json",
"lint": "prettier --check index.ts",
"format": "prettier --write index.ts",
"lint": "prettier --check src",
"format": "prettier --write src",
"test": "node test/index.test.js && node test/psbt-test/bip174-psbt-extended.test.js",
"test:extended": "node --experimental-loader ./test/bitcoinjs-test/esm-loader.js ./test/bitcoinjs-test/index.test.js",
"test:slow": "node test/index.test.js && node test/slow.test.js"
Expand Down
2 changes: 2 additions & 0 deletions _type_test.ts → src/_type_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ tx.addOutput({ amount: 123n });
// tx.addOutput({ amount: 123 });

for (let i = 0; i < tx.inputsLength; i++) {
// @ts-ignore
console.log('I', tx.getInput(i));
}

for (let i = 0; i < tx.outputsLength; i++) {
// @ts-ignore
console.log('O', tx.getOutput(i));
}
21 changes: 21 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*! scure-btc-signer - MIT License (c) 2022 Paul Miller (paulmillr.com) */

// prettier-ignore
export {
p2pk, p2pkh, p2sh, p2ms, p2wsh, p2wpkh, p2tr, p2tr_ns, p2tr_ms, p2tr_pk,
multisig // => classicMultisig?
} from './payment.js';
export { OP, RawTx, CompactSize, Script, ScriptNum } from './script.js';
export { Transaction } from './transaction.js';
export { selectUTXO } from './utxo.js';
export { NETWORK, compareBytes as _cmpBytes, TAPROOT_UNSPENDABLE_KEY } from './utils.js';

// Utils
// prettier-ignore
export {
Address, getAddress, WIF,
taprootListToTree, OutScript, _sortPubkeys, sortedMultisig, combinations
} from './payment.js'; // remove
export { _DebugPSBT, TaprootControlBlock } from './psbt.js'; // remove
export { Decimal, bip32Path, SigHash, PSBTCombine, DEFAULT_SEQUENCE } from './transaction.js'; // remove
export { _cmpBig, _Estimator } from './utxo.js';
Loading

0 comments on commit 3d1c60e

Please sign in to comment.