load

open override fun load(db: WalletDatabase)

Reads the record save wrote, overwrites index, and rebuilds destination (which carries the unlock value).

On-disk layout (matches save):

  1. version byte

  2. unlock value (Int64)

  3. leaf index (Int32)

contractDbKey uses the current index to locate the record, so callers loading a specific (name, index) entry must set index first.

Throws org.nexa.libnexakotlin.DataMissingException (from the WalletDatabase lookup) if no record exists for this contract at the current index; IllegalStateException if the stored version is not SERIALIZED_VERSION.