def get_hex(self, signed=True):
total_ins_satoshi = self.total_input_satoshis()<EOL>if total_ins_satoshi == <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>total_outs_satoshi = sum([x['<STR_LIT:value>'] for x in self.outs])<EOL>if not self.fee_satoshi:<EOL><INDENT>self.fee() <EOL><DEDENT>change_satoshi = total_ins_satoshi - (total_outs_satoshi + self.fee_satoshi)<EOL>if change_satoshi < <NUM_LIT:0>:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>% (total_ins_satoshi, total_outs_satoshi, self.fee_satoshi, self.crypto.upper())<EOL>)<EOL><DEDENT>ins = [x['<STR_LIT:input>'] for x in self.ins]<EOL>if change_satoshi > <NUM_LIT:0>:<EOL><INDENT>if self.verbose:<EOL><INDENT>print("<STR_LIT>" % (change_satoshi, self.change_address))<EOL><DEDENT>change = [{'<STR_LIT:value>': change_satoshi, '<STR_LIT:address>': self.change_address}]<EOL><DEDENT>else:<EOL><INDENT>change = [] <EOL>if self.verbose: print("<STR_LIT>")<EOL><DEDENT>tx = mktx(ins, self.outs + change)<EOL>if signed:<EOL><INDENT>for i, input_data in enumerate(self.ins):<EOL><INDENT>if not input_data['<STR_LIT>']:<EOL><INDENT>raise Exception("<STR_LIT>" % i)<EOL><DEDENT>tx = sign(tx, i, input_data['<STR_LIT>'])<EOL><DEDENT><DEDENT>return tx<EOL>
Given all the data the user has given so far, make the hex using pybitcointools