Skip to main content

acta_maker_sdk/
lib.rs

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"))]
6#![cfg_attr(
7    not(feature = "ws-client"),
8    doc = "Rust SDK for Acta options market makers. Enable the `ws-client` feature for the WebSocket client and its documented examples."
9)]
10
11pub mod error;
12pub mod nonce;
13pub mod orders;
14pub mod quote;
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 quote::{QuoteBuildError, QuoteBuilder, RfqBinding};
25
26pub use types::PRICE_SCALE;
27pub use types::QuoteExpiry;
28pub use types::ids::{
29    Balance, ChainId, Decimals, DurationSeconds, MarketId, Nonce, OrderId, OrderVersion,
30    PositionType, PositionTypeParseError, Price, Quantity, QuoteCount, RfqVersion, Slot, Strike,
31    TimeoutSeconds, TradeCount, UserId, Volume,
32};
33pub use types::invite::{
34    REFERRAL_CODE_MAX_LEN, REFERRAL_CODE_MIN_LEN, RESERVED_CODES, ReferralCode,
35    ReferralCodeFormatError, TakerStatus, is_reserved,
36};
37
38#[cfg(feature = "chain")]
39pub mod chain;
40
41#[cfg(feature = "ws-client")]
42pub use ws::client::{PreparedClientMessage, WsClient, WsTransportConfig};
43
44#[cfg(feature = "ws-client")]
45pub use ws::error::{WsClientError, WsResult, WsTransportConfigError};
46#[cfg(feature = "ws-client")]
47pub use ws::maker::{
48    MakerClientError, MakerDataClient, MakerDataRequest, MakerDataRequestError, MakerQuoteClient,
49    MakerResponse,
50};
51#[cfg(all(feature = "ws-client", feature = "test-helpers"))]
52pub use ws::managed::ManagedWsTestPeer;
53#[cfg(feature = "ws-client")]
54pub use ws::managed::{
55    GapPolicy, MakerWsEndpoint, ManagedInbound, ManagedMessageReceiver, ManagedReceiveError,
56    ManagedWsConfig, ManagedWsConfigError, ManagedWsError, ManagedWsEvent, ManagedWsHandle,
57    ManagedWsState, ManagedWsTerminationReason, OutboundMessageError, SendAwaitError, SendTicket,
58    WaitUntilReadyError, normalize_maker_data_ws_url, normalize_maker_ws_url,
59    normalize_maker_ws_url_for_endpoint, spawn_managed_ws,
60};
61pub use ws::types::{ClientMessage, ServerMessage};
62
63pub use nonce::{AtomicNonceGenerator, NonceError, NonceGenerator};
64pub use orders::{
65    BytesSigner, ORDER_DOMAIN_TAG, ORDER_ID_LEN, ORDER_PREIMAGE_LEN, OrderError, OrderPreimageArgs,
66    SignerLike, build_order_preimage, compute_order_id, hash_order_preimage, order_id_hex,
67    order_preimage_hex, sign_order_id_base58, sign_order_id_bytes,
68    sign_order_id_from_base58_keypair, sign_order_id_with_async_signer, sign_order_id_with_signer,
69    sign_order_id_with_signer_base58, verify_order_id_signature_base58,
70    verify_order_id_signature_bytes,
71};
72pub use signing::{AsyncSignerLike, SigningError, SigningFuture};
73pub use wire::{
74    WireError, decode_base58_32, decode_base58_64, decode_hex_32, encode_base58, encode_hex,
75};