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

Commit 3960aba

Browse files
Hubert KosterHubert Koster
authored andcommitted
chore: fixing merge conflicts
2 parents 9b669f1 + 9663705 commit 3960aba

File tree

63 files changed

+1394
-455
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1394
-455
lines changed

config/v3/app_register/send.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"enum": [1]
1515
},
1616
"app_markup_percentage": {
17-
"description": "[Optional] Markup to be added to contract prices (as a percentage of contract payout).",
17+
"description": "[Optional] Markup to be added to contract prices (as a percentage of contract payout). Max markup: 3%.",
1818
"type": "number",
19-
"maximum": 5,
19+
"maximum": 3,
2020
"minimum": 0
2121
},
2222
"appstore": {

config/v3/app_update/send.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"type": "integer"
1414
},
1515
"app_markup_percentage": {
16-
"description": "[Optional] Markup to be added to contract prices (as a percentage of contract payout).",
16+
"description": "[Optional] Markup to be added to contract prices (as a percentage of contract payout). Max markup: 3%.",
1717
"type": "number",
18-
"maximum": 5,
18+
"maximum": 3,
1919
"minimum": 0
2020
},
2121
"appstore": {

docs/core-concepts/api-calls-anatomy/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ All API calls have a send functionality for making a request and receiving a res
2424

2525
Several API calls provide the `subscribe` functionality. When you subscribe to an API call, you will receive a continuous stream from data of this particular API call.
2626

27-
Some of these API calls automatically subscribe (e.g. [ticks](https://api.deriv.com/api-explorer#ticks)) and some have an optional `subscribe` field. If you pass `1` to the `subscribe` field, the subscription will start and the server will continue to send the requested data until you unsubscribe by calling the `Forget` or `Forget all` API calls.
27+
Some of these API calls automatically subscribe (e.g. [ticks](/api-explorer#ticks)) and some have an optional `subscribe` field. If you pass `1` to the `subscribe` field, the subscription will start and the server will continue to send the requested data until you unsubscribe by calling the `Forget` or `Forget all` API calls.
2828

29-
For example, you can call [Tick History](https://api.deriv.com/api-explorer#ticks_history) to receive tick history data. But when you add the `subscribe` option to this call, you will receive the tick history data you requested in the first response, and you will continue to receive a new response every time there is a new tick published by the server for the given symbol.
29+
For example, you can call [Tick History](/api-explorer#ticks_history) to receive tick history data. But when you add the `subscribe` option to this call, you will receive the tick history data you requested in the first response, and you will continue to receive a new response every time there is a new tick published by the server for the given symbol.
3030

3131
In the message stream from `subscribe`, there is a field called `subscription`. This is the `Stream ID`. With this ID, you can identify the message stream in your logic and stop the stream with `Forget` and `Forget All` API calls.
3232

@@ -41,7 +41,7 @@ If you call the API with the `send` functionality, then the server will only sen
4141
If you want to stop the message stream created by `subscribe`, you will have to call the `Forget` API call with the correct `Stream ID`. Otherwise, you can use the `Forget All` API call to stop streams by their `Method name`.
4242

4343
:::caution
44-
For more information on the `Forget` API call, have a look at [Forget](https://api.deriv.com/api-explorer#forget) and [Forget All](https://api.deriv.com/api-explorer#forget_all) in the API explorer.
44+
For more information on the `Forget` API call, have a look at [Forget](/api-explorer#forget) and [Forget All](/api-explorer#forget_all) in the API explorer.
4545
:::
4646

4747
## Request data
@@ -64,15 +64,15 @@ A `Residence List` call returns a list of countries and 2-letter country codes,
6464

6565
The request data for this call is as below:
6666

67-
```ts
67+
```ts showLineNumbers
6868
{
6969
residence_list: 1; // Api Call Method Name
7070
passthrough?: object; // Optional
7171
req_id?: number; // Optional
7272
}
7373
```
7474

75-
The `residence_list` field is the `method name` for the call and is required. There may be other required fields related to this type of the request you want to send. To know more about `Residence List` and other API calls, please check them out in [API Explorer](https://api.deriv.com/api-explorer#residence_list).
75+
The `residence_list` field is the `method name` for the call and is required. There may be other required fields related to this type of the request you want to send. To know more about `Residence List` and other API calls, please check them out in [API Explorer](/api-explorer#residence_list).
7676

7777
### Optional fields
7878

@@ -87,7 +87,7 @@ Whatever you pass to this field will be returned back to you inside a `response`
8787
You may need to `tag` your requests and pass them through our `WebSocket` calls. You can do so by passing a `number` to this field. It can be helpful when you need to map `requests` to `responses`.
8888

8989
:::caution
90-
To learn about additional optional fields specific to each API call, please refer to our [API Explorer](https://api.deriv.com/api-explorer).
90+
To learn about additional optional fields specific to each API call, please refer to our [API Explorer](/api-explorer).
9191
:::
9292

9393
## Response data
@@ -96,7 +96,7 @@ When you get the response for the call, there will be a `Field` with the same na
9696

9797
The response for the `Residence List` call:
9898

99-
```js
99+
```js showLineNumbers
100100
{
101101
echo_req: {
102102
req_id: 1,
@@ -163,7 +163,7 @@ The response for the `Residence List` call:
163163
};
164164
```
165165

166-
Here the `residence_list` is the `method name`, and it contains the actual data you requested. To keep it short, we haven't included the rest of the array. You can check the actual response [here](https://api.deriv.com/api-explorer#residence_list).
166+
Here the `residence_list` is the `method name`, and it contains the actual data you requested. To keep it short, we haven't included the rest of the array. You can check the actual response [here](/api-explorer#residence_list).
167167

168168
#### The `echo_req` field
169169

@@ -173,7 +173,7 @@ This `Field` contains the exact `Request Data` you sent to the server.
173173

174174
This `Field` helps you determine which `message` data you're getting on the message event of the WebSocket connection. For example, your `onmessage` event handler for your WebSocket connection in `JavaScript` would be:
175175

176-
```js
176+
```js showLineNumbers
177177
socket.onmessage = (event) => {
178178
const receivedMessage = JSON.parse(event.data);
179179

docs/core-concepts/authorization-authentication/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Please refer to [Setting up a Deriv application](docs/setting-up-a-deriv-applica
3333

3434
An API token is a unique identifier of a client that requests access from a server. It's the simplest way of authorisation.
3535

36-
The access level for each API token has to match the required access level of each API call, which can be found in the [API Explorer](https://api.deriv.com/api-explorer) as well.
36+
The access level for each API token has to match the required access level of each API call, which can be found in the [API Explorer](/api-explorer) as well.
3737

3838
For example, on the screenshot below, you can see that to be able to use the Account Status, a token with read access level must be used.
3939

@@ -71,7 +71,7 @@ Once a user signs up/logs in, they will be redirected to the URL that you entere
7171

7272
The query parameters in the redirect URL are the user's accounts and their related session tokens. You can map the query parameters to an array using the following approach:
7373

74-
```js
74+
```js showLineNumbers
7575
const user_accounts = [
7676
{
7777
account: 'cr799393',
@@ -86,17 +86,17 @@ const user_accounts = [
8686
];
8787
```
8888

89-
To authorise the user based on the user's **selected** account, call the [authorize](https://api.deriv.com/api-explorer#authorize) API call with the user's **selected** account **session token**:
89+
To authorise the user based on the user's **selected** account, call the [authorize](/api-explorer#authorize) API call with the user's **selected** account **session token**:
9090

91-
```js
91+
```js showLineNumbers
9292
{
9393
"authorize": "a1-f7pnteezo4jzhpxclctizt27hyeot"
9494
}
9595
```
9696

9797
The response for the `authorize` call would be an object as below:
9898

99-
```js
99+
```js showLineNumbers
100100
{
101101
"account_list": [
102102
{

docs/core-concepts/websocket/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ WebSocket is especially great for services that require continuous data exchange
2525
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`:
2626

2727
```js
28-
let socket = new WebSocket('wss://red.binaryws.com/websockets/v3?app_id=1089');
28+
let socket = new WebSocket('wss://ws.binaryws.com/websockets/v3?app_id=1089');
2929
```
3030

3131
:::caution
@@ -47,9 +47,9 @@ Sending a message can be done via socket.send(data).
4747

4848
Here’s an example in `JavaScript`:
4949

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

5454
socket.onopen = function (e) {
5555
console.log('[open] Connection established');

docs/languages/javascript/get-country-list/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You can learn more about countries [here](/docs/terminology/trading/residence-li
1717

1818
To get a list of countries, update the open event listener using the following approach:
1919

20-
```js title="index.js"
20+
```js title="index.js" showLineNumbers
2121
const ping_interval = 12000; // it's in milliseconds, which equals to 120 seconds
2222
let interval;
2323
// subscribe to `open` event
@@ -38,7 +38,7 @@ websocket.addEventListener('open', (event) => {
3838

3939
Now, update the `message` event listener to render the data:
4040

41-
```js title="index.js"
41+
```js title="index.js" showLineNumbers
4242
// subscribe to `message` event
4343
websocket.addEventListener('message', (event) => {
4444
const receivedMessage = JSON.parse(event.data);
@@ -58,7 +58,7 @@ websocket.addEventListener('message', (event) => {
5858

5959
The response should be an object:
6060

61-
```json
61+
```json showLineNumbers
6262
{
6363
"echo_req": {
6464
"req_id": 1,
@@ -143,9 +143,9 @@ You will need detailed content about `IDV` and `ONFIDO` identity services, their
143143

144144
Your final code will be:
145145

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

docs/languages/javascript/project-setup/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ Now, open the `index.html` file or use the [Live Server Extension](https://marke
3838

3939
Now, change the content of the files using the following approach:
4040

41-
```js title="index.js"
42-
console.log("we will create our websocket connection here");
41+
```js title="index.js" showLineNumbers
42+
console.log('we will create our websocket connection here');
4343
```
4444

45-
```html title="index.html"
45+
```html title="index.html" showLineNumbers
4646
<!DOCTYPE html>
4747
<html lang="en">
4848
<head>

docs/languages/javascript/websocket-connection/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ If you're not familiar with WebSockets, please check out [our documentation](/do
2222

2323
Next, we'll create a WebSocket connection to Deriv WebSocket Server as seen below:
2424

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

3030
:::info
@@ -46,7 +46,7 @@ Generally, we have 4 events on `WebSocket connections`:
4646

4747
Let's add an event listener for these events on our WebSocket connection.
4848

49-
```js title="index.js"
49+
```js title="index.js" showLineNumbers
5050
// subscribe to `open` event
5151
websocket.addEventListener('open', (event) => {
5252
console.log('websocket connection established: ', event);
@@ -72,13 +72,13 @@ Now, open the `index.html` file in our browser and check your developer console.
7272

7373
### Send and receive data
7474

75-
Our WebSocket server provides [ping/pong](/api-explorer#ping) functionality. Let's use it in our demo project to send and receive data. Change the event listeners for `open` and `message` as below:
75+
Our WebSocket server provides <a href="/api-explorer#ping" target="_blank" rel="noopener noreferrer">ping/pong</a> functionality. Let's use it in our demo project to send and receive data. Change the event listeners for `open` and `message` as below:
7676

7777
:::caution
7878
The `send` function on the WebSocket connection, only receives `string`, `ArrayBuffer`, `Blob`, `TypedArray` and `DataView`. You can read more about them on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send). This means, if we want to send an `object`, we have to stringify it with `JSON.stringify` first.
7979
:::
8080

81-
```js title="index.js"
81+
```js title="index.js" showLineNumbers
8282
// subscribe to `open` event
8383
websocket.addEventListener('open', (event) => {
8484
console.log('websocket connection established: ', event);
@@ -95,7 +95,7 @@ websocket.addEventListener('message', (event) => {
9595

9696
The `receivedMessage` would be an object like so:
9797

98-
```js
98+
```js showLineNumbers
9999
{
100100
echo_req: {
101101
ping: 1
@@ -119,7 +119,7 @@ By default, `WebSocket connections` will be closed when no traffic is sent betwe
119119

120120
A simple setup example would be the following:
121121

122-
```js title="index.js"
122+
```js title="index.js" showLineNumbers
123123
const ping_interval = 12000; // it's in milliseconds, which equals to 120 seconds
124124
let interval;
125125
websocket.addEventListener('open', (event) => {
@@ -145,9 +145,9 @@ Now, when the connection is `established`, we start sending `ping` requests with
145145

146146
Your final code should be:
147147

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

docs/setting-up-a-deriv-application.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ keywords:
1414
description: How to setup Deriv application
1515
---
1616

17-
:::danger
18-
For the reviewer, Links in this section will be provided in the future.
19-
:::
20-
2117
#### Deriv account
2218

23-
If you don't have a Deriv account yet, you can easily create one by visiting our signup page or using the [new_account_virtual](/api-explorer#new_account_virtual) API call. It's completely free. And if you have an account already, please log in using your account details. To avoid any accidental loss of funds during testing, we recommend using your demo account instead of a real account.
19+
If you don't have a Deriv account yet, you can easily create one by visiting our signup page or using the <a href="/api-explorer#new_account_virtual" target="_blank" rel="noopener noreferrer">new_account_virtual</a> API call. It's completely free. And if you have an account already, please log in using your account details. To avoid any accidental loss of funds during testing, we recommend using your demo account instead of a real account.
2420

25-
To earn markup, get a Deriv real account to receive your monthly earnings. You can also create a real account using [new_account_real](/api-explorer#new_account_real) or [new_account_maltainvest](/api-explorer#new_account_maltainvest) API calls.
21+
To earn markup, get a Deriv real account to receive your monthly earnings. You can also create a real account using <a href="/api-explorer#new_account_real" target="_blank" rel="noopener noreferrer">new_account_real</a> or <a href="/api-explorer#new_account_maltainvest" target="_blank" rel="noopener noreferrer">new_account_maltainvest</a> API calls.
2622

2723
:::caution
2824
To create Deriv applications, you'll need an API token with the Admin scope for the account you wish to use for your application.
@@ -38,7 +34,7 @@ To create a new API token, follow these steps:
3834
2. Provide a name for your token
3935
3. Click **Create**
4036

41-
Alternatively, you can create an API token via the [api_token](/api-explorer#api_token) API call.
37+
Alternatively, you can create an API token via the <a href="/api-explorer#api_token" target="_blank" rel="noopener noreferrer">api_token</a> API call.
4238

4339
:::caution
4440
You need a token with the `Admin` scope to create an application.

docusaurus.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ const config = {
5757
theme: {
5858
customCss: [require.resolve('./src/styles/index.scss')],
5959
},
60+
googleTagManager: {
61+
containerId: 'GTM-NF7884S',
62+
},
6063
}),
6164
],
6265
],

0 commit comments

Comments
 (0)