Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Get App ID', () => {
it('By default it should return vercel staging ap id if hostname is not listed', () => {
window.location.hostname = 'asdfasdf';
const appId = getAppId();
expect(appId).toBe('35073');
expect(appId).toBe('36544');
});
it("Should return 35074 when it's called in localhost environment", () => {
window.location.hostname = 'localhost';
Expand Down
5 changes: 5 additions & 0 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ export const PRODUCTION_APP_ID = '36544';
export const STAGING_APP_ID = '36545';
export const VERCEL_DEPLOYMENT_APP_ID = '35073';
export const LOCALHOST_APP_ID = '35074';
export const PRODUCTION_ME_APP_ID = '61569'
export const PRODUCTION_BE_APP_ID = '61570'
export const STAGING_ME_APP_ID = '61571'
export const STAGING_BE_APP_ID = '61572'

export const DEFAULT_WS_SERVER = 'ws.derivws.com';
export const OAUTH_URL = 'oauth.deriv.com';

Expand Down
10 changes: 9 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import {
VERCEL_DEPLOYMENT_APP_ID,
OAUTH_URL,
DEFAULT_WS_SERVER,
PRODUCTION_ME_APP_ID,
PRODUCTION_BE_APP_ID,
STAGING_ME_APP_ID,
STAGING_BE_APP_ID,
} from './constants';

const CURRENCY_MAP = new Map([
Expand Down Expand Up @@ -86,8 +90,12 @@ export const getAppId = () => {
if (isHost('staging-api.deriv.com')) return STAGING_APP_ID;
if (isHost('deriv-api-docs.binary.sx')) return VERCEL_DEPLOYMENT_APP_ID;
if (isHost('api.deriv.com')) return PRODUCTION_APP_ID;
if (isHost('api.deriv.me')) return PRODUCTION_ME_APP_ID;
if (isHost('api.deriv.be')) return PRODUCTION_BE_APP_ID;
if (isHost('staging-api.deriv.me')) return STAGING_ME_APP_ID;
if (isHost('staging-api.deriv.be')) return STAGING_BE_APP_ID;

return VERCEL_DEPLOYMENT_APP_ID;
return PRODUCTION_APP_ID;
};

/**
Expand Down
Loading