Transactions
API
- class terra_sdk.client.lcd.api.tx.TxAPI(c)[source]
- broadcast(tx, options=None)[source]
Broadcasts a transaction using the
block
broadcast mode.- Parameters
tx (Tx) – transaction to broadcast
options (BroadcastOptions) – broacast options, optional
- Returns
result
- Return type
- broadcast_async(tx, options=None)[source]
Broadcasts a transaction using the
async
broadcast mode.- Parameters
tx (Tx) – transaction to broadcast
options (BroadcastOptions) – broacast options, optional
- Returns
result
- Return type
- broadcast_sync(tx, options=None)[source]
Broadcasts a transaction using the
sync
broadcast mode.- Parameters
tx (Tx) – transaction to broadcast
options (BroadcastOptions) – broacast options, optional
- Returns
result
- Return type
- create(signers, options)[source]
Create a new unsigned transaction, with helpful utilities such as lookup of chain ID, account number, sequence and fee estimation.
- Parameters
signers (List[SingerOptions]) – options about signers
options (CreateTxOptions) – options about creating a tx
- Returns
unsigned tx
- Return type
- estimate_fee(signers, options)[source]
Estimates the proper fee to apply by simulating it within the node.
- Parameters
signers ([SignerOptions]) – signers
options (CreateTxOptions) – transaction info to estimate fee
- Returns
estimated fee
- Return type
Fee
- hash(tx)[source]
Compute hash for a transaction.
- Parameters
tx (Tx) – transaction to hash
- Returns
transaction hash
- Return type
str
- search(events, params=None)[source]
Searches for transactions given criteria.
- Parameters
events (dict) – dictionary containing options
params (APIParams) – optional parameters
- Returns
transaction search results
- Return type
dict
Functions
Data
Transaction broadcast result data types.
- class terra_sdk.core.broadcast.AsyncTxBroadcastResult(txhash)[source]
Data object that contains the response result from node after transaction has been broadcasted with the
sync
broadcast mode.- txhash: str
Transaction hash.
- class terra_sdk.core.broadcast.BlockTxBroadcastResult(height, txhash, raw_log, gas_wanted, gas_used, logs, code=None, codespace=None, info=None, data=None, timestamp=None)[source]
Data object that contains the response result from node after transaction has been broadcasted with the
block
broadcast mode.- code: Optional[int]
If this is present, the transaction failed.
- codespace: Optional[str]
used alongside
code
.- Type
Error subspace name
- data: Optional[str]
- gas_used: int
Actual amount of gas consumed by transaction.
- gas_wanted: int
Gas requested by the transaction.
- height: int
Height at which transaction was included.
- info: Optional[str]
- logs: Optional[List[terra_sdk.core.tx.TxLog]]
List of transaction logs.
- raw_log: Optional[str]
Raw JSON of transaction events.
- timestamp: Optional[str]
timestamp
- txhash: str
Transaction hash.
- class terra_sdk.core.broadcast.SyncTxBroadcastResult(txhash, raw_log, code=None, codespace=None)[source]
Data object that contains the response result from node after transactionco has been broadcasted with the
sync
broadcast mode.- code: Optional[int]
If this is present, the transaction failed.
- codespace: Optional[str]
used alongside
code
.- Type
Error subspace name
- raw_log: Optional[str]
Raw JSON of transaction events.
- txhash: str
Transaction hash.