mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-15 15:10:19 +00:00
deposit, swap, commit
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user