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

Document enums and flags (and make them simpler to use?) #87

Closed
Mr0grog opened this issue Aug 9, 2016 · 0 comments
Closed

Document enums and flags (and make them simpler to use?) #87

Mr0grog opened this issue Aug 9, 2016 · 0 comments
Assignees

Comments

@Mr0grog
Copy link

Mr0grog commented Aug 9, 2016

This basically the same issue as lightsail-network/java-stellar-sdk#31, but for the JS SDK.

It's possible to use enums from the generated XDR classes to make code clearer, as in setting flags on an account:

StellarSdk.Operation.setOptions({
  setFlags: StellarSdk.xdr.AccountFlags.authRevocableFlag().value |
    StellarSdk.xdr.AccountFlags.authRequiredFlag().value
});

// or slightly less awkward if you make yourself a shortcut:
var flags = StellarSdk.xdr.AccountFlags;
StellarSdk.Operation.setOptions({
  setFlags: flags.authRevocableFlag().value | flags.authRequiredFlag().value
});

It'd be helpful if these were documented.

It might also be nice if working with these was easier, though that's maybe better handled as a separate issue? (maybe the setFlags option could take an object, or the flags were exposed at the root level, or the flags weren't methods and you didn't have to get the value property from them, etc.).

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

No branches or pull requests

2 participants