deposit, swap, commit

This commit is contained in:
Hardhat Chad
2025-06-13 13:26:42 -07:00
parent 1e4e9d9fdf
commit c046c482a5
4 changed files with 60 additions and 4 deletions

View File

@@ -48,6 +48,12 @@ async fn main() {
"swap" => {
swap(&rpc, &payer).await.unwrap();
}
"commit" => {
commit(&rpc, &payer).await.unwrap();
}
// "uncommit" => {
// uncommit(&rpc, &payer).await.unwrap();
// }
_ => panic!("Invalid command"),
};
}
@@ -74,6 +80,17 @@ async fn close(
Ok(())
}
async fn commit(
rpc: &RpcClient,
payer: &solana_sdk::signer::keypair::Keypair,
) -> Result<(), anyhow::Error> {
let id_str = std::env::var("ID").expect("Missing ID env var");
let id = id_str.parse::<u64>()?;
let ix = ore_api::sdk::commit(payer.pubkey(), 10000000, Pubkey::default(), 0, id, [0; 32]);
submit_transaction(rpc, payer, &[ix]).await?;
Ok(())
}
async fn deposit(
rpc: &RpcClient,
payer: &solana_sdk::signer::keypair::Keypair,