Module utils

Source

Modules§

field_as_string

Structs§

EncryptedData
Encrypted data container that holds the nonce and ciphertext
FieldEncryption
Main encryption service for field-level encryption

Enums§

AddressDerivationError
DerError
EncryptionError
Secp256k1Error

Functions§

base64_decode
base64_encode
base64_url_decode
base64_url_encode
calculate_intrinsic_gas
Calculates the intrinsic gas for a given transaction
check_authorization_header
Checks if the authorization header in the request matches the expected API key.
decrypt_sensitive_field
Decrypts sensitive data from base64 format
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_pem
Derive Solana address from a PEM-encoded public key.
deserialize_option_secret_string
Helper function to deserialize optional secrets from encrypted base64 storage
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
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_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_connection
Initializes a Redis connection manager.
log_service_info
Logs service information at startup
minutes_ms
Converts minutes to milliseconds
recover_public_key
Recover v point from a signature and from the message contents
serialize_option_secret_string
Helper function to serialize optional secrets as encrypted base64 for storage
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_u128
serialize_u128_as_number
Serialize u128 as number (non-optional)
unsafe_generate_random_private_key