INTERNAL PR js-iden3-auth: VidosResolver#1
Conversation
robdefeo
left a comment
There was a problem hiding this comment.
Couple of suggests to duplicate in both methods
| import { Id } from '@iden3/js-iden3-core'; | ||
| import { type IStateResolver, type ResolvedState, isGenesisStateId } from './resolver'; | ||
|
|
||
| type DidResolutionResult = { |
There was a problem hiding this comment.
can you import import type { DIDResolutionResult } from 'did-resolver'; instead of defining it?
There was a problem hiding this comment.
Done fa1ed4c, needed to extend the type for it to facilitate the Polygon ID state fields.
| const stateHex = state.toString(16); | ||
|
|
||
| const zeroAddress = '11111111111111111111'; // 1 is 0 in base58 | ||
| const did = `did:polygonid:polygon:amoy:${zeroAddress}?gist=${stateHex}`; |
There was a problem hiding this comment.
What about how to make this work on different networks other than Amoy?
There was a problem hiding this comment.
Done cc4047c, added a network param to the VidosResolver constructor.
| }); | ||
| const result = (await response.json()) as DidResolutionResult; | ||
|
|
||
| const globalInfo = result.didDocument.verificationMethod[0].global; |
There was a problem hiding this comment.
suggest checking for an error in result.didResolutionMetadata.error before going too far as otherwise likely will give an incorrect result
There was a problem hiding this comment.
Done 7165914, error is thrown on such resolution error
This PR is implementing
VidosResolverto be used as state resolver for the js-iden3.Example PR: mailchain/polygonid-tutorial-examples#1