Skip to main content

dfns_sdk_rust/
lib.rs

1// Code generated by rust-sdk-generator. crate root (module wiring is generated).
2
3pub mod client;
4pub mod error;
5pub mod signer;
6pub mod types;
7
8pub mod address_watches;
9pub mod agreements;
10pub mod allocations;
11pub mod auth;
12pub mod exchanges;
13pub mod fee_sponsors;
14pub mod keys;
15pub mod networks;
16pub mod payins;
17pub mod payouts;
18pub mod permissions;
19pub mod policies;
20pub mod signers;
21pub mod staking;
22pub mod swaps;
23pub mod vaults;
24pub mod wallets;
25pub mod webhooks;
26
27pub use client::{Client, MultipartFile, Options};
28pub use error::Error;
29
30/// Aggregate entry point exposing every domain client over one transport.
31#[derive(Clone)]
32pub struct DfnsClient {
33    pub address_watches: address_watches::AddressWatchesClient,
34    pub agreements: agreements::AgreementsClient,
35    pub allocations: allocations::AllocationsClient,
36    pub auth: auth::AuthClient,
37    pub exchanges: exchanges::ExchangesClient,
38    pub fee_sponsors: fee_sponsors::FeeSponsorsClient,
39    pub keys: keys::KeysClient,
40    pub networks: networks::NetworksClient,
41    pub payins: payins::PayinsClient,
42    pub payouts: payouts::PayoutsClient,
43    pub permissions: permissions::PermissionsClient,
44    pub policies: policies::PoliciesClient,
45    pub signers: signers::SignersClient,
46    pub staking: staking::StakingClient,
47    pub swaps: swaps::SwapsClient,
48    pub vaults: vaults::VaultsClient,
49    pub wallets: wallets::WalletsClient,
50    pub webhooks: webhooks::WebhooksClient,
51}
52
53impl DfnsClient {
54    pub fn new(options: Options) -> Result<Self, Error> {
55        let client = Client::new(options)?;
56        Ok(DfnsClient {
57            address_watches: address_watches::AddressWatchesClient::new(client.clone()),
58            agreements: agreements::AgreementsClient::new(client.clone()),
59            allocations: allocations::AllocationsClient::new(client.clone()),
60            auth: auth::AuthClient::new(client.clone()),
61            exchanges: exchanges::ExchangesClient::new(client.clone()),
62            fee_sponsors: fee_sponsors::FeeSponsorsClient::new(client.clone()),
63            keys: keys::KeysClient::new(client.clone()),
64            networks: networks::NetworksClient::new(client.clone()),
65            payins: payins::PayinsClient::new(client.clone()),
66            payouts: payouts::PayoutsClient::new(client.clone()),
67            permissions: permissions::PermissionsClient::new(client.clone()),
68            policies: policies::PoliciesClient::new(client.clone()),
69            signers: signers::SignersClient::new(client.clone()),
70            staking: staking::StakingClient::new(client.clone()),
71            swaps: swaps::SwapsClient::new(client.clone()),
72            vaults: vaults::VaultsClient::new(client.clone()),
73            wallets: wallets::WalletsClient::new(client.clone()),
74            webhooks: webhooks::WebhooksClient::new(client.clone()),
75        })
76    }
77}