New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@vocdoni/models

Package Overview
Dependencies
Maintainers
5
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@vocdoni/models

Javascript/Typescript models package

latest
Source
npmnpm
Version
1.14.0
Version published
Maintainers
5
Created
Source

@vocdoni/data-models

@vocdoni/data-models contains the data model definitions for the dvote-js library

Installation

Use npm to install @vocdoni/data-models.

npm install @vocdoni/data-models

Usage

Account Backup

import { AccountBackup } from "@vocdoni/data-models"

const wallet = Wallet.createRandom()
const originalPassphrase = Math.random().toString()
const encryptedMnemonic = AccountBackup.encryptPayload(wallet.mnemonic.phrase, originalPassphrase)

const backupBytes = AccountBackup.create({
  backupName: "Hello world",
  questionIds: [1, 2, 3],
  answers: ["Answer 1", "Answer 2", "Answer 3"],
  accountWallet: {
    encryptedMnemonic,
    authMethod: Wallet_AuthMethod.PASS,
    hdPath: wallet.mnemonic.path,
    locale: wallet.mnemonic.locale
  },
  currentPassphrase: originalPassphrase
})
const decryptedPassphrase = AccountBackup.recoverPassphrase(backupBytes, ["Answer 1", "Answer 2", "Answer 3"])

Entity Metadata

import { checkValidEntityMetadata } from "@vocdoni/data-models"

checkValidEntityMetadata({})
// throws an Error

Process Metadata

import { checkValidProcessMetadata } from "@vocdoni/data-models"

checkValidProcessMetadata({})
// throws an Error

Testing

To execute library tests just run

npm run test

FAQs

Package last updated on 22 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts