@neuraiproject/neurai-key 2.8.4 → 2.8.5
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/.vscode/settings.json +3 -0
- package/README.md +31 -4
- package/dist/NeuraiKey.js +32279 -32111
- package/dist/main.js +26 -8
- package/dist/main.js.map +1 -1
- package/dist/module.js +27 -6
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/index.ts +33 -6
- package/package.json +3 -2
- package/test-html/NeuraiKey.js +32279 -32111
- package/test-html/index.html +12 -1
- package/test.js +18 -0
- package/types.ts +1 -0
package/test-html/index.html
CHANGED
|
@@ -450,6 +450,11 @@
|
|
|
450
450
|
<span class="info-label">Path:</span>
|
|
451
451
|
<span class="info-value">${addressPair.external.path}</span>
|
|
452
452
|
</div>
|
|
453
|
+
<div class="address-info">
|
|
454
|
+
<span class="info-label">Public Key:</span>
|
|
455
|
+
<span class="info-value">${addressPair.external.publicKey}</span>
|
|
456
|
+
<button class="copy-btn" onclick="copiarTexto('${addressPair.external.publicKey}', this)">📋</button>
|
|
457
|
+
</div>
|
|
453
458
|
<div class="address-info">
|
|
454
459
|
<span class="info-label">Private Key:</span>
|
|
455
460
|
<span class="info-value">${addressPair.external.privateKey}</span>
|
|
@@ -476,6 +481,11 @@
|
|
|
476
481
|
<span class="info-label">Path:</span>
|
|
477
482
|
<span class="info-value">${addressPair.internal.path}</span>
|
|
478
483
|
</div>
|
|
484
|
+
<div class="address-info">
|
|
485
|
+
<span class="info-label">Public Key:</span>
|
|
486
|
+
<span class="info-value">${addressPair.internal.publicKey}</span>
|
|
487
|
+
<button class="copy-btn" onclick="copiarTexto('${addressPair.internal.publicKey}', this)">📋</button>
|
|
488
|
+
</div>
|
|
479
489
|
<div class="address-info">
|
|
480
490
|
<span class="info-label">Private Key:</span>
|
|
481
491
|
<span class="info-value">${addressPair.internal.privateKey}</span>
|
|
@@ -501,7 +511,8 @@
|
|
|
501
511
|
- The first 5 addresses (external and internal) have been generated<br>
|
|
502
512
|
- <strong>External</strong> addresses are used to receive payments<br>
|
|
503
513
|
- <strong>Internal</strong> addresses are used as change addresses<br>
|
|
504
|
-
- Each pair follows the BIP44 standard with path m/44'/175'/0'/change/index
|
|
514
|
+
- Each pair follows the BIP44 standard with path m/44'/175'/0'/change/index<br>
|
|
515
|
+
- Public keys can be converted back into addresses with <code>NeuraiKey.publicKeyToAddress</code>${passphraseInfo}
|
|
505
516
|
`;
|
|
506
517
|
resultsDiv.appendChild(infoDiv);
|
|
507
518
|
|
package/test.js
CHANGED
|
@@ -63,6 +63,15 @@ test("Validate Wallet Import Format (WIF) main-net ", () => {
|
|
|
63
63
|
expect(address.external.WIF).toBe("KwWavecys1Qskgzwsyv6CNeTospWkvMeLzx3dLqeV4xAJEMXF8Qq");
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
+
test("Convert external public key to main-net address", () => {
|
|
67
|
+
const mnemonic = "result pact model attract result puzzle final boss private educate luggage era";
|
|
68
|
+
const pair = NeuraiKey.getAddressPair("xna", mnemonic, 0, 1);
|
|
69
|
+
|
|
70
|
+
expect(NeuraiKey.publicKeyToAddress("xna", pair.external.publicKey)).toBe(
|
|
71
|
+
pair.external.address
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
|
|
66
75
|
test("Validate Wallet Import Format (WIF) test-net ", () => {
|
|
67
76
|
const network = "xna-test";
|
|
68
77
|
const mnemonic = "result pact model attract result puzzle final boss private educate luggage era";
|
|
@@ -71,6 +80,15 @@ test("Validate Wallet Import Format (WIF) test-net ", () => {
|
|
|
71
80
|
expect(address.external.WIF).toBe("cSfwLzc9DNj4PdzyGK1sAZzxNwih2HaezMrT8w4MXyhf8qhaHJiE");
|
|
72
81
|
});
|
|
73
82
|
|
|
83
|
+
test("Convert external public key to test-net address", () => {
|
|
84
|
+
const mnemonic = "result pact model attract result puzzle final boss private educate luggage era";
|
|
85
|
+
const pair = NeuraiKey.getAddressPair("xna-test", mnemonic, 0, 1);
|
|
86
|
+
|
|
87
|
+
expect(NeuraiKey.publicKeyToAddress("xna-test", pair.external.publicKey)).toBe(
|
|
88
|
+
pair.external.address
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
|
|
74
92
|
test("Validate get public address from Wallet Import Format (WIF) main-net ", () => {
|
|
75
93
|
const network = "xna";
|
|
76
94
|
const WIF = "KwWavecys1Qskgzwsyv6CNeTospWkvMeLzx3dLqeV4xAJEMXF8Qq";
|