v0.22.0 (2021-06-22)
SDK Release notes 0.22.0 (2021-06-22)
Features
-
refactored
DelegationNode
&DelegationRootNode
constructors to allow setting the revocation status at creation (#377) (c6e96c7). For example, aDelegationNode
is now instantiated as follows:import { DelegationNode, Permission, Utils } from '@kiltprotocol/sdk-js' // with // root: DelegationRootNode // parent: DelegationNode const delegation = new DelegationNode({ id: Utils.UUID.generate(), rootId: root.id, account: delegee.address, permissions: [Permission.ATTEST], parentId: parent.id, revoked: false, })
-
we now add a bundle of the
sdk-js
package to our releases, allowing easy consumption in web applications (#367) (6849d04). Click here to find out how to embed the bundle in your web site. -
added a
createPresentation
method to theAttestedClaim
which produces a deep copy of your credential, optionally filtering the attributes you want to disclose (#398) (18d4df4). Example:import { AttestedClaim } from '@kiltprotocol/sdk-js' const credential = AttestedClaim.fromRequestAndAttestation(request, attestation) // produce a copy of your credential that only discloses the value of attribute 'a', // blinding all other attributes: const presentation = credential.createPresentation(['a'])
-
added the option to send
CType
objects as part of Terms on theSubmit-Terms
message type for repository-independent attestation workflows (#399) (a67fc24):import Kilt, { MessageBody } from '@kiltprotocol/sdk-js' // given some ICType `autonomousVehicleIdCType` const messageBody: MessageBody = { content: { claim: { cTypeHash: autonomousVehicleIdCType.hash, contents: { id: 'abc-defg', licensePlate: 'B-OB 1234' }, }, cTypes: [autonomousVehicleIdCType], prerequisiteClaims: [], }, type: Kilt.Message.BodyType.SUBMIT_TERMS, } const message = new Kilt.Message(messageBody, sender, recipient)
-
now providing a
jsonld-signatures
suite in thevc-export
package, which allows verifying Kilt Verifiable Credentials invc-js
(#365) (e3c085d). Refer to the README to find out how. -
polkadot type definitions are now imported from
@kiltprotocol/type-definitions
- the types that are also included in@polkadot-js/apps
for KILT chains (#393) (986850b). -
added content checks to message constructors to assure that instantiated message objects contain reasonable data (#391) (7d0ad63).
Chores
- update polkadot dependencies to
4.12.1
(api) /6.6.1
(keyring & utils) and upgraded to typescript4.0.0
(#397) (b620fd5). - bump lodash to 4.17.21 (c7c3556).
- removed
formatKiltBalanceDecimalPlacement
from the Balance utils, which was not exposed and no longer used (#389) (95ecc8e).
Ci
- set up CI to run non-required integration tests against additional mashnet-node built (#387) (b2a9224).
- introduced caching of package builds to CI to reduce redundant building and installs (#323) (35bcea3).
- remove accidentally committed yarn version files that broke the CI (#385 - c276f9b; #390 - a85c8f0; e3c44b1).
Documentation Changes
- documented an easier way to create kilt messages in the getting-started-guide #388 (81a427e).
- removed misleading references to our legacy (experimental) privacy enhancement in README (1ade250).
- updated README with our shiny new logo! (bdd813b)