Skip to content

Commit

Permalink
fix(rest): add live baseURL
Browse files Browse the repository at this point in the history
  • Loading branch information
Braden Napier committed Oct 20, 2020
1 parent f4e15d3 commit 9bc9655
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
12 changes: 5 additions & 7 deletions src/client/rest/authenticated.ts
Expand Up @@ -56,13 +56,11 @@ export class RestAuthenticatedClient {
private signer: undefined | signatures.MessageSigner = undefined;

public constructor(options: RestAuthenticatedClientOptions) {
const baseURL = options.sandbox
? constants.SANDBOX_REST_API_BASE_URL
: options.baseURL;

if (!baseURL) {
throw new Error('Must set sandbox to true');
}
const baseURL =
options.baseURL ??
(options.sandbox
? constants.SANDBOX_REST_API_BASE_URL
: constants.LIVE_REST_API_BASE_URL);

this.baseURL = baseURL;

Expand Down
11 changes: 5 additions & 6 deletions src/client/rest/public.ts
Expand Up @@ -43,12 +43,11 @@ export class RestPublicClient {
private axios: AxiosInstance;

public constructor(options: RestPublicClientOptions) {
const baseURL = options.sandbox
? constants.SANDBOX_REST_API_BASE_URL
: options.baseURL;
if (!baseURL) {
throw new Error('Must set sandbox to true');
}
const baseURL =
options.baseURL ??
(options.sandbox
? constants.SANDBOX_REST_API_BASE_URL
: constants.LIVE_REST_API_BASE_URL);

this.baseURL = baseURL;

Expand Down

0 comments on commit 9bc9655

Please sign in to comment.