createDustSpend

fun createDustSpend(statePtr: Long, seed: ByteArray, utxoIndex: Int, vFee: BigInteger, currentTimeMs: Long = System.currentTimeMillis()): DustSpendCreator.DustSpend?

Creates a DustSpend action for fee payment.

Parameters:

  • statePtr: Pointer to DustLocalState (from DustRepository.deserializeState())

  • seed: 32-byte seed for deriving DustSecretKey

  • utxoIndex: Index of UTXO to spend (0-based)

  • vFee: Fee amount in Specks

  • currentTimeMs: Current time for timestamp (System.currentTimeMillis())

Important:

  • UTXO must exist at the given index

  • UTXO must have sufficient value to cover fee

  • Change will be calculated as: utxo.value - vFee

Return

DustSpend object, or null on error

Parameters

statePtr

Pointer to deserialized DustLocalState

seed

32-byte seed array

utxoIndex

Index of UTXO to spend

vFee

Fee amount in Specks

currentTimeMs

Current time in milliseconds

Throws

if seed is not 32 bytes