jcc_wallet 1.1.2 → 1.2.1

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 CHANGED
@@ -38,6 +38,8 @@ npm install jcc_wallet
38
38
 
39
39
  - [JingchangWallet](#api-of-jingchangwallet)
40
40
 
41
+ - [hdWallet](https://github.com/JCCDex/jcc_wallet/blob/master/docs/hd.md)
42
+
41
43
  - [jtWallet](https://github.com/JCCDex/jcc_wallet/blob/master/docs/jingtum.md)
42
44
 
43
45
  - [callWallet](https://github.com/JCCDex/jcc_wallet/blob/master/docs/call.md)
@@ -403,6 +405,37 @@ const JingchangWallet = require("jcc_wallet").JingchangWallet;
403
405
  */
404
406
  ```
405
407
 
408
+ ## HD Wallet
409
+
410
+ jcc wallet support BIP32/39/44 standard.
411
+
412
+ more detail see [test/hd.spec.js](https://github.com/JCCDex/jcc_wallet/blob/master/test/hd.spec.js) test case.
413
+
414
+ ```javascript
415
+ // normally hd maniuplate
416
+ IHDWallet hd = HDWallet.generate({ language: "chinese_simplified" });
417
+
418
+ // derive bsc wallet
419
+ hd.deriveWallet({ chain: BIP44Chain.BSC, account: 0, index: 0 })
420
+ hd.getAddress();
421
+
422
+ // don't worry about address/secret format, hd object have chain type attribute, check it by native chain sdk
423
+ hd.validAddress("your address, like jxxxxx or 0x1234");
424
+ hd.validSecret("your secret");
425
+
426
+ // default encode utf-8
427
+ hd.hash("message text");
428
+
429
+ // sign by hd private key automatically
430
+ hd.sign("message text");
431
+
432
+ // verify message signature is sign address signed or not
433
+ hd.verify("message text", signature, signAddress);
434
+ // or if you don't passby address, you can passby keypair
435
+ hd.verify("message test", signature, null, keypair)
436
+
437
+ ```
438
+
406
439
  ## Deprecated API
407
440
 
408
441
  **_Deprecated api will be removed after 2020.1.1, please update asap._**