diff --git a/crates/chia-bls/src/secret_key.rs b/crates/chia-bls/src/secret_key.rs index 661719814..6e4384a51 100644 --- a/crates/chia-bls/src/secret_key.rs +++ b/crates/chia-bls/src/secret_key.rs @@ -270,6 +270,12 @@ impl SecretKey { pub fn py_derive_unhardened(&self, idx: u32) -> Self { self.derive_unhardened(idx) } + + #[pyo3(name = "from_seed")] + #[staticmethod] + pub fn py_from_seed(seed: &[u8]) -> Self { + Self::from_seed(seed) + } } #[cfg(feature = "py-bindings")] diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index e2632c1c9..8ae0938de 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -429,6 +429,8 @@ def __init__( "def public_key(self) -> G1Element: ...", "def derive_hardened(self, int) -> PrivateKey: ...", "def derive_unhardened(self, int) -> PrivateKey: ...", + "@staticmethod", + "def from_seed(bytes) -> PrivateKey: ...", ], ) diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index 661474b40..f1c815408 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -215,6 +215,8 @@ class PrivateKey: def public_key(self) -> G1Element: ... def derive_hardened(self, int) -> PrivateKey: ... def derive_unhardened(self, int) -> PrivateKey: ... + @staticmethod + def from_seed(bytes) -> PrivateKey: ... def __init__( self ) -> None: ...