https://github.com/codechain-io/foundry-keystore-js
A private key management library for Foundry
https://github.com/codechain-io/foundry-keystore-js
Last synced: 4 months ago
JSON representation
A private key management library for Foundry
- Host: GitHub
- URL: https://github.com/codechain-io/foundry-keystore-js
- Owner: CodeChain-io
- License: isc
- Created: 2020-02-18T10:25:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-06T06:14:16.000Z (over 5 years ago)
- Last Synced: 2025-02-21T12:47:00.578Z (4 months ago)
- Language: TypeScript
- Homepage:
- Size: 163 KB
- Stars: 2
- Watchers: 8
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Foundry keystore [](https://travis-ci.org/CodeChain-io/foundry-keystore-js)
===================Foundry keystore is a private key management library. It saves Foundry's account address safely in a disk. If you want to manage Foundry keys using nodejs, you should use this.
Example
-----------```js
var CCKey = require('foundry-keystore');async function example() {
const cckey = await CCKey.create();
const savedKeys = await cckey.keystore.getKeys();
console.dir(savedKeys);
await cckey.keystore.createKey({ passphrase: "my password" });
const savedKeys_ = await cckey.keystore.getKeys();
console.dir(savedKeys_);await cckey.close();
};
example();```
How your private key is saved
-------------------We use a JSON file to save an encrypted private key. You can find the file in `./keystore.db`