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

Add valueOf support to XDR types. #101

Open
Shaptic opened this issue Jun 21, 2023 · 0 comments
Open

Add valueOf support to XDR types. #101

Shaptic opened this issue Jun 21, 2023 · 0 comments

Comments

@Shaptic
Copy link
Contributor

Shaptic commented Jun 21, 2023

Is your feature request related to a problem? Please describe.
It is very convenient to be able to use XDR types that correlate to a native type in an inline, convenient way. For example, you could use Hyper inline with arithmetic operations, e.g.

let increment = new Hyper(1234n) + 1n;

Describe the solution you'd like
valueOf() methods added to each XDR primitive type we support.

Describe alternatives you've considered
Each type has a way to access its raw, underlying value, but this is a little jankier.

Additional context
See @paulbellamy's comment here: stellar/dts-xdr#6 (comment).

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