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[Account, LazyGradedVestingAccount]
-
Data¶
Account¶
Data objects pertaining to accounts.
-
class
terra_sdk.core.auth.data.account.
Account
(address, coins, public_key, account_number, sequence)[source]¶ Stores information about an account.
-
account_number
: int¶
-
address
: AccAddress¶
-
coins
: terra_sdk.core.coins.Coins¶
-
public_key
: terra_sdk.core.auth.data.public_key.PublicKey¶
-
sequence
: int¶
-
-
class
terra_sdk.core.auth.data.account.
LazyGradedVestingAccount
(address, coins, public_key, account_number, sequence, original_vesting, delegated_free, delegated_vesting, end_time, vesting_schedules)[source]¶ Stores information about an account with vesting.
-
account_number
: int¶
-
address
: AccAddress¶
-
coins
: terra_sdk.core.coins.Coins¶
-
delegated_free
: terra_sdk.core.coins.Coins¶
-
delegated_vesting
: terra_sdk.core.coins.Coins¶
-
end_time
: int¶
-
original_vesting
: terra_sdk.core.coins.Coins¶
-
public_key
: terra_sdk.core.auth.data.public_key.PublicKey¶
-
sequence
: int¶
-
to_data
()[source]¶ Converts the object to its JSON-serializable Python data representation.
- Return type
dict
-
vesting_schedules
: List[dict]¶
-
Transactions¶
Data objects pertaining to building, signing, and parsing Transactions.
-
class
terra_sdk.core.auth.data.tx.
StdFee
(gas, amount)[source]¶ Data structure holding information for a transaction fee.
- Parameters
gas (int) – gas to use (“gas requested”)
amount (Coins.Input) – fee amount
-
class
terra_sdk.core.auth.data.tx.
StdSignMsg
(chain_id, account_number, sequence, fee, msgs, memo)[source]¶ Data structure holding information which can be signed to create a
StdTx
.Note
This object can be considered an “unsigned transaction”.
- Parameters
chain_id (str) – chain ID
account_number (int) – account number
sequence (int) – sequence number
fee (StdFee) – transaction fee
msgs (List[Msg]) – list of messages to include
memo (str) – transaction memo
-
class
terra_sdk.core.auth.data.tx.
StdSignature
(signature, pub_key)[source]¶ Data structure holding information for a transaction signature.
-
pub_key
: Optional[terra_sdk.core.auth.data.public_key.PublicKey]¶ Signature’s public key information.
-
signature
: str¶ Actual signature contents.
-
-
class
terra_sdk.core.auth.data.tx.
StdTx
(msg, fee, signatures, memo)[source]¶ Data structure for a transaction which can be broadcasted.
- Parameters
msg (List[Msg]) – list of messages to include in transaction
fee (StdFee) – fee to use for transaction
signatures (List[StdSignature]) – list of signatures
memo (str) – transaction memo
-
class
terra_sdk.core.auth.data.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 atDeliverTx
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.auth.data.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.auth.data.tx.StdTx¶ Transaction object.
-
txhash
: str¶ Transaction hash.
-
-
class
terra_sdk.core.auth.data.tx.
TxLog
(msg_index, log, events)[source]¶ Object containing the events of a transaction that is automatically generated when
TxInfo
orBlockTxBroadcastResult
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 becode_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.auth.data.public_key.
PublicKey
(type, value)[source]¶ Data object holding the public key component of an account or signature.
-
MULTISIG
: str = 'tendermint/PubKeyMultisigThreshold'¶ Multisig public key type.
-
SIMPLE
: str = 'tendermint/PubKeySecp256k1'¶ Normal signature public key type.
-
to_data
()[source]¶ Converts the object to its JSON-serializable Python data representation.
- Return type
dict
-
type
: str¶ Either
PublicKey.SIMPLE
orPublicKey.MULTISIG
.
-
value
: Optional[Union[str, dict]]¶
-