newbie here, so apologies if this is a stupid question.
I would like to use the functionality of the wagyu crate in my code. This crate has command line functionality, so I can run the code from the command line but I can't seem to reference it from my own code.
I've tried 2 options:
- Replicate the input 'clap' is expecting when calling the crate (a struct with arguments)
- Call a specific function from within the crate
For item 2 I have tried:
use wagyu::cli::ethereum;
fn main() {
let m: String = String::from("sunny story shrimp absent valid today film floor month measure fatigue pet");
// Returns the address of the corresponding mnemonic.
let passphrase = "";
let pathway = "m/44'/60'/0'/0";
let address = ethereum::from_mnemonic(m, passphrase, pathway);
println!("phrase: {:?}", address);
When I try to build this code I get the following compile error:
error[E0425]: cannot find function `from_mnemonic` in module `ethereum`
--> src\main.rs:37:29
|
37 | let address = ethereum::from_mnemonic::<>(s, passphrase, pathway);
| ^^^^^^^^^^^^^ not found in `ethereum`
But I know from checking the code in the ethereum.rs file that there is a public function called 'from_mnemonic' (defined on line 88).
Does anyone know why I can't call this function? Or alternatively, is there an easy way to use a crate that has a clap dependency without using the command line interface?
Many thanks.