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
32
33
34
35
36
37
38
39
40
41
use solana_client::rpc_client::RpcClient;
use solana_program::pubkey::Pubkey;
use solana_sdk::signature::{read_keypair_file, Signer};
use common::command::{CliConfig, ProcessResult};
use common::contract::instructions::initialize_rewarder::new_initialize_rewarder;
use common::utils::send::send_tx;
pub fn process_initialize_rewarder(
rpc_client: &RpcClient,
config: &mut CliConfig,
clmmpool: Pubkey,
rewarder_authority_file: &str,
rewarder_token_mint: Pubkey,
rewarder_index: u8,
mint_wrapper: Pubkey,
minter: Pubkey,
) -> ProcessResult {
let rewarder_authority_keypair = read_keypair_file(rewarder_authority_file.clone())?;
let rewarder_authority_pubkey = rewarder_authority_keypair.pubkey();
config.signers.push(Box::new(rewarder_authority_keypair));
let ixs = [new_initialize_rewarder(
clmmpool,
rewarder_authority_pubkey,
rewarder_token_mint,
rewarder_index,
mint_wrapper,
minter,
config.pubkey().unwrap()
)];
let res = send_tx(rpc_client, config, &ixs)?;
Ok("signers : ".to_owned() + res.to_string().as_str())
}