Cron
[Source]
(Added by the Cron amendment.)
The Cron pseudo-transaction is automatically inserted into the ledger by the Cron engine when a scheduled Hook execution is due. This pseudo-transaction triggers the execution of the Hook on the account specified in the Owner field.
Example
Section titled “Example”{ "TransactionType": "Cron", "Account": "rrrrrrrrrrrrrrrrrrrrrhoLvTp", "Fee": "0", "LedgerSequence": 21225473, "Sequence": 0, "SigningPubKey": "", "TxnSignature": "", "Owner": "rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm"}Fields
Section titled “Fields”| Field | JSON Type | Internal Type | Description |
|---|---|---|---|
Owner | String | AccountID | The account that owns the scheduled Hook execution. This is the account that will be invoked when the cron executes. |
LedgerSequence | Number | UInt32 | The ledger index where this pseudo-transaction appears. This distinguishes the pseudo-transaction from other occurrences of the same change. |
Common Fields
Section titled “Common Fields”As a pseudo-transaction, Cron uses the standard pseudo-transaction values for common fields:
| Field | Value |
|---|---|
Account | rrrrrrrrrrrrrrrrrrrrrhoLvTp (ACCOUNT_ZERO) |
Fee | 0 |
Sequence | 0 |
SigningPubKey | "" (empty string) |
TxnSignature | "" (empty string) |
Execution Behavior
Section titled “Execution Behavior”When a Cron ledger object is ready to execute (based on its StartTime, DelaySeconds, and RepeatCount fields), the Cron engine automatically inserts a Cron pseudo-transaction into the ledger.
The pseudo-transaction contains an Owner field that references the account with the scheduled Hook. The Hook on that account will be invoked automatically, and the account is treated as a weak transactional stakeholder (TSH) during execution.
Important: Hook developers must enable collect calls (hsfCOLLECT flag) on their Hooks, as the Owner constitutes a weak transactional stakeholder when the Cron pseudo-transaction executes. The account must also have the asfTshCollect flag enabled.
Related Documentation
Section titled “Related Documentation”- CronSet transaction: Creates, updates, or deletes scheduled Hook executions
- Cron ledger object: The ledger object that represents a scheduled Hook execution
- Weak and Strong: Understanding transactional stakeholders
- Collect Call Hooks: How weak TSH Hooks are executed