INNER CODE UNIT · JavaScript

info

opentimestamps/javascript-opentimestamps · ots-cli.js:155

function info (argsFileOts, options) {
  const otsPromise = Utils.readFilePromise(argsFileOts, null)

  Promise.all([otsPromise]).then(values => {
    const ots = values[0]

    try {
      const detachedOts = DetachedTimestampFile.deserialize(ots)
      const infoResult = OpenTimestamps.info(detachedOts, options)
      console.log(infoResult)
    } catch (err) {
      if (err instanceof Context.BadMagicError) {
        throw new Error('Error! ' + argsFileOts + ' is not a timestamp file.')
      } else if (err instanceof Context.DeserializationError) {
        throw new Error('Invalid timestamp file ' + argsFileOts)
      } else {
        throw err
      }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…