@liquality/wallet-core
Common library for liquality wallet
6,689
21
| Install | |
|---|---|
npm install @liquality/wallet-core |
|
| Latest Version: | 4.27.1 |
| Vue: | 2 |
| Older releases: | 3 |
| License: | MIT |
| Last Updated: | Dec 7, 2023 |
| Links: | GitHub · npm |
Maintainer: koderholic
Wallet Core
_ __ ____ __ ______ | | / /___ _/ / /__ / /_ / ____/___ ________ | | /| / / __ `/ / / _ \/ __/ / / / __ \/ ___/ _ \ | |/ |/ / /_/ / / / __/ /_ / /___/ /_/ / / / __/ |__/|__/\__,_/_/_/\___/\__/ \____/\____/_/ \___/
Wallet Core is a cryptocurrency wallet library in Typescript. It provides an abstracted interface that handles all the necessary internals of a muilti chain wallet.
Features
- State management
- Seed management and security
- Account management
- Blockchain communication under a common interface, powered by Chainify
- Retriving balances
- Sending transactions
- Intra and cross chain swaps supporting a host of decentralised exchanges - Liquality, Thorchain, Uniswap, 1inch, Sovryn, Astroport etc.
- Hardware wallet support
Install
npm install @liquality/wallet-core
yarn add @liquality/wallet-core
Usage
import { setupWallet } from '@liquality/wallet-core';
import defaultOptions from '@liquality/wallet-core/dist/src/walletOptions/defaultOptions'; // Default options
const wallet = setupWallet({
...defaultOptions,
});
(async () => {
await wallet.dispatch.createWallet({
key: 'satoshi',
mnemonic: 'never gonna give you up never gonna let you down never gonna',
imported: true,
});
await wallet.dispatch.unlockWallet({ key: 'satoshi' });
await wallet.dispatch.changeActiveNetwork({ network: 'mainnet' });
console.log(wallet.state); // State will include default accounts
})();
Options
See WalletOptions in types
{
initialState?: RootState; // The initial state of the wallet
crypto: { // Implmenetation for platform specific crypto
pbkdf2(password: string, salt: string, iterations: number, length: number, digest: string): Promise<string>;
encrypt(value: string, key: string): Promise<any>;
decrypt(value: any, key: string): Promise<any>;
};
// Handle notifications
createNotification(notification: Notification): void;
...
}
Examples
How to run tests
Integration tests are written in Jest.
yarn test
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 4.27.1 | ^2.6.11 | MIT | |
| 4.27.0 | ^2.6.11 | MIT | |
| 4.26.0 | ^2.6.11 | MIT | |
| 4.25.0 | ^2.6.11 | MIT | |
| 4.24.0 | ^2.6.11 | MIT | |
| 4.23.0 | ^2.6.11 | MIT | |
| 4.22.0 | ^2.6.11 | MIT | |
| 4.21.1 | ^2.6.11 | MIT | |
| 4.21.0 | ^2.6.11 | MIT | |
| 4.20.0 | ^2.6.11 | MIT | |
| 4.19.0 | ^2.6.11 | MIT | |
| 4.18.0 | ^2.6.11 | MIT | |
| 4.17.0 | ^2.6.11 | MIT | |
| 4.16.0 | ^2.6.11 | MIT | |
| 4.15.1 | ^2.6.11 | MIT | |
| 4.15.0 | ^2.6.11 | MIT | |
| 4.14.0 | ^2.6.11 | MIT | |
| 4.13.0 | ^2.6.11 | MIT | |
| 4.12.0 | ^2.6.11 | MIT | |
| 4.11.0 | ^2.6.11 | MIT | |
| 4.10.0 | ^2.6.11 | MIT | |
| 4.9.0 | ^2.6.11 | MIT | |
| 4.8.0 | ^2.6.11 | MIT | |
| 4.7.0 | ^2.6.11 | MIT | |
| 4.6.0 | ^2.6.11 | MIT | |
| 4.5.0 | ^2.6.11 | MIT | |
| 4.4.0 | ^2.6.11 | MIT | |
| 4.3.0 | ^2.6.11 | MIT | |
| 4.2.0 | ^2.6.11 | MIT | |
| 4.1.0 | ^2.6.11 | MIT |
Showing the latest 30 of 180. See every release on npm
Pre-releases (19)
| Version | Released | Vue | License |
|---|---|---|---|
| 2.0.1-next.2 | ^2.6.11 | MIT | |
| 2.0.1-next.1 | ^2.6.11 | MIT | |
| 2.0.1-next.0 | ^2.6.11 | MIT | |
| 2.0.0-next.6 | ^2.6.11 | MIT | |
| 2.0.0-next.5 | ^2.6.11 | MIT | |
| 1.31.4-next.4 | ^2.6.11 | MIT | |
| 1.31.4-next.3 | ^2.6.11 | MIT | |
| 1.31.4-next.2 | ^2.6.11 | MIT | |
| 1.31.4-next.1 | ^2.6.11 | MIT | |
| 1.31.0-next.5 | ^2.6.11 | MIT | |
| 1.31.0-next.4 | ^2.6.11 | MIT | |
| 1.31.0-next.3 | ^2.6.11 | MIT | |
| 1.31.0-next.2 | ^2.6.11 | MIT | |
| 1.31.0-next.1 | ^2.6.11 | MIT | |
| 1.29.21-next.1 | ^2.6.11 | MIT | |
| 1.29.17-next.4 | ^2.6.11 | MIT | |
| 1.29.17-next.3 | ^2.6.11 | MIT | |
| 1.29.17-next.2 | ^2.6.11 | MIT | |
| 1.29.17-next.0 | ^2.6.11 | MIT |