-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: get credential registry state (tever vcstate) #282
Changes from 1 commit
e032084
63ce7ca
172d7ef
7a72ff6
234e357
53b6c37
f0fb01a
565e8c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,6 +229,23 @@ export interface IpexAdmitArgs { | |
datetime?: string; | ||
} | ||
|
||
export type CredentialState = { | ||
vn: [number, number], | ||
i: string, | ||
s: string, | ||
d: string, | ||
ri: string, | ||
a: { s: number, d: string }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (really is an int, unlike most There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @iFergal but it is a sequence number anyway right? If so, Is it the sequence number of the credential state changes, or of the registry event? If the registry event, is it possible we have a similar issue as we had for KEL events where it would not handle There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it's still a sequence number. It's the sn of the anchoring event in the KEL for the current credential event. A mix of int and hex seems to be used throughout keripy, I believe it just needs to be hex when it's actually part of a KERI event and this is just an export of current state. I think it's OK for Signify to consider
|
||
dt: string, | ||
et: string | ||
} & ({ | ||
et: "iss" | "rev", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lenkan |
||
ra: Record<string, never> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This corresponds to |
||
} | { | ||
et: "bis" | "brv", | ||
ra: { i: string, s: string, d: string } | ||
}); | ||
|
||
/** | ||
* Credentials | ||
*/ | ||
|
@@ -285,6 +302,20 @@ export class Credentials { | |
return includeCESR ? await res.text() : await res.json(); | ||
} | ||
|
||
/** | ||
* Get the state of a credential | ||
* @async | ||
* @param {string} ri - management registry identifier | ||
* @param {string} said - SAID of the credential | ||
* @returns {Promise<CredentialState>} A promise to the credential registry state | ||
*/ | ||
async state(ri: string, said: string): Promise<CredentialState> { | ||
const path = `/registries/${ri}/${said}`; | ||
const method = "GET"; | ||
const res = await this.client.fetch(path, method, null); | ||
return res.json(); | ||
} | ||
|
||
/** | ||
* Issue a credential | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I can get transaction state noticing working on keripy, this could be extended nicely to check for revocations w/o IPEX.