pub mod delegated;
pub mod types;
#[allow(unused_imports)]
use types::*;
#[derive(Clone)]
pub struct SignersClient {
client: crate::client::Client,
}
impl SignersClient {
pub fn new(client: crate::client::Client) -> Self {
SignersClient { client }
}
pub async fn cancel_fleet_operation(
&self,
store_id: String,
body: CancelFleetOperationRequest,
) -> Result<CancelFleetOperationResponse, crate::error::Error> {
let path = format!(
"/key-stores/{}/fleet-operations/cancel",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request::<CancelFleetOperationResponse>(
reqwest::Method::POST,
&path,
Some(&body),
true,
)
.await
}
pub async fn create_add_mac_user_input(
&self,
store_id: String,
body: CreateAddMacUserInputRequest,
) -> Result<(), crate::error::Error> {
let path = format!(
"/key-stores/{}/add-mac-user/input",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_no_content(reqwest::Method::POST, &path, Some(&body), true)
.await
}
pub async fn create_add_provisioner_input(
&self,
store_id: String,
body: CreateAddProvisionerInputRequest,
) -> Result<(), crate::error::Error> {
let path = format!(
"/key-stores/{}/add-provisioner/input",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_no_content(reqwest::Method::POST, &path, Some(&body), true)
.await
}
pub async fn create_clone_input(
&self,
store_id: String,
body: CreateCloneInputRequest,
) -> Result<(), crate::error::Error> {
let path = format!("/key-stores/{}/clone/input", urlencoding::encode(&store_id));
let body = serde_json::to_value(&body)?;
self.client
.request_no_content(reqwest::Method::POST, &path, Some(&body), true)
.await
}
pub async fn create_genesis_input(
&self,
store_id: String,
body: CreateGenesisInputRequest,
) -> Result<(), crate::error::Error> {
let path = format!(
"/key-stores/{}/genesis/input",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_no_content(reqwest::Method::POST, &path, Some(&body), true)
.await
}
pub async fn create_key_harvest_input(
&self,
store_id: String,
body: CreateKeyHarvestInputRequest,
) -> Result<(), crate::error::Error> {
let path = format!(
"/key-stores/{}/key-harvest/input",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_no_content(reqwest::Method::POST, &path, Some(&body), true)
.await
}
pub async fn create_onchain_sign_input(
&self,
store_id: String,
body: CreateOnchainSignInputRequest,
) -> Result<(), crate::error::Error> {
let path = format!(
"/key-stores/{}/onchain-sign/input",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_no_content(reqwest::Method::POST, &path, Some(&body), true)
.await
}
pub async fn create_proof_of_control_input(
&self,
store_id: String,
body: CreateProofOfControlInputRequest,
) -> Result<(), crate::error::Error> {
let path = format!(
"/key-stores/{}/proof-of-control/input",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_no_content(reqwest::Method::POST, &path, Some(&body), true)
.await
}
pub async fn list_key_stores(&self) -> Result<ListKeyStoresResponse, crate::error::Error> {
let path = String::from("/key-stores");
self.client
.request::<ListKeyStoresResponse>(reqwest::Method::GET, &path, None, false)
.await
}
pub async fn list_signers(&self) -> Result<ListSignersResponse, crate::error::Error> {
let path = String::from("/signers");
self.client
.request::<ListSignersResponse>(reqwest::Method::GET, &path, None, false)
.await
}
pub async fn submit_add_mac_user_output(
&self,
store_id: String,
body: SubmitAddMacUserOutputRequest,
file: crate::client::MultipartFile,
) -> Result<SubmitAddMacUserOutputResponse, crate::error::Error> {
let path = format!(
"/key-stores/{}/add-mac-user/output",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_multipart::<SubmitAddMacUserOutputResponse>(
reqwest::Method::POST,
&path,
Some(&body),
file,
true,
)
.await
}
pub async fn submit_add_provisioner_output(
&self,
store_id: String,
body: SubmitAddProvisionerOutputRequest,
file: crate::client::MultipartFile,
) -> Result<SubmitAddProvisionerOutputResponse, crate::error::Error> {
let path = format!(
"/key-stores/{}/add-provisioner/output",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_multipart::<SubmitAddProvisionerOutputResponse>(
reqwest::Method::POST,
&path,
Some(&body),
file,
true,
)
.await
}
pub async fn submit_clone_output(
&self,
store_id: String,
body: SubmitCloneOutputRequest,
file: crate::client::MultipartFile,
) -> Result<SubmitCloneOutputResponse, crate::error::Error> {
let path = format!(
"/key-stores/{}/clone/output",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_multipart::<SubmitCloneOutputResponse>(
reqwest::Method::POST,
&path,
Some(&body),
file,
true,
)
.await
}
pub async fn submit_genesis_output(
&self,
store_id: String,
body: SubmitGenesisOutputRequest,
file: crate::client::MultipartFile,
) -> Result<SubmitGenesisOutputResponse, crate::error::Error> {
let path = format!(
"/key-stores/{}/genesis/output",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_multipart::<SubmitGenesisOutputResponse>(
reqwest::Method::POST,
&path,
Some(&body),
file,
true,
)
.await
}
pub async fn submit_key_harvest_output(
&self,
store_id: String,
body: SubmitKeyHarvestOutputRequest,
file: crate::client::MultipartFile,
) -> Result<SubmitKeyHarvestOutputResponse, crate::error::Error> {
let path = format!(
"/key-stores/{}/key-harvest/output",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_multipart::<SubmitKeyHarvestOutputResponse>(
reqwest::Method::POST,
&path,
Some(&body),
file,
true,
)
.await
}
pub async fn submit_onchain_sign_output(
&self,
store_id: String,
body: SubmitOnchainSignOutputRequest,
file: crate::client::MultipartFile,
) -> Result<SubmitOnchainSignOutputResponse, crate::error::Error> {
let path = format!(
"/key-stores/{}/onchain-sign/output",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_multipart::<SubmitOnchainSignOutputResponse>(
reqwest::Method::POST,
&path,
Some(&body),
file,
true,
)
.await
}
pub async fn submit_proof_of_control_output(
&self,
store_id: String,
body: SubmitProofOfControlOutputRequest,
file: crate::client::MultipartFile,
) -> Result<SubmitProofOfControlOutputResponse, crate::error::Error> {
let path = format!(
"/key-stores/{}/proof-of-control/output",
urlencoding::encode(&store_id)
);
let body = serde_json::to_value(&body)?;
self.client
.request_multipart::<SubmitProofOfControlOutputResponse>(
reqwest::Method::POST,
&path,
Some(&body),
file,
true,
)
.await
}
}