1#![warn(rust_2018_idioms, unreachable_pub, unused_must_use)]
2#![forbid(unsafe_code)]
3#![warn(clippy::all)]
4#![allow(clippy::module_name_repetitions)]
5#![cfg_attr(feature = "ws-client", doc = include_str!("../README.md"))]
7#![cfg_attr(
8 not(feature = "ws-client"),
9 doc = "Rust SDK for Acta options market makers. Enable the `ws-client` feature for the WebSocket client and its documented examples."
10)]
11
12pub mod error;
13pub mod nonce;
14pub mod orders;
15pub mod signing;
16pub mod types;
17pub mod wire;
18pub mod ws;
19
20pub use error::ActaSdkError;
21
22pub const WS_PROTOCOL_VERSION: &str = "1.0.0";
23
24pub use types::PRICE_SCALE;
26pub use types::ids::{
27 Balance, ChainId, Decimals, DurationSeconds, MarketId, Nonce, OrderId, OrderVersion,
28 PositionType, PositionTypeParseError, Price, Quantity, QuoteCount, RfqVersion, Slot, Strike,
29 TimeoutSeconds, TradeCount, UserId, Volume,
30};
31pub use types::invite::{
32 REFERRAL_CODE_MAX_LEN, REFERRAL_CODE_MIN_LEN, RESERVED_CODES, ReferralCode,
33 ReferralCodeFormatError, TakerStatus, is_reserved,
34};
35
36#[cfg(feature = "chain")]
37pub mod chain;
38
39#[cfg(feature = "ws-client")]
40pub use ws::client::{PreparedClientMessage, WsClient, WsTransportConfig};
41
42#[cfg(feature = "ws-client")]
43pub use ws::error::{WsClientError, WsResult, WsTransportConfigError};
44#[cfg(all(feature = "ws-client", feature = "test-helpers"))]
45pub use ws::managed::ManagedWsTestPeer;
46#[cfg(feature = "ws-client")]
47pub use ws::managed::{
48 ChallengeSigner, MakerWsEndpoint, ManagedInbound, ManagedMessageReceiver, ManagedReceiveError,
49 ManagedWsConfig, ManagedWsConfigError, ManagedWsError, ManagedWsEvent, ManagedWsHandle,
50 OutboundMessageError, SendAwaitError, SendTicket, normalize_maker_data_ws_url,
51 normalize_maker_ws_url, normalize_maker_ws_url_for_endpoint, spawn_managed_ws,
52};
53pub use ws::types::{ClientMessage, ServerMessage};
54
55pub use nonce::{AtomicNonceGenerator, NonceError, NonceGenerator};
56pub use orders::{
57 BytesSigner, ORDER_DOMAIN_TAG, ORDER_ID_LEN, ORDER_PREIMAGE_LEN, OrderError, OrderPreimageArgs,
58 SignerLike, build_order_preimage, compute_order_id, hash_order_preimage, order_id_hex,
59 order_preimage_hex, sign_order_id_base58, sign_order_id_bytes,
60 sign_order_id_from_base58_keypair, sign_order_id_with_async_signer, sign_order_id_with_signer,
61 sign_order_id_with_signer_base58, verify_order_id_signature_base58,
62 verify_order_id_signature_bytes,
63};
64pub use signing::{AsyncSignerLike, SigningError, SigningFuture};
65pub use wire::*;