marketplace documentation and rpc methods renamed
This commit is contained in:
parent
ed733c3210
commit
6441183d25
14 changed files with 226 additions and 4 deletions
|
|
@ -29,5 +29,5 @@ namespace command_line
|
|||
|
||||
const arg_descriptor<bool> arg_disable_stop_if_time_out_of_sync = { "disable-stop-if-time-out-of-sync", "Do not stop the daemon if serious time synchronization problem is detected", false, true };
|
||||
const arg_descriptor<bool> arg_disable_stop_on_low_free_space = { "disable-stop-on-low-free-space", "Do not stop the daemon if free space at data dir is critically low", false, true };
|
||||
const arg_descriptor<bool> arg_enable_offers_service = { "enable_offers_service", "Enables marketplace feature", false, false};
|
||||
const arg_descriptor<bool> arg_enable_offers_service = { "enable-offers-service", "Enables marketplace feature", false, false};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace bc_services
|
|||
{
|
||||
|
||||
//fields filled in UI
|
||||
uint8_t offer_type; // OFFER_TYPE_PRIMARY_TO_TARGET - 0, OFFER_TYPE_TARGET_TO_PRIMARY - 1 etc.
|
||||
uint8_t offer_type; // OFFER_TYPE_PRIMARY_TO_TARGET(SELL ORDER) - 0, OFFER_TYPE_TARGET_TO_PRIMARY(BUY ORDER) - 1 etc.
|
||||
uint64_t amount_primary; // amount of the currency
|
||||
uint64_t amount_target; // amount of other currency or goods
|
||||
std::string bonus; //
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ namespace currency
|
|||
MAP_JON_RPC ("reset_transaction_pool", on_reset_transaction_pool, COMMAND_RPC_RESET_TX_POOL)
|
||||
MAP_JON_RPC ("get_current_core_tx_expiration_median", on_get_current_core_tx_expiration_median, COMMAND_RPC_GET_CURRENT_CORE_TX_EXPIRATION_MEDIAN)
|
||||
//
|
||||
MAP_JON_RPC_WE("get_offers_ex", on_get_offers_ex, COMMAND_RPC_GET_OFFERS_EX)
|
||||
MAP_JON_RPC_WE("marketplace_global_get_offers_ex", on_get_offers_ex, COMMAND_RPC_GET_OFFERS_EX)
|
||||
|
||||
//remote miner rpc
|
||||
MAP_JON_RPC_N(on_login, mining::COMMAND_RPC_LOGIN)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include "serialization_performance_test.h"
|
||||
#include "keccak_test.h"
|
||||
#include "blake2_test.h"
|
||||
#include "print_struct_to_json.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
@ -33,7 +34,9 @@ int main(int argc, char** argv)
|
|||
set_process_affinity(1);
|
||||
set_thread_high_priority();
|
||||
|
||||
test_blake2();
|
||||
//test_blake2();
|
||||
|
||||
print_struct_to_json();
|
||||
|
||||
//performance_timer timer;
|
||||
//timer.start();
|
||||
|
|
|
|||
26
tests/performance_tests/print_struct_to_json.h
Normal file
26
tests/performance_tests/print_struct_to_json.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (c) 2012-2013 The Boolberry developers
|
||||
// Copyright (c) 2012-2013 The Zano developers
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "currency_core/currency_basic.h"
|
||||
#include "rpc/core_rpc_server_commands_defs.h"
|
||||
#include "wallet/wallet_public_structs_defs.h"
|
||||
|
||||
|
||||
|
||||
inline bool print_struct_to_json()
|
||||
{
|
||||
tools::wallet_public::COMMAND_MARKETPLACE_PUSH_OFFER::request of = AUTO_VAL_INIT(of);
|
||||
tools::wallet_public::COMMAND_MARKETPLACE_PUSH_UPDATE_OFFER::request uo = AUTO_VAL_INIT(uo);
|
||||
|
||||
bc_services::core_offers_filter ft = AUTO_VAL_INIT(ft);
|
||||
|
||||
std::string s = epee::serialization::store_t_to_json(of);
|
||||
s = epee::serialization::store_t_to_json(ft);
|
||||
s = epee::serialization::store_t_to_json(uo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 0,
|
||||
"method": "marketplace_cancel_offer",
|
||||
"params": {
|
||||
"no": 0,
|
||||
"tx_id": "1ca72152db6b962e473a0f838c281c902b7e1ed79c0a762bdb197ccf7f4ab2d5",
|
||||
"fee": 10000000000
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"id": 0,
|
||||
"jsonrpc": "2.0",
|
||||
"result": {
|
||||
"tx_blob_size": 368,
|
||||
"tx_hash": "d52014dae0b65168e0551acef9e95972041f3f38d92455d18c8b886baece3d90"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 0,
|
||||
"method": "marketplace_get_offers_ex",
|
||||
"params": {
|
||||
"filter": {
|
||||
"amount_low_limit": 0,
|
||||
"amount_up_limit": 0,
|
||||
"bonus": false,
|
||||
"category": "",
|
||||
"fake": false,
|
||||
"keyword": "",
|
||||
"limit": 100,
|
||||
"location_city": "",
|
||||
"location_country": "",
|
||||
"offer_type_mask": 0,
|
||||
"offset": 0,
|
||||
"order_by": 0,
|
||||
"primary": "",
|
||||
"rate_low_limit": "0.000000",
|
||||
"rate_up_limit": "0.000000",
|
||||
"reverse": false,
|
||||
"target": "",
|
||||
"timestamp_start": 0,
|
||||
"timestamp_stop": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"id": 0,
|
||||
"jsonrpc": "2.0",
|
||||
"result": {
|
||||
"offers": [{
|
||||
"ap": "20",
|
||||
"at": "1",
|
||||
"b": "",
|
||||
"cat": "CLS:MAN:TSH",
|
||||
"cnt": "Skype: some_skype, discord: some_user#01012",
|
||||
"com": "Some nice comments about tshirt",
|
||||
"do": "Additional conditions",
|
||||
"et": 10,
|
||||
"fee": 10000000000,
|
||||
"index_in_tx": 0,
|
||||
"lci": "",
|
||||
"lco": "World Wide",
|
||||
"ot": 1,
|
||||
"p": "USD",
|
||||
"pt": "Credit cards, BTC, ZANO, ETH",
|
||||
"security": "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"t": "T-shirt with Zano logo, made by Crypjunkie",
|
||||
"timestamp": 1570219600,
|
||||
"tx_hash": "6ba12c5d2c66d31f770bfdc88ae9dc90d007b9b33f946fc7c1d9750f8655331c",
|
||||
"tx_original_hash": "0000000000000000000000000000000000000000000000000000000000000000"
|
||||
},{
|
||||
"ap": "20",
|
||||
"at": "1",
|
||||
"b": "",
|
||||
"cat": "CLS:MAN:TSH",
|
||||
"cnt": "Skype: some_skype, discord: some_user#01012",
|
||||
"com": "Some nice comments about tshirt",
|
||||
"do": "Additional conditions",
|
||||
"et": 10,
|
||||
"fee": 10000000000,
|
||||
"index_in_tx": 0,
|
||||
"lci": "",
|
||||
"lco": "World Wide",
|
||||
"ot": 1,
|
||||
"p": "USD",
|
||||
"pt": "Credit cards, BTC, ZANO, ETH",
|
||||
"security": "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"t": "T-shirt with Zano logo, made by Crypjunkie",
|
||||
"timestamp": 1570219840,
|
||||
"tx_hash": "2987b671cc337203628a3a1bb7ac811e41f110864d6162d3c2276d2c79f694d6",
|
||||
"tx_original_hash": "0000000000000000000000000000000000000000000000000000000000000000"
|
||||
}],
|
||||
"status": "",
|
||||
"total_offers": 0
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 0,
|
||||
"method": "marketplace_push_offer",
|
||||
"params": {
|
||||
"od": {
|
||||
"ap": "20",
|
||||
"at": "1",
|
||||
"cat": "CLS:MAN:TSH",
|
||||
"cnt": "Skype: some_skype, discord: some_user#01012",
|
||||
"com": "Some nice comments about tshirt",
|
||||
"do": "Additional conditions",
|
||||
"et": 10,
|
||||
"fee": 10000000000,
|
||||
"lci": "",
|
||||
"lco": "World Wide",
|
||||
"ot": 1,
|
||||
"p": "USD",
|
||||
"pt": "Credit cards, BTC, ZANO, ETH",
|
||||
"t": "T-shirt with Zano logo, made by Crypjunkie[4]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 0,
|
||||
"method": "marketplace_push_offer",
|
||||
"params": {
|
||||
"od": {
|
||||
"ap": "10000",
|
||||
"at": "1",
|
||||
"cat": "HRD:MIN",
|
||||
"cnt": "Skype: some_skype, discord: some_user#01012",
|
||||
"com": "Some nice comments about farm",
|
||||
"do": "Additional conditions",
|
||||
"et": 10,
|
||||
"fee": 10000000000,
|
||||
"lci": "",
|
||||
"lco": "World Wide",
|
||||
"ot": 1,
|
||||
"p": "USD",
|
||||
"pt": "Credit cards, BTC, ZANO, ETH",
|
||||
"t": "Mining farm built by Gigabyted"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"id": 0,
|
||||
"jsonrpc": "2.0",
|
||||
"result": {
|
||||
"tx_blob_size": 549,
|
||||
"tx_hash": "2987b671cc337203628a3a1bb7ac811e41f110864d6162d3c2276d2c79f694d6"
|
||||
}
|
||||
}
|
||||
-----[2]
|
||||
{
|
||||
"id": 0,
|
||||
"jsonrpc": "2.0",
|
||||
"result": {
|
||||
"tx_blob_size": 552,
|
||||
"tx_hash": "1ca72152db6b962e473a0f838c281c902b7e1ed79c0a762bdb197ccf7f4ab2d5"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 0,
|
||||
"method": "marketplace_push_update_offer",
|
||||
"params": {
|
||||
"no": 0,
|
||||
"tx_id": "2987b671cc337203628a3a1bb7ac811e41f110864d6162d3c2276d2c79f694d6",
|
||||
"od": {
|
||||
"ap": "20",
|
||||
"at": "1",
|
||||
"cat": "CLS:MAN:TSH",
|
||||
"cnt": "Skype: some_skype, discord: some_user#01012",
|
||||
"com": "Some nice comments about tshirt",
|
||||
"do": "Additional conditions",
|
||||
"et": 10,
|
||||
"fee": 10000000000,
|
||||
"lci": "",
|
||||
"lco": "World Wide",
|
||||
"ot": 1,
|
||||
"p": "USD",
|
||||
"pt": "Credit cards, BTC, ZANO, ETH",
|
||||
"t": "T-shirt with Zano logo, made by Crypjunkie[updated]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"id": 0,
|
||||
"jsonrpc": "2.0",
|
||||
"result": {
|
||||
"tx_blob_size": 725,
|
||||
"tx_hash": "06da9bac0f15fd7ab41983f9437f95835b1baef6810fe15b2ea831f60b058b4b"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue