1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use common::command::{CliConfig, ProcessResult};
use common::contract::instructions::pause_clmmpool::new_pause_clmmpool;
use common::program::SWAP_PROGRAM_ID;
use common::utils::send::send_tx;
use solana_client::rpc_client::RpcClient;
use solana_program::pubkey::Pubkey;

pub fn process_pause_pool(
    rpc_client: &RpcClient,
    config: &CliConfig,
    clmmpool: &Pubkey,
) -> ProcessResult {
    let (clmm_config_pubkey, _) = Pubkey::find_program_address(
        &[
            b"clmmconfig",
        ],
        &SWAP_PROGRAM_ID,
    );

    let ixs = [
        new_pause_clmmpool(
            &clmm_config_pubkey,
            clmmpool,
            config.pubkey().unwrap(),
        )
    ];

    let res = send_tx(rpc_client, config, &ixs)?;

    Ok("signers : ".to_owned() + res.to_string().as_str())
}