Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some API models fixed according to schema #21

Merged
merged 5 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/client/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ impl Maestro {
params: Option<HashMap<String, String>>,
) -> Result<TransactionOutputFromReference, Box<dyn Error>> {
let formatted_params = params.map_or("".to_string(), |p| {
p.iter()
"?".to_string() + p.iter()
.map(|(k, v)| format!("{}={}", k, v))
.collect::<Vec<String>>()
.join("&")
.to_string()
.as_str()
});
let url = format!(
"/transactions/{}/outputs/{}/txo{}",
Expand Down
6 changes: 3 additions & 3 deletions src/models/addresses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ pub struct Utxo {
pub assets: Vec<Asset>,
pub datum: Option<HashMap<String, serde_json::Value>>,
pub index: i64,
pub reference_script: ReferenceScript,
pub reference_script: Option<ReferenceScript>,
pub tx_hash: String,
pub slot: i64,
#[serde(alias="txout_cbor")]
pub tx_out_cbor: String,
}

#[derive(Deserialize)]
pub struct ReferenceScript {
pub bytes: String,
pub hash: String,
pub json: HashMap<String, serde_json::Value>,
pub json: Option<HashMap<String, serde_json::Value>>,
pub r#type: String,
}

Expand Down
Loading