buildUnshieldedWithdrawalJson

fun buildUnshieldedWithdrawalJson(recipientAddressHash: ByteArray, amount: BigInteger, tokenType: String = UtxoSpend.NATIVE_TOKEN_TYPE): String

Build the unshielded-withdrawal JSON for a contract call whose circuit SENDS value out via sendUnshielded (e.g. a treasury withdrawal). Pass the result to MidnightContract.call's unshieldedWithdrawalJson; the native assembler adds a fallible offer with the recipient output (no inputs, no signature — the contract provides the value). The recipientAddressHash MUST match the recipient the contract claims (verify.rs claimed_unshielded_spends).

Parameters

recipientAddressHash

the recipient's 32-byte UserAddress (Bech32m-decoded).

amount

base units the contract will send.

tokenType

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