dfns_sdk_rs/api/signers/
client.rs1use super::types::*;
4use crate::{
5 models::generic::DfnsApiClientOptions,
6 utils::{
7 fetch::simple_fetch,
8 url::{build_path_and_query, PathAndQueryParams},
9 },
10};
11use std::collections::HashMap;
12
13#[derive(Debug, Clone, PartialEq)]
14pub struct SignersClient {
15 api_options: DfnsApiClientOptions,
16}
17
18impl SignersClient {
19 pub fn new(api_options: DfnsApiClientOptions) -> Self {
20 Self { api_options }
21 }
22
23 pub async fn list_signers(&self) -> Result<ListSignersResponse, crate::error::DfnsError> {
24 let path = build_path_and_query(
25 "/signers",
26 &PathAndQueryParams {
27 path: HashMap::new(),
28 query: HashMap::new(),
29 },
30 );
31
32 simple_fetch(
33 &path,
34 crate::utils::fetch::FetchOptions {
35 method: crate::utils::fetch::HttpMethod::GET,
36 headers: None,
37 body: None,
38 api_options: self.api_options.base.clone(),
39 },
40 )
41 .await
42 }
43}