Skip to content

Commit

Permalink
Merge 7b99a8e into 61467fa
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekn committed Feb 15, 2016
2 parents 61467fa + 7b99a8e commit 029d09e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 49 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

As this project is pre 1.0, breaking changes may happen for minor version bumps. A breaking change will get clearly notified in this log.

## 0.4.2 - unreleased
## 0.5.0 - unreleased

* **Breaking change** `Server` and `FederationServer` constructors no longer accept object as `serverUrl` parameter.

## next patch - unreleased

* Added tests.
* Added `CHANGELOG.md` file.
Expand Down
11 changes: 0 additions & 11 deletions src/account_call_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@ export class AccountCallBuilder extends CallBuilder {
this.url.segment('accounts');
}

/**
* Returns information and links relating to a single account.
* The balances section in the returned JSON will also list all the trust lines this account has set up.
*
* @deprecated use accountId method instead
*/
address(id) {
console.warn("AccountCallBuilder#address is deprecated, please use AccountCallBuilder#accountId instead");
return this.accountId(id);
}

/**
* Returns information and links relating to a single account.
* The balances section in the returned JSON will also list all the trust lines this account has set up.
Expand Down
27 changes: 4 additions & 23 deletions src/federation_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,13 @@ export class FederationServer {
* [federation server](https://www.stellar.org/developers/learn/concepts/federation.html)
* instance and exposes an interface for requests to that instance.
* @constructor
* @param {string} serverURL The federation server URL (ex. `https://acme.com/federation`). The old method (config object parameter) is **deprecated**.
* @param {string} serverURL The federation server URL (ex. `https://acme.com/federation`).
* @param {string} domain Domain this server represents
*/
constructor(serverURL, domain) {
if (isString(serverURL)) {
// TODO `domain` regexp
this.serverURL = URI(serverURL);
this.domain = domain;
} else {
// We leave the old method for compatibility reasons.
// This will be removed in the next major release.
if (!serverURL) {
serverURL = {};
}
this.protocol = serverURL.secure ? "https" : "http";
this.hostname = serverURL.hostname || "localhost";
this.port = serverURL.port || 80;
this.path = serverURL.path || '/federation';
this.domain = serverURL.domain;
this.serverURL = URI({
protocol: this.protocol,
hostname: this.hostname,
port: this.port,
path: this.path
});
}
// TODO `domain` regexp
this.serverURL = URI(serverURL);
this.domain = domain;
}

/**
Expand Down
17 changes: 3 additions & 14 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,10 @@ export class Server {
* Server handles a network connection to a [Horizon](https://www.stellar.org/developers/horizon/learn/index.html)
* instance and exposes an interface for requests to that instance.
* @constructor
* @param {string} serverURL Horizon Server URL (ex. `https://horizon-testnet.stellar.org`). The old method (config object parameter) is **deprecated**.
* @param {string} serverURL Horizon Server URL (ex. `https://horizon-testnet.stellar.org`).
*/
constructor(serverURL={}) {
if (isString(serverURL)) {
this.serverURL = URI(serverURL);
} else {
// We leave the old method for compatibility reasons.
// This will be removed in the next major release.
this.protocol = serverURL.secure ? "https" : "http";
this.hostname = serverURL.hostname || "localhost";
this.port = serverURL.port || 3000;
this.serverURL = URI({ protocol: this.protocol,
hostname: this.hostname,
port: this.port });
}
constructor(serverURL) {
this.serverURL = URI(serverURL);
}

/**
Expand Down

0 comments on commit 029d09e

Please sign in to comment.