BalanceProgress

sealed class BalanceProgress

Granular progress updates during the balance+submit pipeline.

DApp developers receive these through TransactionBalancer.balanceAndSubmit's onProgress callback, or through ContractCallStage.BalancingDetail in MidnightContract.call's progress callback.

Usage in a ViewModel:

contract.call("post", message) { stage ->
when (stage) {
is ContractCallStage.BalancingDetail -> when (stage.progress) {
is BalanceProgress.SyncingDust -> showStatus("Syncing dust wallet...")
is BalanceProgress.SyncingDustProgress -> showProgress(
stage.progress.eventsProcessed, stage.progress.totalEvents
)
is BalanceProgress.ProvingDust -> showStatus("Proving dust payment...")
is BalanceProgress.Submitting -> showStatus("Submitting to blockchain...")
is BalanceProgress.WaitingFinalization -> showStatus("Waiting for finalization...")
is BalanceProgress.RetryingDustSync -> showStatus("Retrying dust sync...")
}
// ... handle other stages
}
}

Inheritors

Types

Link copied to clipboard

Generating ZK proof for dust fee payment.

Link copied to clipboard

Spent-dust recovery (node error 195 = InputNotInUtxos): a dust UTXO the wallet picked was already spent on-chain — the indexer's event stream hadn't reflected our own earlier fee spend yet. The wallet records it, re-selects a different dust UTXO, and retries. (This is not error 115, which is an InvalidProof — an unrelated failure mode.)

Link copied to clipboard

Error 170 recovery: re-syncing dust from genesis and retrying.

Link copied to clipboard

Balanced transaction submitted to the blockchain node.

Link copied to clipboard

Initial dust wallet sync starting (first call per session is slow).

Link copied to clipboard
data class SyncingDustProgress(val eventsProcessed: Int, val totalEvents: Int) : BalanceProgress

Dust sync streaming progress — use for progress bars.

Link copied to clipboard

Transaction is in a block, waiting for finalization.