Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/rpc/dispatcher/dispatcher_legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub fn dispatcher(req: Json, ctx: MmArc) -> DispatcherRes {
"get_relay_mesh" => hyres(get_relay_mesh(ctx)),
"get_trade_fee" => hyres(get_trade_fee(ctx, req)),
// "fundvalue" => lp_fundvalue (ctx, req, false),
"help" => help(),
"help" => help(ctx),
"import_swaps" => hyres(import_swaps(ctx, req)),
"kmd_rewards_info" => hyres(kmd_rewards_info(ctx)),
// "inventory" => inventory (ctx, req),
Expand Down
30 changes: 4 additions & 26 deletions mm2src/mm2_main/src/rpc/lp_commands/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,39 +194,17 @@ pub async fn enable(ctx: MmArc, req: Json) -> Result<Response<Vec<u8>>, String>
Ok(res)
}

#[cfg(target_arch = "wasm32")]
pub fn help() -> HyRes {
pub fn help(ctx: MmArc) -> HyRes {
rpc_response(
INTERNAL_SERVER_ERROR_CODE,
RESPONSE_OK_STATUS_CODE,
json!({
"error":"'help' is only supported in native mode"
"result": "Please visit https://komodoplatform.com/en/docs/komodo-defi-framework/api for the API documentation.",
"version": &ctx.mm_version,
})
.to_string(),
)
}

#[cfg(not(target_arch = "wasm32"))]
pub fn help() -> HyRes {
rpc_response(
RESPONSE_OK_STATUS_CODE,
"
buy(base, rel, price, relvolume, timeout=10, duration=3600)
electrum(coin, urls)
enable(coin, urls, swap_contract_address)
myprice(base, rel)
my_balance(coin)
my_swap_status(params/uuid)
orderbook(base, rel, duration=3600)
sell(base, rel, price, basevolume, timeout=10, duration=3600)
send_raw_transaction(coin, tx_hex)
setprice(base, rel, price, broadcast=1)
stop()
version
withdraw(coin, amount, to)
",
)
}

/// Get MarketMaker session metrics
pub fn metrics(ctx: MmArc) -> HyRes {
match ctx.metrics.collect_json().map(|value| value.to_string()) {
Expand Down
Loading