Skip to content

Commit

Permalink
feat: force mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kirosc committed Jul 7, 2021
1 parent d3af516 commit bdc1406
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ export class API {
this.axios = Axios.create({
baseURL: ENDPOINT,
timeout: options?.timeout ?? 30000,
headers: { APIKEY: this.KEY },
headers: {
APIKEY: this.KEY,
...(options?.forcedMode && { 'Forced-Mode': options?.forcedMode }),
},
});
this.axios.interceptors.request.use(
(config) => {
Expand Down
1 change: 1 addition & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface APIOptions {
key?: string;
secrets?: string;
timeout?: number;
forcedMode?: 'real' | 'paper';
errorHandler?: (
response: ThreeCommasError,
reject: (reason?: any) => void
Expand Down

0 comments on commit bdc1406

Please sign in to comment.