gleeth/utils/validation

Values

pub fn validate_address(
  address: String,
) -> Result(String, types.GleethError)
pub fn validate_address_from_line(
  line: String,
) -> Result(String, types.GleethError)
pub fn validate_addresses(
  addresses: List(String),
) -> Result(List(String), types.GleethError)
pub fn validate_block_hash(
  hash: String,
) -> Result(String, types.GleethError)

Validate block hash

pub fn validate_call_data(
  data: String,
) -> Result(String, types.GleethError)

Validate contract call data

pub fn validate_chain_id(
  chain_id: Int,
) -> Result(Int, types.GleethError)

Validate chain ID (must be positive integer)

pub fn validate_hash(
  hash: String,
) -> Result(String, types.GleethError)
pub fn validate_hex_amount(
  amount: String,
) -> Result(String, types.GleethError)

Validate amount/value field (can be any valid hex number)

pub fn validate_hex_bytes(
  hex_string: String,
  expected_bytes: Int,
  description: String,
) -> Result(String, types.GleethError)

Validate hex string with specific byte length requirement

pub fn validate_non_empty(
  value: String,
  field_name: String,
) -> Result(String, types.GleethError)

Generic validator for non-empty strings

pub fn validate_private_key(
  private_key: String,
) -> Result(String, types.GleethError)

Validate private key format (32 bytes)

pub fn validate_public_key(
  public_key: String,
) -> Result(String, types.GleethError)

Validate public key format (33 or 65 bytes)

pub fn validate_signature(
  signature: String,
) -> Result(String, types.GleethError)

Validate signature format (65 bytes: r + s + v)

pub fn validate_transaction_hash(
  hash: String,
) -> Result(String, types.GleethError)

Validate Ethereum transaction hash

Search Document