Skip to content

Commit 07d6b8f

Browse files
authored
Merge pull request #40 from SIDANWhatever/main
feat: adding base url option
2 parents fe9032d + a94a0bb commit 07d6b8f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@maestro-org/typescript-sdk",
3-
"version": "1.5.1",
3+
"version": "1.5.2",
44
"description": "TypeScript SDK for the Maestro Dapp Platform",
55
"main": "dist/index.js",
66
"module": "dist/index.mjs",

src/configuration.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import globalAxios, { AxiosInstance, AxiosRequestConfig } from 'axios';
33
export type MaestroSupportedNetworks = 'Mainnet' | 'Preprod' | 'Preview';
44

55
export interface ConfigurationParameters {
6-
readonly apiKey: string;
6+
readonly apiKey?: string;
7+
readonly baseUrl?: string;
78
readonly network: MaestroSupportedNetworks;
89
readonly baseOptions?: AxiosRequestConfig;
910
readonly axiosInstance?: AxiosInstance;
@@ -36,8 +37,12 @@ export class Configuration {
3637
readonly axiosInstance: AxiosInstance;
3738

3839
constructor(param: ConfigurationParameters) {
39-
this.apiKey = param.apiKey;
40-
this.baseUrl = `https://${param.network}.gomaestro-api.org/v1`;
40+
if (param.baseUrl) {
41+
this.baseUrl = param.baseUrl;
42+
} else {
43+
this.baseUrl = `https://${param.network}.gomaestro-api.org/v1`;
44+
}
45+
this.apiKey = param.apiKey || '';
4146
this.baseOptions = param.baseOptions;
4247
this.axiosInstance = param.axiosInstance ?? globalAxios;
4348
}

0 commit comments

Comments
 (0)