New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jwallet-web-keystore

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jwallet-web-keystore - npm Package Compare versions

Comparing version

to
0.6.0

11

lib/Keystore.js

@@ -216,2 +216,13 @@ 'use strict';

}, {
key: 'getAddressFromMnemonic',
value: function getAddressFromMnemonic(accountId) {
var addressIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var account = this.getAccount({ id: accountId, type: this.mnemonicType });
this._checkAccountExist(account);
return this._generateAddresses(account.bip32XPublicKey, addressIndex, 1).shift();
}
}, {
key: 'getMnemonic',

@@ -218,0 +229,0 @@ value: function getMnemonic(password, accountId) {

2

package.json
{
"name": "jwallet-web-keystore",
"version": "0.5.0",
"version": "0.6.0",
"description": "Library for ethereum blockchain accounts management",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -284,2 +284,23 @@ # jwallet-web-keystore

#### getAddressFromMnemonic(accountId, addressIndex)
**Note: used only for `mnemonic` accounts.**
##### Parameters
| Param | Type | Description |
| ------------ | ------ | -------------------------------------------------------------- |
| accountId | String | Unique ID of account |
| addressIndex | String | Index of address to derive from `mnemonic` / `bip32XPublicKey` |
##### Returns
Derived by index address.
##### Example
```javascript
const address = keystore.getAddressFromMnemonic('110ec58a-a0f2-4ac4-8393-c977d813b8d1', 5)
```
#### setAddressIndex(accountId, addressIndex)

@@ -286,0 +307,0 @@

@@ -76,2 +76,11 @@ const should = require('should')

it('getAddressFromMnemonic() should derive address by index from mnemonic', function(done) {
const address = keystore.getAddressFromMnemonic(accountId, 0)
address.should.be.a.String()
address.length.should.be.equal(addressLength)
done()
})
it('setAddressIndex() should set current address index', function(done) {

@@ -78,0 +87,0 @@ const addressIndex = 3