xpi-ts 0.2.22 → 0.2.24
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/dist/cjs/lib/bitcore/crypto/point.js +2 -2
- package/dist/cjs/lib/bitcore/index.js +162 -162
- package/dist/esm/lib/bitcore/crypto/point.js +2 -2
- package/dist/esm/lib/bitcore/index.js +42 -42
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/address.d.ts +116 -0
- package/dist/types/lib/bitcore/address.d.ts.map +1 -1
- package/dist/types/lib/bitcore/block/block.d.ts +214 -0
- package/dist/types/lib/bitcore/block/block.d.ts.map +1 -1
- package/dist/types/lib/bitcore/block/blockheader.d.ts +220 -0
- package/dist/types/lib/bitcore/block/blockheader.d.ts.map +1 -1
- package/dist/types/lib/bitcore/block/merkleblock.d.ts +206 -0
- package/dist/types/lib/bitcore/block/merkleblock.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/bn.d.ts +224 -0
- package/dist/types/lib/bitcore/crypto/bn.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/ecdsa.d.ts +122 -0
- package/dist/types/lib/bitcore/crypto/ecdsa.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/hash.d.ts +56 -0
- package/dist/types/lib/bitcore/crypto/hash.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/index.d.ts +4 -0
- package/dist/types/lib/bitcore/crypto/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/musig2.d.ts +282 -0
- package/dist/types/lib/bitcore/crypto/musig2.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/point.d.ts +87 -0
- package/dist/types/lib/bitcore/crypto/point.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/random.d.ts +48 -0
- package/dist/types/lib/bitcore/crypto/random.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/schnorr.d.ts +203 -0
- package/dist/types/lib/bitcore/crypto/schnorr.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/signature.d.ts +452 -0
- package/dist/types/lib/bitcore/crypto/signature.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/sigtype.d.ts +46 -0
- package/dist/types/lib/bitcore/crypto/sigtype.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/base58.d.ts +68 -0
- package/dist/types/lib/bitcore/encoding/base58.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/base58check.d.ts +58 -0
- package/dist/types/lib/bitcore/encoding/base58check.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/bufferreader.d.ts +112 -0
- package/dist/types/lib/bitcore/encoding/bufferreader.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/bufferwriter.d.ts +144 -0
- package/dist/types/lib/bitcore/encoding/bufferwriter.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/varint.d.ts +86 -0
- package/dist/types/lib/bitcore/encoding/varint.d.ts.map +1 -1
- package/dist/types/lib/bitcore/errors.d.ts +4 -0
- package/dist/types/lib/bitcore/errors.d.ts.map +1 -1
- package/dist/types/lib/bitcore/hdprivatekey.d.ts +59 -0
- package/dist/types/lib/bitcore/hdprivatekey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/hdpublickey.d.ts +145 -0
- package/dist/types/lib/bitcore/hdpublickey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/index.d.ts +58 -54
- package/dist/types/lib/bitcore/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/message.d.ts +63 -0
- package/dist/types/lib/bitcore/message.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/errors.d.ts +4 -0
- package/dist/types/lib/bitcore/mnemonic/errors.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/index.d.ts +4 -0
- package/dist/types/lib/bitcore/mnemonic/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/mnemonic.d.ts +106 -0
- package/dist/types/lib/bitcore/mnemonic/mnemonic.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/pbkdf2.d.ts +13 -0
- package/dist/types/lib/bitcore/mnemonic/pbkdf2.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/words/english.d.ts +4 -0
- package/dist/types/lib/bitcore/mnemonic/words/english.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/words/french.d.ts +5 -0
- package/dist/types/lib/bitcore/mnemonic/words/french.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/words/index.d.ts +4 -0
- package/dist/types/lib/bitcore/mnemonic/words/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/musig2/index.d.ts +14 -0
- package/dist/types/lib/bitcore/musig2/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/musig2/session.d.ts +254 -0
- package/dist/types/lib/bitcore/musig2/session.d.ts.map +1 -1
- package/dist/types/lib/bitcore/musig2/signer.d.ts +212 -0
- package/dist/types/lib/bitcore/musig2/signer.d.ts.map +1 -1
- package/dist/types/lib/bitcore/networks.d.ts +17 -0
- package/dist/types/lib/bitcore/networks.d.ts.map +1 -1
- package/dist/types/lib/bitcore/opcode.d.ts +151 -0
- package/dist/types/lib/bitcore/opcode.d.ts.map +1 -1
- package/dist/types/lib/bitcore/privatekey.d.ts +80 -0
- package/dist/types/lib/bitcore/privatekey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/publickey.d.ts +195 -0
- package/dist/types/lib/bitcore/publickey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/chunk.d.ts +51 -0
- package/dist/types/lib/bitcore/script/chunk.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/condition-stack.d.ts +60 -0
- package/dist/types/lib/bitcore/script/interpreter/condition-stack.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/index.d.ts +23 -0
- package/dist/types/lib/bitcore/script/interpreter/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/interpreter.d.ts +86 -0
- package/dist/types/lib/bitcore/script/interpreter/interpreter.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/script-num.d.ts +115 -0
- package/dist/types/lib/bitcore/script/interpreter/script-num.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/types.d.ts +119 -0
- package/dist/types/lib/bitcore/script/interpreter/types.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/taproot.d.ts +297 -0
- package/dist/types/lib/bitcore/script/taproot.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script.d.ts +510 -0
- package/dist/types/lib/bitcore/script.d.ts.map +1 -1
- package/dist/types/lib/bitcore/taproot/musig2.d.ts +153 -0
- package/dist/types/lib/bitcore/taproot/musig2.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/multisig.d.ts +8 -0
- package/dist/types/lib/bitcore/transaction/input/multisig.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/multisigscripthash.d.ts +8 -0
- package/dist/types/lib/bitcore/transaction/input/multisigscripthash.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/publickey.d.ts +8 -0
- package/dist/types/lib/bitcore/transaction/input/publickey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/publickeyhash.d.ts +14 -0
- package/dist/types/lib/bitcore/transaction/input/publickeyhash.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/taproot.d.ts +22 -0
- package/dist/types/lib/bitcore/transaction/input/taproot.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input.d.ts +418 -0
- package/dist/types/lib/bitcore/transaction/input.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/outpoint.d.ts +110 -0
- package/dist/types/lib/bitcore/transaction/outpoint.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/output.d.ts +83 -0
- package/dist/types/lib/bitcore/transaction/output.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/sighash.d.ts +69 -0
- package/dist/types/lib/bitcore/transaction/sighash.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/signature.d.ts +98 -0
- package/dist/types/lib/bitcore/transaction/signature.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/transaction.d.ts +379 -0
- package/dist/types/lib/bitcore/transaction/transaction.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/unspentoutput.d.ts +61 -0
- package/dist/types/lib/bitcore/transaction/unspentoutput.d.ts.map +1 -1
- package/dist/types/lib/bitcore/unit.d.ts +140 -0
- package/dist/types/lib/bitcore/unit.d.ts.map +1 -1
- package/dist/types/lib/bitcore/uri.d.ts +34 -0
- package/dist/types/lib/bitcore/uri.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/base32.d.ts +55 -0
- package/dist/types/lib/bitcore/util/base32.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/bits.d.ts +76 -0
- package/dist/types/lib/bitcore/util/bits.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/buffer.d.ts +135 -0
- package/dist/types/lib/bitcore/util/buffer.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/convertBits.d.ts +15 -0
- package/dist/types/lib/bitcore/util/convertBits.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/js.d.ts +19 -0
- package/dist/types/lib/bitcore/util/js.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/merkle.d.ts +85 -0
- package/dist/types/lib/bitcore/util/merkle.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/preconditions.d.ts +29 -0
- package/dist/types/lib/bitcore/util/preconditions.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util.d.ts +7 -0
- package/dist/types/lib/bitcore/util.d.ts.map +1 -1
- package/dist/types/lib/bitcore/xaddress.d.ts +117 -0
- package/dist/types/lib/bitcore/xaddress.d.ts.map +1 -1
- package/dist/types/lib/lokad.d.ts +292 -0
- package/dist/types/lib/lokad.d.ts.map +1 -1
- package/dist/types/lib/nft.d.ts +434 -0
- package/dist/types/lib/nft.d.ts.map +1 -1
- package/dist/types/lib/rank/api.d.ts +13 -0
- package/dist/types/lib/rank/api.d.ts.map +1 -1
- package/dist/types/lib/rank/index.d.ts +153 -0
- package/dist/types/lib/rank/index.d.ts.map +1 -1
- package/dist/types/lib/rank/opcode.d.ts +6 -2
- package/dist/types/lib/rank/opcode.d.ts.map +1 -1
- package/dist/types/lib/rank/script.d.ts +10 -0
- package/dist/types/lib/rank/script.d.ts.map +1 -1
- package/dist/types/lib/rank/transaction.d.ts +11 -0
- package/dist/types/lib/rank/transaction.d.ts.map +1 -1
- package/dist/types/lib/rpc.d.ts +176 -0
- package/dist/types/lib/rpc.d.ts.map +1 -1
- package/dist/types/utils/constants.d.ts +27 -0
- package/dist/types/utils/constants.d.ts.map +1 -1
- package/dist/types/utils/env.d.ts +15 -0
- package/dist/types/utils/env.d.ts.map +1 -1
- package/dist/types/utils/string.d.ts +57 -0
- package/dist/types/utils/string.d.ts.map +1 -1
- package/dist/types/utils/wallet.d.ts +43 -1
- package/dist/types/utils/wallet.d.ts.map +1 -1
- package/package.json +1 -1
- package/tsconfig.types.json +2 -1
|
@@ -33,67 +33,212 @@ export interface HDPublicKeyBuffers {
|
|
|
33
33
|
xprivkey?: Buffer;
|
|
34
34
|
}
|
|
35
35
|
export type HDPublicKeyInput = string | Buffer | HDPublicKeyData | HDPublicKeyObject;
|
|
36
|
+
/**
|
|
37
|
+
* Hierarchical Deterministic Public Key (BIP32)
|
|
38
|
+
*
|
|
39
|
+
* Represents an extended public key that can derive child public keys
|
|
40
|
+
* without access to the corresponding private key. This enables watch-only
|
|
41
|
+
* wallets and public key derivation for non-hardened paths.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* // Create from xpub string
|
|
46
|
+
* const hdPubKey = new HDPublicKey('xpub...')
|
|
47
|
+
*
|
|
48
|
+
* // Create from HDPrivateKey
|
|
49
|
+
* const hdPubKey = hdPrivKey.hdPublicKey
|
|
50
|
+
*
|
|
51
|
+
* // Derive child keys (non-hardened only)
|
|
52
|
+
* const child = hdPubKey.derive("m/0/1")
|
|
53
|
+
* const childByIndex = hdPubKey.deriveChild(0)
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
36
56
|
export declare class HDPublicKey {
|
|
57
|
+
/** The Base58Check-encoded extended public key string */
|
|
37
58
|
readonly xpubkey: Buffer;
|
|
59
|
+
/** The network this key belongs to */
|
|
38
60
|
readonly network: Network;
|
|
61
|
+
/** The depth in the HD tree (0 for master key) */
|
|
39
62
|
readonly depth: number;
|
|
63
|
+
/** The public key */
|
|
40
64
|
readonly publicKey: PublicKey;
|
|
65
|
+
/** The fingerprint of this key (first 4 bytes of HASH160 of public key) */
|
|
41
66
|
readonly fingerPrint: Buffer;
|
|
67
|
+
/** The fingerprint of the parent key */
|
|
42
68
|
readonly parentFingerPrint: Buffer;
|
|
69
|
+
/** The child index used to derive this key */
|
|
43
70
|
readonly childIndex: number;
|
|
71
|
+
/** The chain code used for child key derivation */
|
|
44
72
|
readonly chainCode: Buffer;
|
|
73
|
+
/** Internal buffers for serialization */
|
|
45
74
|
private _buffers;
|
|
75
|
+
/** Hardened key derivation threshold (2^31) */
|
|
46
76
|
static readonly Hardened = 2147483648;
|
|
77
|
+
/** Valid aliases for the root element in derivation paths */
|
|
47
78
|
static readonly RootElementAlias: string[];
|
|
79
|
+
/** Size of the version field in bytes */
|
|
48
80
|
static readonly VersionSize = 4;
|
|
81
|
+
/** Size of the depth field in bytes */
|
|
49
82
|
static readonly DepthSize = 1;
|
|
83
|
+
/** Size of the parent fingerprint field in bytes */
|
|
50
84
|
static readonly ParentFingerPrintSize = 4;
|
|
85
|
+
/** Size of the child index field in bytes */
|
|
51
86
|
static readonly ChildIndexSize = 4;
|
|
87
|
+
/** Size of the chain code field in bytes */
|
|
52
88
|
static readonly ChainCodeSize = 32;
|
|
89
|
+
/** Size of the public key field in bytes */
|
|
53
90
|
static readonly PublicKeySize = 33;
|
|
91
|
+
/** Size of the checksum field in bytes */
|
|
54
92
|
static readonly CheckSumSize = 4;
|
|
93
|
+
/** Total size of the data portion (without checksum) in bytes */
|
|
55
94
|
static readonly DataSize = 78;
|
|
95
|
+
/** Total size of the serialized key (with checksum) in bytes */
|
|
56
96
|
static readonly SerializedByteSize = 82;
|
|
97
|
+
/** Start position of version field in serialized buffer */
|
|
57
98
|
static readonly VersionStart = 0;
|
|
99
|
+
/** End position of version field in serialized buffer */
|
|
58
100
|
static readonly VersionEnd: number;
|
|
101
|
+
/** Start position of depth field in serialized buffer */
|
|
59
102
|
static readonly DepthStart: number;
|
|
103
|
+
/** End position of depth field in serialized buffer */
|
|
60
104
|
static readonly DepthEnd: number;
|
|
105
|
+
/** Start position of parent fingerprint field in serialized buffer */
|
|
61
106
|
static readonly ParentFingerPrintStart: number;
|
|
107
|
+
/** End position of parent fingerprint field in serialized buffer */
|
|
62
108
|
static readonly ParentFingerPrintEnd: number;
|
|
109
|
+
/** Start position of child index field in serialized buffer */
|
|
63
110
|
static readonly ChildIndexStart: number;
|
|
111
|
+
/** End position of child index field in serialized buffer */
|
|
64
112
|
static readonly ChildIndexEnd: number;
|
|
113
|
+
/** Start position of chain code field in serialized buffer */
|
|
65
114
|
static readonly ChainCodeStart: number;
|
|
115
|
+
/** End position of chain code field in serialized buffer */
|
|
66
116
|
static readonly ChainCodeEnd: number;
|
|
117
|
+
/** Start position of public key field in serialized buffer */
|
|
67
118
|
static readonly PublicKeyStart: number;
|
|
119
|
+
/** End position of public key field in serialized buffer */
|
|
68
120
|
static readonly PublicKeyEnd: number;
|
|
121
|
+
/** Start position of checksum field in serialized buffer */
|
|
69
122
|
static readonly ChecksumStart: number;
|
|
123
|
+
/** End position of checksum field in serialized buffer */
|
|
70
124
|
static readonly ChecksumEnd: number;
|
|
125
|
+
/**
|
|
126
|
+
* Creates a new HDPublicKey instance.
|
|
127
|
+
*
|
|
128
|
+
* @param data - The data to create the HDPublicKey from. Can be:
|
|
129
|
+
* - A Base58Check-encoded xpub string
|
|
130
|
+
* - A Buffer containing the serialized key
|
|
131
|
+
* - An HDPublicKeyData object with key components
|
|
132
|
+
* - An HDPublicKeyObject with string representations
|
|
133
|
+
* - An HDPrivateKey to extract the public key from
|
|
134
|
+
* @throws Error if the data is invalid or cannot be parsed
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```typescript
|
|
138
|
+
* // From xpub string
|
|
139
|
+
* const hdPubKey = new HDPublicKey('xpub...')
|
|
140
|
+
*
|
|
141
|
+
* // From HDPrivateKey
|
|
142
|
+
* const hdPubKey = new HDPublicKey(hdPrivateKey)
|
|
143
|
+
*
|
|
144
|
+
* // From object
|
|
145
|
+
* const hdPubKey = new HDPublicKey({
|
|
146
|
+
* network: 'mainnet',
|
|
147
|
+
* depth: 0,
|
|
148
|
+
* parentFingerPrint: BufferUtil.alloc(4),
|
|
149
|
+
* childIndex: 0,
|
|
150
|
+
* chainCode: chainCodeBuffer,
|
|
151
|
+
* publicKey: publicKey
|
|
152
|
+
* })
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
71
155
|
constructor(data: HDPublicKeyInput);
|
|
156
|
+
/**
|
|
157
|
+
* Verifies that a given path is valid
|
|
158
|
+
*/
|
|
72
159
|
static isValidPath(arg: string | number): boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Verifies that a given serialized public key in base58 with checksum format is valid
|
|
162
|
+
*/
|
|
73
163
|
static isValidSerialized(data: string | Buffer, network?: string | Network): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Checks what's the error that causes the validation of a serialized public key to fail
|
|
166
|
+
*/
|
|
74
167
|
static getSerializedError(data: string | Buffer, network?: string | Network): Error | null;
|
|
168
|
+
/**
|
|
169
|
+
* Validate network
|
|
170
|
+
*/
|
|
75
171
|
private static _validateNetwork;
|
|
172
|
+
/**
|
|
173
|
+
* Create HDPublicKey from string
|
|
174
|
+
*/
|
|
76
175
|
static fromString(arg: string): HDPublicKey;
|
|
176
|
+
/**
|
|
177
|
+
* Create HDPublicKey from object
|
|
178
|
+
*/
|
|
77
179
|
static fromObject(arg: HDPublicKeyData | HDPublicKeyObject): HDPublicKey;
|
|
180
|
+
/**
|
|
181
|
+
* Create HDPublicKey from buffer
|
|
182
|
+
*/
|
|
78
183
|
static fromBuffer(arg: Buffer): HDPublicKey;
|
|
79
184
|
private _classifyArguments;
|
|
80
185
|
private static _transformString;
|
|
81
186
|
private static _transformSerialized;
|
|
82
187
|
private static _transformBuffer;
|
|
83
188
|
private static _transformObject;
|
|
189
|
+
/**
|
|
190
|
+
* Build from HDPrivateKey
|
|
191
|
+
*/
|
|
84
192
|
private _buildFromPrivate;
|
|
193
|
+
/**
|
|
194
|
+
* Build from buffers
|
|
195
|
+
*/
|
|
85
196
|
private _buildFromBuffers;
|
|
197
|
+
/**
|
|
198
|
+
* Validate buffer arguments
|
|
199
|
+
*/
|
|
86
200
|
private static _validateBufferArguments;
|
|
87
201
|
private _buildFromObject;
|
|
202
|
+
/**
|
|
203
|
+
* Build from serialized data (Base58Check-encoded xpub string or raw buffer)
|
|
204
|
+
* This method is called when deserializing an existing HDPublicKey
|
|
205
|
+
*/
|
|
88
206
|
private _buildFromSerialized;
|
|
207
|
+
/**
|
|
208
|
+
* Derive child key
|
|
209
|
+
*/
|
|
89
210
|
derive(arg: string | number, hardened?: boolean): HDPublicKey;
|
|
211
|
+
/**
|
|
212
|
+
* Derive child key (main implementation)
|
|
213
|
+
*/
|
|
90
214
|
deriveChild(arg: string | number, hardened?: boolean): HDPublicKey;
|
|
215
|
+
/**
|
|
216
|
+
* Derive with number
|
|
217
|
+
*/
|
|
91
218
|
private _deriveWithNumber;
|
|
219
|
+
/**
|
|
220
|
+
* Derive from string path
|
|
221
|
+
*/
|
|
92
222
|
private _deriveFromString;
|
|
223
|
+
/**
|
|
224
|
+
* Convert to string
|
|
225
|
+
*/
|
|
93
226
|
toString(): string;
|
|
227
|
+
/**
|
|
228
|
+
* Convert to buffer
|
|
229
|
+
*/
|
|
94
230
|
toBuffer(): Buffer;
|
|
231
|
+
/**
|
|
232
|
+
* Convert to object
|
|
233
|
+
*/
|
|
95
234
|
toObject(): HDPublicKeyObject;
|
|
235
|
+
/**
|
|
236
|
+
* Convert to JSON
|
|
237
|
+
*/
|
|
96
238
|
toJSON(): string;
|
|
239
|
+
/**
|
|
240
|
+
* Get string representation for console
|
|
241
|
+
*/
|
|
97
242
|
inspect(): string;
|
|
98
243
|
}
|
|
99
244
|
//# sourceMappingURL=hdpublickey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hdpublickey.d.ts","sourceRoot":"","sources":["../../../../lib/bitcore/hdpublickey.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAE,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAMzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,WAAW,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,MAAM,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,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D;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,WAAW;IAUlE;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAqCzB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAgBzB;;OAEG;IACH,QAAQ,IAAI,MAAM;IAIlB;;OAEG;IACH,QAAQ,IAAI,MAAM;IAIlB;;OAEG;IACH,QAAQ,IAAI,iBAAiB;IAa7B;;OAEG;IACH,MAAM,IAAI,MAAM;IAIhB;;OAEG;IACH,OAAO,IAAI,MAAM;CAGlB"}
|
|
@@ -1,56 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
43
|
-
export
|
|
1
|
+
/**
|
|
2
|
+
* Main exports for lotus-lib
|
|
3
|
+
* All modules migrated from bitcore-lib-xpi with ESM and BigInt support
|
|
4
|
+
*/
|
|
5
|
+
export { Hash } from './crypto/hash.js';
|
|
6
|
+
export { Random } from './crypto/random.js';
|
|
7
|
+
export { Point } from './crypto/point.js';
|
|
8
|
+
export { Signature } from './crypto/signature.js';
|
|
9
|
+
export { ECDSA } from './crypto/ecdsa.js';
|
|
10
|
+
export { Schnorr } from './crypto/schnorr.js';
|
|
11
|
+
export { BN } from './crypto/bn.js';
|
|
12
|
+
export { muSig2KeyAgg, muSig2NonceGen, muSig2NonceAgg, muSig2PartialSign, muSig2PartialSigVerify, muSig2SigAgg, muSig2TaggedHash, type MuSig2KeyAggContext, type MuSig2Nonce, type MuSig2AggregatedNonce, } from './crypto/musig2.js';
|
|
13
|
+
export { MuSigSessionManager, MuSigSessionPhase, type MuSigSession, } from './musig2/session.js';
|
|
14
|
+
export { MuSig2Signer, createMuSig2Signer, type MuSig2SignerConfig, type MuSig2PrepareResult, type MuSig2SignResult, type MuSig2TaprootSignResult, } from './musig2/signer.js';
|
|
15
|
+
export { buildMuSig2TaprootKey, buildMuSig2TaprootKeyWithScripts, signTaprootKeyPathWithMuSig2, verifyTaprootKeyPathMuSigPartial, isMuSigTaprootOutput, createMuSigTaprootAddress, type MuSig2TaprootKeyResult, } from './taproot/musig2.js';
|
|
16
|
+
export { isSchnorrSignature, isECDSASignature, getSignatureType, isValidSignatureLength, } from './crypto/sigtype.js';
|
|
17
|
+
export { PrivateKey } from './privatekey.js';
|
|
18
|
+
export { PublicKey } from './publickey.js';
|
|
19
|
+
export { HDPrivateKey } from './hdprivatekey.js';
|
|
20
|
+
export { HDPublicKey } from './hdpublickey.js';
|
|
21
|
+
export { JSUtil } from './util/js.js';
|
|
22
|
+
export { Preconditions } from './util/preconditions.js';
|
|
23
|
+
export { Base32 } from './util/base32.js';
|
|
24
|
+
export { convertBits } from './util/convertBits.js';
|
|
25
|
+
export { BufferUtil, NULL_HASH, EMPTY_BUFFER } from './util/buffer.js';
|
|
26
|
+
export { BitcoreError } from './errors.js';
|
|
27
|
+
export { Base58 } from './encoding/base58.js';
|
|
28
|
+
export { Base58Check } from './encoding/base58check.js';
|
|
29
|
+
export { BufferReader } from './encoding/bufferreader.js';
|
|
30
|
+
export { BufferWriter } from './encoding/bufferwriter.js';
|
|
31
|
+
export { Varint } from './encoding/varint.js';
|
|
32
|
+
export { Network, livenet, testnet, regtest, networks, defaultNetwork, get as getNetwork, add as addNetwork, remove as removeNetwork, Networks, type NetworkName, } from './networks.js';
|
|
33
|
+
export { Address } from './address.js';
|
|
34
|
+
export { XAddress } from './xaddress.js';
|
|
35
|
+
export { Script, ScriptTypes, type ScriptType } from './script.js';
|
|
36
|
+
export { Opcode } from './opcode.js';
|
|
37
|
+
export { Interpreter } from './script/interpreter/interpreter.js';
|
|
38
|
+
export { Chunk } from './script/chunk.js';
|
|
39
|
+
export { Unit } from './unit.js';
|
|
40
|
+
export { Message } from './message.js';
|
|
41
|
+
export { URI } from './uri.js';
|
|
42
|
+
export { Input, MultisigInput, MultisigScriptHashInput, PublicKeyInput, PublicKeyHashInput, TaprootInput, Output, UnspentOutput, sighash, sign, verify, TransactionSignature, Transaction, } from './transaction/index.js';
|
|
43
|
+
export { DEFAULT_SIGN_FLAGS, SIGHASH_SINGLE_BUG, BITS_64_ON, } from './transaction/sighash.js';
|
|
44
|
+
export { applyTweakToPublicKey, buildKeyPathTaproot, buildPayToTaproot, buildScriptPathTaproot, buildTapTree, calculateTapBranch, calculateTapLeaf, calculateTapTweak, createControlBlock, extractTaprootCommitment, extractTaprootState, isTapLeafNode, isTapBranchNode, taggedHash, tweakPublicKey, tweakPrivateKey, verifyTaprootCommitment, verifyTaprootScriptPath, verifyTaprootScriptPathFromControlBlock, verifyTaprootSpend, TAPROOT_LEAF_MASK, TAPROOT_LEAF_TAPSCRIPT, TAPROOT_CONTROL_BASE_SIZE, TAPROOT_CONTROL_NODE_SIZE, TAPROOT_CONTROL_MAX_NODE_COUNT, TAPROOT_CONTROL_MAX_SIZE, TAPROOT_SCRIPTTYPE, TAPROOT_INTRO_SIZE, TAPROOT_SIGHASH_TYPE, TAPROOT_SIZE_WITHOUT_STATE, TAPROOT_SIZE_WITH_STATE, TAPROOT_ANNEX_TAG, type TapLeafNode, type TapBranchNode, type TapNode, type TapLeaf, type TapTreeBuildResult, type TaprootVerifyResult, } from './script/taproot.js';
|
|
45
|
+
export { Block, BlockHeader, MerkleBlock } from './block/index.js';
|
|
46
|
+
export { type MnemonicInput, Mnemonic, MnemonicError, pbkdf2, Words, } from './mnemonic/index.js';
|
|
47
|
+
export type { InputData, InputObject, OutputData, OutputObject, UnspentOutputData, UnspentOutputObject, TransactionSignatureData, TransactionSignatureObject, TransactionData, TransactionObject, } from './transaction/index.js';
|
|
44
48
|
export type { BlockData, BlockObject, BlockHeaderData, BlockHeaderObject, MerkleBlockData, MerkleBlockObject, } from './block';
|
|
45
|
-
export type { NetworkConfig } from './networks';
|
|
46
|
-
export type { PrivateKeyData, PrivateKeyObject, PrivateKeySerialized, } from './privatekey';
|
|
47
|
-
export type { PublicKeyData, PublicKeyExtra, PublicKeyObject, PublicKeySerialized, } from './publickey';
|
|
48
|
-
export type { HDPrivateKeyData, HDPrivateKeyObject, HDPrivateKeyBuffers, HDPrivateKeyInput, } from './hdprivatekey';
|
|
49
|
-
export type { HDPublicKeyData, HDPublicKeyObject, HDPublicKeyBuffers, HDPublicKeyInput, } from './hdpublickey';
|
|
50
|
-
export type { AddressData, AddressObject, CashAddressDecoding } from './address';
|
|
51
|
-
export type { XAddressData, XAddressObject } from './xaddress';
|
|
52
|
-
export type { ScriptData } from './script';
|
|
53
|
-
export type { URIParams } from './uri';
|
|
54
|
-
export type { UnitData } from './unit';
|
|
55
|
-
export type { TransactionLike } from './transaction/sighash';
|
|
49
|
+
export type { NetworkConfig } from './networks.js';
|
|
50
|
+
export type { PrivateKeyData, PrivateKeyObject, PrivateKeySerialized, } from './privatekey.js';
|
|
51
|
+
export type { PublicKeyData, PublicKeyExtra, PublicKeyObject, PublicKeySerialized, } from './publickey.js';
|
|
52
|
+
export type { HDPrivateKeyData, HDPrivateKeyObject, HDPrivateKeyBuffers, HDPrivateKeyInput, } from './hdprivatekey.js';
|
|
53
|
+
export type { HDPublicKeyData, HDPublicKeyObject, HDPublicKeyBuffers, HDPublicKeyInput, } from './hdpublickey.js';
|
|
54
|
+
export type { AddressData, AddressObject, CashAddressDecoding, } from './address.js';
|
|
55
|
+
export type { XAddressData, XAddressObject } from './xaddress.js';
|
|
56
|
+
export type { ScriptData } from './script.js';
|
|
57
|
+
export type { URIParams } from './uri.js';
|
|
58
|
+
export type { UnitData } from './unit.js';
|
|
59
|
+
export type { TransactionLike } from './transaction/sighash.js';
|
|
56
60
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/bitcore/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/bitcore/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AAGnC,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACL,YAAY,EACZ,kB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E,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEzC,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -1,26 +1,89 @@
|
|
|
1
1
|
import { PrivateKey } from './privatekey';
|
|
2
2
|
import { Address } from './address';
|
|
3
3
|
import type { Buffer } from 'buffer/';
|
|
4
|
+
/**
|
|
5
|
+
* Message class for signing and verifying Bitcoin-style messages.
|
|
6
|
+
*
|
|
7
|
+
* Implements the Bitcoin message signing standard using ECDSA signatures
|
|
8
|
+
* with recovery. Messages are prefixed with a magic string before hashing
|
|
9
|
+
* to prevent signing arbitrary data that could be interpreted as transactions.
|
|
10
|
+
*
|
|
11
|
+
* The signature format includes a recovery flag that allows the public key
|
|
12
|
+
* to be recovered from the signature, enabling verification using only
|
|
13
|
+
* the message, signature, and expected address.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // Sign a message
|
|
18
|
+
* const message = new Message('Hello, Lotus!')
|
|
19
|
+
* const privateKey = new PrivateKey()
|
|
20
|
+
* const signature = message.sign(privateKey)
|
|
21
|
+
*
|
|
22
|
+
* // Verify with address
|
|
23
|
+
* const address = privateKey.toAddress()
|
|
24
|
+
* const verified = message.verify(address, signature)
|
|
25
|
+
*
|
|
26
|
+
* // Recover public key from signature
|
|
27
|
+
* const recoveredPubKey = message.recoverPublicKey(address, signature)
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
4
30
|
export declare class Message {
|
|
5
31
|
private _message;
|
|
6
32
|
error?: string;
|
|
7
33
|
static readonly MAGIC_BYTES: Buffer;
|
|
8
34
|
constructor(message: string);
|
|
35
|
+
/**
|
|
36
|
+
* Get the magic hash for signing
|
|
37
|
+
*/
|
|
9
38
|
magicHash(): Buffer;
|
|
39
|
+
/**
|
|
40
|
+
* Internal sign method
|
|
41
|
+
*/
|
|
10
42
|
private _sign;
|
|
43
|
+
/**
|
|
44
|
+
* Sign the message with a private key
|
|
45
|
+
*/
|
|
11
46
|
sign(privateKey: PrivateKey): string;
|
|
47
|
+
/**
|
|
48
|
+
* Internal verify method
|
|
49
|
+
*/
|
|
12
50
|
private _verify;
|
|
51
|
+
/**
|
|
52
|
+
* Verify a signature against a Bitcoin address
|
|
53
|
+
*/
|
|
13
54
|
verify(bitcoinAddress: Address | string, signatureString: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Recover public key from signature
|
|
57
|
+
*/
|
|
14
58
|
recoverPublicKey(bitcoinAddress: Address | string, signatureString: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Create Message from string
|
|
61
|
+
*/
|
|
15
62
|
static fromString(str: string): Message;
|
|
63
|
+
/**
|
|
64
|
+
* Create Message from JSON
|
|
65
|
+
*/
|
|
16
66
|
static fromJSON(json: string | object): Message;
|
|
67
|
+
/**
|
|
68
|
+
* Convert to object
|
|
69
|
+
*/
|
|
17
70
|
toObject(): {
|
|
18
71
|
message: string;
|
|
19
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Convert to JSON
|
|
75
|
+
* @alias toObject API compatibility wrapper (may not be needed)
|
|
76
|
+
*/
|
|
20
77
|
toJSON(): {
|
|
21
78
|
message: string;
|
|
22
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* Convert to string
|
|
82
|
+
*/
|
|
23
83
|
toString(): string;
|
|
84
|
+
/**
|
|
85
|
+
* Get string representation for console
|
|
86
|
+
*/
|
|
24
87
|
inspect(): string;
|
|
25
88
|
}
|
|
26
89
|
//# sourceMappingURL=message.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../lib/bitcore/message.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM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OAAO,IAAI,MAAM;CAGlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../lib/bitcore/mnemonic/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../lib/bitcore/mnemonic/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,eAAO,MAAM,aAAa,UAAyC,CAAA;AAGnE,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,KAAK,CAAA;IAC9C,eAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,KAAK,KAAK,CAAA;IAChD,eAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,KAAK,KAAK,CAAA;CACjD"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mnemonic module exports
|
|
3
|
+
* Migrated from @abcpros/bitcore-mnemonic with ESM support and TypeScript
|
|
4
|
+
*/
|
|
1
5
|
export { Mnemonic, default, type MnemonicInput } from './mnemonic.js';
|
|
2
6
|
export { MnemonicError } from './errors.js';
|
|
3
7
|
export { pbkdf2 } from './pbkdf2.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/bitcore/mnemonic/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/bitcore/mnemonic/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1,7 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BIP39 Mnemonic implementation
|
|
3
|
+
* Migrated from @abcpros/bitcore-mnemonic with ESM support and TypeScript
|
|
4
|
+
*/
|
|
1
5
|
import { HDPrivateKey } from '../hdprivatekey.js';
|
|
2
6
|
import { Network, type NetworkName } from '../networks.js';
|
|
3
7
|
import type { Buffer } from 'buffer/';
|
|
8
|
+
/**
|
|
9
|
+
* Type definition for the input data to the Mnemonic constructor.
|
|
10
|
+
*/
|
|
4
11
|
export type MnemonicInput = string | Buffer | number | string[];
|
|
12
|
+
/**
|
|
13
|
+
* BIP39 Mnemonic implementation for deterministic wallet generation.
|
|
14
|
+
*
|
|
15
|
+
* A Mnemonic is a group of easy to remember words used for generating
|
|
16
|
+
* deterministic wallets. It can be used to derive a seed (with an optional
|
|
17
|
+
* passphrase) which then generates an HDPrivateKey.
|
|
18
|
+
*
|
|
19
|
+
* @see https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // generate a random mnemonic
|
|
23
|
+
* const mnemonic = new Mnemonic();
|
|
24
|
+
* const phrase = mnemonic.phrase;
|
|
25
|
+
*
|
|
26
|
+
* // use a different language
|
|
27
|
+
* const mnemonic = new Mnemonic(Mnemonic.Words.ENGLISH);
|
|
28
|
+
* const xprivkey = mnemonic.toHDPrivateKey();
|
|
29
|
+
*
|
|
30
|
+
* @param data - A seed, phrase, or entropy to initialize (can be skipped)
|
|
31
|
+
* @param wordlist - The wordlist to generate mnemonics from
|
|
32
|
+
*/
|
|
5
33
|
export declare class Mnemonic {
|
|
6
34
|
readonly wordlist: string[];
|
|
7
35
|
readonly phrase: string;
|
|
@@ -10,16 +38,94 @@ export declare class Mnemonic {
|
|
|
10
38
|
ENGLISH: string[];
|
|
11
39
|
FRENCH: string[];
|
|
12
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* Will return a boolean if the mnemonic is valid
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
*
|
|
46
|
+
* var valid = Mnemonic.isValid('lab rescue lunch elbow recall phrase perfect donkey biology guess moment husband');
|
|
47
|
+
* // true
|
|
48
|
+
*
|
|
49
|
+
* @param {String} mnemonic - The mnemonic string
|
|
50
|
+
* @param {String} [wordlist] - The wordlist used
|
|
51
|
+
* @returns {boolean}
|
|
52
|
+
*/
|
|
13
53
|
static isValid(mnemonic: string, wordlist?: string[]): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Internal function to check if a mnemonic belongs to a wordlist.
|
|
56
|
+
*
|
|
57
|
+
* @param {String} mnemonic - The mnemonic string
|
|
58
|
+
* @param {String} wordlist - The wordlist
|
|
59
|
+
* @returns {boolean}
|
|
60
|
+
*/
|
|
14
61
|
static _belongsToWordlist(mnemonic: string, wordlist: string[]): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Internal function to detect the wordlist used to generate the mnemonic.
|
|
64
|
+
*
|
|
65
|
+
* @param {String} mnemonic - The mnemonic string
|
|
66
|
+
* @returns {Array} the wordlist or null
|
|
67
|
+
*/
|
|
15
68
|
static _getDictionary(mnemonic?: string): string[] | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Will generate a seed based on the mnemonic and optional passphrase.
|
|
71
|
+
*
|
|
72
|
+
* @param {String} [passphrase]
|
|
73
|
+
* @returns {Buffer}
|
|
74
|
+
*/
|
|
16
75
|
toSeed(passphrase?: string): Buffer;
|
|
76
|
+
/**
|
|
77
|
+
* Will generate a Mnemonic object based on a seed.
|
|
78
|
+
*
|
|
79
|
+
* @param {Buffer} [seed]
|
|
80
|
+
* @param {string} [wordlist]
|
|
81
|
+
* @returns {Mnemonic}
|
|
82
|
+
*/
|
|
17
83
|
static fromSeed(seed: Buffer, wordlist?: string[]): Mnemonic;
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
* Generates a HD Private Key from a Mnemonic.
|
|
87
|
+
* Optionally receive a passphrase and Lotus network.
|
|
88
|
+
*
|
|
89
|
+
* @param {String=} [passphrase]
|
|
90
|
+
* @param {Network|String|number=} [network] - The network: 'livenet', 'testnet', or 'regtest
|
|
91
|
+
* @returns {HDPrivateKey}
|
|
92
|
+
*/
|
|
18
93
|
toHDPrivateKey(passphrase?: string, network?: Network | NetworkName): HDPrivateKey;
|
|
94
|
+
/**
|
|
95
|
+
* Will return a the string representation of the mnemonic
|
|
96
|
+
*
|
|
97
|
+
* @returns {String} Mnemonic
|
|
98
|
+
*/
|
|
19
99
|
toString(): string;
|
|
100
|
+
/**
|
|
101
|
+
* Will return a string formatted for the console
|
|
102
|
+
*
|
|
103
|
+
* @returns {String} Mnemonic
|
|
104
|
+
*/
|
|
20
105
|
inspect(): string;
|
|
106
|
+
/**
|
|
107
|
+
* Internal function to generate a random mnemonic
|
|
108
|
+
*
|
|
109
|
+
* @param {Number} ENT - Entropy size, defaults to 128
|
|
110
|
+
* @param {Array} wordlist - Array of words to generate the mnemonic
|
|
111
|
+
* @returns {String} Mnemonic string
|
|
112
|
+
*/
|
|
21
113
|
static _mnemonic(ENT: number, wordlist: string[]): string;
|
|
114
|
+
/**
|
|
115
|
+
* Internal function to generate mnemonic based on entropy
|
|
116
|
+
*
|
|
117
|
+
* @param {Buffer} entropy - Entropy buffer
|
|
118
|
+
* @param {Array} wordlist - Array of words to generate the mnemonic
|
|
119
|
+
* @returns {String} Mnemonic string
|
|
120
|
+
*/
|
|
22
121
|
static _entropy2mnemonic(entropy: Buffer, wordlist: string[]): string;
|
|
122
|
+
/**
|
|
123
|
+
* Internal function to create checksum of entropy
|
|
124
|
+
*
|
|
125
|
+
* @param {Buffer} entropy
|
|
126
|
+
* @returns {string} Checksum of entropy length / 32
|
|
127
|
+
* @private
|
|
128
|
+
*/
|
|
23
129
|
static _entropyChecksum(entropy: Buffer): string;
|
|
24
130
|
}
|
|
25
131
|
export default Mnemonic;
|