terra_sdk.client.lcd.api.tx
SignerOptions Objects
_2@attr.s_2class SignerOptions()
SignerOptions specifies infomations about signers
Arguments:
addressAccAddress - address of the signersequenceint, optional - nonce of the messages from the signerpublic_keyPublicKey, optional - signer's PublicKey
CreateTxOptions Objects
_2@attr.s_2class CreateTxOptions()
Arguments:
msgsList[Msg] - list of messages to includefeeOptional[Fee], optional - transaction fee. IfNone, will be estimated. See more onfee estimation_.memostr, optional - optional short string to include with transaction.gasstr, optional - gas limit to set per-transaction; set to "auto" to calculate sufficient gas automaticallygas_pricesCoins.Input, optional - gas prices for fee estimation.gas_adjustmentNumeric.Input, optional - gas adjustment for fee estimation.fee_denomsList[str], optional - list of denoms to use for fee after estimation.account_numberint, optional - account number (overrides blockchain query if provided)sequenceint, optional - sequence (overrides blockchain qu ery if provided)timeout_heightint, optional - specifies a block timeout height to prevent the tx from being committed past a certain height.sign_mode- (SignMode, optional): SignMode.SIGN_MODE_DIRECT by default. multisig needs SignMode.SIGN_MODE_LEGACY_AMINO_JSON.
AsyncTxAPI Objects
_1class AsyncTxAPI(BaseAsyncAPI)
tx_info
_1async def tx_info(tx_hash: str) -> TxInfo
Fetches information for an included transaction given a tx hash.
Arguments:
tx_hashstr - hash of transaction to lookup
Returns:
TxInfo- transaction info
create
_1async def create(signers: List[SignerOptions], options: CreateTxOptions) -> Tx
Create a new unsigned transaction, with helpful utilities such as lookup of chain ID, account number, sequence and fee estimation.
Arguments:
signersList[SignerOptions] - options about signersoptionsCreateTxOptions - options about creating a tx
Returns:
Tx- unsigned tx
estimate_fee
_1async def estimate_fee(signers: List[SignerOptions], options: CreateTxOptions) -> Fee
Estimates the proper fee to apply by simulating it within the node.
Arguments:
signers[SignerOptions] - signersoptionsCreateTxOptions - transaction info to estimate fee
Returns:
Fee- estimated fee
encode
_1async def encode(tx: Tx) -> str
Encode a Tx to base64 encoded proto string
decode
_1async def decode(tx: str) -> Tx
Decode base64 encoded proto string to a Tx
hash
_1async def hash(tx: Tx) -> str
Compute hash for a transaction.
Arguments:
txTx - transaction to hash
Returns:
str- transaction hash
broadcast_sync
_1async def broadcast_sync(tx: Tx, options: BroadcastOptions = None) -> SyncTxBroadcastResult
Broadcasts a transaction using the sync broadcast mode.
Arguments:
txTx - transaction to broadcastoptionsBroadcastOptions - broacast options, optional
Returns:
SyncTxBroadcastResult- result
broadcast_async
_1async def broadcast_async(tx: Tx, options: BroadcastOptions = None) -> AsyncTxBroadcastResult
Broadcasts a transaction using the async broadcast mode.
Arguments:
txTx - transaction to broadcastoptionsBroadcastOptions - broacast options, optional
Returns:
AsyncTxBroadcastResult- result
broadcast
_1async def broadcast(tx: Tx, options: BroadcastOptions = None) -> BlockTxBroadcastResult
Broadcasts a transaction using the block broadcast mode.
Arguments:
txTx - transaction to broadcastoptionsBroadcastOptions - broacast options, optional
Returns:
BlockTxBroadcastResult- result
search
_1async def search(events: List[list], params: Optional[APIParams] = None) -> dict
Searches for transactions given criteria.
Arguments:
eventsdict - dictionary containing optionsparamsAPIParams - optional parameters
Returns:
dict- transaction search results
tx_infos_by_height
_1async def tx_infos_by_height(height: Optional[int] = None) -> List[TxInfo]
Fetches information for an included transaction given block height or latest
Arguments:
heightint, optional - height to lookup. latest if height is None.
Returns:
List[TxInfo]- transaction info