Releases: poetapp/poet-js
Releases · poetapp/poet-js
v5.0.3
v5.0.2
v5.0.1
v5.0.0
5.0.0 (2018-10-10)
Features
- sign verifiable claims with jsonld-signatures (9fe5933)
BREAKING CHANGES
- the mechanism to create a verifiable claim and sign it has changed dramatically.
Refer to the README for details. Use the method below to create a claim.
import { configureCreateVerifiableClaim, createIssuerFromPrivateKey, getVerifiableClaimSigner } from '@po.et/poet-js'
const { configureSignVerifiableClaim } = getVerifiableClaimSigner()
const issuerPrivateKey = '<Ed25519Base58PrivateKey>'
const issuer = createIssuerFromPrivateKey(issuerPrivateKey)
const createVerifiableWorkClaim = configureCreateVerifiableClaim({ issuer })
const signVerifiableClaim = configureSignVerifiableClaim({ privateKey: issuerPrivateKey })
const workClaim = {
name: 'The Raven',
author: 'Edgar Allan Poe',
tags: 'poem',
dateCreated: '',
datePublished: '1845-01-29T03:00:00.000Z',
archiveUrl: 'https://example.com/raven',
hash: '<hash of content>',
}
const unsignedVerifiableClaim = await createVerifiableWorkClaim(workClaim)
const signedWorkClaim = await signVerifiableClaim(unsignedVerifiableClaim)