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..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 | 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,38 +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, + "result": { + "base": "DOC", + "rel": "MARTY", + "base_amount": "2.4", + "base_amount_rat": [ [ - 1 + 1, + [ + 12 + ] + ], + [ + 1, + [ + 5 + ] ] ], - [ - 1, + "rel_amount": "2.64", + "rel_amount_rat": [ [ - 1 - ] - ] - ], - "price": [ - [ - 1, + 1, + [ + 66 + ] + ], [ - 1 + 1, + [ + 25 + ] ] ], - [ - 1, + "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 + ] + ], + [ + 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 151abaeb..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 | 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,38 +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, + "result": { + "base": "DOC", + "rel": "MARTY", + "base_amount": "2.4", + "base_amount_rat": [ [ - 1 + 1, + [ + 12 + ] + ], + [ + 1, + [ + 5 + ] ] ], - [ - 1, + "rel_amount": "2.64", + "rel_amount_rat": [ [ - 1 - ] - ] - ], - "price": [ - [ - 1, + 1, + [ + 66 + ] + ], [ - 1 + 1, + [ + 25 + ] ] ], - [ - 1, + "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 + ] + ], + [ + 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 99a5fa6f..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 | 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: | -| 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 | +| 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 | #### Response