Skip to content

Commit 4a735f8

Browse files
authored
add baseUrl param (#72)
1 parent 06d59dd commit 4a735f8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/kiln.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { MaticService } from './services/matic';
1313
type Config = {
1414
apiToken: string;
1515
testnet?: boolean;
16+
baseUrl?: string;
1617
};
1718

1819
export const KILN_VALIDATORS = v;
@@ -28,10 +29,10 @@ export class Kiln {
2829
xtz: XtzService;
2930
matic: MaticService;
3031

31-
constructor({ testnet, apiToken }: Config) {
32+
constructor({ testnet, apiToken, baseUrl }: Config) {
3233
api.defaults.headers.common.Authorization = `Bearer ${apiToken}`;
3334
api.defaults.headers.common['Content-Type'] = 'application/json';
34-
api.defaults.baseURL =
35+
api.defaults.baseURL = baseUrl ? baseUrl :
3536
testnet === true
3637
? 'https://api.testnet.kiln.fi'
3738
: 'https://api.kiln.fi';

0 commit comments

Comments
 (0)