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
use solana_client::rpc_client::RpcClient;
use solana_program::pubkey::Pubkey;
use common::command::{CliConfig, ProcessResult};
use common::contract::instructions::decrease_liquidity::new_decrease_liquidity_tx;
use common::utils::send::send_tx;
pub fn process(
rpc_client: &RpcClient,
config: &CliConfig,
mint: &Pubkey,
amount_a: &f64,
liquidity: &u128,
amount_b: &f64,
slid: &f64,
) -> ProcessResult {
let ixs = vec![new_decrease_liquidity_tx(
rpc_client, config, mint, amount_a, amount_b, liquidity, slid,
)
.expect("liquidity is zero")];
let res = send_tx(rpc_client, config, &ixs)?;
Ok("signers : ".to_owned() + res.to_string().as_str())
}