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

doichain

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doichain - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

lib/validateMnemonic.js

2

lib/generateMnemonic.js

@@ -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")
})
})
});
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