Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
chore: changing binaryws to derivws
Browse files Browse the repository at this point in the history
  • Loading branch information
Hubert Koster authored and Hubert Koster committed Aug 24, 2023
1 parent 54c3e88 commit 5f16345
Show file tree
Hide file tree
Showing 19 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions docs/core-concepts/websocket/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ WebSocket is especially great for services that require continuous data exchange
To open a WebSocket connection, we need to create `new WebSocket` using the special protocol `ws`or `wss` in the url. Here is how you can do that in `JavaScript`:

```js
let socket = new WebSocket('wss://ws.binaryws.com/websockets/v3?app_id=1089');
let socket = new WebSocket('wss://ws.derivws.com/websockets/v3?app_id=1089');
```

:::caution
Expand All @@ -49,7 +49,7 @@ Here’s an example in `JavaScript`:

```js showLineNumbers
const app_id = 1089; // Replace with your app_id or leave as 1089 for testing.
const socket = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const socket = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);

socket.onopen = function (e) {
console.log('[open] Connection established');
Expand Down
2 changes: 1 addition & 1 deletion docs/languages/javascript/get-country-list/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Your final code will be:

```js title="index.js" showLineNumbers
const app_id = 1089; // Replace with your app_id or leave as 1089 for testing.
const websocket = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const websocket = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const ping_interval = 12000; // it's in milliseconds, which equals to 120 seconds
let interval;

Expand Down
4 changes: 2 additions & 2 deletions docs/languages/javascript/websocket-connection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Next, we'll create a WebSocket connection to Deriv WebSocket Server as seen belo

```js title="index.js" showLineNumbers
const app_id = 1089; // Replace with your app_id or leave as 1089 for testing.
const websocket = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const websocket = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
```

:::info
Expand Down Expand Up @@ -147,7 +147,7 @@ Your final code should be:

```js title="index.js" showLineNumbers
const app_id = 1089; // Replace with your app_id or leave as 1089 for testing.
const websocket = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const websocket = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const ping_interval = 12000; // it's in milliseconds, which equals to 120 seconds
let interval;

Expand Down
2 changes: 1 addition & 1 deletion examples/active_symbols/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 1089; // Replace with your app_id or leave the current one for testing.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });

// Currently gets all available symbols.
Expand Down
2 changes: 1 addition & 1 deletion examples/balance/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 32404; // Replace with your app_id or leave the current one for testing.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });

// WARNING: Be careful to not leak your token here in the sandbox.
Expand Down
2 changes: 1 addition & 1 deletion examples/buy_contract/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 32436; // Replace with your app_id or leave the current test app_id.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });

// Use a demo account token to test with demo currency.
Expand Down
2 changes: 1 addition & 1 deletion examples/contracts_for_symbol/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 1089; // Replace with your app_id or leave the current test app_id.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });

const contracts_for_symbol_request = {
Expand Down
2 changes: 1 addition & 1 deletion examples/expired_contracts/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 32512; // Replace with your app_id or leave current one for testing.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });

let token = '';
Expand Down
2 changes: 1 addition & 1 deletion examples/keep_alive/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 1089; // Replace with your app_id or leave as 1089 for testing.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);

const api = new DerivAPIBasic({ connection });

Expand Down
2 changes: 1 addition & 1 deletion examples/open_contracts/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 32486; // Replace with your app_id for testing.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });
// WARNING: Be careful to not leak your token here in the sandbox.
let token = '';
Expand Down
2 changes: 1 addition & 1 deletion examples/portfolio/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 32445; // Replace with your app_id or leave as 1089 for testing.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });
// WARNING: Be careful to not leak your token here in the sandbox.
let token = '';
Expand Down
2 changes: 1 addition & 1 deletion examples/profit_table/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 32450; // Replace with your app_id or leave as 1089 for testing.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });
// WARNING: Be careful to not leak your token here in the sandbox.
let token = '';
Expand Down
2 changes: 1 addition & 1 deletion examples/proposal/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 1089; // Replace with your app_id or leave as 1089 for testing.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });

const proposal_request = {
Expand Down
2 changes: 1 addition & 1 deletion examples/statement/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 32462; // Replace with your app_id or leave as 1089 for testing.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });
// WARNING: Be careful to not leak your token here in the sandbox.
let token = '';
Expand Down
2 changes: 1 addition & 1 deletion examples/ticks/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 1089; // Replace with your app_id or leave as 1089 for testing.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });
const tickStream = () => api.subscribe({ ticks: 'R_100' });

Expand Down
2 changes: 1 addition & 1 deletion examples/ticks_history/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api/dist/DerivAPIBasic';

const app_id = 1089; // Replace with your app_id or leave as 1089 for testing.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });

const ticks_history_request = {
Expand Down
2 changes: 1 addition & 1 deletion examples/website_status/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import DerivAPIBasic from 'https://cdn.skypack.dev/@deriv/deriv-api';
const app_id = 1089; // Replace with your app_id or leave as 1089 for testing.
const connection = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
const connection = new WebSocket(`wss://ws.derivws.com/websockets/v3?app_id=${app_id}`);
const api = new DerivAPIBasic({ connection });

const websiteStatusResponse = async (res) => {
Expand Down
2 changes: 1 addition & 1 deletion src/features/Endpoint/Endpoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const EndPoint = () => {
},
})}
name='server_url'
placeholder='e.g. frontend.binaryws.com'
placeholder='e.g. ws.derivws.com'
className={styles.textInput}
required
/>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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 DEFAULT_WS_SERVER = 'ws.binaryws.com';
export const DEFAULT_WS_SERVER = 'ws.derivws.com';
export const OAUTH_URL = 'oauth.deriv.com';

export const LOGIN_ACCOUNTS_SESSION_STORAGE_KEY = 'login-accounts';
Expand Down

0 comments on commit 5f16345

Please sign in to comment.