Function: generateKeyPairSigner()
ts
function generateKeyPairSigner(
extractable?
): Promise<KeyPairSigner<string>>;Generates a signer capable of signing messages and transactions by generating a CryptoKeyPair and creating a KeyPairSigner from it.
Parameters
| Parameter | Type | Description |
|---|---|---|
extractable? | boolean | Setting this to true makes it possible to extract the bytes of the private key using the crypto.subtle.exportKey() API. Defaults to false, which prevents the bytes of the private key from being visible to JS. |
Returns
Promise<KeyPairSigner<string>>
Example
ts
import { generateKeyPairSigner } from '@solana/signers';
const signer = await generateKeyPairSigner();