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 +33 -0
- package/dist/jcc-wallet.min.js +46 -0
- package/lib/constant/index.js +1 -0
- package/lib/constant/index.js.map +1 -1
- package/lib/eth/index.d.ts +1 -1
- package/lib/eth/index.js +1 -0
- package/lib/eth/index.js.map +1 -1
- package/lib/hd/constant.d.ts +25 -0
- package/lib/hd/constant.js +55 -0
- package/lib/hd/constant.js.map +1 -0
- package/lib/hd/ethereum.plugin.d.ts +4 -0
- package/lib/hd/ethereum.plugin.js +94 -0
- package/lib/hd/ethereum.plugin.js.map +1 -0
- package/lib/hd/index.d.ts +227 -0
- package/lib/hd/index.js +390 -0
- package/lib/hd/index.js.map +1 -0
- package/lib/hd/plugins.d.ts +1 -0
- package/lib/hd/plugins.js +31 -0
- package/lib/hd/plugins.js.map +1 -0
- package/lib/hd/swtc.plugin.d.ts +5 -0
- package/lib/hd/swtc.plugin.js +72 -0
- package/lib/hd/swtc.plugin.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +21 -6
- package/lib/index.js.map +1 -1
- package/lib/jingchangWallet/index.js.map +1 -1
- package/lib/moac/index.d.ts +1 -1
- package/lib/moac/index.js +1 -0
- package/lib/moac/index.js.map +1 -1
- package/lib/types/index.d.ts +20 -0
- package/lib/util/index.js +1 -0
- package/lib/util/index.js.map +1 -1
- package/lib/x-wallet/index.js +1 -0
- package/lib/x-wallet/index.js.map +1 -1
- package/package.json +7 -3
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._**
|