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

Legacy support (borsh-js) #4

Open
marcus-pousette opened this issue Sep 1, 2022 · 0 comments
Open

Legacy support (borsh-js) #4

marcus-pousette opened this issue Sep 1, 2022 · 0 comments

Comments

@marcus-pousette
Copy link
Member

marcus-pousette commented Sep 1, 2022

Can this library by compatible with borsh-js schemas in a simple way? Many existing users are depending on borsh-js and do not perhaps want to rewrite everything if it is already working.

The support has to work two way. I.e. There should be a way of getting borsh-js schemas into borsh-ts and borsh-ts into borsh-js schemas.

Issues:

  • borsh-js uses 'BN' instead of 'bigint' for u64 and above.
  • Enum representation in borsh-ts assumes that one creates a class for each enum type, whereas in borsh-js enums are simply enumerated.
  • borsh-ts supports custom serializers which will not work out of the box with borsh-js
  • When fixing all these compatibility issue, there will be a lot more (complicated) code, and a lot of test code has to be written (perhaps all of this would be a separate module)
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

No branches or pull requests

1 participant