disable_coin
disable_coin coin
The disable_coin method deactivates the previously enabled coin, and also cancels all active orders that use the selected coin. The method will return an error in the following cases:
- The coin is not enabled
- The coin is used by active swaps
- The coin is used by a currently matching order. In this case, other orders might still be cancelled
Arguments
| Structure | Type | Description |
|---|---|---|
| coin | string | the ticker of coin to disable |
Response
| Structure | Type | Description |
|---|---|---|
| coin | string | the ticker of deactivated coin |
| cancelled_orders | array of strings | uuids of cancelled orders |
| swaps | array of strings | uuids of active swaps that use the selected coin; present only in error cases |
| orders.matching | array of strings | uuids of matching orders that use the selected coin; present only in error cases |
| orders.cancelled | array of strings | uuids of orders that were successfully cancelled despite the error |
📌 Examples
Command
POST disable_coin
{
"userpass": "RPC_UserP@SSW0RD",
"method": "disable_coin",
"coin": "DOC"
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "disable_coin",
"coin": "DOC"
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "disable_coin",
"coin": "DOC"
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "disable_coin",
"coin": "DOC"
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"userpass": "RPC_UserP@SSW0RD",
"method": "disable_coin",
"coin": "DOC"
}
JSON;
$ch = curl_init("http://127.0.0.1:7783");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response; package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{"userpass":"RPC_UserP@SSW0RD","method":"disable_coin","coin":"DOC"}`)
resp, err := http.Post("http://127.0.0.1:7783", "application/json", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
} require 'net/http'
require 'json'
require 'uri'
uri = URI("http://127.0.0.1:7783")
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "disable_coin",
"coin": "DOC"
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response (success)
{
"result": {
"cancelled_orders": ["e5fc7c81-7574-4d3f-b64a-47227455d62a"],
"coin": "DOC"
}
}Response (error - coin is not enabled)
{
"error": "No such coin: DOC"
}Response (error - active swap is using the coin)
{
"error": "There're active swaps using DOC",
"swaps": ["d88d0a0e-f8bd-40ab-8edd-fe20801ef349"]
}Response (error - the order is matched at the moment, but another order is cancelled)
{
"error": "There're currently matching orders using DOC",
"orders": {
"matching": ["d88d0a0e-f8bd-40ab-8edd-fe20801ef349"],
"cancelled": ["c88d0a0e-f8bd-40ab-8edd-fe20801ef349"]
}
}