nautilus_dydx/grpc/
mod.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2025 Nautech Systems Pty Ltd. All rights reserved.
3//  https://nautechsystems.io
4//
5//  Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6//  You may not use this file except in compliance with the License.
7//  You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9//  Unless required by applicable law or agreed to in writing, software
10//  distributed under the License is distributed on an "AS IS" BASIS,
11//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//  See the License for the specific language governing permissions and
13//  limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16//! gRPC client implementation for the dYdX v4 protocol.
17//!
18//! This module provides gRPC client functionality for interacting with the dYdX v4 protocol
19//! via the Cosmos SDK. It handles:
20//!
21//! - Transaction signing and broadcasting using `cosmrs`.
22//! - gRPC communication with validator nodes.
23//! - Protocol Buffer message encoding/decoding.
24//! - Cosmos SDK account management.
25//!
26//! The client supports dYdX trading operations including:
27//!
28//! - Order placement, modification, and cancellation.
29//! - Transfer operations between subaccounts.
30//! - Subaccount management.
31//! - Transaction signing with secp256k1 keys.
32//!
33//! # Architecture
34//!
35//! dYdX v4 is built on the Cosmos SDK and uses gRPC for all state-changing operations
36//! (placing orders, transfers, etc.). The HTTP/REST API (Indexer) is read-only and used
37//! for querying market data and historical information.
38
39pub mod builder;
40pub mod client;
41pub mod order;
42pub mod types;
43pub mod wallet;
44
45// Re-exports
46pub use builder::TxBuilder;
47pub use client::{DydxGrpcClient, Height, TxHash};
48pub use order::{
49    DEFAULT_RUST_CLIENT_METADATA, OrderBuilder, OrderFlags, OrderGoodUntil, OrderMarketParams,
50    SHORT_TERM_ORDER_MAXIMUM_LIFETIME,
51};
52pub use types::ChainId;
53pub use wallet::{Account, Subaccount, Wallet};