diff --git a/Cargo.lock b/Cargo.lock index 9f5fcc89..8028925d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -395,9 +395,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.13" +version = "1.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" dependencies = [ "jobserver", "libc", @@ -2051,9 +2051,9 @@ dependencies = [ [[package]] name = "near-ledger" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2240ef10dc9f5a52e22df66cf68604dc574dabaf09e6fc9739e9ca1c2796a01d" +checksum = "b3399f41b5746672183d487ab2a652bb5205f6a2926f279c6440094c542c7337" dependencies = [ "borsh", "ed25519-dalek", @@ -2688,9 +2688,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -3159,9 +3159,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", "memchr", @@ -3546,9 +3546,9 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.6.0", "core-foundation", diff --git a/src/commands/account/add_key/use_ledger/mod.rs b/src/commands/account/add_key/use_ledger/mod.rs index 88ca2de9..00d70bb2 100644 --- a/src/commands/account/add_key/use_ledger/mod.rs +++ b/src/commands/account/add_key/use_ledger/mod.rs @@ -24,6 +24,13 @@ impl AddLedgerKeyActionContext { scope: &::InteractiveClapContextScope, ) -> color_eyre::eyre::Result { let seed_phrase_hd_path = scope.seed_phrase_hd_path.clone(); + eprintln!("Opening the NEAR application... Please approve opening the application"); + near_ledger::open_near_application().map_err(|ledger_error| { + color_eyre::Report::msg(format!("An error happened while trying to open the NEAR application on the ledger: {ledger_error:?}")) + })?; + + std::thread::sleep(std::time::Duration::from_secs(1)); + eprintln!( "Please allow getting the PublicKey on Ledger device (HD Path: {})", seed_phrase_hd_path diff --git a/src/commands/account/create_account/create_implicit_account/use_ledger.rs b/src/commands/account/create_account/create_implicit_account/use_ledger.rs index 587b495b..abc01492 100644 --- a/src/commands/account/create_account/create_implicit_account/use_ledger.rs +++ b/src/commands/account/create_account/create_implicit_account/use_ledger.rs @@ -26,6 +26,14 @@ impl SaveWithLedgerContext { std::sync::Arc::new({ let seed_phrase_hd_path = scope.seed_phrase_hd_path.clone(); move |folder_path| { + eprintln!( + "Opening the NEAR application... Please approve opening the application" + ); + near_ledger::open_near_application().map_err(|ledger_error| { + color_eyre::Report::msg(format!("An error happened while trying to open the NEAR application on the ledger: {ledger_error:?}")) + })?; + std::thread::sleep(std::time::Duration::from_secs(1)); + eprintln!( "Please allow getting the PublicKey on Ledger device (HD Path: {})", seed_phrase_hd_path diff --git a/src/commands/account/create_account/fund_myself_create_account/add_key/use_ledger/mod.rs b/src/commands/account/create_account/fund_myself_create_account/add_key/use_ledger/mod.rs index bdc966cc..d8163566 100644 --- a/src/commands/account/create_account/fund_myself_create_account/add_key/use_ledger/mod.rs +++ b/src/commands/account/create_account/fund_myself_create_account/add_key/use_ledger/mod.rs @@ -19,6 +19,13 @@ impl AddAccessWithLedgerContext { scope: &::InteractiveClapContextScope, ) -> color_eyre::eyre::Result { let seed_phrase_hd_path = scope.seed_phrase_hd_path.clone(); + eprintln!("Opening the NEAR application... Please approve opening the application"); + near_ledger::open_near_application().map_err(|ledger_error| { + color_eyre::Report::msg(format!("An error happened while trying to open the NEAR application on the ledger: {ledger_error:?}")) + })?; + + std::thread::sleep(std::time::Duration::from_secs(1)); + eprintln!( "Please allow getting the PublicKey on Ledger device (HD Path: {})", seed_phrase_hd_path diff --git a/src/commands/account/create_account/sponsor_by_faucet_service/add_key/use_ledger/mod.rs b/src/commands/account/create_account/sponsor_by_faucet_service/add_key/use_ledger/mod.rs index 03f08e6d..5064304a 100644 --- a/src/commands/account/create_account/sponsor_by_faucet_service/add_key/use_ledger/mod.rs +++ b/src/commands/account/create_account/sponsor_by_faucet_service/add_key/use_ledger/mod.rs @@ -18,6 +18,13 @@ impl AddAccessWithLedgerContext { previous_context: super::super::NewAccountContext, scope: &::InteractiveClapContextScope, ) -> color_eyre::eyre::Result { + eprintln!("Opening the NEAR application... Please approve opening the application"); + near_ledger::open_near_application().map_err(|ledger_error| { + color_eyre::Report::msg(format!("An error happened while trying to open the NEAR application on the ledger: {ledger_error:?}")) + })?; + + std::thread::sleep(std::time::Duration::from_secs(1)); + let seed_phrase_hd_path = scope.seed_phrase_hd_path.clone(); eprintln!( "Please allow getting the PublicKey on Ledger device (HD Path: {})", diff --git a/src/transaction_signature_options/sign_with_ledger/mod.rs b/src/transaction_signature_options/sign_with_ledger/mod.rs index cf6533a0..7be7943b 100644 --- a/src/transaction_signature_options/sign_with_ledger/mod.rs +++ b/src/transaction_signature_options/sign_with_ledger/mod.rs @@ -254,6 +254,15 @@ impl interactive_clap::FromCli for SignLedger { .clone() .expect("Unexpected error"); + eprintln!("Opening the NEAR application... Please approve opening the application"); + if let Err(err) = near_ledger::open_near_application().map_err(|ledger_error| { + color_eyre::Report::msg(format!("An error happened while trying to open the NEAR application on the ledger: {ledger_error:?}")) + }) { + return interactive_clap::ResultFromCli::Err(Some(clap_variant), err); + } + + std::thread::sleep(std::time::Duration::from_secs(1)); + eprintln!( "Please allow getting the PublicKey on Ledger device (HD Path: {})", seed_phrase_hd_path