renegade_sdk/renegade_wallet_client/actions/
mod.rs

1//! Actions to update a Renegade wallet
2
3pub mod admin_assign_order_to_pool;
4pub mod admin_create_matching_pool;
5pub mod admin_get_account_orders;
6pub mod admin_get_open_orders;
7pub mod admin_get_order;
8pub mod admin_is_task_queue_paused;
9pub mod admin_place_order_in_pool;
10pub mod approvals;
11pub mod cancel_order;
12pub mod create_account;
13pub mod deposit;
14pub mod get_account;
15pub mod get_account_seeds;
16pub mod get_balance_by_mint;
17pub mod get_balances;
18pub mod get_order;
19pub mod get_orders;
20pub mod get_task;
21pub mod get_tasks;
22pub mod place_order;
23pub mod sync_account;
24pub mod update_order;
25pub mod withdraw;
26
27// ----------------------------
28// | Query Parameter Constants |
29// ----------------------------
30
31/// The query parameter for non-blocking requests
32pub(crate) const NON_BLOCKING_PARAM: &str = "non_blocking";
33/// The query parameter for page token
34pub(crate) const PAGE_TOKEN_PARAM: &str = "page_token";
35/// The query parameter for including historic orders
36pub(crate) const INCLUDE_HISTORIC_ORDERS_PARAM: &str = "include_historic_orders";
37/// The query parameter for including historic tasks
38pub(crate) const INCLUDE_HISTORIC_TASKS_PARAM: &str = "include_historic_tasks";
39/// The query parameter for matching pool
40pub(crate) const MATCHING_POOL_PARAM: &str = "matching_pool";
41
42// -----------
43// | Helpers |
44// -----------
45
46/// Constructs an HTTP path by replacing URL parameters with given values
47macro_rules! construct_http_path {
48    ($base_url:expr $(, $param:expr => $value:expr)*) => {{
49        let mut url = $base_url.to_string();
50        $(
51            let placeholder = format!(":{}", $param);
52            url = url.replace(&placeholder, &$value.to_string());
53        )*
54        url
55    }};
56}
57pub(crate) use construct_http_path;