last-heartbeat to stacks-block-time, restarting the inactivity countdown. The vault must exist and must not be distributed. This function is only callable by the vault owner (the address that created the vault), because it uses tx-sender to look up the vault.
Function signature
Parameters
This function takes no arguments. The vault owner is identified bytx-sender.
Return value
Returns
(ok true) on success. The vault’s last-heartbeat is updated to the current stacks-block-time.Returns
(err uint) on failure. See error codes below.Error codes
| Code | Constant | When returned |
|---|---|---|
| u103 | ERR-VAULT-NOT-FOUND | The calling address has no vault |
| u110 | ERR-VAULT-DISTRIBUTED | The vault has been distributed or cancelled |
How the heartbeat works
The function mergesstacks-block-time into the vault’s last-heartbeat field:
stacks-block-time is a Clarity 4 consensus-level keyword — it returns the timestamp of the current Stacks block and cannot be manipulated by the caller.
Vault states where heartbeat works
The function only blocks ifis-distributed is true. It succeeds in all other states:
| Vault state | Heartbeat allowed? | Effect |
|---|---|---|
active | Yes | Resets timer, vault stays active |
grace | Yes | Resets timer, vault returns to active |
claimable | Yes | Resets timer, vault returns to active — heirs can no longer claim |
distributed | No | Returns ERR-VAULT-DISTRIBUTED |
