Function get_nep2_from_private_key

Source
pub fn get_nep2_from_private_key(
    pri_key: &str,
    passphrase: &str,
) -> Result<String, ProviderError>
Expand description

Compatibility functions to maintain backward compatibility with existing code These functions are provided for convenience and compatibility with the old API Encrypts a private key in hexadecimal format using NEP2.

§Arguments

  • pri_key - The private key in hexadecimal format
  • passphrase - The password to encrypt the key with

§Returns

A NEP2-formatted string containing the encrypted key, or an error if encryption fails