Kit
Type aliases

KeyPairSigner

KeyPairSigner<TAddress> = MessagePartialSigner<TAddress> & TransactionPartialSigner<TAddress> & object

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 declaration

NameType
keyPairCryptoKeyPair

Type Parameters

Type ParameterDefault typeDescription
TAddress extends stringstringSupply a string literal to define a signer having a particular address.

Example

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]);

See

On this page