-
Notifications
You must be signed in to change notification settings - Fork 49
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
Api based sdk #150
Open
Vikastc
wants to merge
22
commits into
dhiway:api_based_sdk
Choose a base branch
from
Vikastc:api_based_sdk
base: api_based_sdk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Api based sdk #150
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Support for nested selective disclosure by using a flattened content model. This PR also has a breaking change on `createPresentation` call. **not supported** - selective disclosure of array values - refactored the function signature to accept an options object. This would allow you to easily omit specific properties and make the function more extensible in the future. ``` interface CreatePresentationOptions { document: IDocument; signCallback: SignCallback; selectedAttributes?: string[]; challenge?: string; } ``` Modified createPresentation function: ``` export async function createPresentation({ document, signCallback, selectedAttributes = [], challenge, }: CreatePresentationOptions): Promise<IDocumentPresentation> { // ... (rest of the function remains unchanged) } ``` We can now call the function with just the properties you need. It makes the call more readable and easily extensible. ``` const presentation = await createPresentation({ document: document, signCallback: async ({ data }) => ({ signature: holderKeys.authentication.sign(data), keyType: holderKeys.authentication.type, keyUri: `${holderDid.uri}${holderDid.authentication[0].id}`, }), // selectedAttributes: ['name', 'id', 'address.pin', 'address.location', 'address'], challenge: challenge }); ``` In the call above, we can easily omit selectedAttributes. If you want to include selectedAttributes, you can add that property to the options object. This structure allows for much cleaner function calls, especially when a function has several parameters, and some of them are optional. We should refactor other calls to follow this model.
The "verifyPresentation()" method was previously checking if a stream had been revoked. However, when dealing with stream updates, the stream remains unrevoked, causing "verifyPresentation()" to incorrectly return true for old documents as well. This problem has been resolved by implementing the new check.
…changing identifier (dhiway#112)
Signed-off-by: vikastc <[email protected]>
…iway#121) 'required' is very crucial field to be added into the schema to support multiple usecases. Fixes: dhiway#120 Signed-off-by: Amar Tumballi <[email protected]>
* netx-dev companion * authority membership updates * augment api updates * demo updates to use the membership pallets. Author: Satish Mohan
* type definitions update - updates to latest DID - also gets the unique pallet related updates
Signed-off-by: vikastc <[email protected]>
Signed-off-by: vikastc <[email protected]>
Signed-off-by: vikastc <[email protected]>
Signed-off-by: vikastc <[email protected]>
Signed-off-by: vikastc <[email protected]>
Signed-off-by: vikastc <[email protected]>
Signed-off-by: vikastc <[email protected]>
Signed-off-by: vikastc <[email protected]>
Signed-off-by: vikastc <[email protected]>
Why are we adding this to the SDK repo? |
There is a separate branch in cord.js named api_based_sdk, was working on this so did a git rebase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.