https://github.com/leapwallet/leap-keychain
https://github.com/leapwallet/leap-keychain
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/leapwallet/leap-keychain
- Owner: leapwallet
- License: mit
- Created: 2022-12-28T22:06:46.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-02T11:52:57.000Z (about 2 months ago)
- Last Synced: 2025-04-02T12:35:59.824Z (about 2 months ago)
- Language: TypeScript
- Homepage: https://leapwallet.github.io/leap-keychain
- Size: 410 KB
- Stars: 10
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Leap Keychain
leap-keychain library includes modules for key management, account creation, and transaction signing for cosmos blockchains.
- Platforms: Browsers supporting ES6 or higher
- Module systems: ECMAScript Modules
- Programming languages: ES6 (JavaScript, TypeScript, etc. which target ES6 or higher)
- Static types: TypeScript definitions bundled## Installation
Use one of the following methods:
- npm:
```shell
npm i @leapwallet/leap-keychain
```
- Yarn:
```shell
yarn add @leapwallet/leap-keychain
```## Usage
Initialize storage and crypto modules in the top level file index.js or app.js
```javascript
import { initStorage, initCrypto } from '@leapwallet/leap-keychain';
// create a storage object
initStorage({
set: (key, value) => {
localStorage.setItem(key, value);
return Promise.resolve();
},
get: (key) => {
const value = localStorage.getItem(key);
return Promise.resolve(storageObj[key]);
},
remove: (key) => {
localStorage.removeItem(key);
return Promise.resolve();
},
});// initialize crypto modules
initCrypto();
```To use the keychain
```javascript
import { KeyChain } from '@leapwallet/leap-keychain'
// create wallet using mnemonic
KeyChain.createWalletUsingMnemonic({
mnemonic: "12/24 word mnemonic",
name: "wallet name";
password: "encryption password";
addressIndex: "address index";
colorIndex: "0";
chainInfos: {
//The 'chain infos' object includes the address prefix and coin type for the chains for which wallet creation is required.
cosmos: {
addressPrefix: 'cosmos',
coinType: '118',
key: 'cosmos'
}
};
})```
## [Security](SECURITY.md)
## [Contributing](CONTRIBUTING.md)