v0.2.6-pre.017

This commit is contained in:
2026-08-22 09:39:13 +02:00
parent 5c0be421da
commit 362123f357
22 changed files with 896 additions and 109 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-wallet-lib/src/wallet.rs
// version: 9
// version: 10
//! In-memory native Wallet V1 create/open orchestration.
@@ -55,6 +55,21 @@ impl OwnerStateV1 {
return;
}
/// Reconstructs one short-lived Solana keypair copy for authenticated V1 -> V2 migration.
pub(crate) fn clone_solana_keypair_for_migration(&self) -> ksp_core_lib::Result<solana_keypair::Keypair> {
let keypair = match self.solana_keypair.as_ref() {
std::option::Option::Some(value) => value,
std::option::Option::None => return std::result::Result::Err(key_material_error()),
};
let mut bytes = keypair.to_bytes();
let cloned = solana_keypair::Keypair::try_from(bytes.as_slice());
bytes.zeroize();
return match cloned {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(_) => std::result::Result::Err(key_material_error()),
};
}
/// Executes the crate-internal export transfer operation for `OwnerStateV1`.
pub(crate) fn export_transfer(&self, format: crate::WalletTransferFormat) -> ksp_core_lib::Result<std::vec::Vec<u8>> {
let keypair = match self.solana_keypair.as_ref() {