Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@harmony-js/account

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@harmony-js/account - npm Package Compare versions

Comparing version 0.0.60 to 0.1.0

5

dist/index.cjs.js

@@ -402,6 +402,9 @@ /**

/**
* @function generateMnemonic
* @function newMnemonic
* @memberof Wallet
* @return {string} Mnemonics
*/
Wallet.prototype.newMnemonic = function () {
return Wallet.generateMnemonic();
};
/**

@@ -408,0 +411,0 @@ * @function addByMnemonic

@@ -398,6 +398,9 @@ /**

/**
* @function generateMnemonic
* @function newMnemonic
* @memberof Wallet
* @return {string} Mnemonics
*/
Wallet.prototype.newMnemonic = function () {
return Wallet.generateMnemonic();
};
/**

@@ -404,0 +407,0 @@ * @function addByMnemonic

@@ -399,6 +399,9 @@ /**

/**
* @function generateMnemonic
* @function newMnemonic
* @memberof Wallet
* @return {string} Mnemonics
*/
Wallet.prototype.newMnemonic = function () {
return Wallet.generateMnemonic();
};
/**

@@ -405,0 +408,0 @@ * @function addByMnemonic

3

dist/types.d.ts

@@ -0,3 +1,6 @@

/**
* test type docs
*/
export declare type ShardID = string | number;
export declare type Shards = Map<ShardID, string>;
//# sourceMappingURL=types.d.ts.map

@@ -22,6 +22,7 @@ import { EncryptOptions } from '@harmony-js/crypto';

/**
* @function generateMnemonic
* @function newMnemonic
* @memberof Wallet
* @return {string} Mnemonics
*/
newMnemonic(): string;
/**

@@ -28,0 +29,0 @@ * @function addByMnemonic

@@ -50,6 +50,9 @@ "use strict";

/**
* @function generateMnemonic
* @function newMnemonic
* @memberof Wallet
* @return {string} Mnemonics
*/
Wallet.prototype.newMnemonic = function () {
return Wallet.generateMnemonic();
};
/**

@@ -56,0 +59,0 @@ * @function addByMnemonic

{
"name": "@harmony-js/account",
"version": "0.0.60",
"version": "0.1.0",
"description": "account and wallet for harmony",

@@ -21,9 +21,9 @@ "main": "dist/index.js",

"dependencies": {
"@harmony-js/core": "0.0.60",
"@harmony-js/crypto": "0.0.60",
"@harmony-js/network": "0.0.60",
"@harmony-js/transaction": "0.0.60",
"@harmony-js/utils": "0.0.60"
"@harmony-js/core": "0.1.0",
"@harmony-js/crypto": "0.1.0",
"@harmony-js/network": "0.1.0",
"@harmony-js/transaction": "0.1.0",
"@harmony-js/utils": "0.1.0"
},
"gitHead": "dce1b4d29ea5261dea16799fccde857c8ae365eb"
"gitHead": "2c07e706979b3c891e927e3b97a222e47b8a2f55"
}

@@ -1,58 +0,9 @@

# Features
# Usage
1. [x] Account instance
2. [x] Create Account
3. [x] Import prv key
4. [x] Import/Export keystore file
5. [x] BIP39
6. [x] BIP44
7. [WIP] Sign txn/message
8. [x] getBalance
9. [x] Wallet CRUD
```typescript
# Wallet Usage
import {Wallet} from '@harmony-js/account'
```js
const wallet=new Wallet()
import { Wallet } from '@harmony-js/account';
const wallet = new Wallet();
const mnes = wallet.generateMnemonic();
// add mnemonic and use index=0
const accountA = wallet.addByMnemonic(mnes,0);
// this account instance will be the wallet's signer by default
console.log(wallet.signer.address === accountA.address)
// true
wallet.encryptAccount(accountA.address,'easy password')
.then((encrypted)=>{
console.log(encrypted.privateKey);
// private key now is keyStoreV3 format string
wallet.decryptAccount(accountA.address,'easy password')
.then((decrypted)=>{
console.log(decrypted.privateKey);
// now private key is recovered
})
});
wallet.accounts
// it will display accounts addresses live in wallet
wallet.getAccount(accountA.address);
// it will get account instance by using address as reference
wallet.removeAccount(accountA.address);
// it will remove account instance from wallet
wallet.createAccount();
// it will create a new acount instance
wallet.addByPrivateKey(key);
// you can add private key directly as well
```

@@ -0,2 +1,5 @@

/**
* test type docs
*/
export type ShardID = string | number;
export type Shards = Map<ShardID, string>;

@@ -8,7 +8,7 @@ import {

} from '@harmony-js/crypto';
import { Messenger } from '@harmony-js/network';
import { isPrivateKey, isAddress } from '@harmony-js/utils';
import { Transaction } from '@harmony-js/transaction';
import { Account } from './account';
import { defaultMessenger } from './utils';
import {Messenger} from '@harmony-js/network';
import {isPrivateKey, isAddress} from '@harmony-js/utils';
import {Transaction} from '@harmony-js/transaction';
import {Account} from './account';
import {defaultMessenger} from './utils';

@@ -51,6 +51,9 @@ class Wallet {

/**
* @function generateMnemonic
* @function newMnemonic
* @memberof Wallet
* @return {string} Mnemonics
*/
newMnemonic(): string {
return Wallet.generateMnemonic();
}

@@ -331,2 +334,2 @@ /**

export { Wallet };
export {Wallet};
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"declarationDir": "dist"
"outDir": "dist"
},
"include": ["src", "../../typings/**/*.d.ts"],
"references": [
{ "path": "../harmony-crypto" },
{ "path": "../harmony-utils" },
{ "path": "../harmony-transaction" },
{ "path": "../harmony-network" }
{"path": "../harmony-crypto"},
{"path": "../harmony-utils"},
{"path": "../harmony-transaction"},
{"path": "../harmony-network"}
]
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc