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

Added Toml types from SEP1 #794

Merged

Conversation

tobinbc
Copy link
Contributor

@tobinbc tobinbc commented Sep 27, 2022

#371

Added all the fields I could find in SEP1; and other sources when building my Anchor.

They are not readonly because if going in the other direction it can be desired to assemble the object first before it is tomlified.

Is there any desire to bring in the reverse?
e.g.

const TOML = require("@iarna/toml");
const body = TOML.stringify(config);

@JakeUrban JakeUrban requested a review from Shaptic October 3, 2022 22:23
@JakeUrban
Copy link
Contributor

JakeUrban commented Oct 3, 2022

This is great @tobinbc, thanks for contributing this.

About generating the TOML content from a StellarTomlResolver.StellarToml object, I think it would be helpful, but wouldn't that functionality be best implemented in the toml library? The toml library in the Python ecosystem has a .dumps() function that accepts an arbitrary dict and creates the TOML contents. I would assume the JavaScript variant has the same functionality for objects, but it doesn't look like it which is a bit surprising.

Copy link
Contributor

@Shaptic Shaptic left a comment

Choose a reason for hiding this comment

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

Nice add! We can add the reverse direction if there's need later.

@Shaptic Shaptic merged commit 531c3fc into stellar:master Oct 4, 2022
@Shaptic Shaptic mentioned this pull request Oct 4, 2022
@tobinbc
Copy link
Contributor Author

tobinbc commented Oct 4, 2022 via email

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.

3 participants