txCompleter

abstract fun txCompleter(tx: iTransaction, minConfirms: Int, flags: Int, inputAmount: Long? = null, adjustableOutput: Int? = null, destinationAddress: PayAddress? = null, changeAddress: PayAddress? = null, sigHashTypeOverride: ByteArray? = null, contractId: ByteArray? = null)

Modify the passed transaction to complete it to the extent possible by this wallet.

Operations include: Find inputs needed to supply satoshis and/or group tokens for this transaction. If change outputs are required, add them. If mint baton passing outputs are possible then add them if equalizeAuthorities=true If outputs are not fully specified, supply the missing constraints. The order of inputs and outputs is NOT changed.

Parameters

tx

: The transaction to complete

inputAmount

: if inputAmount is non-null, assume existing inputs supply this number of satoshis. The code will not look up any inputs to discover the input amount. Note that you can use this field to under-add the existing inputs to provide extra coins for change. You can even set this field to a negative number if you have provided no inputs, but want the system to provide extra coin for fees. This is commonly done when the provided txCompleter will produce a partial transaction but you want this phase to supply enough fee to cover subsequent completion.

flags

: bit map of TxCompletionFlags that must be set

useAuthorities

: If useAuthorities = true, pull in authorities if needed (and available) to handle (mint/melt) operations

fund

: If fund = true, add native crypto inputs to pay for the transaction

adjustableOutput

: Based on the flags, this output may be adjusted for fee or surplus (coming out of tokens). Pass a null if any adjustment should error.

destinationAddress

: If null, any missing output templates will substitute a new address from the wallet. If non-null output substitutions will use this address.

changeAddress

: Send any change, either tokens or native, here. If null, a new address is created from the wallet

sigHashTypeOverride

: if non-null all signatures will use this as their sighashtype field

contractId

Use this contract id if non-null. Otherwise (default is null) select inputs with no associated contract.