renegade_sdk/renegade_wallet_client/actions/
admin_create_matching_pool.rs

1//! Admin action to create a matching pool
2
3use renegade_external_api::EmptyRequestResponse;
4use renegade_external_api::http::admin::ADMIN_MATCHING_POOL_CREATE_ROUTE;
5
6use crate::{RenegadeClientError, actions::construct_http_path, client::RenegadeClient};
7
8impl RenegadeClient {
9    /// Creates a new matching pool via the admin API.
10    ///
11    /// Orders can only be matched with other orders in the same matching pool.
12    /// If the specified matching pool already exists, this is a no-op.
13    ///
14    /// This is an admin action that requires the client to be configured with
15    /// an admin HMAC key.
16    pub async fn admin_create_matching_pool(
17        &self,
18        matching_pool: String,
19    ) -> Result<(), RenegadeClientError> {
20        let admin_client = self.get_admin_client()?;
21
22        let path = construct_http_path!(ADMIN_MATCHING_POOL_CREATE_ROUTE, "matching_pool" => matching_pool);
23
24        admin_client.post::<_, EmptyRequestResponse>(&path, EmptyRequestResponse {}).await?;
25
26        Ok(())
27    }
28}