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

Automatically decode XDR structures for Server.getEvents #156

Merged
merged 6 commits into from
Oct 9, 2023

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented Oct 6, 2023

This makes the following changes to the expected schema for getEvents endpoint:

-   contractId: string;
+   contractId: Contract;
-   topic: string[];
+   topic: xdr.ScVal[];
-   value: {
-     xdr: string;
-   };
+   value: xdr.ScVal;

In particular,

  • events[i].contractId is now an instance of Contract
  • events[i].topic is now a list of decoded xdr.ScVal instances
  • events[i].value.xdr is now remapped directly to events.value
  • events[i].value is a decoded xdr.ScVal instance

Related: #128.

@Shaptic Shaptic requested a review from sreuland October 6, 2023 21:33
src/server.ts Show resolved Hide resolved
@Shaptic Shaptic merged commit f84f29c into main Oct 9, 2023
4 checks passed
@Shaptic Shaptic deleted the decode-events branch October 9, 2023 20:18
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.

2 participants