Skip to content

feat(didc-js): encode and validate specific types and service args #602

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

olaszakos
Copy link

Overview
This PR extends the didc-js wasm module with capability to encode values of specific types, and values for the service arguments, with the purpose of also validating them against those types. This is useful for JS clients where the user is expected to produce valid candid value for a particular type.

Requirements

  • the encode function can receive type information other than service_method such as a type name or instruction to use the service argument types

Considered Solutions
I did not find any other solution.

Recommended Solution
Since encode already has this functionality to encode (and validate) service method arguments, this seems like a good place to extend the functionality.

Considerations

@olaszakos olaszakos requested a review from a team as a code owner April 8, 2025 12:43
@olaszakos olaszakos marked this pull request as draft April 8, 2025 14:22
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.

1 participant