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

Make Hyper signatures conform to js-xdr changes. #6

Merged
merged 17 commits into from
Jun 21, 2023
Merged

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented Jun 14, 2023

NOTE: This is contingent upon the release of js-xdr@3.0.0.


This modifies the constructor for Hyper and UnsignedHyper to match the new ways to create integers larger than 32-bits in stellar/js-xdr (see stellar/js-xdr#100):

-    constructor(low: number, high: number);
+    constructor(values: string | bigint | number | Array<string | bigint | number>);

It also adds conversions methods to make it easier to use in native code:

    toBigInt(): bigint;
    toString(): string;

Known Limitations

Because dts-dom (the underlying workhorse of this package) does not support bigint as a type (i.e. there was no dom.types.bigint), I forked it to a personal repo. We should probably make it a Stellar repo, instead.

@Shaptic Shaptic requested a review from paulbellamy June 14, 2023 00:50
@@ -28,14 +28,25 @@ exports[`.transform(type definitions) 1`] = `
validateXDR(input: string, format: \\"hex\\" | \\"base64\\"): boolean;
}

interface Bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is from #4 because yarn test -u wasn't run

yarn.lock Outdated Show resolved Hide resolved
@Shaptic Shaptic merged commit 004a97b into master Jun 21, 2023
1 check passed
@Shaptic Shaptic deleted the fix-hyper-support branch June 21, 2023 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants