Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat(sdk-accounts): add identity sdk #9

wants to merge 3 commits into from

Conversation

voliva
Copy link
Contributor

@voliva voliva commented May 2, 2025

This is something we've been using in many mini-dApps, I think it could be useful to have it as an SDK.

@voliva voliva requested review from josepot and carlosala May 2, 2025 13:33
Copy link
Member

@josepot josepot left a 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 !

Comment on lines 7 to 13
export type IdentityInfo = {
[K in keyof DescriptorsIdentityInfo]?: DescriptorsIdentityInfo[K] extends
| Binary
| undefined
? DescriptorsIdentityInfo[K]
: string
}
Copy link
Member

@josepot josepot May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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?

Copy link
Contributor Author

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"),
Copy link
Member

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...)

@voliva voliva requested a review from josepot May 3, 2025 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants