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

Expose certain functions from @stellar/js-xdr so downstream don't need to mix dependencies. #744

Merged
merged 4 commits into from
May 14, 2024

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented May 8, 2024

No description provided.

Copy link

github-actions bot commented May 8, 2024

Size Change: +3.07 kB (+0.1%)

Total Size: 3.22 MB

Filename Size Change
dist/stellar-base.js 2.36 MB +2.28 kB (+0.1%)
dist/stellar-base.min.js 856 kB +788 B (+0.09%)

compressed-size-action

Copy link
Contributor

@chadoh chadoh left a comment

Choose a reason for hiding this comment

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

Thanks!

@BlaineHeffron
Copy link

BlaineHeffron commented May 13, 2024

When I use the cereal namespace instead of just importing directly from js-xdr this code gets a TypeError:

export function processSpecEntryStream(buffer: Buffer) {
  const reader = new cereal.XdrReader(buffer);
  const res: xdr.ScSpecEntry[] = [];
  while (!reader.eof){
    res.push(xdr.ScSpecEntry.read(reader));
  }
  return res;
}
Argument of type 'XdrReader' is not assignable to parameter of type 'Buffer'.
  Type 'XdrReader' is missing the following properties from type 'Buffer': write, toJSON, equals, compare, and 91 more.

93     res.push(xdr.ScSpecEntry.read(reader));

Edit: it still works when I just ts-ignore it, but not sure why it complains when I use the cereal namespace vs importing it directly. Anyway, I don't think its really a problem.

@Shaptic Shaptic merged commit 7c02991 into master May 14, 2024
6 checks passed
@Shaptic Shaptic deleted the expose-js-xdr branch May 14, 2024 20:39
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

Successfully merging this pull request may close these issues.

None yet

4 participants