multiversx_sdk/data/
esdt.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

// EsdtBalance  holds information about the esdt balance
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EsdtBalance {
    pub token_identifier: String,
    pub balance: String,
}

// EsdtBalanceDataholds the esdt balance data
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EsdtBalanceData {
    pub esdts: HashMap<String, EsdtBalance>,
}

// EsdtBalanceResponse holds the esdt balance endpoint response
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EsdtBalanceResponse {
    pub data: Option<EsdtBalanceData>,
    pub error: String,
    pub code: String,
}

// EsdtRolesData holds the esdt roles data
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EsdtRolesData {
    pub roles: HashMap<String, Vec<String>>,
}

// EsdtBalanceResponse holds the esdt roles endpoint response
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EsdtRolesResponse {
    pub data: Option<EsdtRolesData>,
    pub error: String,
    pub code: String,
}