sell
sell base rel price volume (match_by order_type base_confs base_nota rel_confs rel_nota)
The sell method issues a sell request and attempts to match an order from the orderbook based on the provided arguments.
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 of rel coins the user wants to receive for each unit of the base coin spent. |
| volume | numeric string or rational | the maximum amount of base coin available for sale in 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:
|
| match_by | object | Optional. A standard MatchBy 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 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
| Structure | Type | Description |
|---|---|---|
| action | string | the action of the request (Sell) |
| base | string | the base currency of the request |
| base_amount | numeric string | the resulting amount of base currency that is sold if the order matches, represented as a decimal value. |
| base_amount_rat | rational | the resulting amount of base currency that is sold if the order matches, represented as a standard RationalValue object. |
| rel | string | the rel currency of the request |
| rel_amount | string | the minimum amount of rel coin that must be received in order to sell the base_amount of base (according to price, in decimal representation) |
| rel_amount_rat | rational | the minimum amount of rel coin that must be received in order to sell the base_amount of base (according to price, represented as a standard RationalValue object). |
| method | string | this field is used for internal P2P interactions; the value is always equal to “request |
| dest_pub_key | string | reserved for future use. The dest_pub_key allows the user to choose the P2P node that is eligible to match with the request. This value defaults to “zero pubkey”, meaning that anyone can match |
| sender_pubkey | string | the public key of our node |
| uuid | string | the request uuid |
| match_by | object | A standard MatchBy 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. |
| conf_settings | object | A standard ConfSettings object. |
| base_orderbook_ticker | string | the ticker of the base currency if orderbook_ticker is configured for the base currency in coins file. If not defined, will return a null value. |
| rel_orderbook_ticker | string | the ticker of the rel currency if orderbook_ticker is configured for the rel currency in coins file. If not defined, will return a null value. |
📌 Examples
Command (decimal representation)
POST sell
{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "DOC",
"rel": "MARTY",
"price": 1.1,
"volume": 2.4
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "DOC",
"rel": "MARTY",
"price": 1.1,
"volume": 2.4
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "DOC",
"rel": "MARTY",
"price": 1.1,
"volume": 2.4
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "DOC",
"rel": "MARTY",
"price": 1.1,
"volume": 2.4
};
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": "sell",
"base": "DOC",
"rel": "MARTY",
"price": 1.1,
"volume": 2.4
}
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":"sell","base":"DOC","rel":"MARTY","price":1.1,"volume":2.4}`)
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": "sell",
"base": "DOC",
"rel": "MARTY",
"price": 1.1,
"volume": 2.4
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Command (rational representation in num-rational crate format)
POST sell
{
"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
},
"userpass": "RPC_UserP@SSW0RD"
} curl --url "http://127.0.0.1:7783" --data '{
"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
},
"userpass": "RPC_UserP@SSW0RD"
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"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
},
"userpass": "RPC_UserP@SSW0RD"
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"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
},
"userpass": "RPC_UserP@SSW0RD"
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"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
},
"userpass": "RPC_UserP@SSW0RD"
}
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(`{"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},"userpass":"RPC_UserP@SSW0RD"}`)
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 = {
"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
},
"userpass": "RPC_UserP@SSW0RD"
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Command (rational representation as a fraction object)
POST sell
{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "HELLO",
"rel": "WORLD",
"volume": {
"numer": "3",
"denom": "2"
},
"price": {
"numer": "2",
"denom": "1"
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "HELLO",
"rel": "WORLD",
"volume": {
"numer": "3",
"denom": "2"
},
"price": {
"numer": "2",
"denom": "1"
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "HELLO",
"rel": "WORLD",
"volume": {
"numer": "3",
"denom": "2"
},
"price": {
"numer": "2",
"denom": "1"
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "HELLO",
"rel": "WORLD",
"volume": {
"numer": "3",
"denom": "2"
},
"price": {
"numer": "2",
"denom": "1"
}
};
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": "sell",
"base": "HELLO",
"rel": "WORLD",
"volume": {
"numer": "3",
"denom": "2"
},
"price": {
"numer": "2",
"denom": "1"
}
}
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":"sell","base":"HELLO","rel":"WORLD","volume":{"numer":"3","denom":"2"},"price":{"numer":"2","denom":"1"}}`)
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": "sell",
"base": "HELLO",
"rel": "WORLD",
"volume": {
"numer": "3",
"denom": "2"
},
"price": {
"numer": "2",
"denom": "1"
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Command (with confirmations and notarization settings)
POST sell
{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "HELLO",
"rel": "WORLD",
"volume": {
"numer": "3",
"denom": "2"
},
"price": {
"numer": "2",
"denom": "1"
},
"base_confs": 2,
"base_nota": true,
"rel_confs": 5,
"rel_nota": false
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "HELLO",
"rel": "WORLD",
"volume": {
"numer": "3",
"denom": "2"
},
"price": {
"numer": "2",
"denom": "1"
},
"base_confs": 2,
"base_nota": true,
"rel_confs": 5,
"rel_nota": false
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "HELLO",
"rel": "WORLD",
"volume": {
"numer": "3",
"denom": "2"
},
"price": {
"numer": "2",
"denom": "1"
},
"base_confs": 2,
"base_nota": true,
"rel_confs": 5,
"rel_nota": false
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "HELLO",
"rel": "WORLD",
"volume": {
"numer": "3",
"denom": "2"
},
"price": {
"numer": "2",
"denom": "1"
},
"base_confs": 2,
"base_nota": true,
"rel_confs": 5,
"rel_nota": false
};
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": "sell",
"base": "HELLO",
"rel": "WORLD",
"volume": {
"numer": "3",
"denom": "2"
},
"price": {
"numer": "2",
"denom": "1"
},
"base_confs": 2,
"base_nota": true,
"rel_confs": 5,
"rel_nota": false
}
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":"sell","base":"HELLO","rel":"WORLD","volume":{"numer":"3","denom":"2"},"price":{"numer":"2","denom":"1"},"base_confs":2,"base_nota":true,"rel_confs":5,"rel_nota":false}`)
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": "sell",
"base": "HELLO",
"rel": "WORLD",
"volume": {
"numer": "3",
"denom": "2"
},
"price": {
"numer": "2",
"denom": "1"
},
"base_confs": 2,
"base_nota": true,
"rel_confs": 5,
"rel_nota": false
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Command (set to not save order history)
POST sell
{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "TKL",
"rel": "DUST",
"volume": {
"numer": "5",
"denom": "2"
},
"price": {
"numer": "9",
"denom": "4"
},
"save_in_history": false
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "TKL",
"rel": "DUST",
"volume": {
"numer": "5",
"denom": "2"
},
"price": {
"numer": "9",
"denom": "4"
},
"save_in_history": false
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "TKL",
"rel": "DUST",
"volume": {
"numer": "5",
"denom": "2"
},
"price": {
"numer": "9",
"denom": "4"
},
"save_in_history": false
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "TKL",
"rel": "DUST",
"volume": {
"numer": "5",
"denom": "2"
},
"price": {
"numer": "9",
"denom": "4"
},
"save_in_history": false
};
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": "sell",
"base": "TKL",
"rel": "DUST",
"volume": {
"numer": "5",
"denom": "2"
},
"price": {
"numer": "9",
"denom": "4"
},
"save_in_history": false
}
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":"sell","base":"TKL","rel":"DUST","volume":{"numer":"5","denom":"2"},"price":{"numer":"9","denom":"4"},"save_in_history":false}`)
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": "sell",
"base": "TKL",
"rel": "DUST",
"volume": {
"numer": "5",
"denom": "2"
},
"price": {
"numer": "9",
"denom": "4"
},
"save_in_history": false
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Command (GoodTillCancelled type)
POST sell
{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"order_type": {
"type": "GoodTillCancelled"
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"order_type": {
"type": "GoodTillCancelled"
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"order_type": {
"type": "GoodTillCancelled"
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"order_type": {
"type": "GoodTillCancelled"
}
};
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": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"order_type": {
"type": "GoodTillCancelled"
}
}
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":"sell","base":"BASE","rel":"REL","volume":[[1,[1]],[1,[1]]],"price":[[1,[1]],[1,[1]]],"order_type":{"type":"GoodTillCancelled"}}`)
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": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"order_type": {
"type": "GoodTillCancelled"
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Command (FillOrKill type)
POST sell
{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"order_type": {
"type": "FillOrKill"
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"order_type": {
"type": "FillOrKill"
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"order_type": {
"type": "FillOrKill"
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"order_type": {
"type": "FillOrKill"
}
};
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": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"order_type": {
"type": "FillOrKill"
}
}
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":"sell","base":"BASE","rel":"REL","volume":[[1,[1]],[1,[1]]],"price":[[1,[1]],[1,[1]]],"order_type":{"type":"FillOrKill"}}`)
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": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"order_type": {
"type": "FillOrKill"
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Command (match by Any)
POST sell
{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Any"
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Any"
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Any"
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Any"
}
};
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": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Any"
}
}
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":"sell","base":"BASE","rel":"REL","volume":[[1,[1]],[1,[1]]],"price":[[1,[1]],[1,[1]]],"match_by":{"type":"Any"}}`)
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": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Any"
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Command (match by Pubkeys)
POST sell
{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Pubkeys",
"data": [
"1ab7edc96abaefb358b52c583048eaaeb8ea42609d096d6cddfafa02fa510c6a"
]
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Pubkeys",
"data": [
"1ab7edc96abaefb358b52c583048eaaeb8ea42609d096d6cddfafa02fa510c6a"
]
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Pubkeys",
"data": [
"1ab7edc96abaefb358b52c583048eaaeb8ea42609d096d6cddfafa02fa510c6a"
]
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Pubkeys",
"data": [
"1ab7edc96abaefb358b52c583048eaaeb8ea42609d096d6cddfafa02fa510c6a"
]
}
};
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": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Pubkeys",
"data": [
"1ab7edc96abaefb358b52c583048eaaeb8ea42609d096d6cddfafa02fa510c6a"
]
}
}
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":"sell","base":"BASE","rel":"REL","volume":[[1,[1]],[1,[1]]],"price":[[1,[1]],[1,[1]]],"match_by":{"type":"Pubkeys","data":["1ab7edc96abaefb358b52c583048eaaeb8ea42609d096d6cddfafa02fa510c6a"]}}`)
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": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Pubkeys",
"data": [
"1ab7edc96abaefb358b52c583048eaaeb8ea42609d096d6cddfafa02fa510c6a"
]
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Command (match by Orders)
POST sell
{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Orders",
"data": [
"d14452bb-e82d-44a0-86b0-10d4cdcb8b24"
]
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Orders",
"data": [
"d14452bb-e82d-44a0-86b0-10d4cdcb8b24"
]
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Orders",
"data": [
"d14452bb-e82d-44a0-86b0-10d4cdcb8b24"
]
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Orders",
"data": [
"d14452bb-e82d-44a0-86b0-10d4cdcb8b24"
]
}
};
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": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Orders",
"data": [
"d14452bb-e82d-44a0-86b0-10d4cdcb8b24"
]
}
}
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":"sell","base":"BASE","rel":"REL","volume":[[1,[1]],[1,[1]]],"price":[[1,[1]],[1,[1]]],"match_by":{"type":"Orders","data":["d14452bb-e82d-44a0-86b0-10d4cdcb8b24"]}}`)
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": "sell",
"base": "BASE",
"rel": "REL",
"volume": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"price": [
[
1,
[
1
]
],
[
1,
[
1
]
]
],
"match_by": {
"type": "Orders",
"data": [
"d14452bb-e82d-44a0-86b0-10d4cdcb8b24"
]
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body))