Skip to content

Commit

Permalink
Merge pull request #21 from oskin1/main
Browse files Browse the repository at this point in the history
Some API models fixed according to schema
  • Loading branch information
Vardominator authored Apr 5, 2024
2 parents 107bca4 + 8593c04 commit 508cd20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 508cd20

Please sign in to comment.