keystore_wdc
Version:
``` npm i keystore_wdc; const KeyStore = require('keystore_wdc'); const ks = new KeyStore(); ``` #### 生成keystore ``` async function create(){ const keystore = await ks.Create("your password"); } ``` * 返回keystore,密码格式不正确返回-1。
28 lines (25 loc) • 986 B
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/keystore_wdc@0.4.20-beta/contract-dist/bundle.js"></script>
<script src="./local/coin.abi.js"></script>
<script>
window.onload = function () {
const t = keystore_wdc_contract
console.log(t.BN)
const sk = 'f0d55ae8a79186e8595514fe23dec8716a191d2bb525998298371693dc69a926'
const addr = t.publicKeyHash2Address(t.publicKey2Hash(t.privateKey2PublicKey(sk)))
console.log(addr)
// const rpc = new t.RPC('8.210.39.91', 19585)
// const c = new t.Contract('1HnbSn23tVpa1dcchnSrzsTd7aCzaSC2NY', coinABI)
// rpc.viewContract(c, 'balanceOf', addr)
// .then(console.log)
}
</script>
</body>
</html>