buildUnshieldedFundingJson

suspend fun buildUnshieldedFundingJson(amount: BigInteger, tokenType: String = UtxoSpend.NATIVE_TOKEN_TYPE): String

Build the unshielded-funding JSON that lets a contract call fund the value a contract receives via receiveUnshielded (e.g. a treasury deposit). Pass the result to MidnightContract.call's unshieldedFundingJson; the native assembler adds + signs a guaranteed offer whose inputs cover amount (+ change back to this wallet).

Selects the wallet's NIGHT UTXOs largest-first from the live set (no lock — mirrors the send path's nightDescending() read; a locked selection is a tracked follow-up). Throws InsufficientFundsException when the wallet can't cover amount.

Parameters

amount

base units the contract will receive.

tokenType

32-byte token color hex (default: native NIGHT).