Skip to content
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

[sdk/javascript] Transfer transaction - support for message types #228

Closed
cryptoBeliever opened this issue May 20, 2022 · 2 comments · Fixed by #352
Closed

[sdk/javascript] Transfer transaction - support for message types #228

cryptoBeliever opened this issue May 20, 2022 · 2 comments · Fixed by #352
Assignees
Labels
sdk-javascript Related to the Javascript SDK. Status: WIP This issue or PR is a work in progress.

Comments

@cryptoBeliever
Copy link
Contributor

cryptoBeliever commented May 20, 2022

Current Behaviour

Old SDKs message specification defined four types of messages:

  • Plain Message (prefix 0)
  • Encrypted Message (prefix 1)
  • Persistent Delegated Message transaction (prefix 254)
  • Raw Message (no prefix or not recognized prefix)

Currently, the SDK user (developer) has only the option to put the message as raw text when creating the transfer transaction object. So SDK user has to:

  • remember (when sending and when reading from API transactions) which prefix is for which transaction type and how to decode messages
  • implement encryption and decryption of messages (in case of encrypted messages)
  • implement persistent delegating message creation

Expected Behaviour

It's desired that SDK users be released from the obligation to remember the specification for various types of messages.
For SDK developers would be very helpful if:

  • he could create objects representing a specific message type (constructor/factory methods)
  • when reading transactions from API provide a way to read messages without knowing the specification e.g. wrapping messages using a typed message object.

Corresponding issue for Python SDK: #229

@cryptoBeliever cryptoBeliever added Status: WIP This issue or PR is a work in progress. sdk-javascript Related to the Javascript SDK. labels May 20, 2022
@cryptoBeliever cryptoBeliever changed the title [sdk/javascript] Functionality to encrypt/decrypt message [sdk/javascript] Transfer transaction - support for message types May 27, 2022
@gimre-xymcity
Copy link
Member

this is currently done via MessageEncoder object,
however, currently in case of NEM it will throw an error if it's instantiated on non-encrypted message type.
additionally try_decode/tryDecocde might throw in some cases

@cryptoBeliever
Copy link
Contributor Author

Encryption/Decryption works correctly ✔️

@cryptoBeliever cryptoBeliever linked a pull request Apr 16, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sdk-javascript Related to the Javascript SDK. Status: WIP This issue or PR is a work in progress.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@Jaguar0625 @gimre-xymcity @cryptoBeliever and others