openzeppelin_relayer/constants/stellar_transaction.rs
1//! Constants for Stellar transaction processing.
2//!
3//! This module contains default values used throughout the Stellar transaction
4//! handling logic, including fees, retry delays, and timeout thresholds.
5
6use chrono::Duration;
7
8pub const STELLAR_DEFAULT_TRANSACTION_FEE: u32 = 100;
9/// Default maximum fee for fee-bump transactions (0.1 XLM = 1,000,000 stroops)
10pub const STELLAR_DEFAULT_MAX_FEE: i64 = 1_000_000;
11
12// Status check scheduling
13/// Initial delay before first status check (in seconds)
14/// Set to 2s for faster detection of transaction state changes
15pub const STELLAR_STATUS_CHECK_INITIAL_DELAY_SECONDS: i64 = 2;
16
17// Other delays
18/// Default delay (in seconds) for retrying transaction after bad sequence error
19pub const STELLAR_BAD_SEQUENCE_RETRY_DELAY_SECONDS: i64 = 2;
20
21/// Get status check initial delay duration
22pub fn get_stellar_status_check_initial_delay() -> Duration {
23 Duration::seconds(STELLAR_STATUS_CHECK_INITIAL_DELAY_SECONDS)
24}