utxo-lib 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (249) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -0
  3. package/dist/src/address.d.ts +11 -0
  4. package/dist/src/address.d.ts.map +1 -0
  5. package/dist/src/address.js +37 -0
  6. package/dist/src/addressFormat.d.ts +53 -0
  7. package/dist/src/addressFormat.d.ts.map +1 -0
  8. package/dist/src/addressFormat.js +110 -0
  9. package/dist/src/bitgo/Musig2.d.ts +51 -0
  10. package/dist/src/bitgo/Musig2.d.ts.map +1 -0
  11. package/dist/src/bitgo/Musig2.js +175 -0
  12. package/dist/src/bitgo/Unspent.d.ts +95 -0
  13. package/dist/src/bitgo/Unspent.d.ts.map +1 -0
  14. package/dist/src/bitgo/Unspent.js +138 -0
  15. package/dist/src/bitgo/UtxoPsbt.d.ts +132 -0
  16. package/dist/src/bitgo/UtxoPsbt.d.ts.map +1 -0
  17. package/dist/src/bitgo/UtxoPsbt.js +469 -0
  18. package/dist/src/bitgo/UtxoTransaction.d.ts +22 -0
  19. package/dist/src/bitgo/UtxoTransaction.d.ts.map +1 -0
  20. package/dist/src/bitgo/UtxoTransaction.js +97 -0
  21. package/dist/src/bitgo/UtxoTransactionBuilder.d.ts +26 -0
  22. package/dist/src/bitgo/UtxoTransactionBuilder.d.ts.map +1 -0
  23. package/dist/src/bitgo/UtxoTransactionBuilder.js +67 -0
  24. package/dist/src/bitgo/bbc/DashPsbt.d.ts +12 -0
  25. package/dist/src/bitgo/bbc/DashPsbt.d.ts.map +1 -0
  26. package/dist/src/bitgo/bbc/DashPsbt.js +27 -0
  27. package/dist/src/bitgo/bbc/DashTransaction.d.ts +39 -0
  28. package/dist/src/bitgo/bbc/DashTransaction.d.ts.map +1 -0
  29. package/dist/src/bitgo/bbc/DashTransaction.js +109 -0
  30. package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts +14 -0
  31. package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts.map +1 -0
  32. package/dist/src/bitgo/bbc/DashTransactionBuilder.js +28 -0
  33. package/dist/src/bitgo/bbc/index.d.ts +4 -0
  34. package/dist/src/bitgo/bbc/index.d.ts.map +1 -0
  35. package/dist/src/bitgo/bbc/index.js +16 -0
  36. package/dist/src/bitgo/bitcoincash/address.d.ts +35 -0
  37. package/dist/src/bitgo/bitcoincash/address.d.ts.map +1 -0
  38. package/dist/src/bitgo/bitcoincash/address.js +151 -0
  39. package/dist/src/bitgo/bitcoincash/index.d.ts +2 -0
  40. package/dist/src/bitgo/bitcoincash/index.d.ts.map +1 -0
  41. package/dist/src/bitgo/bitcoincash/index.js +14 -0
  42. package/dist/src/bitgo/dash/DashPsbt.d.ts +12 -0
  43. package/dist/src/bitgo/dash/DashPsbt.d.ts.map +1 -0
  44. package/dist/src/bitgo/dash/DashPsbt.js +27 -0
  45. package/dist/src/bitgo/dash/DashTransaction.d.ts +39 -0
  46. package/dist/src/bitgo/dash/DashTransaction.d.ts.map +1 -0
  47. package/dist/src/bitgo/dash/DashTransaction.js +109 -0
  48. package/dist/src/bitgo/dash/DashTransactionBuilder.d.ts +14 -0
  49. package/dist/src/bitgo/dash/DashTransactionBuilder.d.ts.map +1 -0
  50. package/dist/src/bitgo/dash/DashTransactionBuilder.js +28 -0
  51. package/dist/src/bitgo/dash/index.d.ts +4 -0
  52. package/dist/src/bitgo/dash/index.d.ts.map +1 -0
  53. package/dist/src/bitgo/dash/index.js +16 -0
  54. package/dist/src/bitgo/index.d.ts +17 -0
  55. package/dist/src/bitgo/index.d.ts.map +1 -0
  56. package/dist/src/bitgo/index.js +30 -0
  57. package/dist/src/bitgo/keyutil.d.ts +17 -0
  58. package/dist/src/bitgo/keyutil.d.ts.map +1 -0
  59. package/dist/src/bitgo/keyutil.js +37 -0
  60. package/dist/src/bitgo/nonStandardHalfSigned.d.ts +7 -0
  61. package/dist/src/bitgo/nonStandardHalfSigned.d.ts.map +1 -0
  62. package/dist/src/bitgo/nonStandardHalfSigned.js +56 -0
  63. package/dist/src/bitgo/outputScripts.d.ts +84 -0
  64. package/dist/src/bitgo/outputScripts.d.ts.map +1 -0
  65. package/dist/src/bitgo/outputScripts.js +297 -0
  66. package/dist/src/bitgo/parseInput.d.ts +92 -0
  67. package/dist/src/bitgo/parseInput.d.ts.map +1 -0
  68. package/dist/src/bitgo/parseInput.js +344 -0
  69. package/dist/src/bitgo/psbt/fromHalfSigned.d.ts +24 -0
  70. package/dist/src/bitgo/psbt/fromHalfSigned.d.ts.map +1 -0
  71. package/dist/src/bitgo/psbt/fromHalfSigned.js +91 -0
  72. package/dist/src/bitgo/psbt/scriptTypes.d.ts +6 -0
  73. package/dist/src/bitgo/psbt/scriptTypes.d.ts.map +1 -0
  74. package/dist/src/bitgo/psbt/scriptTypes.js +23 -0
  75. package/dist/src/bitgo/signature.d.ts +84 -0
  76. package/dist/src/bitgo/signature.d.ts.map +1 -0
  77. package/dist/src/bitgo/signature.js +222 -0
  78. package/dist/src/bitgo/tnumber.d.ts +9 -0
  79. package/dist/src/bitgo/tnumber.d.ts.map +1 -0
  80. package/dist/src/bitgo/tnumber.js +31 -0
  81. package/dist/src/bitgo/transaction.d.ts +29 -0
  82. package/dist/src/bitgo/transaction.d.ts.map +1 -0
  83. package/dist/src/bitgo/transaction.js +247 -0
  84. package/dist/src/bitgo/types.d.ts +5 -0
  85. package/dist/src/bitgo/types.d.ts.map +1 -0
  86. package/dist/src/bitgo/types.js +12 -0
  87. package/dist/src/bitgo/wallet/Psbt.d.ts +47 -0
  88. package/dist/src/bitgo/wallet/Psbt.d.ts.map +1 -0
  89. package/dist/src/bitgo/wallet/Psbt.js +232 -0
  90. package/dist/src/bitgo/wallet/Unspent.d.ts +47 -0
  91. package/dist/src/bitgo/wallet/Unspent.d.ts.map +1 -0
  92. package/dist/src/bitgo/wallet/Unspent.js +154 -0
  93. package/dist/src/bitgo/wallet/WalletKeys.d.ts +72 -0
  94. package/dist/src/bitgo/wallet/WalletKeys.d.ts.map +1 -0
  95. package/dist/src/bitgo/wallet/WalletKeys.js +104 -0
  96. package/dist/src/bitgo/wallet/WalletOutput.d.ts +18 -0
  97. package/dist/src/bitgo/wallet/WalletOutput.d.ts.map +1 -0
  98. package/dist/src/bitgo/wallet/WalletOutput.js +69 -0
  99. package/dist/src/bitgo/wallet/WalletScripts.d.ts +7 -0
  100. package/dist/src/bitgo/wallet/WalletScripts.d.ts.map +1 -0
  101. package/dist/src/bitgo/wallet/WalletScripts.js +15 -0
  102. package/dist/src/bitgo/wallet/WalletUnspentSigner.d.ts +19 -0
  103. package/dist/src/bitgo/wallet/WalletUnspentSigner.d.ts.map +1 -0
  104. package/dist/src/bitgo/wallet/WalletUnspentSigner.js +47 -0
  105. package/dist/src/bitgo/wallet/chains.d.ts +57 -0
  106. package/dist/src/bitgo/wallet/chains.d.ts.map +1 -0
  107. package/dist/src/bitgo/wallet/chains.js +106 -0
  108. package/dist/src/bitgo/wallet/index.d.ts +8 -0
  109. package/dist/src/bitgo/wallet/index.d.ts.map +1 -0
  110. package/dist/src/bitgo/wallet/index.js +20 -0
  111. package/dist/src/bitgo/zcash/ZcashBufferutils.d.ts +26 -0
  112. package/dist/src/bitgo/zcash/ZcashBufferutils.d.ts.map +1 -0
  113. package/dist/src/bitgo/zcash/ZcashBufferutils.js +157 -0
  114. package/dist/src/bitgo/zcash/ZcashPsbt.d.ts +36 -0
  115. package/dist/src/bitgo/zcash/ZcashPsbt.d.ts.map +1 -0
  116. package/dist/src/bitgo/zcash/ZcashPsbt.js +146 -0
  117. package/dist/src/bitgo/zcash/ZcashTransaction.d.ts +61 -0
  118. package/dist/src/bitgo/zcash/ZcashTransaction.d.ts.map +1 -0
  119. package/dist/src/bitgo/zcash/ZcashTransaction.js +341 -0
  120. package/dist/src/bitgo/zcash/ZcashTransactionBuilder.d.ts +21 -0
  121. package/dist/src/bitgo/zcash/ZcashTransactionBuilder.d.ts.map +1 -0
  122. package/dist/src/bitgo/zcash/ZcashTransactionBuilder.js +105 -0
  123. package/dist/src/bitgo/zcash/address.d.ts +8 -0
  124. package/dist/src/bitgo/zcash/address.d.ts.map +1 -0
  125. package/dist/src/bitgo/zcash/address.js +57 -0
  126. package/dist/src/bitgo/zcash/hashZip0244.d.ts +27 -0
  127. package/dist/src/bitgo/zcash/hashZip0244.d.ts.map +1 -0
  128. package/dist/src/bitgo/zcash/hashZip0244.js +184 -0
  129. package/dist/src/bitgo/zcash/index.d.ts +4 -0
  130. package/dist/src/bitgo/zcash/index.d.ts.map +1 -0
  131. package/dist/src/bitgo/zcash/index.js +16 -0
  132. package/dist/src/classify.d.ts +19 -0
  133. package/dist/src/classify.d.ts.map +1 -0
  134. package/dist/src/classify.js +89 -0
  135. package/dist/src/index.d.ts +13 -0
  136. package/dist/src/index.d.ts.map +1 -0
  137. package/dist/src/index.js +36 -0
  138. package/dist/src/networks.d.ts +119 -0
  139. package/dist/src/networks.d.ts.map +1 -0
  140. package/dist/src/networks.js +477 -0
  141. package/dist/src/noble_ecc.d.ts +28 -0
  142. package/dist/src/noble_ecc.d.ts.map +1 -0
  143. package/dist/src/noble_ecc.js +168 -0
  144. package/dist/src/payments/index.d.ts +4 -0
  145. package/dist/src/payments/index.d.ts.map +1 -0
  146. package/dist/src/payments/index.js +8 -0
  147. package/dist/src/payments/p2tr.d.ts +3 -0
  148. package/dist/src/payments/p2tr.d.ts.map +1 -0
  149. package/dist/src/payments/p2tr.js +348 -0
  150. package/dist/src/payments/p2tr_ns.d.ts +3 -0
  151. package/dist/src/payments/p2tr_ns.d.ts.map +1 -0
  152. package/dist/src/payments/p2tr_ns.js +134 -0
  153. package/dist/src/taproot.d.ts +141 -0
  154. package/dist/src/taproot.d.ts.map +1 -0
  155. package/dist/src/taproot.js +384 -0
  156. package/dist/src/templates/multisig/index.d.ts +4 -0
  157. package/dist/src/templates/multisig/index.d.ts.map +1 -0
  158. package/dist/src/templates/multisig/index.js +8 -0
  159. package/dist/src/templates/multisig/input.d.ts +7 -0
  160. package/dist/src/templates/multisig/input.d.ts.map +1 -0
  161. package/dist/src/templates/multisig/input.js +25 -0
  162. package/dist/src/templates/multisig/output.d.ts +7 -0
  163. package/dist/src/templates/multisig/output.d.ts.map +1 -0
  164. package/dist/src/templates/multisig/output.js +38 -0
  165. package/dist/src/templates/nulldata.d.ts +10 -0
  166. package/dist/src/templates/nulldata.d.ts.map +1 -0
  167. package/dist/src/templates/nulldata.js +17 -0
  168. package/dist/src/templates/pubkey/index.d.ts +4 -0
  169. package/dist/src/templates/pubkey/index.d.ts.map +1 -0
  170. package/dist/src/templates/pubkey/index.js +8 -0
  171. package/dist/src/templates/pubkey/input.d.ts +7 -0
  172. package/dist/src/templates/pubkey/input.d.ts.map +1 -0
  173. package/dist/src/templates/pubkey/input.js +14 -0
  174. package/dist/src/templates/pubkey/output.d.ts +7 -0
  175. package/dist/src/templates/pubkey/output.d.ts.map +1 -0
  176. package/dist/src/templates/pubkey/output.js +15 -0
  177. package/dist/src/templates/pubkeyhash/index.d.ts +4 -0
  178. package/dist/src/templates/pubkeyhash/index.d.ts.map +1 -0
  179. package/dist/src/templates/pubkeyhash/index.js +8 -0
  180. package/dist/src/templates/pubkeyhash/input.d.ts +7 -0
  181. package/dist/src/templates/pubkeyhash/input.d.ts.map +1 -0
  182. package/dist/src/templates/pubkeyhash/input.js +16 -0
  183. package/dist/src/templates/pubkeyhash/output.d.ts +6 -0
  184. package/dist/src/templates/pubkeyhash/output.d.ts.map +1 -0
  185. package/dist/src/templates/pubkeyhash/output.js +20 -0
  186. package/dist/src/templates/scripthash/index.d.ts +4 -0
  187. package/dist/src/templates/scripthash/index.d.ts.map +1 -0
  188. package/dist/src/templates/scripthash/index.js +8 -0
  189. package/dist/src/templates/scripthash/input.d.ts +6 -0
  190. package/dist/src/templates/scripthash/input.d.ts.map +1 -0
  191. package/dist/src/templates/scripthash/input.js +43 -0
  192. package/dist/src/templates/scripthash/output.d.ts +6 -0
  193. package/dist/src/templates/scripthash/output.d.ts.map +1 -0
  194. package/dist/src/templates/scripthash/output.js +15 -0
  195. package/dist/src/templates/taproot/index.d.ts +4 -0
  196. package/dist/src/templates/taproot/index.d.ts.map +1 -0
  197. package/dist/src/templates/taproot/index.js +8 -0
  198. package/dist/src/templates/taproot/input.d.ts +6 -0
  199. package/dist/src/templates/taproot/input.d.ts.map +1 -0
  200. package/dist/src/templates/taproot/input.js +23 -0
  201. package/dist/src/templates/taproot/output.d.ts +6 -0
  202. package/dist/src/templates/taproot/output.d.ts.map +1 -0
  203. package/dist/src/templates/taproot/output.js +15 -0
  204. package/dist/src/templates/taprootnofn/index.d.ts +4 -0
  205. package/dist/src/templates/taprootnofn/index.d.ts.map +1 -0
  206. package/dist/src/templates/taprootnofn/index.js +8 -0
  207. package/dist/src/templates/taprootnofn/input.d.ts +7 -0
  208. package/dist/src/templates/taprootnofn/input.d.ts.map +1 -0
  209. package/dist/src/templates/taprootnofn/input.js +24 -0
  210. package/dist/src/templates/taprootnofn/output.d.ts +7 -0
  211. package/dist/src/templates/taprootnofn/output.d.ts.map +1 -0
  212. package/dist/src/templates/taprootnofn/output.js +28 -0
  213. package/dist/src/templates/witnesscommitment/index.d.ts +3 -0
  214. package/dist/src/templates/witnesscommitment/index.d.ts.map +1 -0
  215. package/dist/src/templates/witnesscommitment/index.js +6 -0
  216. package/dist/src/templates/witnesscommitment/output.d.ts +8 -0
  217. package/dist/src/templates/witnesscommitment/output.d.ts.map +1 -0
  218. package/dist/src/templates/witnesscommitment/output.js +31 -0
  219. package/dist/src/templates/witnesspubkeyhash/index.d.ts +4 -0
  220. package/dist/src/templates/witnesspubkeyhash/index.d.ts.map +1 -0
  221. package/dist/src/templates/witnesspubkeyhash/index.js +8 -0
  222. package/dist/src/templates/witnesspubkeyhash/input.d.ts +7 -0
  223. package/dist/src/templates/witnesspubkeyhash/input.d.ts.map +1 -0
  224. package/dist/src/templates/witnesspubkeyhash/input.js +19 -0
  225. package/dist/src/templates/witnesspubkeyhash/output.d.ts +6 -0
  226. package/dist/src/templates/witnesspubkeyhash/output.d.ts.map +1 -0
  227. package/dist/src/templates/witnesspubkeyhash/output.js +15 -0
  228. package/dist/src/templates/witnessscripthash/index.d.ts +4 -0
  229. package/dist/src/templates/witnessscripthash/index.d.ts.map +1 -0
  230. package/dist/src/templates/witnessscripthash/index.js +8 -0
  231. package/dist/src/templates/witnessscripthash/input.d.ts +6 -0
  232. package/dist/src/templates/witnessscripthash/input.d.ts.map +1 -0
  233. package/dist/src/templates/witnessscripthash/input.js +35 -0
  234. package/dist/src/templates/witnessscripthash/output.d.ts +6 -0
  235. package/dist/src/templates/witnessscripthash/output.d.ts.map +1 -0
  236. package/dist/src/templates/witnessscripthash/output.js +15 -0
  237. package/dist/src/testutil/index.d.ts +3 -0
  238. package/dist/src/testutil/index.d.ts.map +1 -0
  239. package/dist/src/testutil/index.js +15 -0
  240. package/dist/src/testutil/keys.d.ts +10 -0
  241. package/dist/src/testutil/keys.d.ts.map +1 -0
  242. package/dist/src/testutil/keys.js +40 -0
  243. package/dist/src/testutil/mock.d.ts +21 -0
  244. package/dist/src/testutil/mock.d.ts.map +1 -0
  245. package/dist/src/testutil/mock.js +86 -0
  246. package/dist/src/transaction_builder.d.ts +47 -0
  247. package/dist/src/transaction_builder.d.ts.map +1 -0
  248. package/dist/src/transaction_builder.js +1084 -0
  249. package/package.json +87 -0
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.types = exports.witness = exports.output = exports.input = void 0;
4
+ const _1 = require("./");
5
+ const multisig = require("./templates/multisig");
6
+ const nullData = require("./templates/nulldata");
7
+ const pubKey = require("./templates/pubkey");
8
+ const pubKeyHash = require("./templates/pubkeyhash");
9
+ const scriptHash = require("./templates/scripthash");
10
+ const taproot = require("./templates/taproot");
11
+ const taprootnofn = require("./templates/taprootnofn");
12
+ const witnessCommitment = require("./templates/witnesscommitment");
13
+ const witnessPubKeyHash = require("./templates/witnesspubkeyhash");
14
+ const witnessScriptHash = require("./templates/witnessscripthash");
15
+ const types = {
16
+ P2MS: 'multisig',
17
+ NONSTANDARD: 'nonstandard',
18
+ NULLDATA: 'nulldata',
19
+ P2PK: 'pubkey',
20
+ P2PKH: 'pubkeyhash',
21
+ P2SH: 'scripthash',
22
+ P2WPKH: 'witnesspubkeyhash',
23
+ P2WSH: 'witnessscripthash',
24
+ P2TR: 'taproot',
25
+ P2TR_NS: 'taprootnofn',
26
+ WITNESS_COMMITMENT: 'witnesscommitment',
27
+ };
28
+ exports.types = types;
29
+ function classifyOutput(script) {
30
+ if (witnessPubKeyHash.output.check(script))
31
+ return types.P2WPKH;
32
+ if (witnessScriptHash.output.check(script))
33
+ return types.P2WSH;
34
+ if (taproot.output.check(script))
35
+ return types.P2TR;
36
+ if (pubKeyHash.output.check(script))
37
+ return types.P2PKH;
38
+ if (scriptHash.output.check(script))
39
+ return types.P2SH;
40
+ // XXX: optimization, below functions bscript.decompile before use
41
+ const chunks = _1.script.decompile(script);
42
+ if (!chunks)
43
+ throw new TypeError('Invalid script');
44
+ if (taprootnofn.output.check(chunks))
45
+ return types.P2TR_NS;
46
+ if (multisig.output.check(chunks))
47
+ return types.P2MS;
48
+ if (pubKey.output.check(chunks))
49
+ return types.P2PK;
50
+ if (witnessCommitment.output.check(chunks))
51
+ return types.WITNESS_COMMITMENT;
52
+ if (nullData.output.check(chunks))
53
+ return types.NULLDATA;
54
+ return types.NONSTANDARD;
55
+ }
56
+ exports.output = classifyOutput;
57
+ function classifyInput(script, allowIncomplete) {
58
+ // XXX: optimization, below functions bscript.decompile before use
59
+ const chunks = _1.script.decompile(script);
60
+ if (!chunks)
61
+ throw new TypeError('Invalid script');
62
+ if (pubKeyHash.input.check(chunks))
63
+ return types.P2PKH;
64
+ if (scriptHash.input.check(chunks, allowIncomplete))
65
+ return types.P2SH;
66
+ if (taprootnofn.input.check(chunks, allowIncomplete))
67
+ return types.P2TR_NS;
68
+ if (multisig.input.check(chunks, allowIncomplete))
69
+ return types.P2MS;
70
+ if (pubKey.input.check(chunks))
71
+ return types.P2PK;
72
+ return types.NONSTANDARD;
73
+ }
74
+ exports.input = classifyInput;
75
+ function classifyWitness(script, allowIncomplete) {
76
+ // XXX: optimization, below functions bscript.decompile before use
77
+ const chunks = _1.script.decompile(script);
78
+ if (!chunks)
79
+ throw new TypeError('Invalid script');
80
+ if (witnessPubKeyHash.input.check(chunks))
81
+ return types.P2WPKH;
82
+ if (witnessScriptHash.input.check(chunks, allowIncomplete))
83
+ return types.P2WSH;
84
+ if (taproot.input.check(chunks))
85
+ return types.P2TR;
86
+ return types.NONSTANDARD;
87
+ }
88
+ exports.witness = classifyWitness;
89
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3NpZnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xhc3NpZnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUJBQXVDO0FBQ3ZDLGlEQUFpRDtBQUNqRCxpREFBaUQ7QUFDakQsNkNBQTZDO0FBQzdDLHFEQUFxRDtBQUNyRCxxREFBcUQ7QUFDckQsK0NBQStDO0FBQy9DLHVEQUF1RDtBQUN2RCxtRUFBbUU7QUFDbkUsbUVBQW1FO0FBQ25FLG1FQUFtRTtBQUVuRSxNQUFNLEtBQUssR0FBRztJQUNaLElBQUksRUFBRSxVQUFvQjtJQUMxQixXQUFXLEVBQUUsYUFBdUI7SUFDcEMsUUFBUSxFQUFFLFVBQW9CO0lBQzlCLElBQUksRUFBRSxRQUFrQjtJQUN4QixLQUFLLEVBQUUsWUFBc0I7SUFDN0IsSUFBSSxFQUFFLFlBQXNCO0lBQzVCLE1BQU0sRUFBRSxtQkFBNkI7SUFDckMsS0FBSyxFQUFFLG1CQUE2QjtJQUNwQyxJQUFJLEVBQUUsU0FBbUI7SUFDekIsT0FBTyxFQUFFLGFBQXVCO0lBQ2hDLGtCQUFrQixFQUFFLG1CQUE2QjtDQUNsRCxDQUFDO0FBZ0RxRixzQkFBSztBQTlDNU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LCBhbGxvd0luY29tcGxldGU/OiBib29sZWFuKTogc3RyaW5nIHtcbiAgLy8gWFhYOiBvcHRpbWl6YXRpb24sIGJlbG93IGZ1bmN0aW9ucyBic2NyaXB0LmRlY29tcGlsZSBiZWZvcmUgdXNlXG4gIGNvbnN0IGNodW5rcyA9IGJzY3JpcHQuZGVjb21waWxlKHNjcmlwdCk7XG4gIGlmICghY2h1bmtzKSB0aHJvdyBuZXcgVHlwZUVycm9yKCdJbnZhbGlkIHNjcmlwdCcpO1xuXG4gIGlmICh3aXRuZXNzUHViS2V5SGFzaC5pbnB1dC5jaGVjayhjaHVua3MpKSByZXR1cm4gdHlwZXMuUDJXUEtIO1xuICBpZiAod2l0bmVzc1NjcmlwdEhhc2guaW5wdXQuY2hlY2soY2h1bmtzIGFzIEJ1ZmZlcltdLCBhbGxvd0luY29tcGxldGUpKSByZXR1cm4gdHlwZXMuUDJXU0g7XG4gIGlmICh0YXByb290LmlucHV0LmNoZWNrKGNodW5rcyBhcyBCdWZmZXJbXSkpIHJldHVybiB0eXBlcy5QMlRSO1xuXG4gIHJldHVybiB0eXBlcy5OT05TVEFOREFSRDtcbn1cblxuZXhwb3J0IHsgY2xhc3NpZnlJbnB1dCBhcyBpbnB1dCwgY2xhc3NpZnlPdXRwdXQgYXMgb3V0cHV0LCBjbGFzc2lmeVdpdG5lc3MgYXMgd2l0bmVzcywgdHlwZXMgfTtcbiJdfQ==
@@ -0,0 +1,13 @@
1
+ export * from 'bitcoinjs-lib';
2
+ export * as bitgo from './bitgo';
3
+ export * as address from './address';
4
+ export * as addressFormat from './addressFormat';
5
+ export * as classify from './classify';
6
+ export * as taproot from './taproot';
7
+ export * as testutil from './testutil';
8
+ export * from './noble_ecc';
9
+ export * as p2trPayments from './payments';
10
+ export { networks, Network, NetworkName, getNetworkList, isValidNetwork, getNetworkName, getMainnet, getTestnet, isMainnet, isTestnet, supportsTaproot, supportsSegwit, } from './networks';
11
+ export { TransactionBuilder } from './transaction_builder';
12
+ export { Network as BitcoinJSNetwork } from 'bitcoinjs-lib';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAEvC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAEvC,cAAc,aAAa,CAAC;AAE5B,OAAO,KAAK,YAAY,MAAM,YAAY,CAAC;AAE3C,OAAO,EACL,QAAQ,EACR,OAAO,EACP,WAAW,EACX,cAAc,EACd,cAAc,EACd,cAAc,EACd,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,eAAe,EACf,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.TransactionBuilder = exports.supportsSegwit = exports.supportsTaproot = exports.isTestnet = exports.isMainnet = exports.getTestnet = exports.getMainnet = exports.getNetworkName = exports.isValidNetwork = exports.getNetworkList = exports.networks = exports.p2trPayments = exports.testutil = exports.taproot = exports.classify = exports.addressFormat = exports.address = exports.bitgo = void 0;
14
+ __exportStar(require("bitcoinjs-lib"), exports);
15
+ exports.bitgo = require("./bitgo");
16
+ exports.address = require("./address");
17
+ exports.addressFormat = require("./addressFormat");
18
+ exports.classify = require("./classify");
19
+ exports.taproot = require("./taproot");
20
+ exports.testutil = require("./testutil");
21
+ __exportStar(require("./noble_ecc"), exports);
22
+ exports.p2trPayments = require("./payments");
23
+ var networks_1 = require("./networks");
24
+ Object.defineProperty(exports, "networks", { enumerable: true, get: function () { return networks_1.networks; } });
25
+ Object.defineProperty(exports, "getNetworkList", { enumerable: true, get: function () { return networks_1.getNetworkList; } });
26
+ Object.defineProperty(exports, "isValidNetwork", { enumerable: true, get: function () { return networks_1.isValidNetwork; } });
27
+ Object.defineProperty(exports, "getNetworkName", { enumerable: true, get: function () { return networks_1.getNetworkName; } });
28
+ Object.defineProperty(exports, "getMainnet", { enumerable: true, get: function () { return networks_1.getMainnet; } });
29
+ Object.defineProperty(exports, "getTestnet", { enumerable: true, get: function () { return networks_1.getTestnet; } });
30
+ Object.defineProperty(exports, "isMainnet", { enumerable: true, get: function () { return networks_1.isMainnet; } });
31
+ Object.defineProperty(exports, "isTestnet", { enumerable: true, get: function () { return networks_1.isTestnet; } });
32
+ Object.defineProperty(exports, "supportsTaproot", { enumerable: true, get: function () { return networks_1.supportsTaproot; } });
33
+ Object.defineProperty(exports, "supportsSegwit", { enumerable: true, get: function () { return networks_1.supportsSegwit; } });
34
+ var transaction_builder_1 = require("./transaction_builder");
35
+ Object.defineProperty(exports, "TransactionBuilder", { enumerable: true, get: function () { return transaction_builder_1.TransactionBuilder; } });
36
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNl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0ICogYXMgcDJ0clBheW1lbnRzIGZyb20gJy4vcGF5bWVudHMnO1xuXG5leHBvcnQge1xuICBuZXR3b3JrcyxcbiAgTmV0d29yayxcbiAgTmV0d29ya05hbWUsXG4gIGdldE5ldHdvcmtMaXN0LFxuICBpc1ZhbGlkTmV0d29yayxcbiAgZ2V0TmV0d29ya05hbWUsXG4gIGdldE1haW5uZXQsXG4gIGdldFRlc3RuZXQsXG4gIGlzTWFpbm5ldCxcbiAgaXNUZXN0bmV0LFxuICBzdXBwb3J0c1RhcHJvb3QsXG4gIHN1cHBvcnRzU2Vnd2l0LFxufSBmcm9tICcuL25ldHdvcmtzJztcblxuZXhwb3J0IHsgVHJhbnNhY3Rpb25CdWlsZGVyIH0gZnJvbSAnLi90cmFuc2FjdGlvbl9idWlsZGVyJztcblxuZXhwb3J0IHsgTmV0d29yayBhcyBCaXRjb2luSlNOZXR3b3JrIH0gZnJvbSAnYml0Y29pbmpzLWxpYic7XG4iXX0=
@@ -0,0 +1,119 @@
1
+ export declare type NetworkName = 'bitcoin' | 'testnet' | 'bitcoincash' | 'bitcoincashTestnet' | 'ecash' | 'ecashTest' | 'bitcoingold' | 'bitcoingoldTestnet' | 'bitcoinsv' | 'bitcoinsvTestnet' | 'dash' | 'dashTest' | 'dogecoin' | 'dogecoinTest' | 'litecoin' | 'litecoinTest' | 'zcash' | 'zcashTest' | 'bbc';
2
+ export declare type Network = {
3
+ messagePrefix: string;
4
+ pubKeyHash: number;
5
+ scriptHash: number;
6
+ wif: number;
7
+ bip32: {
8
+ public: number;
9
+ private: number;
10
+ };
11
+ cashAddr?: {
12
+ prefix: string;
13
+ pubKeyHash: number;
14
+ scriptHash: number;
15
+ };
16
+ bech32?: string;
17
+ forkId?: number;
18
+ /**
19
+ * @deprecated
20
+ */
21
+ coin: string;
22
+ };
23
+ export declare const networks: Record<NetworkName, Network>;
24
+ /**
25
+ * @returns {Network[]} all known networks as array
26
+ */
27
+ export declare function getNetworkList(): Network[];
28
+ /**
29
+ * @param {Network} network
30
+ * @returns {NetworkName} the name of the network. Returns undefined if network is not a value
31
+ * of `networks`
32
+ */
33
+ export declare function getNetworkName(network: Network): NetworkName | undefined;
34
+ /**
35
+ * @param {Network} network
36
+ * @returns {Object} the mainnet corresponding to a testnet
37
+ */
38
+ export declare function getMainnet(network: Network): Network;
39
+ /**
40
+ * @param {Network} network
41
+ * @returns {boolean} true iff network is a mainnet
42
+ */
43
+ export declare function isMainnet(network: Network): boolean;
44
+ /**
45
+ * @param {Network} network
46
+ * @returns {boolean} true iff network is a testnet
47
+ */
48
+ export declare function isTestnet(network: Network): boolean;
49
+ /**
50
+ *
51
+ * @param {Network} network
52
+ * @param {Network} otherNetwork
53
+ * @returns {boolean} true iff both networks are for the same coin
54
+ */
55
+ export declare function isSameCoin(network: Network, otherNetwork: Network): boolean;
56
+ /**
57
+ * @param {Network} network
58
+ * @returns {Network|undefined} - The testnet corresponding to a mainnet.
59
+ * Returns undefined if a network has no testnet.
60
+ */
61
+ export declare function getTestnet(network: Network): Network | undefined;
62
+ /**
63
+ * @param {Network} network
64
+ * @returns {boolean} true iff network bitcoin or testnet
65
+ */
66
+ export declare function isBitcoin(network: Network): boolean;
67
+ /**
68
+ * @param {Network} network
69
+ * @returns {boolean} true iff network is bitcoincash or bitcoincashTestnet
70
+ */
71
+ export declare function isBitcoinCash(network: Network): boolean;
72
+ /**
73
+ * @param {Network} network
74
+ * @returns {boolean} true iff network is ecash or ecashTest
75
+ */
76
+ export declare function isECash(network: Network): boolean;
77
+ /**
78
+ * @param {Network} network
79
+ * @returns {boolean} true iff network is bitcoingold
80
+ */
81
+ export declare function isBitcoinGold(network: Network): boolean;
82
+ /**
83
+ * @param {Network} network
84
+ * @returns {boolean} true iff network is bitcoinsv or bitcoinsvTestnet
85
+ */
86
+ export declare function isBitcoinSV(network: Network): boolean;
87
+ /**
88
+ * @param {Network} network
89
+ * @returns {boolean} true iff network is dash or dashTest
90
+ */
91
+ export declare function isDash(network: Network): boolean;
92
+ /**
93
+ * @param {Network} network
94
+ * @returns {boolean} true iff network is dogecoin or dogecoinTest
95
+ */
96
+ export declare function isDogecoin(network: Network): boolean;
97
+ /**
98
+ * @param {Network} network
99
+ * @returns {boolean} true iff network is litecoin or litecoinTest
100
+ */
101
+ export declare function isLitecoin(network: Network): boolean;
102
+ /**
103
+ * @param {Network} network
104
+ * @returns {boolean} true iff network is zcash or zcashTest
105
+ */
106
+ export declare function isZcash(network: Network): boolean;
107
+ /**
108
+ * @param {unknown} network
109
+ * @returns {boolean} returns true iff network is any of the network stated in the argument
110
+ */
111
+ export declare function isValidNetwork(network: unknown): network is Network;
112
+ export declare function supportsSegwit(network: Network): boolean;
113
+ export declare function supportsTaproot(network: Network): boolean;
114
+ /**
115
+ * @param {Network} network
116
+ * @returns {boolean} true iff network is dash or dashTest
117
+ */
118
+ export declare function isBbc(network: Network): boolean;
119
+ //# sourceMappingURL=networks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networks.d.ts","sourceRoot":"","sources":["../../src/networks.ts"],"names":[],"mappings":"AAuCA,oBAAY,WAAW,GACnB,SAAS,GACT,SAAS,GACT,aAAa,GACb,oBAAoB,GACpB,OAAO,GACP,WAAW,GACX,aAAa,GACb,oBAAoB,GACpB,WAAW,GACX,kBAAkB,GAClB,MAAM,GACN,UAAU,GACV,UAAU,GACV,cAAc,GACd,UAAU,GACV,cAAc,GACd,OAAO,GACP,WAAW,GAEX,KAAK,CAAC;AAEV,oBAAY,OAAO,GAAG;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EA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