Skip to main content

terra_sdk.core.tx

Data objects pertaining to building, signing, and parsing Transactions.

Tx Objects


_2
@attr.s
_2
class Tx(JSONSerializable)

Data structure for a transaction which can be broadcasted.

Arguments:

  • body TxBody - the processable content of the transaction
  • auth_info AuthInfo - the authorization related content of the transaction
  • signatures List[bytes] - signatures is a list of signatures that matches the length and order of body and auth_info

TxBody Objects


_2
@attr.s
_2
class TxBody(JSONSerializable)

Body of a transaction.

Arguments:

  • messages - list of messages to include in transaction
  • memo - transaction memo timeout_height:

AuthInfo Objects


_2
@attr.s
_2
class AuthInfo(JSONSerializable)

AuthInfo

Arguments:

  • signer_infos - information of the signers
  • fee - Fee

SignerInfo Objects


_2
@attr.s
_2
class SignerInfo(JSONSerializable)

SignerInfo

Arguments:

public_key (PublicKey) mode_info (ModeInfo) sequence (int)

TxLog Objects


_2
@attr.s
_2
class TxLog(JSONSerializable)

Object containing the events of a transaction that is automatically generated when :class:TxInfo or :class:BlockTxBroadcastResult objects are read.

msg_index

Number of the message inside the transaction that it was included in.

log

This field may be populated with details of the message's error, if any.

events

Raw event log data

events_by_type

Event log data, re-indexed by event type name and attribute type.

For instance, the event type may be: store_code and an attribute key could be code_id.

>>> logs[0].events_by_type["<event-type>"]["<attribute-key>"] ['<attribute-value>', '<attribute-value2>']

TxInfo Objects


_2
@attr.s
_2
class TxInfo(JSONSerializable)

Holds information pertaining to a transaction which has been included in a block on the blockchain.

.. note:: Users are not expected to create this object directly. It is returned by :meth:TxAPI.tx_info()&lt;terra_sdk.client.lcd.api.tx.TxAPI.tx_info&gt;

height

Block height at which transaction was included.

txhash

Transaction hash.

rawlog

Event log information as a raw JSON-string.

logs

Event log information.

gas_wanted

Gas requested by transaction.

gas_used

Actual gas amount used.

tx

Transaction object.

timestamp

Time at which transaction was included.

code

If this field is not None, the transaction failed at DeliverTx stage.

codespace

Error subspace (used alongside code).