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

StellarTomlResolver #75

Merged
merged 5 commits into from
Sep 12, 2016
Merged

StellarTomlResolver #75

merged 5 commits into from
Sep 12, 2016

Conversation

bartekn
Copy link
Contributor

@bartekn bartekn commented Sep 7, 2016

This PR introduces StellarTomlResolver that is responsible for downloading and parsing stellar.toml files. The API is simple:

StellarSdk.StellarTomlResolver.resolve('acme.com')
  .then(stellarToml => {
    console.log(stellarToml.FEDERATION_SERVER);
    console.log(stellarToml.CURRENCIES);
  });

The second parameter in resolve method: opts allows setting allowHttp option, that will download stellar.toml file over http protocol (instead of https).

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 90.435% when pulling a077fbf on stellar-toml-resolver into a105b69 on master.

@nullstyle
Copy link
Contributor

It's worth noting that IMO having the allowHttp option be a per-call option will probably be annoying to use. I can't think of any situation where a developer would want to switch between modes within the same process... more likely, a given process will want the same behavior for all resolve operations: either all over SSL or none over SSL.

IMO, treating this similar to how we treat what network the sdk is configured against is the most appropriate solution.

I would add a module level "allowHttp" variable that will be used in the event that opts doesn't override it.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.9%) to 89.63% when pulling 2bf5438 on stellar-toml-resolver into c301bb8 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.9%) to 89.63% when pulling 2bf5438 on stellar-toml-resolver into c301bb8 on master.

@bartekn
Copy link
Contributor Author

bartekn commented Sep 12, 2016

Created Config class to set global config params.

@bartekn bartekn merged commit d20fdbc into master Sep 12, 2016
@abuiles abuiles deleted the stellar-toml-resolver branch July 25, 2019 19:46
lhtdeepaktomar pushed a commit to lhtdeepaktomar/js-stellar-sdk that referenced this pull request Jun 11, 2021
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

3 participants