gleeth/commands/recover

Types

pub type OutputFormat {
  Compact
  Detailed
  Json
}

Constructors

  • Compact
  • Detailed
  • Json

Options for signature recovery command

pub type RecoverOptions {
  RecoverOptions(
    message: String,
    signature: String,
    recovery_mode: RecoveryMode,
    format: OutputFormat,
  )
}

Constructors

pub type RecoveryMode {
  RecoverPublicKey
  RecoverAddress
  RecoverCandidates
  VerifyAddress(expected: String)
}

Constructors

  • RecoverPublicKey
  • RecoverAddress
  • RecoverCandidates
  • VerifyAddress(expected: String)

Recovery result for output

pub type RecoveryResult {
  PublicKeyResult(public_key: String)
  AddressResult(address: String)
  CandidatesResult(
    public_keys: List(String),
    addresses: List(String),
    recovery_ids: List(Int),
  )
  VerificationResult(is_valid: Bool, recovered_address: String)
}

Constructors

  • PublicKeyResult(public_key: String)
  • AddressResult(address: String)
  • CandidatesResult(
      public_keys: List(String),
      addresses: List(String),
      recovery_ids: List(Int),
    )
  • VerificationResult(is_valid: Bool, recovered_address: String)

Values

pub fn default_options() -> RecoverOptions

Create recovery options with defaults

pub fn execute_recovery(
  options: RecoverOptions,
) -> Result(String, String)

Execute signature recovery with given options

pub fn parse_output_format(
  format_str: String,
) -> Result(OutputFormat, String)

Parse output format from string

pub fn parse_recovery_mode(
  mode_str: String,
) -> Result(RecoveryMode, String)

Parse recovery mode from string

pub fn print_usage() -> Nil

Print usage information

pub fn validate_options(
  options: RecoverOptions,
) -> Result(Nil, String)

Validate recovery options

Search Document