Kit
Functions

fromLegacyKeypair

fromLegacyKeypair(keypair, extractable?): Promise<CryptoKeyPair>

Converts a legacy Keypair object to a native Ed25519 CryptoKeyPair object.

Parameters

ParameterType
keypairKeypair
extractable?boolean

Returns

Promise<CryptoKeyPair>

Example

import { fromLegacyKeypair } from '@solana/compat';
 
const legacyKeyPair = Keypair.generate();
const { privateKey, publicKey } = await fromLegacyKeypair(legacyKeyPair);

On this page