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

Commit 6867f48

Browse files
committed
Merge branch 'master' into markupupdate
2 parents e4dabcf + 2e92de3 commit 6867f48

File tree

54 files changed

+839
-190
lines changed

Some content is hidden

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

54 files changed

+839
-190
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: Keep Alive code 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

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: Ticks History code 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: Ticks code example
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
@@ -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: 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)