chainline-contracts / chainline.contracts / HubContract / wallet_hasFunds

wallet_hasFunds

private fun ScriptHash.wallet_hasFunds(requiredBalance: Long, excludeRecipient: ScriptHash, nowTime: Int, countOutputs: Boolean): Boolean (source)

Check if the wallet has enough funds to perform a transaction after reserved funds and tx outputs are considered. Note: Please ensure that the script has been through wallet_validate before this is called.

Parameters

requiredBalance - the effective balance of the wallet required (after tx outputs counted)

countOutputs - count transaction outputs? this is unnecessary if this is a hub invocation (system fee already taken)

Return
true if the wallet's effective balance is greater than or equal to requiredBalance