Skip to main content

blockfrost_openapi/models/
script_json.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5pub struct ScriptJson {
6    /// JSON contents of the `timelock` script, null for `plutus` scripts
7    #[serde(rename = "json", deserialize_with = "Option::deserialize")]
8    pub json: Option<serde_json::Value>,
9}
10
11impl ScriptJson {
12    pub fn new(json: Option<serde_json::Value>) -> ScriptJson {
13        ScriptJson {
14            json,
15        }
16    }
17}
18