Module utils Copy item path Source pub use aws_error::classify_sdk_error ;aws_error Helpers for diagnosing AWS SDK errors. field_as_string DistributedLock A distributed lock implementation using Redis SET NX EX pattern. EncryptedData Encrypted data container that holds the nonce and ciphertext EncryptionContext Provides task-local context for AAD during encryption/decryption operations. FieldEncryption Main encryption service for field-level encryption LockGuard A guard that represents an acquired distributed lock. RedisConnections Holds separate connection pools for read and write operations. AddressDerivationError DerError Ed25519Error EncryptionError EthereumJsonRpcError Ethereum-specific JSON-RPC error codes (EIP-1474) RedirectDecision Decision returned by evaluate_redirect_decision . Secp256k1Error StandardJsonRpcError Standard JSON-RPC 2.0 error codes BOOTSTRAP_LOCK_TTL_SECS Default lock TTL for bootstrap operations (2 minutes).
Used as a safety net for crashes during initialization or config processing. LOCK_POLL_INTERVAL_MS Polling interval when waiting for completion. LOCK_WAIT_MAX_SECS Max wait time when another instance holds the lock.
Set slightly longer than lock TTL to handle edge cases. base64_decode base64_encode base64_url_decode base64_url_encode calculate_intrinsic_gas Calculates the intrinsic gas for a given transaction calculate_scheduled_timestamp Calculates a future timestamp by adding delay seconds to the current time check_authorization_header Checks if the authorization header in the request matches the expected API key. create_secure_redirect_policy Creates a secure redirect policy that only allows HTTP to HTTPS upgrades on the same host. decrypt_sensitive_field Decrypts sensitive data from base64 format decrypt_sensitive_field_auto Decrypts sensitive data with automatic version detection derive_ethereum_address_from_der Derive EVM address from the DER payload. derive_ethereum_address_from_pem Derive EVM address from the PEM string. derive_solana_address_from_der Derive Solana address from DER/SPKI encoded Ed25519 public key.
Solana addresses are base58-encoded Ed25519 public keys. derive_solana_address_from_pem Derive Solana address from a PEM-encoded public key. derive_stellar_address_from_der Derive Stellar address from DER/SPKI encoded Ed25519 public key.
Stellar addresses use StrKey encoding (G prefix for public accounts). derive_stellar_address_from_pem Derive Stellar address from a PEM-encoded public key.
Stellar uses Ed25519 keys and addresses are encoded with StrKey format (G prefix for accounts). deserialize_i64 Deserialize a non-optional i64, accepting string, integer, or float JSON
forms. See the module docs for why all three forms must be tolerated. deserialize_option_secret_string Helper function to deserialize optional secrets from encrypted base64 storage. deserialize_optional_i64 Deserialize Option<i64>, accepting string, integer, or float JSON forms. deserialize_optional_u64 deserialize_optional_u128 deserialize_optional_u128_as_number Deserialize optional u128 from number deserialize_secret_string Helper function to deserialize secrets from encrypted base64 storage. deserialize_secret_vec Helper function to deserialize secrets from encrypted base64 storage. deserialize_u64 deserialize_u128 deserialize_u128_as_number Deserialize u128 from number (non-optional) encrypt_sensitive_field Encrypts sensitive data if encryption is configured, otherwise returns base64-encoded plaintext encrypt_sensitive_field_with_aad Encrypts sensitive data with AAD (Additional Authenticated Data) evaluate_redirect_decision Core redirect-policy decision. See create_secure_redirect_policy for the
security model. Pure function over url::Url so it can be shared between
reqwest::redirect::Policy::custom and the alloy-re-exported variant. extract_ed25519_public_key_from_der Extract raw 32-byte Ed25519 public key from DER/SPKI encoded format. extract_public_key_from_der Extract raw 64-byte key from DER encoded key. generate_encryption_key Utility function to generate a new encryption key generate_uuid Generate a new UUID. get_encryption Gets the global encryption instance get_evm_default_gas_limit_for_tx Gets the default gas limit for a given transaction get_relayer_last_sync Gets the last sync timestamp for a relayer. get_resubmit_timeout_for_speed Gets the resubmit timeout for a given speed
Returns the timeout in milliseconds based on the speed: get_resubmit_timeout_with_backoff Calculates the resubmit age with exponential backoff initialize_redis_connections Initializes Redis connection pools for both primary and reader endpoints. is_config_processing_completed Returns whether config processing has been explicitly marked as completed. is_config_processing_in_progress Returns whether config processing is explicitly marked as in progress. is_global_init_recently_completed Checks if global initialization was recently completed within the given threshold. is_relayer_recently_synced Checks if a relayer was recently synced within the given threshold. is_retriable_error_code Check if a JSON-RPC error code represents a retriable error. log_service_info Logs service information at startup map_provider_error Maps provider errors to appropriate JSON-RPC error codes and messages. mask_url Masks a URL by showing only the scheme and host, hiding the path and query parameters. minutes_ms Converts minutes to milliseconds poll_until Polls until a condition is met or timeout is reached. recover_public_key Recover v point from a signature and from the message contents recover_public_key_from_hash Recovers the v value from a signature for a pre-hashed message.
The hash parameter is already a 32-byte digest, not raw bytes. sanitize_error_description Sanitizes provider error descriptions to prevent exposing internal details. sanitize_url_for_error Sanitizes a URL for error messages by only showing scheme, host, and port serialize_i64 Serialize a non-optional i64 as a JSON string so it survives a Redis/Lua
cjson round-trip. serialize_option_secret_string Helper function to serialize optional secrets as encrypted base64 for storage. serialize_optional_i64 Serialize Option<i64> as a JSON string (or null) so it survives a
Redis/Lua cjson round-trip. serialize_optional_u128 serialize_optional_u128_as_number serialize_secret_string Helper function to serialize secrets as encrypted base64 for storage. serialize_secret_vec Helper function to serialize secrets as encrypted base64 for storage. serialize_u64 Serialize a u64 as a JSON string so it survives a Redis/Lua cjson
round-trip. serialize_u128 serialize_u128_as_number Serialize u128 as number (non-optional) set_config_processing_completed Marks config processing as completed. set_config_processing_in_progress Marks config processing as in progress. set_global_init_completed Sets the global initialization completion timestamp to the current time. set_relayer_last_sync Sets the last sync timestamp for a relayer to the current time. unsafe_generate_random_private_key validate_safe_url Validates an RPC URL against security policies