Comparing version 0.0.3 to 0.0.4
@@ -1,3 +0,1 @@ | ||
import bip39 from 'bip39' | ||
export const generateMnemonic = () => { | ||
@@ -4,0 +2,0 @@ const bip39 = require("bip39") |
{ | ||
"name": "doichain", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A js-Doichain library. The goal is to fully cover the Doichain protocoll", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,5 +8,6 @@ # js-doichain | ||
This repository contains functions and the documentation to create Doichain | ||
- hd-keys (from seed phrases) | ||
- addresses | ||
This repository contains functions and the documentation to | ||
- create and validate mnemonic seed phrases | ||
- hd-keys (from mnemonic seed phrases) | ||
- Doichain addresses | ||
- "double opt-in/DOI" request transaction | ||
@@ -13,0 +14,0 @@ - email verification request transactions |
import chai from 'chai' | ||
import {printHello} from '../index' | ||
import {generateMnemonic} from '../lib/generateMnemonic' | ||
import {validateMnemonic} from "../lib/validateMnemonic"; | ||
@@ -8,8 +9,15 @@ describe('js-doichain', function(){ | ||
describe('basic doichain functions', function(){ | ||
it('should create a new seed phrase', function () { | ||
it('should create a new mnemonic seed phrase', function () { | ||
const mnemonic = generateMnemonic() | ||
chai.assert.equal(mnemonic.split(' ').length,12,'mnemonic doesnt contain 12 elements') | ||
chai.assert.equal(mnemonic.split(' ').length,12,'mnemonic doesnt contain 12 words') | ||
}) | ||
it('should validate a mnemonic seed phrase', function () { | ||
const mnemonic = "balance blanket camp festival party robot social stairs noodle piano copy drastic" | ||
const valid = validateMnemonic(mnemonic) | ||
chai.assert.equal(valid,true,"mnomnic seed phrase not valid") | ||
}) | ||
}) | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3923
8
29
16