MCPcopy Create free account
hub / github.com/clockwork-xyz/clockwork / delete

Function delete

cli/src/processor/thread.rs:52–65  ·  view source on GitHub ↗
(client: &Client, id: String)

Source from the content-addressed store, hash-verified

50}
51
52pub fn delete(client: &Client, id: String) -> Result<(), CliError> {
53 let thread_pubkey = Thread::pubkey(client.payer_pubkey(), id.into_bytes());
54 let ix = Instruction {
55 program_id: clockwork_thread_program::ID,
56 accounts: clockwork_thread_program::accounts::ThreadDelete {
57 authority: client.payer_pubkey(),
58 close_to: client.payer_pubkey(),
59 thread: thread_pubkey,
60 }.to_account_metas(Some(false)),
61 data: clockwork_thread_program::instruction::ThreadDelete {}.data(),
62 };
63 client.send_and_confirm(&[ix], &[client.payer()]).unwrap();
64 Ok(())
65}
66
67pub fn get(client: &Client, address: Pubkey) -> Result<(), CliError> {
68 let data = client.get_account_data(&address).unwrap();

Callers 1

processFunction · 0.85

Calls 3

payer_pubkeyMethod · 0.80
send_and_confirmMethod · 0.80
payerMethod · 0.80

Tested by

no test coverage detected