Skip to content

cosmpy.aerial.tx_helpers

Transaction helpers.

MessageLog Objects

@dataclass
class MessageLog()

Message Log.

TxResponse Objects

@dataclass
class TxResponse()

Transaction response.

Raises:

  • OutOfGasError: Out of gas error
  • InsufficientFeesError: Insufficient fees
  • BroadcastError: Broadcast Exception

is_successful

def is_successful() -> bool

Check transaction is successful.

Returns:

transaction status

ensure_successful

def ensure_successful()

Ensure transaction is successful.

Raises:

  • OutOfGasError: Out of gas error
  • InsufficientFeesError: Insufficient fees
  • BroadcastError: Broadcast Exception

SubmittedTx Objects

class SubmittedTx()

Submitted transaction.

__init__

def __init__(client: "LedgerClient", tx_hash: str)

Init the Submitted transaction.

Arguments:

  • client: Ledger client
  • tx_hash: transaction hash

tx_hash

@property
def tx_hash() -> str

Get the transaction hash.

Returns:

transaction hash

response

@property
def response() -> Optional[TxResponse]

Get the transaction response.

Returns:

response

contract_code_id

@property
def contract_code_id() -> Optional[int]

Get the contract code id.

Returns:

return contract code id if exist else None

contract_address

@property
def contract_address() -> Optional[Address]

Get the contract address.

Returns:

return contract address if exist else None

wait_to_complete

def wait_to_complete(
    timeout: Optional[Union[int, float, timedelta]] = None,
    poll_period: Optional[Union[int, float,
                                timedelta]] = None) -> "SubmittedTx"

Wait to complete the transaction.

Arguments:

  • timeout: timeout, defaults to None
  • poll_period: poll_period, defaults to None

Returns:

Submitted Transaction