Skip to main content

multiversx_sdk/data/transaction/
tx_cost.rs

1use serde::{Deserialize, Serialize};
2
3/// Follows the format of the data field of a transaction cost request.
4///
5/// Corresponds to [`TxCostResponseData`](https://github.com/multiversx/mx-chain-proxy-go/blob/master/data/transaction.go) in mx-chain-proxy-go.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct TxCostResponseData {
9    pub tx_gas_units: u64,
10    pub return_message: String,
11}
12
13/// Defines a response from the node holding the transaction cost.
14///
15/// Corresponds to [`ResponseTxCost`](https://github.com/multiversx/mx-chain-proxy-go/blob/master/data/transaction.go) in mx-chain-proxy-go.
16#[derive(Debug, Clone, Serialize, Deserialize)]
17#[serde(rename_all = "camelCase")]
18pub struct ResponseTxCost {
19    pub data: Option<TxCostResponseData>,
20    pub error: String,
21    pub code: String,
22}