Skip to content

Commit

Permalink
feat: added sdk version to header
Browse files Browse the repository at this point in the history
  • Loading branch information
Ho3einWave committed Oct 23, 2024
1 parent 9540eab commit 7029359
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
import { defaultsDeep } from 'lodash';
import { MyTonSwapResponse } from '../types/client';
import { defaultBaseUrl } from '../constants';
import packageJson from '../../package.json';
export class Request {
attemptOptions: Partial<AttemptOptions<any>> = {
maxAttempts: 3,
Expand All @@ -21,7 +22,8 @@ export class Request {
...(this.client.options?.apiKey && {
'x-api-key': this.client.options.apiKey,
}),
...this.client.options?.headers,
...(this.client.options?.headers ?? {}),
'sdk-version': packageJson.version,
},
method: 'GET',
} satisfies AxiosRequestConfig;
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"noImplicitAny": true,
"esModuleInterop": true,
"strictNullChecks": true,
"resolveJsonModule": true,

// Best practices
"strict": true,
Expand Down

0 comments on commit 7029359

Please sign in to comment.