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.
- package/README.md +4 -1
- package/dist/electrum/index.js +4 -4
- package/dist/electrum/index.js.map +1 -1
- package/dist/types/electrum/index.d.ts +3 -3
- package/dist/types/electrum.js +7 -1
- package/dist/types/electrum.js.map +1 -1
- package/dist/types/types/electrum.d.ts +6 -1
- package/dist/types/types/wallet.d.ts +3 -3
- package/dist/types/wallet/index.d.ts +1 -1
- package/dist/wallet/index.js.map +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/Electrum.html +46 -44
- package/docs/html/classes/Transaction.html +26 -24
- package/docs/html/classes/Wallet.html +222 -128
- package/docs/html/enums/EAddressType.html +6 -4
- package/docs/html/enums/EAvailableNetworks.html +10 -8
- package/docs/html/enums/EBoostType.html +5 -3
- package/docs/html/enums/EElectrumNetworks.html +229 -0
- package/docs/html/enums/EFeeId.html +8 -6
- package/docs/html/enums/EPaymentType.html +5 -3
- package/docs/html/enums/EProtocol.html +5 -3
- package/docs/html/enums/EUnit.html +6 -4
- package/docs/html/functions/availableNetworks.html +3 -1
- package/docs/html/functions/constructByteCountParam.html +3 -1
- package/docs/html/functions/decodeOpReturnMessage.html +3 -1
- package/docs/html/functions/decodeRawTransaction.html +3 -1
- package/docs/html/functions/err.html +3 -1
- package/docs/html/functions/formatKeyDerivationPath.html +3 -1
- package/docs/html/functions/formatPeerData.html +3 -1
- package/docs/html/functions/generateMnemonic.html +3 -1
- package/docs/html/functions/generateWalletId.html +3 -1
- package/docs/html/functions/getAddressFromScriptPubKey.html +3 -1
- package/docs/html/functions/getAddressTypeFromPath.html +3 -1
- package/docs/html/functions/getByteCount.html +7 -3
- package/docs/html/functions/getDataFallback.html +3 -1
- package/docs/html/functions/getDefaultPort.html +3 -1
- package/docs/html/functions/getDefaultWalletData.html +3 -1
- package/docs/html/functions/getDefaultWalletDataKeys.html +3 -1
- package/docs/html/functions/getExchangeRates.html +3 -1
- package/docs/html/functions/getHighestUsedIndexFromTxHashes.html +3 -1
- package/docs/html/functions/getKeyDerivationPath.html +3 -1
- package/docs/html/functions/getKeyDerivationPathObject.html +3 -1
- package/docs/html/functions/getKeyDerivationPathString.html +3 -1
- package/docs/html/functions/getKeyValue.html +3 -1
- package/docs/html/functions/getPeers.html +3 -1
- package/docs/html/functions/getProtocolForPort.html +3 -1
- package/docs/html/functions/getScriptHash.html +3 -1
- package/docs/html/functions/getSeed.html +3 -1
- package/docs/html/functions/getSeedHash.html +3 -1
- package/docs/html/functions/getSha256.html +3 -1
- package/docs/html/functions/getStorageKeyValues.html +3 -1
- package/docs/html/functions/getTxFee.html +3 -1
- package/docs/html/functions/getWalletDataStorageKey.html +3 -1
- package/docs/html/functions/isValidBech32mEncodedString.html +3 -1
- package/docs/html/functions/objectKeys-1.html +3 -1
- package/docs/html/functions/objectsMatch.html +3 -1
- package/docs/html/functions/ok.html +3 -1
- package/docs/html/functions/parseOnChainPaymentRequest.html +3 -1
- package/docs/html/functions/reduceValue.html +3 -1
- package/docs/html/functions/removeDustOutputs.html +3 -1
- package/docs/html/functions/setReplaceByFee.html +3 -1
- package/docs/html/functions/shuffleArray.html +3 -1
- package/docs/html/functions/validateAddress.html +3 -1
- package/docs/html/functions/validateMnemonic.html +3 -1
- package/docs/html/functions/validateTransaction.html +3 -1
- package/docs/html/index.html +4 -0
- package/docs/html/interfaces/IAddInput.html +6 -4
- package/docs/html/interfaces/IAddress.html +8 -6
- package/docs/html/interfaces/IAddressData.html +6 -4
- package/docs/html/interfaces/IAddressType.html +3 -1
- package/docs/html/interfaces/IAddressTypeData.html +9 -7
- package/docs/html/interfaces/IAddresses.html +3 -1
- package/docs/html/interfaces/IBoostedTransaction.html +7 -5
- package/docs/html/interfaces/IBoostedTransactions.html +3 -1
- package/docs/html/interfaces/ICreateTransaction.html +5 -3
- package/docs/html/interfaces/ICustomGetAddress.html +9 -7
- package/docs/html/interfaces/ICustomGetScriptHash.html +8 -6
- package/docs/html/interfaces/IElectrumGetAddressBalanceRes.html +6 -4
- package/docs/html/interfaces/IExchangeRates.html +3 -1
- package/docs/html/interfaces/IFormattedPeerData.html +8 -6
- package/docs/html/interfaces/IFormattedTransaction.html +22 -20
- package/docs/html/interfaces/IFormattedTransactions.html +3 -1
- package/docs/html/interfaces/IGenerateAddresses.html +17 -8
- package/docs/html/interfaces/IGenerateAddressesResponse.html +5 -3
- package/docs/html/interfaces/IGetAddress.html +6 -4
- package/docs/html/interfaces/IGetAddressBalanceRes.html +5 -3
- package/docs/html/interfaces/IGetAddressByPath.html +5 -3
- package/docs/html/interfaces/IGetAddressHistoryResponse.html +10 -8
- package/docs/html/interfaces/IGetAddressResponse.html +6 -4
- package/docs/html/interfaces/IGetAddressScriptHashBalances.html +247 -0
- package/docs/html/interfaces/IGetAddressScriptHashesHistoryResponse.html +8 -6
- package/docs/html/interfaces/IGetDerivationPath.html +9 -7
- package/docs/html/interfaces/IGetFeeEstimatesResponse.html +7 -5
- package/docs/html/interfaces/IGetHeaderResponse.html +8 -6
- package/docs/html/interfaces/IGetNextAvailableAddressResponse.html +7 -5
- package/docs/html/interfaces/IGetTransactions.html +8 -6
- package/docs/html/interfaces/IGetTransactionsFromInputs.html +8 -6
- package/docs/html/interfaces/IGetUtxosResponse.html +5 -3
- package/docs/html/interfaces/IHeader.html +6 -4
- package/docs/html/interfaces/IIndexes.html +7 -5
- package/docs/html/interfaces/IKeyDerivationPath.html +8 -6
- package/docs/html/interfaces/IKeyDerivationPathData.html +5 -3
- package/docs/html/interfaces/INewBlock.html +5 -3
- package/docs/html/interfaces/IOnchainFees.html +8 -6
- package/docs/html/interfaces/IOutput.html +6 -4
- package/docs/html/interfaces/IPeerData.html +6 -4
- package/docs/html/interfaces/IRbfData.html +9 -7
- package/docs/html/interfaces/ISend.html +5 -3
- package/docs/html/interfaces/ISendTransaction.html +19 -17
- package/docs/html/interfaces/ISendTx.html +6 -4
- package/docs/html/interfaces/ISetupTransaction.html +7 -5
- package/docs/html/interfaces/ISubscribeToAddress.html +7 -5
- package/docs/html/interfaces/ISubscribeToHeader.html +7 -5
- package/docs/html/interfaces/ITargets.html +7 -5
- package/docs/html/interfaces/ITransaction.html +8 -6
- package/docs/html/interfaces/ITxHash.html +4 -2
- package/docs/html/interfaces/ITxHashes.html +6 -4
- package/docs/html/interfaces/IUtxo.html +20 -18
- package/docs/html/interfaces/IVin.html +8 -6
- package/docs/html/interfaces/IVout.html +6 -4
- package/docs/html/interfaces/IWallet.html +18 -16
- package/docs/html/interfaces/IWalletData.html +22 -20
- package/docs/html/types/ElectrumConnectionPubSub.html +3 -1
- package/docs/html/types/ElectrumConnectionSubscription.html +4 -2
- package/docs/html/types/InputData.html +3 -1
- package/docs/html/types/ObjectKeys.html +3 -1
- package/docs/html/types/Result.html +3 -1
- package/docs/html/types/TAddressIndexInfo.html +3 -1
- package/docs/html/types/TAddressLabel.html +3 -1
- package/docs/html/types/TAddressType.html +3 -1
- package/docs/html/types/TAddressTypeContent.html +3 -1
- package/docs/html/types/TAddressTypes.html +3 -1
- package/docs/html/types/TAvailableNetworks.html +3 -1
- package/docs/html/types/TConnectToElectrumRes.html +3 -1
- package/docs/html/types/TDecodeRawTx.html +3 -1
- package/docs/html/types/TElectrumNetworks.html +3 -1
- package/docs/html/types/TGetAddressHistory.html +3 -1
- package/docs/html/types/TGetByteCountInput.html +3 -1
- package/docs/html/types/TGetByteCountInputs.html +3 -1
- package/docs/html/types/TGetByteCountOutput.html +3 -1
- package/docs/html/types/TGetByteCountOutputs.html +3 -1
- package/docs/html/types/TGetData.html +3 -1
- package/docs/html/types/TGetTotalFeeObj.html +3 -1
- package/docs/html/types/TKeyDerivationAccount.html +3 -1
- package/docs/html/types/TKeyDerivationChange.html +3 -1
- package/docs/html/types/TKeyDerivationCoinType.html +3 -1
- package/docs/html/types/TKeyDerivationIndex.html +3 -1
- package/docs/html/types/TKeyDerivationPurpose.html +3 -1
- package/docs/html/types/TMessageDataMap.html +3 -1
- package/docs/html/types/TMessageKeys.html +3 -1
- package/docs/html/types/TOnMessage.html +3 -1
- package/docs/html/types/TProcessUnconfirmedTransactions.html +3 -1
- package/docs/html/types/TProtocol.html +3 -1
- package/docs/html/types/TServer.html +3 -1
- package/docs/html/types/TSetData.html +3 -1
- package/docs/html/types/TSetupTransactionResponse.html +3 -1
- package/docs/html/types/TStorage.html +3 -1
- package/docs/html/types/TSubscribedReceive.html +3 -1
- package/docs/html/types/TTransactionMessage.html +3 -1
- package/docs/html/types/TTxResponse.html +3 -1
- package/docs/html/types/TTxResult.html +3 -1
- package/docs/html/types/TUnspentAddressScriptHashData.html +3 -1
- package/docs/html/types/TWalletDataKeys.html +3 -1
- package/docs/html/variables/defaultElectrumPorts.html +3 -1
- package/docs/html/variables/electrumConnection.html +3 -1
- package/docs/html/variables/mostUsedExchangeTickers.html +3 -1
- package/docs/markdown/README.md +154 -151
- package/docs/markdown/classes/Electrum.md +78 -78
- package/docs/markdown/classes/Transaction.md +54 -54
- package/docs/markdown/classes/Wallet.md +351 -245
- package/docs/markdown/enums/EAddressType.md +3 -3
- package/docs/markdown/enums/EAvailableNetworks.md +7 -7
- package/docs/markdown/enums/EBoostType.md +2 -2
- package/docs/markdown/enums/EElectrumNetworks.md +41 -0
- package/docs/markdown/enums/EFeeId.md +5 -5
- package/docs/markdown/enums/EPaymentType.md +2 -2
- package/docs/markdown/enums/EProtocol.md +2 -2
- package/docs/markdown/enums/EUnit.md +3 -3
- package/docs/markdown/interfaces/IAddInput.md +3 -3
- package/docs/markdown/interfaces/IAddress.md +5 -5
- package/docs/markdown/interfaces/IAddressData.md +3 -3
- package/docs/markdown/interfaces/IAddressTypeData.md +6 -6
- package/docs/markdown/interfaces/IBoostedTransaction.md +4 -4
- package/docs/markdown/interfaces/ICreateTransaction.md +2 -2
- package/docs/markdown/interfaces/ICustomGetAddress.md +4 -4
- package/docs/markdown/interfaces/ICustomGetScriptHash.md +3 -3
- package/docs/markdown/interfaces/IElectrumGetAddressBalanceRes.md +3 -3
- package/docs/markdown/interfaces/IExchangeRates.md +1 -1
- package/docs/markdown/interfaces/IFormattedPeerData.md +5 -5
- package/docs/markdown/interfaces/IFormattedTransaction.md +19 -19
- package/docs/markdown/interfaces/IGenerateAddresses.md +17 -6
- package/docs/markdown/interfaces/IGenerateAddressesResponse.md +2 -2
- package/docs/markdown/interfaces/IGetAddress.md +3 -3
- package/docs/markdown/interfaces/IGetAddressBalanceRes.md +2 -2
- package/docs/markdown/interfaces/IGetAddressByPath.md +2 -2
- package/docs/markdown/interfaces/IGetAddressHistoryResponse.md +7 -7
- package/docs/markdown/interfaces/IGetAddressResponse.md +3 -3
- package/docs/markdown/interfaces/IGetAddressScriptHashBalances.md +63 -0
- package/docs/markdown/interfaces/IGetAddressScriptHashesHistoryResponse.md +5 -5
- package/docs/markdown/interfaces/IGetDerivationPath.md +6 -6
- package/docs/markdown/interfaces/IGetFeeEstimatesResponse.md +4 -4
- package/docs/markdown/interfaces/IGetHeaderResponse.md +5 -5
- package/docs/markdown/interfaces/IGetNextAvailableAddressResponse.md +4 -4
- package/docs/markdown/interfaces/IGetTransactions.md +6 -6
- package/docs/markdown/interfaces/IGetTransactionsFromInputs.md +6 -6
- package/docs/markdown/interfaces/IGetUtxosResponse.md +2 -2
- package/docs/markdown/interfaces/IHeader.md +3 -3
- package/docs/markdown/interfaces/IIndexes.md +4 -4
- package/docs/markdown/interfaces/IKeyDerivationPath.md +5 -5
- package/docs/markdown/interfaces/IKeyDerivationPathData.md +2 -2
- package/docs/markdown/interfaces/INewBlock.md +2 -2
- package/docs/markdown/interfaces/IOnchainFees.md +5 -5
- package/docs/markdown/interfaces/IOutput.md +3 -3
- package/docs/markdown/interfaces/IPeerData.md +3 -3
- package/docs/markdown/interfaces/IRbfData.md +6 -6
- package/docs/markdown/interfaces/ISend.md +2 -2
- package/docs/markdown/interfaces/ISendTransaction.md +16 -16
- package/docs/markdown/interfaces/ISendTx.md +3 -3
- package/docs/markdown/interfaces/ISetupTransaction.md +4 -4
- package/docs/markdown/interfaces/ISubscribeToAddress.md +4 -4
- package/docs/markdown/interfaces/ISubscribeToHeader.md +4 -4
- package/docs/markdown/interfaces/ITargets.md +4 -4
- package/docs/markdown/interfaces/ITransaction.md +6 -6
- package/docs/markdown/interfaces/ITxHash.md +1 -1
- package/docs/markdown/interfaces/ITxHashes.md +3 -3
- package/docs/markdown/interfaces/IUtxo.md +16 -16
- package/docs/markdown/interfaces/IVin.md +5 -5
- package/docs/markdown/interfaces/IVout.md +3 -3
- package/docs/markdown/interfaces/IWallet.md +21 -21
- package/docs/markdown/interfaces/IWalletData.md +25 -25
- package/package.json +1 -1
- package/src/electrum/index.ts +8 -8
- package/src/types/electrum.ts +6 -2
- package/src/types/wallet.ts +3 -3
- package/src/wallet/index.ts +4 -4
package/src/types/electrum.ts
CHANGED
|
@@ -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:
|
|
79
|
+
network: EElectrumNetworks;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
export interface IGetAddressHistoryResponse extends TTxResult, IAddress {}
|
package/src/types/wallet.ts
CHANGED
|
@@ -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
|
|
237
|
+
selectedNetwork: EElectrumNetworks;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
export interface ICustomGetScriptHash {
|
|
241
241
|
address: string;
|
|
242
|
-
selectedNetwork
|
|
242
|
+
selectedNetwork: EElectrumNetworks;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
export interface IGetAddressByPath {
|
package/src/wallet/index.ts
CHANGED
|
@@ -2068,11 +2068,11 @@ export class Wallet {
|
|
|
2068
2068
|
|
|
2069
2069
|
/**
|
|
2070
2070
|
* Clears the UTXO array and balance from storage.
|
|
2071
|
-
* @
|
|
2071
|
+
* @public
|
|
2072
2072
|
* @async
|
|
2073
2073
|
* @returns {Promise<string>}
|
|
2074
2074
|
*/
|
|
2075
|
-
|
|
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({
|