Transactions Output#

TxOutput#

class defichain.transactions.rawtransactions.TxOutput(value: int, script: str, tokenId: int)#
static deserialize(network: Any, hex: str) TxOutput#

Deserializes a transaction output into an output object: TxAddressOutput | TxDataOutput | TxDefiOutput | TxCoinbaseOutput.

Parameters:
  • network (Network) – (required) the corresponding network from the raw transaction

  • hex (str) – (required) the raw transaction output as hexadecimal sting

Returns:

“TxInput”

to_json() {}#

Returns information about the transaction object in json format :return: “{}” - information about the object that was used to call this method

TxAddressOutput#

class defichain.transactions.rawtransactions.TxAddressOutput(value: int, address: str, tokenId: int = 0)#

An output that specifies the address to which the UXTO of the inpus should be sent

Parameters:
  • value (int) – (required) how many UTXO to send

  • address (str) – (required) address to send the UTXO to

  • tokenId (int) – (optional) which token you want to send (almost always 0 -> stands for DFI)

static deserialize(network: Any, hex: str) TxAddressOutput#

Deserializes a transaction output into an output object: TxAddressOutput | TxDataOutput | TxDefiOutput | TxCoinbaseOutput.

Parameters:
  • network (Network) – (required) the corresponding network from the raw transaction

  • hex (str) – (required) the raw transaction output as hexadecimal sting

Returns:

“TxInput”

to_json() {}#

Returns information about the transaction object in json format :return: “{}” - information about the object that was used to call this method

TxDefiOutput#

class defichain.transactions.rawtransactions.TxDefiOutput(value, defiTx: BaseDefiTx, tokenId: int = 0)#

An Output witch includes a defi transaction.

For example a “Poolswap” or “AddPoolLiquidity”

Parameters:
  • value (int) – (required) how many UTXO to send (almost always zero)

  • defiTx (DefiTx) – (required) a DefiTx Object

  • tokenId (int) – (optional) which token you want to send (almost always 0 -> stands for DFI)

static deserialize(network: Any, hex: str) TxDefiOutput#

Deserializes a transaction output into an output object: TxAddressOutput | TxDataOutput | TxDefiOutput | TxCoinbaseOutput.

Parameters:
  • network (Network) – (required) the corresponding network from the raw transaction

  • hex (str) – (required) the raw transaction output as hexadecimal sting

Returns:

“TxInput”

to_json() {}#

Returns information about the transaction object in json format :return: “{}” - information about the object that was used to call this method

TxCoinbaseOutput#

class defichain.transactions.rawtransactions.TxCoinbaseOutput(script: str)#

An output that is specified with every coinbase transaction.

Parameters:

script (str) – (required) Coinbase specific output

static deserialize(network: Any, hex: str) TxCoinbaseOutput#

Deserializes a transaction output into an output object: TxAddressOutput | TxDataOutput | TxDefiOutput | TxCoinbaseOutput.

Parameters:
  • network (Network) – (required) the corresponding network from the raw transaction

  • hex (str) – (required) the raw transaction output as hexadecimal sting

Returns:

“TxInput”

to_json() {}#

Returns information about the transaction object in json format :return: “{}” - information about the object that was used to call this method