state.rs

mail@pastecode.io avatar
unknown
rust
2 years ago
525 B
2
Indexable
Never
use std::{collections::HashMap, hash::Hash};

use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use cosmwasm_std::{Timestamp};
use cw_storage_plus::Item;

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct State {
    pub owner: String,
    pub cards: HashMap<u32, HashMap<String, u32>>,
    pub uris: HashMap<u32, String>,
    pub allowances: HashMap<String, HashMap<String, Timestamp>>,
    pub total: u32
}

pub const STATE: Item<State> = Item::new("state");