diff --git a/docs/getting-started.md b/docs/getting-started.md index 02d7d76fb..4b01e01f0 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -304,9 +304,9 @@ KILT contains a simple messaging system and we describe it through the following First, we create the request for attestation message which the Claimer encrypts with the public key of the Attester: ```typescript -import Kilt, { IRequestAttestationForClaim } from '@kiltprotocol/sdk-js' +import Kilt, { MessageBody } from '@kiltprotocol/sdk-js' -const messageBody: IRequestAttestationForClaim = { +const messageBody: MessageBody = { content: { requestForAttestation }, type: Kilt.Message.BodyType.REQUEST_ATTESTATION_FOR_CLAIM, } @@ -435,9 +435,7 @@ AttestedClaim { The Attester has to send the `attestedClaim` object back to the Claimer in the following message: ```typescript -import { ISubmitAttestationForClaim } from '@kiltprotocol/sdk-js' - -const messageBodyBack: ISubmitAttestationForClaim = { +const messageBodyBack: MessageBody = { content: attestedClaim, type: Kilt.Message.BodyType.SUBMIT_ATTESTATION_FOR_CLAIM, } @@ -501,7 +499,7 @@ This is an **important feature for the privacy of a claimer** as this enables th ### 6.1. Request presentation for CTYPE ```typescript -const messageBodyForClaimer: IRequestClaimsForCTypes = { +const messageBodyForClaimer: MessageBody = { type: Kilt.Message.BodyType.REQUEST_CLAIMS_FOR_CTYPES, content: { ctypes: [ctype.hash] }, } @@ -521,7 +519,7 @@ const copiedCredential = Kilt.AttestedClaim.fromAttestedClaim( ) copiedCredential.request.removeClaimProperties(['age']) -const messageBodyForVerifier: ISubmitClaimsForCTypes = { +const messageBodyForVerifier: MessageBody = { content: [copiedCredential], type: Kilt.Message.BodyType.SUBMIT_CLAIMS_FOR_CTYPES, } diff --git a/docs/getting-started.ts b/docs/getting-started.ts index 990048f67..590aaa208 100644 --- a/docs/getting-started.ts +++ b/docs/getting-started.ts @@ -3,10 +3,7 @@ import Kilt from '@kiltprotocol/sdk-js' import type { SubmittableExtrinsic, IRequestForAttestation, - IRequestAttestationForClaim, - IRequestClaimsForCTypes, - ISubmitAttestationForClaim, - ISubmitClaimsForCTypes, + MessageBody, } from '@kiltprotocol/sdk-js' const NODE_URL = 'ws://127.0.0.1:9944' @@ -101,7 +98,7 @@ async function main(): Promise { ) /* First, we create the request for an attestation message in which the Claimer automatically encodes the message with the public key of the Attester: */ - const messageBody: IRequestAttestationForClaim = { + const messageBody: MessageBody = { content: { requestForAttestation }, type: Kilt.Message.BodyType.REQUEST_ATTESTATION_FOR_CLAIM, } @@ -151,7 +148,7 @@ async function main(): Promise { console.log(attestedClaim) /* The Attester has to send the `attestedClaim` object back to the Claimer in the following message: */ - const messageBodyBack: ISubmitAttestationForClaim = { + const messageBodyBack: MessageBody = { content: attestedClaim, type: Kilt.Message.BodyType.SUBMIT_ATTESTATION_FOR_CLAIM, } @@ -181,7 +178,7 @@ async function main(): Promise { const verifier = Kilt.Identity.buildFromMnemonic(verifierMnemonic) /* 6.1. Request presentation for CTYPE */ - const messageBodyForClaimer: IRequestClaimsForCTypes = { + const messageBodyForClaimer: MessageBody = { type: Kilt.Message.BodyType.REQUEST_CLAIMS_FOR_CTYPES, content: [{ cTypeHash: ctype.hash }], } @@ -199,7 +196,7 @@ async function main(): Promise { ) copiedCredential.request.removeClaimProperties(['age']) - const messageBodyForVerifier: ISubmitClaimsForCTypes = { + const messageBodyForVerifier: MessageBody = { content: [copiedCredential], type: Kilt.Message.BodyType.SUBMIT_CLAIMS_FOR_CTYPES, }