• Creates a KeyPairSigner from a provided CryptoKeyPair.

    The MessagePartialSigner#signMessages | signMessages and TransactionPartialSigner#signTransactions | signTransactions functions of the returned signer will use the private key of the provided key pair to sign messages and transactions.

    Note that both the MessagePartialSigner#signMessages | signMessages and TransactionPartialSigner#signTransactions | signTransactions implementations are parallelized, meaning that they will sign all provided messages and transactions in parallel.

    Parameters

    • keyPair: CryptoKeyPair

    Returns Promise<KeyPairSigner>

    import { generateKeyPair } from '@solana/keys';
    import { createSignerFromKeyPair, KeyPairSigner } from '@solana/signers';

    const keyPair: CryptoKeyPair = await generateKeyPair();
    const signer: KeyPairSigner = await createSignerFromKeyPair(keyPair);