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 network;
13pub mod nonce;
14pub mod orders;
15pub mod quote;
16pub mod signing;
17pub mod types;
18pub mod wire;
19pub mod ws;
20
21pub use error::ActaSdkError;
22pub use network::{DEVNET_API, DEVNET_WS, MAINNET_API, MAINNET_WS};
23
24pub const WS_PROTOCOL_VERSION: &str = "1.0.0";
25
26pub const ACTA_PROGRAM_ID: [u8; 32] =
28 solana_pubkey::pubkey!("33Ezs5eoa16QyPW8wifnyz2nCyMEcq2crqkVBNjnTE8U").to_bytes();
29
30pub use quote::{QuoteBuildError, QuoteBuilder, RfqBinding};
31
32pub use types::PRICE_SCALE;
33pub use types::QuoteExpiry;
34pub use types::ids::{
35 Balance, ChainId, ChainPositionType, ChainPositionTypeParseError, ChainTerms, Decimals,
36 DurationSeconds, MarketId, Nonce, OptionTerms, OrderId, OrderVersion, PositionRevision,
37 PositionType, Price, Quantity, QuoteCount, RfqVersion, Slot, Strike, TakerSide, TimeoutSeconds,
38 TradeCount, UserId, Volume,
39};
40pub use types::invite::{
41 REFERRAL_CODE_MAX_LEN, REFERRAL_CODE_MIN_LEN, RESERVED_CODES, ReferralCode,
42 ReferralCodeFormatError, TakerStatus, is_reserved,
43};
44pub use types::vault::{
45 VaultDelegatePermissions, VaultLeg, VaultOperatorKind, VaultStagingStep, VaultSwapDirection,
46 VaultSwapMode,
47};
48pub use types::{Address32, AddressError};
49pub use types::{PhysicalPremium, physical_premium, total_premium_quote_atoms};
50
51#[cfg(feature = "chain")]
52pub mod chain;
53
54#[cfg(feature = "http")]
55pub mod http;
56
57#[cfg(feature = "ws-client")]
58pub use ws::client::{PreparedClientMessage, ServerClose, WsClient, WsTransportConfig};
59
60#[cfg(feature = "ws-client")]
61pub use ws::error::{WsClientError, WsResult, WsTransportConfigError};
62#[cfg(feature = "ws-client")]
63pub use ws::maker::{
64 MakerClientError, MakerDataClient, MakerDataRequest, MakerDataRequestError, MakerQuoteClient,
65 MakerResponse, PagedRequest,
66};
67#[cfg(all(feature = "ws-client", feature = "test-helpers"))]
68pub use ws::managed::ManagedWsTestPeer;
69#[cfg(feature = "ws-client")]
70pub use ws::managed::{
71 GapPolicy, MakerWsEndpoint, ManagedInbound, ManagedMessageReceiver, ManagedReceiveError,
72 ManagedWsConfig, ManagedWsConfigError, ManagedWsError, ManagedWsEvent, ManagedWsHandle,
73 ManagedWsState, ManagedWsTerminationReason, OutboundMessageError, SendAwaitError, SendTicket,
74 WaitUntilReadyError, normalize_maker_data_ws_url, normalize_maker_ws_url,
75 normalize_maker_ws_url_for_endpoint, spawn_managed_ws,
76};
77pub use ws::market_decimals::{MarketDecimals, TokenDecimals};
78pub use ws::types::{ClientMessage, ServerMessage};
79#[cfg(all(feature = "vault", feature = "http"))]
80pub use ws::vault::{FleetListing, VaultFleet, VaultFleetConfig};
81#[cfg(all(feature = "vault", feature = "chain-rpc"))]
82pub use ws::vault::{SaleDesk, SaleError, SaleOutcome, SaleStage, SignedSale, VaultSale};
83#[cfg(feature = "vault")]
84pub use ws::vault::{
85 SendGate, Ungated, VaultClientError, VaultOperatorClient, VaultOperatorConfig, VaultProjection,
86 VaultProjectionReceiver, VaultRequestError, VaultTxError,
87};
88
89pub use nonce::{AtomicNonceGenerator, NonceError, NonceGenerator};
90pub use orders::{
91 BytesSigner, ORDER_DOMAIN_TAG, ORDER_ID_LEN, ORDER_PREIMAGE_LEN, OrderError, OrderPreimageArgs,
92 SignerLike, build_order_preimage, compute_order_id, hash_order_preimage, order_id_hex,
93 order_preimage_hex, sign_order_id_base58, sign_order_id_bytes,
94 sign_order_id_from_base58_keypair, sign_order_id_with_async_signer, sign_order_id_with_signer,
95 sign_order_id_with_signer_base58, verify_order_id_signature_base58,
96 verify_order_id_signature_bytes,
97};
98pub use signing::{AsyncSignerLike, SigningError, SigningFuture};
99pub use wire::{
100 WireError, decode_base58_32, decode_base58_64, decode_hex_32, encode_base58, encode_hex,
101};
102
103pub mod spreads;
104
105pub use types::{InvalidProductSet, ProductSet};