def fee(self, value=None, unit='<STR_LIT>'):
convert = None<EOL>if not value:<EOL><INDENT>convert = get_current_price(self.crypto, "<STR_LIT>")<EOL>self.fee_satoshi = int(<NUM_LIT> / convert * <NUM_LIT>)<EOL>verbose = "<STR_LIT>"<EOL><DEDENT>elif value == '<STR_LIT>':<EOL><INDENT>self.fee_satoshi = get_optimal_fee(<EOL>self.crypto, self.estimate_size(), verbose=self.verbose<EOL>)<EOL>verbose = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>self.fee_satoshi = self.from_unit_to_satoshi(value, unit)<EOL>verbose = "<STR_LIT>"<EOL><DEDENT>if self.verbose:<EOL><INDENT>if not convert:<EOL><INDENT>convert = get_current_price(self.crypto, "<STR_LIT>")<EOL><DEDENT>fee_dollar = convert * self.fee_satoshi / <NUM_LIT><EOL>print(verbose + "<STR_LIT>" % (self.fee_satoshi, fee_dollar))<EOL><DEDENT>
Set the miner fee, if unit is not set, assumes value is satoshi.
If using 'optimal', make sure you have already added all outputs.