Skip to content

Commit 5c71499

Browse files
committed
Add custom signing key to sdk
1 parent c39d7a7 commit 5c71499

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tuktuk-sdk/src/tuktuk.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ pub fn task_queue_name_mapping_key(config_key: &Pubkey, name: &str) -> Pubkey {
3232
.0
3333
}
3434

35+
pub fn custom_signing_key(task_queue: &Pubkey, signer_seeds: &[&[u8]]) -> Pubkey {
36+
Pubkey::find_program_address(
37+
&[&[b"custom", task_queue.as_ref()], signer_seeds].concat(),
38+
&tuktuk::ID,
39+
)
40+
.0
41+
}
42+
3543
#[derive(Debug)]
3644
pub struct TaskQueueUpdate {
3745
pub task_queues: Vec<(Pubkey, Option<TaskQueueV0>)>,
@@ -64,7 +72,7 @@ pub fn create_config(
6472
pub mod cron {
6573
use anchor_lang::{InstructionData, ToAccountMetas};
6674
use itertools::Itertools;
67-
use solana_sdk::{instruction::Instruction, pubkey::Pubkey};
75+
use solana_sdk::{instruction::Instruction, pubkey, pubkey::Pubkey};
6876
use tuktuk_program::{
6977
cron::{
7078
self,
@@ -78,6 +86,8 @@ pub mod cron {
7886
use super::{hash_name, task, task_queue::task_queue_authority_key};
7987
use crate::{client::GetAnchorAccount, error::Error};
8088

89+
pub const TASK_QUEUE_ID: Pubkey = pubkey!("H39gEszvsi6AT4rYBiJTuZHJSF5hMHy6CKGTd7wzhsg7");
90+
8191
pub fn user_cron_jobs_key(authority: &Pubkey) -> Pubkey {
8292
Pubkey::find_program_address(&[b"user_cron_jobs", authority.as_ref()], &ID).0
8393
}

0 commit comments

Comments
 (0)