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

FederationServer #49

Merged
merged 5 commits into from
Jan 5, 2016
Merged

FederationServer #49

merged 5 commits into from
Jan 5, 2016

Conversation

bartekn
Copy link
Contributor

@bartekn bartekn commented Jan 5, 2016

This PR introduces FederationServer class that allows sending requests to federation servers.

Close #47

@bartekn
Copy link
Contributor Author

bartekn commented Jan 5, 2016

For loading stellar.toml: what do you think about adding static method: FederationServer.createForDomain(domain)? It will load:

https://www.{domain}/.well-known/stellar.toml

parse it and then create and return FederationServer object from FEDERATION_SERVER value.

}
address = `${address}*${this.domain}`;
}
let url = this.serverURL.query(`type=name&q=${address}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like using the map form of query would be better:

this.serverURL.query({type: "name", q: address});

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, thanks. I haven't noticed it.

@nullstyle
Copy link
Contributor

+1

* @returns {Promise}
*/
static forAddress(address) {
let [,domain] = address.split('*');
Copy link
Contributor

Choose a reason for hiding this comment

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

This will behave incorrectly in the presence of 2 asterisks. We should ensure there isn't, returning an error to the user if there is.

@nullstyle
Copy link
Contributor

Other than the bug I pointed out, +1

bartekn added a commit that referenced this pull request Jan 5, 2016
@bartekn bartekn merged commit 899f346 into master Jan 5, 2016
@abuiles abuiles deleted the federation-server 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

2 participants