| 127 | } |
| 128 | |
| 129 | pub async fn get_key( |
| 130 | &self, |
| 131 | path: Option<String>, |
| 132 | purpose: Option<String>, |
| 133 | ) -> Result<GetKeyResponse> { |
| 134 | let data = json!({ |
| 135 | "path": path.unwrap_or_default(), |
| 136 | "purpose": purpose.unwrap_or_default(), |
| 137 | "algorithm": "secp256k1", // Default or specify as needed |
| 138 | }); |
| 139 | let response = self.send_rpc_request("/GetKey", &data).await?; |
| 140 | let response = serde_json::from_value::<GetKeyResponse>(response)?; |
| 141 | |
| 142 | Ok(response) |
| 143 | } |
| 144 | |
| 145 | pub async fn get_quote(&self, report_data: Vec<u8>) -> Result<GetQuoteResponse> { |
| 146 | if report_data.is_empty() || report_data.len() > 64 { |