Skip to content

Commit 549bdf7

Browse files
committed
update req/resp and param descriptions for buy/sell
1 parent 8b17b2a commit 549bdf7

File tree

3 files changed

+185
-105
lines changed

3 files changed

+185
-105
lines changed

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

+91-51
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ The `buy` method issues a buy request and attempts to match an order from the or
1414

1515
## Arguments
1616

17-
| Structure | Type | Description |
18-
| ----------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
19-
| base | string | The name of the coin the user desires to receive |
20-
| rel | string | The name of the coin the user desires to sell |
21-
| price | varies | The price in `rel` the user is willing to pay per one unit of the `base` coin. Can be a numeric string, expressed using standard [RationalValue](/komodo-defi-framework/api/common_structures/#rational-value) or [FractionalValue](/komodo-defi-framework/api/common_structures/#fractional-value) objects. |
22-
| volume | varies | The amount of coins the user is willing to receive of the `base` coin; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: <ul><li>the argument `volume`</li><li>the product of the arguments `volume` and `price`</li></ul>. . Can be a numeric string, expressed using standard [RationalValue](/komodo-defi-framework/api/common_structures/#rational-value) or [FractionalValue](/komodo-defi-framework/api/common_structures/#fractional-value) objects. |
23-
| min\_volume | varies (optional) | The amount of `base` coin that will be used as `min_volume` of `GoodTillCancelled` order after conversion to maker; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: <ul><li>the argument `min_volume`</li><li>the product of the arguments `min_volume` and `price`</li></ul>. . Can be a numeric string, expressed using standard [RationalValue](/komodo-defi-framework/api/common_structures/#rational-value) or [FractionalValue](/komodo-defi-framework/api/common_structures/#fractional-value) objects. |
24-
| match\_by | object | Optional. A standard [MatchBy](/komodo-defi-framework/api/common_structures/orders/#match-by) object, to filter to include only matches by pubkey or uuid. *Important:* This condition is not applied after a `GoodTillCancelled` order is converted to a `maker` request. |
25-
| order\_type | object | Optional. A standard [OrderType](/komodo-defi-framework/api/common_structures/orders/#order-type) object. |
26-
| base\_confs | number | Number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set |
27-
| base\_nota | boolean | Whether dPoW notarization is required for base coin atomic swap transaction; default to base coin configuration if not set |
28-
| rel\_confs | number | Number of required blockchain confirmations for rel coin atomic swap transaction; default to rel coin configuration if not set |
29-
| rel\_nota | boolean | Whether dPoW notarization is required for rel coin atomic swap transaction; default to rel coin configuration if not set |
30-
| save\_in\_history | boolean | Defaults to `true`. If set to `false` no order history will be saved (though order status will be temporarily stored while in progress). If `true`, each order's short record history is stored in a local SQLite database table, and when the order is cancelled or fully matched, it's history will be saved as a json file |
17+
| Structure | Type | Description |
18+
| ----------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
19+
| base | string | The name of the coin the user desires to receive |
20+
| rel | string | The name of the coin the user desires to sell |
21+
| price | various | The amount in `rel` the user wants per one unit of the `base` coin. Can be a numeric string, expressed using standard [RationalValue](/komodo-defi-framework/api/common_structures/#rational-value) or [FractionalValue](/komodo-defi-framework/api/common_structures/#fractional-value) objects. |
22+
| volume | various | The amount of coins the user is willing to receive of the `base` coin; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: <ul><li>the argument `volume`</li><li>the product of the arguments `volume` and `price`</li></ul>. . Can be a numeric string, expressed using standard [RationalValue](/komodo-defi-framework/api/common_structures/#rational-value) or [FractionalValue](/komodo-defi-framework/api/common_structures/#fractional-value) objects. |
23+
| min\_volume | various (optional)| The amount of `base` coin that will be used as `min_volume` of `GoodTillCancelled` order after conversion to maker; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: <ul><li>the argument `min_volume`</li><li>the product of the arguments `min_volume` and `price`</li></ul>. Can be a numeric string, expressed using standard [RationalValue](/komodo-defi-framework/api/common_structures/#rational-value) or [FractionalValue](/komodo-defi-framework/api/common_structures/#fractional-value) objects. |
24+
| match\_by | object | Optional. A standard [MatchBy](/komodo-defi-framework/api/common_structures/orders/#match-by) object, to filter to include only matches by pubkey or uuid. *Important:* This condition is not applied after a `GoodTillCancelled` order is converted to a `maker` request. |
25+
| order\_type | object | Optional. A standard [OrderType](/komodo-defi-framework/api/common_structures/orders/#order-type) object. |
26+
| base\_confs | number | Number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set |
27+
| base\_nota | boolean | Whether dPoW notarization is required for base coin atomic swap transaction; default to base coin configuration if not set |
28+
| rel\_confs | number | Number of required blockchain confirmations for rel coin atomic swap transaction; default to rel coin configuration if not set |
29+
| rel\_nota | boolean | Whether dPoW notarization is required for rel coin atomic swap transaction; default to rel coin configuration if not set |
30+
| save\_in\_history | boolean | Defaults to `true`. If set to `false` no order history will be saved (though order status will be temporarily stored while in progress). If `true`, each order's short record history is stored in a local SQLite database table, and when the order is cancelled or fully matched, it's history will be saved as a json file |
3131

3232
## Response
3333

@@ -58,10 +58,10 @@ The `buy` method issues a buy request and attempts to match an order from the or
5858
{
5959
"userpass": "RPC_UserP@SSW0RD",
6060
"method": "buy",
61-
"base": "HELLO",
62-
"rel": "WORLD",
63-
"volume": "1",
64-
"price": "1"
61+
"base": "DOC",
62+
"rel": "MARTY",
63+
"price": 1.1,
64+
"volume": 2.4
6565
}
6666
```
6767
</CodeGroup>
@@ -71,39 +71,79 @@ The `buy` method issues a buy request and attempts to match an order from the or
7171
<CodeGroup title="" tag="POST" label="buy" mm2MethodDecorate="true">
7272
```json
7373
{
74-
"userpass": "RPC_UserP@SSW0RD",
75-
"method": "buy",
76-
"base": "HELLO",
77-
"rel": "WORLD",
78-
"volume": [
79-
[
80-
1,
81-
[
82-
1
83-
]
84-
],
85-
[
86-
1,
87-
[
88-
1
89-
]
90-
]
91-
],
92-
"price": [
93-
[
94-
1,
95-
[
96-
1
97-
]
98-
],
99-
[
100-
1,
101-
[
102-
1
103-
]
104-
]
105-
]
106-
}
74+
"result": {
75+
"base": "DOC",
76+
"rel": "MARTY",
77+
"base_amount": "2.4",
78+
"base_amount_rat": [
79+
[
80+
1,
81+
[
82+
12
83+
]
84+
],
85+
[
86+
1,
87+
[
88+
5
89+
]
90+
]
91+
],
92+
"rel_amount": "2.64",
93+
"rel_amount_rat": [
94+
[
95+
1,
96+
[
97+
66
98+
]
99+
],
100+
[
101+
1,
102+
[
103+
25
104+
]
105+
]
106+
],
107+
"action": "Buy",
108+
"uuid": "3d2286d1-1eef-487b-a07a-904f33034792",
109+
"method": "request",
110+
"sender_pubkey": "d8064eece4fa5c0f8dc0267f68cee9bdd527f9e88f3594a323428718c391ecc2",
111+
"dest_pub_key": "0000000000000000000000000000000000000000000000000000000000000000",
112+
"match_by": {
113+
"type": "Any"
114+
},
115+
"conf_settings": {
116+
"base_confs": 1,
117+
"base_nota": false,
118+
"rel_confs": 1,
119+
"rel_nota": false
120+
},
121+
"order_type": {
122+
"type": "GoodTillCancelled"
123+
},
124+
"min_volume": "0.0001",
125+
"min_volume_fraction": {
126+
"numer": "1",
127+
"denom": "10000"
128+
},
129+
"min_volume_rat": [
130+
[
131+
1,
132+
[
133+
1
134+
]
135+
],
136+
[
137+
1,
138+
[
139+
10000
140+
]
141+
]
142+
],
143+
"base_orderbook_ticker": null,
144+
"rel_orderbook_ticker": null
145+
}
146+
}
107147
```
108148
</CodeGroup>
109149

0 commit comments

Comments
 (0)