Skip to content

Commit ce5f15e

Browse files
committed
migrates ban_pubkey to components
1 parent fa751c7 commit ce5f15e

File tree

7 files changed

+94
-48
lines changed

7 files changed

+94
-48
lines changed

filepathSlugs.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,10 +2562,7 @@
25622562
"arguments",
25632563
"response",
25642564
"examples",
2565-
"command",
2566-
"response-success",
2567-
"error-already-banned",
2568-
"error-invalid-pubkey"
2565+
"command"
25692566
],
25702567
"src/pages/komodo-defi-framework/api/legacy/batch_requests/index.mdx": [
25712568
"batch-requests",

src/data/kdf_methods_legacy.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,29 @@
4646
"legacy"
4747
]
4848
},
49+
"ban_pubkey": {
50+
"errors_table": "N/A",
51+
"examples": {
52+
"BanPubkey": "Ban a pubkey"
53+
},
54+
"prerequisites": [],
55+
"request_table": "BanPubkeyRequest",
56+
"requirements": {
57+
"environments": [
58+
"native",
59+
"wasm"
60+
],
61+
"wallet_types": [
62+
"hd",
63+
"iguana"
64+
]
65+
},
66+
"response_table": "BanPubkeyResponse",
67+
"sequence": 237,
68+
"tags": [
69+
"legacy"
70+
]
71+
},
4972
"coins_needed_for_kick_start": {
5073
"errors_table": "CoinsNeededForKickStartErrors",
5174
"examples": {

src/data/requests/kdf/legacy/utils.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
2+
"BanPubkey": {
3+
"duration_min": 15,
4+
"method": "ban_pubkey",
5+
"pubkey": "2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520420",
6+
"reason": "Being a naughty boy",
7+
"userpass": "RPC_UserP@SSW0RD"
8+
},
29
"CoinsNeededForKickStart": {
310
"method": "coins_needed_for_kick_start",
411
"userpass": "RPC_UserP@SSW0RD"

src/data/responses/kdf/legacy/utils.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,33 @@
2121
}
2222
]
2323
},
24+
"BanPubkey": {
25+
"error": [
26+
{
27+
"json": {
28+
"error": "rpc:208] dispatcher_legacy:160] pubkey_banning:58] Pubkey is banned already"
29+
},
30+
"notes": "",
31+
"title": "Error (already banned)"
32+
},
33+
{
34+
"json": {
35+
"error": "rpc:184] dispatcher_legacy:140] pubkey_banning:63] invalid value: string \\\"2102f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193eac\\\", expected a hash string"
36+
},
37+
"notes": "",
38+
"title": "Error (invalid pubkey)"
39+
}
40+
],
41+
"success": [
42+
{
43+
"json": {
44+
"result": "success"
45+
},
46+
"notes": "",
47+
"title": "Response (success)"
48+
}
49+
]
50+
},
2451
"LegacyGetEnabledCoins": {
2552
"error": [],
2653
"success": [

src/data/tables/legacy/utils.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
11
{
2+
"BanPubkeyRequest": {
3+
"data": [
4+
{
5+
"parameter": "pubkey",
6+
"type": "string",
7+
"required": true,
8+
"description": "The secp256k1 pubkey (without prefix) to ban"
9+
},
10+
{
11+
"parameter": "reason",
12+
"type": "string",
13+
"required": false,
14+
"description": "Optional. Human-readable reason for banning"
15+
},
16+
{
17+
"parameter": "duration_min",
18+
"type": "integer (minutes)",
19+
"required": false,
20+
"description": "Optional. Duration of the ban in minutes. If omitted, ban persists until the node restarts"
21+
}
22+
]
23+
},
24+
"BanPubkeyResponse": {
25+
"data": [
26+
{
27+
"parameter": "result",
28+
"type": "string",
29+
"required": true,
30+
"description": "Indicates whether the ban was successful"
31+
}
32+
]
33+
},
234
"NoParams": {
335
"data": [
436
{

src/pages/komodo-defi-framework/api/index.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Below is a table of the currently available legacy, v2.0 and v2.0 (Dev) methods:
2020
| | [add\_node\_to\_version\_stat](/komodo-defi-framework/api/v20/utils/add_node_to_version_stat/#add-node-to-version-stat) | |
2121
| [all\_swaps\_uuids\_by\_filter](/komodo-defi-framework/api/legacy/all_swaps_uuids_by_filter/#all-swaps-uuids-by-filter) | | |
2222
| | | [approve\_token](/komodo-defi-framework/api/v20-dev/approve_token/#approve-token) |
23-
| [ban\_pubkey](/komodo-defi-framework/api/legacy/ban_pubkey/#ban-pubkey) | | |
2423
| [best\_orders](/komodo-defi-framework/api/legacy/best_orders/#best-orders) | [best\_orders](/komodo-defi-framework/api/v20/swaps_and_orders/best_orders/#best-orders) | |
2524
| [buy](/komodo-defi-framework/api/legacy/buy/#buy) | | |
2625
| [cancel\_all\_orders](/komodo-defi-framework/api/legacy/cancel_all_orders/#cancel-all-orders) | | |

src/pages/komodo-defi-framework/api/legacy/ban_pubkey/index.mdx

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,18 @@ The `ban_pubkey` method bans the selected pubkey ignoring its order matching mes
1313

1414
## Arguments
1515

16-
| Structure | Type | Description |
17-
| ------------- | ------- | ---------------------------------------------------------------------------------------- |
18-
| pubkey | string | The pubkey to ban |
19-
| reason | string | Optional. The reason for banning |
20-
| duration\_min | integer | Optional. Minutes to apply the ban. If not set, ban will persist until kdf is restarted. |
16+
<CompactTable source="legacy/utils.BanPubkeyRequest" />
2117

2218
## Response
2319

24-
| Structure | Type | Description |
25-
| --------- | ------ | ------------------------------ |
26-
| result | string | whether the ban was successful |
20+
<CompactTable source="legacy/utils.BanPubkeyResponse" />
2721

2822
#### 📌 Examples
2923

3024
#### Command
3125

32-
<CodeGroup title="" tag="POST" label="ban_pubkey" mm2MethodDecorate="true">
33-
```json
34-
{
35-
"userpass": "RPC_UserP@SSW0RD",
36-
"method": "ban_pubkey",
37-
"pubkey": "2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520420",
38-
"reason": "Being a naughty boy",
39-
"duration_min": 15
40-
}
41-
```
42-
</CodeGroup>
26+
<CodeGroup title="" tag="POST" label="ban_pubkey" mm2MethodDecorate="true" source="legacy/utils.BanPubkey" />
4327

4428
<CollapsibleSection expandedText="Hide Response" collapsedText="Show Response">
45-
#### Response (success)
46-
47-
```json
48-
{
49-
"result": "success"
50-
}
51-
```
52-
53-
#### Error (already banned)
54-
55-
```json
56-
{
57-
"error": "rpc:208] dispatcher_legacy:160] pubkey_banning:58] Pubkey is banned already"
58-
}
59-
```
60-
61-
#### Error (invalid pubkey)
62-
63-
```json
64-
65-
{
66-
"error": "rpc:184] dispatcher_legacy:140] pubkey_banning:63] invalid value: string \"2102f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193eac\", expected a hash string"
67-
}
68-
```
29+
<KdfResponses responseKey="legacy/utils.BanPubkey" />
6930
</CollapsibleSection>

0 commit comments

Comments
 (0)