dsrv key management store
// [next.config.js](https://github.com/antelle/argon2-browser/issues/26)
config.module.rules.push({ test: /\.wasm$/, loaders: ['base64-loader'], type: 'javascript/auto' });
import { KMS, CHAIN, createKeyStore } from "@dsrv/kms";
// create key store
const mnemonic = "....";
const password = "strong password";
const keyStore = await createKeyStore(mnemonic.split(" "), password);
/*
{
t: 9,
m: 262144,
s: '89aaLUkbh3E3yvBvatitUsmznTMd2p7jU1cri5D5xBnu',
j: [
'eyJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUEJFUzItSFMyNTYrQTEyOEtXIiwia2lkIjoiT1lBd0hGRW4zYmFKSWJkLXoyc09VMFhnRjVLRmtfb2ZBeWQwWmxMM0FjMCIsInAycyI6IlBqNHpCdS1aMC1laVVPcGx5emh5dXciLCJwMmMiOjgxOTJ9',
'A7jjx9G1jwylhRqmk9WLgc29_G_0Bn36buUSXC1u6zRq0jLzAEKOpg',
'9COzNxXnCc_T1Jtg',
'VD5EXQ',
'BboSFxRBdGQlNyHqG8hOxw'
]
}
*/
// get account
const kms = new KMS({
keyStore,
transport: null,
});
const account = await kms.getAccount({
type: CHAIN.MINA,
account: 0,
index: 0,
password
});
/*
B62qpgyAmA5yNgY4buNhTxTKYTvkqSFf442KkHzYHribCFjDmXcfHHm
*/
- yarn build
- modify test/mnemonic.json
- node test/keystore
- node test/keystore/mina
- node test/keystore/near
- node test/keystore/solana
- yarn build
- node test/ledger/mina
- node test/ledger/cosmos
- node test/ledger/near
- node test/ledger/solana