@neuraiproject/neurai-key 2.8.6 → 2.8.7
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/LICENSE +1 -1
- package/README.md +15 -1
- package/coins/xna-legacy.js +82 -0
- package/coins/xna.js +82 -0
- package/dist/NeuraiKey.js +452 -3713
- package/dist/main.js +166 -3
- package/dist/main.js.map +1 -1
- package/dist/module.js +166 -3
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/index.ts +6 -2
- package/package.json +5 -6
- package/test.js +5 -5
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -14,8 +14,22 @@ That is, use your 12 words to get addresses for Neurai mainnet and testnet.
|
|
|
14
14
|
- ✅ Support for passphrase (25th word) for additional security
|
|
15
15
|
- ✅ Multi-language mnemonic support (English, Spanish, French, Italian, etc.)
|
|
16
16
|
- ✅ Mainnet and Testnet support for Neurai (XNA)
|
|
17
|
+
- ✅ Support for both XNA (BIP44: 1900) and XNA Legacy (BIP44: 0) networks
|
|
17
18
|
- ✅ Convert raw public keys into Neurai mainnet or testnet addresses
|
|
18
19
|
|
|
20
|
+
## Network Types
|
|
21
|
+
|
|
22
|
+
This library supports two Neurai network configurations:
|
|
23
|
+
|
|
24
|
+
- **`xna` / `xna-test`**: Current Neurai standard (BIP44 coin type: 1900)
|
|
25
|
+
- **`xna-legacy` / `xna-legacy-test`**: Legacy Neurai addresses (BIP44 coin type: 0)
|
|
26
|
+
|
|
27
|
+
The main difference is the BIP44 derivation path:
|
|
28
|
+
- **XNA**: `m/44'/1900'/0'/0/0` (recommended for new wallets)
|
|
29
|
+
- **XNA Legacy**: `m/44'/0'/0'/0/0` (for compatibility with older wallets)
|
|
30
|
+
|
|
31
|
+
**Note**: Using different network types will generate completely different addresses from the same mnemonic.
|
|
32
|
+
|
|
19
33
|
|
|
20
34
|
## Example get external and internal (change) addresses by path
|
|
21
35
|
|
|
@@ -31,7 +45,7 @@ import NeuraiKey from "@neuraiproject/neurai-key";
|
|
|
31
45
|
const mnemonic = NeuraiKey.generateMnemonic();
|
|
32
46
|
const ACCOUNT = 0; //default is zero
|
|
33
47
|
const POSITION = 1; //the second address for this wallet
|
|
34
|
-
const network = "xna"; //or xna-test for testnet
|
|
48
|
+
const network = "xna"; //or xna-test for testnet, xna-legacy for legacy addresses
|
|
35
49
|
const addressPair = NeuraiKey.getAddressPair(
|
|
36
50
|
network,
|
|
37
51
|
mnemonic,
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Neurai Legacy (XNA-LEGACY) chain configuration data
|
|
3
|
+
* This replaces the dependency on @hyperbitjs/chains with only the data needed for Neurai Legacy
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const xnaLegacy = {
|
|
7
|
+
mainnet: {
|
|
8
|
+
name: "Neurai",
|
|
9
|
+
unit: "XNA",
|
|
10
|
+
symbol: "xna",
|
|
11
|
+
decimalPlaces: 100000000,
|
|
12
|
+
messagePrefix: "Neurai Signed Message:\n",
|
|
13
|
+
confirmations: 6,
|
|
14
|
+
website: "https://neurai.org/",
|
|
15
|
+
projectUrl: "https://github.com/NeuraiProject",
|
|
16
|
+
id: "94C49B3B-2C88-4408-B566-3D277C596778",
|
|
17
|
+
network: "mainnet",
|
|
18
|
+
hashGenesisBlock: "00000044d33c0c0ba019be5c0249730424a69cb4c222153322f68c6104484806",
|
|
19
|
+
port: 19000,
|
|
20
|
+
portRpc: 19001,
|
|
21
|
+
protocol: {
|
|
22
|
+
magic: 1381320014
|
|
23
|
+
},
|
|
24
|
+
seedsDns: [
|
|
25
|
+
"seed1.neurai.org",
|
|
26
|
+
"seed2.neurai.org",
|
|
27
|
+
"neurai-ipv4.neuraiexplorer.com"
|
|
28
|
+
],
|
|
29
|
+
versions: {
|
|
30
|
+
bip32: {
|
|
31
|
+
private: 76066276,
|
|
32
|
+
public: 76067358
|
|
33
|
+
},
|
|
34
|
+
bip44: 0,
|
|
35
|
+
private: 128,
|
|
36
|
+
public: 53,
|
|
37
|
+
scripthash: 117
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
testnet: {
|
|
41
|
+
name: "Neurai",
|
|
42
|
+
unit: "XNA",
|
|
43
|
+
symbol: "xna",
|
|
44
|
+
decimalPlaces: 100000000,
|
|
45
|
+
messagePrefix: "Neurai Signed Message:\n",
|
|
46
|
+
confirmations: 6,
|
|
47
|
+
website: "https://neurai.org/",
|
|
48
|
+
projectUrl: "https://github.com/NeuraiProject",
|
|
49
|
+
id: "1EB2ACBA-E8E0-4970-BB20-37DA4B70F6A6",
|
|
50
|
+
network: "testnet",
|
|
51
|
+
hashGenesisBlock: "0000006af8b8297448605b0283473ec712f9768f81cc7eae6269b875dee3b0cf",
|
|
52
|
+
port: 19100,
|
|
53
|
+
portRpc: 19101,
|
|
54
|
+
protocol: {
|
|
55
|
+
magic: 1313166674
|
|
56
|
+
},
|
|
57
|
+
seedsDns: [
|
|
58
|
+
"testnet1.neuracrypt.org",
|
|
59
|
+
"testnet2.neuracrypt.org",
|
|
60
|
+
"testnet3.neuracrypt.org"
|
|
61
|
+
],
|
|
62
|
+
versions: {
|
|
63
|
+
bip32: {
|
|
64
|
+
private: 70615956,
|
|
65
|
+
public: 70617039
|
|
66
|
+
},
|
|
67
|
+
bip44: 1,
|
|
68
|
+
private: 239,
|
|
69
|
+
public: 127,
|
|
70
|
+
scripthash: 196
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const chains = {
|
|
76
|
+
"xna-legacy": xnaLegacy
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
module.exports = {
|
|
80
|
+
xnaLegacy,
|
|
81
|
+
chains
|
|
82
|
+
};
|
package/coins/xna.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Neurai (XNA) chain configuration data
|
|
3
|
+
* This replaces the dependency on @hyperbitjs/chains with only the data needed for Neurai
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const xna = {
|
|
7
|
+
mainnet: {
|
|
8
|
+
name: "Neurai",
|
|
9
|
+
unit: "XNA",
|
|
10
|
+
symbol: "xna",
|
|
11
|
+
decimalPlaces: 100000000,
|
|
12
|
+
messagePrefix: "Neurai Signed Message:\n",
|
|
13
|
+
confirmations: 6,
|
|
14
|
+
website: "https://neurai.org/",
|
|
15
|
+
projectUrl: "https://github.com/NeuraiProject",
|
|
16
|
+
id: "94C49B3B-2C88-4408-B566-3D277C596778",
|
|
17
|
+
network: "mainnet",
|
|
18
|
+
hashGenesisBlock: "00000044d33c0c0ba019be5c0249730424a69cb4c222153322f68c6104484806",
|
|
19
|
+
port: 19000,
|
|
20
|
+
portRpc: 19001,
|
|
21
|
+
protocol: {
|
|
22
|
+
magic: 1381320014
|
|
23
|
+
},
|
|
24
|
+
seedsDns: [
|
|
25
|
+
"seed1.neurai.org",
|
|
26
|
+
"seed2.neurai.org",
|
|
27
|
+
"neurai-ipv4.neuraiexplorer.com"
|
|
28
|
+
],
|
|
29
|
+
versions: {
|
|
30
|
+
bip32: {
|
|
31
|
+
private: 76066276,
|
|
32
|
+
public: 76067358
|
|
33
|
+
},
|
|
34
|
+
bip44: 1900,
|
|
35
|
+
private: 128,
|
|
36
|
+
public: 53,
|
|
37
|
+
scripthash: 117
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
testnet: {
|
|
41
|
+
name: "Neurai",
|
|
42
|
+
unit: "XNA",
|
|
43
|
+
symbol: "xna",
|
|
44
|
+
decimalPlaces: 100000000,
|
|
45
|
+
messagePrefix: "Neurai Signed Message:\n",
|
|
46
|
+
confirmations: 6,
|
|
47
|
+
website: "https://neurai.org/",
|
|
48
|
+
projectUrl: "https://github.com/NeuraiProject",
|
|
49
|
+
id: "1EB2ACBA-E8E0-4970-BB20-37DA4B70F6A6",
|
|
50
|
+
network: "testnet",
|
|
51
|
+
hashGenesisBlock: "0000006af8b8297448605b0283473ec712f9768f81cc7eae6269b875dee3b0cf",
|
|
52
|
+
port: 19100,
|
|
53
|
+
portRpc: 19101,
|
|
54
|
+
protocol: {
|
|
55
|
+
magic: 1313166674
|
|
56
|
+
},
|
|
57
|
+
seedsDns: [
|
|
58
|
+
"testnet1.neuracrypt.org",
|
|
59
|
+
"testnet2.neuracrypt.org",
|
|
60
|
+
"testnet3.neuracrypt.org"
|
|
61
|
+
],
|
|
62
|
+
versions: {
|
|
63
|
+
bip32: {
|
|
64
|
+
private: 70615956,
|
|
65
|
+
public: 70617039
|
|
66
|
+
},
|
|
67
|
+
bip44: 1,
|
|
68
|
+
private: 239,
|
|
69
|
+
public: 127,
|
|
70
|
+
scripthash: 196
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const chains = {
|
|
76
|
+
xna
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
module.exports = {
|
|
80
|
+
xna,
|
|
81
|
+
chains
|
|
82
|
+
};
|