I have a sui keystore generated using sui client CLI. I found this: https://github.com/MystenLabs/sui/blob/3ea9adb/sdk/typescript/src/cryptography/ed25519-keypair.ts#L80
let secretKey = raw.slice(1);
let keypair = Ed25519Keypair.fromSecretKey(secretKey);
console.log(`keypair: ${keypair.getKeyScheme()}`)
console.log(`publicKey: ${keypair.getPublicKey().toSuiAddress()}`)
console.log(`privateKey: ${keypair.export().privateKey}`);
The console output looks like this:
keypair: ED25519
publicKey: 0xba84193***9ed
privateKey: L4tOBF****ZyPplG9s=
when I tried to create a new wallet in Sui Wallet by importing using the above private key, it failed with an invalid format.
It seems that the SDK provides the toSuiAddress API for the public key, but not for the private key.
Is it possible to use the Sui keystore to generate the private key usable in the Sui wallet? My end goal is to use the same admin wallet that publishes the package to test my contract in the sui explorer. The first time I generated the address I was not aware of the seed phrase shown in the console.