Skip to main content

multiversx_sdk/data/transaction/
simulate_gas.rs

1use serde::{Deserialize, Serialize};
2
3/// Simplified decode of [`TxCostResponseData`](https://github.com/multiversx/mx-chain-proxy-go/blob/master/data/transaction.go)
4/// used when only the gas cost is needed from the `/transaction/cost` endpoint.
5#[derive(Debug, Clone, Serialize, Deserialize)]
6#[serde(rename_all = "camelCase")]
7pub struct SimulateGasTransactionData {
8    pub tx_gas_units: u64,
9}
10
11/// Simplified response envelope for the `/transaction/cost` endpoint when only gas units are needed.
12/// For the full response, use [`ResponseTxCost`](super::tx_cost::ResponseTxCost).
13#[derive(Debug, Clone, Serialize, Deserialize)]
14pub struct SimulateGasTransactionResponse {
15    pub error: String,
16    pub code: String,
17    pub data: Option<SimulateGasTransactionData>,
18}