From 6a73846366e621c6ee4e294ffa186951e2b78952 Mon Sep 17 00:00:00 2001 From: Arshdeep Date: Thu, 17 Oct 2024 21:28:57 +0530 Subject: [PATCH] add endpoint to get identifier state from each witness --- src/keri/app/coring.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/keri/app/coring.ts b/src/keri/app/coring.ts index 75f93b2b..682bb1cb 100644 --- a/src/keri/app/coring.ts +++ b/src/keri/app/coring.ts @@ -222,4 +222,18 @@ export class KeyStates { const res = await this.client.fetch(path, method, data); return await res.json(); } + + /** + * Retriene the key state of an identifier from each witness and compare with local state of identifier + * @async + * @param {string} pre Identifier prefix + * @returns {Promise} A promise to the key states + */ + async getWitnessState(pre: string): Promise { + const path = `/states/${pre}/watch`; + const data = null; + const method = 'GET'; + const res = await this.client.fetch(path, method, data); + return await res.json(); + } }