DustCloudBackup

Full cross-device dust backup — adds the upload side to DustCloudBackupSource. One implementation serves both views: DustSyncManager consumes only fetch, MidnightWallet also drives upload.

Functions

Link copied to clipboard
abstract suspend fun clear()

Delete the cloud dust-checkpoint blob and clear the local upload digests (#246 — true backup disable). After this, re-enabling backup re-uploads from scratch (the digest guard won't wrongly skip an unchanged checkpoint as already-uploaded). Best-effort; idempotent (deleting an absent blob is a no-op).

Link copied to clipboard
abstract suspend fun fetch(address: String): RestoredDustCheckpoint?

The cloud checkpoint for address, or null if none / unavailable.

Link copied to clipboard
abstract suspend fun upload(address: String, stateBytes: ByteArray, lastEventId: Long)

Snapshot this address's checkpoint into the (multi-network) cloud bundle, preserving other networks' entries. Best-effort + idempotent: a content hash skips re-upload when nothing changed. Callers wrap in runCatching so a backup failure never affects wallet operations.