build

fun build(nightPrivateKey: ByteArray, dustPublicKeyHex: String, utxosJson: String, ttlMillis: Long, networkId: String, currentTimeMillis: Long = System.currentTimeMillis(), ledgerParamsHex: String? = null): DustRegistrationBuilder.Result

Builds a complete dust registration transaction.

Creates and signs a transaction that registers the given NIGHT address for dust generation with the specified DustPublicKey. Includes the user's NIGHT UTXOs as a guaranteed UnshieldedOffer.

Return

a Result: Result.Built on success, Result.NotMatured when the coin is too fresh to self-pay, Result.Failed on any other error.

Parameters

nightPrivateKey

32-byte NIGHT address signing key

dustPublicKeyHex

Hex-encoded DustPublicKey (from DustKeyDeriver)

utxosJson

JSON array of NIGHT UTXOs: {"value":"...","intent_hash":"...","output_no":N}

ttlMillis

Transaction time-to-live in milliseconds since epoch

networkId

Target network id (HRP-less), e.g. "undeployed"/"preprod"

currentTimeMillis

Current time in milliseconds since epoch

ledgerParamsHex

Hex-encoded SCALE ledger parameters from the indexer (getCurrentBlockWithParams().ledgerParameters). When supplied, the native builder gates on coin maturity and returns Result.NotMatured for a too-fresh coin. Pass null only where no params are available (the gate is then skipped).

Throws

if nightPrivateKey is not 32 bytes