1.0.0 • Published 6 years ago

@chainio/vaultcheck v1.0.0

Weekly downloads
21
License
MIT
Repository
github
Last release
6 years ago

Vault Check

A validation library for Vault by Chain.io

Usage

const vaultCheck = '@chainio/vaultcheck'

# Verify a local file and receipt against the blockchain
const filePath = '/home/me/sourcefile.pdf'
const receiptPath '/home/me/sourcefile-receipt.json'
const ethereumServiceProvider = 'https://main.infura.io/your-infura-id'

vaultCheck.checkFiles(ethereumServiceProvider, filePath, receiptPath)
.then((result) => {
  if (result.pass) {
    console.log('it passed')
    console.log('transaction date', result.transactionDate)
  } else {
    console.log('it failed', result.messages)
  }
})

# Verify a local file and receipt against each other without the blockchain
const result = vaultCheck.checkFilesLocal(filePath, receiptPath)
if (result.pass)
  console.log('it passed')
} else {
  console.log('it failed', result.messages)
}