Skip to main content

protochain_api/
protochain.solana.transaction.v1.rs

1// @generated
2// This file is @generated by prost-build.
3/// SolanaInstruction represents a single instruction for Solana execution
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct SolanaInstruction {
7    /// Program ID that will execute this instruction (base58 encoded)
8    #[prost(string, tag="1")]
9    pub program_id: ::prost::alloc::string::String,
10    /// Accounts required by this instruction with their permission requirements
11    #[prost(message, repeated, tag="2")]
12    pub accounts: ::prost::alloc::vec::Vec<SolanaAccountMeta>,
13    /// Instruction data (program-specific parameters)
14    #[prost(bytes="vec", tag="3")]
15    pub data: ::prost::alloc::vec::Vec<u8>,
16    /// Optional description for debugging/logging
17    #[prost(string, tag="4")]
18    pub description: ::prost::alloc::string::String,
19}
20/// SolanaAccountMeta represents account metadata with permissions
21#[allow(clippy::derive_partial_eq_without_eq)]
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct SolanaAccountMeta {
24    /// Account public key (base58 encoded)
25    #[prost(string, tag="1")]
26    pub pubkey: ::prost::alloc::string::String,
27    /// Whether this account must sign the transaction
28    #[prost(bool, tag="2")]
29    pub is_signer: bool,
30    /// Whether this account's data may be modified
31    #[prost(bool, tag="3")]
32    pub is_writable: bool,
33}
34/// Structured error information for transaction submission failures
35///
36/// This message provides comprehensive error details that enable callers to determine
37/// with 100% certainty the state of their transaction submission and whether retry
38/// is appropriate. The error classification follows the "re-signing test" principle:
39/// - PERMANENT failures require rebuilding and re-signing the transaction
40/// - TEMPORARY failures can be resolved with the same signed transaction
41/// - INDETERMINATE states can be resolved by waiting for blockhash expiration
42#[allow(clippy::derive_partial_eq_without_eq)]
43#[derive(Clone, PartialEq, ::prost::Message)]
44pub struct TransactionError {
45    /// Specific error code for programmatic handling
46    #[prost(enumeration="TransactionErrorCode", tag="1")]
47    pub code: i32,
48    /// Human-readable error message
49    #[prost(string, tag="2")]
50    pub message: ::prost::alloc::string::String,
51    /// JSON-encoded additional error context and details
52    #[prost(string, tag="3")]
53    pub details: ::prost::alloc::string::String,
54    /// Whether the same transaction might succeed if retried without modification
55    #[prost(bool, tag="4")]
56    pub retryable: bool,
57    /// Certainty level about transaction submission status
58    #[prost(enumeration="TransactionSubmissionCertainty", tag="5")]
59    pub certainty: i32,
60    /// Original transaction blockhash for resolution timing
61    #[prost(string, tag="6")]
62    pub blockhash: ::prost::alloc::string::String,
63    /// Slot when blockhash expires (~150 blocks after creation)
64    #[prost(uint64, tag="7")]
65    pub blockhash_expiry_slot: u64,
66}
67/// Comprehensive error codes for transaction submission failures
68///
69/// Error classification is based on the "re-signing test" principle:
70/// - If fixing the error requires creating a new transaction with new signatures, it's PERMANENT
71/// - If the same signed transaction could work later, it's TEMPORARY
72/// - If we cannot determine whether the transaction was sent, it's INDETERMINATE
73#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
74#[repr(i32)]
75pub enum TransactionErrorCode {
76    Unspecified = 0,
77    // PERMANENT FAILURES - Transaction was NOT sent and will NEVER succeed as-is
78    // These require rebuilding and re-signing the transaction
79
80    /// Transaction structure or format errors
81    ///
82    /// Malformed transaction structure
83    InvalidTransaction = 1,
84    /// Missing or invalid signatures
85    InvalidSignature = 2,
86    /// Signature verification failed
87    SignatureVerificationFailed = 3,
88    /// Transaction exceeds size limits
89    TransactionTooLarge = 10,
90    /// Account and validation errors
91    ///
92    /// Required account doesn't exist
93    AccountNotFound = 4,
94    /// Account in invalid state
95    InvalidAccount = 5,
96    /// Blockhash format is invalid
97    InvalidBlockhashFormat = 9,
98    /// Expired blockhash - requires re-signing
99    BlockhashNotFound = 11,
100    /// Program execution errors
101    ///
102    /// Program execution failed
103    ProgramError = 6,
104    /// Instruction execution failed
105    InstructionError = 7,
106    /// Precompile verification failed
107    PrecompileVerificationFailed = 8,
108    // TEMPORARY FAILURES - Same exact transaction could succeed later without modification
109    // These are truly transient conditions affecting the same signed transaction
110
111    /// Add funds, same transaction works
112    InsufficientFunds = 20,
113    /// Account locked, wait for unlock
114    AccountInUse = 21,
115    /// Block capacity limit, try next block
116    WouldExceedBlockLimit = 22,
117    /// Temporary simulation issues
118    TransientSimulationFailure = 23,
119    // INDETERMINATE - Cannot determine if transaction was submitted
120    // These errors leave us uncertain about submission status but can be resolved
121
122    /// Could fail before/during/after send
123    NetworkError = 40,
124    /// DANGEROUS - might have been sent
125    Timeout = 41,
126    /// Node might have received it first
127    NodeUnhealthy = 42,
128    /// Depends on where rate limiting occurs
129    RateLimited = 43,
130    /// Generic RPC failures
131    RpcError = 44,
132    /// Connection establishment failed
133    ConnectionFailed = 45,
134    /// HTTP/transport request failed
135    RequestFailed = 46,
136    /// Any unclassified error
137    Unknown = 47,
138}
139impl TransactionErrorCode {
140    /// String value of the enum field names used in the ProtoBuf definition.
141    ///
142    /// The values are not transformed in any way and thus are considered stable
143    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
144    pub fn as_str_name(&self) -> &'static str {
145        match self {
146            TransactionErrorCode::Unspecified => "TRANSACTION_ERROR_CODE_UNSPECIFIED",
147            TransactionErrorCode::InvalidTransaction => "TRANSACTION_ERROR_CODE_INVALID_TRANSACTION",
148            TransactionErrorCode::InvalidSignature => "TRANSACTION_ERROR_CODE_INVALID_SIGNATURE",
149            TransactionErrorCode::SignatureVerificationFailed => "TRANSACTION_ERROR_CODE_SIGNATURE_VERIFICATION_FAILED",
150            TransactionErrorCode::TransactionTooLarge => "TRANSACTION_ERROR_CODE_TRANSACTION_TOO_LARGE",
151            TransactionErrorCode::AccountNotFound => "TRANSACTION_ERROR_CODE_ACCOUNT_NOT_FOUND",
152            TransactionErrorCode::InvalidAccount => "TRANSACTION_ERROR_CODE_INVALID_ACCOUNT",
153            TransactionErrorCode::InvalidBlockhashFormat => "TRANSACTION_ERROR_CODE_INVALID_BLOCKHASH_FORMAT",
154            TransactionErrorCode::BlockhashNotFound => "TRANSACTION_ERROR_CODE_BLOCKHASH_NOT_FOUND",
155            TransactionErrorCode::ProgramError => "TRANSACTION_ERROR_CODE_PROGRAM_ERROR",
156            TransactionErrorCode::InstructionError => "TRANSACTION_ERROR_CODE_INSTRUCTION_ERROR",
157            TransactionErrorCode::PrecompileVerificationFailed => "TRANSACTION_ERROR_CODE_PRECOMPILE_VERIFICATION_FAILED",
158            TransactionErrorCode::InsufficientFunds => "TRANSACTION_ERROR_CODE_INSUFFICIENT_FUNDS",
159            TransactionErrorCode::AccountInUse => "TRANSACTION_ERROR_CODE_ACCOUNT_IN_USE",
160            TransactionErrorCode::WouldExceedBlockLimit => "TRANSACTION_ERROR_CODE_WOULD_EXCEED_BLOCK_LIMIT",
161            TransactionErrorCode::TransientSimulationFailure => "TRANSACTION_ERROR_CODE_TRANSIENT_SIMULATION_FAILURE",
162            TransactionErrorCode::NetworkError => "TRANSACTION_ERROR_CODE_NETWORK_ERROR",
163            TransactionErrorCode::Timeout => "TRANSACTION_ERROR_CODE_TIMEOUT",
164            TransactionErrorCode::NodeUnhealthy => "TRANSACTION_ERROR_CODE_NODE_UNHEALTHY",
165            TransactionErrorCode::RateLimited => "TRANSACTION_ERROR_CODE_RATE_LIMITED",
166            TransactionErrorCode::RpcError => "TRANSACTION_ERROR_CODE_RPC_ERROR",
167            TransactionErrorCode::ConnectionFailed => "TRANSACTION_ERROR_CODE_CONNECTION_FAILED",
168            TransactionErrorCode::RequestFailed => "TRANSACTION_ERROR_CODE_REQUEST_FAILED",
169            TransactionErrorCode::Unknown => "TRANSACTION_ERROR_CODE_UNKNOWN",
170        }
171    }
172    /// Creates an enum from field names used in the ProtoBuf definition.
173    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
174        match value {
175            "TRANSACTION_ERROR_CODE_UNSPECIFIED" => Some(Self::Unspecified),
176            "TRANSACTION_ERROR_CODE_INVALID_TRANSACTION" => Some(Self::InvalidTransaction),
177            "TRANSACTION_ERROR_CODE_INVALID_SIGNATURE" => Some(Self::InvalidSignature),
178            "TRANSACTION_ERROR_CODE_SIGNATURE_VERIFICATION_FAILED" => Some(Self::SignatureVerificationFailed),
179            "TRANSACTION_ERROR_CODE_TRANSACTION_TOO_LARGE" => Some(Self::TransactionTooLarge),
180            "TRANSACTION_ERROR_CODE_ACCOUNT_NOT_FOUND" => Some(Self::AccountNotFound),
181            "TRANSACTION_ERROR_CODE_INVALID_ACCOUNT" => Some(Self::InvalidAccount),
182            "TRANSACTION_ERROR_CODE_INVALID_BLOCKHASH_FORMAT" => Some(Self::InvalidBlockhashFormat),
183            "TRANSACTION_ERROR_CODE_BLOCKHASH_NOT_FOUND" => Some(Self::BlockhashNotFound),
184            "TRANSACTION_ERROR_CODE_PROGRAM_ERROR" => Some(Self::ProgramError),
185            "TRANSACTION_ERROR_CODE_INSTRUCTION_ERROR" => Some(Self::InstructionError),
186            "TRANSACTION_ERROR_CODE_PRECOMPILE_VERIFICATION_FAILED" => Some(Self::PrecompileVerificationFailed),
187            "TRANSACTION_ERROR_CODE_INSUFFICIENT_FUNDS" => Some(Self::InsufficientFunds),
188            "TRANSACTION_ERROR_CODE_ACCOUNT_IN_USE" => Some(Self::AccountInUse),
189            "TRANSACTION_ERROR_CODE_WOULD_EXCEED_BLOCK_LIMIT" => Some(Self::WouldExceedBlockLimit),
190            "TRANSACTION_ERROR_CODE_TRANSIENT_SIMULATION_FAILURE" => Some(Self::TransientSimulationFailure),
191            "TRANSACTION_ERROR_CODE_NETWORK_ERROR" => Some(Self::NetworkError),
192            "TRANSACTION_ERROR_CODE_TIMEOUT" => Some(Self::Timeout),
193            "TRANSACTION_ERROR_CODE_NODE_UNHEALTHY" => Some(Self::NodeUnhealthy),
194            "TRANSACTION_ERROR_CODE_RATE_LIMITED" => Some(Self::RateLimited),
195            "TRANSACTION_ERROR_CODE_RPC_ERROR" => Some(Self::RpcError),
196            "TRANSACTION_ERROR_CODE_CONNECTION_FAILED" => Some(Self::ConnectionFailed),
197            "TRANSACTION_ERROR_CODE_REQUEST_FAILED" => Some(Self::RequestFailed),
198            "TRANSACTION_ERROR_CODE_UNKNOWN" => Some(Self::Unknown),
199            _ => None,
200        }
201    }
202}
203/// Transaction submission certainty levels
204///
205/// This enum indicates our level of certainty about whether the transaction
206/// was actually sent to the Solana network. This is critical for preventing
207/// duplicate transactions and implementing proper retry logic.
208#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
209#[repr(i32)]
210pub enum TransactionSubmissionCertainty {
211    /// We are certain about what happened to the transaction
212    ///
213    /// Default/unknown state
214    Unspecified = 0,
215    /// 100% certain transaction was NOT sent to network
216    NotSubmitted = 1,
217    /// 100% certain transaction WAS sent to network
218    Submitted = 2,
219    /// We are uncertain but can resolve the state through blockchain analysis
220    ///
221    /// Wait for blockhash expiry, then check blockchain
222    UnknownResolvable = 3,
223    /// Cannot determine and cannot easily resolve
224    Unknown = 4,
225}
226impl TransactionSubmissionCertainty {
227    /// String value of the enum field names used in the ProtoBuf definition.
228    ///
229    /// The values are not transformed in any way and thus are considered stable
230    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
231    pub fn as_str_name(&self) -> &'static str {
232        match self {
233            TransactionSubmissionCertainty::Unspecified => "TRANSACTION_SUBMISSION_CERTAINTY_UNSPECIFIED",
234            TransactionSubmissionCertainty::NotSubmitted => "TRANSACTION_SUBMISSION_CERTAINTY_NOT_SUBMITTED",
235            TransactionSubmissionCertainty::Submitted => "TRANSACTION_SUBMISSION_CERTAINTY_SUBMITTED",
236            TransactionSubmissionCertainty::UnknownResolvable => "TRANSACTION_SUBMISSION_CERTAINTY_UNKNOWN_RESOLVABLE",
237            TransactionSubmissionCertainty::Unknown => "TRANSACTION_SUBMISSION_CERTAINTY_UNKNOWN",
238        }
239    }
240    /// Creates an enum from field names used in the ProtoBuf definition.
241    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
242        match value {
243            "TRANSACTION_SUBMISSION_CERTAINTY_UNSPECIFIED" => Some(Self::Unspecified),
244            "TRANSACTION_SUBMISSION_CERTAINTY_NOT_SUBMITTED" => Some(Self::NotSubmitted),
245            "TRANSACTION_SUBMISSION_CERTAINTY_SUBMITTED" => Some(Self::Submitted),
246            "TRANSACTION_SUBMISSION_CERTAINTY_UNKNOWN_RESOLVABLE" => Some(Self::UnknownResolvable),
247            "TRANSACTION_SUBMISSION_CERTAINTY_UNKNOWN" => Some(Self::Unknown),
248            _ => None,
249        }
250    }
251}
252/// Configuration for transaction compilation and execution
253#[allow(clippy::derive_partial_eq_without_eq)]
254#[derive(Clone, Copy, PartialEq, ::prost::Message)]
255pub struct TransactionConfig {
256    /// Compute budget configuration
257    #[prost(uint32, tag="1")]
258    pub compute_unit_limit: u32,
259    #[prost(uint64, tag="2")]
260    pub compute_unit_price: u64,
261    #[prost(uint64, tag="3")]
262    pub priority_fee: u64,
263    /// Validation options
264    #[prost(bool, tag="4")]
265    pub skip_preflight: bool,
266    #[prost(bool, tag="5")]
267    pub skip_account_validation: bool,
268}
269/// Composable transaction supporting multiple instructions
270#[allow(clippy::derive_partial_eq_without_eq)]
271#[derive(Clone, PartialEq, ::prost::Message)]
272pub struct Transaction {
273    /// Instructions for composition (populated in draft state)
274    #[prost(message, repeated, tag="1")]
275    pub instructions: ::prost::alloc::vec::Vec<SolanaInstruction>,
276    /// Transaction lifecycle state
277    #[prost(enumeration="TransactionState", tag="2")]
278    pub state: i32,
279    /// Transaction configuration
280    #[prost(message, optional, tag="3")]
281    pub config: ::core::option::Option<TransactionConfig>,
282    /// Compiled transaction data (populated when compiled)
283    #[prost(string, tag="4")]
284    pub data: ::prost::alloc::string::String,
285    /// Transaction metadata
286    #[prost(string, tag="5")]
287    pub fee_payer: ::prost::alloc::string::String,
288    #[prost(string, tag="6")]
289    pub recent_blockhash: ::prost::alloc::string::String,
290    #[prost(string, repeated, tag="7")]
291    pub signatures: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
292    /// Transaction hash (when submitted)
293    #[prost(string, tag="8")]
294    pub hash: ::prost::alloc::string::String,
295    /// Primary signature for compatibility with existing account service
296    #[prost(string, tag="9")]
297    pub signature: ::prost::alloc::string::String,
298    #[prost(uint64, tag="10")]
299    pub slot: u64,
300    /// Human-readable error message from transaction meta (if any)
301    #[prost(string, tag="11")]
302    pub meta_error_message: ::prost::alloc::string::String,
303    #[prost(string, tag="12")]
304    pub meta_logs: ::prost::alloc::string::String,
305}
306/// Transaction lifecycle states
307#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
308#[repr(i32)]
309pub enum TransactionState {
310    Unspecified = 0,
311    /// Can add/remove instructions
312    Draft = 1,
313    /// Instructions compiled to data, read-only
314    Compiled = 2,
315    /// Some signatures added
316    PartiallySigned = 3,
317    /// All signatures present, ready for submission
318    FullySigned = 4,
319}
320impl TransactionState {
321    /// String value of the enum field names used in the ProtoBuf definition.
322    ///
323    /// The values are not transformed in any way and thus are considered stable
324    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
325    pub fn as_str_name(&self) -> &'static str {
326        match self {
327            TransactionState::Unspecified => "TRANSACTION_STATE_UNSPECIFIED",
328            TransactionState::Draft => "TRANSACTION_STATE_DRAFT",
329            TransactionState::Compiled => "TRANSACTION_STATE_COMPILED",
330            TransactionState::PartiallySigned => "TRANSACTION_STATE_PARTIALLY_SIGNED",
331            TransactionState::FullySigned => "TRANSACTION_STATE_FULLY_SIGNED",
332        }
333    }
334    /// Creates an enum from field names used in the ProtoBuf definition.
335    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
336        match value {
337            "TRANSACTION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
338            "TRANSACTION_STATE_DRAFT" => Some(Self::Draft),
339            "TRANSACTION_STATE_COMPILED" => Some(Self::Compiled),
340            "TRANSACTION_STATE_PARTIALLY_SIGNED" => Some(Self::PartiallySigned),
341            "TRANSACTION_STATE_FULLY_SIGNED" => Some(Self::FullySigned),
342            _ => None,
343        }
344    }
345}
346/// Request/Response messages
347#[allow(clippy::derive_partial_eq_without_eq)]
348#[derive(Clone, PartialEq, ::prost::Message)]
349pub struct CompileTransactionRequest {
350    /// Must be in DRAFT state
351    #[prost(message, optional, tag="1")]
352    pub transaction: ::core::option::Option<Transaction>,
353    /// Who pays transaction fees
354    #[prost(string, tag="2")]
355    pub fee_payer: ::prost::alloc::string::String,
356    /// Optional - will fetch if empty
357    #[prost(string, tag="3")]
358    pub recent_blockhash: ::prost::alloc::string::String,
359}
360#[allow(clippy::derive_partial_eq_without_eq)]
361#[derive(Clone, PartialEq, ::prost::Message)]
362pub struct CompileTransactionResponse {
363    /// Now in COMPILED state
364    #[prost(message, optional, tag="1")]
365    pub transaction: ::core::option::Option<Transaction>,
366}
367#[allow(clippy::derive_partial_eq_without_eq)]
368#[derive(Clone, PartialEq, ::prost::Message)]
369pub struct EstimateTransactionRequest {
370    /// Must be in COMPILED state
371    #[prost(message, optional, tag="1")]
372    pub transaction: ::core::option::Option<Transaction>,
373    /// Commitment level for fee estimation
374    #[prost(enumeration="super::super::r#type::v1::CommitmentLevel", tag="2")]
375    pub commitment_level: i32,
376}
377#[allow(clippy::derive_partial_eq_without_eq)]
378#[derive(Clone, Copy, PartialEq, ::prost::Message)]
379pub struct EstimateTransactionResponse {
380    /// Estimated compute units required
381    #[prost(uint64, tag="1")]
382    pub compute_units: u64,
383    /// Estimated total transaction fee
384    #[prost(uint64, tag="2")]
385    pub fee_lamports: u64,
386    /// Current network priority fee estimate
387    #[prost(uint64, tag="3")]
388    pub priority_fee: u64,
389}
390// Fee Management Philosophy:
391// - Fee calculation is CLIENT responsibility
392// - Services only provide EstimateTransaction for client decision-making
393// - Clients call: build instructions → compile → estimate → set fees → sign → submit
394// - No automatic fee management in services - pure SDK wrapper approach
395
396#[allow(clippy::derive_partial_eq_without_eq)]
397#[derive(Clone, PartialEq, ::prost::Message)]
398pub struct SimulateTransactionRequest {
399    /// Must be compiled
400    #[prost(message, optional, tag="1")]
401    pub transaction: ::core::option::Option<Transaction>,
402    /// Commitment level for simulation
403    #[prost(enumeration="super::super::r#type::v1::CommitmentLevel", tag="2")]
404    pub commitment_level: i32,
405}
406#[allow(clippy::derive_partial_eq_without_eq)]
407#[derive(Clone, PartialEq, ::prost::Message)]
408pub struct SimulateTransactionResponse {
409    #[prost(bool, tag="1")]
410    pub success: bool,
411    #[prost(string, tag="2")]
412    pub error: ::prost::alloc::string::String,
413    #[prost(string, repeated, tag="3")]
414    pub logs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
415}
416#[allow(clippy::derive_partial_eq_without_eq)]
417#[derive(Clone, PartialEq, ::prost::Message)]
418pub struct SignTransactionRequest {
419    #[prost(message, optional, tag="1")]
420    pub transaction: ::core::option::Option<Transaction>,
421    #[prost(oneof="sign_transaction_request::SigningMethod", tags="2, 3")]
422    pub signing_method: ::core::option::Option<sign_transaction_request::SigningMethod>,
423}
424/// Nested message and enum types in `SignTransactionRequest`.
425pub mod sign_transaction_request {
426    #[allow(clippy::derive_partial_eq_without_eq)]
427#[derive(Clone, PartialEq, ::prost::Oneof)]
428    pub enum SigningMethod {
429        #[prost(message, tag="2")]
430        PrivateKeys(super::SignWithPrivateKeys),
431        #[prost(message, tag="3")]
432        Seeds(super::SignWithSeeds),
433    }
434}
435#[allow(clippy::derive_partial_eq_without_eq)]
436#[derive(Clone, PartialEq, ::prost::Message)]
437pub struct SignTransactionResponse {
438    #[prost(message, optional, tag="1")]
439    pub transaction: ::core::option::Option<Transaction>,
440}
441#[allow(clippy::derive_partial_eq_without_eq)]
442#[derive(Clone, PartialEq, ::prost::Message)]
443pub struct SignWithPrivateKeys {
444    /// Base58 encoded private keys
445    #[prost(string, repeated, tag="1")]
446    pub private_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
447}
448#[allow(clippy::derive_partial_eq_without_eq)]
449#[derive(Clone, PartialEq, ::prost::Message)]
450pub struct SignWithSeeds {
451    #[prost(message, repeated, tag="1")]
452    pub seeds: ::prost::alloc::vec::Vec<KeySeed>,
453}
454#[allow(clippy::derive_partial_eq_without_eq)]
455#[derive(Clone, PartialEq, ::prost::Message)]
456pub struct KeySeed {
457    #[prost(string, tag="1")]
458    pub seed: ::prost::alloc::string::String,
459    #[prost(string, tag="2")]
460    pub passphrase: ::prost::alloc::string::String,
461}
462#[allow(clippy::derive_partial_eq_without_eq)]
463#[derive(Clone, PartialEq, ::prost::Message)]
464pub struct CheckIfTransactionIsExpiredRequest {
465    /// Transaction to check
466    #[prost(message, optional, tag="1")]
467    pub transaction: ::core::option::Option<Transaction>,
468    /// Commitment level for transaction submission
469    #[prost(enumeration="super::super::r#type::v1::CommitmentLevel", tag="2")]
470    pub commitment_level: i32,
471}
472#[allow(clippy::derive_partial_eq_without_eq)]
473#[derive(Clone, Copy, PartialEq, ::prost::Message)]
474pub struct CheckIfTransactionIsExpiredResponse {
475    /// True if transaction is expired
476    #[prost(bool, tag="1")]
477    pub is_expired: bool,
478}
479/// Request to asynchronously submit a transaction to the Solana network
480/// The method returns immediately after submission without waiting for confirmation
481#[allow(clippy::derive_partial_eq_without_eq)]
482#[derive(Clone, PartialEq, ::prost::Message)]
483pub struct SubmitTransactionRequest {
484    /// Must be fully signed
485    #[prost(message, optional, tag="1")]
486    pub transaction: ::core::option::Option<Transaction>,
487    /// Commitment level for transaction submission
488    #[prost(enumeration="super::super::r#type::v1::CommitmentLevel", tag="2")]
489    pub commitment_level: i32,
490}
491/// Response containing the submission result
492/// NOTE: This is an asynchronous submission - successful result means the transaction
493/// was successfully sent to the network, NOT that it was confirmed or executed
494/// Use MonitorTransaction to poll for confirmation and execution status
495#[allow(clippy::derive_partial_eq_without_eq)]
496#[derive(Clone, PartialEq, ::prost::Message)]
497pub struct SubmitTransactionResponse {
498    /// Transaction signature
499    #[prost(string, tag="1")]
500    pub signature: ::prost::alloc::string::String,
501    /// Submission outcome (sent vs failed to send)
502    #[prost(enumeration="SubmissionResult", tag="2")]
503    pub submission_result: i32,
504    /// Error details if submission failed (kept for backward compatibility)
505    #[prost(string, tag="3")]
506    pub error_message: ::prost::alloc::string::String,
507    /// NEW: Structured error details with certainty indicators
508    #[prost(message, optional, tag="4")]
509    pub structured_error: ::core::option::Option<TransactionError>,
510}
511#[allow(clippy::derive_partial_eq_without_eq)]
512#[derive(Clone, PartialEq, ::prost::Message)]
513pub struct GetTransactionRequest {
514    #[prost(string, tag="1")]
515    pub signature: ::prost::alloc::string::String,
516    /// Commitment level for transaction retrieval
517    #[prost(enumeration="super::super::r#type::v1::CommitmentLevel", tag="2")]
518    pub commitment_level: i32,
519}
520#[allow(clippy::derive_partial_eq_without_eq)]
521#[derive(Clone, PartialEq, ::prost::Message)]
522pub struct GetTransactionResponse {
523    #[prost(message, optional, tag="1")]
524    pub transaction: ::core::option::Option<Transaction>,
525}
526/// Transaction monitoring messages
527#[allow(clippy::derive_partial_eq_without_eq)]
528#[derive(Clone, PartialEq, ::prost::Message)]
529pub struct MonitorTransactionRequest {
530    /// Transaction signature to monitor
531    #[prost(string, tag="1")]
532    pub signature: ::prost::alloc::string::String,
533    /// Target commitment level
534    #[prost(enumeration="super::super::r#type::v1::CommitmentLevel", tag="2")]
535    pub commitment_level: i32,
536    /// Include program execution logs
537    #[prost(bool, tag="3")]
538    pub include_logs: bool,
539    /// Monitor timeout (default: 60)
540    #[prost(uint32, tag="4")]
541    pub timeout_seconds: u32,
542}
543#[allow(clippy::derive_partial_eq_without_eq)]
544#[derive(Clone, PartialEq, ::prost::Message)]
545pub struct MonitorTransactionResponse {
546    /// Transaction signature being monitored
547    #[prost(string, tag="1")]
548    pub signature: ::prost::alloc::string::String,
549    /// Current transaction status
550    #[prost(enumeration="TransactionStatus", tag="2")]
551    pub status: i32,
552    /// Blockchain slot where transaction was processed
553    #[prost(uint64, tag="3")]
554    pub slot: u64,
555    /// Error details if transaction failed
556    #[prost(string, tag="4")]
557    pub error_message: ::prost::alloc::string::String,
558    /// Program execution logs (if requested)
559    #[prost(string, repeated, tag="5")]
560    pub logs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
561    /// Compute units consumed by transaction
562    #[prost(uint64, tag="6")]
563    pub compute_units_consumed: u64,
564    /// Current commitment level achieved
565    #[prost(enumeration="super::super::r#type::v1::CommitmentLevel", tag="7")]
566    pub current_commitment: i32,
567}
568#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
569#[repr(i32)]
570pub enum SubmissionResult {
571    Unspecified = 0,
572    /// Transaction successfully submitted to network
573    Submitted = 1,
574    /// Transaction failed pre-submission validation
575    FailedValidation = 2,
576    /// Network/RPC error prevented submission
577    FailedNetworkError = 3,
578    /// Fee payer has insufficient balance
579    FailedInsufficientFunds = 4,
580    /// Transaction signature validation failed
581    FailedInvalidSignature = 5,
582    /// NEW: State unknown - use structured_error for resolution
583    Indeterminate = 6,
584}
585impl SubmissionResult {
586    /// String value of the enum field names used in the ProtoBuf definition.
587    ///
588    /// The values are not transformed in any way and thus are considered stable
589    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
590    pub fn as_str_name(&self) -> &'static str {
591        match self {
592            SubmissionResult::Unspecified => "SUBMISSION_RESULT_UNSPECIFIED",
593            SubmissionResult::Submitted => "SUBMISSION_RESULT_SUBMITTED",
594            SubmissionResult::FailedValidation => "SUBMISSION_RESULT_FAILED_VALIDATION",
595            SubmissionResult::FailedNetworkError => "SUBMISSION_RESULT_FAILED_NETWORK_ERROR",
596            SubmissionResult::FailedInsufficientFunds => "SUBMISSION_RESULT_FAILED_INSUFFICIENT_FUNDS",
597            SubmissionResult::FailedInvalidSignature => "SUBMISSION_RESULT_FAILED_INVALID_SIGNATURE",
598            SubmissionResult::Indeterminate => "SUBMISSION_RESULT_INDETERMINATE",
599        }
600    }
601    /// Creates an enum from field names used in the ProtoBuf definition.
602    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
603        match value {
604            "SUBMISSION_RESULT_UNSPECIFIED" => Some(Self::Unspecified),
605            "SUBMISSION_RESULT_SUBMITTED" => Some(Self::Submitted),
606            "SUBMISSION_RESULT_FAILED_VALIDATION" => Some(Self::FailedValidation),
607            "SUBMISSION_RESULT_FAILED_NETWORK_ERROR" => Some(Self::FailedNetworkError),
608            "SUBMISSION_RESULT_FAILED_INSUFFICIENT_FUNDS" => Some(Self::FailedInsufficientFunds),
609            "SUBMISSION_RESULT_FAILED_INVALID_SIGNATURE" => Some(Self::FailedInvalidSignature),
610            "SUBMISSION_RESULT_INDETERMINATE" => Some(Self::Indeterminate),
611            _ => None,
612        }
613    }
614}
615#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
616#[repr(i32)]
617pub enum TransactionStatus {
618    Unspecified = 0,
619    /// Transaction received by validator
620    Received = 1,
621    /// Transaction processed (commitment: processed)
622    Processed = 2,
623    /// Transaction confirmed (commitment: confirmed)
624    Confirmed = 3,
625    /// Transaction finalized (commitment: finalized)
626    Finalized = 4,
627    /// Transaction failed during execution
628    Failed = 5,
629    /// Transaction dropped from network
630    Dropped = 6,
631    /// Monitoring timeout reached
632    Timeout = 7,
633}
634impl TransactionStatus {
635    /// String value of the enum field names used in the ProtoBuf definition.
636    ///
637    /// The values are not transformed in any way and thus are considered stable
638    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
639    pub fn as_str_name(&self) -> &'static str {
640        match self {
641            TransactionStatus::Unspecified => "TRANSACTION_STATUS_UNSPECIFIED",
642            TransactionStatus::Received => "TRANSACTION_STATUS_RECEIVED",
643            TransactionStatus::Processed => "TRANSACTION_STATUS_PROCESSED",
644            TransactionStatus::Confirmed => "TRANSACTION_STATUS_CONFIRMED",
645            TransactionStatus::Finalized => "TRANSACTION_STATUS_FINALIZED",
646            TransactionStatus::Failed => "TRANSACTION_STATUS_FAILED",
647            TransactionStatus::Dropped => "TRANSACTION_STATUS_DROPPED",
648            TransactionStatus::Timeout => "TRANSACTION_STATUS_TIMEOUT",
649        }
650    }
651    /// Creates an enum from field names used in the ProtoBuf definition.
652    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
653        match value {
654            "TRANSACTION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
655            "TRANSACTION_STATUS_RECEIVED" => Some(Self::Received),
656            "TRANSACTION_STATUS_PROCESSED" => Some(Self::Processed),
657            "TRANSACTION_STATUS_CONFIRMED" => Some(Self::Confirmed),
658            "TRANSACTION_STATUS_FINALIZED" => Some(Self::Finalized),
659            "TRANSACTION_STATUS_FAILED" => Some(Self::Failed),
660            "TRANSACTION_STATUS_DROPPED" => Some(Self::Dropped),
661            "TRANSACTION_STATUS_TIMEOUT" => Some(Self::Timeout),
662            _ => None,
663        }
664    }
665}
666include!("protochain.solana.transaction.v1.tonic.rs");
667// @@protoc_insertion_point(module)