Type Alias KeyPairSigner<TAddress>

KeyPairSigner<TAddress>: MessagePartialSigner<TAddress> & TransactionPartialSigner<TAddress> & {
    keyPair: CryptoKeyPair;
}

Defines a signer that uses a CryptoKeyPair to sign messages and transactions.

It implements both the MessagePartialSigner and TransactionPartialSigner interfaces and keeps track of the CryptoKeyPair instance used to sign messages and transactions.

Type Parameters

  • TAddress extends string = string

    Supply a string literal to define a signer having a particular address.

import { generateKeyPairSigner } from '@solana/signers';

const signer = generateKeyPairSigner();
signer.address; // Address;
signer.keyPair; // CryptoKeyPair;
const [messageSignatures] = await signer.signMessages([message]);
const [transactionSignatures] = await signer.signTransactions([transaction]);