@@ -20,12 +20,7 @@ exports.oneOf =
20
20
exports . isTaptree =
21
21
exports . isTapleaf =
22
22
exports . TAPLEAF_VERSION_MASK =
23
- exports . Network =
24
- exports . ECPoint =
25
23
exports . Satoshi =
26
- exports . Signer =
27
- exports . BIP32Path =
28
- exports . UInt31 =
29
24
exports . isPoint =
30
25
exports . stacksEqual =
31
26
exports . typeforce =
@@ -72,49 +67,11 @@ function isPoint(p) {
72
67
return false ;
73
68
}
74
69
exports . isPoint = isPoint ;
75
- const UINT31_MAX = Math . pow ( 2 , 31 ) - 1 ;
76
- function UInt31 ( value ) {
77
- return exports . typeforce . UInt32 ( value ) && value <= UINT31_MAX ;
78
- }
79
- exports . UInt31 = UInt31 ;
80
- function BIP32Path ( value ) {
81
- return (
82
- exports . typeforce . String ( value ) && ! ! value . match ( / ^ ( m \/ ) ? ( \d + ' ? \/ ) * \d + ' ? $ / )
83
- ) ;
84
- }
85
- exports . BIP32Path = BIP32Path ;
86
- BIP32Path . toJSON = ( ) => {
87
- return 'BIP32 derivation path' ;
88
- } ;
89
- function Signer ( obj ) {
90
- return (
91
- ( exports . typeforce . Buffer ( obj . publicKey ) ||
92
- typeof obj . getPublicKey === 'function' ) &&
93
- typeof obj . sign === 'function'
94
- ) ;
95
- }
96
- exports . Signer = Signer ;
97
70
const SATOSHI_MAX = 21 * 1e14 ;
98
71
function Satoshi ( value ) {
99
72
return exports . typeforce . UInt53 ( value ) && value <= SATOSHI_MAX ;
100
73
}
101
74
exports . Satoshi = Satoshi ;
102
- // external dependent types
103
- exports . ECPoint = exports . typeforce . quacksLike ( 'Point' ) ;
104
- // exposed, external API
105
- exports . Network = exports . typeforce . compile ( {
106
- messagePrefix : exports . typeforce . oneOf (
107
- exports . typeforce . Buffer ,
108
- exports . typeforce . String ,
109
- ) ,
110
- bip32 : {
111
- public : exports . typeforce . UInt32 ,
112
- private : exports . typeforce . UInt32 ,
113
- } ,
114
- pubKeyHash : exports . typeforce . UInt8 ,
115
- scriptHash : exports . typeforce . UInt8 ,
116
- wif : exports . typeforce . UInt8 ,
117
- } ) ;
118
75
exports . TAPLEAF_VERSION_MASK = 0xfe ;
119
76
function isTapleaf ( o ) {
120
77
if ( ! o || ! ( 'output' in o ) ) return false ;
0 commit comments