@neuraiproject/neurai-key 2.8.8 → 3.0.0
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 +26 -17
- package/dist/NeuraiKey.global.js +24091 -0
- package/dist/NeuraiKey.global.js.map +1 -0
- package/dist/browser.js +24084 -0
- package/dist/browser.js.map +1 -0
- package/dist/index.cjs +24105 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +89 -0
- package/dist/index.js +661 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -27
- package/.vscode/settings.json +0 -3
- package/coins/xna-legacy.js +0 -82
- package/coins/xna-pq.js +0 -39
- package/coins/xna.js +0 -82
- package/dist/NeuraiKey.js +0 -41513
- package/dist/main.js +0 -454
- package/dist/main.js.map +0 -1
- package/dist/module.js +0 -426
- package/dist/module.js.map +0 -1
- package/dist/types.d.ts +0 -108
- package/dist/types.d.ts.map +0 -1
- package/example-passphrase.js +0 -34
- package/index.ts +0 -339
- package/test-html/NeuraiKey.js +0 -60497
- package/test-html/index.html +0 -543
- package/test.js +0 -261
- package/types.ts +0 -19
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Generate Neurai addresses from a mnemonic phrase following the standards BIP32,
|
|
|
5
5
|
That is, use your 12 words to get addresses for Neurai mainnet and testnet.
|
|
6
6
|
|
|
7
7
|
**NPM**: https://www.npmjs.com/package/@neuraiproject/neurai-key
|
|
8
|
-
**CDN**: https://cdn.jsdelivr.net/npm/@neuraiproject/neurai-key@
|
|
8
|
+
**CDN**: https://cdn.jsdelivr.net/npm/@neuraiproject/neurai-key@3.0.0/dist/NeuraiKey.global.js
|
|
9
9
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
@@ -40,10 +40,8 @@ A simple and "spot on" way to generate/derive addresses.
|
|
|
40
40
|
|
|
41
41
|
If you need brutal performance check out getAddressByPath example below.
|
|
42
42
|
|
|
43
|
-
```
|
|
43
|
+
```javascript
|
|
44
44
|
import NeuraiKey from "@neuraiproject/neurai-key";
|
|
45
|
-
//Or import as CommonsJS module
|
|
46
|
-
//const NeuraiKey = require("@neuraiproject/neurai-key");
|
|
47
45
|
|
|
48
46
|
const mnemonic = NeuraiKey.generateMnemonic();
|
|
49
47
|
const ACCOUNT = 0; //default is zero
|
|
@@ -268,47 +266,58 @@ console.log(pubkeyHex);
|
|
|
268
266
|
|
|
269
267
|
## How to import into your project
|
|
270
268
|
|
|
271
|
-
###
|
|
269
|
+
### ESM default
|
|
272
270
|
|
|
273
|
-
```
|
|
274
|
-
//As ES6 module
|
|
271
|
+
```javascript
|
|
275
272
|
import NeuraiKey from "@neuraiproject/neurai-key";
|
|
276
273
|
```
|
|
277
274
|
|
|
278
|
-
###
|
|
275
|
+
### ESM browser explicit
|
|
279
276
|
|
|
277
|
+
```javascript
|
|
278
|
+
import NeuraiKey from "@neuraiproject/neurai-key/browser";
|
|
280
279
|
```
|
|
281
|
-
|
|
280
|
+
|
|
281
|
+
### CommonJS
|
|
282
|
+
|
|
283
|
+
```javascript
|
|
282
284
|
const NeuraiKey = require("@neuraiproject/neurai-key");
|
|
283
285
|
```
|
|
284
286
|
|
|
285
|
-
###
|
|
287
|
+
### Global build for HTML
|
|
286
288
|
|
|
287
|
-
```
|
|
288
|
-
//A browseriy:d version, with all the dependencies bundled for the web
|
|
289
|
+
```html
|
|
289
290
|
<html>
|
|
290
291
|
<body>
|
|
291
|
-
<script src="./node_modules/@neuraiproject/neurai-key/dist/NeuraiKey.js"></script>
|
|
292
|
+
<script src="./node_modules/@neuraiproject/neurai-key/dist/NeuraiKey.global.js"></script>
|
|
292
293
|
<script>
|
|
293
|
-
alert(NeuraiKey.generateMnemonic());
|
|
294
|
+
alert(globalThis.NeuraiKey.generateMnemonic());
|
|
294
295
|
</script>
|
|
295
296
|
</body>
|
|
296
297
|
</html>
|
|
297
298
|
```
|
|
298
299
|
|
|
300
|
+
## Package layout in `3.0.0`
|
|
301
|
+
|
|
302
|
+
- `dist/index.js`: ESM main entry
|
|
303
|
+
- `dist/index.cjs`: CommonJS entry
|
|
304
|
+
- `dist/browser.js`: explicit browser ESM bundle
|
|
305
|
+
- `dist/NeuraiKey.global.js`: global build for `<script>`
|
|
306
|
+
- `dist/index.d.ts`: TypeScript declarations
|
|
307
|
+
|
|
299
308
|
## install
|
|
300
309
|
|
|
301
|
-
`
|
|
310
|
+
`npm install @neuraiproject/neurai-key`
|
|
302
311
|
|
|
303
312
|
## build
|
|
304
313
|
|
|
305
|
-
`
|
|
314
|
+
`npm run build`
|
|
306
315
|
|
|
307
316
|
## test
|
|
308
317
|
|
|
309
318
|
`npm test`
|
|
310
319
|
|
|
311
|
-
|
|
320
|
+
The test script already builds the package before running Jest.
|
|
312
321
|
|
|
313
322
|
## BIP32
|
|
314
323
|
|