Package-level declarations

Types

Link copied to clipboard
data class AlignedValue(val value: List<ByteArray>, val alignmentJson: String)

Represents a field-aligned byte array value from the Midnight runtime.

Link copied to clipboard
sealed class BalanceProgress

Granular progress updates during the balance+submit pipeline.

Link copied to clipboard

Thrown when circuit execution or transaction assembly fails.

Link copied to clipboard
class CircuitExecutor(context: Context, ioDispatcher: CoroutineDispatcher = Dispatchers.IO)

Executes Compact smart contract circuits on Android via QuickJS + Rust FFI.

Link copied to clipboard
data class CircuitResult(val proofData: ProofData, val stateHandle: Long, val contractAddress: String, val entryPoint: String, val zswapLocalStateJson: String, val privateStateJson: String)

Full result from executing a contract circuit in QuickJS.

Link copied to clipboard

Typed errors from MidnightContract.call — each stage has its own subclass.

Link copied to clipboard
sealed class ContractCallStage

Progress stages emitted during MidnightContract.call.

Link copied to clipboard

Native bridge to the Rust contract runtime.

Link copied to clipboard

Connects to a DApp Connector wallet (e.g., mn serve) via WebSocket JSON-RPC.

Link copied to clipboard
data class DeployExecutionResult(val unprovenTxHex: String, val contractAddress: String)

Result of contract deployment assembly.

Link copied to clipboard
data class DeployResult(val contractAddress: String, val timings: DeployTimings)

Result of deploying a contract to the blockchain.

Link copied to clipboard
data class DeployTimings(val executeMs: Long, val proveMs: Long, val balanceMs: Long)
Link copied to clipboard
data class ExecutionResult(val unprovenTxHex: String, val txParamsJson: String)

Result of circuit execution and transaction assembly.

Link copied to clipboard

Thrown by LedgerEvaluator.readAll when the JS read pipeline fails.

Link copied to clipboard

Proves transactions locally on the phone using cached proving keys.

Link copied to clipboard

Configuration for Midnight contract operations.

Link copied to clipboard

High-level interface for calling Midnight smart contract circuits from Android.

Link copied to clipboard

A typed, eagerly-evaluated snapshot of a deployed contract's ledger.

Link copied to clipboard
class MissingLedgerFieldException(val fieldName: String, val knownFields: Set<String>) : Exception

Thrown when MidnightLedger is asked for a field that doesn't exist in the contract's schema. The exception lists knownFields so a typo or version mismatch can be diagnosed immediately.

Link copied to clipboard
data class PipelineTimings(val fetchStateMs: Long = 0, val executeMs: Long = 0, val proveMs: Long = 0, val balanceMs: Long = 0, val submitMs: Long = 0)

Timing breakdown for each pipeline stage (milliseconds).

Link copied to clipboard
data class PreparedTransaction(val provenTxHex: String, val contractAddress: String, val circuitName: String, val timings: PipelineTimings)

Result of MidnightContract.prepare — a proven transaction ready for later submission via MidnightConfig.submit.

Link copied to clipboard
data class ProofData(val input: AlignedValue, val output: AlignedValue, val publicTranscriptJson: String, val privateTranscriptOutputs: List<AlignedValue>)

Proof data produced by a circuit execution.

Link copied to clipboard
interface ProofProvider

Generates ZK proofs for unproven transactions.

Link copied to clipboard

Thrown when ZK proof generation fails.

Link copied to clipboard

Abstracts the wallet operations needed to finalize a proven transaction: adding dust fee inputs (balancing) and submitting to the blockchain.

Link copied to clipboard
data class TransactionReceipt(val txHash: String?, val status: TransactionStatus, val timings: PipelineTimings, val provenTxHex: String)

Result of a successful MidnightContract.call.

Link copied to clipboard
Link copied to clipboard

How the witness's WitnessResult.data bytes should be presented to the Compact runtime when the witness function is called from JS.

Link copied to clipboard
fun interface WitnessProvider

Provides witness data for circuit execution.

Link copied to clipboard
data class WitnessResult(val privateState: Any?, val data: ByteArray, val kind: WitnessKind = WitnessKind.BYTES)

Result of a witness callback.

Link copied to clipboard
class WrongLedgerFieldTypeException(val fieldName: String, val expected: String, val actualValue: Any?) : Exception

Thrown when a typed accessor's expectation doesn't match what the contract's getter returned. Indicates schema drift, version mismatch, or a wrong-type call on the caller's side.