xrpl/
constants.rs

1//! Collection of public constants for XRPL.
2
3use serde::{Deserialize, Serialize};
4use strum_macros::Display;
5use strum_macros::EnumIter;
6
7/// Regular expression for determining ISO currency codes.
8pub const ISO_CURRENCY_REGEX: &str = r"^[A-Z0-9]{3}$";
9/// Regular expression for determining hex currency codes.
10pub const HEX_CURRENCY_REGEX: &str = r"^[A-F0-9]{40}$";
11
12/// Length of an account id.
13pub const ACCOUNT_ID_LENGTH: usize = 20;
14
15pub const MAX_TICK_SIZE: u32 = 15;
16pub const MIN_TICK_SIZE: u32 = 3;
17pub const DISABLE_TICK_SIZE: u32 = 0;
18
19pub const MAX_TRANSFER_RATE: u32 = 2000000000;
20pub const MIN_TRANSFER_RATE: u32 = 1000000000;
21pub const SPECIAL_CASE_TRANFER_RATE: u32 = 0;
22
23pub const MAX_TRANSFER_FEE: u32 = 50000;
24pub const MAX_URI_LENGTH: usize = 512;
25
26pub const MAX_DOMAIN_LENGTH: usize = 256;
27
28/// Represents the supported cryptography algorithms.
29#[derive(Debug, PartialEq, Eq, Clone, EnumIter, Display, Deserialize, Serialize, Default)]
30#[serde(rename_all = "lowercase")]
31#[strum(serialize_all = "lowercase")]
32pub enum CryptoAlgorithm {
33    #[default]
34    ED25519,
35    SECP256K1,
36}