def get_optimal_fee(crypto, tx_bytes, **modes):
try:<EOL><INDENT>services = get_optimal_services(crypto, '<STR_LIT>')<EOL><DEDENT>except NoServicesDefined:<EOL><INDENT>convert = get_current_price(crypto, '<STR_LIT>')<EOL>fee = int(<NUM_LIT> / convert * <NUM_LIT>)<EOL>if modes.get('<STR_LIT>'):<EOL><INDENT>return [None], fee<EOL><DEDENT>else:<EOL><INDENT>return fee<EOL><DEDENT><DEDENT>fee = enforce_service_mode(<EOL>services, OptimalFee, dict(crypto=crypto, tx_bytes=tx_bytes), modes=modes<EOL>)<EOL>if modes.get('<STR_LIT>'):<EOL><INDENT>return fee[<NUM_LIT:0>], int(fee[<NUM_LIT:1>])<EOL><DEDENT>else:<EOL><INDENT>return int(fee)<EOL><DEDENT>
Get the optimal fee based on how big the transaction is. Currently this
is only provided for BTC. Other currencies will return $0.02 in satoshi.