Skip to main content

upsert_key_entry

Function upsert_key_entry 

Source
pub(crate) fn upsert_key_entry(entry: KeyEntry) -> Result<()>
Expand description

Atomically upsert a KeyEntry into keys.toml.

Replaces any existing entry for the same (wallet_address, chain_id). Each Tempo wallet has at most one active access key per chain, so a fresh login always supersedes the previous entry regardless of the new key address. Creates the file (and parent directories) if missing. Writes via temp file + rename so a crash mid-write cannot corrupt the file.