beignet 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +4 -1
  2. package/dist/electrum/index.js +4 -4
  3. package/dist/electrum/index.js.map +1 -1
  4. package/dist/types/electrum/index.d.ts +3 -3
  5. package/dist/types/electrum.js +7 -1
  6. package/dist/types/electrum.js.map +1 -1
  7. package/dist/types/types/electrum.d.ts +6 -1
  8. package/dist/types/types/wallet.d.ts +3 -3
  9. package/dist/types/wallet/index.d.ts +1 -1
  10. package/dist/wallet/index.js.map +1 -1
  11. package/docs/html/assets/search.js +1 -1
  12. package/docs/html/classes/Electrum.html +46 -44
  13. package/docs/html/classes/Transaction.html +26 -24
  14. package/docs/html/classes/Wallet.html +222 -128
  15. package/docs/html/enums/EAddressType.html +6 -4
  16. package/docs/html/enums/EAvailableNetworks.html +10 -8
  17. package/docs/html/enums/EBoostType.html +5 -3
  18. package/docs/html/enums/EElectrumNetworks.html +229 -0
  19. package/docs/html/enums/EFeeId.html +8 -6
  20. package/docs/html/enums/EPaymentType.html +5 -3
  21. package/docs/html/enums/EProtocol.html +5 -3
  22. package/docs/html/enums/EUnit.html +6 -4
  23. package/docs/html/functions/availableNetworks.html +3 -1
  24. package/docs/html/functions/constructByteCountParam.html +3 -1
  25. package/docs/html/functions/decodeOpReturnMessage.html +3 -1
  26. package/docs/html/functions/decodeRawTransaction.html +3 -1
  27. package/docs/html/functions/err.html +3 -1
  28. package/docs/html/functions/formatKeyDerivationPath.html +3 -1
  29. package/docs/html/functions/formatPeerData.html +3 -1
  30. package/docs/html/functions/generateMnemonic.html +3 -1
  31. package/docs/html/functions/generateWalletId.html +3 -1
  32. package/docs/html/functions/getAddressFromScriptPubKey.html +3 -1
  33. package/docs/html/functions/getAddressTypeFromPath.html +3 -1
  34. package/docs/html/functions/getByteCount.html +7 -3
  35. package/docs/html/functions/getDataFallback.html +3 -1
  36. package/docs/html/functions/getDefaultPort.html +3 -1
  37. package/docs/html/functions/getDefaultWalletData.html +3 -1
  38. package/docs/html/functions/getDefaultWalletDataKeys.html +3 -1
  39. package/docs/html/functions/getExchangeRates.html +3 -1
  40. package/docs/html/functions/getHighestUsedIndexFromTxHashes.html +3 -1
  41. package/docs/html/functions/getKeyDerivationPath.html +3 -1
  42. package/docs/html/functions/getKeyDerivationPathObject.html +3 -1
  43. package/docs/html/functions/getKeyDerivationPathString.html +3 -1
  44. package/docs/html/functions/getKeyValue.html +3 -1
  45. package/docs/html/functions/getPeers.html +3 -1
  46. package/docs/html/functions/getProtocolForPort.html +3 -1
  47. package/docs/html/functions/getScriptHash.html +3 -1
  48. package/docs/html/functions/getSeed.html +3 -1
  49. package/docs/html/functions/getSeedHash.html +3 -1
  50. package/docs/html/functions/getSha256.html +3 -1
  51. package/docs/html/functions/getStorageKeyValues.html +3 -1
  52. package/docs/html/functions/getTxFee.html +3 -1
  53. package/docs/html/functions/getWalletDataStorageKey.html +3 -1
  54. package/docs/html/functions/isValidBech32mEncodedString.html +3 -1
  55. package/docs/html/functions/objectKeys-1.html +3 -1
  56. package/docs/html/functions/objectsMatch.html +3 -1
  57. package/docs/html/functions/ok.html +3 -1
  58. package/docs/html/functions/parseOnChainPaymentRequest.html +3 -1
  59. package/docs/html/functions/reduceValue.html +3 -1
  60. package/docs/html/functions/removeDustOutputs.html +3 -1
  61. package/docs/html/functions/setReplaceByFee.html +3 -1
  62. package/docs/html/functions/shuffleArray.html +3 -1
  63. package/docs/html/functions/validateAddress.html +3 -1
  64. package/docs/html/functions/validateMnemonic.html +3 -1
  65. package/docs/html/functions/validateTransaction.html +3 -1
  66. package/docs/html/index.html +4 -0
  67. package/docs/html/interfaces/IAddInput.html +6 -4
  68. package/docs/html/interfaces/IAddress.html +8 -6
  69. package/docs/html/interfaces/IAddressData.html +6 -4
  70. package/docs/html/interfaces/IAddressType.html +3 -1
  71. package/docs/html/interfaces/IAddressTypeData.html +9 -7
  72. package/docs/html/interfaces/IAddresses.html +3 -1
  73. package/docs/html/interfaces/IBoostedTransaction.html +7 -5
  74. package/docs/html/interfaces/IBoostedTransactions.html +3 -1
  75. package/docs/html/interfaces/ICreateTransaction.html +5 -3
  76. package/docs/html/interfaces/ICustomGetAddress.html +9 -7
  77. package/docs/html/interfaces/ICustomGetScriptHash.html +8 -6
  78. package/docs/html/interfaces/IElectrumGetAddressBalanceRes.html +6 -4
  79. package/docs/html/interfaces/IExchangeRates.html +3 -1
  80. package/docs/html/interfaces/IFormattedPeerData.html +8 -6
  81. package/docs/html/interfaces/IFormattedTransaction.html +22 -20
  82. package/docs/html/interfaces/IFormattedTransactions.html +3 -1
  83. package/docs/html/interfaces/IGenerateAddresses.html +17 -8
  84. package/docs/html/interfaces/IGenerateAddressesResponse.html +5 -3
  85. package/docs/html/interfaces/IGetAddress.html +6 -4
  86. package/docs/html/interfaces/IGetAddressBalanceRes.html +5 -3
  87. package/docs/html/interfaces/IGetAddressByPath.html +5 -3
  88. package/docs/html/interfaces/IGetAddressHistoryResponse.html +10 -8
  89. package/docs/html/interfaces/IGetAddressResponse.html +6 -4
  90. package/docs/html/interfaces/IGetAddressScriptHashBalances.html +247 -0
  91. package/docs/html/interfaces/IGetAddressScriptHashesHistoryResponse.html +8 -6
  92. package/docs/html/interfaces/IGetDerivationPath.html +9 -7
  93. package/docs/html/interfaces/IGetFeeEstimatesResponse.html +7 -5
  94. package/docs/html/interfaces/IGetHeaderResponse.html +8 -6
  95. package/docs/html/interfaces/IGetNextAvailableAddressResponse.html +7 -5
  96. package/docs/html/interfaces/IGetTransactions.html +8 -6
  97. package/docs/html/interfaces/IGetTransactionsFromInputs.html +8 -6
  98. package/docs/html/interfaces/IGetUtxosResponse.html +5 -3
  99. package/docs/html/interfaces/IHeader.html +6 -4
  100. package/docs/html/interfaces/IIndexes.html +7 -5
  101. package/docs/html/interfaces/IKeyDerivationPath.html +8 -6
  102. package/docs/html/interfaces/IKeyDerivationPathData.html +5 -3
  103. package/docs/html/interfaces/INewBlock.html +5 -3
  104. package/docs/html/interfaces/IOnchainFees.html +8 -6
  105. package/docs/html/interfaces/IOutput.html +6 -4
  106. package/docs/html/interfaces/IPeerData.html +6 -4
  107. package/docs/html/interfaces/IRbfData.html +9 -7
  108. package/docs/html/interfaces/ISend.html +5 -3
  109. package/docs/html/interfaces/ISendTransaction.html +19 -17
  110. package/docs/html/interfaces/ISendTx.html +6 -4
  111. package/docs/html/interfaces/ISetupTransaction.html +7 -5
  112. package/docs/html/interfaces/ISubscribeToAddress.html +7 -5
  113. package/docs/html/interfaces/ISubscribeToHeader.html +7 -5
  114. package/docs/html/interfaces/ITargets.html +7 -5
  115. package/docs/html/interfaces/ITransaction.html +8 -6
  116. package/docs/html/interfaces/ITxHash.html +4 -2
  117. package/docs/html/interfaces/ITxHashes.html +6 -4
  118. package/docs/html/interfaces/IUtxo.html +20 -18
  119. package/docs/html/interfaces/IVin.html +8 -6
  120. package/docs/html/interfaces/IVout.html +6 -4
  121. package/docs/html/interfaces/IWallet.html +18 -16
  122. package/docs/html/interfaces/IWalletData.html +22 -20
  123. package/docs/html/types/ElectrumConnectionPubSub.html +3 -1
  124. package/docs/html/types/ElectrumConnectionSubscription.html +4 -2
  125. package/docs/html/types/InputData.html +3 -1
  126. package/docs/html/types/ObjectKeys.html +3 -1
  127. package/docs/html/types/Result.html +3 -1
  128. package/docs/html/types/TAddressIndexInfo.html +3 -1
  129. package/docs/html/types/TAddressLabel.html +3 -1
  130. package/docs/html/types/TAddressType.html +3 -1
  131. package/docs/html/types/TAddressTypeContent.html +3 -1
  132. package/docs/html/types/TAddressTypes.html +3 -1
  133. package/docs/html/types/TAvailableNetworks.html +3 -1
  134. package/docs/html/types/TConnectToElectrumRes.html +3 -1
  135. package/docs/html/types/TDecodeRawTx.html +3 -1
  136. package/docs/html/types/TElectrumNetworks.html +3 -1
  137. package/docs/html/types/TGetAddressHistory.html +3 -1
  138. package/docs/html/types/TGetByteCountInput.html +3 -1
  139. package/docs/html/types/TGetByteCountInputs.html +3 -1
  140. package/docs/html/types/TGetByteCountOutput.html +3 -1
  141. package/docs/html/types/TGetByteCountOutputs.html +3 -1
  142. package/docs/html/types/TGetData.html +3 -1
  143. package/docs/html/types/TGetTotalFeeObj.html +3 -1
  144. package/docs/html/types/TKeyDerivationAccount.html +3 -1
  145. package/docs/html/types/TKeyDerivationChange.html +3 -1
  146. package/docs/html/types/TKeyDerivationCoinType.html +3 -1
  147. package/docs/html/types/TKeyDerivationIndex.html +3 -1
  148. package/docs/html/types/TKeyDerivationPurpose.html +3 -1
  149. package/docs/html/types/TMessageDataMap.html +3 -1
  150. package/docs/html/types/TMessageKeys.html +3 -1
  151. package/docs/html/types/TOnMessage.html +3 -1
  152. package/docs/html/types/TProcessUnconfirmedTransactions.html +3 -1
  153. package/docs/html/types/TProtocol.html +3 -1
  154. package/docs/html/types/TServer.html +3 -1
  155. package/docs/html/types/TSetData.html +3 -1
  156. package/docs/html/types/TSetupTransactionResponse.html +3 -1
  157. package/docs/html/types/TStorage.html +3 -1
  158. package/docs/html/types/TSubscribedReceive.html +3 -1
  159. package/docs/html/types/TTransactionMessage.html +3 -1
  160. package/docs/html/types/TTxResponse.html +3 -1
  161. package/docs/html/types/TTxResult.html +3 -1
  162. package/docs/html/types/TUnspentAddressScriptHashData.html +3 -1
  163. package/docs/html/types/TWalletDataKeys.html +3 -1
  164. package/docs/html/variables/defaultElectrumPorts.html +3 -1
  165. package/docs/html/variables/electrumConnection.html +3 -1
  166. package/docs/html/variables/mostUsedExchangeTickers.html +3 -1
  167. package/docs/markdown/README.md +154 -151
  168. package/docs/markdown/classes/Electrum.md +78 -78
  169. package/docs/markdown/classes/Transaction.md +54 -54
  170. package/docs/markdown/classes/Wallet.md +351 -245
  171. package/docs/markdown/enums/EAddressType.md +3 -3
  172. package/docs/markdown/enums/EAvailableNetworks.md +7 -7
  173. package/docs/markdown/enums/EBoostType.md +2 -2
  174. package/docs/markdown/enums/EElectrumNetworks.md +41 -0
  175. package/docs/markdown/enums/EFeeId.md +5 -5
  176. package/docs/markdown/enums/EPaymentType.md +2 -2
  177. package/docs/markdown/enums/EProtocol.md +2 -2
  178. package/docs/markdown/enums/EUnit.md +3 -3
  179. package/docs/markdown/interfaces/IAddInput.md +3 -3
  180. package/docs/markdown/interfaces/IAddress.md +5 -5
  181. package/docs/markdown/interfaces/IAddressData.md +3 -3
  182. package/docs/markdown/interfaces/IAddressTypeData.md +6 -6
  183. package/docs/markdown/interfaces/IBoostedTransaction.md +4 -4
  184. package/docs/markdown/interfaces/ICreateTransaction.md +2 -2
  185. package/docs/markdown/interfaces/ICustomGetAddress.md +4 -4
  186. package/docs/markdown/interfaces/ICustomGetScriptHash.md +3 -3
  187. package/docs/markdown/interfaces/IElectrumGetAddressBalanceRes.md +3 -3
  188. package/docs/markdown/interfaces/IExchangeRates.md +1 -1
  189. package/docs/markdown/interfaces/IFormattedPeerData.md +5 -5
  190. package/docs/markdown/interfaces/IFormattedTransaction.md +19 -19
  191. package/docs/markdown/interfaces/IGenerateAddresses.md +17 -6
  192. package/docs/markdown/interfaces/IGenerateAddressesResponse.md +2 -2
  193. package/docs/markdown/interfaces/IGetAddress.md +3 -3
  194. package/docs/markdown/interfaces/IGetAddressBalanceRes.md +2 -2
  195. package/docs/markdown/interfaces/IGetAddressByPath.md +2 -2
  196. package/docs/markdown/interfaces/IGetAddressHistoryResponse.md +7 -7
  197. package/docs/markdown/interfaces/IGetAddressResponse.md +3 -3
  198. package/docs/markdown/interfaces/IGetAddressScriptHashBalances.md +63 -0
  199. package/docs/markdown/interfaces/IGetAddressScriptHashesHistoryResponse.md +5 -5
  200. package/docs/markdown/interfaces/IGetDerivationPath.md +6 -6
  201. package/docs/markdown/interfaces/IGetFeeEstimatesResponse.md +4 -4
  202. package/docs/markdown/interfaces/IGetHeaderResponse.md +5 -5
  203. package/docs/markdown/interfaces/IGetNextAvailableAddressResponse.md +4 -4
  204. package/docs/markdown/interfaces/IGetTransactions.md +6 -6
  205. package/docs/markdown/interfaces/IGetTransactionsFromInputs.md +6 -6
  206. package/docs/markdown/interfaces/IGetUtxosResponse.md +2 -2
  207. package/docs/markdown/interfaces/IHeader.md +3 -3
  208. package/docs/markdown/interfaces/IIndexes.md +4 -4
  209. package/docs/markdown/interfaces/IKeyDerivationPath.md +5 -5
  210. package/docs/markdown/interfaces/IKeyDerivationPathData.md +2 -2
  211. package/docs/markdown/interfaces/INewBlock.md +2 -2
  212. package/docs/markdown/interfaces/IOnchainFees.md +5 -5
  213. package/docs/markdown/interfaces/IOutput.md +3 -3
  214. package/docs/markdown/interfaces/IPeerData.md +3 -3
  215. package/docs/markdown/interfaces/IRbfData.md +6 -6
  216. package/docs/markdown/interfaces/ISend.md +2 -2
  217. package/docs/markdown/interfaces/ISendTransaction.md +16 -16
  218. package/docs/markdown/interfaces/ISendTx.md +3 -3
  219. package/docs/markdown/interfaces/ISetupTransaction.md +4 -4
  220. package/docs/markdown/interfaces/ISubscribeToAddress.md +4 -4
  221. package/docs/markdown/interfaces/ISubscribeToHeader.md +4 -4
  222. package/docs/markdown/interfaces/ITargets.md +4 -4
  223. package/docs/markdown/interfaces/ITransaction.md +6 -6
  224. package/docs/markdown/interfaces/ITxHash.md +1 -1
  225. package/docs/markdown/interfaces/ITxHashes.md +3 -3
  226. package/docs/markdown/interfaces/IUtxo.md +16 -16
  227. package/docs/markdown/interfaces/IVin.md +5 -5
  228. package/docs/markdown/interfaces/IVout.md +3 -3
  229. package/docs/markdown/interfaces/IWallet.md +21 -21
  230. package/docs/markdown/interfaces/IWalletData.md +25 -25
  231. package/package.json +1 -1
  232. package/src/electrum/index.ts +8 -8
  233. package/src/types/electrum.ts +6 -2
  234. package/src/types/wallet.ts +3 -3
  235. package/src/wallet/index.ts +4 -4
@@ -7,7 +7,11 @@ import {
7
7
  } from './wallet';
8
8
 
9
9
  export type TElectrumNetworks = 'bitcoin' | 'bitcoinTestnet' | 'bitcoinRegtest';
10
-
10
+ export enum EElectrumNetworks {
11
+ bitcoin = 'bitcoin',
12
+ bitcoinTestnet = 'bitcoinTestnet',
13
+ bitcoinRegtest = 'bitcoinRegtest'
14
+ }
11
15
  export type TConnectToElectrumRes = string;
12
16
 
13
17
  export interface IElectrumGetAddressBalanceRes extends IGetAddressBalanceRes {
@@ -72,7 +76,7 @@ export interface IGetAddressScriptHashBalances {
72
76
  | string;
73
77
  id: number;
74
78
  method: string;
75
- network: TElectrumNetworks;
79
+ network: EElectrumNetworks;
76
80
  }
77
81
 
78
82
  export interface IGetAddressHistoryResponse extends TTxResult, IAddress {}
@@ -1,8 +1,8 @@
1
1
  import { Result } from '../utils';
2
2
  import {
3
+ EElectrumNetworks,
3
4
  IHeader,
4
5
  INewBlock,
5
- TElectrumNetworks,
6
6
  TServer,
7
7
  TTxResult
8
8
  } from './electrum';
@@ -234,12 +234,12 @@ export interface IGetAddress {
234
234
  export interface ICustomGetAddress {
235
235
  path: string;
236
236
  type: EAddressType;
237
- selectedNetwork?: TElectrumNetworks;
237
+ selectedNetwork: EElectrumNetworks;
238
238
  }
239
239
 
240
240
  export interface ICustomGetScriptHash {
241
241
  address: string;
242
- selectedNetwork?: TElectrumNetworks;
242
+ selectedNetwork: EElectrumNetworks;
243
243
  }
244
244
 
245
245
  export interface IGetAddressByPath {
@@ -2068,11 +2068,11 @@ export class Wallet {
2068
2068
 
2069
2069
  /**
2070
2070
  * Clears the UTXO array and balance from storage.
2071
- * @private
2071
+ * @public
2072
2072
  * @async
2073
2073
  * @returns {Promise<string>}
2074
2074
  */
2075
- private async clearUtxos(): Promise<string> {
2075
+ public async clearUtxos(): Promise<string> {
2076
2076
  this._data.balance = 0;
2077
2077
  this._data.utxos = [];
2078
2078
  await Promise.all([
@@ -2518,8 +2518,8 @@ export class Wallet {
2518
2518
  * Returns a fee object for the current transaction.
2519
2519
  * @param {number} [satsPerByte]
2520
2520
  * @param {string} [message]
2521
- * @param {Partial<ISendTransaction>} transaction
2522
- * @param {boolean} fundingLightning
2521
+ * @param {Partial<ISendTransaction>} [transaction]
2522
+ * @param {boolean} [fundingLightning]
2523
2523
  * @returns {Result<TGetTotalFeeObj>}
2524
2524
  */
2525
2525
  public getFeeInfo({