Esempio n. 1
0
 def create_output_by_address():
     txoutputtype = TxOutputType()
     txoutputtype.amount = amount
     if _type == TYPE_SCRIPT:
         txoutputtype.script_type = OutputScriptType.PAYTOOPRETURN
         txoutputtype.op_return_data = trezor_validate_op_return_output_and_get_data(o)
     elif _type == TYPE_ADDRESS:
         txoutputtype.script_type = OutputScriptType.PAYTOADDRESS
         txoutputtype.address = address
     return txoutputtype
Esempio n. 2
0
 def create_output_by_address():
     txoutputtype = TxOutputType()
     txoutputtype.amount = amount
     if _type == TYPE_SCRIPT:
         txoutputtype.script_type = OutputScriptType.PAYTOOPRETURN
         txoutputtype.op_return_data = trezor_validate_op_return_output_and_get_data(
             o)
     elif _type == TYPE_ADDRESS:
         txoutputtype.script_type = OutputScriptType.PAYTOADDRESS
         txoutputtype.address = address
     return txoutputtype
Esempio n. 3
0
 def create_output_by_address():
     txoutputtype = TxOutputType()
     txoutputtype.amount = txout.value
     if address:
         txoutputtype.script_type = OutputScriptType.PAYTOADDRESS
         txoutputtype.address = address
     else:
         txoutputtype.script_type = OutputScriptType.PAYTOOPRETURN
         txoutputtype.op_return_data = trezor_validate_op_return_output_and_get_data(
             txout)
     return txoutputtype
Esempio n. 4
0
 def create_output_by_address():
     txoutputtype = TxOutputType()
     txoutputtype.amount = tx_output.value
     address = classify_tx_output(tx_output)
     if isinstance(address, Address):
         txoutputtype.script_type = OutputScriptType.PAYTOADDRESS
         txoutputtype.address = address.to_string(coin=Net.COIN)
     elif isinstance(address, OP_RETURN_Output):
         txoutputtype.script_type = OutputScriptType.PAYTOOPRETURN
         txoutputtype.op_return_data = validate_op_return(tx_output)
     return txoutputtype
Esempio n. 5
0
 def create_output_by_address(tx_output: XTxOutput) -> TxOutputType:
     txoutputtype = TxOutputType()
     txoutputtype.amount = tx_output.value
     address = classify_tx_output(tx_output)
     if isinstance(address, Address):
         txoutputtype.script_type = OutputScriptType.PAYTOADDRESS
         txoutputtype.address = address.to_string()
     return txoutputtype