MidnightSdk

Top-level entry point for the Midnight Android SDK.

Provides a fully standalone environment for dApps: contract execution, local proving, embedded wallet (dust fee payment), and node submission. No external wallet process (mn serve) required.

val sdk = MidnightSdk.Builder(context)
.network(MidnightNetwork.PREPROD)
.seed(mnemonicSeed)
.build()

val contract = MidnightContract.create(sdk.config) {
contractJs = assets.open("runtime/my-contract-iife.js")
address = contractAddress
coinPublicKey = sdk.coinPublicKey
// ... witnesses, private state
}

val receipt = contract.call("myCircuit", arg1) // Fully standalone
sdk.close()

Types

Link copied to clipboard
class Builder(context: Context)

Builder for MidnightSdk.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

HD derivation path of the access key (e.g., "m/44'/2400'/0'/5/0").

Link copied to clipboard

Access key for sigil identity — 33-byte compressed secp256k1 public key. Use this with KeyAuthorization to build delegation payloads.

Link copied to clipboard

Coin public key for circuit execution (32 bytes).

Link copied to clipboard

MidnightConfig pre-wired with the embedded wallet.

Link copied to clipboard

Proving key manager (for checking/downloading keys).

Link copied to clipboard

Shielded receive address (Bech32m-encoded, HRP mn_shield-addr_<network>).

Link copied to clipboard

Embedded wallet for direct balance/submit operations.

Link copied to clipboard

Unshielded wallet address (Bech32m-encoded).

Functions

Link copied to clipboard
fun close()

Release all resources.

Link copied to clipboard

Register this wallet's NIGHT key to generate dust against its public dust key.