From 549bdf7952e5b40aa0a17a826e5b88ba3f0b2144 Mon Sep 17 00:00:00 2001 From: smk762 Date: Mon, 10 Mar 2025 16:38:53 +0800 Subject: [PATCH 1/2] update req/resp and param descriptions for buy/sell --- .../api/legacy/buy/index.mdx | 142 +++++++++++------- .../api/legacy/sell/index.mdx | 142 +++++++++++------- .../api/legacy/setprice/index.mdx | 6 +- 3 files changed, 185 insertions(+), 105 deletions(-) diff --git a/src/pages/komodo-defi-framework/api/legacy/buy/index.mdx b/src/pages/komodo-defi-framework/api/legacy/buy/index.mdx index 6cf4ecd2..c2169fbd 100644 --- a/src/pages/komodo-defi-framework/api/legacy/buy/index.mdx +++ b/src/pages/komodo-defi-framework/api/legacy/buy/index.mdx @@ -14,20 +14,20 @@ The `buy` method issues a buy request and attempts to match an order from the or ## Arguments -| Structure | Type | Description | -| ----------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| base | string | The name of the coin the user desires to receive | -| rel | string | The name of the coin the user desires to sell | -| 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. | -| 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: . . 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. | -| 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: . . 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. | -| 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. | -| order\_type | object | Optional. A standard [OrderType](/komodo-defi-framework/api/common_structures/orders/#order-type) object. | -| base\_confs | number | Number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set | -| base\_nota | boolean | Whether dPoW notarization is required for base coin atomic swap transaction; default to base coin configuration if not set | -| rel\_confs | number | Number of required blockchain confirmations for rel coin atomic swap transaction; default to rel coin configuration if not set | -| rel\_nota | boolean | Whether dPoW notarization is required for rel coin atomic swap transaction; default to rel coin configuration if not set | -| 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 | +| Structure | Type | Description | +| ----------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| base | string | The name of the coin the user desires to receive | +| rel | string | The name of the coin the user desires to sell | +| 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. | +| 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: . . 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. | +| 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: . 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. | +| 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. | +| order\_type | object | Optional. A standard [OrderType](/komodo-defi-framework/api/common_structures/orders/#order-type) object. | +| base\_confs | number | Number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set | +| base\_nota | boolean | Whether dPoW notarization is required for base coin atomic swap transaction; default to base coin configuration if not set | +| rel\_confs | number | Number of required blockchain confirmations for rel coin atomic swap transaction; default to rel coin configuration if not set | +| rel\_nota | boolean | Whether dPoW notarization is required for rel coin atomic swap transaction; default to rel coin configuration if not set | +| 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 | ## Response @@ -58,10 +58,10 @@ The `buy` method issues a buy request and attempts to match an order from the or { "userpass": "RPC_UserP@SSW0RD", "method": "buy", - "base": "HELLO", - "rel": "WORLD", - "volume": "1", - "price": "1" + "base": "DOC", + "rel": "MARTY", + "price": 1.1, + "volume": 2.4 } ``` @@ -71,39 +71,79 @@ The `buy` method issues a buy request and attempts to match an order from the or ```json { - "userpass": "RPC_UserP@SSW0RD", - "method": "buy", - "base": "HELLO", - "rel": "WORLD", - "volume": [ - [ - 1, - [ - 1 - ] - ], - [ - 1, - [ - 1 - ] - ] - ], - "price": [ - [ - 1, - [ - 1 - ] - ], - [ - 1, - [ - 1 - ] - ] - ] - } + "result": { + "base": "DOC", + "rel": "MARTY", + "base_amount": "2.4", + "base_amount_rat": [ + [ + 1, + [ + 12 + ] + ], + [ + 1, + [ + 5 + ] + ] + ], + "rel_amount": "2.64", + "rel_amount_rat": [ + [ + 1, + [ + 66 + ] + ], + [ + 1, + [ + 25 + ] + ] + ], + "action": "Buy", + "uuid": "3d2286d1-1eef-487b-a07a-904f33034792", + "method": "request", + "sender_pubkey": "d8064eece4fa5c0f8dc0267f68cee9bdd527f9e88f3594a323428718c391ecc2", + "dest_pub_key": "0000000000000000000000000000000000000000000000000000000000000000", + "match_by": { + "type": "Any" + }, + "conf_settings": { + "base_confs": 1, + "base_nota": false, + "rel_confs": 1, + "rel_nota": false + }, + "order_type": { + "type": "GoodTillCancelled" + }, + "min_volume": "0.0001", + "min_volume_fraction": { + "numer": "1", + "denom": "10000" + }, + "min_volume_rat": [ + [ + 1, + [ + 1 + ] + ], + [ + 1, + [ + 10000 + ] + ] + ], + "base_orderbook_ticker": null, + "rel_orderbook_ticker": null + } +} ``` diff --git a/src/pages/komodo-defi-framework/api/legacy/sell/index.mdx b/src/pages/komodo-defi-framework/api/legacy/sell/index.mdx index 151abaeb..66615a8c 100644 --- a/src/pages/komodo-defi-framework/api/legacy/sell/index.mdx +++ b/src/pages/komodo-defi-framework/api/legacy/sell/index.mdx @@ -14,20 +14,20 @@ The `sell` method issues a sell request and attempts to match an order from the ## Arguments -| Structure | Type | Description | -| ----------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| base | string | the name of the coin the user desires to sell | -| rel | string | the name of the coin the user desires to receive | -| 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. | -| 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: . . 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. | -| 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: . . 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. | -| 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. | -| order\_type | object | Optional. A standard [OrderType](/komodo-defi-framework/api/common_structures/orders/#order-type) object. | -| base\_confs | number | number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set | -| base\_nota | bool | whether dPoW notarization is required for base coin atomic swap transaction; default to base coin configuration if not set | -| rel\_confs | number | number of required blockchain confirmations for rel coin atomic swap transaction; default to rel coin configuration if not set | -| rel\_nota | bool | whether dPoW notarization is required for rel coin atomic swap transaction; default to rel coin configuration if not set | -| 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 | +| Structure | Type | Description | +| ----------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| base | string | the name of the coin the user desires to sell | +| rel | string | the name of the coin the user desires to receive | +| price | numeric string or rational | the amount in `rel` the user wants per one unit of the `base` coin | +| volume | numeric string or rational | the maximum amount of `base` coin available for the order, ignored if max is `true`; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: | +| min\_volume | numeric string or rational (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: . 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. | +| 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. | +| order\_type | object | Optional. A standard [OrderType](/komodo-defi-framework/api/common_structures/orders/#order-type) object. | +| base\_confs | number | number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set | +| base\_nota | bool | whether dPoW notarization is required for base coin atomic swap transaction; default to base coin configuration if not set | +| rel\_confs | number | number of required blockchain confirmations for rel coin atomic swap transaction; default to rel coin configuration if not set | +| rel\_nota | bool | whether dPoW notarization is required for rel coin atomic swap transaction; default to rel coin configuration if not set | +| 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 | ## Response @@ -58,10 +58,10 @@ The `sell` method issues a sell request and attempts to match an order from the { "userpass": "RPC_UserP@SSW0RD", "method": "sell", - "base": "BASE", - "rel": "REL", - "volume": "1", - "price": "1" + "base": "DOC", + "rel": "MARTY", + "price": 1.1, + "volume": 2.4 } ``` @@ -71,39 +71,79 @@ The `sell` method issues a sell request and attempts to match an order from the ```json { - "userpass": "RPC_UserP@SSW0RD", - "method": "sell", - "base": "BASE", - "rel": "REL", - "volume": [ - [ - 1, - [ - 1 - ] - ], - [ - 1, - [ - 1 - ] - ] - ], - "price": [ - [ - 1, - [ - 1 - ] - ], - [ - 1, - [ - 1 - ] - ] - ] - } + "result": { + "base": "DOC", + "rel": "MARTY", + "base_amount": "2.4", + "base_amount_rat": [ + [ + 1, + [ + 12 + ] + ], + [ + 1, + [ + 5 + ] + ] + ], + "rel_amount": "2.64", + "rel_amount_rat": [ + [ + 1, + [ + 66 + ] + ], + [ + 1, + [ + 25 + ] + ] + ], + "action": "Sell", + "uuid": "c6fccc24-8ad9-4de3-baad-122ba0f831d2", + "method": "request", + "sender_pubkey": "d8064eece4fa5c0f8dc0267f68cee9bdd527f9e88f3594a323428718c391ecc2", + "dest_pub_key": "0000000000000000000000000000000000000000000000000000000000000000", + "match_by": { + "type": "Any" + }, + "conf_settings": { + "base_confs": 1, + "base_nota": false, + "rel_confs": 1, + "rel_nota": false + }, + "order_type": { + "type": "GoodTillCancelled" + }, + "min_volume": "0.0001", + "min_volume_fraction": { + "numer": "1", + "denom": "10000" + }, + "min_volume_rat": [ + [ + 1, + [ + 1 + ] + ], + [ + 1, + [ + 10000 + ] + ] + ], + "base_orderbook_ticker": null, + "rel_orderbook_ticker": null + } +} ``` diff --git a/src/pages/komodo-defi-framework/api/legacy/setprice/index.mdx b/src/pages/komodo-defi-framework/api/legacy/setprice/index.mdx index 99a5fa6f..861a6f78 100644 --- a/src/pages/komodo-defi-framework/api/legacy/setprice/index.mdx +++ b/src/pages/komodo-defi-framework/api/legacy/setprice/index.mdx @@ -19,9 +19,9 @@ The `setprice` order is always considered a `sell`, for internal implementation | ----------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | base | string | the name of the coin the user desires to sell | | rel | string | the name of the coin the user desires to receive | -| price | numeric string or rational | the price in `rel` the user is willing to receive per one unit of the `base` coin | -| volume | numeric string or rational | the maximum amount of `base` coin available for the order, ignored if max is `true`; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: | -| min\_volume | numeric string or rational | the minimum amount of `base` coin available for the order; it must be less or equal than `volume` param; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: | +| price | various | the amount of `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. | +| volume | various | the maximum amount of `base` coin available for the order, ignored if max is `true`; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: | +| min\_volume | various | the minimum amount of `base` coin available for the order; it must be less or equal than `volume` param; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: | | max | bool | Komodo DeFi Framework API will use the entire coin balance for the order, taking `0.001` coins into reserve to account for fees | | cancel\_previous | bool | Komodo DeFi Framework API will cancel all existing orders for the selected pair by default; set this value to `false` to prevent this behavior | | base\_confs | number | number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set | From c6a7ea49fadeabec3b68fc157e01f3190c8f98fd Mon Sep 17 00:00:00 2001 From: smk762 Date: Tue, 11 Mar 2025 16:07:50 +0800 Subject: [PATCH 2/2] linting and description fix --- .../api/legacy/buy/index.mdx | 167 +++++++++--------- .../api/legacy/sell/index.mdx | 165 ++++++++--------- .../api/legacy/setprice/index.mdx | 24 +-- 3 files changed, 179 insertions(+), 177 deletions(-) diff --git a/src/pages/komodo-defi-framework/api/legacy/buy/index.mdx b/src/pages/komodo-defi-framework/api/legacy/buy/index.mdx index c2169fbd..200d7a02 100644 --- a/src/pages/komodo-defi-framework/api/legacy/buy/index.mdx +++ b/src/pages/komodo-defi-framework/api/legacy/buy/index.mdx @@ -14,20 +14,20 @@ The `buy` method issues a buy request and attempts to match an order from the or ## Arguments -| Structure | Type | Description | -| ----------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| base | string | The name of the coin the user desires to receive | -| rel | string | The name of the coin the user desires to sell | -| 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. | -| 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: . . 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. | -| 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: . 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. | -| 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. | -| order\_type | object | Optional. A standard [OrderType](/komodo-defi-framework/api/common_structures/orders/#order-type) object. | -| base\_confs | number | Number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set | -| base\_nota | boolean | Whether dPoW notarization is required for base coin atomic swap transaction; default to base coin configuration if not set | -| rel\_confs | number | Number of required blockchain confirmations for rel coin atomic swap transaction; default to rel coin configuration if not set | -| rel\_nota | boolean | Whether dPoW notarization is required for rel coin atomic swap transaction; default to rel coin configuration if not set | -| 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 | +| Structure | Type | Description | +| ----------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| base | string | The name of the coin the user desires to receive | +| rel | string | The name of the coin the user desires to sell | +| 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. | +| 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: . . 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. | +| 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: . 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. | +| 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. | +| order\_type | object | Optional. A standard [OrderType](/komodo-defi-framework/api/common_structures/orders/#order-type) object. | +| base\_confs | number | Number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set | +| base\_nota | boolean | Whether dPoW notarization is required for base coin atomic swap transaction; default to base coin configuration if not set | +| rel\_confs | number | Number of required blockchain confirmations for rel coin atomic swap transaction; default to rel coin configuration if not set | +| rel\_nota | boolean | Whether dPoW notarization is required for rel coin atomic swap transaction; default to rel coin configuration if not set | +| 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 | ## Response @@ -72,78 +72,79 @@ The `buy` method issues a buy request and attempts to match an order from the or ```json { "result": { - "base": "DOC", - "rel": "MARTY", - "base_amount": "2.4", - "base_amount_rat": [ - [ - 1, - [ - 12 - ] - ], - [ - 1, - [ - 5 - ] - ] + "base": "DOC", + "rel": "MARTY", + "base_amount": "2.4", + "base_amount_rat": [ + [ + 1, + [ + 12 + ] ], - "rel_amount": "2.64", - "rel_amount_rat": [ - [ - 1, - [ - 66 - ] - ], - [ - 1, - [ - 25 - ] - ] + [ + 1, + [ + 5 + ] + ] + ], + "rel_amount": "2.64", + "rel_amount_rat": [ + [ + 1, + [ + 66 + ] ], - "action": "Buy", - "uuid": "3d2286d1-1eef-487b-a07a-904f33034792", - "method": "request", - "sender_pubkey": "d8064eece4fa5c0f8dc0267f68cee9bdd527f9e88f3594a323428718c391ecc2", - "dest_pub_key": "0000000000000000000000000000000000000000000000000000000000000000", - "match_by": { - "type": "Any" - }, - "conf_settings": { - "base_confs": 1, - "base_nota": false, - "rel_confs": 1, - "rel_nota": false - }, - "order_type": { - "type": "GoodTillCancelled" - }, - "min_volume": "0.0001", - "min_volume_fraction": { - "numer": "1", - "denom": "10000" - }, - "min_volume_rat": [ - [ - 1, - [ - 1 - ] - ], - [ - 1, - [ - 10000 - ] - ] + [ + 1, + [ + 25 + ] + ] + ], + "action": "Buy", + "uuid": "3d2286d1-1eef-487b-a07a-904f33034792", + "method": "request", + "sender_pubkey": "d8064eece4fa5c0f8dc0267f68cee9bdd527f9e88f3594a323428718c391ecc2", + "dest_pub_key": "0000000000000000000000000000000000000000000000000000000000000000", + "match_by": { + "type": "Any" + }, + "conf_settings": { + "base_confs": 1, + "base_nota": false, + "rel_confs": 1, + "rel_nota": false + }, + "order_type": { + "type": "GoodTillCancelled" + }, + "min_volume": "0.0001", + "min_volume_fraction": { + "numer": "1", + "denom": "10000" + }, + "min_volume_rat": [ + [ + 1, + [ + 1 + ] ], - "base_orderbook_ticker": null, - "rel_orderbook_ticker": null - } -} + [ + 1, + [ + 10000 + ] + ] + ], + "base_orderbook_ticker": null, + "rel_orderbook_ticker": null + }, + "userpass": "RPC_UserP@SSW0RD" + } ``` diff --git a/src/pages/komodo-defi-framework/api/legacy/sell/index.mdx b/src/pages/komodo-defi-framework/api/legacy/sell/index.mdx index 66615a8c..f7f51cba 100644 --- a/src/pages/komodo-defi-framework/api/legacy/sell/index.mdx +++ b/src/pages/komodo-defi-framework/api/legacy/sell/index.mdx @@ -14,20 +14,20 @@ The `sell` method issues a sell request and attempts to match an order from the ## Arguments -| Structure | Type | Description | -| ----------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| base | string | the name of the coin the user desires to sell | -| rel | string | the name of the coin the user desires to receive | -| price | numeric string or rational | the amount in `rel` the user wants per one unit of the `base` coin | -| volume | numeric string or rational | the maximum amount of `base` coin available for the order, ignored if max is `true`; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: | +| Structure | Type | Description | +| ----------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| base | string | the name of the coin the user desires to sell | +| rel | string | the name of the coin the user desires to receive | +| price | numeric string or rational | the amount in `rel` the user wants per one unit of the `base` coin | +| volume | numeric string or rational | the maximum amount of `base` coin available for the order, ignored if max is `true`; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: | | min\_volume | numeric string or rational (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: . 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. | -| 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. | -| order\_type | object | Optional. A standard [OrderType](/komodo-defi-framework/api/common_structures/orders/#order-type) object. | -| base\_confs | number | number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set | -| base\_nota | bool | whether dPoW notarization is required for base coin atomic swap transaction; default to base coin configuration if not set | -| rel\_confs | number | number of required blockchain confirmations for rel coin atomic swap transaction; default to rel coin configuration if not set | -| rel\_nota | bool | whether dPoW notarization is required for rel coin atomic swap transaction; default to rel coin configuration if not set | -| 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 | +| 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. | +| order\_type | object | Optional. A standard [OrderType](/komodo-defi-framework/api/common_structures/orders/#order-type) object. | +| base\_confs | number | number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set | +| base\_nota | bool | whether dPoW notarization is required for base coin atomic swap transaction; default to base coin configuration if not set | +| rel\_confs | number | number of required blockchain confirmations for rel coin atomic swap transaction; default to rel coin configuration if not set | +| rel\_nota | bool | whether dPoW notarization is required for rel coin atomic swap transaction; default to rel coin configuration if not set | +| 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 | ## Response @@ -72,78 +72,79 @@ The `sell` method issues a sell request and attempts to match an order from the ```json { "result": { - "base": "DOC", - "rel": "MARTY", - "base_amount": "2.4", - "base_amount_rat": [ - [ - 1, - [ - 12 - ] - ], - [ - 1, - [ - 5 - ] - ] + "base": "DOC", + "rel": "MARTY", + "base_amount": "2.4", + "base_amount_rat": [ + [ + 1, + [ + 12 + ] ], - "rel_amount": "2.64", - "rel_amount_rat": [ - [ - 1, - [ - 66 - ] - ], - [ - 1, - [ - 25 - ] - ] + [ + 1, + [ + 5 + ] + ] + ], + "rel_amount": "2.64", + "rel_amount_rat": [ + [ + 1, + [ + 66 + ] ], - "action": "Sell", - "uuid": "c6fccc24-8ad9-4de3-baad-122ba0f831d2", - "method": "request", - "sender_pubkey": "d8064eece4fa5c0f8dc0267f68cee9bdd527f9e88f3594a323428718c391ecc2", - "dest_pub_key": "0000000000000000000000000000000000000000000000000000000000000000", - "match_by": { - "type": "Any" - }, - "conf_settings": { - "base_confs": 1, - "base_nota": false, - "rel_confs": 1, - "rel_nota": false - }, - "order_type": { - "type": "GoodTillCancelled" - }, - "min_volume": "0.0001", - "min_volume_fraction": { - "numer": "1", - "denom": "10000" - }, - "min_volume_rat": [ - [ - 1, - [ - 1 - ] - ], - [ - 1, - [ - 10000 - ] - ] + [ + 1, + [ + 25 + ] + ] + ], + "action": "Sell", + "uuid": "c6fccc24-8ad9-4de3-baad-122ba0f831d2", + "method": "request", + "sender_pubkey": "d8064eece4fa5c0f8dc0267f68cee9bdd527f9e88f3594a323428718c391ecc2", + "dest_pub_key": "0000000000000000000000000000000000000000000000000000000000000000", + "match_by": { + "type": "Any" + }, + "conf_settings": { + "base_confs": 1, + "base_nota": false, + "rel_confs": 1, + "rel_nota": false + }, + "order_type": { + "type": "GoodTillCancelled" + }, + "min_volume": "0.0001", + "min_volume_fraction": { + "numer": "1", + "denom": "10000" + }, + "min_volume_rat": [ + [ + 1, + [ + 1 + ] ], - "base_orderbook_ticker": null, - "rel_orderbook_ticker": null - } -} + [ + 1, + [ + 10000 + ] + ] + ], + "base_orderbook_ticker": null, + "rel_orderbook_ticker": null + }, + "userpass": "RPC_UserP@SSW0RD" + } ``` diff --git a/src/pages/komodo-defi-framework/api/legacy/setprice/index.mdx b/src/pages/komodo-defi-framework/api/legacy/setprice/index.mdx index 861a6f78..8fb17ebd 100644 --- a/src/pages/komodo-defi-framework/api/legacy/setprice/index.mdx +++ b/src/pages/komodo-defi-framework/api/legacy/setprice/index.mdx @@ -15,20 +15,20 @@ The `setprice` order is always considered a `sell`, for internal implementation ## Arguments -| Structure | Type | Description | -| ----------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| base | string | the name of the coin the user desires to sell | -| rel | string | the name of the coin the user desires to receive | -| price | various | the amount of `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. | +| Structure | Type | Description | +| ----------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| base | string | the name of the coin the user desires to sell | +| rel | string | the name of the coin the user desires to receive | +| price | various | the amount of `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. | | volume | various | the maximum amount of `base` coin available for the order, ignored if max is `true`; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: | | min\_volume | various | the minimum amount of `base` coin available for the order; it must be less or equal than `volume` param; the following values must be greater than or equal to the `min_trading_vol` of the corresponding coin: | -| max | bool | Komodo DeFi Framework API will use the entire coin balance for the order, taking `0.001` coins into reserve to account for fees | -| cancel\_previous | bool | Komodo DeFi Framework API will cancel all existing orders for the selected pair by default; set this value to `false` to prevent this behavior | -| base\_confs | number | number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set | -| base\_nota | bool | whether dPoW notarization is required for base coin atomic swap transaction; default to base coin configuration if not set | -| rel\_confs | number | number of required blockchain confirmations for rel coin atomic swap transaction; default to rel coin configuration if not set | -| rel\_nota | bool | whether dPoW notarization is required for rel coin atomic swap transaction; default to rel coin configuration if not set | -| 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 | +| max | bool | Komodo DeFi Framework API will use the entire coin balance for the order, taking `0.001` coins into reserve to account for fees | +| cancel\_previous | bool | Komodo DeFi Framework API will cancel all existing orders for the selected pair by default; set this value to `false` to prevent this behavior | +| base\_confs | number | number of required blockchain confirmations for base coin atomic swap transaction; default to base coin configuration if not set | +| base\_nota | bool | whether dPoW notarization is required for base coin atomic swap transaction; default to base coin configuration if not set | +| rel\_confs | number | number of required blockchain confirmations for rel coin atomic swap transaction; default to rel coin configuration if not set | +| rel\_nota | bool | whether dPoW notarization is required for rel coin atomic swap transaction; default to rel coin configuration if not set | +| 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 | #### Response