1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
// Copyright (c) Subzero Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
//! # Rialo API Types
//!
//! This crate provides strongly-typed, validated data structures for all Rialo RPC endpoints.
//! It implements the JSON-RPC 2.0 specification with full Solana compatibility.
//!
//! ## Features
//!
//! - **Type Safety**: Strongly typed request and response structures for all RPC endpoints
//! - **Input Validation**: Built-in validation using the `validator` crate with custom rules
//! - **JSON-RPC 2.0**: Full compliance with JSON-RPC 2.0 specification
//! - **Solana Compatibility**: Compatible with Solana RPC client libraries and tools
//! - **Comprehensive Documentation**: Each endpoint includes examples and usage patterns
//!
//! ## Quick Start
//!
//! ```rust
//! use rialo_api_types::{
//! messages::get_account_info::{GetAccountInfoRequest, GetAccountInfoConfig},
//! validation::validate_request
//! };
//!
//! // Create a request
//! let request = GetAccountInfoRequest {
//! version: 0,
//! address: "7xB9i2AcjLNJ6M8iZ3LZJvLm7xpSmH7T5uZzR3DeVXWi".to_string(),
//! config: Some(GetAccountInfoConfig {
//! data_slice: None,
//! min_context_slot: None,
//! })
//! };
//!
//! // Serialize to JSON
//! let json = serde_json::to_string(&request).unwrap();
//! ```
//!
//! ## Validation
//!
//! All request types support comprehensive input validation:
//!
//! ```rust
//! use rialo_api_types::{
//! messages::request_airdrop::RequestAirdropRequest,
//! validation::validate_request
//! };
//!
//! let request = RequestAirdropRequest::new(
//! "7xB9i2AcjLNJ6M8iZ3LZJvLm7xpSmH7T5uZzR3DeVXWi".to_string(),
//! 1_000_000_000 // 1 RLO in kelvins
//! );
//!
//! // This validates the pubkey format and amount constraints
//! let validated = validate_request(request).unwrap();
//! ```
//!
//! ## Supported RPC Methods
//!
//! ### Account Operations
//! - `getAccountInfo` - Get account information and data
//! - `getBalance` - Get account balance in kelvins
//! - `getMultipleAccounts` - Get information for multiple accounts
//!
//! ### Transaction Operations
//! - `sendTransaction` - Submit a signed transaction to the network
//! - `getTransaction` - Get transaction details and metadata
//! - `getSignatureStatuses` - Get confirmation status of transactions
//! - `getSignaturesForAddress` - Get transaction signatures for an address
//!
//! ### Block Operations
//! - `getBlock` - Get confirmed block information
//!
//! ### Health & Status
//! - `getHealth` - Node health check endpoint
//! - `getValidatorHealth` - Validator-specific health check
//! - `getConnectedFullNodes` - Get full nodes connected to validator
//! - `getEpochInfo` - Get current epoch information
//!
//! ### Utility Operations
//! - `requestAirdrop` - Request test tokens (devnet/testnet only)
//! - `getMinimumBalanceForRentExemption` - Get minimum balance for rent exemption
//! - `getFeeForMessage` - Calculate transaction fees
//! - `isBlockhashValid` - Check if a blockhash is still valid
//!
//! ### Rialo-Specific Operations
//! - `getWorkflowLineage` - Get workflow transaction lineage and relationships
//! - `getTriggeredTransactions` - Get transactions triggered by events
//! - `getSubscription` - Get subscription by subscriber and nonce
//! - `getTransactionCount` - Get total transaction count
//!
//! ## Error Handling
//!
//! ```rust
//! use rialo_api_types::validation::{ValidationError, ValidationResult};
//! use rialo_api_types::messages::request_airdrop::RequestAirdropRequest;
//!
//! fn handle_validation_error(result: ValidationResult<RequestAirdropRequest>) {
//! match result {
//! Ok(data) => { /* Use validated data */ }
//! Err(ValidationError::InvalidPublicKey(msg)) => {
//! println!("Invalid public key: {}", msg);
//! }
//! Err(ValidationError::Multiple(msg)) => {
//! println!("Multiple validation errors: {}", msg);
//! }
//! Err(err) => {
//! println!("Validation failed: {}", err);
//! }
//! }
//! }
//! ```
//!
//! ## JSON-RPC 2.0 Format
//!
//! All requests follow the JSON-RPC 2.0 specification:
//!
//! ```json
//! {
//! "jsonrpc": "2.0",
//! "id": 1,
//! "method": "getAccountInfo",
//! "params": [
//! "7xB9i2AcjLNJ6M8iZ3LZJvLm7xpSmH7T5uZzR3DeVXWi"
//! ]
//! }
//! ```
//!
//! Responses include context information and follow the same format:
//!
//! ```json
//! {
//! "jsonrpc": "2.0",
//! "id": 1,
//! "result": {
//! "context": {
//! "slot": 1234567
//! },
//! "value": {
//! "kelvins": 1000000000,
//! "data": ["SGVsbG8gV29ybGQ=", "base64"],
//! "owner": "11111111111111111111111111111111",
//! "executable": false,
//! "rentEpoch": 200
//! }
//! }
//! }
//! ```
// Re-export commonly used types for convenience
pub use ;