js-moi-sdk
js-moi-sdk copied to clipboard
feat: enhance `ManifestCoder` for encoding/decoding routine arguments and returned values
Enhance ManifestCoder
for Encoding/Decoding Routine Arguments and Returned Values
This pull request enhances the ManifestCoder
class by introducing new methods and improvements to existing ones. These changes aim to simplify the process of encoding and decoding routine arguments and returned values, improving the overall developer experience.
Changes:
-
ElementDescriptor
:
- The
ElementDescriptor
class has been relocated fromjs-moi-logic
tojs-moi-manifest
. - Developers can now instantiate an
ElementDescriptor
object with a manifest object, providing more flexibility and integration with the manifest data.
-
Manifest.encodeArguments
:
- This method now supports extracting routine type fields from arguments based on the routine name.
- It can encode arguments into the POLO format, simplifying the developer experience.
- The existing functionality remains unaffected, ensuring backward compatibility.
-
ManifestCoder.decodeArguments
:
- This new method enables extracting the type of the returned value from a routine.
- It can decode the POLO output passed as an argument, facilitating the processing of routine results.
These changes streamline the process of working with routine arguments and returned values within the ManifestCoder
class.
- closes #62
Changes include
- [ ] Bugfix (non-breaking change that solves an issue)
- [X] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (change that is not backwards-compatible and/or changes current functionality)
Checklist
- [X] I have assigned this PR to myself
- [X] I have added at least 1 reviewer
- [X] I have tested this code
- [X] I have updated the README and other relevant documents (guides...)