quantumcoin 6.14.2 → 6.14.4

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 (161) hide show
  1. package/README.md +12 -22
  2. package/dist/README.md +1 -1
  3. package/lib.commonjs/_version.js +1 -1
  4. package/lib.commonjs/crypto/signing-key.d.ts +1 -1
  5. package/lib.commonjs/crypto/signing-key.d.ts.map +1 -1
  6. package/lib.commonjs/crypto/signing-key.js +14 -8
  7. package/lib.commonjs/crypto/signing-key.js.map +1 -1
  8. package/lib.commonjs/quantumcoin.d.ts +2 -0
  9. package/lib.commonjs/quantumcoin.d.ts.map +1 -1
  10. package/lib.commonjs/quantumcoin.js +11 -5
  11. package/lib.commonjs/quantumcoin.js.map +1 -1
  12. package/lib.commonjs/transaction/address.d.ts.map +1 -1
  13. package/lib.commonjs/transaction/address.js +8 -3
  14. package/lib.commonjs/transaction/address.js.map +1 -1
  15. package/lib.commonjs/wallet/json-keystore.d.ts.map +1 -1
  16. package/lib.commonjs/wallet/json-keystore.js +7 -7
  17. package/lib.commonjs/wallet/json-keystore.js.map +1 -1
  18. package/lib.commonjs/wallet/wallet.d.ts.map +1 -1
  19. package/lib.commonjs/wallet/wallet.js +2 -2
  20. package/lib.commonjs/wallet/wallet.js.map +1 -1
  21. package/lib.esm/_version.js +1 -1
  22. package/lib.esm/crypto/signing-key.d.ts +1 -1
  23. package/lib.esm/crypto/signing-key.d.ts.map +1 -1
  24. package/lib.esm/crypto/signing-key.js +15 -8
  25. package/lib.esm/crypto/signing-key.js.map +1 -1
  26. package/lib.esm/quantumcoin.d.ts +2 -0
  27. package/lib.esm/quantumcoin.d.ts.map +1 -1
  28. package/lib.esm/quantumcoin.js +6 -0
  29. package/lib.esm/quantumcoin.js.map +1 -1
  30. package/lib.esm/transaction/address.d.ts.map +1 -1
  31. package/lib.esm/transaction/address.js +8 -2
  32. package/lib.esm/transaction/address.js.map +1 -1
  33. package/lib.esm/wallet/json-keystore.d.ts.map +1 -1
  34. package/lib.esm/wallet/json-keystore.js +11 -5
  35. package/lib.esm/wallet/json-keystore.js.map +1 -1
  36. package/lib.esm/wallet/wallet.d.ts.map +1 -1
  37. package/lib.esm/wallet/wallet.js +3 -1
  38. package/lib.esm/wallet/wallet.js.map +1 -1
  39. package/package.json +6 -5
  40. package/src.ts/_version.ts +1 -1
  41. package/src.ts/crypto/signing-key.ts +14 -9
  42. package/src.ts/quantumcoin.ts +10 -2
  43. package/src.ts/transaction/address.ts +7 -3
  44. package/src.ts/wallet/json-keystore.ts +8 -6
  45. package/src.ts/wallet/wallet.ts +2 -3
  46. package/dist/quantumcoin.js +0 -21137
  47. package/dist/quantumcoin.js.map +0 -1
  48. package/dist/quantumcoin.min.js +0 -1
  49. package/dist/quantumcoin.min.js'.gz' +0 -0
  50. package/dist/quantumcoin.umd.js +0 -21316
  51. package/dist/quantumcoin.umd.js.map +0 -1
  52. package/dist/quantumcoin.umd.min.js +0 -1
  53. package/dist/quantumcoin.umd.min.js'.gz' +0 -0
  54. package/dist/wordlists-extra.js +0 -1500
  55. package/dist/wordlists-extra.js.map +0 -1
  56. package/dist/wordlists-extra.min.js +0 -1
  57. package/dist/wordlists-extra.min.js'.gz' +0 -0
  58. package/lib.commonjs/providers/provider-alchemy.d.ts +0 -50
  59. package/lib.commonjs/providers/provider-alchemy.d.ts.map +0 -1
  60. package/lib.commonjs/providers/provider-alchemy.js +0 -151
  61. package/lib.commonjs/providers/provider-alchemy.js.map +0 -1
  62. package/lib.commonjs/providers/provider-ankr.d.ts +0 -61
  63. package/lib.commonjs/providers/provider-ankr.d.ts.map +0 -1
  64. package/lib.commonjs/providers/provider-ankr.js +0 -137
  65. package/lib.commonjs/providers/provider-ankr.js.map +0 -1
  66. package/lib.commonjs/providers/provider-blockscout.d.ts +0 -59
  67. package/lib.commonjs/providers/provider-blockscout.d.ts.map +0 -1
  68. package/lib.commonjs/providers/provider-blockscout.js +0 -145
  69. package/lib.commonjs/providers/provider-blockscout.js.map +0 -1
  70. package/lib.commonjs/providers/provider-chainstack.d.ts +0 -46
  71. package/lib.commonjs/providers/provider-chainstack.d.ts.map +0 -1
  72. package/lib.commonjs/providers/provider-chainstack.js +0 -102
  73. package/lib.commonjs/providers/provider-chainstack.js.map +0 -1
  74. package/lib.commonjs/providers/provider-cloudflare.d.ts +0 -14
  75. package/lib.commonjs/providers/provider-cloudflare.d.ts.map +0 -1
  76. package/lib.commonjs/providers/provider-cloudflare.js +0 -26
  77. package/lib.commonjs/providers/provider-cloudflare.js.map +0 -1
  78. package/lib.commonjs/providers/provider-etherscan.d.ts +0 -147
  79. package/lib.commonjs/providers/provider-etherscan.d.ts.map +0 -1
  80. package/lib.commonjs/providers/provider-etherscan.js +0 -587
  81. package/lib.commonjs/providers/provider-etherscan.js.map +0 -1
  82. package/lib.commonjs/providers/provider-infura.d.ts +0 -101
  83. package/lib.commonjs/providers/provider-infura.d.ts.map +0 -1
  84. package/lib.commonjs/providers/provider-infura.js +0 -206
  85. package/lib.commonjs/providers/provider-infura.js.map +0 -1
  86. package/lib.commonjs/providers/provider-pocket.d.ts +0 -54
  87. package/lib.commonjs/providers/provider-pocket.d.ts.map +0 -1
  88. package/lib.commonjs/providers/provider-pocket.js +0 -109
  89. package/lib.commonjs/providers/provider-pocket.js.map +0 -1
  90. package/lib.commonjs/providers/provider-quicknode.d.ts +0 -59
  91. package/lib.commonjs/providers/provider-quicknode.d.ts.map +0 -1
  92. package/lib.commonjs/providers/provider-quicknode.js +0 -163
  93. package/lib.commonjs/providers/provider-quicknode.js.map +0 -1
  94. package/lib.commonjs/wallet/hdwallet.d.ts +0 -248
  95. package/lib.commonjs/wallet/hdwallet.d.ts.map +0 -1
  96. package/lib.commonjs/wallet/hdwallet.js +0 -505
  97. package/lib.commonjs/wallet/hdwallet.js.map +0 -1
  98. package/lib.commonjs/wallet/json-crowdsale.d.ts +0 -27
  99. package/lib.commonjs/wallet/json-crowdsale.d.ts.map +0 -1
  100. package/lib.commonjs/wallet/json-crowdsale.js +0 -60
  101. package/lib.commonjs/wallet/json-crowdsale.js.map +0 -1
  102. package/lib.commonjs/wallet/mnemonic.d.ts +0 -65
  103. package/lib.commonjs/wallet/mnemonic.d.ts.map +0 -1
  104. package/lib.commonjs/wallet/mnemonic.js +0 -169
  105. package/lib.commonjs/wallet/mnemonic.js.map +0 -1
  106. package/lib.commonjs/wallet/seedwallet.d.ts +0 -4
  107. package/lib.commonjs/wallet/seedwallet.d.ts.map +0 -1
  108. package/lib.commonjs/wallet/seedwallet.js +0 -8
  109. package/lib.commonjs/wallet/seedwallet.js.map +0 -1
  110. package/lib.esm/providers/provider-alchemy.d.ts +0 -50
  111. package/lib.esm/providers/provider-alchemy.d.ts.map +0 -1
  112. package/lib.esm/providers/provider-alchemy.js +0 -147
  113. package/lib.esm/providers/provider-alchemy.js.map +0 -1
  114. package/lib.esm/providers/provider-ankr.d.ts +0 -61
  115. package/lib.esm/providers/provider-ankr.d.ts.map +0 -1
  116. package/lib.esm/providers/provider-ankr.js +0 -133
  117. package/lib.esm/providers/provider-ankr.js.map +0 -1
  118. package/lib.esm/providers/provider-blockscout.d.ts +0 -59
  119. package/lib.esm/providers/provider-blockscout.d.ts.map +0 -1
  120. package/lib.esm/providers/provider-blockscout.js +0 -141
  121. package/lib.esm/providers/provider-blockscout.js.map +0 -1
  122. package/lib.esm/providers/provider-chainstack.d.ts +0 -46
  123. package/lib.esm/providers/provider-chainstack.d.ts.map +0 -1
  124. package/lib.esm/providers/provider-chainstack.js +0 -98
  125. package/lib.esm/providers/provider-chainstack.js.map +0 -1
  126. package/lib.esm/providers/provider-cloudflare.d.ts +0 -14
  127. package/lib.esm/providers/provider-cloudflare.d.ts.map +0 -1
  128. package/lib.esm/providers/provider-cloudflare.js +0 -22
  129. package/lib.esm/providers/provider-cloudflare.js.map +0 -1
  130. package/lib.esm/providers/provider-etherscan.d.ts +0 -147
  131. package/lib.esm/providers/provider-etherscan.d.ts.map +0 -1
  132. package/lib.esm/providers/provider-etherscan.js +0 -584
  133. package/lib.esm/providers/provider-etherscan.js.map +0 -1
  134. package/lib.esm/providers/provider-infura.d.ts +0 -101
  135. package/lib.esm/providers/provider-infura.d.ts.map +0 -1
  136. package/lib.esm/providers/provider-infura.js +0 -201
  137. package/lib.esm/providers/provider-infura.js.map +0 -1
  138. package/lib.esm/providers/provider-pocket.d.ts +0 -54
  139. package/lib.esm/providers/provider-pocket.d.ts.map +0 -1
  140. package/lib.esm/providers/provider-pocket.js +0 -105
  141. package/lib.esm/providers/provider-pocket.js.map +0 -1
  142. package/lib.esm/providers/provider-quicknode.d.ts +0 -59
  143. package/lib.esm/providers/provider-quicknode.d.ts.map +0 -1
  144. package/lib.esm/providers/provider-quicknode.js +0 -159
  145. package/lib.esm/providers/provider-quicknode.js.map +0 -1
  146. package/lib.esm/wallet/hdwallet.d.ts +0 -248
  147. package/lib.esm/wallet/hdwallet.d.ts.map +0 -1
  148. package/lib.esm/wallet/hdwallet.js +0 -498
  149. package/lib.esm/wallet/hdwallet.js.map +0 -1
  150. package/lib.esm/wallet/json-crowdsale.d.ts +0 -27
  151. package/lib.esm/wallet/json-crowdsale.d.ts.map +0 -1
  152. package/lib.esm/wallet/json-crowdsale.js +0 -55
  153. package/lib.esm/wallet/json-crowdsale.js.map +0 -1
  154. package/lib.esm/wallet/mnemonic.d.ts +0 -65
  155. package/lib.esm/wallet/mnemonic.d.ts.map +0 -1
  156. package/lib.esm/wallet/mnemonic.js +0 -165
  157. package/lib.esm/wallet/mnemonic.js.map +0 -1
  158. package/lib.esm/wallet/seedwallet.d.ts +0 -4
  159. package/lib.esm/wallet/seedwallet.d.ts.map +0 -1
  160. package/lib.esm/wallet/seedwallet.js +0 -4
  161. package/lib.esm/wallet/seedwallet.js.map +0 -1
@@ -1,498 +0,0 @@
1
- /**
2
- * Explain HD Wallets..
3
- *
4
- * @_subsection: api/wallet:HD Wallets [hd-wallets]
5
- */
6
- import { computeHmac, randomBytes, ripemd160, SigningKey, sha256 } from "../crypto/index.js";
7
- import { VoidSigner } from "../providers/index.js";
8
- import { computeAddress } from "../transaction/index.js";
9
- import { concat, dataSlice, decodeBase58, defineProperties, encodeBase58, getBytes, hexlify, isBytesLike, getNumber, toBeArray, toBigInt, toBeHex, assertPrivate, assert, assertArgument } from "../utils/index.js";
10
- import { LangEn } from "../wordlists/lang-en.js";
11
- import { BaseWallet } from "./base-wallet.js";
12
- import { Mnemonic } from "./mnemonic.js";
13
- import { encryptKeystoreJson, encryptKeystoreJsonSync, } from "./json-keystore.js";
14
- /**
15
- * The default derivation path for Ethereum HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``)
16
- */
17
- export const defaultPath = "m/44'/60'/0'/0/0";
18
- // "Bitcoin seed"
19
- const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]);
20
- const HardenedBit = 0x80000000;
21
- const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
22
- const Nibbles = "0123456789abcdef";
23
- function zpad(value, length) {
24
- let result = "";
25
- while (value) {
26
- result = Nibbles[value % 16] + result;
27
- value = Math.trunc(value / 16);
28
- }
29
- while (result.length < length * 2) {
30
- result = "0" + result;
31
- }
32
- return "0x" + result;
33
- }
34
- function encodeBase58Check(_value) {
35
- const value = getBytes(_value);
36
- const check = dataSlice(sha256(sha256(value)), 0, 4);
37
- const bytes = concat([value, check]);
38
- return encodeBase58(bytes);
39
- }
40
- const _guard = {};
41
- function ser_I(index, chainCode, publicKey, privateKey) {
42
- const data = new Uint8Array(37);
43
- if (index & HardenedBit) {
44
- assert(privateKey != null, "cannot derive child of neutered node", "UNSUPPORTED_OPERATION", {
45
- operation: "deriveChild"
46
- });
47
- // Data = 0x00 || ser_256(k_par)
48
- data.set(getBytes(privateKey), 1);
49
- }
50
- else {
51
- // Data = ser_p(point(k_par))
52
- data.set(getBytes(publicKey));
53
- }
54
- // Data += ser_32(i)
55
- for (let i = 24; i >= 0; i -= 8) {
56
- data[33 + (i >> 3)] = ((index >> (24 - i)) & 0xff);
57
- }
58
- const I = getBytes(computeHmac("sha512", chainCode, data));
59
- return { IL: I.slice(0, 32), IR: I.slice(32) };
60
- }
61
- function derivePath(node, path) {
62
- const components = path.split("/");
63
- assertArgument(components.length > 0, "invalid path", "path", path);
64
- if (components[0] === "m") {
65
- assertArgument(node.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`, "path", path);
66
- components.shift();
67
- }
68
- let result = node;
69
- for (let i = 0; i < components.length; i++) {
70
- const component = components[i];
71
- if (component.match(/^[0-9]+'$/)) {
72
- const index = parseInt(component.substring(0, component.length - 1));
73
- assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component);
74
- result = result.deriveChild(HardenedBit + index);
75
- }
76
- else if (component.match(/^[0-9]+$/)) {
77
- const index = parseInt(component);
78
- assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component);
79
- result = result.deriveChild(index);
80
- }
81
- else {
82
- assertArgument(false, "invalid path component", `path[${i}]`, component);
83
- }
84
- }
85
- return result;
86
- }
87
- /**
88
- * An **HDNodeWallet** is a [[Signer]] backed by the private key derived
89
- * from an HD Node using the [[link-bip-32]] stantard.
90
- *
91
- * An HD Node forms a hierarchal structure with each HD Node having a
92
- * private key and the ability to derive child HD Nodes, defined by
93
- * a path indicating the index of each child.
94
- */
95
- export class HDNodeWallet extends BaseWallet {
96
- /**
97
- * The compressed public key.
98
- */
99
- publicKey;
100
- /**
101
- * The fingerprint.
102
- *
103
- * A fingerprint allows quick qay to detect parent and child nodes,
104
- * but developers should be prepared to deal with collisions as it
105
- * is only 4 bytes.
106
- */
107
- fingerprint;
108
- /**
109
- * The parent fingerprint.
110
- */
111
- parentFingerprint;
112
- /**
113
- * The mnemonic used to create this HD Node, if available.
114
- *
115
- * Sources such as extended keys do not encode the mnemonic, in
116
- * which case this will be ``null``.
117
- */
118
- mnemonic;
119
- /**
120
- * The chaincode, which is effectively a public key used
121
- * to derive children.
122
- */
123
- chainCode;
124
- /**
125
- * The derivation path of this wallet.
126
- *
127
- * Since extended keys do not provide full path details, this
128
- * may be ``null``, if instantiated from a source that does not
129
- * encode it.
130
- */
131
- path;
132
- /**
133
- * The child index of this wallet. Values over ``2 *\* 31`` indicate
134
- * the node is hardened.
135
- */
136
- index;
137
- /**
138
- * The depth of this wallet, which is the number of components
139
- * in its path.
140
- */
141
- depth;
142
- /**
143
- * @private
144
- */
145
- constructor(guard, signingKey, parentFingerprint, chainCode, path, index, depth, mnemonic, provider) {
146
- super(signingKey, provider);
147
- assertPrivate(guard, _guard, "HDNodeWallet");
148
- defineProperties(this, { publicKey: signingKey.publicKey });
149
- const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);
150
- defineProperties(this, {
151
- parentFingerprint, fingerprint,
152
- chainCode, path, index, depth
153
- });
154
- defineProperties(this, { mnemonic });
155
- }
156
- connect(provider) {
157
- return new HDNodeWallet(_guard, this.signingKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider);
158
- }
159
- #account() {
160
- const account = { address: this.address, privateKey: this.privateKey };
161
- const m = this.mnemonic;
162
- if (this.path && m && m.wordlist.locale === "en" && m.password === "") {
163
- account.mnemonic = {
164
- path: this.path,
165
- locale: "en",
166
- entropy: m.entropy
167
- };
168
- }
169
- return account;
170
- }
171
- /**
172
- * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with
173
- * %%password%%.
174
- *
175
- * If %%progressCallback%% is specified, it will receive periodic
176
- * updates as the encryption process progreses.
177
- */
178
- async encrypt(password, progressCallback) {
179
- return await encryptKeystoreJson(this.#account(), password, { progressCallback });
180
- }
181
- /**
182
- * Returns a [JSON Keystore Wallet](json-wallets) encryped with
183
- * %%password%%.
184
- *
185
- * It is preferred to use the [async version](encrypt) instead,
186
- * which allows a [[ProgressCallback]] to keep the user informed.
187
- *
188
- * This method will block the event loop (freezing all UI) until
189
- * it is complete, which may be a non-trivial duration.
190
- */
191
- encryptSync(password) {
192
- return encryptKeystoreJsonSync(this.#account(), password);
193
- }
194
- /**
195
- * The extended key.
196
- *
197
- * This key will begin with the prefix ``xpriv`` and can be used to
198
- * reconstruct this HD Node to derive its children.
199
- */
200
- get extendedKey() {
201
- // We only support the mainnet values for now, but if anyone needs
202
- // testnet values, let me know. I believe current sentiment is that
203
- // we should always use mainnet, and use BIP-44 to derive the network
204
- // - Mainnet: public=0x0488B21E, private=0x0488ADE4
205
- // - Testnet: public=0x043587CF, private=0x04358394
206
- assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" });
207
- return encodeBase58Check(concat([
208
- "0x0488ADE4", zpad(this.depth, 1), this.parentFingerprint,
209
- zpad(this.index, 4), this.chainCode,
210
- concat(["0x00", this.privateKey])
211
- ]));
212
- }
213
- /**
214
- * Returns true if this wallet has a path, providing a Type Guard
215
- * that the path is non-null.
216
- */
217
- hasPath() { return (this.path != null); }
218
- /**
219
- * Returns a neutered HD Node, which removes the private details
220
- * of an HD Node.
221
- *
222
- * A neutered node has no private key, but can be used to derive
223
- * child addresses and other public data about the HD Node.
224
- */
225
- neuter() {
226
- return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.provider);
227
- }
228
- /**
229
- * Return the child for %%index%%.
230
- */
231
- deriveChild(_index) {
232
- const index = getNumber(_index, "index");
233
- assertArgument(index <= 0xffffffff, "invalid index", "index", index);
234
- // Base path
235
- let path = this.path;
236
- if (path) {
237
- path += "/" + (index & ~HardenedBit);
238
- if (index & HardenedBit) {
239
- path += "'";
240
- }
241
- }
242
- const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, this.privateKey);
243
- const ki = new SigningKey(toBeHex((toBigInt(IL) + BigInt(this.privateKey)) % N, 32));
244
- return new HDNodeWallet(_guard, ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.mnemonic, this.provider);
245
- }
246
- /**
247
- * Return the HDNode for %%path%% from this node.
248
- */
249
- derivePath(path) {
250
- return derivePath(this, path);
251
- }
252
- static #fromSeed(_seed, mnemonic) {
253
- assertArgument(isBytesLike(_seed), "invalid seed", "seed", "[REDACTED]");
254
- const seed = getBytes(_seed, "seed");
255
- assertArgument(seed.length >= 16 && seed.length <= 64, "invalid seed", "seed", "[REDACTED]");
256
- const I = getBytes(computeHmac("sha512", MasterSecret, seed));
257
- const signingKey = new SigningKey(hexlify(I.slice(0, 32)));
258
- return new HDNodeWallet(_guard, signingKey, "0x00000000", hexlify(I.slice(32)), "m", 0, 0, mnemonic, null);
259
- }
260
- /**
261
- * Creates a new HD Node from %%extendedKey%%.
262
- *
263
- * If the %%extendedKey%% will either have a prefix or ``xpub`` or
264
- * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]])
265
- * or full HD Node ([[HDNodeWallet) respectively.
266
- */
267
- static fromExtendedKey(extendedKey) {
268
- const bytes = toBeArray(decodeBase58(extendedKey)); // @TODO: redact
269
- assertArgument(bytes.length === 82 || encodeBase58Check(bytes.slice(0, 78)) === extendedKey, "invalid extended key", "extendedKey", "[ REDACTED ]");
270
- const depth = bytes[4];
271
- const parentFingerprint = hexlify(bytes.slice(5, 9));
272
- const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16);
273
- const chainCode = hexlify(bytes.slice(13, 45));
274
- const key = bytes.slice(45, 78);
275
- switch (hexlify(bytes.slice(0, 4))) {
276
- // Public Key
277
- case "0x0488b21e":
278
- case "0x043587cf": {
279
- const publicKey = hexlify(key);
280
- return new HDNodeVoidWallet(_guard, computeAddress(publicKey), publicKey, parentFingerprint, chainCode, null, index, depth, null);
281
- }
282
- // Private Key
283
- case "0x0488ade4":
284
- case "0x04358394 ":
285
- if (key[0] !== 0) {
286
- break;
287
- }
288
- return new HDNodeWallet(_guard, new SigningKey(key.slice(1)), parentFingerprint, chainCode, null, index, depth, null, null);
289
- }
290
- assertArgument(false, "invalid extended key prefix", "extendedKey", "[ REDACTED ]");
291
- }
292
- /**
293
- * Creates a new random HDNode.
294
- */
295
- static createRandom(password, path, wordlist) {
296
- if (password == null) {
297
- password = "";
298
- }
299
- if (path == null) {
300
- path = defaultPath;
301
- }
302
- if (wordlist == null) {
303
- wordlist = LangEn.wordlist();
304
- }
305
- const mnemonic = Mnemonic.fromEntropy(randomBytes(16), password, wordlist);
306
- return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path);
307
- }
308
- /**
309
- * Create an HD Node from %%mnemonic%%.
310
- */
311
- static fromMnemonic(mnemonic, path) {
312
- if (!path) {
313
- path = defaultPath;
314
- }
315
- return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path);
316
- }
317
- /**
318
- * Creates an HD Node from a mnemonic %%phrase%%.
319
- */
320
- static fromPhrase(phrase, password, path, wordlist) {
321
- if (password == null) {
322
- password = "";
323
- }
324
- if (path == null) {
325
- path = defaultPath;
326
- }
327
- if (wordlist == null) {
328
- wordlist = LangEn.wordlist();
329
- }
330
- const mnemonic = Mnemonic.fromPhrase(phrase, password, wordlist);
331
- return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path);
332
- }
333
- /**
334
- * Creates an HD Node from a %%seed%%.
335
- */
336
- static fromSeed(seed) {
337
- return HDNodeWallet.#fromSeed(seed, null);
338
- }
339
- }
340
- /**
341
- * A **HDNodeVoidWallet** cannot sign, but provides access to
342
- * the children nodes of a [[link-bip-32]] HD wallet addresses.
343
- *
344
- * The can be created by using an extended ``xpub`` key to
345
- * [[HDNodeWallet_fromExtendedKey]] or by
346
- * [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]].
347
- */
348
- export class HDNodeVoidWallet extends VoidSigner {
349
- /**
350
- * The compressed public key.
351
- */
352
- publicKey;
353
- /**
354
- * The fingerprint.
355
- *
356
- * A fingerprint allows quick qay to detect parent and child nodes,
357
- * but developers should be prepared to deal with collisions as it
358
- * is only 4 bytes.
359
- */
360
- fingerprint;
361
- /**
362
- * The parent node fingerprint.
363
- */
364
- parentFingerprint;
365
- /**
366
- * The chaincode, which is effectively a public key used
367
- * to derive children.
368
- */
369
- chainCode;
370
- /**
371
- * The derivation path of this wallet.
372
- *
373
- * Since extended keys do not provider full path details, this
374
- * may be ``null``, if instantiated from a source that does not
375
- * enocde it.
376
- */
377
- path;
378
- /**
379
- * The child index of this wallet. Values over ``2 *\* 31`` indicate
380
- * the node is hardened.
381
- */
382
- index;
383
- /**
384
- * The depth of this wallet, which is the number of components
385
- * in its path.
386
- */
387
- depth;
388
- /**
389
- * @private
390
- */
391
- constructor(guard, address, publicKey, parentFingerprint, chainCode, path, index, depth, provider) {
392
- super(address, provider);
393
- assertPrivate(guard, _guard, "HDNodeVoidWallet");
394
- defineProperties(this, { publicKey });
395
- const fingerprint = dataSlice(ripemd160(sha256(publicKey)), 0, 4);
396
- defineProperties(this, {
397
- publicKey, fingerprint, parentFingerprint, chainCode, path, index, depth
398
- });
399
- }
400
- connect(provider) {
401
- return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, provider);
402
- }
403
- /**
404
- * The extended key.
405
- *
406
- * This key will begin with the prefix ``xpub`` and can be used to
407
- * reconstruct this neutered key to derive its children addresses.
408
- */
409
- get extendedKey() {
410
- // We only support the mainnet values for now, but if anyone needs
411
- // testnet values, let me know. I believe current sentiment is that
412
- // we should always use mainnet, and use BIP-44 to derive the network
413
- // - Mainnet: public=0x0488B21E, private=0x0488ADE4
414
- // - Testnet: public=0x043587CF, private=0x04358394
415
- assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" });
416
- return encodeBase58Check(concat([
417
- "0x0488B21E",
418
- zpad(this.depth, 1),
419
- this.parentFingerprint,
420
- zpad(this.index, 4),
421
- this.chainCode,
422
- this.publicKey,
423
- ]));
424
- }
425
- /**
426
- * Returns true if this wallet has a path, providing a Type Guard
427
- * that the path is non-null.
428
- */
429
- hasPath() { return (this.path != null); }
430
- /**
431
- * Return the child for %%index%%.
432
- */
433
- deriveChild(_index) {
434
- const index = getNumber(_index, "index");
435
- assertArgument(index <= 0xffffffff, "invalid index", "index", index);
436
- // Base path
437
- let path = this.path;
438
- if (path) {
439
- path += "/" + (index & ~HardenedBit);
440
- if (index & HardenedBit) {
441
- path += "'";
442
- }
443
- }
444
- const Ki = "";
445
- const address = "";
446
- return new HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, hexlify(""), path, index, this.depth + 1, this.provider);
447
- }
448
- /**
449
- * Return the signer for %%path%% from this node.
450
- */
451
- derivePath(path) {
452
- return derivePath(this, path);
453
- }
454
- }
455
- /*
456
- export class HDNodeWalletManager {
457
- #root: HDNodeWallet;
458
-
459
- constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) {
460
- if (password == null) { password = ""; }
461
- if (path == null) { path = "m/44'/60'/0'/0"; }
462
- if (locale == null) { locale = LangEn.wordlist(); }
463
- this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale);
464
- }
465
-
466
- getSigner(index?: number): HDNodeWallet {
467
- return this.#root.deriveChild((index == null) ? 0: index);
468
- }
469
- }
470
- */
471
- /**
472
- * Returns the [[link-bip-32]] path for the account at %%index%%.
473
- *
474
- * This is the pattern used by wallets like Ledger.
475
- *
476
- * There is also an [alternate pattern](getIndexedAccountPath) used by
477
- * some software.
478
- */
479
- export function getAccountPath(_index) {
480
- const index = getNumber(_index, "index");
481
- assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index);
482
- return `m/44'/60'/${index}'/0/0`;
483
- }
484
- /**
485
- * Returns the path using an alternative pattern for deriving accounts,
486
- * at %%index%%.
487
- *
488
- * This derivation path uses the //index// component rather than the
489
- * //account// component to derive sequential accounts.
490
- *
491
- * This is the pattern used by wallets like MetaMask.
492
- */
493
- export function getIndexedAccountPath(_index) {
494
- const index = getNumber(_index, "index");
495
- assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index);
496
- return `m/44'/60'/0'/0/${index}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AAC,CAAC;IAEpD,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,IAAY;QACnB,OAAO,UAAU,CAAmB,IAAI,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;CACJ;AAED;;;;;;;;;;;;;;;EAeE;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,MAAe;IAC1C,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,cAAc,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,WAAW,EAAE,uBAAuB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC3F,OAAO,aAAc,KAAM,OAAO,CAAC;AACvC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAe;IACjD,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,cAAc,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,WAAW,EAAE,uBAAuB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC3F,OAAO,kBAAmB,KAAK,EAAE,CAAC;AACtC,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * @_subsection: api/wallet:JSON Wallets [json-wallets]
3
- */
4
- /**
5
- * The data stored within a JSON Crowdsale wallet is fairly
6
- * minimal.
7
- */
8
- export type CrowdsaleAccount = {
9
- privateKey: string;
10
- address: string;
11
- };
12
- /**
13
- * Returns true if %%json%% is a valid JSON Crowdsale wallet.
14
- */
15
- export declare function isCrowdsaleJson(json: string): boolean;
16
- /**
17
- * Before Ethereum launched, it was necessary to create a wallet
18
- * format for backers to use, which would be used to receive ether
19
- * as a reward for contributing to the project.
20
- *
21
- * The [[link-crowdsale]] format is now obsolete, but it is still
22
- * useful to support and the additional code is fairly trivial as
23
- * all the primitives required are used through core portions of
24
- * the library.
25
- */
26
- export declare function decryptCrowdsaleJson(json: string, _password: string | Uint8Array): CrowdsaleAccount;
27
- //# sourceMappingURL=json-crowdsale.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"json-crowdsale.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMrD;AAID;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,gBAAgB,CA2BnG"}
@@ -1,55 +0,0 @@
1
- /**
2
- * @_subsection: api/wallet:JSON Wallets [json-wallets]
3
- */
4
- import { CBC, pkcs7Strip } from "aes-js";
5
- import { getAddress } from "../address/index.js";
6
- import { pbkdf2 } from "../crypto/index.js";
7
- import { id } from "../hash/index.js";
8
- import { getBytes, assertArgument } from "../utils/index.js";
9
- import { getPassword, looseArrayify, spelunk } from "./utils.js";
10
- /**
11
- * Returns true if %%json%% is a valid JSON Crowdsale wallet.
12
- */
13
- export function isCrowdsaleJson(json) {
14
- try {
15
- const data = JSON.parse(json);
16
- if (data.encseed) {
17
- return true;
18
- }
19
- }
20
- catch (error) { }
21
- return false;
22
- }
23
- // See: https://github.com/ethereum/pyethsaletool
24
- /**
25
- * Before Ethereum launched, it was necessary to create a wallet
26
- * format for backers to use, which would be used to receive ether
27
- * as a reward for contributing to the project.
28
- *
29
- * The [[link-crowdsale]] format is now obsolete, but it is still
30
- * useful to support and the additional code is fairly trivial as
31
- * all the primitives required are used through core portions of
32
- * the library.
33
- */
34
- export function decryptCrowdsaleJson(json, _password) {
35
- const data = JSON.parse(json);
36
- const password = getPassword(_password);
37
- // Ethereum Address
38
- const address = getAddress(spelunk(data, "ethaddr:string!"));
39
- // Encrypted Seed
40
- const encseed = looseArrayify(spelunk(data, "encseed:string!"));
41
- assertArgument(encseed && (encseed.length % 16) === 0, "invalid encseed", "json", json);
42
- const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16);
43
- const iv = encseed.slice(0, 16);
44
- const encryptedSeed = encseed.slice(16);
45
- // Decrypt the seed
46
- const aesCbc = new CBC(key, iv);
47
- const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed)));
48
- // This wallet format is weird... Convert the binary encoded hex to a string.
49
- let seedHex = "";
50
- for (let i = 0; i < seed.length; i++) {
51
- seedHex += String.fromCharCode(seed[i]);
52
- }
53
- return { address, privateKey: id(seedHex) };
54
- }
55
- //# sourceMappingURL=json-crowdsale.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"json-crowdsale.js","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAYjE;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IACxC,IAAI;QACA,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,IAAI,CAAC,OAAO,EAAE;YAAE,OAAO,IAAI,CAAC;SAAE;KACrC;IAAC,OAAO,KAAK,EAAE,GAAG;IACnB,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,iDAAiD;AAEjD;;;;;;;;;G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,CAAC,CAAC;KAC3C;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;AAChD,CAAC"}
@@ -1,65 +0,0 @@
1
- import type { BytesLike } from "../utils/index.js";
2
- import type { Wordlist } from "../wordlists/index.js";
3
- /**
4
- * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]
5
- * seeds and convert between phrases and entropy.
6
- */
7
- export declare class Mnemonic {
8
- /**
9
- * The mnemonic phrase of 12, 15, 18, 21 or 24 words.
10
- *
11
- * Use the [[wordlist]] ``split`` method to get the individual words.
12
- */
13
- readonly phrase: string;
14
- /**
15
- * The password used for this mnemonic. If no password is used this
16
- * is the empty string (i.e. ``""``) as per the specification.
17
- */
18
- readonly password: string;
19
- /**
20
- * The wordlist for this mnemonic.
21
- */
22
- readonly wordlist: Wordlist;
23
- /**
24
- * The underlying entropy which the mnemonic encodes.
25
- */
26
- readonly entropy: string;
27
- /**
28
- * @private
29
- */
30
- constructor(guard: any, entropy: string, phrase: string, password?: null | string, wordlist?: null | Wordlist);
31
- /**
32
- * Returns the seed for the mnemonic.
33
- */
34
- computeSeed(): string;
35
- /**
36
- * Creates a new Mnemonic for the %%phrase%%.
37
- *
38
- * The default %%password%% is the empty string and the default
39
- * wordlist is the [English wordlists](LangEn).
40
- */
41
- static fromPhrase(phrase: string, password?: null | string, wordlist?: null | Wordlist): Mnemonic;
42
- /**
43
- * Create a new **Mnemonic** from the %%entropy%%.
44
- *
45
- * The default %%password%% is the empty string and the default
46
- * wordlist is the [English wordlists](LangEn).
47
- */
48
- static fromEntropy(_entropy: BytesLike, password?: null | string, wordlist?: null | Wordlist): Mnemonic;
49
- /**
50
- * Returns the phrase for %%mnemonic%%.
51
- */
52
- static entropyToPhrase(_entropy: BytesLike, wordlist?: null | Wordlist): string;
53
- /**
54
- * Returns the entropy for %%phrase%%.
55
- */
56
- static phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string;
57
- /**
58
- * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.
59
- *
60
- * This checks all the provided words belong to the %%wordlist%%,
61
- * that the length is valid and the checksum is correct.
62
- */
63
- static isValidMnemonic(phrase: string, wordlist?: null | Wordlist): boolean;
64
- }
65
- //# sourceMappingURL=mnemonic.d.ts.map