Skip to content

Commit

Permalink
refactor: split commands into separate files
Browse files Browse the repository at this point in the history
Issue: BTC-1351
  • Loading branch information
OttoAllmendinger committed Sep 27, 2024
1 parent 93e467c commit ab6ce32
Show file tree
Hide file tree
Showing 24 changed files with 398 additions and 352 deletions.
1 change: 1 addition & 0 deletions modules/utxo-bin/bin/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env node
import * as yargs from 'yargs';

import { cmdParseTx, cmdParseAddress, cmdParseScript, cmdGenerateAddress, cmdParseXpub } from '../src/commands';

yargs
Expand Down
3 changes: 2 additions & 1 deletion modules/utxo-bin/src/InputParser.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as utxolib from '@bitgo/utxo-lib';
import { script, ScriptSignature } from 'bitcoinjs-lib';

import { Parser, ParserNode } from './Parser';
import { getParserTxInputProperties, getPrevOut, ParserTx, ParserTxInput } from './ParserTx';
import { getHollowSpendMessage, HollowSegwitSpend, parseHollowSegwitSpend } from './hollowSegwitSpend';
import { script, ScriptSignature } from 'bitcoinjs-lib';
import { isHighS } from './ecdsa';
import { ChainInfo } from './TxParser';
import { OutputParser } from './OutputParser';
Expand Down
3 changes: 2 additions & 1 deletion modules/utxo-bin/src/OutputParser.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import * as utxolib from '@bitgo/utxo-lib';
import { Network } from '@bitgo/utxo-lib';

import { ChainInfo } from './TxParser';
import { Parser, ParserNode } from './Parser';
import { AddressParser } from './AddressParser';
import { formatSat } from './format';
import { Network } from '@bitgo/utxo-lib';

export class OutputParser extends Parser {
constructor(
Expand Down
3 changes: 2 additions & 1 deletion modules/utxo-bin/src/ScriptParser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Parser, ParserNode } from './Parser';
import * as utxolib from '@bitgo/utxo-lib';

import { Parser, ParserNode } from './Parser';
import { parseUnknown } from './parseUnknown';

const paymentTypes = ['p2sh', 'p2pkh', 'p2wpkh', 'p2wsh', 'p2ms'] as const;
Expand Down
1 change: 1 addition & 0 deletions modules/utxo-bin/src/TxParser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { OutputSpend, TransactionStatus } from '@bitgo/blockapis';
import * as utxolib from '@bitgo/utxo-lib';

import { Parser, ParserNode } from './Parser';
import { formatSat } from './format';
import { getParserTxProperties, ParserTx, ParserTxInput, ParserTxOutput } from './ParserTx';
Expand Down
1 change: 1 addition & 0 deletions modules/utxo-bin/src/args/walletKeys.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as assert from 'assert';

import * as utxolib from '@bitgo/utxo-lib';

export function isWalletKeyName(name: string): name is utxolib.bitgo.KeyName {
Expand Down
1 change: 1 addition & 0 deletions modules/utxo-bin/src/bip32.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as utxolib from '@bitgo/utxo-lib';

import { Parser, ParserNode } from './Parser';
import { parseUnknown } from './parseUnknown';

Expand Down
340 changes: 0 additions & 340 deletions modules/utxo-bin/src/commands.ts

This file was deleted.

Loading

0 comments on commit ab6ce32

Please sign in to comment.