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

@vocdoni/data-models

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vocdoni/data-models

Javascript/Typescript models package

  • 1.14.2
  • Source
  • npm
  • Socket score

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 25 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

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