API

Cron SDK

Quick tip

If you are looking for a quick start guide, check out the Quickstart guide.

Instructions

add_cron_transaction_v0

Accounts

NameMutabilitySignerDocs
payermutyes
authorityimmutyes
cron_jobmutno
cron_job_transactionmutno
system_programimmutno

Args

NameTypeDocs
argsAddCronTransactionArgsV0

AddCronTransactionArgsV0 Fields:

FieldTypeDescription
indexu32
transaction_sourceTransactionSourceV0

close_cron_job_v0

Accounts

NameMutabilitySignerDocs
rent_refundmutno
authorityimmutyes
user_cron_jobsmutno
cron_jobmutno
cron_job_name_mappingmutno
system_programimmutno
task_return_account_1mutno
task_return_account_2mutno

initialize_cron_job_v0

Accounts

NameMutabilitySignerDocs
payermutyes
queue_authorityimmutyes
task_queue_authorityimmutno
authorityimmutyes
user_cron_jobsmutno
cron_jobmutno
cron_job_name_mappingmutno
task_queuemutno
taskmutno
task_return_account_1mutno
task_return_account_2mutno
system_programimmutno
tuktuk_programimmutno

Args

NameTypeDocs
argsInitializeCronJobArgsV0

InitializeCronJobArgsV0 Fields:

FieldTypeDescription
schedulestring
namestring
free_tasks_per_transactionu8The number of free tasks each transaction will be executed with. This allows transactions scheduled via cron to themselves schedule more transactions. If none of your transactions need to schedule more transactions, set this to 0.
num_tasks_per_queue_callu8The number of tasks to queue per queue call. Cron job works by queueing a single task that runs at the appropriate time. This tasks job is to recursively queue all transactions in this cron. The higher you set this number, the more tasks will be queued per queue call, making the tasks execute faster/more parallelized. Setting this too high without proper lookup tables will result in the queue call being too large

queue_cron_tasks_v0

Accounts

NameMutabilitySignerDocs
cron_jobmutno
task_queueimmutno
task_return_account_1mutno
task_return_account_2mutno
system_programimmutno

remove_cron_transaction_v0

Accounts

NameMutabilitySignerDocs
rent_refundmutyes
authorityimmutyes
cron_jobmutno
cron_job_transactionmutno
system_programimmutno

Args

NameTypeDocs
argsRemoveCronTransactionArgsV0

RemoveCronTransactionArgsV0 Fields:

FieldTypeDescription
indexu32

Accounts

CronJobNameMappingV0

FieldTypeDescription
cron_jobpubkey
namestring
bump_seedu8

CronJobTransactionV0

FieldTypeDescription
idu32
cron_jobpubkey
transactionTransactionSourceV0
bump_seedu8

CronJobV0

FieldTypeDescription
idu32
user_cron_jobspubkey
task_queuepubkey
authoritypubkey
free_tasks_per_transactionu8
num_tasks_per_queue_callu8
schedulestring
namestring
current_exec_tsi64
current_transaction_idu32
num_transactionsu32
next_transaction_idu32
removed_from_queuebool
bump_seedu8

TaskQueueAuthorityV0

FieldTypeDescription
task_queuepubkey
queue_authoritypubkey
bump_seedu8

TaskQueueV0

FieldTypeDescription
tuktuk_configpubkey
idu32
update_authoritypubkey
reservedpubkey
min_crank_rewardu64
uncollected_protocol_feesu64
capacityu16
created_ati64
updated_ati64
bump_seedu8
task_bitmapbytes
namestring
lookup_tablesVec<pubkey>
num_queue_authoritiesu16
stale_task_ageu32

UserCronJobsV0

FieldTypeDescription
authoritypubkey
min_cron_job_idu32
next_cron_job_idu32
bump_seedu8

Types

AddCronTransactionArgsV0

FieldTypeDescription
indexu32
transaction_sourceTransactionSourceV0

CompiledInstructionV0

FieldTypeDescription
program_id_indexu8
accountsbytes
databytes

CompiledTransactionV0

FieldTypeDescription
num_rw_signersu8
num_ro_signersu8
num_rwu8
accountsVec<pubkey>
instructionsVec<CompiledInstructionV0>
signer_seedsVec<unknown>

CronJobNameMappingV0

FieldTypeDescription
cron_jobpubkey
namestring
bump_seedu8

CronJobTransactionV0

FieldTypeDescription
idu32
cron_jobpubkey
transactionTransactionSourceV0
bump_seedu8

CronJobV0

FieldTypeDescription
idu32
user_cron_jobspubkey
task_queuepubkey
authoritypubkey
free_tasks_per_transactionu8
num_tasks_per_queue_callu8
schedulestring
namestring
current_exec_tsi64
current_transaction_idu32
num_transactionsu32
next_transaction_idu32
removed_from_queuebool
bump_seedu8

InitializeCronJobArgsV0

FieldTypeDescription
schedulestring
namestring
free_tasks_per_transactionu8The number of free tasks each transaction will be executed with. This allows transactions scheduled via cron to themselves schedule more transactions. If none of your transactions need to schedule more transactions, set this to 0.
num_tasks_per_queue_callu8The number of tasks to queue per queue call. Cron job works by queueing a single task that runs at the appropriate time. This tasks job is to recursively queue all transactions in this cron. The higher you set this number, the more tasks will be queued per queue call, making the tasks execute faster/more parallelized. Setting this too high without proper lookup tables will result in the queue call being too large

RemoveCronTransactionArgsV0

FieldTypeDescription
indexu32

RunTaskReturnV0

FieldTypeDescription
tasksVec<TaskReturnV0>
accountsVec<pubkey>

TaskQueueAuthorityV0

FieldTypeDescription
task_queuepubkey
queue_authoritypubkey
bump_seedu8

TaskQueueV0

FieldTypeDescription
tuktuk_configpubkey
idu32
update_authoritypubkey
reservedpubkey
min_crank_rewardu64
uncollected_protocol_feesu64
capacityu16
created_ati64
updated_ati64
bump_seedu8
task_bitmapbytes
namestring
lookup_tablesVec<pubkey>
num_queue_authoritiesu16
stale_task_ageu32

TaskReturnV0

FieldTypeDescription
triggerTriggerV0
transactionTransactionSourceV0
crank_rewardOption<u64>
free_tasksu8
descriptionstring

TransactionSourceV0

VariantFieldsDescription
CompiledV0unknown
RemoteV0url: string, signer: pubkey

TriggerV0

VariantFieldsDescription
Now
Timestampi64

UserCronJobsV0

FieldTypeDescription
authoritypubkey
min_cron_job_idu32
next_cron_job_idu32
bump_seedu8

Errors

CodeNameMessage
6000InvalidScheduleInvalid schedule
6001TransactionAlreadyExistsTransaction already exists
6002InsufficientFundsInsufficient funds
6003OverflowOverflow
6004InvalidDataIncreaseInvalid data increase
6005CronJobHasTransactionsCron job has transactions
6006InvalidNumTasksPerQueueCallInvalid number of tasks per queue call
6007TooEarlyToo early to queue tasks
Previous