-
Notifications
You must be signed in to change notification settings - Fork 1
feat(sdk-accounts): add identity sdk #9
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
base: main
Are you sure you want to change the base?
Conversation
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.
Good stuff! Thanks @voliva !
export type IdentityInfo = { | ||
[K in keyof DescriptorsIdentityInfo]?: DescriptorsIdentityInfo[K] extends | ||
| Binary | ||
| undefined | ||
? DescriptorsIdentityInfo[K] | ||
: string | ||
} |
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.
export type IdentityInfo = { | |
[K in keyof DescriptorsIdentityInfo]?: DescriptorsIdentityInfo[K] extends | |
| Binary | |
| undefined | |
? DescriptorsIdentityInfo[K] | |
: string | |
} | |
export type IdentityInfo = { | |
[K in keyof DescriptorsIdentityInfo]?: K extends "pgp_fingerprint" | |
? DescriptorsIdentityInfo[K] // or FixedSizeBinary<20> | undefined | |
: string | |
} |
I wouldn't make it super-generic, b/c it's very coupled that that specific field... What I mean is that since we are in control of the DescriptorsIdentityInfo
type, we may as-well do it like this, no?
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.
Agree 👍
const displayName: Identity["displayName"] = info.display | ||
? { | ||
value: info.display, | ||
verified: judgements.some((v) => v.judgement === "Reasonable"), |
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.
Shouldn't KnownGood
also be verified
? 🤔 (I really don't know, I'm just guessing...)
This is something we've been using in many mini-dApps, I think it could be useful to have it as an SDK.