Skip to content

Add valueOf support to XDR types. #101

@Shaptic

Description

@Shaptic

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions