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

Commit 63ce35f

Browse files
committed
Merge branch 'master' into SEO
2 parents f765d13 + 2e92de3 commit 63ce35f

File tree

73 files changed

+1679
-357
lines changed

Some content is hidden

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

73 files changed

+1679
-357
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ docusaurus.config.js
33
jest.config.js
44
commitlint.config.js
55
babel.config.js
6-
examples
6+
examples
7+
src/theme

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/code-examples/javascript/keep-alive/index.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ keywords:
1616
description: With this API example, learn how to keep a connection alive when getting contract proposals via the Deriv API.
1717
---
1818

19+
import RenderOfficialContents from '@site/src/components/RenderOfficialContents';
1920
import SandboxIframe from '@site/src/components/SandboxIframe';
2021
import { sandboxes } from '@site/src/components/SandboxIframe/utility/sandboxes';
2122

22-
In this example you'll see how to keep a connection alive when getting contract proposals via the Deriv API. This example keeps the connection alive by sending a ping every 30 seconds.
23+
<RenderOfficialContents>
24+
<p>In this example you'll see how to keep a connection alive when getting contract proposals via the Deriv API. This example keeps the connection alive by sending a ping every 30 seconds.</p>
25+
</RenderOfficialContents>
2326

2427
<SandboxIframe sandbox={sandboxes.keep_alive} />

docs/code-examples/javascript/ticks-history/index.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ keywords:
1616
description: Subscribe to Deriv API's ticks history feature to get past tick times and prices. Integrate this feature into your trading app with this API example.
1717
---
1818

19+
import RenderOfficialContents from '@site/src/components/RenderOfficialContents';
1920
import SandboxIframe from '@site/src/components/SandboxIframe';
2021
import { sandboxes } from '@site/src/components/SandboxIframe/utility/sandboxes';
2122

2223
With ticks history you are able to get a collection of past tick times and prices.
2324

2425
<SandboxIframe sandbox={sandboxes.ticks_history} />
2526

26-
We subscribe to the ticks functionality from the Deriv API websocket to keep track of current and past ticks.
27+
<RenderOfficialContents>
28+
<p>We subscribe to the ticks functionality from the Deriv API websocket to keep track of current and past ticks.</p>
29+
</RenderOfficialContents>
2730

2831
As an example you could create an interactive tick graph.

docs/code-examples/javascript/ticks/index.mdx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,20 @@ keywords:
1414
description: Check out an API example of a tick call connected to an API WebSocket. Start building your trading app today!
1515
---
1616

17+
import RenderOfficialContents from '@site/src/components/RenderOfficialContents';
1718
import SandboxIframe from '@site/src/components/SandboxIframe';
1819
import { sandboxes } from '@site/src/components/SandboxIframe/utility/sandboxes';
1920

20-
The easiest way to understand how Deriv API works is to try our Tick call:
21+
<RenderOfficialContents>
22+
<p>The easiest way to understand how Deriv API works is to try our Tick call:</p>
23+
</RenderOfficialContents>
2124

2225
<SandboxIframe sandbox={sandboxes.ticks} />
2326

24-
We'll start with the ticks example because it's a pretty simple block of code to implement. You don't have to log into the Deriv account and get your app authenticated to try it.
27+
<RenderOfficialContents>
28+
<p>We'll start with the ticks example because it's a pretty simple block of code to implement. You don't have to log into the Deriv account and get your app authenticated to try it.</p>
29+
</RenderOfficialContents>
2530

26-
A tick is a measure of minimum upward or downward movement in the price of a trading commodity. We subscribe to the ticks functionality from the Deriv API websocket, which will return new tick data every second. As an example you could create an interactive tick graph with this data.
31+
<RenderOfficialContents>
32+
<p>A tick is a measure of minimum upward or downward movement in the price of a trading commodity. We subscribe to the ticks functionality from the Deriv API websocket, which will return new tick data every second. As an example you could create an interactive tick graph with this data.</p>
33+
</RenderOfficialContents>

docs/core-concepts/_category_.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"className": "hide-sidebar-item",
23
"label": "Core concepts",
34
"position": 2,
45
"link": {

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

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

2424
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.
2525

26-
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.
26+
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.
2727

28-
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.
28+
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.
2929

3030
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.
3131

@@ -40,7 +40,7 @@ If you call the API with the `send` functionality, then the server will only sen
4040
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`.
4141

4242
:::caution
43-
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.
43+
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.
4444
:::
4545

4646
## Request data
@@ -63,15 +63,15 @@ A `Residence List` call returns a list of countries and 2-letter country codes,
6363

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

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

74-
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).
74+
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).
7575

7676
### Optional fields
7777

@@ -86,7 +86,7 @@ Whatever you pass to this field will be returned back to you inside a `response`
8686
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`.
8787

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

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

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

98-
```js
98+
```js showLineNumbers
9999
{
100100
echo_req: {
101101
req_id: 1,
@@ -162,7 +162,7 @@ The response for the `Residence List` call:
162162
};
163163
```
164164

165-
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).
165+
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).
166166

167167
#### The `echo_req` field
168168

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

173173
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:
174174

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

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ 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.
5252
const socket = new WebSocket(`wss://ws.binaryws.com/websockets/v3?app_id=${app_id}`);
5353

0 commit comments

Comments
 (0)