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