Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 61 additions & 41 deletions investments/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions investments/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@
members = [
"client",
"programs/*",
]

[patch.crates-io]
anchor-lang = { git = "https://github.com/clockwork-xyz/anchor", branch = "0.25.0-solana.1.13.4" }
anchor-spl = { git = "https://github.com/clockwork-xyz/anchor", branch = "0.25.0-solana.1.13.4" }
clockwork-sdk = { git = "https://github.com/clockwork-xyz/clockwork", tag = "v1.3.9" }
]
10 changes: 5 additions & 5 deletions investments/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
[dependencies]
investments-program = { path = "../programs/investments", features = ["no-entrypoint"], version = "0.1.0" }
serum-crank = { path = "../../serum_crank/programs/serum_crank", features = ["no-entrypoint"], version = "0.1.0" }
clockwork-sdk = { version = "1.3.9", features = ["client"] }
anchor-spl = { version = "0.25.0", features = ["dex"] }
anchor-lang = "0.25.0"
solana-sdk = "1.10.34"
solana-client = "1.10.34"
clockwork-client = "1.4.0"
anchor-spl = { version = "0.26.0", features = ["dex"] }
anchor-lang = "0.26.0"
solana-sdk = "1.13.5"
solana-client = "1.13.5"
serum-common = { version = "0.4.7", features = ["client"] }
17 changes: 8 additions & 9 deletions investments/client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ use {
},
token,
},
clockwork_sdk::client::{thread_program, Client, ClientResult, SplToken},
clockwork_client::{
thread::{self, state::Thread},
Client, ClientResult, SplToken,
},
serum_common::client::rpc::mint_to_new_account,
solana_sdk::{
instruction::Instruction, native_token::LAMPORTS_PER_SOL, signature::Keypair,
Expand Down Expand Up @@ -47,15 +50,11 @@ fn main() -> ClientResult<()> {
market_keys.pc_mint,
market_keys.coin_mint,
);
let investment_thread = clockwork_sdk::thread_program::accounts::Thread::pubkey(
investment,
"investment".to_string(),
);
let investment_thread = Thread::pubkey(investment, "investment".to_string());

// derive serum_crank PDAs
let crank = serum_crank::state::Crank::pubkey(market_keys.market);
let crank_thread =
clockwork_sdk::thread_program::accounts::Thread::pubkey(crank, "crank".into());
let crank_thread = Thread::pubkey(crank, "crank".into());

print_explorer_link(investment_thread, "investment_thread".to_string())?;
print_explorer_link(crank_thread, "crank_thread".to_string())?;
Expand Down Expand Up @@ -284,7 +283,7 @@ fn initialize_serum_crank(
let initialize_ix = Instruction {
program_id: serum_crank::ID,
accounts: vec![
AccountMeta::new_readonly(thread_program::ID, false),
AccountMeta::new_readonly(thread::ID, false),
AccountMeta::new(crank, false),
AccountMeta::new(crank_thread, false),
AccountMeta::new_readonly(anchor_spl::dex::ID, false),
Expand Down Expand Up @@ -329,7 +328,7 @@ fn create_investment_and_deposit(
program_id: investments_program::ID,
accounts: vec![
AccountMeta::new_readonly(associated_token::ID, false),
AccountMeta::new_readonly(thread_program::ID, false),
AccountMeta::new_readonly(thread::ID, false),
AccountMeta::new_readonly(anchor_spl::dex::ID, false),
AccountMeta::new(investment, false),
AccountMeta::new(investment_mint_a_token_account, false),
Expand Down
2 changes: 1 addition & 1 deletion investments/client/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use {
anchor_lang::{prelude::*, solana_program::sysvar},
clockwork_sdk::client::{Client, ClientResult},
clockwork_client::{Client, ClientResult},
solana_sdk::{
instruction::Instruction, signature::Keypair, signer::Signer, transaction::Transaction,
},
Expand Down
7 changes: 4 additions & 3 deletions investments/programs/investments/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ default = []
[profile.release]
overflow-checks = true

anchor-lang = { version = "0.26.0", features = ["init-if-needed"] }
anchor-spl = { version = "0.26.0", features = ["token"] }
clockwork-sdk = { version = "1.4.0" }
[dependencies]
anchor-spl = { version = "0.26.0", features = ["dex"] }
anchor-lang = "0.26.0"
clockwork-sdk = "1.4.0"
4 changes: 2 additions & 2 deletions investments/programs/investments/src/instructions/claim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ pub struct Claim<'info> {
#[account(address = sysvar::rent::ID)]
pub rent: Sysvar<'info, Rent>,

#[account(address = clockwork_sdk::thread_program::ID)]
pub scheduler_program: Program<'info, clockwork_sdk::thread_program::ThreadProgram>,
#[account(address = clockwork_sdk::ID)]
pub scheduler_program: Program<'info, clockwork_sdk::ThreadProgram>,

#[account(address = system_program::ID)]
pub system_program: Program<'info, System>,
Expand Down
Loading