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
Properties
HD derivation path of the access key (e.g., "m/44'/2400'/0'/5/0").
Access key for sigil identity — 33-byte compressed secp256k1 public key. Use this with KeyAuthorization to build delegation payloads.
Coin public key for circuit execution (32 bytes).
MidnightConfig pre-wired with the embedded wallet.
Proving key manager (for checking/downloading keys).
Shielded receive address (Bech32m-encoded, HRP mn_shield-addr_<network>).
Embedded wallet for direct balance/submit operations.
Unshielded wallet address (Bech32m-encoded).