Skip to content

Commit

Permalink
Merge pull request #121 from KomodoPlatform/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
gcharang committed Sep 9, 2023
2 parents f47b132 + 448d2d3 commit d0af996
Show file tree
Hide file tree
Showing 99 changed files with 1,783 additions and 1,724 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/get_data_lint_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: node utils/js/get_file_author_data.js

- name: Validate and Update links
run: node utils/js/validate_update_internal_links.js
run: node utils/js/validate_update_internal_links_userpass.js

- name: Check presence of file and dirs
run: node utils/js/file_presence_structure_checker.js
Expand Down
14 changes: 7 additions & 7 deletions STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ And rendered as:

![Code group UI](src/images/style-guide-images/code-group-sample.png)

If you have a single block of code, you can use the `CodeGroup` without wrapping it around the block by using `mdx-annotations`.
<!-- If you have a single block of code, you can use the `CodeGroup` without wrapping it around the block by using `mdx-annotations`.
````mdx
```ts {{title: "Single Block", tag: "post", label: "/kmd/jwt/post"}}
Expand All @@ -131,9 +131,9 @@ If you have a single block of code, you can use the `CodeGroup` without wrapping
And you'll still have it rendered correctly:
![Single code block UI](src/images/style-guide-images/single-code-block.png)
![Single code block UI](src/images/style-guide-images/single-code-block.png) -->

It is important to **note that**, "**AtomicDEX methods**" should be wrapped with `CodeGroup` tags, using the **method name** as the **label value**, and the **tag value** set to **POST**. Use the `json {{ mm2MethodDecorate : true }}` decorator to generate code blocks for:
It is important to **note that**, "**AtomicDEX methods**" should be wrapped with `CodeGroup` tags, using the **method name** as the **label value**, and the **tag value** set to **POST**, an additional **mm2MethodDecorate property** with the value **"true"**. This will generate code blocks for:

- **JSON**: The pure request body.
- **Python3**: Using the requests library.
Expand All @@ -143,16 +143,16 @@ It is important to **note that**, "**AtomicDEX methods**" should be wrapped with
- **GO**: Using net/http. (need to confirm this is correct)
- **Ruby**: Using net/http.

You only need to include the `json` data, and the `mm2MethodDecorate` annotation populates for various languages automatically.
You only need to include the `json` data, and the additional **mm2MethodDecorate property** populates for various languages automatically.

A working code sample would look like this:

````mdx
<CodeGroup title="Generate Invoice" tag="POST" label="generate_invoice">
<CodeGroup title="Generate Invoice" tag="POST" label="generate_invoice" mm2MethodDecorate="true">

```json {{ mm2MethodDecorate : true }}
```json
{
"userpass": "userpass",
"userpass": "MM2_RPC_PASSWORD",
"mmrpc": "2.0",
"method": "lightning::payments::generate_invoice",
"params": {
Expand Down
8 changes: 4 additions & 4 deletions src/pages/atomicdex/api/legacy/active_swaps/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ The `active_swaps` method returns all the swaps that are currently running on th

#### Command (without include\_status)

<CodeGroup title="" tag="POST" label="active_swaps">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="active_swaps" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "active_swaps"
Expand All @@ -37,8 +37,8 @@ The `active_swaps` method returns all the swaps that are currently running on th

#### Command (include\_status = true)

<CodeGroup title="" tag="POST" label="active_swaps">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="active_swaps" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "active_swaps",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ The `all_swaps_uuids_by_filter` method returns all uuids of swaps that match the

#### Command (select swaps uuids that have my\_coin = DOC and other\_coin = MARTY)

<CodeGroup title="" tag="POST" label="all_swaps_uuids_by_filter">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="all_swaps_uuids_by_filter" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "all_swaps_uuids_by_filter",
Expand All @@ -45,8 +45,8 @@ The `all_swaps_uuids_by_filter` method returns all uuids of swaps that match the

#### Command (select swaps uuids that have my\_coin = DOC and started\_at >= 1611705600 (January 27, 2021 0:00:00 GMT))

<CodeGroup title="" tag="POST" label="all_swaps_uuids_by_filter">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="all_swaps_uuids_by_filter" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "all_swaps_uuids_by_filter",
Expand All @@ -58,8 +58,8 @@ The `all_swaps_uuids_by_filter` method returns all uuids of swaps that match the

#### Command (select swaps uuids that have started\_at >= 1611705600 (January 27, 2021 0:00:00 GMT) and started\_at \< 1611792001 (January 28, 2021 0:00:01 GMT))

<CodeGroup title="" tag="POST" label="all_swaps_uuids_by_filter">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="all_swaps_uuids_by_filter" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "all_swaps_uuids_by_filter",
Expand Down
4 changes: 2 additions & 2 deletions src/pages/atomicdex/api/legacy/ban_pubkey/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ The `ban_pubkey` method bans the selected pubkey ignoring its order matching mes

#### Command

<CodeGroup title="" tag="POST" label="ban_pubkey">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="ban_pubkey" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "ban_pubkey",
Expand Down
4 changes: 2 additions & 2 deletions src/pages/atomicdex/api/legacy/best_orders/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ where order entry has the following structure

#### Command

<CodeGroup title="" tag="POST" label="best_orders">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="best_orders" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "best_orders",
Expand Down
40 changes: 20 additions & 20 deletions src/pages/atomicdex/api/legacy/buy/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ The `buy` method issues a buy request and attempts to match an order from the or

#### Command (decimal representation)

<CodeGroup title="" tag="POST" label="buy">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="buy" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "buy",
Expand All @@ -77,8 +77,8 @@ The `buy` method issues a buy request and attempts to match an order from the or

#### Command (rational representation in num-rational crate format)

<CodeGroup title="" tag="POST" label="buy">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="buy" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "buy",
Expand Down Expand Up @@ -118,8 +118,8 @@ The `buy` method issues a buy request and attempts to match an order from the or

#### Command (rational representation as fraction object)

<CodeGroup title="" tag="POST" label="buy">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="buy" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "buy",
Expand All @@ -139,8 +139,8 @@ The `buy` method issues a buy request and attempts to match an order from the or

#### Command (with confirmations and notarization settings)

<CodeGroup title="" tag="POST" label="buy">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="buy" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "buy",
Expand All @@ -164,8 +164,8 @@ The `buy` method issues a buy request and attempts to match an order from the or

#### Command (set to not save order history)

<CodeGroup title="" tag="POST" label="buy">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="buy" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "buy",
Expand All @@ -186,8 +186,8 @@ The `buy` method issues a buy request and attempts to match an order from the or

#### Command (GoodTillCancelled type)

<CodeGroup title="" tag="POST" label="buy">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="buy" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "buy",
Expand Down Expand Up @@ -230,8 +230,8 @@ The `buy` method issues a buy request and attempts to match an order from the or

#### Command (FillOrKill type)

<CodeGroup title="" tag="POST" label="buy">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="buy" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "buy",
Expand Down Expand Up @@ -274,8 +274,8 @@ The `buy` method issues a buy request and attempts to match an order from the or

#### Command (match by Any)

<CodeGroup title="" tag="POST" label="buy">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="buy" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "buy",
Expand Down Expand Up @@ -318,8 +318,8 @@ The `buy` method issues a buy request and attempts to match an order from the or

#### Command (match by Pubkeys)

<CodeGroup title="" tag="POST" label="buy">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="buy" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "buy",
Expand Down Expand Up @@ -365,8 +365,8 @@ The `buy` method issues a buy request and attempts to match an order from the or

#### Command (match by Orders)

<CodeGroup title="" tag="POST" label="buy">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="buy" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "buy",
Expand Down
12 changes: 6 additions & 6 deletions src/pages/atomicdex/api/legacy/cancel_all_orders/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ The `cancel_all_orders` cancels the active orders created by the AtomicDEX API n

#### Command (All orders)

<CodeGroup title="" tag="POST" label="cancel_all_orders">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="cancel_all_orders" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "cancel_all_orders",
Expand All @@ -44,8 +44,8 @@ The `cancel_all_orders` cancels the active orders created by the AtomicDEX API n

#### Command (Cancel by pair)

<CodeGroup title="" tag="POST" label="cancel_all_orders">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="cancel_all_orders" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "cancel_all_orders",
Expand All @@ -62,8 +62,8 @@ The `cancel_all_orders` cancels the active orders created by the AtomicDEX API n

#### Command (Cancel by coin)

<CodeGroup title="" tag="POST" label="cancel_all_orders">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="cancel_all_orders" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "cancel_all_orders",
Expand Down
4 changes: 2 additions & 2 deletions src/pages/atomicdex/api/legacy/cancel_order/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ The `cancel_order` cancels the active order created by the AtomicDEX API node.

#### Command

<CodeGroup title="" tag="POST" label="cancel_order">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="cancel_order" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "cancel_order",
Expand Down
36 changes: 18 additions & 18 deletions src/pages/atomicdex/api/legacy/coin_activation/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ AtomicDEX is a true cross chain, cross protocol Decentralized Exchange (DEX), al

#### Command for UTXO based coins

<CodeGroup title="" tag="POST" label="electrum">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="electrum" mm2MethodDecorate="true">
```json
{
"coin": "LTC",
"method": "electrum",
Expand Down Expand Up @@ -138,8 +138,8 @@ AtomicDEX is a true cross chain, cross protocol Decentralized Exchange (DEX), al

#### Command for UTXO based coins with `required_confirmations`, `requires_notarization` and `mm2` arguments

<CodeGroup title="" tag="POST" label="electrum">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="electrum" mm2MethodDecorate="true">
```json
{
"coin": "KMD",
"method": "electrum",
Expand Down Expand Up @@ -181,8 +181,8 @@ AtomicDEX is a true cross chain, cross protocol Decentralized Exchange (DEX), al

#### Command (For QTUM/QRC20 tokens)

<CodeGroup title="" tag="POST" label="electrum">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="electrum" mm2MethodDecorate="true">
```json
{
"coin": "QTUM",
"method": "electrum",
Expand Down Expand Up @@ -265,8 +265,8 @@ AtomicDEX is a true cross chain, cross protocol Decentralized Exchange (DEX), al

#### Command (for native UTXO-based blockchains)

<CodeGroup title="" tag="POST" label="enable">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="enable" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "enable",
Expand Down Expand Up @@ -294,8 +294,8 @@ AtomicDEX is a true cross chain, cross protocol Decentralized Exchange (DEX), al

#### Command (With `required_confirmations`, `requires_notarization` and `mm2` arguments)

<CodeGroup title="" tag="POST" label="enable">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="enable" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "enable",
Expand Down Expand Up @@ -326,8 +326,8 @@ AtomicDEX is a true cross chain, cross protocol Decentralized Exchange (DEX), al

#### Command (for Ethereum and ERC20-based blockchains)

<CodeGroup title="" tag="POST" label="enable">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="enable" mm2MethodDecorate="true">
```json
{
"coin": "ETH",
"method": "enable",
Expand Down Expand Up @@ -361,8 +361,8 @@ AtomicDEX is a true cross chain, cross protocol Decentralized Exchange (DEX), al

#### Command (for Ethereum and ERC20-based blockchains with gas\_station\_url and policy)

<CodeGroup title="" tag="POST" label="enable">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="enable" mm2MethodDecorate="true">
```json
{
"coin": "ETH",
"userpass": "MM2_RPC_PASSWORD",
Expand Down Expand Up @@ -401,8 +401,8 @@ AtomicDEX is a true cross chain, cross protocol Decentralized Exchange (DEX), al

#### Command for Polygon (MATIC) and PLG20 tokens

<CodeGroup title="" tag="POST" label="enable">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="enable" mm2MethodDecorate="true">
```json
{
"coin": "NZDS-PLG20",
"method": "enable",
Expand Down Expand Up @@ -434,8 +434,8 @@ AtomicDEX is a true cross chain, cross protocol Decentralized Exchange (DEX), al

#### Command for Binance Coin (BNB) and BEP20 tokens

<CodeGroup title="" tag="POST" label="enable">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="enable" mm2MethodDecorate="true">
```json
{
"coin": "BUSD-BEP20",
"method": "enable",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ If the AtomicDEX API is stopped while making a swap/having the active order it w

#### Command

<CodeGroup title="" tag="POST" label="coins_needed_for_kick_start">
```json {{ mm2MethodDecorate : true }}
<CodeGroup title="" tag="POST" label="coins_needed_for_kick_start" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "coins_needed_for_kick_start"
Expand Down
Loading

0 comments on commit d0af996

Please sign in to comment.