Auth

Note

Data objects are also aliased under at terra_sdk.core.auth.

API

class terra_sdk.client.lcd.api.auth.AuthAPI(c)[source]
account_info(address)[source]

Fetches the account information.

Parameters

address (AccAddress) – account address

Returns

account information

Return type

Union[BaseAccount, LazyGradedVestingAccount]

Data

Account

class terra_sdk.core.auth.data.account.Account[source]

Transactions

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

class terra_sdk.core.tx.AuthInfo(signer_infos, fee)[source]
Parameters
  • signer_infos – information of the signers

  • fee (Fee) – Fee

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

class terra_sdk.core.tx.SignMode(value)[source]

SignMode represents a signing mode with its own security guarantees.

class terra_sdk.core.tx.SignerInfo(public_key, mode_info, sequence)[source]

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

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

class terra_sdk.core.tx.Tx(body, auth_info, signatures)[source]

Data structure for a transaction which can be broadcasted.

Parameters
  • body (TxBody) – the processable content of the transaction

  • auth_info (AuthInfo) – the authorization related content of the transaction

  • signatures – signatures is a list of signatures that matches the length and order of body and auth_info

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

class terra_sdk.core.tx.TxBody(messages, memo='', timeout_height=None)[source]

Body of a transaction.

Parameters
  • messages (List[Msg]) – list of messages to include in transaction

  • memo (Optional[str]) – transaction memo

  • timeout_height (Optional[int]) –

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

class terra_sdk.core.tx.TxInfo(height, txhash, rawlog, logs, gas_wanted, gas_used, tx, timestamp, code=None, codespace=None)[source]

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 TxAPI.tx_info()

code: Optional[int]

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

codespace: Optional[str]

Error subspace (used alongside code).

gas_used: int

Actual gas amount used.

gas_wanted: int

Gas requested by transaction.

height: int

Block height at which transaction was included.

logs: Optional[List[terra_sdk.core.tx.TxLog]]

Event log information.

rawlog: str

Event log information as a raw JSON-string.

timestamp: str

Time at which transaction was included.

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

tx: terra_sdk.core.tx.Tx

Transaction object.

txhash: str

Transaction hash.

class terra_sdk.core.tx.TxLog(msg_index, log, events)[source]

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

events: List[dict]

Raw event log data

events_by_type: Dict[str, Dict[str, List[str]]]

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>']
log: str

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

msg_index: int

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

Public Key

class terra_sdk.core.public_key.LegacyAminoMultisigPublicKey(threshold, public_keys=NOTHING)[source]

Data object holding the Legacy Amino-typed public key component of an account or signature.

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

type_amino = 'tendermint/PubKeyMultisigThreshold'
type_url = '/cosmos.crypto.multisig.LegacyAminoPubKey'

Multisig public key type.

class terra_sdk.core.public_key.PublicKey[source]

Data object holding the public key component of an account or signature.

abstract to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

class terra_sdk.core.public_key.SimplePublicKey(key)[source]

Data object holding the SIMPLE public key component of an account or signature.

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

type_amino = 'tendermint/PubKeySecp256k1'
type_url = '/cosmos.crypto.secp256k1.PubKey'

Normal signature public key type.

class terra_sdk.core.public_key.ValConsPubKey(key)[source]

Data object holding the public key component of an validator’s account or signature.

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

type_amino = 'tendermint/PubKeyEd25519'
type_url = '/cosmos.crypto.ed25519.PubKey'

an ed25519 tendermint public key type.